How to create a new LiveCopy Site through Java API | Community
Skip to main content
Level 4
October 16, 2015
Solved

How to create a new LiveCopy Site through Java API

  • October 16, 2015
  • 4 replies
  • 3665 views

Hi Masters!

I would like to know how to create a new LiveCopy Site through Java API. I mean, the same action that you can do in Siteadmin->New Site. It seems an easy task, but I’m trying to find out the entry point in Java API, with no success.

Any help will be appreciated.

Thank you very much!

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

Are you looking at "New Site" or "New Live Copy". New site is little different from New Live copy. New site creates multiple live copies. One level down the root page it creates live copy with isDeep=true.

For creating Live copy.

  1. Create Copy of the page.
  2. Use RelationShipManager API to establish LiveRelationShip - relationshipManager.establishRelationship(master, liveCopy, deep, false, configs);
  3. Rollout the page using RolloutManger - rolloutManager.rollout(resourceresolver, relationship, true, true);

4 replies

smacdonald2008
Level 10
October 16, 2015

The only AEM LiveCopy API that is exposed is:

https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/wcm/msm/api/LiveCopy.html

However - according to this Javadoc - this API defines a Live Copy configuration between a blueprint and its target. I am not seeing a method that creates a new one.  In fact - most of the methods are  get methods that return information. 

Accepted solution
October 16, 2015

Are you looking at "New Site" or "New Live Copy". New site is little different from New Live copy. New site creates multiple live copies. One level down the root page it creates live copy with isDeep=true.

For creating Live copy.

  1. Create Copy of the page.
  2. Use RelationShipManager API to establish LiveRelationShip - relationshipManager.establishRelationship(master, liveCopy, deep, false, configs);
  3. Rollout the page using RolloutManger - rolloutManager.rollout(resourceresolver, relationship, true, true);
Level 4
October 16, 2015

Thank you very much, maruthid!

I was looking for the same behavior than to create a "New Site", with 'Live Copy' checkbox selected.

I'm not sure if I've understood you comment about 'New site creates multiple live copies. One level down the root page it creates live copy with isDeep=true.'

I've got a site with standard structure: 1)root level, 2)language level, and 3)chapter level. I would like to choose the language levels available in the new livecopy site. I don't need to choose the chapters (but it would be interesting to know how).

Which steps should I follow?

I've checked in CRXDE the contents of a livecopy site created via siteadmin UI. I've seen that both root level and language levels have 'jcr:content/cq:LiveSyncConfig' node with 'cq:isDeep' = false, and chapter level has 'jcr:content/cq:LiveSyncConfig' node with 'cq:isDeep' = true.

Should I copy the root level, delete the languages (and chapters, in general case, not in mine) I don't need, and establish LiveRelationShip at both root level (with 'cq:isDeep' = false), at language level (with 'cq:isDeep' = false) and at chapter level (with 'cq:isDeep' = true), for each languages and chapters? Is this correct?

Thank you again!

Level 2
August 7, 2018

Hi Maruthid,

Do you happen to know how to get RolloutConfig object in order to use it inside the establishRelationship method?

There is a RolloutConfigManager interface but I was not able to found available implementations.

Best regards,

Andrii