Search code examples
aem

AEM / CQ5 - livecopy - how to get the list of live copy pages (if any), for a given page path(which is blueprint in this case)


I would like to get the list of live copy pages for any given blue print page. So, if I have given a page path, I should be able to list out all its live copies(if any). Can this be achieved with any API?


Solution

  • Live copies of a resource (page) can be obtained by the official API

    You just need to use LiveRelationshipManager.getLiveRelationships in order to get the live relationships.

    Depending on the version of AEM you are using and the complexity of your BluePrint setup and depth of LiveCopy inheritance (and cancellations) this API could have performance impacts.

    • For pre AEM 6.0 SP3, it will be pretty slow and is not entirely optimised.
    • AEM 6.1 SP1 and all the way to latest version this API is optimised for performance.

    In effect, it should return the same data which is visible via CQ Blueprint manager screen.