use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignDto in project midpoint by Evolveum.
the class PageCertCampaign method loadCampaign.
@NotNull
private CertCampaignDto loadCampaign() {
// todo
Task task = createSimpleTask("dummy");
OperationResult result = task.getResult();
AccessCertificationCampaignType campaign = null;
try {
PrismObject<AccessCertificationCampaignType> campaignObject = WebModelServiceUtils.loadObject(AccessCertificationCampaignType.class, campaignOid, PageCertCampaign.this, task, result);
if (campaignObject != null) {
campaign = campaignObject.asObjectable();
}
result.recordSuccessIfUnknown();
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get campaign", ex);
result.recordFatalError("Couldn't get campaign.", ex);
}
result.recomputeStatus();
if (!WebComponentUtil.isSuccessOrHandledError(result)) {
showResult(result);
}
if (campaign != null) {
return new CertCampaignDto(campaign, this, task, result);
} else {
throw redirectBackViaRestartResponseException();
}
}
use of com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignDto in project midpoint by Evolveum.
the class PageCertCampaign method initBasicInfoLayout.
private void initBasicInfoLayout(Form mainForm) {
mainForm.add(new Label(ID_CAMPAIGN_NAME, new PropertyModel<>(campaignModel, CertCampaignDto.F_NAME)));
mainForm.add(new Label(ID_CAMPAIGN_DESCRIPTION, new PropertyModel<>(campaignModel, CertCampaignDto.F_DESCRIPTION)));
mainForm.add(new Label(ID_CAMPAIGN_OWNER, new PropertyModel<>(campaignModel, CertCampaignDto.F_OWNER_NAME)));
mainForm.add(new Label(ID_CAMPAIGN_NUMBER_OF_STAGES, new PropertyModel<>(campaignModel, CertCampaignDto.F_NUMBER_OF_STAGES)));
mainForm.add(new Label(ID_CAMPAIGN_CURRENT_STATE, new PropertyModel<>(campaignModel, CertCampaignDto.F_CURRENT_STATE)));
mainForm.add(new Label(ID_CAMPAIGN_TIME, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
CertCampaignDto dto = campaignModel.getObject();
return formatDuration(dto.getCampaignStart(), dto.getCampaignEnd());
}
}));
mainForm.add(new Label(ID_STAGE_TIME, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
CertCampaignDto dto = campaignModel.getObject();
return formatStageDuration(dto.getStageStart(), dto.getStageDeadline(), dto.getStageEnd());
}
}));
WebMarkupContainer escalationLevelInfoContainer = new WebMarkupContainer(ID_ESCALATION_LEVEL_INFO_CONTAINER);
mainForm.add(escalationLevelInfoContainer);
escalationLevelInfoContainer.add(new Label(ID_ESCALATION_LEVEL_INFO, new PropertyModel<String>(campaignModel, CertCampaignDto.F_ESCALATION_LEVEL_INFO)));
escalationLevelInfoContainer.add(new VisibleBehaviour(() -> campaignModel.getObject().getEscalationLevelInfo() != null));
}
Aggregations