Search in sources :

Example 16 with MainObjectListPanel

use of com.evolveum.midpoint.gui.api.component.MainObjectListPanel 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)

Example 17 with MainObjectListPanel

use of com.evolveum.midpoint.gui.api.component.MainObjectListPanel in project midpoint by Evolveum.

the class PageConnectorHosts method initLayout.

protected void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ConnectorHostType> table = new MainObjectListPanel<ConnectorHostType>(ID_TABLE, ConnectorHostType.class, getQueryOptions()) {

        @Override
        protected void objectDetailsPerformed(AjaxRequestTarget target, ConnectorHostType host) {
        }

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

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return createRowActions();
        }

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

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

        @Override
        protected boolean isObjectDetailsEnabled(IModel<SelectableBean<ConnectorHostType>> rowModel) {
            return false;
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) IModel(org.apache.wicket.model.IModel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 18 with MainObjectListPanel

use of com.evolveum.midpoint.gui.api.component.MainObjectListPanel in project midpoint by Evolveum.

the class PageReports method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ReportType> table = new MainObjectListPanel<ReportType>(ID_TABLE, ReportType.class) {

        private static final long serialVersionUID = 1L;

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

        @Override
        protected List<IColumn<SelectableBean<ReportType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultObjectColumns();
        }

        @Override
        protected IColumn<SelectableBean<ReportType>, String> createCheckboxColumn() {
            return null;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return PageReports.this.createInlineMenu();
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 19 with MainObjectListPanel

use of com.evolveum.midpoint.gui.api.component.MainObjectListPanel in project midpoint by Evolveum.

the class PageOrgs method initLayout.

protected void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<OrgType> table = new MainObjectListPanel<OrgType>(ID_TABLE, OrgType.class, getQueryOptions()) {

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

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            FocusListInlineMenuHelper<OrgType> listInlineMenuHelper = new FocusListInlineMenuHelper<OrgType>(OrgType.class, PageOrgs.this, this) {

                private static final long serialVersionUID = 1L;

                protected boolean isShowConfirmationDialog(ColumnMenuAction action) {
                    return PageOrgs.this.isShowConfirmationDialog(action);
                }

                protected IModel<String> getConfirmationMessageModel(ColumnMenuAction action, String actionName) {
                    return PageOrgs.this.getConfirmationMessageModel(action, actionName);
                }
            };
            return listInlineMenuHelper.createRowActions(getType());
        }

        @Override
        protected List<IColumn<SelectableBean<OrgType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultOrgColumns(getPageBase());
        }

        @Override
        protected List<ItemPath> getFixedSearchItems() {
            List<ItemPath> fixedSearchItems = new ArrayList<>();
            fixedSearchItems.add(ObjectType.F_NAME);
            fixedSearchItems.add(AbstractRoleType.F_DISPLAY_NAME);
            fixedSearchItems.add(OrgType.F_PARENT_ORG_REF);
            return fixedSearchItems;
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) ArrayList(java.util.ArrayList) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ColumnMenuAction(com.evolveum.midpoint.web.component.data.column.ColumnMenuAction) FocusListInlineMenuHelper(com.evolveum.midpoint.web.component.util.FocusListInlineMenuHelper) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Example 20 with MainObjectListPanel

use of com.evolveum.midpoint.gui.api.component.MainObjectListPanel in project midpoint by Evolveum.

the class PageObjectTemplates method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ObjectTemplateType> table = new MainObjectListPanel<ObjectTemplateType>(ID_TABLE, ObjectTemplateType.class) {

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

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            List<InlineMenuItem> menu = new ArrayList<>();
            menu.add(createDeleteInlineMenu());
            return menu;
        }

        @Override
        protected List<IColumn<SelectableBean<ObjectTemplateType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultObjectColumns();
        }

        @Override
        protected String getNothingSelectedMessage() {
            return getString("pageObjectTemplates.message.nothingSelected");
        }

        @Override
        protected String getConfirmMessageKeyForSingleObject() {
            return "pageObjectTemplates.message.confirmationMessageForMultipleObject";
        }

        @Override
        protected String getConfirmMessageKeyForMultiObject() {
            return "pageObjectTemplates.message.confirmationMessageForSingleObject";
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ObjectTemplateType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectTemplateType) ArrayList(java.util.ArrayList) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Aggregations

MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)26 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)24 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)22 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)18 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)15 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)14 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)14 ArrayList (java.util.ArrayList)14 Form (org.apache.wicket.markup.html.form.Form)14 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)12 IModel (org.apache.wicket.model.IModel)9 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)5 CompiledObjectCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)5 SelectableBeanImpl (com.evolveum.midpoint.web.component.util.SelectableBeanImpl)5 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)4 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)3 ColumnMenuAction (com.evolveum.midpoint.web.component.data.column.ColumnMenuAction)3 FocusListInlineMenuHelper (com.evolveum.midpoint.web.component.util.FocusListInlineMenuHelper)3