For example, a live copy is created in /content/copy/us from the source/blueprint at /content/we-retail/language-masters. The resources /content/we.retail/language-masters/en/jcr:content and /content/copy/us/en/jcr:content form a relationship.

LiveCopy

LiveCopy holds the configuration details for the relationships (LiveRelationship) between the live copy resources and their source/blueprint resources.

Use the LiveCopy class to access to the path of the page, the path of the source/blueprint page, the rollout configurations and whether child pages are also included in the LiveCopy.

A LiveCopy node is created each time Create Site or Create Live Copy is used.

LiveStatus

LiveStatus objects provide access to the runtime status of a LiveRelationship. Use to query the synchronization status of a live copy.

LiveAction

A LiveAction is an action that is executed on each resource that is involved in the rollout.

LiveActions are only generated by RolloutConfigs.

LiveActionFactory

Creates LiveAction objects given a LiveAction configuration. Configurations are stored as resources in the repository.

RolloutConfig

The RolloutConfig holds a list of LiveActions, to be used when triggered. The LiveCopy inherits the RolloutConfig and the result is present in the LiveRelationship.

Setting up a live copy for the very first time also uses a RolloutConfig (which triggers the LiveActions).

Creating a New Synchronization Action

Create custom synchronization actions to use with your rollout configurations. Create a synchronization action when the installed actions do not meet your specific application requirements. To do so, create two classes:

The LiveActionFactory creates instances of the LiveAction class for a given configuration:

LiveAction classes include the following methods:

getName: Returns the name of the action The name is used to refer to the action, for example in rollout configurations.

execute: Performs the tasks of the action.

LiveActionFactory classes include the following members:

LIVE_ACTION_NAME: A field that contains the name of the associated LiveAction. This name must coincide with the value that is returned by the getName method of the LiveAction class.

createAction: Creates an instance of the LiveAction. The optional Resource parameter can be used to provide configuration information.

createsAction: Returns the name of the associated LiveAction.

Accessing the LiveAction Configuration Node

Use the LiveAction configuration node in the repository to store information that affects the runtime behaviour of the LiveAction instance. The node in the repository that stores the LiveAction configuration is available to the LiveActionFactory object at runtime. Therefore, you can add properties to the configuration node to and use them in your LiveActionFactory implementation as needed.

For example, a LiveAction needs to store the name of the blueprint author. A property of the configuration node includes the property name of the blueprint page that stores the information. At runtime, the LiveAction retrieves the property name from the configuration, then obtains the property value.

The parameter of the LiveActionFactory.createAction method is a Resource object. This Resource object represents the cq:LiveSyncAction node for this live action in the rollout configuration; see Creating a Rollout Configuration. As usual when using a configuration node, you should adapt it to a ValueMap object:

The autoSave value indicates whether your LiveAction should save changes that are made to the repository.

The reset value indicates the rollout reset mode.

From these objects you can obtain all of the information about the LiveCopy. You can also use the Resource objects to obtain ResourceResolver, Session, and Node objects. These objects are useful for manipulating repository content:

In the first line of the following code, source is the Resource object of the source page:

Click New, then New Page to define the Rollout Configuration properties:

Title: The title of the Rollout Configuration, such as My Rollout Configuration

Name: The name of the node that stores the property values, such as myrolloutconfig

Select RolloutConfig Template.

Click Create.

Double-click on the rollout configuration that you created to open it for further configuration.

Click Edit.

In the Rollout Config dialog, select the Sync Trigger to define the action that causes the rollout to occur.

Click OK to save the changes.

Add Synchronization Actions to the Rollout Configuration

Rollout configurations are stored below the /etc/msm/rolloutconfigs node. Add child nodes of type cq:LiveSyncAction to add synchronization actions to the rollout configuration. The order of the synchronization action nodes determines the order in which the actions occur.

For example, for the rollout configuration with the Name property of myrolloutconfig, select the node:

/etc/msm/rolloutconfigs/myrolloutconfig/jcr:content

Click Create then Create Node. Then configure the following node properties and click OK:

Name: The node name of the synchronization action. The name must be the same as the Action Name in the table under Synchronization Actions, for example contentCopy or workflow.

Type: cq:LiveSyncAction

Select the action node just created and add the following property to the node:

Name: The property name of the action. The name must be the same as the Property Name in the table under Synchronization Actions, for example enabled.

Type: String

Value: the property value of the action. For valid values, see the Properties column in Synchronization Actions, for example true.

Add and configure as many synchronization action nodes as you require. Rearrange the action nodes so that their order matches the order in which you want them to occur. The topmost action node occurs first.

Click Save All.

Creating and Using a Simple LiveActionFactory Class

Follow the procedures in this section to develop a LiveActionFactory and use it in a rollout configuration. The procedures use Maven and Eclipse to develop and deploy the LiveActionFactory:

Implement LiveActionFactory

The following LiveActionFactory class implements a LiveAction that logs messages about the source and target pages, and copies the cq:lastModifiedBy property from the source node to the target node. The name of the live action is exampleLiveAction.

In the Eclipse Project Explorer, right-click the MyLiveActionFactory-bundle/src/main/java/com.adobe.example.msm package and click New > Class. For the Name, enter ExampleLiveActionFactory and then click Finish.

Open the ExampleLiveActionFactory.java file, replace the content with the following code, and save the file.

Removing the Chapters Step in the Create Site Wizard

In some cases, the Chapters selection is not required in the create site wizard (only the Languages selection is required). To remove this step in the default We.Retail English blueprint:

In CRX Explorer, remove the node:/etc/blueprints/weretail-english/jcr:content/dialog/items/tabs/items/tab_chap.

Navigate to /libs/wcm/msm/templates/blueprint/defaults/livecopy_tab/items and create a new node:

Name = chapters; Type = cq:Widget.

Add following properties to the new node:

Name = name; Type = String; Value = msm:chapterPages

Name = value; Type = String; Value = all

Name = xtype; Type = String; Value = hidden

Changing language names and default countries

AEM uses a default set of language and country codes.

The default language code is the lower-case, two-letter code as defined by ISO-639-1.

The default country code is the lower-case or upper-case, two-letter code as defined by ISO 3166.

MSM uses a stored list of language and country codes to determine the name of the country that is associated with the name of the language version of your page. You can change the following aspects of the list if required:

The language list is stored below the /libs/wcm/core/resources/languages node. Each child node represents a language or a language-country:

The name of the node is the languge code (such as en or de), or the language_country code (such as en_us or de_ch).

The language property of the node stores the full name of the language for the code.

The country property of the node stores the full name of the country for the code.

When the node name consists only of a language code (such as en), the country property is *, and an additional defaultCountry property stores the code of the language-country to indicate the country to use.

Make sure you are not allowed to edit this property in the touch-enabled UI unless inheritance is cancelled, also that you can then reinstate inheritance; this is controlled by clicking the chain/broken-chain links that toggle to indicate the status of the connection.

Whether a page property is subject to roll out and therefore, subject to cancelling/reinstating inheritance when editing, is controlled by the dialog property:

cq-msm-lockable

is applicable to items in a touch-enabled UI dialog

will create the chain-link symbol in the dialog

only allows editing if inheritance is cancelled (the chain-link is broken)

Type: String

Value: holds the name of the property under consideration (and is comparable to the value of the property name; for example, see/libs/foundation/components/page/cq:dialog/content/items/tabs/items/basic/items/column/items/title/items/title

When cq-msm-lockable has been defined, breaking/closing the chain will interact with MSM in the following way:

if the value of cq-msm-lockable is:

Relative (e.g. myProperty or ./myProperty)

it will add and remove the property from cq:propertyInheritanceCancelled.

MSM does not operate with deep properties (e.g. ./image/fileReference), even though the dialog’s logic does. If the chain is opened a rollout of the page will overwrite ./image/fileReference, as the rollout of the image node will not "walk" up to the parent node to check cq:propertyInheritanceCancelled.

Absolute (e.g. /image)

breaking the chain will cancel inheritance by adding the cq:LiveSyncCancelled mixin to ./image and setting cq:isCancelledForChildren to true.

closing the chain will revert inheritance.

Note:

When you re-enable inheritance, the live copy page property is not automatically synchronized with the source property. You can manually request a synchronization if this is required.

Twitter™ and Facebook posts are not covered under the terms of Creative Commons.