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
BedrockMission!

Learn More

View all

Sign in to view all badges

How to find live copies pages for a blueprint page

Avatar

Avatar
Level 1
ASK_93
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
ASK_93
Level 1

Likes

0 likes

Total Posts

3 posts

Correct Reply

0 solutions
View profile
ASK_93
Level 1

24-06-2021

Hi All,

 

How can I find out live copies for a blueprint page in my servlet or any backend class (event listener - node move of type cq:Page)? I have tried the LiveRelationshipManager API but it was not working?

 

we get the live copies in the left side rail when select a blueprint page in sites.

 

Thanks in Advance

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 3
vmadala
Level 3

Likes

21 likes

Total Posts

28 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 3
vmadala
Level 3

Likes

21 likes

Total Posts

28 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Establish
Boost 3
Boost 1
Affirm 1
View profile
vmadala
Level 3

24-06-2021

Hello @ASK_93 , The below piece of code is working fine for me to get the live relation copies from the master page.

 

LiveRelationshipManager liveRelationManager = resourceResolver.adaptTo(LiveRelationshipManager.class);
Resource resource = resourceResolver.getResource(<path to master page>);
try {
RangeIterator iterator = liveRelationManager.getLiveRelationships(resource, null, null);
while(iterator.hasNext()) {
LiveRelationship liveCopy = (LiveRelationship)iterator.next();
}
} catch (WCMException e) {
//Log the error
}

 

 

Answers (3)

Answers (3)

Avatar

Avatar
Boost 5
Level 2
anupam_miglani
Level 2

Likes

9 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
anupam_miglani
Level 2

Likes

9 likes

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
anupam_miglani
Level 2

25-06-2021

Hi @ASK_93 

I would suggest you to try to refresh the session, as this is triggered on NODE_MOVED, so it might be the case that when repository session was taken, the live copy wasn't synced to moved page.

Thanks
Anupam 

Avatar

Avatar
Contributor
Level 4
Bimmi_Soi
Level 4

Likes

68 likes

Total Posts

74 posts

Correct Reply

24 solutions
Top badges earned
Contributor
Applaud 5
Boost 50
Ignite 1
Affirm 10
View profile

Avatar
Contributor
Level 4
Bimmi_Soi
Level 4

Likes

68 likes

Total Posts

74 posts

Correct Reply

24 solutions
Top badges earned
Contributor
Applaud 5
Boost 50
Ignite 1
Affirm 10
View profile
Bimmi_Soi
Level 4

24-06-2021

@ASK_93  : LiveRelationshipManager should ideally work. What is the error you are getting?

 

Avatar

Avatar
Boost 25
Level 3
ibishika
Level 3

Likes

30 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Boost 25
Affirm 3
Boost 10
Boost 5
Give Back
View profile

Avatar
Boost 25
Level 3
ibishika
Level 3

Likes

30 likes

Total Posts

29 posts

Correct Reply

3 solutions
Top badges earned
Boost 25
Affirm 3
Boost 10
Boost 5
Give Back
View profile
ibishika
Level 3

24-06-2021

I will try doing this if the LiveRelationship api is not working:

Get the node from jcr which is storing the livecopy related info and process them as required in your code. I am not sure if that works for your use case.