Managing LiveCycle Applications with ant

Adobe LiveCycle ES4 introduces out of the box ant tasks which can help in managing LiveCycle Applications (like import, export, deploy etc).

In past, Livecycle client SDK provided following public APIs for managing applications:

public boolean deployApplication(String anApplicationName, 
    String anApplicationVersion) 
    throws ApplicationManagerClientException

public boolean undeployApplication(String anApplicationName, 
    String anApplicationVersion) 
    throws ApplicationManagerClientException

public String importApplication(Document aRequest) 
    throws DesigntimeServiceException

public Document export(ArrayList exportReqs,
    String lcaDescription) 
    throws DesigntimeServiceException

In addition to these APIs,  LiveCycle ES4 also provide convenient ant tasks which internally use these APIs.

Declaring and using the ANT tasks

To use the new ant tasks, following section needs to be added in the ant (i.e. build.xml) file:

<!-- common section -->
<property name="lc.sdk.home" 
    value="C:/Adobe/Adobe LiveCycle ES4/LiveCycle_ES_SDK" />
<path id="application.client.classpath">
  <pathelement 
    location="${lc.sdk.home}/client-libs/thirdparty/axis.jar"/> 
  <pathelement 
    location="${lc.sdk.home}/client-libs/thirdparty/saaj.jar"/> 
  <pathelement 
    location="${lc.sdk.home}/client-libs/thirdparty/wsdl4j.jar"/> 
  <pathelement location=
    "${lc.sdk.home}/client-libs/thirdparty/commons-logging.jar"/>
  <pathelement 
    location="${lc.sdk.home}/client-libs/thirdparty/jaxrpc.jar"/> 
  <pathelement location=
    "${lc.sdk.home}/client-libs/thirdparty/commons-discovery.jar"/> 
  <pathelement location=
    "${lc.sdk.home}/client-libs/thirdparty/commons-collections-3.1.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/thirdparty/activation.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/thirdparty/mail.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/common/adobe-livecycle-client.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/common/adobe-usermanager-client.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/common/adobe-repository-client.jar"/>
  <pathelement location=
    "${lc.sdk.home}/client-libs/common/adobe-application-remote-client.jar"/>
</path>
<taskdef name="deploy" classname=
  "com.adobe.livecycle.applicationmanager.ant.tasks.DeployApplicationTask">
  <classpath refid="application.client.classpath"/>
</taskdef>
<taskdef name="undeploy" classname=
  "com.adobe.livecycle.applicationmanager.ant.tasks.UndeployApplicationTask">
  <classpath refid="application.client.classpath"/>
</taskdef>
<taskdef name="deleteapp" classname=
"com.adobe.livecycle.applicationmanager.ant.tasks.DeleteApplicationTask">
  <classpath refid="application.client.classpath"/>
</taskdef>
<taskdef name="exportlca" classname=
"com.adobe.livecycle.applicationmanager.ant.tasks.ExportLCATask">
  <classpath refid="application.client.classpath"/>
</taskdef>
<taskdef name="importlca" classname=
"com.adobe.livecycle.applicationmanager.ant.tasks.ImportLCATask">
  <classpath refid="application.client.classpath"/>
</taskdef>

After this section the defined tasks can be used as follows:

<!-- This would import MyProcess on the server -->
<importlca file="MyProcess.lca" 
  propertiesFile="lcserver.properties" />

<!-- This would export application MyProcess from server 
to file MyProcess.lca on the local machine -->
<exportlca file="MyProcess.lca" appname="MyProcess" 
  appversion="1.0" propertiesFile="lcserver.properties" />

<!-- This would deploy the imported application
on the server -->
<deploy appname="MyProcess" appversion="1.0" 
  propertiesFile="lcserver.properties" />

<!-- This would undeploy the deployed application 
on the server -->
<undeploy appname="MyProcess" appversion="1.0" 
  propertiesFile="lcserver.properties" />

<!-- This would delete the application on the server -->
<delete appname="MyProcess" appversion="1.0" 
  propertiesFile="lcserver.properties" />

The lcserver.properties file used in the example is of following form:

serverUrl=http://<lc-server-ip>:<lc-server-port>
username=administrator
password=password
VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 6.0/10 (5 votes cast)
Managing LiveCycle Applications with ant, 6.0 out of 10 based on 5 ratings

About Neerav Aggarwal

Engineering Manager, LiveCycle
This entry was posted in Adobe LiveCycle ES4. Bookmark the permalink.

Comments are closed.