-
1. Re: How to delete all versions of a versionable node?
rhauch Jul 7, 2015 9:59 AM (in response to jkraushaar)The JCR standard API does not define a way to do this, but ModeShape added a custom API to remove nodes and their version histories in 4.0. See the org.modeshape.jcr.api.version.VersionManager.remove(String path) method, and the MODE-1839 issue describing the changes, some reasons why we implemented it this way, and workarounds with the standard JCR API that get you almost there.
-
2. Re: How to delete all versions of a versionable node?
hchiorean Jul 7, 2015 10:04 AM (in response to rhauch)I cannot access these information using the Versioning API getVersionHistory method (PathNotFoundException).
why is this exception being thrown ? You should be able to interrogate the version history of a versionable node. If that's not the case, then there's either a bug somewhere or some data became corrupted in the version history. Once you have the version history of a node you can call #removeVersion to remove all specific versions of a node. After you've accomplished that, rhauch describes how you can completely clean up the version tree.
-
3. Re: How to delete all versions of a versionable node?
jkraushaar Jul 7, 2015 10:11 AM (in response to hchiorean)I called getVersionHistory() for an already deleted node. If the node still exists, calling the method will return the VersionHistory object as you described.
-
4. Re: How to delete all versions of a versionable node?
jkraushaar Jul 8, 2015 3:41 AM (in response to rhauch)Are there any best practices if I want to delete a shareable node (and the complete shared set) using this method?