AEM Mobile Apps | Community
Skip to main content
AEM_Forum
Level 10
March 1, 2018
Solved

AEM Mobile Apps

  • March 1, 2018
  • 6 replies
  • 3987 views

Hi,

Let us say, I want to build an AEM Mobile App, that behaves exactly similar to an AEM Web App and the AEM Web App was already built (it is up and running).

Now in order to build the AEM Mobile App, what additional steps to be followed?

Given that JCR Data is accessible in a RESTful way, do we still need to build servlets on JCR Data?

My understanding is that from AEM side we do not need to do anything, as Mobile App could access AEM data in a RESTful way (by design).

Appreciate your replies.

Thanks,

Rama.

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

Hi Rama,

You're correct, AEM can serve content in Restfull manner without any servlet or custom code.

But the default JSON output will contain a lot of extra information and can reveal your internal repository structure.

In order, to avoid any security related issues, it would be a good idea to only expose a subset of information(node contents) and hide certain implementation level details like jcr:PrimaryType: sling:resourceType, sling:resourceSuperType.

This can be achieved with a custom servlet or content services.

If you still, want to use the default JSON output, I would strongly recommend using Sling Model Exporters, this way you can hide implementation level details.

Hope this helps.

Regards

Varun mitra

[1] https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/adobe/acs/samples/models/SampleSlingModelExporter.java

[2] https://www.dropbox.com/s/8jcaw3x7g1lrblx/ResourceToJSONServlet.java?dl=0

6 replies

AEM_Forum
AEM_ForumAuthor
Level 10
March 4, 2018

Hi,

Someone kindly address my query.

My query is if we want to display AEM JCR data inside a Mobile App, what should I do from AEM perspective?

Given that AEM JCR exposes the data in a RESTful way, is it true that this data is readily available to the Mobile Apps, all it needs to do is to call the RESTful API?

Appreciate your replies.

Thanks,

Rama.

AEM_Forum
AEM_ForumAuthor
Level 10
March 6, 2018

Hi all,

Do you suggest that the upcoming Ask The Expert Session on Content As A Service is going to address this query?

Thanks,

Rama.

varunmitra
Adobe Employee
Adobe Employee
March 13, 2018

Hi Rama,

You might want to explore content services feature that is available with AEM 6.3 + Feature Pack 1.

Here is the documentation and a tutorial for this.

Also, creating a simple sling servlet to obtain channel neutral output can also work.

Regards

Varun

[1] https://helpx.adobe.com/experience-manager/kt/sites/using/content-services-tutorial-use.html

Adobe Experience Manager Help | Getting Started with AEM Content Services

[2] https://helpx.adobe.com/experience-manager/kt/sites/using/structured-content-fragments-content-services-article-setup.ht…

AEM_Forum
AEM_ForumAuthor
Level 10
March 13, 2018

Thanks Varun for responding with these very useful links.

My main query is that JCR itself is a repository offering access to the content in a RESTful way.

Does it not serve our this purpose?

Why cant the Mobile App issue a RESTful call to the JCR for the content?

Why do we need servlets and all?

Thanks,

Rama.

smacdonald2008
Level 10
March 13, 2018

YEs - the AEM JCR is Restful and you can perform many Restful operations - as shown here:  Sling Cheatsheet

However - as Varun suggests - Content Services can be used

varunmitra
Adobe Employee
varunmitraAdobe EmployeeAccepted solution
Adobe Employee
March 13, 2018

Hi Rama,

You're correct, AEM can serve content in Restfull manner without any servlet or custom code.

But the default JSON output will contain a lot of extra information and can reveal your internal repository structure.

In order, to avoid any security related issues, it would be a good idea to only expose a subset of information(node contents) and hide certain implementation level details like jcr:PrimaryType: sling:resourceType, sling:resourceSuperType.

This can be achieved with a custom servlet or content services.

If you still, want to use the default JSON output, I would strongly recommend using Sling Model Exporters, this way you can hide implementation level details.

Hope this helps.

Regards

Varun mitra

[1] https://github.com/Adobe-Consulting-Services/acs-aem-samples/blob/master/bundle/src/main/java/com/adobe/acs/samples/models/SampleSlingModelExporter.java

[2] https://www.dropbox.com/s/8jcaw3x7g1lrblx/ResourceToJSONServlet.java?dl=0