Search in sources :

Example 1 with RExclusion

use of com.evolveum.midpoint.repo.sql.data.common.container.RExclusion in project midpoint by Evolveum.

the class RAbstractRole method copyFromJAXB.

public static <T extends AbstractRoleType> void copyFromJAXB(AbstractRoleType jaxb, RAbstractRole<T> repo, RepositoryContext repositoryContext, IdGeneratorResult generatorResult) throws DtoTranslationException {
    RFocus.copyFromJAXB(jaxb, repo, repositoryContext, generatorResult);
    repo.setRequestable(jaxb.isRequestable());
    repo.setDisplayName(RPolyString.copyFromJAXB(jaxb.getDisplayName()));
    repo.setIdentifier(jaxb.getIdentifier());
    repo.setRiskLevel(jaxb.getRiskLevel());
    for (AssignmentType inducement : jaxb.getInducement()) {
        RAssignment rInducement = new RAssignment(repo, RAssignmentOwner.ABSTRACT_ROLE);
        RAssignment.copyFromJAXB(inducement, rInducement, jaxb, repositoryContext, generatorResult);
        repo.getAssignments().add(rInducement);
    }
    for (ExclusionPolicyConstraintType exclusion : jaxb.getExclusion()) {
        RExclusion rExclusion = new RExclusion(repo);
        RExclusion.copyFromJAXB(exclusion, rExclusion, jaxb, repositoryContext, generatorResult);
        repo.getExclusion().add(rExclusion);
    }
    for (ObjectReferenceType approverRef : jaxb.getApproverRef()) {
        RObjectReference ref = RUtil.jaxbRefToRepo(approverRef, repositoryContext.prismContext, repo, RReferenceOwner.ROLE_APPROVER);
        if (ref != null) {
            repo.getApproverRef().add(ref);
        }
    }
    //PrismObjectDefinition<AbstractRoleType> roleDefinition = jaxb.asPrismObject().getDefinition();
    repo.setApprovalProcess(jaxb.getApprovalProcess());
    repo.setOwnerRef(RUtil.jaxbRefToEmbeddedRepoRef(jaxb.getOwnerRef(), repositoryContext.prismContext));
}
Also used : RAssignment(com.evolveum.midpoint.repo.sql.data.common.container.RAssignment) ExclusionPolicyConstraintType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExclusionPolicyConstraintType) ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType) RExclusion(com.evolveum.midpoint.repo.sql.data.common.container.RExclusion)

Aggregations

RAssignment (com.evolveum.midpoint.repo.sql.data.common.container.RAssignment)1 RExclusion (com.evolveum.midpoint.repo.sql.data.common.container.RExclusion)1 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)1 ExclusionPolicyConstraintType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExclusionPolicyConstraintType)1 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)1