Package javax.jcr

Examples of javax.jcr.Node.checkin()


    private boolean checkin(final ResourceResolver resolver, final String path) throws RepositoryException {
        final Resource rsrc = resolver.getResource(path);
        final Node node = (rsrc == null ? null : rsrc.adaptTo(Node.class));
        if (node != null) {
            if (node.isCheckedOut() && isVersionable(node)) {
                node.checkin();
                return true;
            }
        }
        return false;
    }
View Full Code Here


                response.setStatus(HttpServletResponse.SC_NOT_FOUND,
                    "Missing source " + resource + " for checkout");
                return;
            }

            node.checkin();
            changes.add(Modification.onCheckin(resource.getPath()));

        } else {

            while (res.hasNext()) {
View Full Code Here

            while (res.hasNext()) {
                Resource resource = res.next();
                Node node = resource.adaptTo(Node.class);
                if (node != null) {
                    node.checkin();
                    changes.add(Modification.onCheckin(resource.getPath()));
                }
            }

        }
View Full Code Here

    public void testAccessVersionHistory() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        allow(n.getPath(), versionPrivileges);

        Node testNode = testSession.getNode(n.getPath());
        testNode.checkin();
        testNode.checkout();

        // accessing the version history must be allowed if the versionable node
        // is readable to the editing test session.
        VersionHistory vh = testNode.getVersionHistory();
View Full Code Here

    public void testAccessVersionHistoryVersionableNodeNotAccessible() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        allow(n.getPath(), versionPrivileges);

        Node testNode = testSession.getNode(n.getPath());
        testNode.checkin();
        testNode.checkout();

        VersionHistory vh = testNode.getVersionHistory();
        String vhPath = vh.getPath();
        String vhUUID = vh.getIdentifier();
View Full Code Here

    @Test
    public void testAccessVersionHistoryVersionableNodeRemoved() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        allow(n.getPath(), versionPrivileges);

        n.checkin();
        n.checkout();

        String versionablePath = n.getPath();
        VersionHistory vh = n.getVersionHistory();
        String vhPath = vh.getPath();
View Full Code Here

    public void testAddVersionLabel() throws Exception {
        Node n = createVersionableNode(superuser.getNode(path));
        allow(n.getPath(), versionPrivileges);

        Node testNode = testSession.getNode(n.getPath());
        Version v = testNode.checkin();
        testNode.checkout();
        Version v2 = testNode.checkin();
        testNode.checkout();

        // -> VersionHistory.addVersionLabel must be allowed
View Full Code Here

        allow(n.getPath(), versionPrivileges);

        Node testNode = testSession.getNode(n.getPath());
        Version v = testNode.checkin();
        testNode.checkout();
        Version v2 = testNode.checkin();
        testNode.checkout();

        // -> VersionHistory.addVersionLabel must be allowed
        VersionHistory history = testNode.getVersionHistory();
        history.addVersionLabel(v.getName(), "testLabel", false);
View Full Code Here

        modify(path, REP_WRITE, true);
        modify(path, Privilege.JCR_NODE_TYPE_MANAGEMENT, true);
        modify(path, Privilege.JCR_VERSION_MANAGEMENT, true);

        Node n = createVersionableNode(testSession.getNode(path));
        n.checkin();
        n.checkout();
    }

    @Test
    public void testCheckInCheckout() throws Exception {
View Full Code Here

        Node n = createVersionableNode(superuser.getNode(path));
        try {
            testSession.refresh(false);
            Node testNode = testSession.getNode(n.getPath());
            testNode.checkin();
            fail("Missing jcr:versionManagement privilege -> checkin/checkout must fail.");
        } catch (AccessDeniedException e) {
            // success
            // ... but the property must not be modified nor indicating
            // checkedIn status
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.