Examples of NodeImpl


Examples of org.apache.jackrabbit.core.NodeImpl

     *
     * @throws Exception
     */
    public void testImportACLUnknown() throws Exception {
        try {
            NodeImpl target = (NodeImpl) testRootNode.addNode(nodeName1);
            target.addMixin("rep:AccessControllable");

            InputStream in = new ByteArrayInputStream(XML_POLICY_TREE_4.getBytes("UTF-8"));
            SessionImporter importer = new SessionImporter(target, sImpl,
                    ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
            new ParsingContentHandler(ih).parse(in);

            String path = target.getPath();

            AccessControlManager acMgr = sImpl.getAccessControlManager();
            AccessControlPolicy[] policies = acMgr.getPolicies(path);

            assertEquals(1, policies.length);
View Full Code Here

Examples of org.apache.jackrabbit.core.NodeImpl

        // all ACEs for an import. maybe control this behavior via uuid-flag.
        if (true) {
            return;
        }

        NodeImpl target = (NodeImpl) testRootNode;
        target = (NodeImpl) target.addNode("test", "test:sameNameSibsFalseChildNodeDefinition");
        AccessControlManager acMgr = sImpl.getAccessControlManager();
        for (AccessControlPolicyIterator it = acMgr.getApplicablePolicies(target.getPath()); it.hasNext();) {
            AccessControlPolicy policy = it.nextAccessControlPolicy();
            if (policy instanceof AccessControlList) {
                Privilege[] privs = new Privilege[] {acMgr.privilegeFromName(Privilege.JCR_LOCK_MANAGEMENT)};
                ((AccessControlList) policy).addAccessControlEntry(sImpl.getPrincipalManager().getEveryone(), privs);
                acMgr.setPolicy(target.getPath(), policy);
            }
        }

        try {

            InputStream in = new ByteArrayInputStream(XML_POLICY_TREE_2.getBytes("UTF-8"));
            SessionImporter importer = new SessionImporter(target, sImpl, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
            new ParsingContentHandler(ih).parse(in);

            AccessControlPolicy[] policies = acMgr.getPolicies(target.getPath());

            assertEquals(1, policies.length);
            assertTrue(policies[0] instanceof JackrabbitAccessControlList);

            AccessControlEntry[] entries = ((JackrabbitAccessControlList) policies[0]).getAccessControlEntries();
View Full Code Here

Examples of org.apache.jackrabbit.core.NodeImpl

     * Imports an empty resource-based ACL for a policy that already exists.
     *
     * @throws Exception
     */
    public void testImportEmptyExistingPolicy() throws Exception {
        NodeImpl target = (NodeImpl) testRootNode;
        target = (NodeImpl) target.addNode("test", "test:sameNameSibsFalseChildNodeDefinition");
        AccessControlManager acMgr = sImpl.getAccessControlManager();
        for (AccessControlPolicyIterator it = acMgr.getApplicablePolicies(target.getPath()); it.hasNext();) {
            AccessControlPolicy policy = it.nextAccessControlPolicy();
            if (policy instanceof AccessControlList) {
                acMgr.setPolicy(target.getPath(), policy);
            }
        }

        try {

            InputStream in = new ByteArrayInputStream(XML_POLICY_ONLY.getBytes("UTF-8"));

            SessionImporter importer = new SessionImporter(target, sImpl, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW, new PseudoConfig());
            ImportHandler ih = new ImportHandler(importer, sImpl);
            new ParsingContentHandler(ih).parse(in);

            AccessControlPolicy[] policies = acMgr.getPolicies(target.getPath());

            assertEquals(1, policies.length);
            assertTrue(policies[0] instanceof JackrabbitAccessControlList);

            AccessControlEntry[] entries = ((JackrabbitAccessControlList) policies[0]).getAccessControlEntries();
View Full Code Here

Examples of org.apache.jackrabbit.core.NodeImpl

                throw new NotExecutableException();
            }
        }


        NodeImpl target;
        NodeImpl root = (NodeImpl) sImpl.getRootNode();
        if (!root.hasNode(AccessControlConstants.N_ACCESSCONTROL)) {
            target = root.addNode(AccessControlConstants.N_ACCESSCONTROL, AccessControlConstants.NT_REP_ACCESS_CONTROL, null);
        } else {
            target = root.getNode(AccessControlConstants.N_ACCESSCONTROL);
            if (!target.isNodeType(AccessControlConstants.NT_REP_ACCESS_CONTROL)) {
                target.setPrimaryType(sImpl.getJCRName(AccessControlConstants.NT_REP_ACCESS_CONTROL));
            }
        }
        try {
View Full Code Here

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

        FileUtils.deleteRecursive("target/temp", false);
        mk = MicroKernelFactory.getInstance(url + ";clean");
        cleanRepository(mk);

        String root = mk.getNodes("/", mk.getHeadRevision());
        NodeImpl rootNode = NodeImpl.parse(root);
        if (rootNode.getPropertyCount() > 0) {
            System.out.println("Last mk not disposed: " + root);
        }
        if (rootNode.getChildNodeNames(Integer.MAX_VALUE).hasNext()) {
            System.out.println("Last mk not disposed: " + root);
        }
        if (PROFILE) {
            prof = new Profiler();
            prof.interval = 1;
View Full Code Here

Examples of org.apache.jackrabbit.mongomk.impl.model.NodeImpl

    @Test
    public void testBuildSimpleNodes() throws Exception {
        String json = "{ \"/\" : { \"a\" : { \"b\" : {} , \"c\" : {} } } }";
        Node node = NodeBuilder.build(json);

        Node node_c = new NodeImpl("/a/c");
        Node node_b = new NodeImpl("/a/b");
        Node node_a = new NodeImpl("/a", new Node[] { node_b, node_c });
        Node node_root = new NodeImpl("/", new Node[] { node_a });

        NodeAssert.assertDeepEquals(node, node_root);
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.jcr.NodeImpl

        return privileges.values().toArray(new Privilege[privileges.size()]);
    }

    @Override
    public Privilege getPrivilege(String privilegeName) throws RepositoryException {
        NodeImpl privilegeRoot = getPrivilegeRoot();
        if (privilegeRoot.hasNode(privilegeName)) {
            return getPrivilege(privilegeRoot.getNode(privilegeName), new HashMap<String, Privilege>(1));
        } else {
            throw new AccessControlException("No such privilege " + privilegeName);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeImpl

        head = mk.commit("/:root/head/config", "^ \"nodeVersion\": true", head, "");

        head = mk.commit("/", "+ \"test1\": { \"id\": 1 }", head, "");
        head = mk.commit("/", "+ \"test2\": { \"id\": 1 }", head, "");

        NodeImpl n = NodeImpl.parse(mk.getNodes("/", head, 1, 0, -1, null));
        String vra = n.getNodeVersion();
        String v1a = n.getNode("test1").getNodeVersion();
        String v2a = n.getNode("test2").getNodeVersion();

        // changes the node version
        head = mk.commit("/", "^ \"test2/id\": 2", head, "");

        n = NodeImpl.parse(mk.getNodes("/", head, 1, 0, -1, null));
        String vrb = n.getNodeVersion();
        String v1b = n.getNode("test1").getNodeVersion();
        String v2b = n.getNode("test2").getNodeVersion();

        assertFalse(vra.equals(vrb));
        assertEquals(v1a, v1b);
        assertFalse(v2a.equals(v2b));
    }
View Full Code Here

Examples of org.apache.jetspeed.page.document.impl.NodeImpl

    {
        // construct page element attributes from path
        path = NodeImpl.getCanonicalNodePath(path);

        // optimized retrieval from cache by path if available
        NodeImpl cachedNode = DatabasePageManagerCache.cacheLookup(path);
        if (fragmentsElementType.isInstance(cachedNode))
        {
            // check for view access on page element
            cachedNode.checkAccess(JetspeedActions.VIEW);

            return (BaseFragmentsElement)cachedNode;
        }

        // retrieve page element from database
View Full Code Here

Examples of org.apache.jetspeed.prefs.om.impl.NodeImpl

            if (null != parent)
            {
                parentNodeId = new Long(parent.getNodeId());
            }

            Node nodeObj = new NodeImpl(parentNodeId, nodeName, nodeType, fullPath);

            try
            {
                getPersistenceBrokerTemplate().store(nodeObj);
              NodeImplProxy proxy = new NodeImplProxy(nodeObj);
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.