我正在尝试检索 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/