jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lubos and Alena Pochman" <pochm...@gmail.com>
Subject Removing root version
Date Tue, 03 Apr 2007 22:45:41 GMT
I would like to implement rollback function for the versioned node. If node
has only one version, the node itself is removed. If there is more then one
of the node, the root (top, head) node is removed. I tried v.remove() or
history.removeVersion(v.getName()), but both fail with exception:

cannot remove a protected node

Here is the code:

            VersionHistory history = document.getVersionHistory();
            VersionIterator ito = history.getAllVersions();
            if (ito.hasNext()) {
                Version v = ito.nextVersion(); // Top version
                if (ito.hasNext())

My question is, is it possible or do I have to use workaround like create
new version from version head-1 (create new version) and then remove the
original root version and the original head-1 version?

Thanks, Lubos

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message