Adobe LiveCycle Content Services software lets building content-rich engagement applications rapidly with running on Adobe LiveCycle Enterprise Suite (ES) platform. As LiveCycle ES provides efficient solutions for media-centric domains, Content Services is a one of the most important modules with the reason that it has management capabilities for document based contents. The main advantage of using Adobe LiveCycle platform is that accelarating solution’s time to market. So, the motivation of this work is to see that how easy and fast is that developing a client application to interact with Adobe LiveCycle Content Services module.
The performance concept is also another issue that should be taken into accout at client application side. Flex is one of the best option with the reason of using AMF (Action Messaging Format), which offers fast and efficient communication with help of binary format. There is another important reason that LiveCycle Service Discovery Plug-in is available to find and generate any service resource at the client application. Let’s take a look at Flex solution provided below for the scenario that retrieving the contents stored and managed by Content Services software.
- Install LiveCycle Service Discovery Plug-in for Flash Builder
You can find the details here
- Find and define DocumentManagementService in the LiveCycle services list
Once connecting to LiveCycle ES data services, then you will be able to search service list
<fx:Declarations>
<services:DocumentManagementService fault="documentService_faultHandler(event)" result="documentService_resultHandler(event)"/>
</fx:Declarations>
- Test and call getSpaceContents method
The method is available under DocumentManagementService definition, and it can be tested via Test Operation tool inside Flash Builder
private function retrieveContentsAction():void {
documentService.getSpaceContents(storeLoc.text,spaceLoc.text, false);
}
- Bind result to a datagrid component
The result is returned as a list of retrieved contents and a datagrid component can be used to visualize those contents. In the example, I have created an auxiliary class named ContentInstance to format the result list.
protected function documentService_faultHandler(event:FaultEvent):void{
Alert.show(event.fault.toString());
}
protected function documentService_resultHandler(event:ResultEvent):void{
var returnObj:ArrayCollection = event.result as ArrayCollection;
productList = new ArrayCollection();
for(var i:int=0; i<returnObj.length; i++){
var atmapObj:Object = returnObj[i]["attributeMap"] as Object;
var docObj:Object = returnObj[i]["document"] as Object;
var ci:ContentInstance = new ContentInstance();
ci.guid = atmapObj["{http://www.alfresco.org/model/system/1.0}node-uuid"] as String;
ci.documentName = atmapObj["{http://www.alfresco.org/model/content/1.0}name"] as String;
ci.documentCreator = atmapObj["{http://www.alfresco.org/model/content/1.0}creator"] as String;
//ci.documentLink = atmapObj["{http://www.alfresco.org/model/content/1.0}browse-link"] as String;
ci.documentLink = docObj["url"] as String;
productList.addItem(ci);
}
}
I think anybody tries to develop the same will aggree with me on that it is very easy and fast to develop an application running on LiveCycle ES platform by using Flex. Especially, testing and defining a service with help of service discovery plug-in makes application development and unit testing of LiveCycle’s services really exciting.


