Examples of createObjectNode()


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

    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

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

        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

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

        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

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

                }
                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

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

        // 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

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

                String targetRev = design.get("_rev").getTextValue();
                int targetRevNum = parseRevNumber(targetRev);
                System.out.println("Target Rev: " + targetRev);
                design.remove("_rev");

                JsonNode attachments = mapper.createObjectNode();

                if (design.has("_attachments")) {
                    attachments = design.get("_attachments");
                }
                design.remove("_attachments");
View Full Code Here

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

        final ObjectMapper mapper = new ObjectMapper();

        final ArrayNode rootNode = mapper.createArrayNode();
        for (final Document doc : documents) {
            final Map<String, String> fieldUnicity = Maps.newHashMap();
            final ObjectNode docNode = mapper.createObjectNode();
            for (final IndexableField field : doc.getFields()) {
                if (fieldUnicity.containsKey(field.name()) || field.binaryValue() != null) {
                    continue;
                }
                fieldUnicity.put(field.name(), "");
View Full Code Here

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

    {
        ObjectMapper        mapper = new ObjectMapper();
        ArrayNode           arrayNode = mapper.createArrayNode();
        for ( String name : serviceNames.getNames() )
        {
            ObjectNode      node = mapper.createObjectNode();
            node.put("name", name);
            arrayNode.add(node);
        }

        mapper.writer().writeValue(entityStream, arrayNode);
View Full Code Here

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

        .inputStreamToString(VersionedAvroEntityMapper.class
            .getResourceAsStream("/ManagedSchemaEntityVersion.avsc"));

    JsonNode jsonNode = rawSchemaAsJsonNode(avroSchemaString);
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode mappingNode = mapper.createObjectNode();
    mappingNode.put("type", "column");
    mappingNode.put("value", "_s:sv_" + entityName);
    ((ObjectNode)jsonNode.get("fields").get(0)).put("mapping", mappingNode);
    return jsonNode.toString();
  }
View Full Code Here

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

        .inputStreamToString(VersionedAvroEntityMapper.class
            .getResourceAsStream("/ManagedSchemaEntityVersion.avsc"));

    JsonNode jsonNode = rawSchemaAsJsonNode(avroSchemaString);
    ObjectMapper mapper = new ObjectMapper();
    ObjectNode mappingNode = mapper.createObjectNode();
    mappingNode.put("type", "column");
    mappingNode.put("value", "_s:sv_" + entityName);
    ((ObjectNode)jsonNode.get("fields").get(0)).put("mapping", mappingNode);
    return jsonNode.toString();
  }
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.