Search in sources :

Example 1 with GuiObjectDetailsPageType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType in project midpoint by Evolveum.

the class PageBaseSystemConfiguration method createObjectDetailsModels.

@Override
protected AssignmentHolderDetailsModel<SystemConfigurationType> createObjectDetailsModels(PrismObject<SystemConfigurationType> object) {
    return new AssignmentHolderDetailsModel<>(createPrismObjectModel(object), this) {

        @Override
        protected GuiObjectDetailsPageType loadDetailsPageConfiguration(PrismObject<SystemConfigurationType> assignmentHolder) {
            CompiledGuiProfile profile = getModelServiceLocator().getCompiledGuiProfile();
            try {
                GuiObjectDetailsPageType defaultPageConfig = null;
                for (Class<? extends Containerable> clazz : getAllDetailsTypes()) {
                    QName type = GuiImplUtil.getContainerableTypeName(clazz);
                    if (defaultPageConfig == null) {
                        defaultPageConfig = profile.findObjectDetailsConfiguration(type);
                    } else {
                        GuiObjectDetailsPageType anotherConfig = profile.findObjectDetailsConfiguration(type);
                        defaultPageConfig = getModelServiceLocator().getAdminGuiConfigurationMergeManager().mergeObjectDetailsPageConfiguration(defaultPageConfig, anotherConfig);
                    }
                }
                return applyArchetypePolicy(defaultPageConfig);
            } catch (Exception ex) {
                LOGGER.error("Couldn't create default gui object details page and apply archetype policy", ex);
            }
            return null;
        }
    };
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) GuiObjectDetailsPageType(com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType) QName(javax.xml.namespace.QName) AssignmentHolderDetailsModel(com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel) CompiledGuiProfile(com.evolveum.midpoint.model.api.authentication.CompiledGuiProfile)

Example 2 with GuiObjectDetailsPageType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType 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;
    }
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ConfigurationException(com.evolveum.midpoint.util.exception.ConfigurationException) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ArchetypePolicyType(com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType)

Example 3 with GuiObjectDetailsPageType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType in project midpoint by Evolveum.

the class ArchetypeAdminGuiConfigurationAsserter method objectDetails.

public GuiObjectDetailsPageAsserter<ArchetypeAdminGuiConfigurationAsserter<RA>> objectDetails() {
    Assertions.assertThat(archetypeAdminGuiConfig).isNotNull();
    GuiObjectDetailsPageType details = archetypeAdminGuiConfig.getObjectDetails();
    return new GuiObjectDetailsPageAsserter<>(details, this, "from archetype admin gui " + archetypeAdminGuiConfig);
}
Also used : GuiObjectDetailsPageType(com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType)

Aggregations

GuiObjectDetailsPageType (com.evolveum.midpoint.xml.ns._public.common.common_3.GuiObjectDetailsPageType)2 AssignmentHolderDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel)1 CompiledGuiProfile (com.evolveum.midpoint.model.api.authentication.CompiledGuiProfile)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 ConfigurationException (com.evolveum.midpoint.util.exception.ConfigurationException)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 ArchetypePolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.ArchetypePolicyType)1 QName (javax.xml.namespace.QName)1