tags:

views:

152

answers:

1

I'm using Apache Jackrabbit to store versioned data. I'm following the template listed on the Jackrabbit wiki for versioning basics, but there's one thing that isn't working as expected.

After I run the code from the wiki, I try saving another version of the node, then getting its version string:

child = parentNode.getNode("childNode");
child.checkout();
child.setProperty("anyProperty", "Blah3");
session.save();
Version thisVersion = child.checkin();
System.out.println(thisVersion.getName());

The output of this code is 1.0.0 , when I want it to be 1.1 . My goal is to be able to remove the last -- and only the last -- version of a node, and have the next version have the same name as the removed version. I only care about doing this when the node is being added; if I can check in the node, and read the name (to get the version number) without an exception being thrown, I'm fine with not being able to remove the version. Looking around the internet, I can't find a way to accomplish this.

+1  A: 

You can't control the version naming, this is handled by the JCR implementation (in this case Jackrabbit). If you want to have your custom names for versions, use version labels.

Alexander Klimetschek

related questions