Jackrabbit 版本删除——名称意外
我正在使用 Apache Jackrabbit 来存储版本数据。我正在遵循 Jackrabbit wiki 上列出的模板来获取 版本控制基础知识,但是有件事没有按预期进行。
从 wiki 运行代码后,我尝试保存节点的另一个版本,然后获取其版本字符串:
child = parentNode.getNode("childNode");
child.checkout();
child.setProperty("anyProperty", "Blah3");
session.save();
Version thisVersion = child.checkin();
System.out.println(thisVersion.getName());
此代码的输出是 1.0.0 ,而我希望它是 1.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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法控制版本命名,这是由 JCR 实现(在本例中为 Jackrabbit)处理的。如果您想要为版本使用自定义名称,请使用版本标签。
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.