use of org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider in project midpoint by Evolveum.
the class SubtasksPanel method initLayout.
private void initLayout(boolean workflowsEnabled) {
List<IColumn<TaskDto, String>> columns = new ArrayList<IColumn<TaskDto, String>>();
columns.add(PageTasks.createTaskNameColumn(this, "SubtasksPanel.label.name"));
columns.add(PageTasks.createTaskCategoryColumn(this, "SubtasksPanel.label.category"));
columns.add(PageTasks.createTaskExecutionStatusColumn(this, "SubtasksPanel.label.executionState"));
columns.add(PageTasks.createTaskResultStatusColumn(this, "SubtasksPanel.label.result"));
//columns.add(PageTasks.createTaskDetailColumn(this, "SubtasksPanel.label.detail", workflowsEnabled));
ISortableDataProvider provider = new ListDataProvider(this, getModel());
add(new TablePanel<TaskDto>(ID_SUBTASKS_TABLE, provider, columns));
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider 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);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider in project midpoint by Evolveum.
the class MyAccountsPanel method initLayout.
@Override
protected void initLayout() {
List<IColumn<SimpleAccountDto, String>> columns = new ArrayList<IColumn<SimpleAccountDto, String>>();
columns.add(new PropertyColumn(createStringResource("MyAccountsPanel.account.name"), "accountName"));
columns.add(new PropertyColumn(createStringResource("MyAccountsPanel.account.resource"), "resourceName"));
ISortableDataProvider provider = new ListDataProvider(this, getModel());
TablePanel accountsTable = new TablePanel<SimpleAccountDto>(ID_ACCOUNTS_TABLE, provider, columns);
accountsTable.setShowPaging(false);
add(accountsTable);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider in project midpoint by Evolveum.
the class MyAssignmentsPanel method initLayout.
private void initLayout() {
List<IColumn<AssignmentItemDto, String>> columns = new ArrayList<IColumn<AssignmentItemDto, String>>();
columns.add(new IconColumn<AssignmentItemDto>(null) {
private static final long serialVersionUID = 1L;
@Override
protected IModel<String> createIconModel(final IModel<AssignmentItemDto> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
AssignmentItemDto item = rowModel.getObject();
if (item.getType() == null) {
return OperationResultStatusPresentationProperties.FATAL_ERROR.getIcon() + " fa-lg";
}
return item.getType().getIconCssClass();
}
};
}
@Override
protected IModel<String> createTitleModel(final IModel<AssignmentItemDto> rowModel) {
return new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
AssignmentItemDto item = rowModel.getObject();
if (item.getType() == null) {
return MyAssignmentsPanel.this.getString("MyAssignmentsPanel.type.error");
}
switch(item.getType()) {
case CONSTRUCTION:
return MyAssignmentsPanel.this.getString("MyAssignmentsPanel.type.accountConstruction");
case ORG_UNIT:
return MyAssignmentsPanel.this.getString("MyAssignmentsPanel.type.orgUnit");
case ROLE:
return MyAssignmentsPanel.this.getString("MyAssignmentsPanel.type.role");
default:
return MyAssignmentsPanel.this.getString("MyAssignmentsPanel.type.error");
}
}
};
}
});
columns.add(new AbstractColumn<AssignmentItemDto, String>(createStringResource("MyAssignmentsPanel.assignment.displayName")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<AssignmentItemDto>> cellItem, String componentId, final IModel<AssignmentItemDto> rowModel) {
AssignmentHeaderPanel panel = new AssignmentHeaderPanel(componentId, rowModel);
panel.add(new AttributeModifier("class", "dash-assignment-header"));
cellItem.add(panel);
}
});
ISortableDataProvider provider = new ListDataProvider(this, getModel());
TablePanel accountsTable = new TablePanel<AssignmentItemDto>(ID_ASSIGNMETNS_TABLE, provider, columns);
accountsTable.setShowPaging(false);
add(accountsTable);
}
use of org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider in project midpoint by Evolveum.
the class PageSelfDashboard method initLayout.
private void initLayout() {
DashboardSearchPanel dashboardSearchPanel = new DashboardSearchPanel(ID_SEARCH_PANEL, null);
List<String> searchPanelActions = Arrays.asList(AuthorizationConstants.AUTZ_UI_USERS_ALL_URL, AuthorizationConstants.AUTZ_UI_USERS_URL, AuthorizationConstants.AUTZ_UI_RESOURCES_ALL_URL, AuthorizationConstants.AUTZ_UI_RESOURCES_URL, AuthorizationConstants.AUTZ_UI_TASKS_ALL_URL, AuthorizationConstants.AUTZ_UI_TASKS_URL);
dashboardSearchPanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
UserInterfaceElementVisibilityType visibilityType = getComponentVisibility(PredefinedDashboardWidgetId.SEARCH);
return WebComponentUtil.getElementVisibility(visibilityType, searchPanelActions);
}
});
add(dashboardSearchPanel);
LinksPanel linksPanel = new LinksPanel(ID_LINKS_PANEL, Model.ofList(loadLinksList()));
linksPanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
UserInterfaceElementVisibilityType visibilityType = getComponentVisibility(PredefinedDashboardWidgetId.SHORTCUTS);
return WebComponentUtil.getElementVisibility(visibilityType);
}
});
add(linksPanel);
// TODO is this correct? [med]
application = getApplication();
final Session session = Session.get();
AsyncDashboardPanel<Object, List<WorkItemDto>> workItemsPanel = new AsyncDashboardPanel<Object, List<WorkItemDto>>(ID_WORK_ITEMS_PANEL, createStringResource("PageSelfDashboard.workItems"), GuiStyleConstants.CLASS_OBJECT_WORK_ITEM_ICON, GuiStyleConstants.CLASS_OBJECT_WORK_ITEM_BOX_CSS_CLASSES, true) {
private static final long serialVersionUID = 1L;
@Override
protected SecurityContextAwareCallable<CallableResult<List<WorkItemDto>>> createCallable(Authentication auth, IModel callableParameterModel) {
return new SecurityContextAwareCallable<CallableResult<List<WorkItemDto>>>(getSecurityEnforcer(), auth) {
private static final long serialVersionUID = 1L;
@Override
public CallableResult<List<WorkItemDto>> callWithContextPrepared() throws Exception {
// TODO is this correct? [med]
setupContext(application, session);
return loadWorkItems();
}
};
}
@Override
protected Component getMainComponent(String markupId) {
ISortableDataProvider provider = new ListDataProvider(this, new PropertyModel<List<WorkItemDto>>(getModel(), CallableResult.F_VALUE));
return new WorkItemsPanel(markupId, provider, null, 10, WorkItemsPanel.View.DASHBOARD);
}
};
workItemsPanel.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
UserInterfaceElementVisibilityType visibilityType = getComponentVisibility(PredefinedDashboardWidgetId.MY_WORKITEMS);
return getWorkflowManager().isEnabled() && WebComponentUtil.getElementVisibility(visibilityType);
}
});
add(workItemsPanel);
AsyncDashboardPanel<Object, List<ProcessInstanceDto>> myRequestsPanel = new AsyncDashboardPanel<Object, List<ProcessInstanceDto>>(ID_REQUESTS_PANEL, createStringResource("PageSelfDashboard.myRequests"), GuiStyleConstants.CLASS_SHADOW_ICON_REQUEST, GuiStyleConstants.CLASS_OBJECT_SERVICE_BOX_CSS_CLASSES, true) {
private static final long serialVersionUID = 1L;
@Override
protected SecurityContextAwareCallable<CallableResult<List<ProcessInstanceDto>>> createCallable(Authentication auth, IModel callableParameterModel) {
return new SecurityContextAwareCallable<CallableResult<List<ProcessInstanceDto>>>(getSecurityEnforcer(), auth) {
private static final long serialVersionUID = 1L;
@Override
public CallableResult<List<ProcessInstanceDto>> callWithContextPrepared() throws Exception {
setupContext(application, session);
return loadMyRequests();
}
};
}
@Override
protected Component getMainComponent(String markupId) {
ISortableDataProvider provider = new ListDataProvider(this, new PropertyModel<List<ProcessInstanceDto>>(getModel(), CallableResult.F_VALUE));
return new ProcessInstancesPanel(markupId, provider, null, 10, ProcessInstancesPanel.View.DASHBOARD, null);
}
};
myRequestsPanel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
UserInterfaceElementVisibilityType visibilityType = getComponentVisibility(PredefinedDashboardWidgetId.MY_REQUESTS);
return getWorkflowManager().isEnabled() && WebComponentUtil.getElementVisibility(visibilityType);
}
});
add(myRequestsPanel);
initMyAccounts();
initAssignments();
}
Aggregations