Example #1
0
  @Override
  JSONStreamAware processRequest(HttpServletRequest req) {

    JSONArray assetIds = new JSONArray();
    for (Asset asset : Asset.getAllAssets()) {
      assetIds.add(Convert.toUnsignedLong(asset.getId()));
    }

    JSONObject response = new JSONObject();
    response.put("assetIds", assetIds);
    return response;
  }
Example #2
0
  @Override
  JSONStreamAware processRequest(HttpServletRequest req) {

    JSONObject response = new JSONObject();
    JSONArray assetsJSONArray = new JSONArray();
    response.put("assets", assetsJSONArray);
    for (Asset asset : Asset.getAllAssets()) {
      assetsJSONArray.add(JSONData.asset(asset));
    }
    return response;
  }