Apache Sling Context-Aware Configuration is part of the AEM product since version 6.3. You can also use it in AEM 6.1 or 6.2 by deploying the required bundles and adding some basic configuration. And if you want to use the latest features provided by wcm.io Context-Aware Configuration you need to deploy some updated bundles from Sling in AEM 6.3 as well.

Apache Sling Context-Aware Configuration Bundles

Links to the latest versions of Apache Sling Context-Aware Configuration bundles:

Apache Sling Context-Aware Configuration API Maven Central
Apache Sling Context-Aware Configuration SPI Maven Central
Apache Sling Context-Aware Configuration Implementation Maven Central
Apache Johnzon Wrapper Library Maven Central

Deploying Sling Context-Aware Configuration to AEM 6.1 or AEM 6.2

In AEM 6.1 or AEM 6.2 you need to deploy the latest version of these Sling bundles:

  • org.apache.sling:org.apache.sling.caconfig.api
  • org.apache.sling:org.apache.sling.caconfig.spi
  • org.apache.sling:org.apache.sling.caconfig.impl
  • org.apache.sling:org.apache.sling.commons.johnzon

The Default Context Path Strategy needs an additional configuration to support sling:configRef properties stored in jcr:content subnodes of AEM content pages:

  org.apache.sling.caconfig.resource.impl.def.DefaultContextPathStrategy
    configRefResourceNames=["jcr:content"]

You should also extend the filter settings for ignoring property names when reading and writing configuration data to also exclude properties with the cq: namespace:

  org.apache.sling.caconfig.management.impl.ConfigurationManagementSettingsImpl
    ignorePropertyNameRegex=["^(jcr|cq):.+$"]

If you want to use the Web Console plugin for Sling Context-Aware configuration you also need to create a system user which has read access to /conf and /content and add an service user mapping for this user (named sling-caconfig in this example):

  org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended-sling-caconfig
    user.mapping=["org.apache.sling.caconfig.impl\=sling-caconfig"]

Updating Sling Context-Aware Configuration in AEM 6.3

In AEM 6.3 you should check which versions of the bundles mentioned above are already installed. If you have no service pack installed you need to update at least the SPI and Impl bundle to the latest version:

  • org.apache.sling:org.apache.sling.caconfig.spi
  • org.apache.sling:org.apache.sling.caconfig.impl
  • org.apache.sling:org.apache.sling.commons.johnzon

The additional configuration steps for AEM 6.1 and 6.2 are not required for AEM 6.3 because they are already included, except this one:

  org.apache.sling.caconfig.management.impl.ConfigurationManagementSettingsImpl
    ignorePropertyNameRegex=["^(jcr|cq):.+$"]

Back to top

Version: 1.1.3-SNAPSHOT. Last Published: 2017-05-29.