Search in sources :

Example 16 with ReportTO

use of org.apache.syncope.common.lib.to.ReportTO in project syncope by apache.

the class ReportDirectoryPanel method getColumns.

@Override
protected List<IColumn<ReportTO, String>> getColumns() {
    final List<IColumn<ReportTO, String>> columns = new ArrayList<>();
    columns.add(new KeyPropertyColumn<>(new StringResourceModel("key", this), "key"));
    columns.add(new PropertyColumn<>(new StringResourceModel("name", this), "name", "name"));
    columns.add(new DatePropertyColumn<>(new StringResourceModel("lastExec", this), "lastExec", "lastExec"));
    columns.add(new DatePropertyColumn<>(new StringResourceModel("nextExec", this), "nextExec", "nextExec"));
    columns.add(new DatePropertyColumn<>(new StringResourceModel("start", this), "start", "start"));
    columns.add(new DatePropertyColumn<>(new StringResourceModel("end", this), "end", "end"));
    columns.add(new PropertyColumn<>(new StringResourceModel("latestExecStatus", this), "latestExecStatus", "latestExecStatus"));
    columns.add(new BooleanPropertyColumn<>(new StringResourceModel("active", this), "active", "active"));
    columns.add(new AbstractColumn<ReportTO, String>(new Model<>(""), "running") {

        private static final long serialVersionUID = 4209532514416998046L;

        @Override
        public void populateItem(final Item<ICellPopulator<ReportTO>> cellItem, final String componentId, final IModel<ReportTO> rowModel) {
            JobTO jobTO = restClient.getJob(rowModel.getObject().getKey());
            JobActionPanel panel = new JobActionPanel(componentId, jobTO, false, ReportDirectoryPanel.this, pageRef);
            MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE, String.format("%s,%s", StandardEntitlement.TASK_EXECUTE, StandardEntitlement.TASK_UPDATE));
            cellItem.add(panel);
        }

        @Override
        public String getCssClass() {
            return "col-xs-1";
        }
    });
    return columns;
}
Also used : ArrayList(java.util.ArrayList) ReportTO(org.apache.syncope.common.lib.to.ReportTO) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) JobActionPanel(org.apache.syncope.client.console.widgets.JobActionPanel) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) StringResourceModel(org.apache.wicket.model.StringResourceModel) CompoundPropertyModel(org.apache.wicket.model.CompoundPropertyModel) IModel(org.apache.wicket.model.IModel) Model(org.apache.wicket.model.Model) StringResourceModel(org.apache.wicket.model.StringResourceModel) JobTO(org.apache.syncope.common.lib.to.JobTO)

Aggregations

ReportTO (org.apache.syncope.common.lib.to.ReportTO)16 Test (org.junit.jupiter.api.Test)9 ImplementationTO (org.apache.syncope.common.lib.to.ImplementationTO)5 Response (javax.ws.rs.core.Response)4 UserReportletConf (org.apache.syncope.common.lib.report.UserReportletConf)3 ExecTO (org.apache.syncope.common.lib.to.ExecTO)3 ExecuteQuery (org.apache.syncope.common.rest.api.beans.ExecuteQuery)3 ArrayList (java.util.ArrayList)2 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)2 StringResourceModel (org.apache.wicket.model.StringResourceModel)2 AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)1 URI (java.net.URI)1 Date (java.util.Date)1 MultilevelPanel (org.apache.syncope.client.console.panels.MultilevelPanel)1 ReportDirectoryPanel (org.apache.syncope.client.console.reports.ReportDirectoryPanel)1 ReportExecutionDetails (org.apache.syncope.client.console.reports.ReportExecutionDetails)1 ReportTemplateDirectoryPanel (org.apache.syncope.client.console.reports.ReportTemplateDirectoryPanel)1 JobActionPanel (org.apache.syncope.client.console.widgets.JobActionPanel)1 LoggerTO (org.apache.syncope.common.lib.log.LoggerTO)1 AuditReportletConf (org.apache.syncope.common.lib.report.AuditReportletConf)1