LiveCycle Data Services:Setting up an SDK, Compilers, and Flex Builder
From Adobe Labs
| Table of contents |
Setting up an SDK, compilers, and Flex Builder for LiveCycle Data Services ES 2.6
Before developing and compiling Flex applications that use LiveCycle Data Services ES 2.6 Beta 2, you must set up your development and compilation environment. LiveCycle Data Services ES does not include any Flex compilers. You have the option of working with Builder 3, the Flex web tier compiler for J2EE, or the mxmlc command line compiler.
Configuring the LiveCycle Data Services ES 2.6 SDK
To build a LiveCycle Data Services ES 2.6 application in Flex Builder or with the mxmlc command line compiler, you need the Flex 3 SDK along with the LiveCycle Data Services SWC files. Complete these steps to configure the Flex 3 SDK and other required SWC files:
- Unzip install_root/resources/flex_sdk\flex_sdk_3.zip to install_root/resources/flex_sdk, where install_root is the LiveCycle Data Services ES installation directory.
- Copy install_root/resources/frameworks\libs\datavisualization.swc and fds.swc to install_root/resources/flex_sdk/frameworks/libs.
- Copy install_root/resources/frameworks/libs/air/airfds.swc to install_root//resources/flex_sdk/frameworks/libs/air.
- Copy install_root/resources/frameworks/libs/player/playerfds.swc to install_root//resources/flex_sdk/frameworks/libs/player.
- Copy install_root/resources/frameworks/libs/locale/en_US/datavisualization_rb.swc and fds_rb.swc to install_root/resources/flex_sdk/frameworks/locale/en_US.
Setting up Flex Builder 3 for LiveCycle Data Services ES 2.6
To build an LiveCycle Data Services ES 2.6 application in Flex Builder, you need the Flex 3 SDK along with the LiveCycle Data Services SWC files. These instructions describe how to add the SDK to Flex Builder. Make sure you <a href="#config_sdk">configure your SDK</a> before completing this procedure.
Note: To add an SDK to Flex Builder, you must first create a Flex project in Flex Builder. If you have an existing Flex project, you can use it to add the SDK. If you do not have an existing Flex project, first create one using all of the default settings. You can remove the project after adding the SDK.
- Start Flex Builder
- Select an existing Flex project in Flex Builder. If you do not have an existing Flex project, create one.
- Select Project > Properties to open the Project Properties dialog box.
- Select Flex Compiler.
- Select Configure Flex SDKs from the right side of the dialog box to open the Installed Flex SDKs dialog box.
- Click Add.
- Specify install_root/resources/flex_sdk for the Flex SDK location in the Add Flex SDK dialog box.
- Specify LCDS_Beta 2 for the Flex SDK name in the Add Flex SDK dialog box.
- (Optional) Select the checkbox next to the Flex LCDS Beta 2 SDK to make it the default SDK for new Flex projects.
- Click OK.
Creating a Flex Builder project that uses LiveCycle Data Services ES 2.6
Flex Builder does not include LiveCycle Data Service ES 2.6 as one of the server options when you create a Flex project that uses J2EE. However, you can select the LiveCycle Data Services option and manually set the root folder, root URL, and context root of your web application.
Complete the following steps to create a LiveCycle Data Services ES 2.6 project:
- Select File > New > Flex Project.
- Enter a project name.
- Select an application type. If you are creating an AIR application, make sure you do not have any server tokens in URLs in the service configuration files. In the web applications that ship with LiveCycle Data Services ES, server tokens are used in the channel endpoint URLs in the WEB-INF/flex/services-config.xml file, as the following example shows:
<endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>You would change that line to something like this:
<endpoint url="http://your_server_name:8400/lcds/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
- Select J2EE as the Application server type.
- Select "Use remote object acccess".
- Select "LiveCycle Data Services".
- Deselect "Create combined Java/Flex Project with WTP" if that option is available.
- Click Next.
- Deselect Use default location for local LiveCycle Data Services server.
- Manually set the root folder, root URL, and context root of your web application.
- Make sure the option to compile the application locally in Flex Builder is selected.
- Make sure that your server is running, and click Validate Configuration.
- Click Finish.
After Flex Builder creates your project, make sure that your project uses the LiveCycle Data Services ES 2.6 SDK to compile it:
- Select the project.
- Select Project > Properties to open the Project Properties dialog box.
- Select Flex Compiler.
- Choose "Use a specific SDK" under Flex SDK version.
- Select LCDS_Beta 2, or whatever you named the LCDS SDK, from the dropdown list of SDKs.
- Click OK.
You should now be able to create, compile, and run an application that uses LCDS.
Integrating the Flex web tier compiler for J2EE
LiveCycle Data Services ES no longer includes an integrated web tier compiler, but you can download the Flex J2EE web tier compiler and easily integrate it into a LiveCycle Data Services ES 2.6 .
- Download the Flex 3 Compiler Module for J2EE Application Servers from the download page.
- Open or unzip the Flex 3 Compiler Module for J2EE Application Servers ZIP file and then unzip the webtier.war file that it contains to a directory called webtier.
- Copy all of the files in the webtier/WEB-INF/lib to to the corresponding WEB-INF/lib directory of your LiveCycle Data Service ES web application. Do not overwrite any existing files.
- Copy all of the files and directories in the webtier/WEB-INF/flex directory except the services-config.xml file to to the corresponding WEB-INF/flex directory of your LiveCycle Data Service ES web application. Do not overwrite any existing files.
- Copy the player and locale directories as well as the datavisualization.swc file from the install_root/resources/frameworks/libs directory to the WEB-INF/flex/libs directory of your LiveCycle Data Service ES web application.
- Add the text highlighted in green below to the web.xml file in the WEB-INF directory of your LiveCycle Data Service ES web application:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>LiveCycle Data Services Samples</display-name>
<description>LiveCycle Data Services Application with Samples</description>
<!-- start from webtier web.xml -->
<context-param>
<param-name>flex.class.path</param-name>
<param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</param-value>
</context-param>
<!-- end from webtier web.xml -->
<!-- Http Flex Session attribute and binding listener support -->
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<!-- MessageBroker Servlet -->
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>PDFResourceServlet</servlet-name>
<display-name>Helper for retrieving dynamically generated PDF documents.</display-name>
<servlet-class>flex.samples.pdfgen.PDFResourceServlet</servlet-class>
</servlet>
<!-- start from webtier web.xml -->
<servlet>
<servlet-name>FlexMxmlServlet</servlet-name>
<display-name>MXML Processor</display-name>
<description>Servlet wrapper for the Mxml Compiler</description>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.MxmlServlet</param-value>
</init-param>
<init-param>
<param-name>webtier.configuration.file</param-name>
<param-value>/WEB-INF/flex/flex-webtier-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>FlexSwfServlet</servlet-name>
<display-name>SWF Retriever</display-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.SwfServlet</param-value>
</init-param>
<!-- SwfServlet must be initialized after MxmlServlet -->
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>FlexForbiddenServlet</servlet-name>
<display-name>Prevents access to *.as/*.swc files</display-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.ForbiddenServlet</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>FlexInternalServlet</servlet-name>
<servlet-class>flex.bootstrap.BootstrapServlet</servlet-class>
<init-param>
<param-name>servlet.class</param-name>
<param-value>flex.webtier.server.j2ee.filemanager.FileManagerServlet</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
<!-- end from webtier web.xml --> </span>
<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>PDFResourceServlet</servlet-name>
<url-pattern>/dynamic-pdf/*</url-pattern>
</servlet-mapping>
<!-- start from webtier web.xml -->
<servlet-mapping>
<servlet-name>FlexMxmlServlet</servlet-name>
<url-pattern>*.mxml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FlexSwfServlet</servlet-name>
<url-pattern>*.swf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.as</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.swc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FlexInternalServlet</servlet-name>
<url-pattern>/flex-internal/*</url-pattern>
</servlet-mapping>
<!-- end from webtier web.xml -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<!-- for WebSphere deployment, please uncomment -->
<!--
<resource-ref>
<description>Flex Messaging WorkManager</description>
<res-ref-name>wm/MessagingWorkManager</res-ref-name>
<res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
-->
<!--
<security-constraint>
<web-resource-collection>
<web-resource-name>Protected Sample</web-resource-name>
<url-pattern>/messagebroker/amf/SampleSalaryRO</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>sampleusers</role-name>
</auth-constraint>
</security-constraint>
-->
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<!--
<security-role>
<role-name>sampleusers</role-name>
</security-role>
-->
<!-- start from webtier web.xml -->
<taglib>
<taglib-uri>FlexTagLib</taglib-uri>
<taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
</taglib>
<!-- end from webtier web.xml -->
</web-app>
