use of com.evolveum.midpoint.prism.query.OrderDirection 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.prism.query.OrderDirection 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