Accessibility

Table of Contents

Customizing the Eclipse IDE for robust ColdFusion application development

Using the ColdFusion 8 Extensions for Eclipse

To use the ColdFusion 8 Extensions for Eclipse, you will need to download them from the Adobe ColdFusion support site and install them as directed. These extensions include plug-ins that add a ColdFusion 8 code debugger, RDS capabilities, code wizards, and more.

I will very briefly give an overview of the RDS capabilities and the code wizards. I also recommend reading the following article that will give you an in-depth look at the code debugger in Eclipse: Using the ColdFusion 8 step-through debugger for Eclipse.

RDS capabilities

Remote Development Services, or RDS, enables applications such as Eclipse to browse available components and data structures of data sources on the ColdFusion server. You will be able to access your data sources to view your database tables and to build queries.

Once you have installed the ColdFusion 8 Extensions for Eclipse, you can access these new tools by clicking Window > Show View > Other from the main toolbar. From the window that appears, click the ColdFusion folder to see the options available. From the list, select RDS Dataview and click OK (see Figure 13).

Selecting the RDS Dataview

Figure 13. Selecting the RDS Dataview

Now you will see a panel open at the left side of the Eclipse environment. A localhost data source should be visible. If you try to expand the localhost view, you will be prompted for an RDS password. If you configured your ColdFusion server on port 8500, enter your password, and the data sources that are configured in your ColdFusion Administrator will appear. If you have configured your server in another fashion, you will need to open the RDS configuration window by right-clicking the localhost item and Selecting "RDS Configuration."

From the RDS Configuration window, select your localhost and enter the relevant information to allow Eclipse to connect to your RDS Server that should have been installed and configured when you installed ColdFusion.

When you return to your Eclipse environment, open the tree under the localhost server in the RDS panel. You can expand your data sources to view the tables and columns for each database. You can also build queries off of these data sources.

To view the Query Builder, right-click the data source you want to work with and Select RDS Query Viewer. From here you can write your SQL code by hand or visually, by clicking the Visual Query Builder button on the top of this panel.

From the Visual Query Builder, you can click and click and click to create your SQL queries. There is even a nice visual table relations view to join fields and build WHERE statements (see Figure 14).

Visual Query Builder

Figure 14. Visual Query Builder

Code wizards

Several wizards are available with the new ColdFusion 8 Extensions for Eclipse. This article will briefly introduce two of them.

CFC wizard

The CFC component wizard builds complex CFCs fast and efficiently from your data sources. For example, you can click on a table in a data source from your RDS Dataview panel, then right-click and select ColdFusion Wizards > Create CFC. A CFC wizard opens with editable parameters (see Figure 15).

The CFC Wizard

Figure 15. The CFC Wizard

Select your options and click Finish. Your CFC will be created and opened in Eclipse.

ColdFusion/AJAX Application wizard

The next wizard that I will introduce is the ColdFusion/AJAX Application wizard. There is also a ColdFusion/Flex Application wizard, but it requires the Flex Builder plug-in for Eclipse. This current version of Eclipse that we are using will not work with Flex Builder 2, and you may want to install Flex Builder 3 instead or install an older version of Eclipse that is compatible with Flex Builder 2. The CF/AJAX wizard will step you through building a complete data-driven AJAX application with a few clicks.

To begin, you will need to Select File > New > Project > Other. From the window that opens, select the ColdFusion Wizards folder and open its tree to select the ColdFusion/AJAX Application wizard. A window will appear welcoming you to the power of ColdFusion – yes, indeed…

Select Next a couple of times till you get to the RDS Server and Data Source Selection step. Since this is a new application, it is not necessary to edit any of the default settings in the steps that you skipped through. Refer to the documentation for more details. I have a link below to the relevant Live Docs.

Choose your localhost RDS server and your data source. Click Next again and you will be in the Page Layout and Design step. This section defines the pages that will be a part of your application. You can define Master Pages, Detail Pages, Master Detail Pages and ColdFusion/Flashpaper Report Documents.

In this step you will create a new page from the Available Pages section and add it to the Navigation tree. In the Page Information, name your page and select Master/Detail page (see Figure 16).

Page Layout and Design step

Figure 16. Page Layout and Design step

Click the Edit Master Section button and a Query Builder will open. As this is a master page, only select a few general details, since you will be able to add more columns to the Detail Section.

You will need to select an ID column from the table that you want to work with, even though it doesn't have to appear in your application. When you are finished building your query, Click OK to close the builder. Back in the Page Layout and Design window, Select the Detail Section tab to reopen the Query Builder.

After you have built your query, click Save and then enter a Project Name and the path to your local ColdFusion server. A folder will be created in your wwwroot folder with the project name that you specify. Do not add a folder name to the end of Web Root Folder. Click Finish and wait for the ColdFusion/AJAX wizard to finish.

That's it. To browse your new application, Edit the URL of your project to point to your new index.cfm page and click the refresh button in your Browser View tab in the Eclipse environment. Test your new data-driven AJAX application.

If your outcome was not what you desired, you can edit the code, or just create a new project and run the wizard again. For more information about additional wizards and details how to use them, check out the ColdFusion Live Docs documentation.

Where to go from here

This tutorial gets you started ColdFusion building applications with Eclipse. CFEclipse has many more features to offer. For more details about CFEclipse, including a brief history, you can read this overview on CFEclipse for ColdFusion Developers. I recommend browsing the CFEclipse.org website for updates, how-to videos, and other useful information. A ton of tweaks and add-ons are available for you to use to supercharge your Eclipse environment, but you will need to build the hotrod yourself with available plug-ins.

By leveraging the additional tools that are available for Eclipse and CFEclipse, you can customize your very own feature-rich development environment.

Attributions

Aaron West's snippets