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;
}
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);
}
Aggregations