use of com.evolveum.prism.xml.ns._public.query_3.PagingType in project midpoint by Evolveum.
the class PagingConvertor method createPagingType.
public static PagingType createPagingType(ObjectPaging paging) {
if (paging == null) {
return null;
}
PagingType pagingType = new PagingType();
pagingType.setOrderDirection(toOrderDirectionType(paging.getDirection()));
pagingType.setMaxSize(paging.getMaxSize());
pagingType.setOffset(paging.getOffset());
if (paging.getOrderBy() != null) {
pagingType.setOrderBy(new ItemPathType(paging.getOrderBy()));
}
return pagingType;
}
use of com.evolveum.prism.xml.ns._public.query_3.PagingType in project midpoint by Evolveum.
the class TestQueryConvertor method testConvertQueryNullFilter.
@Test
public void testConvertQueryNullFilter() throws Exception {
ObjectQuery query = ObjectQuery.createObjectQuery(ObjectPaging.createPaging(0, 10));
QueryType queryType = QueryJaxbConvertor.createQueryType(query, getPrismContext());
assertNotNull(queryType);
assertNull(queryType.getFilter());
PagingType paging = queryType.getPaging();
assertNotNull(paging);
assertEquals(new Integer(0), paging.getOffset());
assertEquals(new Integer(10), paging.getMaxSize());
}
use of com.evolveum.prism.xml.ns._public.query_3.PagingType in project midpoint by Evolveum.
the class PagingTypeFactory method createPaging.
public static PagingType createPaging(int offset, int maxSize, OrderDirectionType order, String orderBy) {
PagingType paging = new PagingType();
paging.setOffset(offset);
paging.setMaxSize(maxSize);
if (order != null && StringUtils.isNotEmpty(orderBy)) {
paging.setOrderBy(fillPropertyReference(orderBy));
paging.setOrderDirection(order);
}
return paging;
}
use of com.evolveum.prism.xml.ns._public.query_3.PagingType in project midpoint by Evolveum.
the class ContainerableListPanel method setDefaultSorting.
protected void setDefaultSorting(ISelectableDataProvider<C, PO> provider) {
if (provider instanceof SortableDataProvider && isCollectionViewPanel() && getObjectCollectionView().getPaging() != null && getObjectCollectionView().getPaging().getOrderBy() != null) {
PagingType paging = getObjectCollectionView().getPaging();
boolean ascending = !OrderDirectionType.DESCENDING.equals(paging.getOrderDirection());
ItemPath orderBy = paging.getOrderBy().getItemPath();
ItemName name = orderBy.lastName();
if (name == null) {
return;
}
((SortableDataProvider) provider).setSort(new SortParam(name.getLocalPart(), ascending));
}
}
use of com.evolveum.prism.xml.ns._public.query_3.PagingType in project midpoint by Evolveum.
the class TestQueryConverter method testConvertQueryNullFilter.
@Test
public void testConvertQueryNullFilter() throws Exception {
ObjectQuery query = getQueryFactory().createQuery(getQueryFactory().createPaging(0, 10));
QueryType queryType = getQueryConverter().createQueryType(query);
assertNotNull(queryType);
assertNull(queryType.getFilter());
PagingType paging = queryType.getPaging();
assertNotNull(paging);
assertEquals(Integer.valueOf(0), paging.getOffset());
assertEquals(Integer.valueOf(10), paging.getMaxSize());
}
Aggregations