Package org.myphotodiary.json

Examples of org.myphotodiary.json.JsonArray.addItem()


        List<Attribute> dirAttributes = directory.getAttributes();
        if (dirAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: dirAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
View Full Code Here


        .addParameter(Configuration.dateParam, img.getDate().toString());
        List<Attribute> imgAttributes = img.getAttributes();
        if (imgAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: imgAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
View Full Code Here

      }

      // Create Json response
      JsonArray rsp = new JsonArray();
      for (Attribute attribute: attributes) {
        rsp.addItem(attribute.getName());
      }
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
      response.setContentType(Configuration.jsonContentType);
      response.setCharacterEncoding(Configuration.contentEncoding);
View Full Code Here

            + img.getDirectory().getPath() + "/" + img.getName());
        imgList.addItem(im);
        th.addParameter(Configuration.urlParam, cfg.getImageRootUrl(request)
            + img.getDirectory().getPath() + "/"
            + Configuration.thumbDirName + "/" + img.getName());
        thumbList.addItem(th);
      }
      rsp.addParameter(Configuration.imgListParam, imgList);
      rsp.addParameter(Configuration.thumbListParam, thumbList);
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
View Full Code Here

      }

      // Create Json response
      JsonArray rsp = new JsonArray();
      for (Attribute attribute: attributes) {
        rsp.addItem(attribute.getName());
      }
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
      response.setContentType(Configuration.jsonContentType);
      response.setCharacterEncoding(Configuration.contentEncoding);
View Full Code Here

            + img.getDirectory().getPath() + "/" + img.getName());
        imgList.addItem(im);
        th.addParameter(Configuration.urlParam, cfg.imageRootUrl
            + img.getDirectory().getPath() + "/"
            + Configuration.thumbDirName + "/" + img.getName());
        thumbList.addItem(th);
      }
      rsp.addParameter(Configuration.imgListParam, imgList);
      rsp.addParameter(Configuration.thumbListParam, thumbList);
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
View Full Code Here

        }
        List<Attribute> dirAttributes = directory.getAttributes();
        if (dirAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: dirAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
View Full Code Here

        .addParameter(Configuration.dateParam, img.getDate().toString());
        List<Attribute> imgAttributes = img.getAttributes();
        if (imgAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: imgAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
View Full Code Here

      JsonArray rsp = new JsonArray();
      for (Group group: groups) {
        try {
          // RBAC on the group
          AccessController.checkAuthorization(group, request, Action.browse, null);
          rsp.addItem(group.getGroupName());
        }
        catch (AuthorizationException ex) {
          // Group access not allowed, check the next one
        }
      }
View Full Code Here

      JsonArray rsp = new JsonArray();
      for (Group group: groups) {
        // RBAC on the group
        AccessController.checkAuthorization(group, request, Action.browse, null);

        rsp.addItem(group.getGroupName());
      }
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
      response.setContentType(Configuration.jsonContentType);
      response.setCharacterEncoding(Configuration.contentEncoding);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.