コード例 #1
0
  public CertDefinitionDto(
      AccessCertificationDefinitionType definition, OperationResult result, PageBase page) {
    this.definition = definition;
    ownerName = CertCampaignDto.resolveOwnerName(definition.getOwnerRef(), result, page);

    try {
      xml =
          page.getPrismContext()
              .serializeObjectToString(definition.asPrismObject(), PrismContext.LANG_XML);
    } catch (SchemaException e) {
      throw new SystemException("Couldn't serialize campaign definition to XML", e);
    }
  }
コード例 #2
0
  private void deleteDefinitionPerformed(
      AjaxRequestTarget target, AccessCertificationDefinitionType definition) {
    OperationResult result = new OperationResult(OPERATION_DELETE_DEFINITION);
    try {
      Task task = createSimpleTask(OPERATION_DELETE_DEFINITION);
      ObjectDelta<AccessCertificationDefinitionType> delta =
          ObjectDelta.createDeleteDelta(
              AccessCertificationDefinitionType.class, definition.getOid(), getPrismContext());
      getModelService()
          .executeChanges(WebComponentUtil.createDeltaCollection(delta), null, task, result);
    } catch (Exception ex) {
      result.recordPartialError("Couldn't delete campaign definition.", ex);
      LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete campaign definition", ex);
    }

    result.computeStatusIfUnknown();
    if (result.isSuccess()) {
      result.recordStatus(
          OperationResultStatus.SUCCESS, "The definition has been successfully deleted.");
    }

    getDefinitionsTable().clearCache();

    showResult(result);
    target.add(getFeedbackPanel(), getDefinitionsTable());
  }
コード例 #3
0
  private void createCampaignPerformed(
      AjaxRequestTarget target, AccessCertificationDefinitionType definition) {
    LOGGER.debug("Create certification campaign performed for {}", definition.asPrismObject());

    OperationResult result = new OperationResult(OPERATION_CREATE_CAMPAIGN);
    try {
      Task task = createSimpleTask(OPERATION_CREATE_CAMPAIGN);
      getCertificationService().createCampaign(definition.getOid(), task, result);
    } catch (Exception ex) {
      result.recordFatalError(ex);
    } finally {
      result.computeStatusIfUnknown();
    }

    showResult(result);
    target.add(getFeedbackPanel());
  }
コード例 #4
0
 private void showCampaignsPerformed(
     AjaxRequestTarget target, AccessCertificationDefinitionType definition) {
   PageParameters parameters = new PageParameters();
   parameters.add(OnePageParameterEncoder.PARAMETER, definition.getOid());
   navigateToNext(PageCertCampaigns.class, parameters);
 }
コード例 #5
0
 protected void detailsPerformed(
     AjaxRequestTarget target, AccessCertificationDefinitionType service) {
   PageParameters parameters = new PageParameters();
   parameters.add(OnePageParameterEncoder.PARAMETER, service.getOid());
   navigateToNext(PageCertDefinition.class, parameters);
 }
コード例 #6
0
 public int getNumberOfStages() {
   return definition.getStageDefinition().size();
 }
コード例 #7
0
 public String getDescription() {
   return definition.getDescription();
 }