Changeset 101:7268c3ca025b in AnnotationManagerN4J for src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
r91 r101 85 85 // no id -- send all annotations 86 86 Form form = getRequest().getResourceRef().getQueryAsForm(); 87 int limit = getInt(form.getFirstValue("limit" ));88 int offset = getInt(form.getFirstValue("offset" ));87 int limit = getInt(form.getFirstValue("limit", "1000")); 88 int offset = getInt(form.getFirstValue("offset", "0")); 89 89 String sortBy = form.getFirstValue("sortBy"); 90 90 return getAllAnnotations(authUser, limit, offset, sortBy); … … 113 113 114 114 // read all annotations 115 List<Annotation> annotations = store.getAnnotations(null, null );115 List<Annotation> annotations = store.getAnnotations(null, null, 0, 0); 116 116 for (Annotation annotation : annotations) { 117 117 // check permission … … 131 131 JSONArray rows = new JSONArray(); 132 132 int cnt = 0; 133 int max = limit + offset; 133 134 for (JSONObject result : results) { 134 135 cnt += 1; 135 if (offset > 0 && cnt < offset) 136 continue; 136 if (cnt < offset) continue; 137 137 rows.put(result); 138 if (limit > 0 && cnt >= limit) 139 break; 138 if (limit > 0 && cnt >= max) break; 140 139 } 141 140
Note: See TracChangeset
for help on using the changeset viewer.