The goal of this sample is to demonstrate how you can create a Flex application that can use LiveCycle Forms to render PDF and HTML forms from XML form templates (XDP) created in Adobe Designer. The Flex application will display a list of pre-designed forms, sample xml data files (that can be used to pre-populate the forms) and available transformations. Once a form and optional XML data file have been selected, click on the Render Form button. This will make a call to LiveCycle Forms which will render the form on the server and return the result to the Flex application. Since Flash cannot embed PDF or HTML, I have lifted Christophe’s IFrame sample. Basically, the PDF and HTML content returned from LiveCycle Forms is displayed in an IFrame on top of Flash. There are still some issues I have to work out regarding re-sizing etc. I’ll post an update as soon as I have time to look into it.
An optional part of this sample is to display performance numbers. When LiveCycle Forms is rendering the form template into PDF or HTML, I collect the number of milliseconds that it took to render the form. That performance data can be pushed to the flex application using JMS. This option is turned off by default, please read the README.HTML file to see what needs to be done to turn this option on.
This sample will showcase several Flex Data Services 2 capabilities. The first one being RPC Services. This sample uses a Java Object named FileUtils that I created that implements several file I/O functions. One of these function is listFilesFromURL(url). This function will return a string array of files available at the provided URL. That is the function that is used to display the list of available forms and XMl data files. This function was tested with JRun as well as WebLogic directory listings. If there any issues with the code, let me know. The other Flex Data Services 2 capability showcased in this sample is real-time messaging. If you choose to enable the JMS capabilities of this sample, everytime a form is rendered, the performance data is sent to a JMS topic and Flex will detect that message and grab the value which will be displayed in the graph. The really cool thing about this feature is that every person running this application will see all of the performance data, not just their own.
You will need LiveCycle Forms as well as Flex Data Services. Check out these links to get access to the software.
I’m working on getting the application hosted somewhere accessible to you can try it… Stay tuned.