Package javax.jcr

Examples of javax.jcr.Node.checkout()


        Node trn = testSession.getNode(path);
        modify(trn.getPath(), Privilege.JCR_VERSION_MANAGEMENT, true);

        Node testNode = trn.getNode(n.getName());
        Version v = testNode.checkin();
        testNode.checkout();

        // removing a version must be allowed
        testNode.getVersionHistory().removeVersion(v.getName());
    }
View Full Code Here


        Node trn = testSession.getNode(path);
        modify(trn.getPath(), Privilege.JCR_VERSION_MANAGEMENT, true);

        Node testNode = trn.getNode(n.getName());
        Version v = testNode.checkin();
        testNode.checkout();

        // remove ability to edit version information
        // -> VersionHistory.removeVersion must not be allowed.
        modify(trn.getPath(), Privilege.JCR_VERSION_MANAGEMENT, false);
        try {
View Full Code Here

    @Ignore("OAK-168") // FIXME: waiting for basic version mgt
    @Test
    public void testRemoveVersion3() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        Version v = n.checkin();
        n.checkout();

        testSession.refresh(false);
        assertFalse(testAcMgr.hasPrivileges(n.getPath(), versionPrivileges));
        AccessControlList acl = allow(SYSTEM, versionPrivileges);
View Full Code Here

    @Test
    public void testAccessVersionContentWithoutStoreAccess() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        Version v = n.checkin();
        VersionHistory vh = n.getVersionHistory();
        n.checkout();
        Version v2 = n.checkin();
        n.checkout();

        testSession.refresh(false);
        assertFalse(testAcMgr.hasPrivileges(n.getPath(), versionPrivileges));
View Full Code Here

        Node n = createVersionableNode(superuser.getNode(path));
        Version v = n.checkin();
        VersionHistory vh = n.getVersionHistory();
        n.checkout();
        Version v2 = n.checkin();
        n.checkout();

        testSession.refresh(false);
        assertFalse(testAcMgr.hasPrivileges(n.getPath(), versionPrivileges));
        AccessControlList acl = deny(SYSTEM, privilegesFromName(Privilege.JCR_READ));
View Full Code Here

            assertFalse(tn.isCheckedOut());
        } finally {
            readOnly.logout();
            // reset the denied read-access
            n.checkout();
            changeReadPermission(principal, n, true);
        }
    }

    public void testAddNodeUuid() throws RepositoryException, NotExecutableException {
View Full Code Here

        firstNode.addMixin(JcrConstants.MIX_VERSIONABLE);
        firstNode.getSession().save();

        // create version for the node
        Version firstNodeVersion = firstNode.checkin();
        firstNode.checkout();

        Node secondNode = testRootNode.addNode(nodeName2);
        secondNode.setPrimaryType(JcrConstants.NT_UNSTRUCTURED);
        secondNode.addMixin(JcrConstants.MIX_VERSIONABLE);
        Property firstNodeVersionFrozenUuid = firstNodeVersion.getFrozenNode().getProperty(JcrConstants.JCR_FROZENUUID);
View Full Code Here

        secondNode.setProperty(JcrConstants.JCR_FROZENUUID, firstNodeVersionFrozenUuid.getValue());
        secondNode.getSession().save();

        // create version of the second node
        Version secondNodeVersion = secondNode.checkin();
        secondNode.checkout();

        // frozenUuid from the second node version node should not be the same as the one from the first node version
        Property secondBodeVersionFrozenUuid = secondNodeVersion.getFrozenNode().getProperty(JcrConstants.JCR_FROZENUUID);
        assertFalse(JcrConstants.JCR_FROZENUUID + " should not be the same for two different versions of different nodes! ",
                secondBodeVersionFrozenUuid.getValue().equals(firstNodeVersionFrozenUuid.getValue()));
View Full Code Here

        // mark V1 with label test and foo
        versionableNode.getVersionHistory().addVersionLabel(v1Name, "test", true);
        versionableNode.getVersionHistory().addVersionLabel(v1Name, "foo", true);

        // create V1.1 of child
        child1.checkout();
        Version v11Child = child1.checkin();
        child1.getVersionHistory().addVersionLabel(v11Child.getName(), "foo", true);

        // restore 1.0 of versionable node --> no child
        versionableNode.restore(version, true);
View Full Code Here

        // V1 of versionable node has child1
        String v1 = versionableNode.checkin().getName();

        // create V1.1 of child
        child1.checkout();
        Version v11Child = child1.checkin();

        // V2 of versionable node has child1
        versionableNode.checkout();
        String v2 = versionableNode.checkin().getName();
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.