use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImpl in project midpoint by Evolveum.
the class TaskErrorsTabPanel method initLayoutNew.
private void initLayoutNew() {
var provider = new SelectableBeanContainerDataProvider<OperationExecutionType>(this, Model.of(), null, true) {
@Override
protected String getDefaultSortParam() {
return TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP;
}
@Override
protected SortOrder getDefaultSortOrder() {
return SortOrder.DESCENDING;
}
@Override
public SelectableBean<OperationExecutionType> createDataObjectWrapper(OperationExecutionType obj) {
return new TaskErrorSelectableBeanImpl(obj);
}
@Override
public ObjectQuery getQuery() {
return createContentQuery(getModelObject().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(TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP)) {
ordering = ItemPath.create(OperationExecutionType.F_TIMESTAMP);
} else if (sortParam.getProperty().equals("name")) {
// TODO why is this "name" and not TaskErrorSelectableBeanImpl.F_OBJECT_REF_NAME?
ordering = ItemPath.create(PrismConstants.T_PARENT, ObjectType.F_NAME);
} else {
// TODO this is actually not used
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<OperationExecutionType> getType() {
return OperationExecutionType.class;
}
};
BoxedTablePanel<?> table = new BoxedTablePanel<>(ID_TASK_ERRORS, provider, initColumns());
table.setOutputMarkupId(true);
add(table);
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImpl in project midpoint by Evolveum.
the class TaskErrorsPanel method initLayoutNew.
private void initLayoutNew() {
var provider = new SelectableBeanContainerDataProvider<OperationExecutionType>(this, Model.of(), null, true) {
@Override
protected String getDefaultSortParam() {
return TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP;
}
@Override
protected SortOrder getDefaultSortOrder() {
return SortOrder.DESCENDING;
}
@Override
public SelectableBean<OperationExecutionType> createDataObjectWrapper(OperationExecutionType obj) {
return new TaskErrorSelectableBeanImpl(obj);
}
@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(TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP)) {
ordering = ItemPath.create(OperationExecutionType.F_TIMESTAMP);
} else if (sortParam.getProperty().equals("name")) {
// TODO why is this "name" and not TaskErrorSelectableBeanImplNew.F_OBJECT_REF_NAME?
ordering = ItemPath.create(PrismConstants.T_PARENT, ObjectType.F_NAME);
} else {
// TODO this is actually not used
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<OperationExecutionType> getType() {
return OperationExecutionType.class;
}
};
BoxedTablePanel<?> table = new BoxedTablePanel<>(ID_TASK_ERRORS, provider, initColumnsNew());
table.setOutputMarkupId(true);
add(table);
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImpl in project midpoint by Evolveum.
the class TaskErrorsPanel method initColumnsNew.
private List<IColumn<TaskErrorSelectableBeanImpl, String>> initColumnsNew() {
List<IColumn<TaskErrorSelectableBeanImpl, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.objectName"), TaskErrorSelectableBeanImpl.F_OBJECT_REF_NAME) {
@Override
public String getSortProperty() {
return "name";
}
});
columns.add(new AbstractColumn<>(createStringResource("pageTaskEdit.taskErros.timestamp"), TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<TaskErrorSelectableBeanImpl>> cellItem, String componentId, IModel<TaskErrorSelectableBeanImpl> rowModel) {
Label label = new Label(componentId, (IModel<String>) () -> WebComponentUtil.getShortDateTimeFormattedValue(rowModel.getObject().getErrorTimestamp(), getPageBase()));
cellItem.add(label);
}
});
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.status"), TaskErrorSelectableBeanImpl.F_STATUS));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.message"), TaskErrorSelectableBeanImpl.F_MESSAGE));
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.recordType"), TaskErrorSelectableBeanImpl.F_RECORD_TYPE));
columns.add(new AjaxLinkColumn<>(createStringResource("pageTaskEdit.taskErros.realOwner"), TaskErrorSelectableBeanImpl.F_REAL_OWNER_DESCRIPTION) {
@Override
public void onClick(AjaxRequestTarget target, IModel<TaskErrorSelectableBeanImpl> rowModel) {
TaskErrorSelectableBeanImpl object = rowModel.getObject();
PrismObject<ObjectType> realOwner = object.getRealOwner();
WebComponentUtil.dispatchToObjectDetailsPage(realOwner.getCompileTimeClass(), realOwner.getOid(), TaskErrorsPanel.this, false);
}
});
return columns;
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImpl in project midpoint by Evolveum.
the class TaskErrorsTabPanel method initColumns.
private List<IColumn<TaskErrorSelectableBeanImpl, String>> initColumns() {
List<IColumn<TaskErrorSelectableBeanImpl, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.objectName"), TaskErrorSelectableBeanImpl.F_OBJECT_REF_NAME) {
@Override
public String getSortProperty() {
return "name";
}
});
columns.add(new AbstractColumn<>(createStringResource("pageTaskEdit.taskErros.timestamp"), TaskErrorSelectableBeanImpl.F_ERROR_TIMESTAMP) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<TaskErrorSelectableBeanImpl>> cellItem, String componentId, IModel<TaskErrorSelectableBeanImpl> rowModel) {
Label label = new Label(componentId, (IModel<String>) () -> WebComponentUtil.getShortDateTimeFormattedValue(rowModel.getObject().getErrorTimestamp(), getPageBase()));
cellItem.add(label);
}
});
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.status"), TaskErrorSelectableBeanImpl.F_STATUS));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.message"), TaskErrorSelectableBeanImpl.F_MESSAGE));
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.recordType"), TaskErrorSelectableBeanImpl.F_RECORD_TYPE));
columns.add(new AjaxLinkColumn<>(createStringResource("pageTaskEdit.taskErros.realOwner"), TaskErrorSelectableBeanImpl.F_REAL_OWNER_DESCRIPTION) {
@Override
public void onClick(AjaxRequestTarget target, IModel<TaskErrorSelectableBeanImpl> rowModel) {
TaskErrorSelectableBeanImpl object = rowModel.getObject();
PrismObject<ObjectType> realOwner = object.getRealOwner();
WebComponentUtil.dispatchToObjectDetailsPage(realOwner.getCompileTimeClass(), realOwner.getOid(), TaskErrorsTabPanel.this, false);
}
});
return columns;
}
Aggregations