Package com.dotcms.repackage.org.codehaus.jettison.json

Examples of com.dotcms.repackage.org.codehaus.jettison.json.JSONArray


   
 
   
        // get our JSON Going
        JSONObject json = new JSONObject()
    JSONArray jsonCons = new JSONArray()

    for(Contentlet c : cons){
     
     
      try {
       
        jsonCons.put(contentletToJSON(c));
       
      } catch (Exception e) {
        Logger.error(this.getClass(), "unable JSON contentlet " + c.getIdentifier());
        Logger.debug(this.getClass(), "unable to find contentlet", e);
      }
View Full Code Here


    }
    try {
      if (jsonString.startsWith("{"))
        new JSONObject(jsonString);
      else if (jsonString.startsWith("["))
        new JSONArray(jsonString);

      return true;
    } catch (Exception e) {
      return false;
    }
View Full Code Here

    paramsMap.put( "callback", callback );
    //Creating an utility response object
    ResourceResponse responseResource = new ResourceResponse( paramsMap );

    List<ContentletSearch> searchIndex = APILocator.getContentletAPI().searchIndex(query, limit, offset, sortBy, initData.getUser(), true);
    JSONArray array=new JSONArray();
    for(ContentletSearch cs : searchIndex) {
      array.put(new JSONObject()
      .put("inode", cs.getInode())
      .put("identifier", cs.getIdentifier()));
    }

    return responseResource.response( array.toString() );
  }
View Full Code Here

    return json.toString();
  }

  private String getJSON(List<Contentlet> cons, HttpServletRequest request, HttpServletResponse response, String render) throws IOException{
    JSONObject json = new JSONObject();
    JSONArray jsonCons = new JSONArray();

    for(Contentlet c : cons){
      try {
        jsonCons.put(contentletToJSON(c, request, response, render));
      } catch (Exception e) {
        Logger.warn(this.getClass(), "unable JSON contentlet " + c.getIdentifier());
        Logger.debug(this.getClass(), "unable to find contentlet", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.codehaus.jettison.json.JSONArray

Copyright © 2018 www.massapicom. 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.