Пример #1
0
  @Override
  public void onRefreshSummary() {
    cancelPendingSummaryRequest();
    String uri = resourceRequestBuilder.getResource();
    uri = removeQueryParam(uri, "limit");

    Map<String, String> args = Maps.newHashMap();
    args.put("resetCache", "true");
    limit = Math.max(getView().getLimit().intValue(), Math.min(MIN_LIMIT, entitiesCount));

    if (limit < entitiesCount) {
      args.put("limit", String.valueOf(limit));
    }

    String target = updateQueryParams(uri, args);
    resourceRequestBuilder.forResource(target);
    if (target.contains("_transient")) {
      // for script evaluation, we must use post so the script/categories are passed in the form,
      // otherwise the summary is incorrect
      resourceRequestBuilder.post();
    } else {
      resourceRequestBuilder.get();
    }

    onReset();
  }
Пример #2
0
  @Override
  public void onFullSummary() {
    getView().setLimit(entitiesCount);
    cancelPendingSummaryRequest();
    String uri = resourceRequestBuilder.getResource();
    uri = removeQueryParam(uri, "limit");
    Map<String, String> args = Maps.newHashMap();
    args.put("resetCache", "true");
    uri = updateQueryParams(uri, args);

    if (uri.contains("_transient")) {
      // for script evaluation, we must use post so the script/categories are passed in the form,
      // otherwise the summary is incorrect
      resourceRequestBuilder.forResource(uri).post();
    } else {
      resourceRequestBuilder.forResource(uri).get();
    }

    limit = entitiesCount;
    onReset();
  }