Ignore:
Timestamp:
Feb 13, 2015, 5:10:11 PM (9 years ago)
Author:
casties
Branch:
default
Message:

make admin ui view of all annotations scale better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java

    r91 r101  
    8585            // no id -- send all annotations
    8686            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"));
    8989            String sortBy = form.getFirstValue("sortBy");
    9090            return getAllAnnotations(authUser, limit, offset, sortBy);
     
    113113
    114114        // read all annotations
    115         List<Annotation> annotations = store.getAnnotations(null, null);
     115        List<Annotation> annotations = store.getAnnotations(null, null, 0, 0);
    116116        for (Annotation annotation : annotations) {
    117117            // check permission
     
    131131        JSONArray rows = new JSONArray();
    132132        int cnt = 0;
     133        int max = limit + offset;
    133134        for (JSONObject result : results) {
    134135            cnt += 1;
    135             if (offset > 0 && cnt < offset)
    136                 continue;
     136            if (cnt < offset) continue;
    137137            rows.put(result);
    138             if (limit > 0 && cnt >= limit)
    139                 break;
     138            if (limit > 0 && cnt >= max) break;
    140139        }
    141140
Note: See TracChangeset for help on using the changeset viewer.