Examples of JsopReader


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

    }

    @Override
    public JsopReader diffStream(String fromRevisionId, String toRevisionId, String path) {
        rightsRevision = getHeadRevision();
        JsopReader diff = mk.diffStream(fromRevisionId, toRevisionId, path);
        if (admin) {
            return diff;
        }
        return filterDiff(diff, toRevisionId);
    }
View Full Code Here

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

    public JsopReader getNodesStream(String path, String revisionId, int depth, long offset, int count, String filter) {
        rightsRevision = getHeadRevision();
        if (!checkRights(path, false)) {
            return null;
        }
        JsopReader t = mk.getNodesStream(path, revisionId, depth, offset, count, filter);
        if (admin || t == null) {
            return t;
        }
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0);
        n = filterAccess(path, n);
        JsopStream buff = new JsopStream();
        if (n == null) {
            return null;
View Full Code Here

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

            String key = path + "@" + rightsRevision;
            NodeImpl n = cache.get(key);
            if (n == null) {
                if (mk.nodeExists(path, rightsRevision)) {
                    String json = mk.getNodes(path, rightsRevision, 0, 0, 0, null);
                    JsopReader t = new JsopTokenizer(json);
                    t.read('{');
                    n = NodeImpl.parse(map, t, 0);
                } else {
                    n = new NodeImpl(map, 0);
                }
                cache.put(key, n);
View Full Code Here

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

        String head = mk.getHeadRevision();
        if (mk.nodeExists(MOUNT, head)) {
            String mounts = mk.getNodes(MOUNT, head);
            NodeMap map = new NodeMap();
            JsopReader t = new JsopTokenizer(mounts);
            t.read('{');
            NodeImpl n = NodeImpl.parse(map, t, 0);
            for (long pos = 0;; pos++) {
                String childName = n.getChildNodeName(pos);
                if (childName == null) {
                    break;
View Full Code Here

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

    private synchronized void init() {
        if (properties == null) {
            String json = kernel.getNodes(
                    path, revision, 0, 0, MAX_CHILD_NODE_NAMES, null);

            JsopReader reader = new JsopTokenizer(json);
            reader.read('{');
            properties = new LinkedHashMap<String, PropertyState>();
            childNodes = new LinkedHashMap<String, NodeState>();
            do {
                String name = reader.readString();
                reader.read(':');
                if (":childNodeCount".equals(name)) {
                    childNodeCount =
                            Long.valueOf(reader.read(JsopTokenizer.NUMBER));
                } else if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = path + '/' + name;
                    if ("/".equals(path)) {
                        childPath = '/' + name;
                    }
                    childNodes.put(name, new KernelNodeState(kernel, valueFactory, childPath, revision));
                } else if (reader.matches('[')) {
                    properties.put(name, new PropertyStateImpl(name, CoreValueMapper.listFromJsopReader(reader, valueFactory)));
                } else {
                    CoreValue cv = CoreValueMapper.fromJsopReader(reader, valueFactory);
                    properties.put(name, new PropertyStateImpl(name, cv));
                }
            } while (reader.matches(','));
            reader.read('}');
            reader.read(JsopTokenizer.END);
        }
    }
View Full Code Here

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

        if (count > 0 && childNodeCount > MAX_CHILD_NODE_NAMES) {
            String json = kernel.getNodes(
                    path, revision, 0, offset, all ? -1 : count, null);

            JsopReader reader = new JsopTokenizer(json);
            reader.read('{');
            do {
                String name = reader.readString();
                reader.read(':');
                if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = getChildPath(name);
                    NodeState child =
                            new KernelNodeState(kernel, valueFactory, childPath, revision);
                    entries.add(new KernelChildNodeEntry(name, child));
                } else {
                    reader.read();
                }
            } while (reader.matches(','));
            reader.read('}');
            reader.read(JsopTokenizer.END);
        }

        return entries.iterator();
    }
View Full Code Here

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

        }
        return hasMore;
    }
   
    private void loadValue(String v) {
        JsopReader reader = new JsopTokenizer(v);
        PropertyState p;
        if (reader.matches('[')) {
            p = DocumentPropertyState.readArrayProperty("x", nodeStore, reader);
            if (p.getType() == Type.BINARIES) {
                for (int i = 0; i < p.count(); i++) {
                    Blob b = p.getValue(Type.BINARY, i);
                    batch.add(b);
View Full Code Here

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

     * @return the core value
     */
    protected CoreValue getCoreValue(String propertyValue) {
        // TODO data type mapping
        CoreValueFactory vf = query.getValueFactory();
        JsopReader r = new JsopTokenizer(propertyValue);
        if (r.matches('[')) {
            // TODO support arrays, but only for comparisons
            throw new IllegalArgumentException("Arrays are currently not supported: " + propertyValue);
        }
        return CoreValueMapper.fromJsopReader(r, vf);
    }
View Full Code Here

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

    private synchronized void init() {
        if (properties == null) {
            String json = kernel.getNodes(
                    path, revision, 0, 0, MAX_CHILD_NODE_NAMES, null);

            JsopReader reader = new JsopTokenizer(json);
            reader.read('{');
            properties = new LinkedHashMap<String, PropertyState>();
            childNodes = new LinkedHashMap<String, NodeState>();
            do {
                String name = reader.readString();
                reader.read(':');
                if (":childNodeCount".equals(name)) {
                    childNodeCount =
                            Long.valueOf(reader.read(JsopReader.NUMBER));
                } else if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = path + '/' + name;
                    if ("/".equals(path)) {
                        childPath = '/' + name;
                    }
                    childNodes.put(name, new KernelNodeState(kernel, valueFactory, childPath, revision));
                } else if (reader.matches('[')) {
                    properties.put(name, new PropertyStateImpl(name, CoreValueMapper.listFromJsopReader(reader, valueFactory)));
                } else {
                    CoreValue cv = CoreValueMapper.fromJsopReader(reader, valueFactory);
                    properties.put(name, new PropertyStateImpl(name, cv));
                }
            } while (reader.matches(','));
            reader.read('}');
            reader.read(JsopReader.END);
        }
    }
View Full Code Here

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

        if (count > 0 && childNodeCount > MAX_CHILD_NODE_NAMES) {
            String json = kernel.getNodes(
                    path, revision, 0, offset, all ? -1 : count, null);

            JsopReader reader = new JsopTokenizer(json);
            reader.read('{');
            do {
                String name = reader.readString();
                reader.read(':');
                if (reader.matches('{')) {
                    reader.read('}');
                    String childPath = getChildPath(name);
                    NodeState child = new KernelNodeState(
                            kernel, valueFactory, childPath, revision);
                    entries.add(new MemoryChildNodeEntry(name, child));
                } else {
                    reader.read();
                }
            } while (reader.matches(','));
            reader.read('}');
            reader.read(JsopReader.END);
        }

        return entries.iterator();
    }
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.