use of com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType in project midpoint by Evolveum.
the class AssignmentCollector method createAuthenticationLensContext.
private <AH extends AssignmentHolderType> LensContext<AH> createAuthenticationLensContext(PrismObject<AH> user, OperationResult result) throws SchemaException {
LensContext<AH> lensContext = new LensContextPlaceholder<>(user);
ArchetypePolicyType policyConfigurationType = determineObjectPolicyConfiguration(user, result);
lensContext.getFocusContext().setArchetypePolicy(policyConfigurationType);
return lensContext;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType in project midpoint by Evolveum.
the class AssignmentHolderDetailsModel method applyArchetypePolicy.
protected GuiObjectDetailsPageType applyArchetypePolicy(GuiObjectDetailsPageType defaultPageConfig) {
OperationResult result = new OperationResult("mergeArchetypeConfig");
PrismObject<AH> assignmentHolder = getPrismObject();
try {
ArchetypePolicyType archetypePolicyType = getModelServiceLocator().getModelInteractionService().determineArchetypePolicy(assignmentHolder, result);
return getAdminGuiConfigurationMergeManager().mergeObjectDetailsPageConfiguration(defaultPageConfig, archetypePolicyType, result);
} catch (SchemaException | ConfigurationException e) {
LOGGER.error("Cannot merge details page configuration from archetype policy, {}", e.getMessage(), e);
return defaultPageConfig;
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType in project midpoint by Evolveum.
the class PageArchetype method createMainPanel.
@Override
protected AbstractObjectMainPanel<ArchetypeType> createMainPanel(String id) {
return new AbstractRoleMainPanel<>(id, getObjectModel(), getProjectionModel(), this) {
private static final long serialVersionUID = 1L;
@Override
public AbstractRoleMemberPanel<ArchetypeType> createMemberPanel(String panelId, PageBase pageBase) {
return new ArchetypeMembersPanel(panelId, new Model<>(getObject().asObjectable()), pageBase);
}
@Override
protected List<ITab> createTabs(PageAdminObjectDetails<ArchetypeType> parentPage) {
List<ITab> tabs = super.createTabs(parentPage);
tabs.add(new PanelTab(parentPage.createStringResource("PageArchetype.archetypePolicy"), getTabVisibility(ComponentConstants.UI_ARCHTYPE_TAB_ARCHETYPE_POLICY_URL, false, parentPage)) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ContainerOfSystemConfigurationPanel<ArchetypePolicyType>(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ArchetypeType.F_ARCHETYPE_POLICY), ArchetypePolicyType.COMPLEX_TYPE);
}
});
return tabs;
}
};
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType in project midpoint by Evolveum.
the class SchemaTransformer method getVisibilityPolicy.
@NotNull
private <O extends ObjectType> List<VisibilityPolicyEntry> getVisibilityPolicy(ArchetypePolicyType archetypePolicy, Object contextDesc) throws SchemaException {
List<VisibilityPolicyEntry> visibilityPolicy = new ArrayList<>();
for (ItemConstraintType itemConstraint : archetypePolicy.getItemConstraint()) {
UserInterfaceElementVisibilityType visibility = itemConstraint.getVisibility();
if (visibility != null) {
ItemPathType itemPathType = itemConstraint.getPath();
if (itemPathType == null) {
throw new SchemaException("No 'path' in item definition in archetype policy for " + contextDesc);
}
UniformItemPath itemPath = prismContext.toUniformPath(itemPathType);
visibilityPolicy.add(new VisibilityPolicyEntry(itemPath, visibility));
}
}
return visibilityPolicy;
}
Aggregations