Could you please help me in writing Sling Model for generating custom JSON for
1. Component with parsys (components can be added in parsys)
2. Page level (with all the components and sub-components added)
Any code example would help a lot.
Thanks
Views
Replies
Total Likes
To generate JSON - you can use Sling Model Exporter - see: Adobe Experience Manager Help | Exporting Adobe Experience Manager Data Using Sling Model Exporters
Views
Replies
Total Likes
You can also export Sling Resources to JSON using Java logic as discussed here -- Converting AEM/Sling Resources to JSON - Adobe Experience Manager | AEM/CQ | Apache Sling
Views
Replies
Total Likes
Hi,
Please check Adobe Experience Manager Help | Developing Sling Model Exporters in AEM
Views
Replies
Total Likes
I appreciate the help guys. I could not relate the concepts present at links provided to my requirement.
It would be nice to have a code preview for point 1 or 2.
Views
Replies
Total Likes
Sling Exporter returns data for a component in parsys - as you requested for point 1 (Component with parsys).
Views
Replies
Total Likes
Thanks Donald,
My requirement is, export JSON for
page with contentParsys [allow only 1 component with componentsParsys],
componentsParsys allow multiple components [components without parsys & components with answerParsys] multiple times,
answerParsys allow only multiple Answer components.
The complexity of this requirement is confusing me.
Views
Replies
Total Likes
Raja,
Could you please elaborate on exactly how you need the output ? Its bit confusing with all the info what you gave.
Thanks
Veena
Views
Replies
Total Likes
Created a Page using Template having pathParsys,
pathParsys allow component A multiple times.
Component A has componentParsys,
componentParsys allow component B, component C, component D, component E, component F, component G, component H multiple times.
Component C & Component D are configured with 1 default Answer component and have answerParsys (to add additional answer components),
answerParsys allow Answer component multiple times.
Component H is configured with 2 default Answer components
Note: Component B, Component E, Component F, Component G does not have parsys.
After a lot of combinations of components are added to the Page and Published, I need to generate JSON at Page level (with all components data).
Views
Replies
Total Likes
With the approach what scott mentioned what is the JSON you are getting right now ? With some real data I can give you a solution though
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies