Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Import application configuration

Avatar

Former Community Member

Hi everyone,

I would like to make a java application that automatically deploys a livecycle application to another environment and imports a configuration file.

The first part (deploying the lca) is easy, there are examples in the documentation.

However, the second part is quiet hard, and I can't find any documentation about it ...

In the LiveCycle Administration Console, it's possible to "export execution configuration" as an xml file, and then to import it back in the new environment.

Is there a way to use this functionnality via LiveCycle Java API ?

The only other solution I see is to write a Java application that parses the XML document generated by Adobe and update every endpoint / configuration parameter "manually" but's it seems like a long job, and i'm sure there's a better way !

Best regards,

Thomas

1 Reply

Avatar

Former Community Member

Ok guys I found the answer !

I simply needed to use the ImportApplicationInfo param while deploying the new application

Here's the code for those who wants :

     //Set connection properties required to invoke LiveCycle ES2

     Properties ConnectionProps = new Properties();

     ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "YOUR_ENDPOINT");

     ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);         

     ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");

     ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");

     ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

       

     //Create a ServiceClientFactory object

     ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);

     ServiceRegistryClient serviceReg = new ServiceRegistryClient(myFactory);


     // Get conf file

     FileInputStream fileAppInfo = new FileInputStream("d:/LCConf.xml");

     Document appInfo = new Document(fileAppInfo);

          

     // Get LCA file

     FileInputStream fileApp = new FileInputStream("d:/test.lca");

     Document lca = new Document(fileApp);

      

     // Deploy using the xml and the lca

     ApplicationManager appManager = new ApplicationManager(myFactory);

     ImportApplicationInfo appInfoSettings = new ImportApplicationInfo(true, appInfo);

     ApplicationStatus appStatus = appManager.importApplicationArchive(lca, appInfoSettings);

     System.out.println("Returned code : " + appStatus.getStatusCode()); // 1 is success