- protected JsonObject createJsonObject(Request request) {
- /* load Sones. */
- boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "true"));
- Set<Sone> sones = loadAllSones ? webInterface.getCore().getSones() : Collections.singleton(getCurrentSone(request.getToadletContext()));
- JsonArray jsonSones = new JsonArray();
+ protected JsonReturnObject createJsonObject(FreenetRequest request) {
+ final Sone currentSone = getCurrentSoneWithoutCreatingSession(request.getToadletContext());
+ /* load Sones. always return the status of the current Sone. */
+ Set<Sone> sones = new HashSet<Sone>(Collections.singleton(getCurrentSoneWithoutCreatingSession(request.getToadletContext())));
+ String loadSoneIds = request.getHttpRequest().getParam("soneIds");
+ if (loadSoneIds.length() > 0) {
+ String[] soneIds = loadSoneIds.split(",");
+ for (String soneId : soneIds) {
+ /* just add it, we skip null further down. */
+ sones.add(webInterface.getCore().getSone(soneId).orNull());
+ }
+ }
+ ArrayNode jsonSones = new ArrayNode(instance);