Jackrabbit 版本删除——名称意外

发布于 2024-08-30 02:55:04 字数 660 浏览 5 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

郁金香雨 2024-09-06 02:55:04

您无法控制版本命名,这是由 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文