Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
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
Résolu ! Accéder à la solution.
Vues
Réponses
Nombre de J’aime
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
}
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.
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
}
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
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Likes
Réponses
Vues
Likes
Réponses