Package javax.jcr.version

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


        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        version = versionManager.checkin(path);
        versionManager.checkout(path);
        version2 = versionManager.checkin(path);
        versionManager.checkout(path);
        rootVersion = versionManager.getVersionHistory(path).getRootVersion();

        // build a second versionable node below the testroot
        try {
View Full Code Here


        // create a version of the versionable child node
        VersionManager wVersionManager = wVersionableChildNode.getSession().getWorkspace().getVersionManager();
        String wPath = wVersionableChildNode.getPath();
        wVersionManager.checkout(wPath);
        wChildVersion = wVersionManager.checkin(wPath);
        wVersionManager.checkout(wPath);
    }


    protected void tearDown() throws Exception {
View Full Code Here

                throw new NotExecutableException("Nodes must be versionable in order to run this test.");
            }

            VersionManager versionManager = wVersionableNode.getSession().getWorkspace().getVersionManager();
            String path = wVersionableNode.getPath();
            Version v = versionManager.checkin(path);
            versionManager.checkout(path);
            wSuperuser.move(wVersionableChildNode.getPath(), wVersionableNode2.getPath() + "/" + wVersionableChildNode.getName());
            wSuperuser.save();
            wSuperuser.getWorkspace().getVersionManager().restore(new Version[]{v}, false);
View Full Code Here

     */
    public void testWorkspaceRestoreOnCheckedInNodeJcr2() throws RepositoryException {
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        if (versionManager.isCheckedOut(path)) {
            versionManager.checkin(path);
        }
        superuser.getWorkspace().getVersionManager().restore(new Version[]{version}, true);
    }

    /**
 
View Full Code Here

        nodeParent.getSession().save();

        VersionManager versionManager = nodeParent.getSession().getWorkspace().getVersionManager();
        String path = nodeParent.getPath();
        versionManager.checkout(path);
        Version v = versionManager.checkin(path);

        initialNodePath = childNode.getPath();
        versionManager.checkout(path);
        childNode.remove();
        nodeParent.getSession().save();
View Full Code Here

    public void testRestorePropJcr2() throws RepositoryException {
        try {
            VersionManager versionManager = p.getSession().getWorkspace().getVersionManager();
            String path = p.getParent().getPath();
            versionManager.checkout(path);
            versionManager.checkin(path);
            fail("On checkin of N which has a property with OnParentVersion ABORT defined, an UnsupportedRepositoryOperationException must be thrown.");
        } catch (VersionException e) {
            // success
        }
    }
View Full Code Here

        topVNode.setProperty(propertyName1, topVNode.getName());
        String path = topVNode.getPath();

        // save default workspace
        testRootNode.getSession().save();
        versionManager.checkin(path);
        versionManager.checkout(path);

        log.println("test nodes created successfully on " + workspace.getName());

        // clone the newly created node from src workspace into second workspace
View Full Code Here

        // default workspace
        Node originalNode = testRootNode.getNode(nodeName1);
        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
        String originalPath = originalNode.getPath();
        vmWsp1.checkout(originalPath);
        vmWsp1.checkin(originalPath);
   
        // second workspace
        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
        String path = nodeToMerge.getPath();
        vmWsp2.checkin(path);
View Full Code Here

        vmWsp1.checkin(originalPath);
   
        // second workspace
        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
        String path = nodeToMerge.getPath();
        vmWsp2.checkin(path);
   
        // "merge" the clonedNode with the newNode from the default workspace
        vmWsp2.checkout(path);
        vmWsp2.merge(path, workspace.getName(), true);
   
View Full Code Here

        Node subNode = nodeToMerge.addNode(nodeName3, versionableNodeType);
        subNode.setProperty(propertyName1, CHANGED_STRING);
        superuserW2.save();
        VersionManager versionManager = subNode.getSession().getWorkspace().getVersionManager();
        String path = subNode.getPath();
        versionManager.checkin(path);

        versionManager.merge(path, workspace.getName(), true);
        assertTrue(subNode.getProperty(propertyName1).getString().equals(CHANGED_STRING));
    }
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.