Skip to main content
kinjald72392939
Jan 24, 2017 8:11 AM UTC
Solved

Is there anyways we can use java code to replicate a package that is created using java code?

I've created a package using java code as follows.

 

Session session = slingRepository.loginAdministrative(null);

JcrPackageManager packageManager =  (JcrPackageManager)PackagingService.getPackageManager(session);

JcrPackage pack = packageManager.create(PACKAGE_GROUPNAME, packageName, PACKAGE_VERSION);

Now I need to replicate this package on all the publishers inside java code. However, I am unable to find any API that can do this. Can anyone please help me with the same?

 

Thanks,

Kinjal

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Peter_Puzanovs
Peter_PuzanovsAccepted solution
Community Advisor
Jan 24, 2017 2:01 PM UTC

Hi Kinjal,

Use https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/AgentManager.html to retrieve your agents and https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/Agent.html API to replicate you data across.

P.S. Day was smart, not to club everything into one API, so to use replication you setup agents and use Agent API, to create packages you use PackageManger API's

Regards,

Peter

1 reply

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
Jan 24, 2017 2:01 PM UTC

Hi Kinjal,

Use https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/AgentManager.html to retrieve your agents and https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/Agent.html API to replicate you data across.

P.S. Day was smart, not to club everything into one API, so to use replication you setup agents and use Agent API, to create packages you use PackageManger API's

Regards,

Peter

Translate