We have a requirement of pushing the CQ page to two different locations in publisher i.e.
the page in CQ5 - content/site/page1 should be replicated to content/site-test/page1 and then to content/site/page1 in same publisher. We also dont want to create a copy of page1 in authoring i.e. we dont want to create content/site-test/page1 at Author to avoid duplicates at authoring instance.
Is there a way (using APIs or otherwise), replicate a page in authoring on two different location (one usual default location at publisher and another one in a different root node).? We are using CQ 5.5
Thanks
Anand
Solved! Go to Solution.
Views
Replies
Total Likes
I would say there are a couple of options available to you:
Views
Replies
Total Likes
I would say there are a couple of options available to you:
Views
Replies
Total Likes
Hello Anand,
If you don't want to create additional live copy, you can create custom live action and implement additional logic there.
https://dev.day.com/docs/en/cq/5-5/developing/multi_site_manager_dev.html
Views
Replies
Total Likes
I would really question such a requirement, as it raises a number of questions and probably also problems. I would explore 2 approaches:
Still, I don't know the exact requirement, why you want to duplicate replicated pages. But all approaches, which duplicate the content don't look that elegant to me.
Jörg
Views
Replies
Total Likes
I will write a custom workflow step and will include below code to replicate -
@Reference
com.day.cq.replication.Replicator replicator = null;
ReplicationOptions opts = new ReplicationOptions();
opts.setFilter(new AgentFilter(){
public boolean isIncluded(final Agent agent) {
return agent.getId("YourAgentID"));
}
});
replicator.replicate(Session, ReplicationActionType.ACTIVATE, "Path/to/Your/Page", opts);
Views
Replies
Total Likes
@Sam205505050....thanks for your response. I believe this would be helpful for me to trigger a specific replication agent however I still have to customize Transport library to create nodes at two locations one of which (one path out of two replicated paths at CQ publisher) does not exist in author.
Anand
Views
Replies
Total Likes
Thanks Orotas. Option#2 seems more favorable for the requirement. Agreed with you that #1 is highly unreliable. Long path dig in for CQ libraries....
Thanks for your response.
Anand
Views
Replies
Total Likes