Search in sources :

Example 1 with CompiledShadowCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledShadowCollectionView in project midpoint by Evolveum.

the class ResourceContentPanel method initLayout.

private void initLayout() {
    WebMarkupContainer totals = new WebMarkupContainer(ID_TOTALS);
    totals.setOutputMarkupId(true);
    add(totals);
    initShadowStatistics(totals);
    MainObjectListPanel<ShadowType> shadowListPanel = new MainObjectListPanel<>(ID_TABLE, ShadowType.class, createSearchOptions(), getPanelConfiguration()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return ResourceContentPanel.this.createRowMenuItems();
        }

        @Override
        protected List<IColumn<SelectableBean<ShadowType>, String>> createDefaultColumns() {
            return ResourceContentPanel.this.initColumns();
        }

        @Override
        protected void objectDetailsPerformed(AjaxRequestTarget target, ShadowType object) {
            shadowDetailsPerformed(target, WebComponentUtil.getName(object), object.getOid());
        }

        @Override
        protected boolean isCreateNewObjectEnabled() {
            return false;
        }

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return ResourceContentPanel.this.getTableId();
        }

        @Override
        public PageStorage getPageStorage() {
            return getPageBase().getSessionStorage().getResourceContentStorage(kind, searchMode);
        }

        @Override
        protected ISelectableDataProvider createProvider() {
            provider = createSelectableBeanObjectDataProvider(() -> getResourceContentQuery(), null);
            provider.setEmptyListOnNullQuery(true);
            provider.setSort(null);
            provider.setDefaultCountIfNull(Integer.MAX_VALUE);
            return provider;
        }

        @Override
        protected Search createSearch(Class<ShadowType> type) {
            return ResourceContentPanel.this.createSearch();
        }

        @Override
        protected CompiledObjectCollectionView getObjectCollectionView() {
            CompiledShadowCollectionView compiledView = findContainerPanelConfig();
            if (compiledView != null) {
                return compiledView;
            }
            return super.getObjectCollectionView();
        }
    };
    shadowListPanel.setOutputMarkupId(true);
    shadowListPanel.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return createQuery() != null;
        }
    });
    shadowListPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_SHADOW_BOX_CSS_CLASSES);
    add(shadowListPanel);
    Label label = new Label(ID_LABEL, "Nothing to show. Select intent to search");
    add(label);
    label.setOutputMarkupId(true);
    label.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return createQuery() == null;
        }
    });
    initButton(ID_IMPORT, "Import", " fa-download", SystemObjectsType.ARCHETYPE_IMPORT_TASK.value());
    initButton(ID_RECONCILIATION, "Reconciliation", " fa-link", SystemObjectsType.ARCHETYPE_RECONCILIATION_TASK.value());
    initButton(ID_LIVE_SYNC, "Live Sync", " fa-refresh", SystemObjectsType.ARCHETYPE_LIVE_SYNC_TASK.value());
    initCustomLayout();
}
Also used : MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) CompiledShadowCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledShadowCollectionView) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Aggregations

MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)1 CompiledShadowCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledShadowCollectionView)1 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)1 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Label (org.apache.wicket.markup.html.basic.Label)1