Java JCR:父子节点版本对应关系

发布于 2024-08-24 15:22:53 字数 413 浏览 3 评论 0原文

我正在使用 Jackrabbit,我有以下问题:
我有一个父节点 P 和一个子节点 C。P 和 C 都是可版本化的。在我的代码中的某个时刻,我需要从 P 的先前版本 V 获取数据,因此我使用 getVersionHistory().getVersion(V).getNode("jcr:frozennode") 为了获得我需要的版本。然而在这个版本中,节点 P 的子节点不再是节点 C 而是对 C 版本历史的引用,因此我不知道当 P 的版本是 V 时 C 所处的确切状态。所以问题是,有没有办法确定哪些 C 版本对应于已检索的 PI 版本(“对应”是指同时处于活动状态)。我知道,由于 P 和 C 都是可版本化的,因此可以独立签出/签入,因此可能没有与 P 版本相对应的单个 C 版本,因此我希望获得 C 的子集版本历史记录包含 P 处于版本 V 时经历的版本 C。
谢谢你,
克里斯蒂娜

I am using Jackrabbit and I have the following question:
I have a parent node P and a child node C. Both P and C are versionable. At some point in my code I need to get data from a previous version V of P, so I use getVersionHistory().getVersion(V).getNode("jcr:frozennode")
in order to get the version I need. In this version however, the child of node P is no longer node C but a reference to C's version history, therefore I don't know the exact state C was in while P's version was V. So the question is, is there a way to determine which versions of C correspond to the version of P I have retrieved (by "correspond" I mean were active at the same time). I understand that since both P and C are versionable and therefore can be checked-out/checked-in independently there might not be a single version of C corresponding to a version of P, so I would expect to get a sub-set of C's version history which contains the versions C went through while P was in version V.
Thank you,
Christina

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

じ违心 2024-08-31 15:22:53

您可以使用添加到所有节点的时间戳来确定在给定时间关联的版本。

编辑:“正确”的方法可能是按版本签出完整的子树。
另请检查以下链接:

http://www.day.com/specs /jcr/2.0/3_Repository_Model.html#VersionableState

或者本教程:
http://jtoee.com/jsr-170/the_jcr_primer/5/

CND文档:
http://jackrabbit.apache.org/node-type-notation.html

You could use timestamps added to all nodes to determine which versions where assosciated at a given time.

EDIT: The "proper" way is probably to checkout a complete subtree by version.
Check also these links:

http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#VersionableState

Or this tutorial:
http://jtoee.com/jsr-170/the_jcr_primer/5/

CND docs:
http://jackrabbit.apache.org/node-type-notation.html

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