Search in sources :

Example 1 with DecisionDto

use of com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto in project midpoint by Evolveum.

the class DecisionsPanel method initLayout.

protected void initLayout(UserProfileStorage.TableId tableId, int pageSize) {
    List<IColumn<DecisionDto, String>> columns = new ArrayList<>();
    columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.user"), DecisionDto.F_USER));
    columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.originalActor"), DecisionDto.F_ORIGINAL_ACTOR));
    columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.stage"), DecisionDto.F_STAGE));
    columns.add(createOutcomeColumn());
    columns.add(new PropertyColumn<DecisionDto, String>(createStringResource("DecisionsPanel.comment"), DecisionDto.F_COMMENT) {

        @Override
        public void populateItem(Item<ICellPopulator<DecisionDto>> item, String componentId, IModel<DecisionDto> rowModel) {
            super.populateItem(item, componentId, rowModel);
            item.add(new AttributeAppender("style", "max-width: 200px; word-wrap: break-word;"));
        }
    });
    columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.when"), DecisionDto.F_TIME));
    columns.add(new PropertyColumn<>(createStringResource("DecisionsPanel.escalation"), DecisionDto.F_ESCALATION_LEVEL_NUMBER));
    ISortableDataProvider provider = new ListDataProvider<>(this, getModel());
    BoxedTablePanel decisionsTable = new BoxedTablePanel<>(ID_DECISIONS_TABLE, provider, columns, tableId, pageSize);
    add(decisionsTable);
}
Also used : ListDataProvider(com.evolveum.midpoint.web.component.util.ListDataProvider) ArrayList(java.util.ArrayList) ISortableDataProvider(org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider) ICellPopulator(org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) DecisionDto(com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto) BoxedTablePanel(com.evolveum.midpoint.web.component.data.BoxedTablePanel) AttributeAppender(org.apache.wicket.behavior.AttributeAppender)

Example 2 with DecisionDto

use of com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto in project midpoint by Evolveum.

the class ItemApprovalHistoryPanel method initLayout.

private void initLayout(UserProfileStorage.TableId tableId, int pageSize) {
    add(new DecisionsPanel(ID_DECISIONS_DONE, new AbstractReadOnlyModel<List<DecisionDto>>() {

        @Override
        public List<DecisionDto> getObject() {
            List<DecisionDto> rv = new ArrayList<>();
            WfContextType wfContextType = getModelObject();
            if (wfContextType == null) {
                return rv;
            }
            if (!wfContextType.getEvent().isEmpty()) {
                wfContextType.getEvent().forEach(e -> addIgnoreNull(rv, DecisionDto.create(e, getPageBase())));
            } else {
                ItemApprovalProcessStateType instanceState = WfContextUtil.getItemApprovalProcessInfo(wfContextType);
                if (instanceState != null) {
                    instanceState.getDecisions().forEach(d -> addIgnoreNull(rv, DecisionDto.create(d)));
                }
            }
            return rv;
        }
    }, tableId, pageSize));
}
Also used : DecisionsPanel(com.evolveum.midpoint.web.component.wf.DecisionsPanel) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) ItemApprovalProcessStateType(com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType) DecisionDto(com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto) ArrayList(java.util.ArrayList) WfContextType(com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType)

Aggregations

DecisionDto (com.evolveum.midpoint.web.page.admin.workflow.dto.DecisionDto)2 ArrayList (java.util.ArrayList)2 BoxedTablePanel (com.evolveum.midpoint.web.component.data.BoxedTablePanel)1 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)1 DecisionsPanel (com.evolveum.midpoint.web.component.wf.DecisionsPanel)1 ItemApprovalProcessStateType (com.evolveum.midpoint.xml.ns._public.common.common_3.ItemApprovalProcessStateType)1 WfContextType (com.evolveum.midpoint.xml.ns._public.common.common_3.WfContextType)1 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)1 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 ISortableDataProvider (org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1