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

AEM Mobile Apps

Avatar

Level 10

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.

1 Accepted Solution

Avatar

Correct answer by
Level 3

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/ad...

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

View solution in original post

6 Replies

Avatar

Level 10

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.

Avatar

Level 10

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.

Avatar

Level 3

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-servi...

Avatar

Level 10

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.

Avatar

Level 10

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

Avatar

Correct answer by
Level 3

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/ad...

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