-
Notifications
You must be signed in to change notification settings - Fork 28
Customizing App Import
The import process for existing PhoneGap apps provided by AEM Mobile can be customized to suit a variety of requirements. Before an import can even occur, however, an archive of the existing app must be created.
Furthermore, while the import process is ideal for quickly bootstrapping an existing app in AEM, it is also possible to wrap an existing app in an AEM content package to be included as part of a overall deployment strategy.
Any Cordova project can be zipped and imported into AEM as long as a few conventions are followed.
- archive can contain any number of top level directories
- eg. repo-name/branch/config.xml
- common Cordova/PhoneGap project structure must be followed
- archive can only contain one 'www' directory
- the import process will determine where the app root is based on the location of the 'www' directory
- archive can only contain one 'config.xml'
- the 'config.xml' can either be in the 'www' directory or in its parent directory
- if a 'config.xml' is not found or it is not in one of the above locations an error will occur\
- archive cannot contain plugins or platforms directories
- only import configuration and web content to AEM
- use import operation OSGI config to exclude files in ZIP and to determine what contents should be copied to Assets vs.
/content/mobileapps
The upload operation used during an app import can be configured to suit specific requirements.
Persistent Identity: com.adobe.cq.mobile.platform.impl.operations.MobileAssetUploadOperation
A regular expression to indicate what file patterns should be ignored during import.
- eg. ^(__MACOSX.)|(..DS_Store)$
A list of mime types that will be extracted to the app asset path instead of under the app instance.
- eg. ["image/jpg", "image/jpeg", "image/png"]
Some additional properties can optionally be added to the root config.xml element of a PhoneGap app to assist with the import process.
XML Namespace: xmlns:cq="http://www.day.com/jcr/cq/1.0"
- the node name for the app's group
- attribute name: cq:appName
- default: app name from config or archive file name
- eg.
cq:appName="hybrid-reference-app"
- the path to the app template that should be used during app creation
- attribute name: cq:templatePath
- default:
/libs/mobileapps/phonegap/templates/app-hybrid
- eg.
cq:templatePath="/apps/arumsey/mobileapps/templates/app-hybrid-custom"
- root DAM location to extract assets
- attribute name: cq:assetPath
- default:
/content/dam/mobileapps
- eg.
cq:assetPath="/content/dam/we-healthcare/tracker-application"
- title to give DAM assets folder
- attribute name: cq:assetTitle
- default:
<empty>
- eg.
cq:assetTitle="we.Tracker Assets"