Get Started with Model-Driven Development
Adobe LiveCycle Data Services 3 introduces a data modeling language and platform code named Fiber. Fiber facilitates the development of data-centric applications. The new Modeler tool in LiveCycle Data Service 3 is an editor for Fiber data models. You can use the Modeler in conjunction with Flash Builder and the LiveCycle Data Services server to generate both client and server code from data models.
With the Modeler, the Fiber Assembler feature in LiveCycle Data Service, and Flash Builder, you can automatically generate Data Management Service destinations and Flex client code from the same model. You can generate the initial model from an existing SQL database, edit it in the Modeler tool, and then deploy it to both Flash Builder and the LiveCycle Data Services server. This results in tightly coupled client and server code for working with data in the database.
Follow these steps to get started with model-driven development:
- Get the Software
- Configure RDS on the Server
- Configure a JDBC Data Source
- Configure Flash Builder to View Your Database
- Create a J2EE Server Project in Flash Builder
- Next steps
Get the Software
Download and install the following software to get started building model-driven applications:
- LiveCycle Data Service 3 server beta 1
- Flash Builder 4 beta 1
- Modeler Eclipse plugins installed in Flash Builder, or Eclipse with Flash Builder plugins
- A SQL database
See the release notes for detailed installation instructions
Configure RDS on the Server
To work with server destinations or SQL databases while in Flash Builder or the Modeler, you must configure RDS on the server. RDS stands for Remote Development Services. The lcds and lcds-samples web applications in LiveCycle Data Services include an RDS server that is preconfigured but commented out in the WEB-INF/web.xml file.
By default, the RDS server uses application server security, and you must configure a role named rds and assign a user to that role.
The following example shows the default RDS servlet configuration in the WEB-INF/web.xml file. You must uncomment this section of the file.
<servlet>
<servlet-name>RDSDispatchServlet</servlet-name>
<display-name>RDSDispatchServlet</display-name>
<servlet-class>flex.rds.server.servlet.FrontEndServlet
</servlet-class>
<load-on-startup>10</load-on-startup>
</servlet>
<servlet-mapping id="RDS_DISPATCH_MAPPING">
<servlet-name>RDSDispatchServlet</servlet-name>
<url-pattern>/CFIDE/main/ide.cfm</url-pattern>
</servlet-mapping>
How you configure application server security depends on the application server you use. For more information, see your application server documentation.
On the Apache Tomcat server, by default you configure users and roles in the tomcat-users.xml file in the tomcat/conf directory. The following example shows a user and role configured for RDS in a tomcat-users.xml file:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="rds"/>
<user username="rdsuser" password="rdspassword" roles="rds"/>
</tomcat-users>
For development on your local machine, you can use the RDS servlet without configuring application server security, but this is not recommended for public deployment. The lcds-samples web application is preconfigured this way.
The following example shows an RDS servlet configuration in the WEB-INF/web.xml file with an init-param setting that bypasses application server security:
<servlet>
<servlet-name>RDSDispatchServlet</servlet-name>
<display-name>RDSDispatchServlet</display-name>
<servlet-class>flex.rds.server.servlet.FrontEndServlet
</servlet-class>
<init-param>
<param-name>useAppserverSecurity</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
<servlet-mapping id="RDS_DISPATCH_MAPPING">
<servlet-name>RDSDispatchServlet</servlet-name>
<url-pattern>/CFIDE/main/ide.cfm</url-pattern>
</servlet-mapping>
...
Configure a JDBC Data Source
You must configure a JDBC data source for each SQL database that you want to use. The RDS server uses this data source to display database tables in the RDS Dataview panel of the Modeler. How you configure a JDBC data source depends on the application server you use. For more information, see your application server documentation.
On the Apache Tomcat server, you configure JDBC data sources in a context file. The default context file is tomcat/conf/context.xml. You can also configure data sources in a context file for a specific host and web application; for example, tomcat/conf/Catalina/localhost/web_app_name.xml file.
The following example shows a JDBC data source configuration on Tomcat:
<Context privileged="true" antiResourceLocking="false"
antiJARLocking="false" reloadable="true">
<Resource name="jdbc/ordersDB" type="javax.sql.DataSource"
driverClassName="org.hsqldb.jdbcDriver"
maxIdle="2" maxWait="5000"
url="jdbc:hsqldb:hsql://localhost:9002/ordersdb"
username="sa" password="" maxActive="4"/>
</Context>
Configure Flash Builder to View Your Database
After you configure RDS on the server, you must configure Flash Builder to connect to the RDS server and display your database in the Modeler RDS data view.
Complete the following steps to configure Flash Builder for RDS:
- Make sure your application server is running.
- In Flash Builder, select Window > Preferences.
- Expand the Adobe tree node and select RDS Configuration.
- Under Currently Configured RDS Servers, select LCDS (localhost).
- Enter a description and the hostname and port number of your RDS server.
- Enter the context root of the web application that hosts your RDS server.
- If you are using web application security, enter a valid username and password combination, or leave the password field blank and select Prompt for Password.
- Click Test Connection.
- If the connection is successful, click OK.
Create a J2EE server project in Flash Builder
To use Flash Builder with LiveCycle Data Services, you must create a Flex project that corresponds to the server and web application you are using.
Complete the following steps to create a new Flex project:
- Make sure your application server is running.
- In Flash Builder, select File > New > Flex Project.
- Enter a project name.
- Use the default project location.
- Make sure the application type is set to Web.
- Use the default Flex SDK version.
- Change the Application server type to J2EE.
- Make sure that Use remote object access service is checked.
- Select LiveCycle Data Services as the server.
- Click Next.
- Enter the server location information for your server. Depending on the current information in the fields, you may need to uncheck Use default location... and manually enter the root folder, root url, and context root.
- Click Validate Configuration.
- If the configuration is valid, click Finish to create the project.
Next steps
Now that your development environment is set up, it is time to start building models and applications. Learn more on the beta site:
- Watch videos and try demonstration applications found within the installer.
- Build a model from a SQL database and build a Flex client application in Flash Builder.
See Using Adobe LiveCycle Data Services in the Developer's Guide. - Find out about the modeling language and the Modeler tool. See Data Modeling with Adobe LiveCycle Data Services in the Modeler help and in the Modeler Guide.