Examples of ItemVisitor


Examples of javax.jcr.ItemVisitor

        acl.addEntry(EveryonePrincipal.getInstance(), privileges, false);
        acMgr.setPolicy(root.getPath(), acl);
        session.save();

        final int[] numACEs = new int[1];
        ItemVisitor v = new TraversingItemVisitor.Default() {
            @Override
            protected void entering(Node node, int i) throws RepositoryException {
                if (node.isNodeType(AccessControlConstants.NT_REP_ACE)) {
                    numACEs[0]++;
                }
                super.entering(node, i);
            }
            @Override
            protected void entering(Property prop, int i) throws RepositoryException {
                super.entering(prop, i);
            }
        };
        v.visit(root);
        System.out.println("Num ACEs: " + numACEs[0]);

        session.logout();
    }
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.