Search in sources :

Example 1 with PageAssignmentHolderDetails

use of com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails in project midpoint by Evolveum.

the class MultivalueContainerListPanel method getFocusObject.

public <AH extends AssignmentHolderType> PrismObject<AH> getFocusObject() {
    AssignmentHolderTypeMainPanel mainPanel = findParent(AssignmentHolderTypeMainPanel.class);
    if (mainPanel != null) {
        return mainPanel.getObjectWrapper().getObject();
    }
    PageBase pageBase = getPageBase();
    if (pageBase != null && pageBase instanceof PageAssignmentHolderDetails) {
        PageAssignmentHolderDetails pageAssignmentHolderDetails = (PageAssignmentHolderDetails) pageBase;
        return (PrismObject<AH>) pageAssignmentHolderDetails.getPrismObject();
    }
    return null;
}
Also used : AssignmentHolderTypeMainPanel(com.evolveum.midpoint.web.component.objectdetails.AssignmentHolderTypeMainPanel) PrismObject(com.evolveum.midpoint.prism.PrismObject) PageAssignmentHolderDetails(com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 2 with PageAssignmentHolderDetails

use of com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails in project midpoint by Evolveum.

the class DirectAndIndirectAssignmentPanel method loadEvaluatedAssignments.

private List<PrismContainerValueWrapper<AssignmentType>> loadEvaluatedAssignments(IModel<PrismContainerWrapper<AssignmentType>> parent) throws SchemaException, ExpressionEvaluationException, CommunicationException, SecurityViolationException, ConfigurationException, ObjectNotFoundException, PolicyViolationException, ObjectAlreadyExistsException {
    if (!(getPageBase() instanceof PageAssignmentHolderDetails)) {
        return parent.getObject().getValues();
    }
    Task task = getPageBase().createSimpleTask(OPERATION_RECOMPUTE_ASSIGNMENTS);
    OperationResult result = new OperationResult(OPERATION_RECOMPUTE_ASSIGNMENTS);
    Set<AssignmentValueWrapper> assignmentValueWrapperSet = new LinkedHashSet<>();
    ObjectDelta<AH> delta = getObjectDelta(result);
    ModelContext<AH> modelContext = getPageBase().getModelInteractionService().previewChanges(Collections.singleton(delta), createPreviewAssignmentsOptions(), task, result);
    Collection<? extends EvaluatedAssignment<?>> evaluatedAssignments = modelContext.getNonNegativeEvaluatedAssignments();
    for (EvaluatedAssignment<?> evaluatedAssignment : evaluatedAssignments) {
        if (!evaluatedAssignment.isValid()) {
            continue;
        }
        collectRoleAndOrgs(evaluatedAssignment, parent, assignmentValueWrapperSet);
        collectResources(evaluatedAssignment, parent, assignmentValueWrapperSet, task, result);
    }
    return new ArrayList<>(assignmentValueWrapperSet);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) AssignmentValueWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.AssignmentValueWrapper) PageAssignmentHolderDetails(com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Aggregations

PageAssignmentHolderDetails (com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 AssignmentValueWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.AssignmentValueWrapper)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 AssignmentHolderTypeMainPanel (com.evolveum.midpoint.web.component.objectdetails.AssignmentHolderTypeMainPanel)1