DocumentationAEMAEM TutorialsAEM as a Cloud Service Tutorials

Custom namespaces

Last update: March 23, 2025
  • 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 properties
  • cq for AEM (formerly known as Adobe CQ) properties
  • dam for AEM properties specific to DAM assets
  • dc 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.

video poster

https://video.tv.adobe.com/v/3412319?quality=12&learn=on

Resources

  • Sling Repository Initialization (repoinit) documentation

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.

recommendation-more-help
4859a77c-7971-4ac9-8f5c-4260823c6f69