Search in sources :

Example 1 with AssignmentCandidatesSpecification

use of com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification in project midpoint by Evolveum.

the class AssignmentPopup method loadAssignmentHolderSpecification.

private AssignmentCandidatesSpecification loadAssignmentHolderSpecification() {
    OperationResult result = new OperationResult(OPERATION_LOAD_ASSIGNMENT_HOLDER_SPECIFICATION);
    PrismObject obj = getFocusObject();
    AssignmentCandidatesSpecification spec = null;
    try {
        spec = getPageBase().getModelInteractionService().determineAssignmentHolderSpecification(obj, result);
    } catch (SchemaException | ConfigurationException ex) {
        result.recordPartialError(ex.getLocalizedMessage());
        LOGGER.error("Couldn't load assignment holder specification for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
    }
    return spec;
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AssignmentCandidatesSpecification(com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification)

Example 2 with AssignmentCandidatesSpecification

use of com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification in project midpoint by Evolveum.

the class AssignmentPanel method loadAssignmentTargetRelationsList.

@NotNull
private <AH extends AssignmentHolderType> List<AssignmentObjectRelation> loadAssignmentTargetRelationsList() {
    OperationResult result = new OperationResult(OPERATION_LOAD_ASSIGNMENT_TARGET_RELATIONS);
    List<AssignmentObjectRelation> assignmentTargetRelations = new ArrayList<>();
    PrismObject<AH> obj = getMultivalueContainerListPanel().getFocusObject();
    try {
        AssignmentCandidatesSpecification spec = getPageBase().getModelInteractionService().determineAssignmentTargetSpecification(obj, result);
        assignmentTargetRelations = spec != null ? spec.getAssignmentObjectRelations() : new ArrayList<>();
    } catch (SchemaException | ConfigurationException ex) {
        result.recordPartialError(ex.getLocalizedMessage());
        LOGGER.error("Couldn't load assignment target specification for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
    }
    return assignmentTargetRelations;
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AssignmentCandidatesSpecification(com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with AssignmentCandidatesSpecification

use of com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method loadCandidateSpecification.

private AssignmentCandidatesSpecification loadCandidateSpecification() {
    OperationResult result = new OperationResult(OPERATION_LOAD_MEMBER_RELATIONS);
    PrismObject<? extends AbstractRoleType> obj = getModelObject().asPrismObject();
    AssignmentCandidatesSpecification spec = null;
    try {
        spec = getPageBase().getModelInteractionService().determineAssignmentHolderSpecification(obj, result);
    } catch (Throwable ex) {
        result.recordPartialError(ex.getLocalizedMessage());
        LOGGER.error("Couldn't load member relations list for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
    }
    return spec;
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AssignmentCandidatesSpecification(com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification)

Example 4 with AssignmentCandidatesSpecification

use of com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method loadCandidateSpecification.

private AssignmentCandidatesSpecification loadCandidateSpecification() {
    OperationResult result = new OperationResult(OPERATION_LOAD_MEMBER_RELATIONS);
    PrismObject<? extends AbstractRoleType> obj = getModelObject().asPrismObject();
    AssignmentCandidatesSpecification spec = null;
    try {
        spec = getPageBase().getModelInteractionService().determineAssignmentHolderSpecification(obj, result);
    } catch (Throwable ex) {
        result.recordPartialError(ex.getLocalizedMessage());
        LOGGER.error("Couldn't load member relations list for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
    }
    return spec;
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AssignmentCandidatesSpecification(com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification)

Example 5 with AssignmentCandidatesSpecification

use of com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification in project midpoint by Evolveum.

the class AbstractAssignmentPanel method loadAssignmentTargetRelationsList.

@NotNull
private <AH extends AssignmentHolderType> List<AssignmentObjectRelation> loadAssignmentTargetRelationsList() {
    OperationResult result = new OperationResult(OPERATION_LOAD_ASSIGNMENT_TARGET_RELATIONS);
    List<AssignmentObjectRelation> assignmentTargetRelations = new ArrayList<>();
    PrismObject<AH> obj = getFocusObject();
    try {
        AssignmentCandidatesSpecification spec = getPageBase().getModelInteractionService().determineAssignmentTargetSpecification(obj, result);
        assignmentTargetRelations = spec != null ? spec.getAssignmentObjectRelations() : new ArrayList<>();
    } catch (SchemaException | ConfigurationException ex) {
        result.recordPartialError(ex.getLocalizedMessage());
        LOGGER.error("Couldn't load assignment target specification for the object {} , {}", obj.getName(), ex.getLocalizedMessage());
    }
    return assignmentTargetRelations;
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AssignmentCandidatesSpecification(com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

AssignmentCandidatesSpecification (com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification)6 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)6 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)2 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2