Hi Team,
I have a requirement where I need to generate the single JSON data of all the content fragments selected. In component dialog Author is selecting the folder & via Sling Model I'm able to get all the content fragments within selected folder. Then I'm adding to those in list<resource> & can use on page as well.
But now I want to generate one JSON file with all the data from these fragments (something like below snippet) & each fragment may include more than 20 fields.
{
"cfList": [
{
"id": "1",
"firstName": "A",
"lastName": "B"
},
{
"id": "2",
"firstName": "C",
"lastName": "D"
},
{
"id": "3",
"firstName": "E",
"lastName": "F"
}
]
}
Can you please suggest any approach to achieve this?
Many thanks,
sesmic