Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Child node inheriting replication properties from replicated template. How to stop this from happening?

Avatar

Level 2

Hi Team,

 

I have parent node '/content/example/en_us' which has jcr:primaryType of value 'cq:Page'. It is published using  Please read the update at the end of this question.

replicator.replicate(session, ReplicationActionType.ACTIVATE, paths, replicationOptions); 

Here are the replication options:

replicationOptions.setSuppressVersions(true);
replicationOptions.setSynchronous(true);
replicationOptions.setSuppressStatusUpdate(false);   

After replication when I create node as '/content/example/en_us/sample'  with jcr:primaryType of either 'cq:PageContent' or 'cq:Page' it inherits the replication properties cq:lastReplicatedBy,cq:lastReplicationAction, cq:lastReplicated from parent. The incorrect behavior is this node  '/content/example/en_us/sample' is not even replicated but just gets the properties from parent.

 

How to stop inheriting the replication properties from parent node? I do want other properties to be inherited.

 

Any help is appreciated.

 

AEM version 6.5.15

 

UPDATE:

I’ve observed that the behavior in question is NOT a result of publishing the node located at ‘/content/example/en_us’. Rather, it’s due to the publication of the template that is used to create child pages.

In other words, when a template is published programmatically, and the child pages created using this template then the children inherit its replication properties. How to overcome this?

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

when you create a page using a template then all the properties/child node of initial node copied as initialise content. It is not an inheritance but copy.
If somehow you can avoid changing the replication status on initial node when you publish the template this problem won't be happening.

maybe below can help

replicationOptions.setSuppressStatusUpdate(true);   



Arun Patidar

View solution in original post

8 Replies

Avatar

Employee Advisor

HI @samaraneni , are you creating the node programmatically or through AEM UI?

Avatar

Level 2

Hi Anish,

 

I created child nodes both programmatically and from Touch UI, it's the same behavior. In this screen shot I created a page 'uu_hindi' manually and it got 'Published' and 'Published By' values from parent where 'uu_hindi' is not even replicated.

samaraneni_0-1707216406582.png

Thanks

Avatar

Level 2

I have updated the question with my latest observation, please read that.

 

Thanks

Avatar

Community Advisor

Hi @samaraneni 
Please check if the initial node of the template has replication properties or not, if yes then it will be added to the pages.
How to fix this problem :

1. Do not publish the template but deploy using codebase.

2. Remove the replication properties just after creating the pages using same code or an event listener which will delete replication properties on create.



Arun Patidar

Avatar

Level 2

Hi @arunpatidar 

 

Yes, the initial node of the template has replication properties set.  

I'm creating and publishing templates using sling servlets (APIs) so don't want to do it through code base. 

Is there is a configuration change or options that could be set to not inherit these from the template.

 

Thanks

Avatar

Correct answer by
Community Advisor

when you create a page using a template then all the properties/child node of initial node copied as initialise content. It is not an inheritance but copy.
If somehow you can avoid changing the replication status on initial node when you publish the template this problem won't be happening.

maybe below can help

replicationOptions.setSuppressStatusUpdate(true);   



Arun Patidar

Avatar

Administrator

@samaraneni Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 2

I went with replicationOptions.setSuppressStatusUpdate(true); for templates so they'll be published from api but not carry the replication properties. This way the pages created with the template whose inital node has no replication properties set will be working as expected. Thanks @arunpatidar