Package javax.jcr.version

Examples of javax.jcr.version.VersionManager.checkpoint()


        Node n = testRootNode.addNode(nodeName1, testNodeType);
        n.addMixin(mixVersionable);
        n.setProperty("prop", "a");
        superuser.save();
        String path = n.getPath();
        Version v = vMgr.checkpoint(path); // 1.0
        n.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        n.remove();
        superuser.save();
View Full Code Here


        superuser.save();
        String path = n.getPath();
        Version v = vMgr.checkpoint(path); // 1.0
        n.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        n.remove();
        superuser.save();
        vMgr.restore(path, v, true);
        assertTrue(superuser.nodeExists(path));
        n = superuser.getNode(path);
View Full Code Here

        Node child = n.addNode("test:copyOnParentVersion", ntUnstructured);
        child.addMixin(mixReferenceable);
        child.setProperty("prop", "a");
        superuser.save();
        String path = n.getPath();
        Version v = vMgr.checkpoint(path); // 1.0
        n.setProperty("prop", "b");
        child.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        vMgr.restore(v, true);
View Full Code Here

        String path = n.getPath();
        Version v = vMgr.checkpoint(path); // 1.0
        n.setProperty("prop", "b");
        child.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        vMgr.restore(v, true);
        assertEquals("Property not restored", "a", n.getProperty("prop").getString());
        assertEquals("Property not restored", "a", child.getProperty("prop").getString());
        assertFalse("Restored node must not have jcr:frozenPrimaryType property",
                child.hasProperty(JcrConstants.JCR_FROZENPRIMARYTYPE));
View Full Code Here

            throws RepositoryException, NotExecutableException {
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        n.addMixin(mixVersionable);
        superuser.save();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        vMgr.checkpoint(n.getPath());
        QueryManager qm = superuser.getWorkspace().getQueryManager();
        Version v = vMgr.getBaseVersion(n.getPath());
        Query q = qm.createQuery("//element(*, nt:version)[@jcr:uuid = '" +
                v.getIdentifier() + "']", Query.XPATH);
        NodeIterator nodes = q.execute().getNodes();
View Full Code Here

        Node n = testRootNode.addNode(nodeName1, testNodeType);
        n.addMixin(mixVersionable);
        Node child = n.addNode(nodeName2, ntUnstructured);
        superuser.save();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        vMgr.checkpoint(n.getPath());
        Version v = vMgr.getBaseVersion(n.getPath());
        Node frozenChild = v.getFrozenNode().getNode(child.getName());
        assertEquals(ntFrozenNode, frozenChild.getPrimaryNodeType().getName());
    }
View Full Code Here

        Node n = testRootNode.addNode(nodeName1, testNodeType);
        n.addMixin(mixVersionable);
        Node child = n.addNode(nodeName2, "nt:folder");
        superuser.save();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        Version v = vMgr.checkpoint(n.getPath());
        vMgr.checkpoint(n.getPath());
        Version baseVersion = vMgr.getBaseVersion(n.getPath());
        Node frozenChild = baseVersion.getFrozenNode().getNode(child.getName());
        assertEquals(child.getIdentifier(),
                frozenChild.getProperty(Property.JCR_FROZEN_UUID).getString());
View Full Code Here

        n.addMixin(mixVersionable);
        Node child = n.addNode(nodeName2, "nt:folder");
        superuser.save();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        Version v = vMgr.checkpoint(n.getPath());
        vMgr.checkpoint(n.getPath());
        Version baseVersion = vMgr.getBaseVersion(n.getPath());
        Node frozenChild = baseVersion.getFrozenNode().getNode(child.getName());
        assertEquals(child.getIdentifier(),
                frozenChild.getProperty(Property.JCR_FROZEN_UUID).getString());
        vMgr.restore(v, true);
View Full Code Here

        n.addMixin(mixVersionable);
        superuser.save();

        String p = n.getPath();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        Version v1 = vMgr.checkpoint(p);

        // check if versionable node has references to v1.0
        assertEquals("v1.0", v1.getIdentifier(), n.getProperty(Property.JCR_BASE_VERSION).getString());
        assertEquals("v1.0", v1.getIdentifier(), n.getProperty(Property.JCR_PREDECESSORS).getValues()[0].getString());
View Full Code Here

        n.setProperty("myref", ref);
        superuser.save();

        String p = n.getPath();
        VersionManager vMgr = superuser.getWorkspace().getVersionManager();
        Version v1 = vMgr.checkpoint(p);
        Node frozen = v1.getFrozenNode();

        assertEquals("ref", ref.getPath(), frozen.getProperty("myref").getNode().getPath());

        checkReferences("ref in version store", ref.getReferences(), n.getPath() + "/myref");
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.