Search in sources :

Example 1 with PrismPropertyWrapperModel

use of com.evolveum.midpoint.web.model.PrismPropertyWrapperModel 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)

Aggregations

DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)1 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 BasicMultivalueContainerListPanel (com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel)1 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)1 SingleContainerPanel (com.evolveum.midpoint.gui.impl.prism.panel.SingleContainerPanel)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 ObjectBasicPanel (com.evolveum.midpoint.web.component.ObjectBasicPanel)1 AbstractObjectMainPanel (com.evolveum.midpoint.web.component.objectdetails.AbstractObjectMainPanel)1 PrismPropertyWrapperModel (com.evolveum.midpoint.web.model.PrismPropertyWrapperModel)1 ArrayList (java.util.ArrayList)1 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Panel (org.apache.wicket.markup.html.panel.Panel)1 RepeatingView (org.apache.wicket.markup.repeater.RepeatingView)1