본문 바로가기

Develop/AEM

특정 node 값 받아오기

String copyright_path = g_content_country_locale_url+"/jcr:content/footer/footer-copyright";

Resource resources = resourceResolver.getResource(copyright_path);

Node rootNode = resources.adaptTo(Node.class);

String footer_copyright = rootNode.getProperty("text").getString();

---  Result  -----------------------------------------------------------------

<!-- copyright_path : /content/genesis/global/en/jcr:content/footer/footer-copyright -->
<!-- resources : JcrNodeResource, type=genesis/global/components/footer/footer-copyright, superType=null, path=/content/genesis/global/en/jcr:content/footer/footer-copyright -->
<!-- rootNode : Node[NodeDelegate{tree=/content/genesis/global/en/jcr:content/footer/footer-copyright: { jcr:primaryType = nt:unstructured, jcr:mixinTypes = [cq:ReplicationStatus], jcr:lastModifiedBy = 9267053, text = COPYRIGHT 2016 GENESIS MOTOR COMPANY ALL RIGHTS RESERVED., jcr:lastModified = 2016-10-21T14:20:59.322+09:00, sling:resourceType = genesis/global/components/footer/footer-copyright}}] -->
<!-- footer_copyright : COPYRIGHT 2016 GENESIS MOTOR COMPANY ALL RIGHTS RESERVED. -->


PageManager
https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/api/PageManager.html


Content using the JCR API

https://helpx.adobe.com/experience-manager/using/programmatically-accessing-cq-content-using.html