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

Avatar

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
RashidJorvee
Level 3

26-06-2018

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

Replies

Avatar

Avatar
Boost 1
Level 1
peterp18579053
Level 1

Likes

2 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
peterp18579053
Level 1

Likes

2 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
peterp18579053
Level 1

26-06-2018

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

Avatar

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
RashidJorvee
Level 3

26-06-2018

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.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,409 likes

Total Posts

12,671 posts

Correct reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

26-06-2018

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.

Avatar

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 3
RashidJorvee
Level 3

Likes

28 likes

Total Posts

55 posts

Correct reply

1 solution
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
RashidJorvee
Level 3

26-06-2018

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

Avatar

Avatar
Validate 1
Level 2
ad6
Level 2

Likes

4 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ad6
Level 2

Likes

4 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
ad6
Level 2

17-07-2018

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.

Avatar

Avatar
Boost 1
Level 1
santhiswaroopg
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
santhiswaroopg
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
santhiswaroopg
Level 1

18-07-2018

@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);

}

}

Avatar

Avatar
Boost 1
Level 1
santhiswaroopg
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
santhiswaroopg
Level 1

Like

1 like

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
santhiswaroopg
Level 1

18-07-2018

You can try using above code