Accessibility

ColdFusion Article

 

Building your first data management application with ColdFusion and Flex


Table of Contents

Using the ColdFusion 8 extensions for Eclipse and Flex Builder

When installing Flex Builder 3 you were asked if you wanted to install the ColdFusion extensions. If you did not select that option you can find them in the ColdFusion LiveDocs.

Set up Eclipse to connect to the ColdFusion Remote Development Service (RDS) by choosing Window > Preferences, then ColdFusion > RDS Configuration (see figure 9).

This example uses the locally installed ColdFusion server. You can specify multiple servers if you also wanted to connect to one or more ColdFusion servers located elsewhere.

Note: If you are using the multiserver install of ColdFusion, the port number will be 8300; if you are using the standalone install you should set the port to 8500. For the security information, type the username and password that you use to log in to the ColdFusion administrator. Click Test Connection to ensure everything is set up correctly and click OK.

Figure 9

Figure 9. Setting the RDS configuration.

To open the RDS view in the Eclipse workbench, choose Window > Other Views. From the list of views which you can add to the workbench, expand the ColdFusion node, select RDS Dataview, and click OK (see Figure 10).

Figure 10

Figure 10. Selecting the RDS Dataview.

In your workbench you should now see the RDS Dataview window (see Figure 11).

Figure 11

Figure 11. The RDS Dataview window.

You may need to click the refresh button to display the list of defined data sources in your ColdFusion server.

At this point, the ColdFusion CFC wizard will do much of the coding work for you. First you need to create the server-side ColdFusion files that will work with LiveCycle Data Services ES. Your list of data sources may differ from the list in Figure 11. If you installed the ColdFusion sample data sources you should have the cfartgallery data source already. If not, you can download the Access database from the article and add it to your data sources in the ColdFusion administrator. Learn more about adding data sources to ColdFusion.

Next, expand the cfartgallery tree (see Figure 12).

Figure 12

Figure 12. Expanding the cfartgallery tree.

Right-click the APP.ARTISTS table and select ColdFusion Wizards > Create CFC (see Figure 13).

Figure 13

Figure 13. Starting the ColdFusion CFC Value Object Wizard

Figure 14

Figure 14. The ColdFusion CFC Value Object Wizard

To create the CFC file, follow these steps:

  1. Set CFC Folder to /myProject/src/com/adobe/devnet/example
  2. The default CFC Package Name may be src.com.adobe.devnet.example, change this to com.adobe.devnet.example
  3. Select LiveCycle Data Services Assembler CFC’s the CFC Type
  4. Set the AS Folder to /myProject/src/com/adobe/devnet/example
  5. The default AS Package Name may be src.com.adobe.devnet.example, change this to com.adobe.devnet.example
  6. Click Finish.

Take a look at the four files that were generated. While this code is everything we need for this example, you can easily modify it to fit any custom needs you may have. In short, you just saved great deal of time having the wizard generate all the base code that you need.