Composite Application Framework supports deploying a composite
application using command line tools. Currently, command line deployment
is supported by providing Ant tasks to use with Apache Ant. For
more information on Apache Ant, visit ant.apache.org.
The mosaicTasks.jar that is provided with the Composite Application
Framework SDK defines the Ant tasks for deploying composite applications
and catalogs. To access the tasks from an Ant script, the mosaicTasks.jar
must be available and defined as a resource. For example:
<taskdef resource="mosaic.tasks" classpath="${AEP_SDKS}/mosaicTasks.jar" />
After you have defined the resource, you can use the mosaic-catalog
and mosaic-application tasks to deploy composite applications and
catalogs to an Experience Server. For example, to deploy a composite
application:
<mosaic-application
action="import" file="applications/Basic.axml"
property="response"
protocol="http" server="localhost" port="4502"
username="admin" password=admin" />
To deploy a catalog:
<mosaic-catalog
action="import" file="catalogs/Concepts.zip"
property="response"
protocol="http" server="localhost" port="4502"
maxwait="360000"
username="admin" password=admin" />
The 'name' attribute of the root Composite Application Description
Language (CADL) element specifies the unique name of the application
or catalog. The root element for a composite application (AXML)
file is <app:Application>. For a catalog (CXML) file, it is
<catalog:Catalog>.
The catalog.zip file contains not only the CXML file, but also
any assets to be loaded into the catalog. When you use Experience
Services to deploy a catalog, the catalog archive (ZIP file) is
created and stored in the output folder of the project.
You can also use standard Ant tasks to build the ZIP file. Ensure
that the CXML file is in the root of the archive and that you lay
out the components in the same relative paths as they are to be
deployed to the server. For example, if the CXML contains /Catalog/TileClassList/TileClass/Content[@uri='${catalogURL}/tiles/Basic/Basic.swf']
(XPath notation), then the archive should contain the file "Basic.swf"
in the folder "tiles/Basic/". For more detailed examples, install
the Composite Application Framework sample applications and examine
the Ant build.xml scripts.
<mosaic-application action="import" file="applications/ClientDashboard.xml" property="response" protocol="${protocol}" server="${server}" port="${port}" username="${username}" password="${password}" />
When you import an application, if an application currently exists
on the server with the same unique name, the import action replaces
the existing application. The import action replaces the application
only if the user has permission to modify the application.
When you import a catalog, if a catalog currently exists on the
server with the same unique name, the import action replaces existing
components and adds new components. The import action replaces and
adds components only if the user has permissions to modify those
components and the catalog.
For more information on using Ant tasks, see Composite Application Framework Task Reference.