Package org.apache.jackrabbit.oak.util

Examples of org.apache.jackrabbit.oak.util.NodeUtil.addChild()


        rp = new RestrictionProviderImpl();

        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
        NodeUtil system = rootNode.getChild("jcr:system");
        NodeUtil perms = system.addChild(REP_PERMISSION_STORE, NT_REP_PERMISSION_STORE);
        perms.addChild(userPrincipal.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group1.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group2.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group3.getName(), NT_REP_PERMISSION_STORE);
        NodeUtil testNode = rootNode.addChild("nodeName1", NT_UNSTRUCTURED);
        testNode.setString("propName1", "strValue");
View Full Code Here


        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
        NodeUtil system = rootNode.getChild("jcr:system");
        NodeUtil perms = system.addChild(REP_PERMISSION_STORE, NT_REP_PERMISSION_STORE);
        perms.addChild(userPrincipal.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group1.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group2.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group3.getName(), NT_REP_PERMISSION_STORE);
        NodeUtil testNode = rootNode.addChild("nodeName1", NT_UNSTRUCTURED);
        testNode.setString("propName1", "strValue");
        NodeUtil testNode2 = testNode.addChild("nodeName2", NT_UNSTRUCTURED);
View Full Code Here

        NodeUtil rootNode = new NodeUtil(root.getTree("/"));
        NodeUtil system = rootNode.getChild("jcr:system");
        NodeUtil perms = system.addChild(REP_PERMISSION_STORE, NT_REP_PERMISSION_STORE);
        perms.addChild(userPrincipal.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group1.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group2.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group3.getName(), NT_REP_PERMISSION_STORE);
        NodeUtil testNode = rootNode.addChild("nodeName1", NT_UNSTRUCTURED);
        testNode.setString("propName1", "strValue");
        NodeUtil testNode2 = testNode.addChild("nodeName2", NT_UNSTRUCTURED);
        testNode2.setString("propName2", "strValue");
View Full Code Here

        NodeUtil system = rootNode.getChild("jcr:system");
        NodeUtil perms = system.addChild(REP_PERMISSION_STORE, NT_REP_PERMISSION_STORE);
        perms.addChild(userPrincipal.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group1.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group2.getName(), NT_REP_PERMISSION_STORE);
        perms.addChild(group3.getName(), NT_REP_PERMISSION_STORE);
        NodeUtil testNode = rootNode.addChild("nodeName1", NT_UNSTRUCTURED);
        testNode.setString("propName1", "strValue");
        NodeUtil testNode2 = testNode.addChild("nodeName2", NT_UNSTRUCTURED);
        testNode2.setString("propName2", "strValue");
        root.commit();
View Full Code Here

        super.before();

        Principal testPrincipal = getTestPrincipal();
        NodeUtil rootNode = new NodeUtil(root.getTree("/"), namePathMapper);
        NodeUtil testNode = rootNode.addChild("testPath", JcrConstants.NT_UNSTRUCTURED);
        testNode.addChild("childNode", JcrConstants.NT_UNSTRUCTURED);

        AccessControlManager acMgr = getAccessControlManager(root);
        JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(acMgr, testPath);
        acl.addAccessControlEntry(testPrincipal, privilegesFromNames(JCR_ADD_CHILD_NODES));
        acl.addAccessControlEntry(EveryonePrincipal.getInstance(), privilegesFromNames(JCR_READ));
View Full Code Here

        super.before();

        Principal testPrincipal = getTestPrincipal();
        NodeUtil rootNode = new NodeUtil(root.getTree("/"), namePathMapper);
        NodeUtil testNode = rootNode.addChild("testPath", JcrConstants.NT_UNSTRUCTURED);
        testNode.addChild("childNode", JcrConstants.NT_UNSTRUCTURED);

        AccessControlManager acMgr = getAccessControlManager(root);
        JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(acMgr, testPath);
        acl.addAccessControlEntry(testPrincipal, privilegesFromNames(JCR_ADD_CHILD_NODES));
        acl.addAccessControlEntry(EveryonePrincipal.getInstance(), privilegesFromNames(JCR_READ));
View Full Code Here

                    root.commit();
                }
            }

            // authNode - anyNode - authFolder -> create User
            folder = someContent.addChild("folder", UserConstants.NT_REP_AUTHORIZABLE_FOLDER);
            root.commit(); // this time save node structure
            try {
                Principal p = new PrincipalImpl("test4");
                userMgr.createUser(p.getName(), p.getName(), p, folder.getTree().getPath());
                root.commit();
View Full Code Here

            if (user != null && !user.isGroup()) {
                String userPath = user.getPath();
                NodeUtil userNode = new NodeUtil(root.getTree(userPath));
                tokenParent = userNode.getChild(TOKENS_NODE_NAME);
                if (tokenParent == null) {
                    tokenParent = userNode.addChild(TOKENS_NODE_NAME, TOKENS_NT_NAME);
                    parentPath = userPath + '/' + TOKENS_NODE_NAME;
                    root.commit();
                }
            } else {
                log.debug("Cannot create login token: No corresponding node for User " + userId + '.');
View Full Code Here

        super.before();

        Principal testPrincipal = getTestPrincipal();
        NodeUtil rootNode = new NodeUtil(root.getTree("/"), namePathMapper);
        NodeUtil testNode = rootNode.addChild("testPath", JcrConstants.NT_UNSTRUCTURED);
        testNode.addChild("childNode", JcrConstants.NT_UNSTRUCTURED);

        AccessControlManager acMgr = getAccessControlManager(root);
        JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(acMgr, testPath);
        acl.addAccessControlEntry(testPrincipal, privilegesFromNames(PrivilegeConstants.JCR_ADD_CHILD_NODES));
        acl.addAccessControlEntry(EveryonePrincipal.getInstance(), privilegesFromNames(PrivilegeConstants.JCR_READ));
View Full Code Here

        acMgr = getAccessControlManager(npMapper);
        valueFactory = new ValueFactoryImpl(root.getBlobFactory(), npMapper);

        NodeUtil rootNode = new NodeUtil(root.getTree("/"), npMapper);
        rootNode.addChild(testName, JcrConstants.NT_UNSTRUCTURED);
        root.commit();

        testPrivileges = privilegesFromNames(Privilege.JCR_ADD_CHILD_NODES, Privilege.JCR_READ);
        testPrincipal = getTestPrincipal();
    }
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.