Search in sources :

Example 1 with JobActionPanel

use of org.apache.syncope.client.console.widgets.JobActionPanel 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)

Example 2 with JobActionPanel

use of org.apache.syncope.client.console.widgets.JobActionPanel in project syncope by apache.

the class ProvisioningTaskDirectoryPanel method getFieldColumns.

@Override
protected List<IColumn<T, String>> getFieldColumns() {
    List<IColumn<T, 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 PropertyColumn<>(new StringResourceModel("description", this), "description", "description"));
    if (reference == PullTaskTO.class) {
        columns.add(new PropertyColumn<>(new StringResourceModel("destinationRealm", this), "destinationRealm", "destinationRealm"));
    } else if (reference == PushTaskTO.class) {
        columns.add(new PropertyColumn<>(new StringResourceModel("sourceRealm", this), "sourceRealm", "sourceRealm"));
    }
    columns.add(new DatePropertyColumn<>(new StringResourceModel("lastExec", this), "lastExec", "lastExec"));
    columns.add(new DatePropertyColumn<>(new StringResourceModel("nextExec", this), "nextExec", "nextExec"));
    columns.add(new PropertyColumn<>(new StringResourceModel("latestExecStatus", this), "latestExecStatus", "latestExecStatus"));
    columns.add(new BooleanPropertyColumn<>(new StringResourceModel("active", this), "active", "active"));
    columns.add(new AbstractColumn<T, String>(new Model<>(""), "running") {

        private static final long serialVersionUID = -4008579357070833846L;

        @Override
        public void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel) {
            JobTO jobTO = restClient.getJob(rowModel.getObject().getKey());
            JobActionPanel panel = new JobActionPanel(componentId, jobTO, false, ProvisioningTaskDirectoryPanel.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 : DatePropertyColumn(org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn) KeyPropertyColumn(org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn) BooleanPropertyColumn(org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) ArrayList(java.util.ArrayList) 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) PushTaskTO(org.apache.syncope.common.lib.to.PushTaskTO) StringResourceModel(org.apache.wicket.model.StringResourceModel) 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

ArrayList (java.util.ArrayList)2 JobActionPanel (org.apache.syncope.client.console.widgets.JobActionPanel)2 JobTO (org.apache.syncope.common.lib.to.JobTO)2 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 IModel (org.apache.wicket.model.IModel)2 Model (org.apache.wicket.model.Model)2 StringResourceModel (org.apache.wicket.model.StringResourceModel)2 BooleanPropertyColumn (org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.BooleanPropertyColumn)1 DatePropertyColumn (org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn)1 KeyPropertyColumn (org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn)1 PushTaskTO (org.apache.syncope.common.lib.to.PushTaskTO)1 ReportTO (org.apache.syncope.common.lib.to.ReportTO)1 PropertyColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn)1 CompoundPropertyModel (org.apache.wicket.model.CompoundPropertyModel)1