In the past 2 years I had occasion to work on Live Copy, Language Copy and BluePrint on some projects on AEM 6.1 and AEM 6.2. Well, I cannot say I was delighted by a touch UI that was missing a lot of interesting features that were working fine in previous CQ 5.x implementations: live copies and MSM (Multi Site Manager) are areas where these problems are more evident and only with AEM 6.3 I started to see a more complete solution.
But in this article I would like to focus my attention on a problem (or maybe is a feature???) that I have found out after long analysis: Adobe documentation doesn’t describe this behaviour in detail and it’s very difficult for a newbie in Live Copies to understand it.
I’m referring to the way links are rewritten by AEM when you create a new site with the “Create Site” option, starting from a BluePrint. When you create a new site starting from a BluePrint AEM asks you to choose for languages and chapters. I have to say I really don’t understand why Adobe engineers have decided to add the concept of “chapter”. Every first level folder under the languages is defined as “chapter”: in this way when you create a new site you can decide to add only some specific subsections of the website leaving out others.
In figure 1 you can see the create site from blueprint property page, with chapters selection.
If you flag the livecopy checkbox (almost natural in a multi-country website) all the pages will be kept in sync with the blueprint, with a nice-to-have rollout option and (from AEM 6.3) a centralized MSM interface to inspect the synchronization status of each blueprint page (unfortunately I still believe that CQ 5.5 MSM interface was more intuitive, but this is only my opinion as of AEM 6.3).
After site creation I was noticing some problems on internal links: some of them were pointing to the blueprint site and were not rewritten.
The following example clarifies the situation. Let’s take this simple website:
With this structure, “it” is a language, “products” and “about-us” are chapters of the blueprint.
Now place 2 links inside product1 page:
- first link points to product2
- second link points to company
Create a new site starting from the blueprint (/content/example-site/en). The two links in “product1” page will be rewritten in this way:
- link1: /content/example-site/en/products/product2
- link2: /content/example-site/language-masters/en/about-us/company
I was very surprised by this behaviour and started surfing online to find a solution or an explanation. I was able to find issues / problems similar to the one I was experiencing, with Adobe answers that were leaving me a litte surprised.
The explanation is contained here (from Adobe page: https://helpx.adobe.com/experience-manager/6-3/sites/administering/using/msm-best-practices.html)
“Once a new site has been created as a live copy (using Create, then Site), the first two levels of this live copy are shallow. Children of the page do not belong to the live-relationship, but a roll-out will still descend if a live-relationship that matches the trigger is found.
It helps avoid:
- manually adding languages in the blueprint (below the first level)
- manually adding content directly below the language root,
- does not result in automatically carrying this new content over to the live copy on rollout.”
So, the first two folder levels are Shallow live copies (root + language). Chapters are independent live copies. This is the point. Links are rewritten by AEM only inside the livecopy. If the links point outside of the livecopy, the link is not going to be rewritten.
So, in conclusion, simply to avoid some “manual” operations, we are going to make a blueprint completely useless in a lot of potential scenarios (quite common to have internal links pointing between chapters). One of the answers I found in the forum was: “Don’t use blueprint and simply make a livecopy”. Very bad, because blueprints gives you access to full MSM functionalities, above all a centralized tool to monitor the synchronization status for all the pages. Not using the MSM central tool makes extremely difficult to manage something that is difficult by itself.
If you take a look at nodes structure with CRXDE you can better understand what it’s happening here:
. cq:master: points to the blueprint
. cq.isDeep: false It’s Shallow
. cq:master: points to the blueprint language folder
. cq:isDeep: false It’s shallow
. cq:master: points to the blueprint chapter folder
. cq:isDeep: true Ok, finally a real livecopy
Once I realized the problem I was not able to find a clean solution. The only way seems not to use the MSM functionalities. So I decided to manually create the country folder and then to setup a livecopy for each language node. Since I wanted to keep the MSM functionalities, I manually added the cq:LiveSyncConfig the root country node (with cq:isDeep false). In this way I was able to keep also central MSM functionalities, combining the good behaviour of link rewriting. Nothing Adobe-approved… so please, if you want to follow this solution, do it at your own risk.
I write this article with the hope to receive an answer telling me there is a better solution. Or at least to see a nice alert on AEM documentation.