Package org.myphotodiary.json

Examples of org.myphotodiary.json.JsonObject.addParameter()


      // Create Json response
      JsonObject rsp = new JsonObject();
      // Get the directory specific data
      if ((directory != null) && (directory.isIndexingAllowedBoolean())) {
        if (directory.getDescription() != null) {
          rsp.addParameter(Configuration.dirDescParam, directory.getDescription());
        }
        if (directory.getLatitude() != null) {
          rsp.addParameter(Configuration.latParam, directory.getLatitude());
        }
        if (directory.getLongitude() != null) {
View Full Code Here


      if ((directory != null) && (directory.isIndexingAllowedBoolean())) {
        if (directory.getDescription() != null) {
          rsp.addParameter(Configuration.dirDescParam, directory.getDescription());
        }
        if (directory.getLatitude() != null) {
          rsp.addParameter(Configuration.latParam, directory.getLatitude());
        }
        if (directory.getLongitude() != null) {
          rsp.addParameter(Configuration.lngParam, directory.getLongitude());
        }
        if (directory.getDate() != null) {
View Full Code Here

        }
        if (directory.getLatitude() != null) {
          rsp.addParameter(Configuration.latParam, directory.getLatitude());
        }
        if (directory.getLongitude() != null) {
          rsp.addParameter(Configuration.lngParam, directory.getLongitude());
        }
        if (directory.getDate() != null) {
          rsp.addParameter(Configuration.dirDateParam, directory.getDate());
        }
        rsp.addParameter(Configuration.groupParam,
View Full Code Here

        }
        if (directory.getLongitude() != null) {
          rsp.addParameter(Configuration.lngParam, directory.getLongitude());
        }
        if (directory.getDate() != null) {
          rsp.addParameter(Configuration.dirDateParam, directory.getDate());
        }
        rsp.addParameter(Configuration.groupParam,
            (directory.getGroup() == null ? Configuration.publicGroup : directory.getGroup().getGroupName()));

        List<Attribute> dirAttributes = directory.getAttributes();
View Full Code Here

          rsp.addParameter(Configuration.lngParam, directory.getLongitude());
        }
        if (directory.getDate() != null) {
          rsp.addParameter(Configuration.dirDateParam, directory.getDate());
        }
        rsp.addParameter(Configuration.groupParam,
            (directory.getGroup() == null ? Configuration.publicGroup : directory.getGroup().getGroupName()));

        List<Attribute> dirAttributes = directory.getAttributes();
        if (dirAttributes != null) {
          JsonArray attributes = new JsonArray();
View Full Code Here

        if (dirAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: dirAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
        rsp.addParameter(Configuration.dirDescParam, JsonEntity.NULL);
      }
View Full Code Here

          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
        rsp.addParameter(Configuration.dirDescParam, JsonEntity.NULL);
      }
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
      response.setContentType(Configuration.jsonContentType);
      response.setCharacterEncoding(Configuration.contentEncoding);
View Full Code Here

      }

      // Get the image specific data and map it to a Json response
      JsonObject rsp = updateImageData(img);
      if (img != null) {
        rsp.addParameter(Configuration.descParam, img.getDescription())
        .addParameter(Configuration.ratingParam, img.getRating())
        .addParameter(Configuration.dateParam, img.getDate().toString());
        List<Attribute> imgAttributes = img.getAttributes();
        if (imgAttributes != null) {
          JsonArray attributes = new JsonArray();
View Full Code Here

        if (imgAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: imgAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
        rsp.addParameter(Configuration.descParam, JsonEntity.NULL)
        .addParameter(Configuration.ratingParam, Image.NOT_RATED)
View Full Code Here

          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
        rsp.addParameter(Configuration.descParam, JsonEntity.NULL)
        .addParameter(Configuration.ratingParam, Image.NOT_RATED)
        .addParameter(Configuration.dateParam, JsonEntity.NULL);
      }
      getServletContext().log("Json response: " + rsp.toString());
      // Reply the Json response
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.