Search in sources :

Example 96 with IColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.

the class PageResources method initLayout.

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

        @Override
        protected void objectDetailsPerformed(AjaxRequestTarget target, ResourceType object) {
            clearSessionStorageForResourcePage();
            super.objectDetailsPerformed(target, object);
        }

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

        @Override
        protected List<IColumn<SelectableBean<ResourceType>, String>> createDefaultColumns() {
            return PageResources.this.initResourceColumns();
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return PageResources.this.createRowMenuItems();
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
    table.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_RESOURCE_BOX_CSS_CLASSES);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) 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) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)

Example 97 with IColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn 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 98 with IColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.

the class ReportMainPanel method createObjectListForColumns.

private WebMarkupContainer createObjectListForColumns(String panelId, PageAdminObjectDetails<ReportType> parentPage) {
    return new BasicMultivalueContainerListPanel<>(panelId, GuiObjectColumnType.class) {

        @Override
        protected MultivalueContainerDetailsPanel<GuiObjectColumnType> getMultivalueContainerDetailsPanel(ListItem<PrismContainerValueWrapper<GuiObjectColumnType>> item) {
            return createDetailsPanelForColumn(ID_ITEM_DETAILS, item);
        }

        @Override
        protected String getContainerNameForNewButton() {
            return getPageBase().createStringResource("GuiObjectListViewType.column").getString();
        }

        @Override
        protected IModel<PrismContainerWrapper<GuiObjectColumnType>> getContainerModel() {
            return PrismContainerWrapperModel.fromContainerWrapper(ReportMainPanel.this.getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW, GuiObjectListViewType.F_COLUMN));
        }

        @Override
        protected Component createHeader(String headerId) {
            Label label = new Label(headerId, getPageBase().createStringResource("EngineReportTabPanel.columns"));
            label.add(AttributeAppender.append("style", "padding-bottom:10px; font-size: 16px; font-weight: 600; color: #3c8dbc;"));
            return label;
        }

        @Override
        protected List<IColumn<PrismContainerValueWrapper<GuiObjectColumnType>, String>> createDefaultColumns() {
            return createColumnsForColumns(parentPage);
        }
    };
}
Also used : BasicMultivalueContainerListPanel(com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) PrismContainerWrapper(com.evolveum.midpoint.gui.api.prism.wrapper.PrismContainerWrapper) Label(org.apache.wicket.markup.html.basic.Label) ListItem(org.apache.wicket.markup.html.list.ListItem)

Example 99 with IColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn in project midpoint by Evolveum.

the class ReportMainPanel method createColumnsForParameters.

private List<IColumn<PrismContainerValueWrapper<SearchFilterParameterType>, String>> createColumnsForParameters(PageAdminObjectDetails<ReportType> parentPage) {
    PrismContainerWrapperModel<ReportType, SearchFilterParameterType> containerModel = PrismContainerWrapperModel.fromContainerWrapper(getObjectModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_PARAMETER));
    List<IColumn<PrismContainerValueWrapper<SearchFilterParameterType>, String>> columns = new ArrayList<>();
    columns.add(new PrismPropertyWrapperColumn<SearchFilterParameterType, String>(containerModel, SearchFilterParameterType.F_NAME, AbstractItemWrapperColumn.ColumnType.VALUE, parentPage) {

        @Override
        public String getCssClass() {
            return "col-sm-3 col-md-2";
        }
    });
    columns.add(new PrismPropertyWrapperColumn<SearchFilterParameterType, String>(containerModel, SearchFilterParameterType.F_TYPE, AbstractItemWrapperColumn.ColumnType.VALUE, parentPage) {

        @Override
        public String getCssClass() {
            return "col-md-3";
        }
    });
    PrismContainerDefinition<Containerable> def = containerModel.getObject().getComplexTypeDefinition().findContainerDefinition(SearchFilterParameterType.F_DISPLAY);
    columns.add(new PrismPropertyWrapperColumn(Model.of(def), DisplayType.F_LABEL, AbstractItemWrapperColumn.ColumnType.VALUE, parentPage) {

        @Override
        public IModel<?> getDataModel(IModel rowModel) {
            return PrismPropertyWrapperModel.fromContainerValueWrapper(rowModel, ItemPath.create(SearchFilterParameterType.F_DISPLAY, DisplayType.F_LABEL));
        }
    });
    return columns;
}
Also used : IModel(org.apache.wicket.model.IModel) PrismPropertyWrapperColumn(com.evolveum.midpoint.gui.impl.component.data.column.PrismPropertyWrapperColumn) ArrayList(java.util.ArrayList) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) Containerable(com.evolveum.midpoint.prism.Containerable)

Example 100 with IColumn

use of org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn 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)

Aggregations

IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)131 ArrayList (java.util.ArrayList)80 IModel (org.apache.wicket.model.IModel)73 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)69 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)43 Label (org.apache.wicket.markup.html.basic.Label)43 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)37 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)36 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)31 PropertyColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn)31 Model (org.apache.wicket.model.Model)22 Item (org.apache.wicket.markup.repeater.Item)19 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)18 List (java.util.List)18 Component (org.apache.wicket.Component)18 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)17 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)17 PropertyModel (org.apache.wicket.model.PropertyModel)15 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)14 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)13