Search in sources :

Example 1 with PrismContainerWrapperModel

use of com.evolveum.midpoint.web.model.PrismContainerWrapperModel in project midpoint by Evolveum.

the class PageSystemConfiguration method getTabs.

// @Override
// protected void initializeModel(final PrismObject<SystemConfigurationType> configToEdit, boolean isNewObject, boolean isReadonly) {
// Task task = createSimpleTask(OPERATION_LOAD_SYSTEM_CONFIG);
// OperationResult result = new OperationResult(OPERATION_LOAD_SYSTEM_CONFIG);
// //        super.initializeModel(WebModelServiceUtils.loadSystemConfigurationAsPrismObject(this, task, result), false, isReadonly);
// }
private List<ITab> getTabs() {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.system.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new SystemConfigPanel(panelId, getObjectModel());
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.objectPolicy.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            PrismContainerWrapperModel<SystemConfigurationType, ObjectPolicyConfigurationType> model = createModel(getObjectModel(), SystemConfigurationType.F_DEFAULT_OBJECT_POLICY_CONFIGURATION);
            return new ObjectPolicyConfigurationTabPanel(panelId, model);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.globalPolicyRule.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            PrismContainerWrapperModel<SystemConfigurationType, GlobalPolicyRuleType> model = createModel(getObjectModel(), SystemConfigurationType.F_GLOBAL_POLICY_RULE);
            return new GlobalPolicyRuleTabPanel<>(panelId, model);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.globalAccountSynchronization.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_GLOBAL_ACCOUNT_SYNCHRONIZATION_SETTINGS, ProjectionPolicyType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.cleanupPolicy.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_CLEANUP_POLICY, CleanupPoliciesType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.notifications.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            PrismContainerWrapperModel<SystemConfigurationType, NotificationConfigurationType> model = createModel(getObjectModel(), SystemConfigurationType.F_NOTIFICATION_CONFIGURATION);
            return new NotificationConfigTabPanel(panelId, model);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.logging.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            PrismContainerWrapperModel<SystemConfigurationType, LoggingConfigurationType> model = createModel(getObjectModel(), SystemConfigurationType.F_LOGGING);
            return new LoggingConfigurationTabPanel(panelId, model);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.profiling.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            PrismContainerWrapperModel<SystemConfigurationType, ProfilingConfigurationType> profilingModel = createModel(getObjectModel(), SystemConfigurationType.F_PROFILING_CONFIGURATION);
            PrismContainerWrapperModel<SystemConfigurationType, LoggingConfigurationType> loggingModel = createModel(getObjectModel(), SystemConfigurationType.F_LOGGING);
            return new ProfilingConfigurationTabPanel(panelId, profilingModel, loggingModel);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.adminGui.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_ADMIN_GUI_CONFIGURATION, AdminGuiConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.workflow.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_WORKFLOW_CONFIGURATION, WfConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.roleManagement.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_ROLE_MANAGEMENT, RoleManagementConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.internals.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_INTERNALS, InternalsConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.deploymentInformation.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_DEPLOYMENT_INFORMATION, DeploymentInformationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.accessCertification.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_ACCESS_CERTIFICATION, AccessCertificationConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.infrastructure.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_INFRASTRUCTURE, InfrastructureConfigurationType.COMPLEX_TYPE);
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.fullTextSearch.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return createContainerPanel(panelId, getObjectModel(), SystemConfigurationType.F_FULL_TEXT_SEARCH, FullTextSearchConfigurationType.COMPLEX_TYPE);
        }
    });
    return tabs;
}
Also used : ObjectPolicyConfigurationTabPanel(com.evolveum.midpoint.gui.impl.page.admin.configuration.component.ObjectPolicyConfigurationTabPanel) ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) LoggingConfigurationTabPanel(com.evolveum.midpoint.gui.impl.page.admin.configuration.component.LoggingConfigurationTabPanel) NotificationConfigTabPanel(com.evolveum.midpoint.gui.impl.page.admin.configuration.component.NotificationConfigTabPanel) ProfilingConfigurationTabPanel(com.evolveum.midpoint.gui.impl.page.admin.configuration.component.ProfilingConfigurationTabPanel) SystemConfigPanel(com.evolveum.midpoint.gui.impl.page.admin.configuration.component.SystemConfigPanel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) PrismContainerWrapperModel(com.evolveum.midpoint.web.model.PrismContainerWrapperModel)

Example 2 with PrismContainerWrapperModel

use of com.evolveum.midpoint.web.model.PrismContainerWrapperModel in project midpoint by Evolveum.

the class ReportMainPanel method getTabs.

private List<ITab> getTabs(PageAdminObjectDetails<ReportType> parentPage) {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new PanelTab(parentPage.createStringResource("pageReport.basic.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new ObjectBasicPanel<ReportType>(panelId, getObjectModel()) {

                @Override
                protected QName getType() {
                    return ReportType.COMPLEX_TYPE;
                }

                @Override
                protected ItemVisibility getBasicTabVisibility(ItemWrapper<?, ?> itemWrapper) {
                    if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_LIFECYCLE_STATE)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_DIAGNOSTIC_INFORMATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_DEFAULT_SCRIPT_CONFIGURATION)) || itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ItemPath.EMPTY_PATH, ReportType.F_POST_REPORT_SCRIPT))) {
                        return ItemVisibility.HIDDEN;
                    }
                    return ItemVisibility.AUTO;
                }
            };
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("pageReport.engine.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new EngineReportTabPanel(panelId, getObjectModel());
        }

        @Override
        public boolean isVisible() {
            return hasDefinitionFor(ReportType.F_OBJECT_COLLECTION) || hasDefinitionFor(ReportType.F_DASHBOARD);
        }
    });
    tabs.addAll(createTabsForCollectionReports(parentPage));
    tabs.addAll(createTabsForDashboardReports(parentPage));
    tabs.add(new PanelTab(parentPage.createStringResource("pageReport.export.title")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            PrismContainerWrapperModel<ReportType, Containerable> model = PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ReportType.F_FILE_FORMAT);
            return new SingleContainerPanel(panelId, model, FileFormatConfigurationType.COMPLEX_TYPE) {

                @Override
                protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
                    if (itemWrapper.getPath().isSubPathOrEquivalent(ItemPath.create(ReportType.F_FILE_FORMAT, FileFormatConfigurationType.F_HTML))) {
                        return ItemVisibility.HIDDEN;
                    }
                    return ItemVisibility.AUTO;
                }
            };
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility) PrismContainerWrapperModel(com.evolveum.midpoint.web.model.PrismContainerWrapperModel)

Aggregations

PrismContainerWrapperModel (com.evolveum.midpoint.web.model.PrismContainerWrapperModel)2 ArrayList (java.util.ArrayList)2 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)1 LoggingConfigurationTabPanel (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.LoggingConfigurationTabPanel)1 NotificationConfigTabPanel (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.NotificationConfigTabPanel)1 ObjectPolicyConfigurationTabPanel (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.ObjectPolicyConfigurationTabPanel)1 ProfilingConfigurationTabPanel (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.ProfilingConfigurationTabPanel)1 SystemConfigPanel (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.SystemConfigPanel)1 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)1 ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)1 QName (javax.xml.namespace.QName)1 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)1