use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ResourceDetailsTabPanel method initLayout.
protected void initLayout() {
PrismObject<ResourceType> resourceObject = getModelObject();
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<>(ResourceDetailsTabPanel.this, new ListModel<>(resourceConfigList));
List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = new ArrayList<>();
tableColumns.add(ColumnUtils.createPropertyColumn(new ColumnTypeDto<>("ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart())));
tableColumns.add(new PropertyColumn<>(createStringResource("ShadowType.objectClass"), "objectTypeDefinition.objectClass") {
@Override
public IModel<?> getDataModel(IModel<SelectableBeanImpl<ResourceType>> rowModel) {
IModel<QName> model = (IModel<QName>) super.getDataModel(rowModel);
if (model.getObject() != null) {
return () -> model.getObject().getLocalPart();
}
return model;
}
});
List<ColumnTypeDto<String>> columns = Arrays.asList(new ColumnTypeDto<>("ShadowType.intent", "objectTypeDefinition.intent", ShadowType.F_INTENT.getLocalPart()), new ColumnTypeDto<>("ResourceType.isSync", "sync", null));
tableColumns.addAll(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 AjaxLinkPanel(repeater.newChildId(), new Model<>(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 ResourceDetailsTabPanel method initLayout.
protected void initLayout() {
// PrismObject<ResourceType> resourceObject = getObjectWrapper().getObject();
// ResourceType resource = resourceObject.asObjectable();
add(createLastAvailabilityStatusInfo());
add(createSourceTargetInfo());
add(createSchemaStatusInfo());
CapabilitiesPanel capabilities = new CapabilitiesPanel(PANEL_CAPABILITIES, capabilitiesModel);
add(capabilities);
ListDataProvider<ResourceConfigurationDto> resourceConfigProvider = new ListDataProvider<>(ResourceDetailsTabPanel.this, createResourceConfigListModel());
List<IColumn<SelectableBeanImpl<ResourceType>, String>> tableColumns = new ArrayList<>();
tableColumns.add(ColumnUtils.createPropertyColumn(new ColumnTypeDto<>("ShadowType.kind", "objectTypeDefinition.kind", ShadowType.F_KIND.getLocalPart())));
tableColumns.add(new PropertyColumn<>(createStringResource("ShadowType.objectClass"), "objectTypeDefinition.objectClass") {
@Override
public IModel<?> getDataModel(IModel<SelectableBeanImpl<ResourceType>> rowModel) {
IModel<QName> model = (IModel<QName>) super.getDataModel(rowModel);
if (model.getObject() != null) {
return () -> model.getObject().getLocalPart();
}
return model;
}
});
List<ColumnTypeDto<String>> columns = Arrays.asList(new ColumnTypeDto<>("ShadowType.intent", "objectTypeDefinition.intent", ShadowType.F_INTENT.getLocalPart()), new ColumnTypeDto<>("ResourceType.isSync", "sync", null));
tableColumns.addAll(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 AjaxLinkPanel(repeater.newChildId(), new Model<>(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 TaskErrorsPanel method initLayoutOld.
private void initLayoutOld() {
SelectableBeanObjectDataProvider<? extends ObjectType> provider = new SelectableBeanObjectDataProvider<>(this, null) {
@Override
protected String getDefaultSortParam() {
return TaskErrorSelectableBeanImplOld.F_ERROR_TIMESTAMP;
}
@Override
protected SortOrder getDefaultSortOrder() {
return SortOrder.DESCENDING;
}
@Override
public SelectableBean<ObjectType> createDataObjectWrapper(ObjectType obj) {
return new TaskErrorSelectableBeanImplOld<>(obj, getObjectWrapper().getOid());
}
@Override
public ObjectQuery getQuery() {
return createContentQuery(getObjectWrapper().getOid(), getPageBase());
}
@NotNull
@Override
protected List<ObjectOrdering> createObjectOrderings(SortParam<String> sortParam) {
if (sortParam != null && sortParam.getProperty() != null) {
OrderDirection order = sortParam.isAscending() ? OrderDirection.ASCENDING : OrderDirection.DESCENDING;
ItemPath ordering;
if (sortParam.getProperty().equals(TaskErrorSelectableBeanImplOld.F_ERROR_TIMESTAMP)) {
ordering = ItemPath.create("operationExecution", "timestamp");
} else {
ordering = ItemPath.create(new QName(SchemaConstantsGenerated.NS_COMMON, sortParam.getProperty()));
}
return Collections.singletonList(getPrismContext().queryFactory().createOrdering(ordering, order));
} else {
return Collections.emptyList();
}
}
@Override
public Class<ObjectType> getType() {
return ObjectType.class;
}
};
BoxedTablePanel<TaskErrorSelectableBeanImplOld<ObjectType>> table = new BoxedTablePanel<>(ID_TASK_ERRORS, provider, initColumnsOld());
table.setOutputMarkupId(true);
add(table);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ActivitiesItemProcessingPanel method initLayoutNew.
private void initLayoutNew() {
ListView<ActivityItemProcessingDto> activitiesView = new ListView<>(ID_ACTIVITIES, new PropertyModel<>(getModel(), ActivitiesItemProcessingDto.F_ACTIVITIES)) {
@Override
protected void populateItem(ListItem<ActivityItemProcessingDto> listItem) {
IModel<ActivityItemProcessingDto> itemProcessingModel = listItem.getModel();
Label summary = new Label(ID_SUMMARY, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_TITLE));
summary.setOutputMarkupId(true);
listItem.add(summary);
Label wallClockThroughput = new Label(ID_WALL_CLOCK_THROUGHPUT, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_WALL_CLOCK_THROUGHPUT));
summary.setOutputMarkupId(true);
listItem.add(wallClockThroughput);
ChartJsPanel<PieChartConfiguration> chartPanel = new ChartJsPanel<>(ID_CHART, PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CHART));
listItem.add(chartPanel);
chartPanel.add(new VisibleBehaviour(() -> itemProcessingModel.getObject().getTotalCount() > 0));
PropertyModel<List<ProcessedItemDto>> currentItemsModel = PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_CURRENT_ITEMS);
BoxedTablePanel<ProcessedItemDto> currentItems = new BoxedTablePanel<>(ID_CURRENT_ITEMS, new ListDataProvider<>(ActivitiesItemProcessingPanel.this, currentItemsModel), createCurrentItemsColumns()) {
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
public String getAdditionalBoxCssClasses() {
return " box-info ";
}
};
currentItems.setOutputMarkupId(true);
currentItems.add(new VisibleBehaviour(() -> CollectionUtils.isNotEmpty(currentItemsModel.getObject())));
listItem.add(currentItems);
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SUCCESS_BOX), ID_SUCCESS_ITEM));
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_FAILED_BOX), ID_FAILED_ITEM));
listItem.add(createInfoBoxPanel(PropertyModel.of(itemProcessingModel, ActivityItemProcessingDto.F_SKIP_BOX), ID_SKIPPED_ITEM));
}
};
activitiesView.setOutputMarkupId(true);
add(activitiesView);
}
use of com.evolveum.midpoint.web.component.data.BoxedTablePanel in project midpoint by Evolveum.
the class ActivitiesStatisticsPanel method addActionsExecutedTablePanel.
private void addActionsExecutedTablePanel(String id, String titleId, String modelField) {
ListDataProvider<ObjectActionsExecutedEntryType> dataProvider = new ListDataProvider<>(this, PropertyModel.of(statisticsModel, modelField));
BoxedTablePanel<ObjectActionsExecutedEntryType> actionTable = new BoxedTablePanel<>(id, dataProvider, createActionEntryColumns()) {
@Override
protected boolean hideFooterIfSinglePage() {
return true;
}
@Override
protected WebMarkupContainer createHeader(String headerId) {
return new Fragment(headerId, titleId, ActivitiesStatisticsPanel.this);
}
};
actionTable.setOutputMarkupId(true);
actionTable.add(new VisibleBehaviour(() -> !dataProvider.getAvailableData().isEmpty() || dataProvider.size() > 0));
add(actionTable);
}
Aggregations