Wednesday, 20 February 2013

Creating Custom Namespaces


Adobe CQ uses namespaces to maintain modularity between the properties and also tags.  namespaces help in distinguishing different modules of the project. We create thousand of properties in our project and many times it consists of just words. Hence to make the properties names meaningful we can add a namespace to project related namespaces.
Note that the namespace is unique to your project and doesn’t conflict with existing namespaces.
Steps for creating Custom Namespace:
Step 1: Log into CRX and follow this path:http://servername:port/crx/explorer/nodetypes/index.jsp  or click on Node Administration link from the CRX Console.
Step 2:  You will be navigated to the below screen. On the left panel, all the node types will be displayed. Click on the Namespaces link on the right as displayed below:
  
Click on namespaces





 Step 3: Below screen will appear and click on New button and enter the namespace URI and prefix . The namespace provided below is just an example.
enter new





 Step 4: The namespace will be created and it can now be used in your project.
Namespace created





 Let me know if any questions.
Hope this helps. Thanks!

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Ashok,

    Great Article!!!

    Can you please elaborate the namespace use in cq, and in which scenario we may use this one?

    Thanks in advance

    Sony C.

    ReplyDelete
    Replies
    1. Hi Sony,

      It just unique properties(meta data) in your project. you can check it here existing namespaces in CQ5.

      /libs/dam/options/metadata

      Delete
  3. Hi Ashok,
    Great article! I have followed the steps and created the namespace. I can see the entry, but when I upload a page it gives me "Unknown namespace" exception, do you know why?

    Appreciate your help!
    Thanks,
    Manish

    ReplyDelete