CaaS for a page content in aem | Community
Skip to main content
karansheel
Level 3
Sep 17, 2018 12:45 PM UTC

CaaS for a page content in aem

Is there any way to display content of a  page like a sling model json. For example : if i have a page "/content/my-site/homepage" & it contains three components a,b,c . Each component has a sling model. if i hit the component path("/content/my-site/homepage/jcr:content/a.model.json") directly with .model.json extension then it will give a json view of that component as i'm using jackson exporter in sling model. i want to display the json of all the components when i hit the page with any extension. like if i hit "/content/my-site/homepage.model.json" then it will give combined json of all the three components .There is a option to use infinity.json but t gives node structure as a json not a sling model & i don't want to use content fragments or i have  to develop a custom solution for this (using servlet and invoke it on the basis of selctor).

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

6 replies

edubey
Level 10
Sep 17, 2018 2:44 PM UTC

model is the selector used by page model sling exporter.

When you have custom implementation of component sling exporter, you have  to give the path to component in repository and then use model.json on it

Translate
Daniel_Gordon
Employee
Sep 17, 2018 2:14 PM UTC

With the latest version of the Content Services feature pack hitting: "/content/my-site/homepage.model.json" as you described should give you a combined JSON of the Page + any components that have been added to the page. Are you not seeing this behavior? Or are you trying to do something else?

Translate
karansheel
Level 3
Sep 17, 2018 2:18 PM UTC

I tried it on AEM6.4 but didn't get expected rrsult. Can you please provide the latest package version

Translate
smacdonald2008
Level 10
Sep 17, 2018 1:47 PM UTC

I have never tried this use case - i have asked some other internal ppl to look here.

Translate