The resource type of the image and video components that are affected by this handler is set by configuring the properties of the com.adobe.cq.mobile.platform.impl.contentsync.handler.MobilePagesUpdateHandler OSGi service.

mobilepageassets

Collects app page assets.

mobilecontentlisting

Lists the content of the ContentSync zip. This is used by the client side js on device to do the initial file copy required for AEM apps.

This handler should be added to any AEM Apps ContentSync Config.

type - String - mobilecontentlisting

path - String - keep empty, must be present to be seen as a valid handler but path is inferred to be the current ContentSync cache. This value is ignored.

targetRootDirectory - String - the prefix to add to paths as a target root for content update for this handler.

order - Long - Order for ContentSync to excute this handler. This number should be set higher than all other handlers such as 100. It should be run after traditional content handlers.

Includes an updated config.xml that merges any edits made via the Command Center with a provided config.xml. If this handler is not included any app details that are changed via the Administration interface will not be included in the cache.

This handler should be used on a AEM App Shell ContentSync config (node with pge-type=[app-instance]).

targetRootDirectory - String -the prefix to add to paths as a target root for content update for this handler.

targetIconDirectory - String - the directory to place the icons for the app

mobileADBMobileConfigJSON

Include the ADBMobileConfig.JSON file if the AMS cloudservice was configured.

This is used at compile time to configure the AMS plugin for analytic support.

The handler should be used on AEM App Shell ContentSync Config (node with pge-type=app-instance)

type - String - mobileADBMobileConfigJSON

path - String - Path to an app shell (node with pge-type=app-instance or a RT that extends /libs/mobileapps/core/components/instance)

targetRootDirectory - String -the prefix to add to paths as a target root for content update for this handler

notificationsconfig

Extracts notifications configurations required on device. The properties are extracted from the respective push service cloud service configuration associated with the app.

Non-AEM properties in the cloud service's jcr:content node are extracted and added to the pge-notifications-config.json JSON file for inclusion in the app content's www root.

AEM properties are those that are name-spaced with "cq", "sling" or "jcr". Other properties may be excluded using the "excludeProperties" property on the content-sync config node.

type - String - notificationsconfig

excludeProperties - String[] - properties to be excluded

contentsyncconfigcontent

Collects content from an existing ContentSync config.

type - String - contentsyncconfigcontent

path - String- Path to one of:

another ContentSync config

to a Content Package (will be use its phonegap-exportTemplate property to find its ContentSync config)

to a Mobile Resource (app-content's will be found under that resource and, if those content packages have a pge-includeInBuild property which is true, the phonegap-exportTemplate will be used to find its ContentSync config)

autoCreateFirstUpdateBeforeImport - Boolean - if true, create an initial update in the target config before importing if once does not exist already

configSuffix - String - a string to append to the path indicated on the "phonegap-exportTemplate" property of app-content. This can be used to distinguish different export templates. For example, this property can be set to "-dev" to indicate that "/../../../appconfig-dev" should be used (as opposed to "/../../../appconfig").

app-assets

Includes all assets associated with an app instance. This handler will include any assets found under the specified path along with any assets referenced by an app instance's appAssetPath property.

type - String - app-assets

path - String - path to a location under an app instance where app assets are stored

mobileappoffers

A new content sync handler has been introduced for the Personalization use case to render targeted content. The 'mobileappoffers' handler knows how to render the associated target offers that have been created by the content author. The mobileappoffers handler extends the abstract pages update handler therefore many of the properties are similar. The details of the mobileappoffers handler has the following properties.

The mobileappsoffers handler exends the mobileappspages handler and adds the following properties:

includePageTypes - String - defaults to support cq/personalization/components/teaserpage and cq/personalization/components/offerproxy

selector - String - should be set to tandt

path - String- the path to the campaign's brand

mobileappconfig

The mobileappconfig content sync handler provide a way to inject JSON data into the MobileAppsConfig.json. To register a provider class developers will add their MobileAppsInfoProvider class with the list of providers. The handler will iterate over the list of MobileAppsInfoProviders and allow the provider to inject data into the resulting json file. The list of properties which this handler supports are:

path - String - the path to an app instance node with pge-type=app-instance or a RT that extends /libs/mobileapps/core/components/instance

targetRootDirectory - String - the directory where to write the MobileAppsConfig.json file to.

fileName - String - optional name of the file to write the JSON to, defaults to MobileAppsConfig.json

It is possible to have multiple mobileappconfig handlers configured each with a unique set of providers writing to different JSON files.

Testing Content Sync Handlers

Steps for Checking Integrity

Clear cache

Run your handler (cache updated)

Run your handler again (cache should not be updated)

Steps for Debugging

Run your config

Export your config or review on device

If rendering fails check for missing styles/assets/libs or check for bad paths to styles/assets/libs

Logging

Enable ContentSync Debug logging via OSGI logger configurations on package `com.day.cq.contentsync` This will allow you to track what handlers ran and whether they updated the cache and reported updating the cache.

Additional Resources

To learn about the roles and responsibilities of an Administrator and Developer, see the resources below: