Package javax.jcr

Examples of javax.jcr.Node.refresh()


        }
        ConsoleFile wo = ctx.getFile(jcrPath, true);
        if (wo instanceof RepositoryCFile) {
            Node node = (Node) wo.unwrap();
            try {
                node.refresh(cl.hasOption(optKeepChanges));
                System.out.println("Modifications refreshed.");
            } catch (RepositoryException e) {
                throw new ExecutionException("Error while refreshing: " + e);
            }
        } else {
View Full Code Here


                            node.addNode(token);
                        }
                        if (autoSave) node.getSession().save();
                    } catch (RepositoryException e) {
                        // we ignore this as this folder might be created from a different task
                        node.refresh(false);
                    }
                }
                node = node.getNode(token);
            }
            path = path.substring(pos + 1);
View Full Code Here

        session.move(from, to);
        try {
            if (save) {
                node2.save();
            } else {
                node2.refresh(false);
            }
            fail("Refresh and Save should not work for moved nodes");
        } catch (RepositoryException e) {
            // expected
        }
View Full Code Here

        // remove the node
        defaultRootNode.remove();

        try {
            testNode.refresh(true);
            fail("Calling Node.refresh() on deleted node should throw InvalidItemStateException!");
        } catch (InvalidItemStateException e) {
            // ok, works as expected
        }
    }
View Full Code Here

        // complete transaction
        utx.commit();

        // unlock must now be visible to other session
        n2.refresh(false);
        assertFalse(lock2.isLive());
        assertFalse(n2.isLocked());
        assertFalse(n2.hasProperty(jcrLockOwner));
        assertFalse(n2.hasProperty(jcrlockIsDeep));
    }
View Full Code Here

            } else {
                s.getWorkspace().move(parentPath, destPath);
            }
            Node n3 = s.getNode(destPath + "/file");
            Node n4 = n3.getNode("jcr:content");
            n4.refresh(false);
            // call must succeed (see JCR-2472)
            Node n5 = n3.getNode("jcr:content");
        } finally {
            s.logout();
        }
View Full Code Here

        try {
            Node otherNode = (Node) otherSession.getItem(srcPath);

            testRootNode.getSession().getWorkspace().move(srcPath, destPath);

            otherNode.refresh(false);
            try {
                assertTrue(n.isSame(otherNode));
            } catch (InvalidItemStateException e) {
                // ok as well.
            }
View Full Code Here

        superuser.move(refNode.getPath(), destParentNode.getPath() + "/" + nodeName2);
        superuser.save();

        try {
            refNode2.refresh(true);
            Node parent = refNode2.getParent();
            if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                // node has been automatically moved to new place
                assertItemStatus(refNode2, Status.EXISTING);
            } else {
View Full Code Here

        superuser.move(refNode.getPath(), destParentNode.getPath() + "/" + nodeName2);
        superuser.save();

        try {
            refNode2.refresh(true);
            Node parent = refNode2.getParent();
            if (parent.isSame(testSession.getItem(destParentNode.getPath()))) {
                // node has been automatically moved to new place
                assertItemStatus(refNode2, Status.EXISTING_MODIFIED);
            } else if (!isItemStatus(refNode2, Status.EXISTING_MODIFIED)) {
View Full Code Here

        testSession.getItem(destParentNode.getPath() + "/" + nodeName2);

        assertItemStatus(refNode2, Status.STALE_DESTROYED);
        try {
            refNode2.refresh(false);
            fail();
        } catch (InvalidItemStateException e) {
            // correct behaviour
        }
    }
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.