Does CQ5 have a built in mixin type that can be used to add arbitrary properties to a node? | Community
Skip to main content
LinearGradient
Level 6
October 16, 2015
Solved

Does CQ5 have a built in mixin type that can be used to add arbitrary properties to a node?

  • October 16, 2015
  • 7 replies
  • 1259 views

Hi,

In particular, I want to be able to add custom properties to sling:Mapping nodes.

Is there a mixin type I can use with sling:Mapping nodes so that I can add custom properties to them?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

LinearGradient wrote...

Hi Sham,

I want to add an attribute domainName that stores the domain name (e.g. www.example.com) associated with a given sling:Mapping node under /etc/map (or /etc/map.publish).

Thanks.

 

sling:Mapping already provides required matching and redirection properties (sling:match & sling:internalRedirect) for an domainname. What benefit you will achieve adding additional one.  I am still not clear of use case. 

7 replies

Sham_HC
Level 10
October 16, 2015

what is your exact usecase?

Adobe Employee
October 16, 2015

Hi,

Just to be clear, the use of the sling:Mapping node type is not strictly necessary. You can use any node type.

Justin

LinearGradient
Level 6
October 16, 2015

Hi Sham,

I want to add an attribute domainName that stores the domain name (e.g. www.example.com) associated with a given sling:Mapping node under /etc/map (or /etc/map.publish).

Thanks.

LinearGradient
Level 6
October 16, 2015

Hi Justin,

Thanks for the reply. Could you please explain if there are any disadvantages to using another node type, e.g. nt:unstructured?

Thanks.

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

LinearGradient wrote...

Hi Sham,

I want to add an attribute domainName that stores the domain name (e.g. www.example.com) associated with a given sling:Mapping node under /etc/map (or /etc/map.publish).

Thanks.

 

sling:Mapping already provides required matching and redirection properties (sling:match & sling:internalRedirect) for an domainname. What benefit you will achieve adding additional one.  I am still not clear of use case. 

LinearGradient
Level 6
October 16, 2015

Sham HC wrote...

LinearGradient wrote...

Hi Sham,

I want to add an attribute domainName that stores the domain name (e.g. www.example.com) associated with a given sling:Mapping node under /etc/map (or /etc/map.publish).

Thanks.

 

sling:Mapping already provides required matching and redirection properties (sling:match & sling:internalRedirect) for an domainname. What benefit you will achieve adding additional one.  I am still not clear of use case. 

 

When I delete a site, I want to delete all its sling:Mapping nodes too. Right now the query and the code that finds sling:Mapping nodes is not elegant. If I could add a domainName property to sling:Mapping nodes the query could become something like this:

    SELECT * FROM [sling:Mapping] WHERE domainName = "example.com"

Sham_HC
Level 10
October 16, 2015

LinearGradient wrote...

 

When I delete a site, I want to delete all its sling:Mapping nodes too. Right now the query and the code that finds sling:Mapping nodes is not elegant. If I could add a domainName property to sling:Mapping nodes the query could become something like this:

    SELECT * FROM [sling:Mapping] WHERE domainName = "example.com"

 

I was asking your usecase so that I can file enhancement request if it qualifies. IMO this should be handled easily at package with right design.  Regarding original question technical you can achieve by reregistering the node however it is not recommended and also creates some noice in support perspective.