Package javax.jcr

Examples of javax.jcr.Session.move()


            if (srcPath.equals(destPath)) {
                newNode = node;
            }
            else {
                Session session = getNode().getSession();
                session.move(srcPath, destPath);
                newNode = session.getNode(destPath);
                session.save();
            }

            return create(newNode);
View Full Code Here


        if (session.itemExists(destPath)) {
            session.getItem(destPath).remove();
        }

        session.move(sourcePath, destPath);
        response.onMoved(sourcePath, destPath);
    }

}
View Full Code Here

        Node[] shared = getSharedSet(b1);
        assertEquals(2, shared.length);

        // move node
        try {
            session.move(testRootNode.getPath() + "/a2", c.getPath());
            fail("Share cycle not detected on transient move.");
        } catch (RepositoryException e) {
            // expected
        }
    }
View Full Code Here

        // move
        Session session = superuser;

        try {
            // move shareable node
            session.move(b.getPath(), a2.getPath() + "/b");
            session.save();
            fail("Moving a mix:shareable should fail.");
        } catch (UnsupportedRepositoryOperationException e) {
            // expected
        }
View Full Code Here

        node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        Node sourceNode = session.getNode(TEST_PATH + "/source/node");
        session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");
        assertEquals("/test_node/target/moved", sourceNode.getPath());

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
        assertTrue(node.hasNode("target/moved"));
View Full Code Here

        Node source = node.addNode("source").addNode("node");
        node.addNode("target");
        session.save();

        session.refresh(true);
        session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");
        assertEquals(TEST_PATH + "/target/moved", source.getPath());

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
        assertTrue(node.hasNode("target/moved"));
View Full Code Here

        Node node = getNode(TEST_PATH);
        Node source = node.addNode("s");
        session.save();

        session.refresh(true);
        session.move(TEST_PATH + "/s", TEST_PATH + "/s/t");
    }

    @Test
    public void oak962() throws RepositoryException {
        Session session = getAdminSession();
View Full Code Here

        Session session = getAdminSession();
        Node root = session.getRootNode().addNode("root");
        root.addNode("N3");
        root.addNode("N6").addNode("N7");
        session.save();
        session.move("/root/N6/N7", "/root/N3/N12");
        root.getNode("N3").getNode("N12").remove();
        root.getNode("N6").remove();
        session.save();
    }
View Full Code Here

        node.addNode("source").addNode("node").addMixin("mix:referenceable");
        node.addNode("target");
        session.save();

        session.refresh(true);
        session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");

        assertFalse(node.hasNode("source/node"));
        assertTrue(node.hasNode("source"));
        assertTrue(node.hasNode("target/moved"));
View Full Code Here

        String srcPath = childNode.getPath();
        String destPath = parentPath + "/"+ nodeName3;

        checkReadOnly(parentPath);
        try {
            s.move(srcPath, destPath);
            s.save();
            fail("Missing write privilege.");
        } 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.