AEM code snippets : export page data as json format using sling model exporter | Community
Skip to main content
October 17, 2017

AEM code snippets : export page data as json format using sling model exporter

  • October 17, 2017
  • 3 replies
  • 3163 views

In my previous article’s you have seen how to export page data as a JSON format using servlet, now, I am going to explain exporting page content as JSON using sling models exporter,  using sling model exporter you can get below advantages

  • No need to write servlet to export data as JSON format
  • You can use same code which is written using sling models to render content and to export as JSON format

Sling model exporter is very useful when you want to publish your data to third party system’s or consuming within the site using ajax request if you have sling models and wants to serialize them,  by providing simple @Exporter annotations to the existing sling models you can convert your model to CaaS based URL

Refer below link to get to access to complete article and to download code

http://keysandstrokes.info/aem-code-snippets-export-page-data-as-json-format-using-sling-model-exporter/

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

3 replies

smacdonald2008
Level 10
October 17, 2017

Excellent community content!

kautuk_sahni
Community Manager
Community Manager
October 20, 2017

Really valuable content!!

~kautuk

Kautuk Sahni
Level 2
June 4, 2019

Hi Raj,

I have the similar requirement.

I have a site with several pages and each page has 1 or more content fragments on it + some other components.

Now when i request the page as model.json, I want to hide/remove the unwanted data from my json. How can i achieve this?

Can you please guide me on this?