Search in sources :

Example 11 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class PageCertCampaign method initTableLayout.

private void initTableLayout(Form mainForm) {
    CertCaseDtoProvider provider = new CertCaseDtoProvider(PageCertCampaign.this);
    provider.setQuery(createCaseQuery());
    provider.setCampaignOid(campaignOid);
    // default sorting
    provider.setSort(AccessCertificationCaseType.F_OBJECT_REF.getLocalPart(), SortOrder.ASCENDING);
    int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_OUTCOMES_PANEL);
    BoxedTablePanel table = new BoxedTablePanel<>(ID_OUTCOMES_TABLE, provider, initColumns(), UserProfileStorage.TableId.PAGE_CERT_CAMPAIGN_OUTCOMES_PANEL, itemsPerPage);
    table.setShowPaging(true);
    table.setOutputMarkupId(true);
    table.setItemsPerPage(itemsPerPage);
    mainForm.add(table);
}
Also used : CertCaseDtoProvider(com.evolveum.midpoint.web.page.admin.certification.dto.CertCaseDtoProvider) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 12 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class PageCertCampaigns method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    CertCampaignListItemDtoProvider provider = createProvider();
    int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL);
    BoxedTablePanel<CertCampaignListItemDto> table = new BoxedTablePanel<>(ID_CAMPAIGNS_TABLE, provider, initColumns(), UserProfileStorage.TableId.PAGE_CERT_CAMPAIGNS_PANEL, itemsPerPage);
    table.setShowPaging(true);
    table.setOutputMarkupId(true);
    table.setItemsPerPage(itemsPerPage);
    mainForm.add(table);
}
Also used : CertCampaignListItemDtoProvider(com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignListItemDtoProvider) Form(org.apache.wicket.markup.html.form.Form) CertCampaignListItemDto(com.evolveum.midpoint.web.page.admin.certification.dto.CertCampaignListItemDto) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 13 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class PageDebugList method hasToZip.

private boolean hasToZip() {
    BoxedTablePanel table = (BoxedTablePanel) getListTable();
    SearchFragment header = (SearchFragment) table.getHeader();
    AjaxCheckBox zipCheck = header.getZipCheck();
    return zipCheck.getModelObject();
}
Also used : AjaxCheckBox(org.apache.wicket.ajax.markup.html.form.AjaxCheckBox) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel)

Example 14 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class PageTasks method initLayout.

private void initLayout() {
    refreshPanel = new AutoRefreshPanel(ID_REFRESH_PANEL, refreshModel, this, false);
    add(refreshPanel);
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    List<IColumn<TaskDto, String>> taskColumns = initTaskColumns();
    TaskDtoProviderOptions options = TaskDtoProviderOptions.minimalOptions();
    options.setGetNextRunStartTime(true);
    options.setUseClusterInformation(true);
    options.setResolveObjectRef(true);
    TaskDtoProvider provider = new TaskDtoProvider(PageTasks.this, options) {

        @Override
        protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
            TasksStorage storage = getSessionStorage().getTasks();
            storage.setPaging(paging);
        }

        @Override
        public TaskDto createTaskDto(PrismObject<TaskType> task, Task opTask, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException {
            TaskDto dto = super.createTaskDto(task, opTask, result);
            addInlineMenuToTaskRow(dto);
            return dto;
        }
    };
    provider.setQuery(createTaskQuery());
    BoxedTablePanel<TaskDto> taskTable = new BoxedTablePanel(ID_TASK_TABLE, provider, taskColumns, UserProfileStorage.TableId.PAGE_TASKS_PANEL, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_TASKS_PANEL)) {

        @Override
        protected WebMarkupContainer createHeader(String headerId) {
            return new SearchFragment(headerId, ID_TABLE_HEADER, PageTasks.this, searchModel);
        }

        @Override
        protected WebMarkupContainer createButtonToolbar(String id) {
            String fileName = "TaskType_" + createStringResource("MainObjectListPanel.exportFileName").getString();
            CSVDataExporter csvDataExporter = new CSVDataExporter();
            ResourceStreamResource resource = (new ResourceStreamResource() {

                protected IResourceStream getResourceStream() {
                    return new ExportToolbar.DataExportResourceStreamWriter(csvDataExporter, getTaskTable().getDataTable());
                }
            }).setFileName(fileName + "." + csvDataExporter.getFileNameExtension());
            AbstractLink exportDataLink = (new ResourceLink(id, resource)).setBody(csvDataExporter.getDataFormatNameModel());
            exportDataLink.add(new AttributeAppender("class", " btn btn-primary btn-sm"));
            return exportDataLink;
        }
    };
    taskTable.setOutputMarkupId(true);
    TasksStorage storage = getSessionStorage().getTasks();
    taskTable.setCurrentPage(storage.getPaging());
    mainForm.add(taskTable);
    List<IColumn<NodeDto, String>> nodeColumns = initNodeColumns();
    BoxedTablePanel nodeTable = new BoxedTablePanel(ID_NODE_TABLE, new NodeDtoProvider(PageTasks.this) {

        @Override
        public NodeDto createNodeDto(PrismObject<NodeType> node) {
            NodeDto dto = super.createNodeDto(node);
            addInlineMenuToNodeRow(dto);
            return dto;
        }
    }, nodeColumns, UserProfileStorage.TableId.PAGE_TASKS_NODES_PANEL, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_TASKS_NODES_PANEL));
    nodeTable.setOutputMarkupId(true);
    nodeTable.setShowPaging(false);
    mainForm.add(nodeTable);
    initDiagnosticButtons();
}
Also used : Task(com.evolveum.midpoint.task.api.Task) CSVDataExporter(org.apache.wicket.extensions.markup.html.repeater.data.table.export.CSVDataExporter) Form(org.apache.wicket.markup.html.form.Form) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PrismObject(com.evolveum.midpoint.prism.PrismObject) ResourceStreamResource(org.apache.wicket.request.resource.ResourceStreamResource) AutoRefreshPanel(com.evolveum.midpoint.web.component.refresh.AutoRefreshPanel) ResourceLink(org.apache.wicket.markup.html.link.ResourceLink) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) TasksStorage(com.evolveum.midpoint.web.session.TasksStorage) AbstractLink(org.apache.wicket.markup.html.link.AbstractLink)

Example 15 with BoxedTablePanel

use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.

the class PageAuditLogDetails method initAuditLogHistoryPanel.

private void initAuditLogHistoryPanel(WebMarkupContainer eventPanel) {
    AuditEventRecordProvider provider = new AuditEventRecordProvider(PageAuditLogDetails.this) {

        private static final long serialVersionUID = 1L;

        public Map<String, Object> getParameters() {
            Map<String, Object> parameters = new HashMap<String, Object>();
            parameters.put(TASK_IDENTIFIER_PARAMETER, recordModel.getObject().getTaskIdentifier());
            return parameters;
        }
    };
    BoxedTablePanel<AuditEventRecordType> table = new BoxedTablePanel<AuditEventRecordType>(ID_HISTORY_PANEL, provider, initColumns(), UserProfileStorage.TableId.TASK_EVENTS_TABLE, TASK_EVENTS_TABLE_SIZE) {

        @Override
        protected Item<AuditEventRecordType> customizeNewRowItem(final Item<AuditEventRecordType> item, final IModel<AuditEventRecordType> rowModel) {
            if (rowModel.getObject().getTimestamp().equals(recordModel.getObject().getTimestamp())) {
                item.add(new AttributeAppender("style", "background-color: #eee; border-color: #d6d6d6; color: #000"));
            }
            item.add(new AjaxEventBehavior("click") {

                private static final long serialVersionUID = 1L;

                @Override
                protected void onEvent(AjaxRequestTarget target) {
                    PageAuditLogDetails.this.rowItemClickPerformed(target, item, rowModel);
                }
            });
            return item;
        }
    };
    table.getFooterMenu().setVisible(false);
    table.getFooterCountLabel().setVisible(false);
    //TODO hidden temporarily
    table.setVisible(false);
    table.setOutputMarkupId(true);
    table.setAdditionalBoxCssClasses("without-box-header-top-border");
    eventPanel.addOrReplace(table);
}
Also used : IModel(org.apache.wicket.model.IModel) AjaxEventBehavior(org.apache.wicket.ajax.AjaxEventBehavior) AuditEventRecordProvider(com.evolveum.midpoint.web.page.admin.reports.dto.AuditEventRecordProvider) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ListItem(org.apache.wicket.markup.html.list.ListItem) Item(org.apache.wicket.markup.repeater.Item) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Aggregations

BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)20 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)6 Form (org.apache.wicket.markup.html.form.Form)6 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)5 ArrayList (java.util.ArrayList)4 Item (org.apache.wicket.markup.repeater.Item)4 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)3 List (java.util.List)3 IModel (org.apache.wicket.model.IModel)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)2 AuditEventRecordProvider (com.evolveum.midpoint.web.page.admin.reports.dto.AuditEventRecordProvider)2 CSVDataExporter (org.apache.wicket.extensions.markup.html.repeater.data.table.export.CSVDataExporter)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 AbstractLink (org.apache.wicket.markup.html.link.AbstractLink)2 ResourceLink (org.apache.wicket.markup.html.link.ResourceLink)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 ResourceStreamResource (org.apache.wicket.request.resource.ResourceStreamResource)2