Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Rendering JSON for an AEM resource

Avatar

Avatar
Validate 1
Level 3
Lavanya_Malyala
Level 3

Likes

20 likes

Total Posts

29 posts

Correct Reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
Lavanya_Malyala
Level 3

Likes

20 likes

Total Posts

29 posts

Correct Reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
Lavanya_Malyala
Level 3

14-06-2018

Hi,

I'm trying to convert an AEM page (/content/myproject/en) to JSON. I had followed the below link and I could get the expected JSON:

Converting AEM/Sling Resources to JSON - Adobe Experience Manager | AEM/CQ | Apache Sling

However, from the following link I see that we can retrieve the HTML markup (or JSON, XML, txt, PDF, etc...) for a component as well as a page if we provide the correct path. When I tried implementing the same I'm getting the JSON, but not a complete one. I mean that I'm getting a partial JSON which is an invalid one.

FYI: The below link works perfectly for html

Get the rendered HTML for an AEM resource, component or page - Adobe Experience Manager | AEM/CQ | A...

I wonder if the second link is valid for my use case (getting JSON) or not. Can anyone let me know if you had used SlingRequestProcessor service for retrieving JSON?

I'd really appreciate any help or advice on this!

Thanks,

Lavanya Malyala

Replies

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,260 likes

Total Posts

3,140 posts

Correct Reply

886 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

14-06-2018

Hi,

You should use Sling Model Exporter, which is enhanced Sling Model using the Exporter framework to rendition as JSON and allow to customise output as well.

Adobe Experience Manager Help | Developing Sling Model Exporters in AEM

Thanks

Arun

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,081 likes

Total Posts

3,121 posts

Correct Reply

1,061 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

14-06-2018

What do you mean with "I get JSON, but not a complete one"?