I am trying to escape a method when the node is a Live Copy Variation. This is the code I wrote:
Resource res = resourceResolver.getResource(path);
if (res == null) {
return;
}
ModifiableValueMap properties = res.adaptTo(ModifiableValueMap.class);
if (properties == null) {
return;
}
// Escape the method for Live Copy Variations Nodes
if (properties.containsKey("jcr:mixinTypes")) {
String[] array = (String[]) properties.get("jcr:mixinTypes");
boolean isLiveCopy = Arrays.asList(array).contains("cq:LiveRelationship");
if (isLiveCopy) {
return;
}
}
Is there a better way to find out if the resource is a live copy variation?
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @anasustic
There is LiveRelationshipManager, which provides a lot of APIs for MSM.
For your usecase, please try using following API
hasLiveRelationship(Resource resource)
Hello @anasustic
There is LiveRelationshipManager, which provides a lot of APIs for MSM.
For your usecase, please try using following API
hasLiveRelationship(Resource resource)
Thanks so much @aanchal-sikka
Views
Replies
Total Likes
Views
Likes
Replies