use of com.evolveum.midpoint.model.api.AccessCertificationService in project midpoint by Evolveum.
the class PageCertCampaigns method closeCampaignConfirmedPerformed.
private void closeCampaignConfirmedPerformed(AjaxRequestTarget target, CertCampaignListItemDto campaignDto) {
AccessCertificationCampaignType campaign = campaignDto.getCampaign();
LOGGER.debug("Close certification campaign performed for {}", campaign.asPrismObject());
OperationResult result = new OperationResult(OPERATION_CLOSE_CAMPAIGN);
try {
AccessCertificationService acs = getCertificationService();
Task task = createSimpleTask(OPERATION_CLOSE_CAMPAIGN);
acs.closeCampaign(campaign.getOid(), task, result);
} catch (Exception ex) {
result.recordFatalError(ex);
} finally {
result.computeStatusIfUnknown();
}
WebComponentUtil.safeResultCleanup(result, LOGGER);
showResult(result);
target.add((Component) getCampaignsTable());
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.model.api.AccessCertificationService in project midpoint by Evolveum.
the class CertWorkItemDtoProvider method internalIterator.
@Override
public Iterator<CertWorkItemDto> internalIterator(long first, long count) {
LOGGER.trace("begin::iterator() from {} count {}.", first, count);
getAvailableData().clear();
OperationResult result = new OperationResult(OPERATION_SEARCH_OBJECTS);
try {
ObjectPaging paging = createPaging(first, count);
Task task = getPageBase().createSimpleTask(OPERATION_SEARCH_OBJECTS);
ObjectQuery caseQuery = getQuery();
caseQuery = caseQuery != null ? caseQuery.clone() : getPrismContext().queryFactory().createQuery();
caseQuery.setPaging(paging);
Collection<SelectorOptions<GetOperationOptions>> resolveNames = createCollection(createResolveNames());
AccessCertificationService acs = getPageBase().getCertificationService();
List<AccessCertificationWorkItemType> workitems = acs.searchOpenWorkItems(caseQuery, notDecidedOnly, allItems, resolveNames, task, result);
for (AccessCertificationWorkItemType workItem : workitems) {
getAvailableData().add(new CertWorkItemDto(workItem, getPageBase()));
}
} catch (Exception ex) {
result.recordFatalError(getPageBase().createStringResource("CertCaseDtoProvider.message.internalIterator.fatalError").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't list decisions", ex);
} finally {
result.computeStatusIfUnknown();
}
getPageBase().showResult(result, false);
LOGGER.trace("end::iterator()");
return getAvailableData().iterator();
}
use of com.evolveum.midpoint.model.api.AccessCertificationService in project midpoint by Evolveum.
the class PageCertCampaigns method closeStageConfirmedPerformed.
private void closeStageConfirmedPerformed(AjaxRequestTarget target, CertCampaignListItemDto campaignDto) {
AccessCertificationCampaignType campaign = campaignDto.getCampaign();
LOGGER.debug("Close certification stage performed for {}", campaign.asPrismObject());
OperationResult result = new OperationResult(OPERATION_CLOSE_STAGE);
try {
AccessCertificationService acs = getCertificationService();
Task task = createSimpleTask(OPERATION_CLOSE_STAGE);
acs.closeCurrentStage(campaign.getOid(), task, result);
} catch (Exception ex) {
result.recordFatalError(ex);
} finally {
result.computeStatusIfUnknown();
}
WebComponentUtil.safeResultCleanup(result, LOGGER);
showResult(result);
target.add((Component) getCampaignsTable());
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.model.api.AccessCertificationService in project midpoint by Evolveum.
the class CertWorkItemDtoProvider method internalSize.
@Override
protected int internalSize() {
LOGGER.trace("begin::internalSize()");
int count = 0;
OperationResult result = new OperationResult(OPERATION_COUNT_OBJECTS);
try {
Task task = getPageBase().createSimpleTask(OPERATION_COUNT_OBJECTS);
AccessCertificationService acs = getPageBase().getCertificationService();
ObjectQuery query = getQuery().clone();
count = acs.countOpenWorkItems(query, notDecidedOnly, allItems, null, task, result);
} catch (Exception ex) {
result.recordFatalError(getPageBase().createStringResource("CertWorkItemDtoProvider.message.internalSize.fatalError", ex.getMessage()).getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects: " + ex.getMessage(), ex);
} finally {
result.computeStatusIfUnknown();
}
getPageBase().showResult(result, false);
LOGGER.trace("end::internalSize()");
return count;
}
Aggregations