Hi all,
Views
Replies
Total Likes
Can you please explain your use case in more detail - what are you doing with the returned JSON? Have you written any custom servlets that produce the JSON?
Views
Replies
Total Likes
Hi,
Thanks for replying on this.
Yes we have written custom json. Its a JSP (which has the logic for creating JSP). JSON is pretty simple. All its doing is just reading the node properties (under jcr:content) and outputting in form on JSON.
For example:
We have node /content/project1/home
It has got 2 component to capture content
/content/project1/home/jcr:content/node1
/content/project1/home/jcr:content/node2
So now if you hit /content.project1/home.content.json then it will give
{
node1:
{
property1 : "Value for property1",
property2 : "Value for property2",
property3 : "Value for property3"
}
node2:
{
property1 : "Value for property1",
property2 : "Value for property2",
property3 : "Value for property3"
}
}
Let me know if this helps. I can put more details if needed.
Views
Replies
Total Likes
I would look at using a Sling Servlet that uses this API to traverse through the JCR nodes:
http://jackrabbit.apache.org/api/2.2/org/apache/jackrabbit/commons/flat/TreeTraverser.html
Did you use JCR API to read nodes or are you using another approach?
Views
Replies
Total Likes
Views
Likes
Replies