Adobe

AEM 6.3 First Looks: Content as a Service

To the seasoned Adobe Experience Manager (AEM) architect the mention of a new content as a service feature might garner a raised eyebrow. After all, AEM has long provided (we thought) “content as a service” through use of Sling Selectors. That is any AEM page can be dissected by the use of selectors. See: https://sling.apache.org/documentation/the-sling-engine/url-decomposition.html.
Therefore, content as a service is already in good standing… right? Having been involved in projects that use selectors to syndicate content, I can tell you there are gaps in that model. Namely aggregation and governance. A problem we would solve with a custom servlet. Content as a Service in AEM 6.3 will solve those many of those challenges.
AEM 6.3’s Content as a Service (CaaS) is an editor-empowered tool to provide an aggregated view of content within the JCR. That content can be assets, content fragments or pages, intended for external consumption. Uses would typically be mobile applications, portals, external web applications, or even an AEM site itself.
In this article, we’ll show you how to expose an aggregate view of content fragments, which would otherwise require custom development in AEM 6.2. Welcome to AEM CaaS.

Enable CaaS

CaaS is disabled by default. Use the AEM system console to enable via the AEM Content Services Feature Flag:

Create the Service

Using Touch UI, click Mobile, then Spaces:


Create a space.


Entities are the content you are expositing, and can be either an Asset Model or Page Model (additional models can be created). The space you created above is a container for entities. Create an entity:

Choose the Asset Model.

Fill-in the information, and click Create:

Once you’ve created the entity, click Open:

We’ve already created a couple of example content fragments, so let’s choose those. Click the +Add button:

Select the content fragments:

Click Save under Save & Close:

You should see a success message:

Preview the Service on Author

Click on the Preview link and you’ll what the service looks like in jSON format. Note that you can change the selector name and depth.

We can also view this directly on the Author instance:

Preview the Service on Publish

To preview on Publish, we must first publish the service (which will also publish the content). Click Save & Close:

Click Publish Tree:

Navigate back into the service by clicking Edit:

Click Open on Publish:

To fetch the asset, click on the href and download the content fragment:

Open the downloaded fragment in an editor:

The fragment:

This is the way the fragment looks back in the Content Fragment Editor.

Next Steps

As we can see, CaaS enables a non-developer to easily create a service, and then manage what content available via the service. You’ll likely want to use AEM permissions to secure editor access to this feature.
The CaaS entities are stored under /content/entities, so permission management should not be a challenge.

On the Publish instance, all features available to ordinary content should also work, like securing via Dispatcher or usage of Closed User Groups to restrict access.
Give it a try and let us know!

About the Author

More from this Author

Thoughts on “AEM 6.3 First Looks: Content as a Service”

  1. appreciate the guide helps me with a puzzle I have and how content fragments, experience fragments and now this CaaS flag might help to put it together.

  2. Hi Greg,
    I have created CaaS and it is associated with assets (images) for external consumption. But, it doesn’t contain image renditions in CaaS.
    I believe I need to write custom service to expose renditions of images for external consumption.
    Please correct my understanding.
    Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up