use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class PageCreatedReports method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
final AjaxDownloadBehaviorFromStream ajaxDownloadBehavior = new AjaxDownloadBehaviorFromStream() {
@Override
protected InputStream initStream() {
return createReport(this);
}
@Override
public String getFileName() {
return getReportFileName();
}
};
mainForm.add(ajaxDownloadBehavior);
ObjectDataProvider provider = new ObjectDataProvider(PageCreatedReports.this, ReportOutputType.class) {
@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
ReportsStorage storage = getSessionStorage().getReports();
storage.setReportOutputsPaging(paging);
}
@Override
public ObjectQuery getQuery() {
return createQuery();
}
};
BoxedTablePanel table = new BoxedTablePanel(ID_CREATED_REPORTS_TABLE, provider, initColumns(ajaxDownloadBehavior), UserProfileStorage.TableId.PAGE_CREATED_REPORTS_PANEL, (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CREATED_REPORTS_PANEL)) {
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new SearchFragment(headerId, ID_TABLE_HEADER, PageCreatedReports.this, searchModel);
}
};
table.setShowPaging(true);
table.setOutputMarkupId(true);
mainForm.add(table);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ObjectListPanel method createTable.
private BoxedTablePanel<SelectableBean<O>> createTable() {
List<IColumn<SelectableBean<O>, String>> columns;
if (isCustomColumnsListConfigured()) {
columns = initCustomColumns();
} else {
columns = initColumns();
}
BaseSortableDataProvider<SelectableBean<O>> provider = initProvider();
BoxedTablePanel<SelectableBean<O>> table = new BoxedTablePanel<SelectableBean<O>>(ID_TABLE, provider, columns, tableId, tableId == null ? 10 : parentPage.getSessionStorage().getUserProfile().getPagingSize(tableId)) {
private static final long serialVersionUID = 1L;
@Override
protected WebMarkupContainer createHeader(String headerId) {
return initSearch(headerId);
}
@Override
public String getAdditionalBoxCssClasses() {
return ObjectListPanel.this.getAdditionalBoxCssClasses();
}
@Override
protected WebMarkupContainer createButtonToolbar(String id) {
WebMarkupContainer bar = ObjectListPanel.this.createTableButtonToolbar(id);
return bar != null ? bar : super.createButtonToolbar(id);
}
};
table.setOutputMarkupId(true);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
table.setCurrentPage(storage.getPaging());
}
}
return table;
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ProcessInstancesPanel method initLayout.
private void initLayout(UserProfileStorage.TableId tableId, int pageSize, View view, final IModel<String> currentInstanceIdModel) {
BoxedTablePanel<ProcessInstanceDto> table = new BoxedTablePanel<ProcessInstanceDto>(ID_REQUESTS_TABLE, provider, initColumns(view), tableId, pageSize) {
@Override
protected Item<ProcessInstanceDto> customizeNewRowItem(Item<ProcessInstanceDto> item, final IModel<ProcessInstanceDto> rowModel) {
item.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (currentInstanceIdModel == null || currentInstanceIdModel.getObject() == null) {
return "";
}
ProcessInstanceDto rowDto = rowModel.getObject();
if (currentInstanceIdModel.getObject().equals(rowDto.getProcessInstanceId())) {
return "info";
} else {
return "";
}
}
}));
return item;
}
};
table.setOutputMarkupId(true);
table.setAdditionalBoxCssClasses("without-box-header-top-border");
add(table);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ResourceDetailsTabPanel method initLayout.
protected void initLayout(IModel model, PageBase parentPage) {
PrismObject<ResourceType> resourceObject = (PrismObject<ResourceType>) model.getObject();
ResourceType resource = resourceObject.asObjectable();
add(createLastAvailabilityStatusInfo(resource));
add(createSourceTargetInfo(resource));
add(createSchemaStatusInfo(resource));
CapabilitiesPanel capabilities = new CapabilitiesPanel(PANEL_CAPABILITIES, capabilitiesModel);
add(capabilities);
List<ResourceConfigurationDto> resourceConfigList = createResourceConfigList(resource);
ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<ResourceConfigurationDto>(ResourceDetailsTabPanel.this, new ListModel<ResourceConfigurationDto>(resourceConfigList));
List<ColumnTypeDto<String>> columns = Arrays.asList(new ColumnTypeDto<String>("ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart()), new ColumnTypeDto<String>("ShadowType.objectClass", "objectTypeDefinition.objectClass.localPart", ShadowType.F_OBJECT_CLASS.getLocalPart()), new ColumnTypeDto<String>("ShadowType.intent", "objectTypeDefinition.intent", ShadowType.F_INTENT.getLocalPart()), new ColumnTypeDto<String>("ResourceType.isSync", "sync", null));
List<IColumn<SelectableBean<ResourceType>, String>> tableColumns = ColumnUtils.createColumns(columns);
PropertyColumn tasksColumn = new PropertyColumn(PageBase.createStringResourceStatic(this, "ResourceType.tasks"), "definedTasks") {
@Override
public void populateItem(Item item, String componentId, final IModel rowModel) {
ResourceConfigurationDto conf = (ResourceConfigurationDto) rowModel.getObject();
RepeatingView repeater = new RepeatingView(componentId);
for (final TaskType task : conf.getDefinedTasks()) {
repeater.add(new LinkPanel(repeater.newChildId(), new Model<String>(task.getName().getOrig())) {
@Override
public void onClick(AjaxRequestTarget target) {
ResourceDetailsTabPanel.this.taskDetailsPerformed(target, task.getOid());
}
});
}
item.add(repeater);
}
};
tableColumns.add(tasksColumn);
BoxedTablePanel<ResourceConfigurationDto> resourceConfig = new BoxedTablePanel("resourceConfig", resourceConfigProvider, tableColumns);
resourceConfig.setAdditionalBoxCssClasses("box-success");
add(resourceConfig);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class PageCertDecisions method initLayout.
//endregion
//region Layout
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
CertWorkItemDtoProvider provider = createProvider();
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL);
BoxedTablePanel<CertWorkItemDto> table = new BoxedTablePanel<CertWorkItemDto>(ID_DECISIONS_TABLE, provider, initColumns(), UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL, itemsPerPage) {
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new SearchFragment(headerId, ID_TABLE_HEADER, PageCertDecisions.this, showNotDecidedOnlyModel);
}
};
table.setShowPaging(true);
table.setOutputMarkupId(true);
// really don't know why this is necessary, as e.g. in PageRoles the size setting works without it
table.setItemsPerPage(itemsPerPage);
mainForm.add(table);
// adding this on outer feedback panel prevents displaying the error messages
//addVisibleOnWarningBehavior(getMainFeedbackPanel());
//addVisibleOnWarningBehavior(getTempFeedbackPanel());
}
Aggregations