Examples of orderBefore()


Examples of javax.jcr.Node.orderBefore()

        }

        // allow 'remove_node' at childNPath
        // -> now reorder must succeed
        givePrivileges(childNPath, privilegesFromName(Privilege.JCR_REMOVE_NODE), getRestrictions(superuser, childNPath));
        n.orderBefore(Text.getName(childNPath), Text.getName(childNPath2));
        testSession.save();
    }
   
    /**
     * Test case for JCR-2420
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (OrderPatch.Member instruction : orderPatch.getOrderInstructions()) {
                String srcRelPath = Text.unescape(instruction.getMemberHandle());
                Position pos = instruction.getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (int i = 0; i < instructions.length; i++) {
                String srcRelPath = instructions[i].getMemberHandle();
                Position pos = instructions[i].getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        assertEquals("a", iterator.nextNode().getName());
        assertEquals("b", iterator.nextNode().getName());
        assertEquals("c", iterator.nextNode().getName());
        assertFalse(iterator.hasNext());

        root.orderBefore("c", "a");
        iterator = root.getNodes();
        assertEquals("c", iterator.nextNode().getName());
        assertEquals("a", iterator.nextNode().getName());
        assertEquals("b", iterator.nextNode().getName());
        assertFalse(iterator.hasNext());
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        assertEquals("c", iterator.nextNode().getName());
        assertEquals("a", iterator.nextNode().getName());
        assertEquals("b", iterator.nextNode().getName());
        assertFalse(iterator.hasNext());

        root.orderBefore("b", "c");
        iterator = root.getNodes();
        assertEquals("b", iterator.nextNode().getName());
        assertEquals("c", iterator.nextNode().getName());
        assertEquals("a", iterator.nextNode().getName());
        assertFalse(iterator.hasNext());
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        getSession().save();

        NodeIterator it = testNode.getNodes();
        // todo: check order

        testNode.orderBefore("a", "c");
        getSession().save();

        it = testNode.getNodes();
        // todo: check order
    }
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        try {
            if (!n.getPrimaryNodeType().hasOrderableChildNodes()) {
                throw new NotExecutableException("Reordering child nodes is not supported..");
            }

            n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
            testSession.save();
            fail("test session must not be allowed to reorder nodes.");
        } catch (AccessDeniedException e) {
            // success.
        }
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        }

        // grant all privileges
        allow(path, privilegesFromNames(new String[] {Privilege.JCR_ALL}));

        n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
        testSession.save();

        n.orderBefore("rep:policy", Text.getName(childNPath2));
        testSession.save();
    }
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        allow(path, privilegesFromNames(new String[] {Privilege.JCR_ALL}));

        n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
        testSession.save();

        n.orderBefore("rep:policy", Text.getName(childNPath2));
        testSession.save();
    }

    @Ignore("OAK-767 : Implement Node#removeMixin")
    @Test
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        Node n = testSession.getNode(path);
        if (!n.getPrimaryNodeType().hasOrderableChildNodes()) {
            throw new NotExecutableException("Reordering child nodes is not supported..");
        }
        try {
            n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
            testSession.save();
            fail("test session must not be allowed to reorder nodes.");
        } catch (AccessDeniedException e) {
            // success.
        }
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.