Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to create LiveCopy of a page with rollout configuration using Java?

RashidJorvee
Level 4
Level 4

Hi Guys,

I have a requirement to create LiveCopy of a page programmatically using Java. Do we have any API which provides this feature which will create exact liveCopy of a page with its complete structure same as liveCopy option of siteadmin and site.html/content?

thanks!

Rashid

0 Replies
peterp18579053
Level 1
Level 1

Dear Rashid,

First copy/paste page using PageManager API, then use LiveRelationshipManager API[2] to establish relationship between pages.

[1] PageManager ("The Adobe AEM Quickstart and Web Application.")

[2] LiveRelationshipManager ("The Adobe AEM Quickstart and Web Application.")


Regards,Peter

RashidJorvee
Level 4
Level 4

I am unable to generate  RolloutConfig... rolloutConfig parameters, Since when I try to uisng RolloutConfigManager then my component is not getting resolve.

Please suggest how to pass RolloutConfig parameter.

smacdonald2008
Level 10
Level 10

WHile not the exact use case - we have an AEM article that shows use of the MSM API here: Adobe Experience Manager Help | Retrieving Adobe Experience Manager LiveCopy information using the M...

This is the API you want to use for your use case.

RashidJorvee
Level 4
Level 4

Right Scoot, I am trying to achieve this using LiveRelationshipManager API. But when I try to inject RolloutConfigManager interface to create the RolloutConfig then I am getting the unsatisfied message "No service bound error" and unable to execute this service.

Please help me to resolve this issue.

Below is the code which I am trying:

@Reference
LiveRelationshipManager liveRelationshipManager;
@Reference
RolloutConfigManager rolloutConfigManager;
String rolloutConfigPath="/etc/msm/rolloutconfigs/default";

RolloutConfig rolloutConfig=rolloutConfigManager.getRolloutConfig(rolloutConfigPath);
liveRelationshipManager.establishRelationship(fromLive, toLive, deep, autoSave, rolloutConfig);

Error:

1516369_pastedImage_3.png

ad6
Level 2
Level 2

Hi we had tried resolving the rolloutconfigmanager by adapting it using resolver:

RolloutConfigManager rolloutConfigManager = resolver.adapto(RolloutConfigManager.class);

and then we used it in code.

santhiswaroopg
Level 1
Level 1

@Reference

private RolloutManager rolloutManager;

Resource resource = resourceResolver.getResource(sourcePath);

LiveRelationshipManager liveRelationshipManager = resourceResolver.adaptTo(LiveRelationshipManager.class);

Collection<LiveRelationship> liveRelationShips;

liveRelationShips = liveRelationshipManager.getLiveRelationships(resource, Trigger.ROLLOUT, null, true);

if (null != liveRelationShips) {

// get each relationship

for (LiveRelationship liveRelationship : liveRelationShips) {

rolloutManager.rollout(resourceResolver, liveRelationship, true);

}

}