Package org.apache.jackrabbit.mk.simple

Examples of org.apache.jackrabbit.mk.simple.NodeImpl$ChildVisitor


        for (long pos = 0;; pos++) {
            String childName = n.getChildNodeName(pos);
            if (childName == null) {
                break;
            }
            NodeImpl c = n.getNode(childName);
            NodeImpl c2 = filterAccess(PathUtils.concat(path, childName), c);
            if (c2 != c) {
                if (c2 == null) {
                    n = n.cloneAndRemoveChildNode(childName, 0);
                } else {
                    n = n.setChild(childName, c2, 0);
View Full Code Here


            return true;
        }
        boolean access = false;
        while (true) {
            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);
            }
            Boolean b = hasRights(n);
            if (b != null) {
View Full Code Here

            if (exists) {
            String node = mk.getNodes(indexRootNode, revision, 1, 0, Integer.MAX_VALUE, null);
            JsopTokenizer t = new JsopTokenizer(node);
            NodeMap map = new NodeMap();
            t.read('{');
            NodeImpl n = NodeImpl.parse(map, t, 0);
            String rev = JsopTokenizer.decodeQuoted(n.getNode(INDEX_CONTENT).getProperty("rev"));
            if (rev != null) {
                readRevision = rev;
            }
            for (int i = 0; i < n.getChildNodeCount(); i++) {
                String k = n.getChildNodeName(i);
                PropertyIndex prop = PropertyIndex.fromNodeName(this, k);
                if (prop != null) {
                    indexes.put(prop.getIndexNodeName(), prop);
                    propertyIndexes.put(prop.getPropertyName(), prop);
                    queryIndexList = null;
View Full Code Here

        String json = mk.getNodes(p, revision, 0, 0, 0, null);
        if (json == null) {
            page = new BTreeLeaf(tree, parent, name,
                    new String[0], new String[0]);
        } else {
            NodeImpl n = NodeImpl.parse(json);
            String keys = n.getProperty("keys");
            String values = n.getProperty("values");
            String children = n.getProperty("children");
            if (children != null) {
                BTreeNode node = new BTreeNode(tree, parent, name,
                        readArray(keys), readArray(values), readArray(children));
                page = node;
            } else {
View Full Code Here

            switch (r) {
            case '+': {
                t.read(':');
                NodeMap map = new NodeMap();
                if (t.matches('{')) {
                    NodeImpl n = NodeImpl.parse(map, t, 0, path);
                    addOrRemoveRecursive(n, false, true);
                } else {
                    String value = t.readRawValue().trim();
                    String nodePath = PathUtils.getParentPath(path);
                    NodeImpl node = new NodeImpl(map, 0);
                    node.setPath(nodePath);
                    String propertyName = PathUtils.getName(path);
                    node.cloneAndSetProperty(propertyName, value, 0);
                    addOrRemoveRecursive(node, true, true);
                }
                break;
            }
            case '*':
 
View Full Code Here

        // TODO remove: support large trees
        String node = mk.getNodes(nodePath, lastRevision, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null);
        JsopTokenizer t = new JsopTokenizer(node);
        NodeMap map = new NodeMap();
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0, path);
        if (n.hasProperty(property)) {
            n.setPath(nodePath);
            for (Index index : indexes.values()) {
                index.addOrRemoveProperty(nodePath, property, n.getProperty(property), false);
            }
        }
    }
View Full Code Here

        // TODO move: support large trees
        String node = mk.getNodes(sourcePath, lastRevision, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, null);
        JsopTokenizer t = new JsopTokenizer(node);
        NodeMap map = new NodeMap();
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0, sourcePath);
        if (remove) {
            addOrRemoveRecursive(n, true, false);
        }
        if (targetPath != null) {
            t = new JsopTokenizer(node);
View Full Code Here

        // TODO add: support large child node lists
        String node = mk.getNodes(path, readRevision, 0, 0, Integer.MAX_VALUE, null);
        JsopTokenizer t = new JsopTokenizer(node);
        NodeMap map = new NodeMap();
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0, path);
        index.addOrRemoveNode(n, true);
        for (Iterator<String> it = n.getChildNodeNames(Integer.MAX_VALUE); it.hasNext();) {
            addRecursive(index, PathUtils.concat(path, it.next()));
        }
        if (needFlush()) {
            flushBuffer();
        }
View Full Code Here

        String role = mk.getNodes("/:user/" + user, mk.getHeadRevision(), 1, 0, -1, null);
        NodeMap map = new NodeMap();
        JsopReader t = new JsopTokenizer(role);
        t.read('{');
        NodeImpl n = NodeImpl.parse(map, t, 0);
        String password = JsopTokenizer.decodeQuoted(n.getProperty("password"));
        if (!pass.equals(password)) {
            throw ExceptionFactory.get("Wrong password");
        }
        String[] rights =
                JsopTokenizer.decodeQuoted(n.getProperty("rights")).split(",");
        this.userRights = rights;
        boolean isAdmin = false;
        boolean canWrite = false;
        for (String r : rights) {
            if (r.equals("admin")) {
View Full Code Here

            }
            switch (r) {
            case '+':
                t.read(':');
                if (t.matches('{')) {
                    NodeImpl n = NodeImpl.parse(map, t, 0);
                    if (checkDiff(path, diff)) {
                        diff.tag('+').key(path);
                        n = filterAccess(path, n);
                        n.append(diff, Integer.MAX_VALUE, 0, Integer.MAX_VALUE, false);
                        diff.newline();
                    }
                } else {
                    String value = t.readRawValue().trim();
                    String nodeName = PathUtils.getParentPath(path);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.simple.NodeImpl$ChildVisitor

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.