use of org.activiti.explorer.data.MapItem in project Activiti by Activiti.
the class TableDataQuery method loadItems.
public List<Item> loadItems(int start, int count) {
TablePageQuery query = managementService.createTablePageQuery().tableName(tableName);
if (sortPropertyIds != null && sortPropertyIds.length > 0) {
for (int i = 0; i < sortPropertyIds.length; i++) {
// all container properties for table data are Strings
String column = (String) sortPropertyIds[i];
if (sortPropertyIdsAscending[i] == true) {
query.orderAsc(column);
} else {
query.orderDesc(column);
}
}
}
List<Map<String, Object>> rows = query.listPage(start, count).getRows();
List<Item> items = new ArrayList<Item>();
for (Map<String, Object> row : rows) {
HashMap<String, Object> newRow = new HashMap<String, Object>();
for (Entry<String, Object> rowEntry : row.entrySet()) {
String key = rowEntry.getKey();
if (key != null) {
key = key.toUpperCase();
}
newRow.put(key, rowEntry.getValue());
}
items.add(new MapItem(newRow));
}
return items;
}