Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Replicator.replicate sling:folder is activating children also

Avatar

Level 2

Hi!

I am trying to activate a path which is a sling:Folder, but this is activating children of this path also.

Is there any way to control and activate only the path which is sling:Folder.

Thanks in advance.

Thanks,

Praveen.

1 Accepted Solution

Avatar

Correct answer by
Level 2

I have raised a support ticket with Adobe and found that this behavior is intended.

when we replicate a sling:Folder/nt:unstructured path it replicates children also if the child is of type (JcrConstants.NT_HIERARCHYNODE).

View solution in original post

9 Replies

Avatar

Level 10

take a look here - you can write custom code using the Replicator API that can do this use case: How to replicate contents of a folder

Avatar

Employee Advisor

Can you share your AEM version, the relevant piece of code, and and extract of the log indicating this behavior? Can you reproduce it locally?

Avatar

Level 2

Thanks for reply, my concern is I do not want to replicate children of the folder but it automatically does it.

I am using AEM 6.3, and using Replicator API.

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

I have one path at etc/commerce/folder, which is of type sling:Folder, in logs it is showing activation of only "etc/commerce/folder" but internally it is activating all children of this folder which are of nt:unstructured.

Please let me know for more details.

Avatar

Employee Advisor

Ok, so if you pass "/etc/commerce/folder" (of nodetype "sling:folder") to the replicator.replicate() API call, it also replicates "/etc/commerce/folder/childnode"?

How do you see that? Is the replication status of "/etc/commerce/folder/childnode" updated accordingly? Or if the "childnode" was not present on publish before the replication, it is after the replication? For the later case, can you enable DEBUG logging on publish (DEBUG on the class com.day.cq.replication.impl should generate lots of debug statements)?

Jörg

Avatar

Level 2

Hi Jorg,

Yes it is replicating all children of a sling:folder node, I deleted the node in publish and replicated only the path which is of sling:folder and it is creating all the child nodes also in publish.

Replication agent logs showing that it is replicating only the sling:folder path but the size is big (which means inclusive of child nodes).

I have enabled debugging on "com.day.cq.replication.impl" and found the below messages, some config related to HierarchyReplicationContentFilter is allowing the child paths.

com.day.cq.replication.impl.HierarchyReplicationContentFilterFactory$HierarchyReplicationContentFilter checking level of root [/etc/commerce/products/company/affiliates] against node [/etc/commerce/products/company/affiliates/affiliate1]: 6/7 => accept: true

affiliates is sling:folder, which is allowing the children also, please help me in understanding this HierarchyReplicationContentFilter.

Avatar

Level 2

I have found that it is not only for sling:folder, it happens for nt:unstrucutred also.

Basically when I activate any path, it replicates everything under it except folders.

Avatar

Employee Advisor

That's true. From what I understand the behaviour you observe is not intended...

Can you raise a support ticket and provide insight about your usecase and why the current behaviour is not what you want?

Jörg

Avatar

Level 2

Thanks Jorg, will raise a ticket with Adobe. I will keep you posted on the findings, please let me know if you get any other thoughts on the same.

Avatar

Correct answer by
Level 2

I have raised a support ticket with Adobe and found that this behavior is intended.

when we replicate a sling:Folder/nt:unstructured path it replicates children also if the child is of type (JcrConstants.NT_HIERARCHYNODE).