Hi all,
I am using aem 6.5
I have a requirement for converting aem page nodes to json.
Previously I used jsonItemWriter.dump method which converts data directly.
But this method is deprecated.
And second thing is in multifield we get data as item0,item1 in jsonobject format.
But my requirement is to convert this multifield to JsonArray.
Kindly guide for same
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
You can use the sling model exporter to expose the data in JSON format.
Please refer to the below URL to create the sling model export.
https://github.com/auniverseaway/sling-exporter-sample/tree/master/src/main/java/org/millr/sling
Now, to fetch details of multifield nodes, Please follow the below steps.
This way we can map the data of nodes to the sling model and it can be exported to the JSON format using sling model export.
Let me know if you have any questions.
You can use the sling model exporter to expose the data in JSON format.
Please refer to the below URL to create the sling model export.
https://github.com/auniverseaway/sling-exporter-sample/tree/master/src/main/java/org/millr/sling
Now, to fetch details of multifield nodes, Please follow the below steps.
This way we can map the data of nodes to the sling model and it can be exported to the JSON format using sling model export.
Let me know if you have any questions.
Views
Replies
Total Likes
Yes, As we are using @childResource annotation as mentioned above, it will consider all child nodes of multifield.
Combination of List<multifieldNodeModel> and @childResource annotation will map all item nodes of multifield to a List and then you can use it for pass in sightly or anything else.
Views
Replies
Total Likes
Views
Likes
Replies