Bulk replication assets and folders- activate/deactivate | Community
Skip to main content
Level 9
July 22, 2022
Solved

Bulk replication assets and folders- activate/deactivate

  • July 22, 2022
  • 3 replies
  • 1670 views

Hi,

 

Tried checking replicator.replicate option for activate, but it only activates the node and not sub nodes, and node can be a sling folder or dam:asset. 

The same with deactivate. Is this the expected behavior via api?

 

I would also like to avoid replication of a subfolder A, if there are children in that sub folder , that have not been replicated . Same with deactivation. What is the best approach other than traversal or query builder query? can/should sling query be used?

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

3 replies

Level 9
July 22, 2022

I think i might have the answer, let me know your thoughts, not sure of any limitation wrt api

 

replicator.getActivatedPaths(session, path);- get the string path array and then deactivate. 

 

String[] pathArray = pathList.toArray(new String[0]);
replicator.replicate(session, ReplicationActionType.DEACTIVATE, path);

 

 

SantoshSai
Community Advisor
Community Advisor
July 23, 2022

Hi @nitrohazedev ,

Activating the given path does not activate child node within that path. But It invalidates every page within that path in Dispatcher. 

Tree Activation may helps in your case, please check here: https://aem4beginner.blogspot.com/how-to-perform-tree-activation-in-cq-aem

Regards,

Santosh

Santosh Sai
Level 9
July 23, 2022

@santoshsai Do you know of unpublish, based on my observations it is the same as replication where it is targeted to the specific path to activate or deactivate via api vs all it’s children.  The problem is since not all resources may or may not be published , I can’t replicate the tree . By tree replication, first glance , it is iteration and activating one resource at a time ? 
 
It invalidates but does not unpublish IMO ? 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 25, 2022