jcr - Apache 吊索 : Accessing Versions through REST API

标签 jcr sling jackrabbit

我正在尝试检索 Sling 中版本控制节点的版本历史记录。

我已经创建了一个版本控制节点, checkout 了,上传了新版本并 checkin 了它。

curl -u admin:admin -T test.txt http://localhost:8080/apps/versions2
curl -u admin:admin http://localhost:8080/apps/versions2/test.txt -X POST -F"jcr:mixinTypes=mix:versionable"
curl -u admin:admin http://localhost:8080/apps/versions2/test.txt -X POST -F":operation=checkout"
curl -u admin:admin -T test.txt http://localhost:8080/apps/versions2/test.txt
curl -u admin:admin http://localhost:8080/apps/versions2/test.txt -X POST -F":operation=checkin"

但是,当我尝试按照 this enhancement request 的建议提取版本历史记录时它不起作用。

curl -u admin:admin http://localhost:8080/apps/versions2/test.txt.V.tidy.json
{
"jcr:primaryType": "nt:file",
"jcr:mixinTypes": ["mix:versionable"],
"jcr:createdBy": "admin",
"jcr:versionHistory": "31d1e0e8-22b0-476d-b591-b7441073f0fc",
"jcr:predecessors": [],
"jcr:created": "Mon Nov 20 2017 13:31:47 GMT+0100",
"jcr:baseVersion": "00b9682c-9402-4c5f-a759-8f1837e55e35",
"jcr:isCheckedOut": "false",
"jcr:uuid": "0e1784aa-51c2-4901-b56d-89f8dcea9744"
}

我的 B 计划是从 /jcr:system/jcr:versionStorage 读取节点,但我不知道如何通过 WebDAV API 访问它。

最佳答案

version info servlet 的配置策略设置为REQUIRE,这意味着在显式设置配置之前此 servlet 将不会处于事件状态。

因此,您可以转到系统配置( http://localhost:8080/system/console/configMgr ),搜索 Apache Sling Version Info Servlet,单击并保存默认配置,这样您就可以获得该节点的版本正如预期的那样。

关于jcr - Apache 吊索 : Accessing Versions through REST API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47395543/

相关文章:

aem - jcr:lastModified 与 cq:lastModified

java - 为什么吊索 :OsgiConfig node not working in/etc/folder in AEM?

serialization - 将我的 POJO 保存到 Jackrabbit JCR 的最佳方法是什么?

java - 使用 jackrabbit 存储图像等静态内容并使用 servlet 读取它们并将其作为图像流传输给用户对性能有何影响?

aem - JCR 在 AEM 技术堆栈中的作用是什么?

java - 如何使用 JCR 中的 SQL 从子名中检索父名

java - 无法在 CQ 中部署 SlingServlet

recursion - 递归地列出Children

apache - 如何在 tomcat 上部署现有的 apache sling 存储库?