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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Need Best ways to implement Content as a Service for Mobile apps

Shashi_Mulugu
Community Advisor
Community Advisor

Hi Team,

 

Can anyone let us know the best practice along with Pros and Cons for exposing AEM content as json and build Mobile apps.


1.Sling Model exporter framework-json o/p
2.Custom servlet framework- json o/p
3. Experience fragments - json,html o/p
4. Content fragments - json o/p

 

@kautuk_sahni @Arun_Patidar 

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

I would go with the 1st approach but As far as I know, the pros and cons of each approach are:

 

1.Sling Model exporter framework-json --> you need to create for sling model for each component model. For the custom model, you would have complete control of each property. It covers the redirect but not include the response of references like XF.
2.Custom servlet framework- json o/p - The custom servlet allows to control of everything but requires framwork validation to avoid unwanted results. e.g. https://aemlab.blogspot.com/2019/07/get-json-response-of-aem-page.html (e.g. It covers both redirect and reference response inclusion This is not production-ready, I created as a PoC)
3. Experience fragments - json,html o/p - same as point 1st but have to make multiple JSON requests to render the content of one page and MSM could be difficult in XF editor
4. Content fragments - json o/p - Limited data type.

View solution in original post

2 Replies
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

I would go with the 1st approach but As far as I know, the pros and cons of each approach are:

 

1.Sling Model exporter framework-json --> you need to create for sling model for each component model. For the custom model, you would have complete control of each property. It covers the redirect but not include the response of references like XF.
2.Custom servlet framework- json o/p - The custom servlet allows to control of everything but requires framwork validation to avoid unwanted results. e.g. https://aemlab.blogspot.com/2019/07/get-json-response-of-aem-page.html (e.g. It covers both redirect and reference response inclusion This is not production-ready, I created as a PoC)
3. Experience fragments - json,html o/p - same as point 1st but have to make multiple JSON requests to render the content of one page and MSM could be difficult in XF editor
4. Content fragments - json o/p - Limited data type.

View solution in original post

Shashi_Mulugu
Community Advisor
Community Advisor
Thank you Arun. You always help me with your expertise.