LiveCycle Data Services ES Samples

Starting the Samples Database

You have to start the sample database before you can run the LCDS samples. The LCDS samples use an HSQLDB database that is installed by the LCDS installer in the [LCDS ES install]/sampledb directory.

To start the sample database:

  1. Open a command prompt and go to the [LCDS ES install]/sampledb
  2. Run startdb.bat (Windows) or (Unix-based systems)

Source Code

The source code for all the sample applications is available in lcds-samples/WEB-INF/flex-src/ For example, on a typical Windows installation using the Tomcat integrated server, is located in
[LCDS ES install]/tomcat/webapps/lcds-samples/WEB-INF/flex-src.

30 Minute Test Drive

The objective of this test drive is to give you, in a very short amount of time, an understanding of how the Adobe® LiveCycle™ Data Services ES work and what they can do. This test drive consists of a series of eight samples kept as concise as possible (typically between 10 and 50 lines of code) to clearly expose features of interest.

Take the test drive

Other Samples

Inventory Management

This application demonstrates how to use the RemoteObject to build a simple CRUD (Create/Update/Delete) application.

Click here to start the Inventory Management application


Salesbuilder is a simple Sales Force Automation application. It is deployed as an AIR application, and uses the Data Management Services to persist data. The application demonstrates advanced features in the Data Management Services such as associations and lazy loading. It also demonstrates other interesting features such as native drag-and-drop in AIR, direct object manipulation in charting components, etc.

This sample requires the latest version of the Adobe AIR runtime. Please install it from the [LCDS ES install]/resources/air-runtime directory.

Click here to install the AIR application (NOTE: If this downloads as a .zip file, rename the extension to .air to install)

Click here to learn how to use the application

Trader Desktop

This example demonstrates how to use the message service to push data from the server to the client. At the server side, a Java component publishes simulated market data to an LiveCycle Data Services ES messaging destination. The Trader Desktop application subscribes to real time updates for the stocks specified in a configurable watch list. This application lets you experiment with the different types of channels (streaming, polling, long polling) supported by LiveCycle Data Services ES. LiveCycle Data Services ES also supports adaptive polling. Using the adaptive polling (using a per client outbound message queue processor), you have full control over how messages are handled by queue processors and delivered to individual clients. For example you can specify per-client delays for message delivery, and provide custom logic defining how messages are merged between deliveries.

  1. Click here to start the feed
  2. Click here to start the Trader Desktop application
  3. Click here to stop the feed

Collaboration Dashboard

The Collaboration Dashboard show how the Message Service can be used to build collaborative applications. To try this sample, open the application in two different browser windows and notice how selections made in one window are reflected in the other window. For example, the chart on the left shows total revenue across all regions on a monthly basis. When you select a month in this chart, the pie chart in the upper-right panel is updated to display a regional breakdown for the selected month. If you select a region in the pie chart, the chart in the lower-right panel is updated to display the selected region's results compared to the average for the given time period.

Run the sample

PDF Generation

Using the PDF generation feature in LiveCycle Data Services ES, you can build Flex applications that generate PDFs. A typical workflow is as follows:

  1. In the the Flex application you use a RemoteObject to invoke a method on a server component. You pass a data model as an argument. The data model represents the data that you want to merge into the PDF. It can include pure data as well as image snapshots of Flex components such as charting components and datatagrids. In this example the server-side component is
  2. The server-side component uses the Flex-Acrobat API to merge the data model into a PDF template.
  3. The server-side component saves the generated PDF. For example you could save it on the server's file system, as a byte array in the users's session, etc. In this example, we save the PDF as a byte array identified by a unique identifier in the user's session.
  4. The server-side component returns a location where the client application can load the generated PDF from. In this example, we return the unique indentifier representing the byte array in the user session. The Flex client then invokes a servlet (flex.samples.pdfgen.PDFResourceServlet) to retrieve the PDF from the session object.

In this sample, click "Create PDF" to generate a PDF by applying the data model sent from the Flex client to a PDF template. Click "Create PDF from XDP" to generate a PDF by applying the data model sent from the Flex client to an XDP based XFA template. Note that a valid LCDS license is required for generating a PDF from XDP.

Run the sample

SQL Assembler

Using the SQL Assembler, you can build simple CRUD applications based on the Data Management Services without writing server-side code. You can directly specify the SQL statements that you want to execute when the user creates, updates, or deletes items. You can also specify a number of SELECT statements to provide different ways to retrieve data (i.e. retrieve all products, retrieve products by name, etc). See the "sql-product" destination in WEB-INF/flex/data-management-config.xml for an example of how to define a destination using the SQLAssembler.

Run the inventory sample application (demonstrates CRUD capabilities)

Run the store application (demonstrates query capablities)

Runtime Configuration

Runtime configuration provides an alternative approach to defining destinations and adapters. In addition to statically defining destinations and adapters in the XML configuration files (data-management-config.xml, remoting-config.xml, and messaging-config.xml), you can now create destinations and adapters programmatically at runtime. Your runtime destinations and adapters can be injected at server startup, or created as needed during the life cycle of an application. The DataService and Remoting destination samples provide examples of destinations injected at server startup. The Messaging sample provides an example of a destination created as needed.

DataService destination

Run the sample

See to see how the "runtime-employee-ds" destination is created programmatically.

Remoting destination

Run the sample

See to see how the "runtime-employee-ro" destination is created programmatically.

Messaging destination

Run the sample

See to see how the chat room destinations are created programmatically.


The CRM application provides a basic CRUD interface to a simple company and employee database. The CRM Mini application displays a company list and shows how you can edit it directly in a DataGrid chart. To see how the synchronization works, open the applications in two browsers, and watch how changes in one browser occur in the other. The CRM application focuses on the Data Management Service in LiveCycle Data Services ES, and uses two destinations: and crm.employee. If you look at the destinations in the data-management-config.xml file, you can see that the employee and company databases are not associated with each other. Instead, the application handles the association on the client by executing the employee fill() method that uses the company id property. The companies are filled by specifying search terms or a combination of search terms and an industry; this shows how a fill() method can be overloaded. Each of the destinations is backed by an assembler that extends the AbstractAssembler class. This overrides the well-known methods and relies on superclass functionality instead of explicitly specifying each type of fill method. On the client side, the CRM application provides a dialog box for simple conflict resolution. If you edit a company in both applications, the conflicts dialog box appears, and you can select which version to accept. (Ensure that you edit both applications before you click Update in one of the applications.)

Run CRM mini



This application allows users to share notes in real time. It is a basic implementation of a chatroom or whiteboarding application. The goal of this sample is to demonstrate the use of the ActionScript adapter in Data Management Services. The ActionScript adapter is useful when all you need to do is maintain shared collections of objects in memory at the server side. Using the ActionScript adaper, you donít have to write any server-side code. Open data-management-config.xml in WEB-INF/flex, and look at the "notes" destination to see how to configure a destination using the ActionScript adapter.

Run the sample

Hibernate Integration

LiveCycle Data Services ES includes a Hibernate Assembler that allows changes made at the client-side to be automatically persisted using your existing Hibernate configuration. See the "hibernate-contact" destination in WEB-INF/flex/data-management-config.xml as well as hibernate.cfg.xml in WEB-INF/classes for more details, and Contact.hbm.xml in in WEB-INF/classes/flex/samples/contact.

NOTE: Hibernate is not installed in the samples web application. Before running this sample:

  1. Install Hibernate: Copy [LCDS ES install]/resources/hibernate/*.jar to your web application's WEB-INF/lib directory.
  2. Open data-management-config.xml in WEB-INF/flex, and uncomment the "hibernate-contact" destination.
  3. Restart the server.

Run the sample

© 2004-2008 Adobe Systems Incorporated. All rights reserved.