Package javax.jcr

Examples of javax.jcr.Node.restore()


        Version v1 = versionableNode.checkin();
        versionableNode.remove();
        versionableNode = null;
        parent.getSession().save();

        parent.restore(v1, oldName, true);

        versionableNode = parent.getNode(oldName);

        String value = versionableNode.getProperty(propertyName1).getString();
        assertEquals("Restoring a node must set the correct property.", propertyValue2, value);
View Full Code Here


        phase="restore N2 uncommitted.";

        tx = new UserTransactionImpl(s2);
        tx.begin();

        n2.restore("1.0", false);
        Version v2_2 = n2.getBaseVersion();

        check(v1_1, phase, "jcr:rootVersion", 1);
        check(v2_1, phase, "jcr:rootVersion", 1);
        check(v1_2, phase, "1.0", 0);
View Full Code Here

    }

    // restore child, then restore/checkout grandchild nodes
    for (int i = 0; i < NODES_COUNT; i++) {
      Node childNode = myRoot.getNode("child" + i);
      childNode.restore("1.0", false);
      Node grandChildNode = childNode.getNode("grandChild");
      grandChildNode.restore("1.0", false);
      // critical location regarding item state manager caching (see JCR-1197)
      grandChildNode.checkout();
      grandChildNode.checkin();
View Full Code Here

    // restore child, then restore/checkout grandchild nodes
    for (int i = 0; i < NODES_COUNT; i++) {
      Node childNode = myRoot.getNode("child" + i);
      childNode.restore("1.0", false);
      Node grandChildNode = childNode.getNode("grandChild");
      grandChildNode.restore("1.0", false);
      // critical location regarding item state manager caching (see JCR-1197)
      grandChildNode.checkout();
      grandChildNode.checkin();
    }
View Full Code Here

        initialNodePath = childNode.getPath();
        nodeParent.checkout();
        childNode.remove();
        nodeParent.save();

        nodeParent.restore(v, false);

        if (!superuser.itemExists(initialNodePath)) {
            fail("On restore of a OnParentVersion-COPY child node, the node needs to be restored, replacing the current node in the workspace.");
        }
        // todo: add proper comparison of restored node. equals does not work
View Full Code Here

     */
    public void restore(String absPath, String versionName, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
        session.checkIsAlive();

        Node n = itemManager.getNode(resolver.getQPath(absPath));
        n.restore(versionName, removeExisting);
    }

    /**
     * @see javax.jcr.version.VersionManager#restore(Version, boolean)
     */
 
View Full Code Here

        // get parent
        int idx = absPath.lastIndexOf('/');
        String parent = idx == 0 ? "/" : absPath.substring(0, idx);
        String name = absPath.substring(idx + 1);
        Node n = itemManager.getNode(resolver.getQPath(parent));
        n.restore(version, name, removeExisting);
    }

    /**
     * @see javax.jcr.version.VersionManager#restoreByLabel(String, String, boolean)
     */
 
View Full Code Here

                String versionName = getItemName(versionPath);

                String relPath = DomUtil.getChildText(udElem, XML_RELPATH, NAMESPACE);
                if (relPath == null) {
                    // restore version by name
                    node.restore(versionName, removeExisting);
                } else if (node.hasNode(relPath)) {
                    Version v = node.getNode(relPath).getVersionHistory().getVersion(versionName);
                    node.restore(v, relPath, removeExisting);
                } else {
                    Version v = (Version) getRepositorySession().getNode(versionPath);
View Full Code Here

                if (relPath == null) {
                    // restore version by name
                    node.restore(versionName, removeExisting);
                } else if (node.hasNode(relPath)) {
                    Version v = node.getNode(relPath).getVersionHistory().getVersion(versionName);
                    node.restore(v, relPath, removeExisting);
                } else {
                    Version v = (Version) getRepositorySession().getNode(versionPath);
                    node.restore(v, relPath, removeExisting);
                }
View Full Code Here

                } else if (node.hasNode(relPath)) {
                    Version v = node.getNode(relPath).getVersionHistory().getVersion(versionName);
                    node.restore(v, relPath, removeExisting);
                } else {
                    Version v = (Version) getRepositorySession().getNode(versionPath);
                    node.restore(v, relPath, removeExisting);
                }

            } else if (updateInfo.getLabelName() != null) {
                String[] labels = updateInfo.getLabelName();
                if (labels.length != 1) {
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.