【发布时间】:2017-01-11 19:53:32
【问题描述】:
我正在使用 AEM 6.2 并尝试从节点的“jcr:content”中获取“damFolderPath”值。
我试过这些:
//resourcePath = "/content/projects/newyear-1"
Resource resource = resourceResolver.getResource(resourcePath);
Node tNode = resource.adaptTo(Node.class);
Property prop = tNode.getProperty("jcr:content/damFolderPath");
log.info("\n...Output 1:"+tNode.hasProperty("damFolderPath"));
log.info("\n...Output 2:"+prop.toString());
输出 1:假
输出 2:PropertyDelegate{parent=/content/projects/newyear-1/kms/jcr:content: { jcr:primaryType = nt:unstructured, detailsHref = /projects/details.html, jcr:title = kms , active = true, cq:template = /apps/swa/projects/templates/default, damFolderPath = /content/dam/projects/newyear-1/kms, coverUrl = /content/dam/projects /newyear-1/kms/cover, sling:resourceType = cq/gui/components/projects/admin/card/projectcontent, 链接 = { ... }, 仪表板 = { ... }}, property=damFolderPath = /content/dam/projects/newyear-1/kms}]
我可以看到它在那里,但我如何从 output2 中获取它?
【问题讨论】: