Search in sources :

Example 16 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel in project midpoint by Evolveum.

the class ReportMainPanel method createTabsForCollectionReports.

private List<ITab> createTabsForCollectionReports(PageAdminObjectDetails<ReportType> parentPage) {
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.collection")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return new SingleContainerPanel(panelId, PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_COLLECTION)), GuiObjectListViewType.COMPLEX_TYPE);
        }

        @Override
        public boolean isVisible() {
            return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_COLLECTION));
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.view")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            RepeatingView panel = new RepeatingView(panelId);
            PrismPropertyWrapperModel<ReportType, Object> propertyModel = PrismPropertyWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW, GuiObjectListViewType.F_TYPE));
            try {
                Panel propertyPanel = parentPage.initItemPanel(panel.newChildId(), propertyModel.getObject().getTypeName(), propertyModel, null);
                panel.add(propertyPanel);
            } catch (SchemaException e) {
                LOGGER.error("Couldn't create panel for type element in view");
            }
            panel.add(createObjectListForColumns(panel.newChildId(), parentPage));
            return panel;
        }

        @Override
        public boolean isVisible() {
            return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW));
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.parameter")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createObjectListForParameters(panelId, parentPage);
        }

        @Override
        public boolean isVisible() {
            return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_PARAMETER));
        }
    });
    tabs.add(new PanelTab(parentPage.createStringResource("ObjectCollectionReportEngineConfigurationType.subreport")) {

        @Override
        public WebMarkupContainer createPanel(String panelId) {
            return createObjectListForSubreports(panelId, parentPage);
        }

        @Override
        public boolean isVisible() {
            return hasDefinitionFor(ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_SUBREPORT));
        }
    });
    return tabs;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) ObjectBasicPanel(com.evolveum.midpoint.web.component.ObjectBasicPanel) MultivalueContainerDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel) DisplayNamePanel(com.evolveum.midpoint.gui.api.component.DisplayNamePanel) AbstractObjectMainPanel(com.evolveum.midpoint.web.component.objectdetails.AbstractObjectMainPanel) BasicMultivalueContainerListPanel(com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel) Panel(org.apache.wicket.markup.html.panel.Panel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ArrayList(java.util.ArrayList) RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) PrismPropertyWrapperModel(com.evolveum.midpoint.web.model.PrismPropertyWrapperModel) 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)

Example 17 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel in project midpoint by Evolveum.

the class EngineReportTabPanel method initLayout.

@Override
protected void initLayout() {
    RepeatingView panel = new RepeatingView(ID_PANEL);
    add(panel);
    if (hasDefinition(ReportType.F_DASHBOARD)) {
        panel.add(new SingleContainerPanel(panel.newChildId(), PrismContainerWrapperModel.fromContainerWrapper(getModel(), ItemPath.create(ReportType.F_DASHBOARD)), DashboardReportEngineConfigurationType.COMPLEX_TYPE) {

            @Override
            protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
                if (!ItemPath.create(ReportType.F_DASHBOARD, DashboardReportEngineConfigurationType.F_DASHBOARD_REF).equivalent(itemWrapper.getPath()) && !ItemPath.create(ReportType.F_DASHBOARD, DashboardReportEngineConfigurationType.F_SHOW_ONLY_WIDGETS_TABLE).equivalent(itemWrapper.getPath())) {
                    return ItemVisibility.HIDDEN;
                }
                return super.getVisibility(itemWrapper);
            }
        });
    }
    if (hasDefinition(ReportType.F_OBJECT_COLLECTION)) {
        panel.add(new SingleContainerPanel(panel.newChildId(), PrismContainerWrapperModel.fromContainerWrapper(getModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION)), ObjectCollectionReportEngineConfigurationType.COMPLEX_TYPE) {

            @Override
            protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
                if (!ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_CONDITION).equivalent(itemWrapper.getPath()) && !ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_USE_ONLY_REPORT_VIEW).equivalent(itemWrapper.getPath())) {
                    return ItemVisibility.HIDDEN;
                }
                return super.getVisibility(itemWrapper);
            }
        });
    }
}
Also used : RepeatingView(org.apache.wicket.markup.repeater.RepeatingView) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)

Example 18 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel in project midpoint by Evolveum.

the class TaskWorkPanel method initLayout.

@Override
protected void initLayout() {
    SingleContainerPanel activityDefinitionPanel = new SingleContainerPanel(ID_MAIN_PANEL, getObjectWrapperModel(), getPanelConfiguration());
    add(activityDefinitionPanel);
}
Also used : SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)

Example 19 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel in project midpoint by Evolveum.

the class TaskBasicPanel method initLayout.

protected void initLayout() {
    SingleContainerPanel mainPanel = new SingleContainerPanel(ID_MAIN_PANEL, getObjectWrapperModel(), getPanelConfiguration()) {

        @Override
        protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
            return getBasicTabVisibility(itemWrapper.getPath());
        }

        @Override
        protected ItemEditabilityHandler getEditabilityHandler() {
            return wrapper -> getBasicTabEditability(wrapper.getPath());
        }

        @Override
        protected IModel<PrismContainerWrapper> createVirtualContainerModel(VirtualContainersSpecificationType virtualContainer) {
            if (isDeprecatedVirtualContainer(virtualContainer)) {
                return null;
            }
            return super.createVirtualContainerModel(virtualContainer);
        }
    };
    add(mainPanel);
}
Also used : ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) AbstractObjectMainPanel(com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) PanelDisplay(com.evolveum.midpoint.web.application.PanelDisplay) Arrays(java.util.Arrays) ItemEditabilityHandler(com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler) PanelType(com.evolveum.midpoint.web.application.PanelType) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) Collection(java.util.Collection) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType) Component(org.apache.wicket.Component) WebComponentUtil(com.evolveum.midpoint.gui.api.util.WebComponentUtil) ItemVisibility(com.evolveum.midpoint.web.component.prism.ItemVisibility) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) TaskDetailsModel(com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel) List(java.util.List) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType) RefreshableTabPanel(com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel) ItemWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper) IModel(org.apache.wicket.model.IModel) Collections(java.util.Collections) PanelInstance(com.evolveum.midpoint.web.application.PanelInstance) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel) VirtualContainersSpecificationType(com.evolveum.midpoint.xml.ns._public.common.common_3.VirtualContainersSpecificationType)

Example 20 with SingleContainerPanel

use of com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel in project midpoint by Evolveum.

the class TaskDistributionPanel method initLayout.

@Override
protected void initLayout() {
    SingleContainerPanel activityDefinitionPanel = new SingleContainerPanel(ID_MAIN_PANEL, getObjectWrapperModel(), getPanelConfiguration());
    add(activityDefinitionPanel);
}
Also used : SingleContainerPanel(com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)

Aggregations

SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)25 ItemWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)5 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)4 ItemVisibility (com.evolveum.midpoint.web.component.prism.ItemVisibility)3 ArrayList (java.util.ArrayList)3 QName (javax.xml.namespace.QName)3 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 RepeatingView (org.apache.wicket.markup.repeater.RepeatingView)2 DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)1 ItemEditabilityHandler (com.evolveum.midpoint.gui.api.prism.wrapper.ItemEditabilityHandler)1 PrismContainerWrapper (com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper)1 WebComponentUtil (com.evolveum.midpoint.gui.api.util.WebComponentUtil)1 BasicMultivalueContainerListPanel (com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel)1 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)1 AbstractObjectMainPanel (com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel)1 TaskDetailsModel (com.evolveum.midpoint.gui.impl.page.admin.task.TaskDetailsModel)1 ResourceAttributePanel (com.evolveum.midpoint.gui.impl.prism.panel.ResourceAttributePanel)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1