Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to get responsivegrid data using jcr api

Avatar

Level 7

akshaybhujbale_0-1658220744943.png

HI 

 I want to get responsivegrid componenet using jcr api.

Please help me with sample code.

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale ,
You ca iterate nodes. Get ResourceResolver as per your project setup. Get Session from ResourceResolver and iterate nodes. This is just pseudo code.

             Session session=resourceResolver.adaptTo(Session.class);
             Node node=session.getNode("Path to parent node");
                 NodeIterator nodeIterator= node.getNodes();
                 while (nodeIterator.hasNext()){
                     Node child=(Node)nodeIterator.next();
                 }

You can use resource api as well. Once get resource and adaptTo node. 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale ,
You ca iterate nodes. Get ResourceResolver as per your project setup. Get Session from ResourceResolver and iterate nodes. This is just pseudo code.

             Session session=resourceResolver.adaptTo(Session.class);
             Node node=session.getNode("Path to parent node");
                 NodeIterator nodeIterator= node.getNodes();
                 while (nodeIterator.hasNext()){
                     Node child=(Node)nodeIterator.next();
                 }

You can use resource api as well. Once get resource and adaptTo node.