final String sortOrder = webSocketData.getSortOrder();
final String sortKey = webSocketData.getSortKey();
final int pageSize = webSocketData.getPageSize();
final int page = webSocketData.getPage();
final PropertyKey sortProperty = StructrApp.getConfiguration().getPropertyKeyForJSONName(type, sortKey);
final Query query = StructrApp.getInstance(securityContext).nodeQuery(type).includeDeletedAndHidden().sort(sortProperty).order("desc".equals(sortOrder));
// for image lists, suppress thumbnails
if (type.equals(Image.class)) {
query.and(Image.isThumbnail, false);
}
try {
// do search
List<AbstractNode> filteredResults = new LinkedList();
List<? extends GraphObject> resultList = query.getAsList();
// add only root folders to the list
for (GraphObject obj : resultList) {
if (obj instanceof AbstractNode) {