Package javax.jcr.version

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


            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


                String name = Text.getName(itemPath);
                // remove index
                if (name.endsWith("]")) {
                    name = name.substring(0, name.lastIndexOf('['));
                }
                versionHistory.removeVersion(name);
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } else {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
View Full Code Here

                    + path);
        }
        VersionHistory vh = CommandHelper.getNode(ctx, path)
            .getVersionHistory();
        Version v = vh.getVersionByLabel(label);
        vh.removeVersion(v.getName());
        return false;
    }

    /**
     * @return the path key
View Full Code Here

        n.checkout();
        n.checkin();
        VersionHistory vh = n.getVersionHistory();
        vh.addVersionLabel(v10.getName(), "test", true);
        // the next call must not fail
        vh.removeVersion(v10.getName());
        // now the label must be gone
        String[] labels = vh.getVersionLabels();
        assertEquals("Label of a removed version must be removed as well", 0, labels.length);
    }
}
View Full Code Here

        VersionIterator vi = vh.getAllVersions();
        while (vi.hasNext()) {
            Version currenVersion = vi.nextVersion();
            String versionName = currenVersion.getName();
            if (!versionName.equals("jcr:rootVersion") && !versionName.equals(baseVersion)) {
                vh.removeVersion(versionName);
            }
        }
    }

    /**
 
View Full Code Here

     */
    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

        VersionIterator vi = vh.getAllVersions();
        while (vi.hasNext()) {
            Version currenVersion = vi.nextVersion();
            String versionName = currenVersion.getName();
            if (!versionName.equals("jcr:rootVersion") && !versionName.equals(baseVersion)) {
                vh.removeVersion(versionName);
            }
        }
    }

    /**
 
View Full Code Here

        VersionIterator vi = vh.getAllVersions();
        while (vi.hasNext()) {
            Version currenVersion = vi.nextVersion();
            String versionName = currenVersion.getName();
            if (!versionName.equals("jcr:rootVersion") && !versionName.equals(baseVersion)) {
                vh.removeVersion(versionName);
            }
        }
    }

    /**
 
View Full Code Here

                String name = Text.getName(itemPath);
                // remove index
                if (name.endsWith("]")) {
                    name = name.substring(0, name.lastIndexOf('['));
                }
                versionHistory.removeVersion(name);
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } else {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
View Full Code Here

                String name = Text.getName(itemPath);
                // remove index
                if (name.endsWith("]")) {
                    name = name.substring(0, name.lastIndexOf('['));
                }
                versionHistory.removeVersion(name);
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } else {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
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.