Rendering and Delivery rendering-and-delivery

NOTE
Adobe recommends using the SPA Editor for projects that require single page application framework-based client-side rendering (for example, React). Learn more.

Adobe Experience Manager (AEM) content can easily be rendered by way of Sling Default Servlets to render JSON and other formats.

Those out-of-the-box renderings typically walk the repository and return content as is.

AEM, by way of Sling, also supports developing and deploying custom sling renderers to take full control of the rendered schema and content.

Content Services Default Renderers fill the gap between out-of-the-box Sling Defaults and Custom Development allowing customization and control of many aspects of the rendered content without development.

The following diagram shows the rendering of content services.

chlimage_1-15

Requesting JSON requesting-json

Use <RESOURCE.caas[.<EXPORT-CONFIG][.<DEPTH-INT>].json to request JSON.

RESOURCE
an entity resource under /content/entities
or
a content resource under /content
EXPORT-CONFIG

OPTIONAL

an export configuration found under /apps/mobileapps/caas/exportConfigs/EXPORT-CONFIG

If omitted the default export configuration is applied

DEPTH-INT
OPTIONAL

depth recursion for rendering of children as used in Sling rendering

Creating Export Configs creating-export-configs

Export configs can be created to customize JSON rendering.

You can create a configuration node under /apps/mobileapps/caas/exportConfigs.

Node Name
Name of the configuration (for rendering selector)
jcr:primaryType
nt:unstructured

The following table shows the properties of Export Configs:

Name
Type
Default (if, not set)
Value
Description
includeComponents
String[]
include everything
sling:resourceType
exclude details for nodes with specified sling:resourceType from JSON export
excludeComponents
String[]
exclude nothing
sling:resourceType
include details only for nodes with specified sling:resourceType from JSON export
excludePropertyPrefixes
String[]
exclude nothing
Property prefixes
exclude properties that start with specified prefixes from JSON export
excludeProperties
String[]
exclude nothing
Property names
exclude specified properties from JSON export
includeProperties
String[]
include everything
Property names

if excludePropertyPrefixes set
this includes specified properties despite matching the prefix being excluded,

else (exclude properties ignored) only include these properties

includeChildren
String[]
include everything
child names
exclude specified children from JSON export
excludeChildren
String[]
exclude nothing
child names
include only specified children from JSON export, exclude other
renameProperties
String[]
rename nothing
<actual_property_name>,<replacement_property_name>
rename properties using replacements

Resource type export overrides resource-type-export-overrides

Create a configuration node under /apps/mobileapps/caas/exportConfigs.

name
resourceTypeOverrides
jcr:primaryType
nt:unstructured

The following table shows the properties:

Name
Type
Default (if, not set)
Value
Description
<SELECTOR_TO_INC>
String[]
-
sling:resourceType
For the following sling resource types, do not return the default CaaS json export.
Return a customer json export by rendering the resource as;
<RESOURCE>.<SELECTOR_TO_INC>.json

Existing Content Services Export Configs existing-content-services-export-configs

Content Services include two export configurations:

  • default (no config specified)
  • page (to render site pages)

Default Export Configuration default-export-configuration

Content Services default export configuration is applied if a config is specified in the requested URI.

<RESOURCE>.caas[.<DEPTH-INT>].json

Name
Value
excludeProperties
excludePropertyPrefixes
jcr:,sling:,cq:,oak:,pge-
includeProperties
jcr:text,text
jcr:title,title
jcr:description,description
jcr:lastModified,lastModified
cq:tags,tags
cq:lastModified,lastModified
includeComponents
excludeComponents
includeChildren
excludeChildren
Sling JSON Overrides
foundation/components/image
wcm/foundation/components/image
mobileapps/caas/components/data/contentReference
mobileapps/caas/components/data/assetlist

Page Export Configuration page-export-configuration

This configuration extends the default to include grouping children under a child node.

<SITE_PAGE>.caas.page[.<DEPTH-INT>].json

Additional Resources additional-resources

See the resources below to learn about additional topics in Content Services:

recommendation-more-help
2eeeb575-8007-40cc-a72d-206fbc4ddd4b