Expand my Community achievements bar.

SOLVED

Live Copy Synchronization Status

Avatar

Community Advisor

Hi,

I am making changes to the English pages programatically and live copy will copy those changes to Spanish. I would like to know when the live copy is completed copying the changes to Spanish. So I can make changes on top of them in Spanish. Is there anyway to get the live copy synchronization status in Java?

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

bsloki wrote...

Are you looking to make the changes to the live copy programatically ??

 

No. Basically I am doing replication in both English and Spanish locales programatically. Live copy will copy the content from English to Spanish. Before I kick off the replication in Spanish, I want to know if the live copy is completed copying the content from English to Spanish. So I am looking for a flag to know whether live copy is completed copying that content.

I have written the below code to get the live status. I think it will work but not sure.

@Reference
private LiveRelationshipManager liveRelManager;


LiveRelationship liveRelationship;
try {
 liveRelationship = liveRelManager.getLiveRelationship([LIVE COPY PATH], true);
 Map < String, Boolean > map = liveRelationship.getStatus().getAdvancedStatus();
 for (Entry < String, Boolean > element: map.entrySet()) {
  System.out.println("Key is: " + element.getKey());
  System.out.println("Value is: " + element.getValue());
 }

}

View solution in original post

5 Replies

Avatar

Community Advisor

I see in MSM API that if we have LiveRelationship reference variable then we can get the live copy status.

com.day.cq.wcm.msm.api 
Interface LiveRelationship

Can you let me know how to get this reference variable?

Avatar

Level 10

I will look for sample code. As far as I know - there are no articles on this subject. 

Avatar

Level 10

Are you looking to make the changes to the live copy programatically ??

Avatar

Correct answer by
Community Advisor

bsloki wrote...

Are you looking to make the changes to the live copy programatically ??

 

No. Basically I am doing replication in both English and Spanish locales programatically. Live copy will copy the content from English to Spanish. Before I kick off the replication in Spanish, I want to know if the live copy is completed copying the content from English to Spanish. So I am looking for a flag to know whether live copy is completed copying that content.

I have written the below code to get the live status. I think it will work but not sure.

@Reference
private LiveRelationshipManager liveRelManager;


LiveRelationship liveRelationship;
try {
 liveRelationship = liveRelManager.getLiveRelationship([LIVE COPY PATH], true);
 Map < String, Boolean > map = liveRelationship.getStatus().getAdvancedStatus();
 for (Entry < String, Boolean > element: map.entrySet()) {
  System.out.println("Key is: " + element.getKey());
  System.out.println("Value is: " + element.getValue());
 }

}

Avatar

Level 10

Yes... that should work !! Let us know if you were able to get it !