Package javax.jcr

Examples of javax.jcr.Node.restore()


           
            Session session = (Session) DatabaseUtil.getSingleton().getDaoSession();           
            Node versionNode = session.getNodeByUUID(folder.getId());
            Node currentNode = session.getNodeByUUID(versionNode.getProperty("jcr:frozenUuid").getString());

            currentNode.restore(versionNode.getParent().getName(), true);
           
            session.save();
             
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here


      Version baseVersion2 = destVersion.getBaseVersion();
      Version[] predesessors2 = baseVersion2.getSuccessors();
      Version restoreToBaseVersion_2 = predesessors2[0];

      destVersion.restore(restoreToBaseVersion_2, true);
      session.save();

      Thread.sleep(time);

      compareStream(new FileInputStream(tempFile2), srcVersionNode.getNode("jcr:content").getProperty("jcr:data")
View Full Code Here

      node = sessionMaryWS1.getRootNode().getNode("MARY-ReadOnly").getNode("test");

      try
      {
         node.restore("1", true);
         fail("Exception should be thrown.");
      }
      catch (AccessDeniedException e)
      {
      }
View Full Code Here

        propParent.checkout();

        p.setValue(newPropValue);
        p.save();

        propParent.restore(v, false);

        assertEquals("On restore of a OnParentVersion-IGNORE property P, the current value of P must be left unchanged.", p.getString(), newPropValue);
    }
}
View Full Code Here

        propParent.checkout();

        p.setValue(newPropValue);
        p.save();

        propParent.restore(v, false);

        assertEquals("On restore of a OnParentVersion-INITIALIZE property P, the current value of P must be left unchanged.", p.getString(), newPropValue);
    }
}
View Full Code Here

        propParent.checkout();

        p.setValue(newPropValue);
        p.save();

        propParent.restore(v, false);

        assertEquals("On restore of a OnParentVersion-COMPUTE property P, the current P in the workspace will be left unchanged.", p.getString(), newPropValue);
    }
}
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

        Version versionB = versionable.getBaseVersion();
        String[] labels = history.getVersionLabels(versionB);
        assertEquals(1, labels.length);
        assertEquals("labelB", labels[0]);
        Version versionA = history.getVersionByLabel("labelA");
        versionable.restore(versionA, true);
        assertEquals("A", versionable.getProperty("foo").getString());
        versionable.restore(versionB, true);
        assertEquals("B", versionable.getProperty("foo").getString());
        return versionable;
    }
View Full Code Here

        assertEquals(1, labels.length);
        assertEquals("labelB", labels[0]);
        Version versionA = history.getVersionByLabel("labelA");
        versionable.restore(versionA, true);
        assertEquals("A", versionable.getProperty("foo").getString());
        versionable.restore(versionB, true);
        assertEquals("B", versionable.getProperty("foo").getString());
        return versionable;
    }

    private void assertProperties(Node test, Node versionable)
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

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.