use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImplOld in project midpoint by Evolveum.
the class TaskErrorsTabPanel method initColumnsOld.
private List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> initColumnsOld() {
List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.objectName"), TaskErrorSelectableBeanImplOld.F_OBJECT_REF_NAME) {
@Override
public String getSortProperty() {
return "name";
}
});
columns.add(new AbstractColumn<>(createStringResource("pageTaskEdit.taskErros.timestamp"), TaskErrorSelectableBeanImplOld.F_ERROR_TIMESTAMP) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<TaskErrorSelectableBeanImplOld<ObjectType>>> cellItem, String componentId, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> 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"), TaskErrorSelectableBeanImplOld.F_STATUS));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.message"), TaskErrorSelectableBeanImplOld.F_MESSAGE));
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.recordType"), TaskErrorSelectableBeanImplOld.F_RECORD_TYPE));
columns.add(new AjaxLinkColumn<>(createStringResource("pageTaskEdit.taskErros.realOwner"), TaskErrorSelectableBeanImplOld.F_REAL_OWNER_DESCRIPTION) {
@Override
public void onClick(AjaxRequestTarget target, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> rowModel) {
TaskErrorSelectableBeanImplOld<ObjectType> object = rowModel.getObject();
PrismObject<ObjectType> realOwner = object.getRealOwner();
WebComponentUtil.dispatchToObjectDetailsPage(realOwner.getCompileTimeClass(), realOwner.getOid(), TaskErrorsTabPanel.this, false);
}
});
return columns;
}
use of com.evolveum.midpoint.web.page.admin.server.dto.TaskErrorSelectableBeanImplOld in project midpoint by Evolveum.
the class TaskErrorsPanel method initColumnsOld.
private List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> initColumnsOld() {
List<IColumn<TaskErrorSelectableBeanImplOld<ObjectType>, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.objectName"), TaskErrorSelectableBeanImplOld.F_OBJECT_REF_NAME) {
@Override
public String getSortProperty() {
return "name";
}
});
columns.add(new AbstractColumn<>(createStringResource("pageTaskEdit.taskErros.timestamp"), TaskErrorSelectableBeanImplOld.F_ERROR_TIMESTAMP) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<TaskErrorSelectableBeanImplOld<ObjectType>>> cellItem, String componentId, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> 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"), TaskErrorSelectableBeanImplOld.F_STATUS));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.taskErros.message"), TaskErrorSelectableBeanImplOld.F_MESSAGE));
columns.add(new EnumPropertyColumn<>(createStringResource("pageTaskEdit.taskErros.recordType"), TaskErrorSelectableBeanImplOld.F_RECORD_TYPE));
columns.add(new AjaxLinkColumn<>(createStringResource("pageTaskEdit.taskErros.realOwner"), TaskErrorSelectableBeanImplOld.F_REAL_OWNER_DESCRIPTION) {
@Override
public void onClick(AjaxRequestTarget target, IModel<TaskErrorSelectableBeanImplOld<ObjectType>> rowModel) {
TaskErrorSelectableBeanImplOld<ObjectType> 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.TaskErrorSelectableBeanImplOld 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.page.admin.server.dto.TaskErrorSelectableBeanImplOld in project midpoint by Evolveum.
the class TaskErrorsTabPanel method initLayoutOld.
private void initLayoutOld() {
SelectableBeanObjectDataProvider<? extends ObjectType> provider = new SelectableBeanObjectDataProvider<>(this, null) {
@Override
public SelectableBean<ObjectType> createDataObjectWrapper(ObjectType obj) {
return new TaskErrorSelectableBeanImplOld<>(obj, getModelObject().getOid());
}
@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(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);
}
Aggregations