Search in sources :

Example 6 with AccessCertificationService

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());
}
Also used : Task(com.evolveum.midpoint.task.api.Task) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AccessCertificationService(com.evolveum.midpoint.model.api.AccessCertificationService) AccessCertificationCampaignType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType)

Example 7 with AccessCertificationService

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();
}
Also used : ObjectPaging(com.evolveum.midpoint.prism.query.ObjectPaging) Task(com.evolveum.midpoint.task.api.Task) SelectorOptions(com.evolveum.midpoint.schema.SelectorOptions) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) AccessCertificationService(com.evolveum.midpoint.model.api.AccessCertificationService) AccessCertificationWorkItemType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationWorkItemType)

Example 8 with AccessCertificationService

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());
}
Also used : Task(com.evolveum.midpoint.task.api.Task) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AccessCertificationService(com.evolveum.midpoint.model.api.AccessCertificationService) AccessCertificationCampaignType(com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType)

Example 9 with AccessCertificationService

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;
}
Also used : Task(com.evolveum.midpoint.task.api.Task) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) AccessCertificationService(com.evolveum.midpoint.model.api.AccessCertificationService)

Aggregations

AccessCertificationService (com.evolveum.midpoint.model.api.AccessCertificationService)9 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)9 Task (com.evolveum.midpoint.task.api.Task)9 AccessCertificationCampaignType (com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCampaignType)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)2 ObjectPaging (com.evolveum.midpoint.prism.query.ObjectPaging)1 SelectorOptions (com.evolveum.midpoint.schema.SelectorOptions)1 CertCampaignListItemDto (com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignListItemDto)1 AccessCertificationWorkItemType (com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationWorkItemType)1