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);
}
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);
}
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();
}
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();
}
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);
}
Aggregations