30 June 2010
This development article is intended for ActionScript developers who want to create applications for LiveCycle Data Services.
You can programmatically create a Rich Internet Application (RIA) that displays enterprise data by using the LiveCycle Data Services Message Service. You use the Flex client-side API and the server-side Message service to create messaging applications. A client application connects to a message destination on the server, sends messages to the server, and receives messages that were initiated by other client applications. Messages sent to the server are routed to other client applications that have subscribed to the same destination. Therefore if data is modified in one client application, other client applications that subscribe to the destination are updated in real time. That is, any other dashboard application that subscribes to the same destination has the exact same data view.
Client applications that send messages to LiveCycle Data Services are called message producers. You define a producer in a client application by creating a Producer object. Client applications that receive messages from LiveCycle Data Services are called message consumers. You define a consumer in a client application by creating a Consumer object. An application can be both a message producer and a message consumer. When using both a message producer and a message consumer in the same application, ensure that they both reference the same destination.
The following illustration shows messages being passed between producer applications, consumer applications, and LiveCycle Data Services.
The dashboard application enables users to view data in controls such as a pie chart and a data grid control. When the user modifies data located in a control, for example, adjusts the range control, the view is changed. As a result, a message is created and sent to the Message service. All client applications that subscribe to the destination are updated.
The following illustration provides a visual representation of the dashboard application built using Flash Builder 4.
For simplicity, the data that is used by the Dashboard application is located in an XML file named results.xml. Typically data is provided by Java server-side classes deployed on the LiveCycle Data Services server.
The following code represents a portion of the data located in the results.xml file.
<list> <month name="Jan-04" revenue="400263" average="80052"> <region name="APAC" revenue="46130"/> <region name="Europe" revenue="106976"/> <region name="Japan" revenue="79554"/> <region name="Latin America" revenue="39252"/> <region name="North America" revenue="128351"/> </month> <month name="Feb-04" revenue="379145" average="75829"> <region name="APAC" revenue="70324"/> <region name="Europe" revenue="88912"/> <region name="Japan" revenue="69677"/> <region name="Latin America" revenue="59428"/> <region name="North America" revenue="90804"/> </month> </list>
Note: The complete XML file that is used to populate the Dashboard application is available as a file attachment to the PDF document that corresponds to this development article.
The data located in the XML file is retrieved by using a
HTTPService object. The URL property of the
HTTPService object is set to result.xml, which means that the XML file is located in the project’s root folder. The controls in the dashboard application display the data located in the XML file.
The objective of this development article is to guide you through how to build this application and to explain some key concepts related to the Message service. To create a dashboard application by using the Message service, perform the following tasks:
- Start the J2EE application server hosting LiveCycle Data Services.
- Create a Flash Builder 4 project.
- Develop the application logic for the dashboard application.
- Configure LiveCycle Data Services.
Where to go from here
For more information about creating data management applications, see the Using Adobe LiveCycle Data Services ES2 Guide.