Exporting data stored in CQ scaffolds | Community
Skip to main content
jond1978
New Participant
November 25, 2015
Solved

Exporting data stored in CQ scaffolds

  • November 25, 2015
  • 1 reply
  • 637 views

Hi,

We are in a situation where we need to export the data stored in CQ's scaffold structure in excel format (Our initial plan is to make use of Excel's power query for the same). Is there a built in way to export the JCR data into json feed, or should we need to create a custom service for the purpose?


Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

You can achieve this by :-

Option 1 

Link:- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/org/apache/sling/commons/json/jcr/JsonJcrNode.html

There is a Class, JsonJcrNode, this class makes it easy to create a json object out of a JCR node.

//

public class JsonJcrNode

 

extends JSONObject

This class makes it easy to create a JSON object out of a JCR node. It is a shameless copy of JsonItemWriter, but instead of writing the resulting JSON directly to an output, you get a JSONObject that you can deal with.

 

Option 2

Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/components/pageinfo.html

//Obtaining page information in json Format

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

1 reply

kautuk_sahni
kautuk_sahniAccepted solution
Employee
November 25, 2015

Hi 

You can achieve this by :-

Option 1 

Link:- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/org/apache/sling/commons/json/jcr/JsonJcrNode.html

There is a Class, JsonJcrNode, this class makes it easy to create a json object out of a JCR node.

//

public class JsonJcrNode

 

extends JSONObject

This class makes it easy to create a JSON object out of a JCR node. It is a shameless copy of JsonItemWriter, but instead of writing the resulting JSON directly to an output, you get a JSONObject that you can deal with.

 

Option 2

Link:- https://docs.adobe.com/docs/en/aem/6-1/develop/components/pageinfo.html

//Obtaining page information in json Format

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni