AEM 6.4 : Replicate content to a different folder | Community
Skip to main content
Level 4
April 24, 2019

AEM 6.4 : Replicate content to a different folder

  • April 24, 2019
  • 2 replies
  • 5683 views

Hello All, I am looking to see if there is an option to publish the content from author to a different path in the receiving end.

Eg: Path in author:

/content/dam/xyx/logo/logo.jpg

/content/dam/xyx/image/img.jpg

    

This could be published to the received to the folders(in bold)

/content/dam/xyx/logo/logo.jpg --> /content/dam/public/xyx/logo/logo.jpg

/content/dam/xyx/image/img.jpg --> /content/dam/protected/xyx/image/img.jpg

My replication will  be a process step in a workflow. Is this doable?

Regards,

Anand

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

2 replies

Ravi_Pampana
Community Advisor
Community Advisor
April 24, 2019

Hi,

Check below link which has same question and solution

Replicating a CQ page to two different paths in CQ publisher

After replicating you can deactivate programmatically actual path if needed.

smacdonald2008
Level 10
April 24, 2019

You can use the AEM Replication API to build workflows. See this HELPX article:

Adobe Experience Manager Help | Replicating Adobe Experience Manager Content using the Replication API

If you look at the API call - you can define the path:

//Inject a ResourceResolver - make sure to whitelist the bundle

    Session session = wfsession.adaptTo(Session.class);

    ResourceResolver resourceResolver = resolverFactory.getResourceResolver(Collections.singletonMap("user.jcr.session", (Object) session)); 

        

    // Create leanest replication options for activation

    ReplicationOptions options = new ReplicationOptions();

    // Do not create new versions as this adds to overhead

    options.setSuppressVersions(true);

    // Avoid sling job overhead by forcing synchronous. Note this will result in serial activation.

    options.setSynchronous(true);

    // Do NOT suppress status update of resource (set replication properties accordingly)

    options.setSuppressStatusUpdate(false); 

    log.info("**** ABOUT TO REPLICATE" ) ; 

    //Rep the content      replicate(Session session, ReplicationActionType type, String path)

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

Hope this helps you!

a_mn1Author
Level 4
April 25, 2019

Hello Scott, Thanks for the reply.

I am aware of using Replication API in workflow and I have been using that. The problem that I am trying to solve is how to take the content from Author to a different path in Publisher.

So as mentioned in the link,Replicating a CQ page to two different paths in CQ publisher   is a custom Transport handler the only option for this.

Regards