Custom namespaces
- Applies to:
- Experience Manager as a Cloud Service
- Topics:
- Metadata
CREATED FOR:
- Intermediate
- Developer
Learn how to define and deploy custom namespaces to AEM as a Cloud Service.
Custom namespaces are the optional part of a JCR property preceding a :
. AEM uses several namespaces such as:
jcr
for JCR system propertiescq
for AEM (formerly known as Adobe CQ) propertiesdam
for AEM properties specific to DAM assetsdc
for Dublin Core properties
… and many others.
Namespaces can be used to denote the scope and intent of a property. Creating a custom namespace, often your company name, helps clearly identify nodes or properties specific to your AEM implementation and contain data specific to your business.
Custom namespaces are managed in Sling Repository Initialization (repoinit) scripts, and deploys to AEM as a Cloud Service as OSGi configurations - and added to your AEM project’s ui.config
project.
Resources
Code
The following code is used to configure a wknd
namespace.
RepositoryInitializer OSGi configuration
/ui.config/src/main/content/jcr_root/apps/wknd-examples/osgiconfig/config/org.apache.sling.jcr.repoinit.RepositoryInitializer~wknd-examples-namespaces.cfg.json
{
"scripts": [
"register namespace (wknd) https://site.wknd/1.0"
]
}
This allows custom properties using the wknd
namespace, as denoted as the first parameter after the register namespace
instruction, to be use in AEM. For more advanced script definitions, review the examples in the Sling Repository Initialization (repoinit) documentation.