Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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.