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);
    }
  }
  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());
  }
  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());
  }
 private void showCampaignsPerformed(
     AjaxRequestTarget target, AccessCertificationDefinitionType definition) {
   PageParameters parameters = new PageParameters();
   parameters.add(OnePageParameterEncoder.PARAMETER, definition.getOid());
   navigateToNext(PageCertCampaigns.class, parameters);
 }
 protected void detailsPerformed(
     AjaxRequestTarget target, AccessCertificationDefinitionType service) {
   PageParameters parameters = new PageParameters();
   parameters.add(OnePageParameterEncoder.PARAMETER, service.getOid());
   navigateToNext(PageCertDefinition.class, parameters);
 }
 public int getNumberOfStages() {
   return definition.getStageDefinition().size();
 }
 public String getDescription() {
   return definition.getDescription();
 }