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