Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.ObjectMapper.createObjectNode()


    resultObj.put("status", "200 OK");
    resultObj.put("prefix", prefix);
   
    ArrayNode resultArr = mapper.createArrayNode();
    for(SearchResultItem item: results){
      ObjectNode resultItemObj = mapper.createObjectNode();
      resultItemObj.put("id", item.getId());
      resultItemObj.put("name", item.getName());
     
      //FIXME id is used instead of type to enable the suggest autocomplete to function as it doesn't work when no type is given
      ObjectNode tmpObj = mapper.createObjectNode();
View Full Code Here


      ObjectNode resultItemObj = mapper.createObjectNode();
      resultItemObj.put("id", item.getId());
      resultItemObj.put("name", item.getName());
     
      //FIXME id is used instead of type to enable the suggest autocomplete to function as it doesn't work when no type is given
      ObjectNode tmpObj = mapper.createObjectNode();
      tmpObj.put("id", item.getId());
      tmpObj.put("name", item.getId());
      resultItemObj.put("type", tmpObj);     
     
      resultArr.add(resultItemObj);
View Full Code Here

  }
 
  @Override
  public ObjectNode jsonizeHtml(String html, String id){
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode resultObj = mapper.createObjectNode();
    resultObj.put("html",html);
    resultObj.put("id", id);
   
   
   
View Full Code Here

        }
  }
 
  private ObjectNode getResponse(ReconciliationResponse response, PrefixManager prefixManager) {
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode responseObj = mapper.createObjectNode();
    ArrayNode resultArr = mapper.createArrayNode();
    for(ReconciliationCandidate result:response.getResults()){
      ObjectNode resultItemObj = getResultItem(result,prefixManager);
      resultArr.add(resultItemObj);
    }
View Full Code Here

    return responseObj;
  }
 
  private ObjectNode getResultItem(ReconciliationCandidate item, PrefixManager prefixManager){
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode resultItemObj = mapper.createObjectNode();
    resultItemObj.put("id", item.getId());
    resultItemObj.put("name", item.getName());
    resultItemObj.put("score", item.getScore());
    resultItemObj.put("match", item.isMatch());
View Full Code Here

    ArrayNode typesArr = mapper.createArrayNode();
    for(int i=0;i<item.getTypes().length;i++){
      String id = item.getTypes()[i];
      int index = getNamespaceEndPosition(id);
      String prefix = prefixManager.getPrefix(id.substring(0,index));
      ObjectNode typeObj = mapper.createObjectNode();
      typeObj.put("id", id);
      if(prefix!=null){
        String localName = id.substring(index);
        typeObj.put("name", prefix +":" + localName);
      }else{
View Full Code Here

        ObjectMapper objectMapper = new ObjectMapper();
            InputStream input = new FileInputStream(buildPath() +File.separator+request.getParameter("fileName"));
            Definitions definitions = fixFlowConverter.getDefinitions("process_1", input);
            Process process = (Process)definitions.getRootElements().get(0);
        ObjectNode on = fixFlowConverter.convertDefinitions2Json(definitions);
        ObjectNode rootNode = objectMapper.createObjectNode();
        rootNode.put("name", process.getName());
        rootNode.put("description", process.getName());
        rootNode.put("modelId", process.getId());
        rootNode.put("model", on);
        out = response.getWriter();
View Full Code Here

        try {
            ObjectMapper mapper = new ObjectMapper();
            if (StringUtils.equalsIgnoreCase(syncType, "bi-directional") || StringUtils.equalsIgnoreCase(syncType, "pull")) {

                ObjectNode pull = mapper.createObjectNode();
                pull.put("_id", "couchapp-takeout-" + localDbName + "-pull");
                pull.put("source", src_fullurl);
                pull.put("target", localDbName);
                pull.put("continuous", true);
                if (StringUtils.isNotEmpty(pullFilter)) {
View Full Code Here

                }
                rep_db.create(pull);
            }
            if (StringUtils.equalsIgnoreCase(syncType, "bi-directional") || StringUtils.equalsIgnoreCase(syncType, "push")) {
                // other direction
                ObjectNode push = mapper.createObjectNode();
                push.put("_id", "couchapp-takeout-" + localDbName + "-push");
                push.put("target", src_fullurl);
                push.put("source", localDbName);
                push.put("continuous", true);
                if (StringUtils.isNotEmpty(pushFilter)) {
View Full Code Here

        // put a local doc to so the app can query to see if it is running local
        String syncType = design.get("advanced").get("syncType").getTextValue();
        try {
            ObjectMapper mapper = new ObjectMapper();
            ObjectNode takeoutLocal = mapper.createObjectNode();
            takeoutLocal.put("_id", "_local/takeout");
            takeoutLocal.put("source", getSrcReplicationUrl(false));
            takeoutLocal.put("syncType", syncType);
            couchDbInstance.getConnection().put("/" + db.getDatabaseName() + "/_local/takeout", takeoutLocal.toString());
        } catch (Exception ex) {
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.