Package org.apache.jackrabbit.mk.json

Examples of org.apache.jackrabbit.mk.json.JsopBuilder


            this.depth = Integer.MAX_VALUE;
        }
    }

    JsopDiff(BlobSerializer blobs, String path) {
        this(new JsopBuilder(), blobs, path, Integer.MAX_VALUE);
    }
View Full Code Here


    JsopDiff(BlobSerializer blobs) {
        this(blobs, "/");
    }

    JsopDiff(String path, int depth) {
        this(new JsopBuilder(), new BlobSerializer(), path, depth);
    }
View Full Code Here

                && revision.timestamp >= since) {
            list.addFirst(revision);
            revision = revision.base;
        }

        JsopBuilder json = new JsopBuilder();
        json.array();
        int count = 0;
        for (Revision rev : list) {
            if (!rev.hasPathChanged(path)) {
                if (count++ > maxEntries) {
                    break;
                }
                json.object();
                json.key("id").value(rev.id);
                json.key("ts").value(rev.timestamp);
                json.key("msg").value(rev.message);
                json.endObject();
            }
        }
        json.endArray();
        return json.toString();
    }
View Full Code Here

                break;
            }
            revision = revision.base;
        }

        JsopBuilder json = new JsopBuilder();
        json.array();
        for (Revision rev : list) {
            String jsop = rev.getPathChanges(path, blobSerializer);
            if (!jsop.isEmpty()) {
                json.object();
                json.key("id").value(rev.id);
                json.key("ts").value(rev.timestamp);
                json.key("msg").value(rev.message);
                json.key("changes").value(jsop);
                json.endObject();
            }
        }
        json.endArray();
        return json.toString();
    }
View Full Code Here

    }

    JsonSerializer(
            int depth, long offset, int maxChildNodes,
            String filter, BlobSerializer blobs) {
        this(new JsopBuilder(), depth, offset, maxChildNodes,
                new JsonFilter(filter), blobs);
    }
View Full Code Here

    private final JsopBuilder builder;

    private final BlobSerializer blobs;

    CommitDiff(@Nonnull Commit commit, @Nonnull BlobSerializer blobs) {
        this(checkNotNull(commit), "/", new JsopBuilder(), checkNotNull(blobs));
    }
View Full Code Here

                assertEquals(s, s2);
            }
            if (s.indexOf('/') >= 0) {
                continue;
            }
            JsopBuilder jsop = new JsopBuilder();
            jsop.tag('+').key(s).object().key(s).value("x").endObject();
            rev = mk.commit("/", jsop.toString(),
                    null, null);
            nodes = mk.getNodes("/" + s, rev, 0, 0, 100, null);
            jsop = new JsopBuilder();
            jsop.object().key(s).value("x").
                    key(":childNodeCount").value(0).endObject();
            String n = jsop.toString();
            assertEquals(n, nodes);
            nodes = mk.getNodes("/", rev, 0, 0, 100, null);
            jsop = new JsopBuilder();
            jsop.object().key(s).object().endObject().
            key(":childNodeCount").value(1).endObject();
            n = jsop.toString();
            assertEquals(n, nodes);
            jsop = new JsopBuilder();
            jsop.tag('-').value(s);
            rev = mk.commit("/", jsop.toString(), rev, null);
           
        }
    }
View Full Code Here

            String x2 = Utils.escapePropertyName(s);
            String s2 = Utils.unescapePropertyName(x2);
            if (!s.equals(s2)) {
                assertEquals(s, s2);
            }
            JsopBuilder jsop = new JsopBuilder();
            jsop.tag('+').key(s).object().key(s).value("x").endObject();
            rev = mk.commit("/", jsop.toString(),
                    null, null);
            nodes = mk.getNodes("/" + s, rev, 0, 0, 10, null);
            jsop = new JsopBuilder();
            jsop.object().key(s).value("x").
                    key(":childNodeCount").value(0).endObject();
            String n = jsop.toString();
            assertEquals(n, nodes);
            nodes = mk.getNodes("/", rev, 0, 0, 10, null);
            jsop = new JsopBuilder();
            jsop.object().key(s).object().endObject().
            key(":childNodeCount").value(1).endObject();
            n = jsop.toString();
            assertEquals(n, nodes);
            jsop = new JsopBuilder();
            jsop.tag('-').value(s);
            rev = mk.commit("/", jsop.toString(), rev, null);
        }
    }
View Full Code Here

            stagedTree.add(parentNodePath, nodeName, node);
        }

        @Override
        String asDiff() {
            JsopBuilder diff = new JsopBuilder();
            diff.tag('+').key(PathUtils.concat(parentNodePath, nodeName));
            node.toJson(diff);
            return diff.toString();
        }
View Full Code Here

            stagedTree.remove(nodePath);
        }

        @Override
        String asDiff() {
            JsopBuilder diff = new JsopBuilder();
            diff.tag('-').value(nodePath);
            return diff.toString();
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.json.JsopBuilder

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.