Package javax.jcr.version

Examples of javax.jcr.version.VersionHistory.removeVersion()


     */
    public void removeMember(DavResource member) throws DavException {
        if (exists()) {
            VersionHistory versionHistory = (VersionHistory) item;
            try {
                versionHistory.removeVersion(getItemName(member.getLocator().getRepositoryPath()));
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } else {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
View Full Code Here


                            names.add(v.getName());
                        }
                    }
                    Collections.reverse(names);
                    for (String name : names) {
                        history.removeVersion(name);
                    }
                }
            }
        } catch (Exception e) {
            throw new ServletException(e);
View Full Code Here

      checkVersionHistory(testVersionable, 4);

      // -------- play with version remove --------

      // we have v4 as base version, REMOVE v1 from history
      vHistory.removeVersion(vHistory.getVersionByLabel("ver.1").getName());
      if (log.isDebugEnabled())
         log.debug("===== ver.1 removed =====");
      showVersionable(testVersionable);
      checkVersionHistory(testVersionable, 3);
      try
View Full Code Here

        assertThat(v4, is(notNullValue()));
        assertThat(v5, is(notNullValue()));
        assertThat(v6, is(notNullValue()));

        // Remove the 3rd version (that is, i=3) ...
        history.removeVersion(versionName);

        if (print) System.out.println("After (same history used to remove): \n" + history);
        assertThat(history.getAllLinearVersions().getSize(), is(5L));

        // Get the versions using the history node we already have ...
View Full Code Here

        assertThat(v4, is(notNullValue()));
        assertThat(v5, is(notNullValue()));
        assertThat(v6, is(notNullValue()));

        // Remove the 3rd version (that is, i=3) ...
        history.removeVersion(versionName);

        if (print) System.out.println("After (same history used to remove): \n" + history);
        assertThat(history.getAllLinearVersions().getSize(), is(5L));

        // Get the versions using the history node we already have ...
View Full Code Here

        n.remove();
        testRootNode.save();
        assertExists(session, vhUuid);

        // Remove the first version
        vh.removeVersion(v10.getName());
        assertExists(session, vhUuid);

        // Remove the second and last version
        vh.removeVersion(v11.getName());
View Full Code Here

        // Remove the first version
        vh.removeVersion(v10.getName());
        assertExists(session, vhUuid);

        // Remove the second and last version
        vh.removeVersion(v11.getName());

        try {
            session.getNodeByUUID(vhUuid);
            fail("Orphan version history must have been removed");
        } catch (ItemNotFoundException e) {
View Full Code Here

        testRootNode.save();
        assertExists(session, vhUuid);
        assertExists(otherWsSession, vhUuid);

        // Remove the first version
        vh.removeVersion(v10.getName());
        assertExists(session, vhUuid);
        assertExists(otherWsSession, vhUuid);

        // Remove cloned node
        clonedNode.remove();
View Full Code Here

        otherWsRootNode.save();
        assertExists(session, vhUuid);
        assertExists(otherWsSession, vhUuid);

        // Remove the last version
        vh.removeVersion(v11.getName());

        try {
            session.getNodeByUUID(vhUuid);
            fail("Orphan version history must have been removed from the default workspace");
        } catch (ItemNotFoundException e) {
View Full Code Here

            Property reference = otherRoot.setProperty(
                    "RemoveOrphanVersionTest", uuid, PropertyType.REFERENCE);
            otherSession.save();

            // Now remove the contents of the version history
            history.removeVersion(v10.getName());

            // Check that the version history still exists!
            try {
                session.getNodeByUUID(uuid);
            } catch (ItemNotFoundException e) {
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.