Created

Introduction

Adobe released the first version of ColdFusion Builder, the long-awaited ColdFusion-specific integrated development environment (IDE), to the development community back in March 2010. Now with the latest version, ColdFusion Builder 2, developers have even more features, functions, and tools at their fingertips.

For many ColdFusion developers, Dreamweaver has long been a development tool of choice due to its integration with the ColdFusion language library and code assistance.

In this article, you will discover some of the features and tools available within ColdFusion Builder that will help to increase your productivity as a developer and go some way to make your life easier, such as:

Code insight

SQL editor tools

Code refactoring

Extending the IDE functionality using CFML

Importing an existing project into ColdFusion Builder

As well, this article demonstrates that the transition from Dreamweaver to ColdFusion Builder is incredibly simple, easy, and rewarding.

Getting started with ColdFusion Builder

The ColdFusion Builder IDE is based on the Eclipse development platform, a highly extensible development application with a wide collection of plug-ins available to download to assist in enhancing your working environment and development workflow.

You can install ColdFusion Builder in one of two ways:

As a stand-alone IDE

As a plug-in into an existing Eclipse-based application

Which installation method is for me?

The option you choose to install will depend on whether you currently use Eclipse as a development platform.

When installing ColdFusion Builder as a standalone product, you also get a full installation of Eclipse ”under the hood.” This option is perfect if you do not already have Eclipse installed on your machine. If you do have Eclipse already running on your machine, you can choose to install ColdFusion Builder as a plug-in into the IDE, which will enable the full support and tools offered with the stand-alone installation, and will simply add a new perspective to your workbench for your ColdFusion development work.

Because ColdFusion Builder comes bundled with Flash Builder 4, and is also based upon the Eclipse platform, the installation can be integrated to combine a comprehensive development environment for your rich Internet application projects.

Perspectives, views, and panels

One of the benefits of ColdFusion Builder being written on an Eclipse-based platform is the extensibility offered for creating custom perspectives and layouts.

Perspectives, similar to the workspaces available in Dreamweaver, are specific screen setups, containing the panels, toolbars, and windows in a particular position or format within the editor that best suits the developer.

When using Dreamweaver, you can select from one of the pre-defined Workspaces such as Application Developer, Coder, and Coder Plus, or create and customize your own. ColdFusion Builder offers the same level of control to allow you to create and build your perspective to provide you with the tools you need at hand to optimize your workflow and enhance the way you work.

By default, ColdFusion Builder contains two perspectives:

ColdFusion Builder Development

ColdFusion Builder Debugging

Figure 1. The ColdFusion Builder workbench development perspective allows you to customize the layout of your views and panels.

Customizing your perspective

Defining your custom layout within ColdFusion Builder is incredibly easy to do. All views and windows within the application are tabbed. To move them around the workbench, simply click and drag the tab to the area you would like to place it. You can also rearrange the order of grouped tabs by dragging the tabs into your preferred order. The perspective will not revert to any default formation, so every time you use it, all views and windows will remain exactly where you put them.

Matching your Dreamweaver color codes

One of the most useful visual aids in any IDE is the color formatting for code within the editor.
Within ColdFusion Builder, you can easily customize the code formatting colors to suit your needs and requirements by going to Preferences > ColdFusion > Editor Profiles > Editor > Colors. ColdFusion Builder also comes with a default Dreamweaver profile, which has some of the standard colors included. To enable this, go to Preferences > ColdFusion > Editor Profiles and select Dreamweaver from the Active Profile selection list.

Opening and switching perspectives

ColdFusion Builder will automatically open a perspective based upon the association of an opened file, meaning that the perspective will change and display relevant panels and toolbars to assist you to support the current task at hand.

Typically, all development work is undertaken within the Development perspective. The application will automatically switch over to the Debugging perspective when you run debugging.

ColdFusion server management

ColdFusion Builder comes with the built-in ability to interact with ColdFusion server instances, whether they are on a remote server or on your local development environment.

In a similar process to setting up a new site in Dreamweaver and assigning that site to a local or remote environment, we can set up a ColdFusion project and assign it to a specific ColdFusion server.

However, unlike Dreamweaver, by assigning a server instance to the project, you are able to easily view the preview page directly within ColdFusion Builder without previewing in an external browser, utilize the debugging features, and have quick and easy access to data sources and server management features, all from within the IDE.

Adding a ColdFusion server connection

Creating a new ColdFusion server connection is very easy to do, and you manage it through the Servers tab at the bottom of the IDE. If this is not visible in your current layout, go to Window > Show View -> Servers. Use the following steps to set up a connection to the local development server on your machine:

Click the Add Server button (the first icon in the view toolbar) and select ColdFusion as the server type.

Enter a name for the server. This is not system specific and is only there to help you identify the server in the tab so you can enter in anything you like. In this instance, enter localhost. Likewise, the description input is purely for your reference. Add CF9 Localhost. Select the Other option from the Application Server menu, since you are using ColdFusion's development server config installation using port 8500, and not a JRun instance.

Select Is Local from the options and enter the development port number 8500.

Since you are not using a J2EE instance, skip to the Other Settings options and enter your RDS username and password. The RDS security permissions can be set within the ColdFusion administrator under the Security > RDS menu option. Move to the next screen.

Enter the Server Home path: (Note: these are the paths for installation. Your default paths may be different if you installed ColdFusion 9 with custom settings).

Typical path on Mac OS X: /Applications/ColdFusion9

Typical path on Windows: C:\ColdFusion9

Enter the Document Root path: (note: these are the paths for my installation. Your default paths may be different if you installed ColdFusion 9 with custom settings)

OS X: /Applications/ColdFusion9/wwwroot

Windows: C:\Coldfusion9\wwwroot

Click Finish to save the server information

Quick access to the administrator and server monitor

ColdFusion Builder can now access the local ColdFusion development server. This opens up a level of control and improved workflow that wasn’t available in Dreamweaver.

A superb example of the benefits of having tight integration is the ability to open up the ColdFusion Administrator and Server Monitoring tool directly within the IDE itself. No need to waste extra clicks and time opening up a browser to navigate there yourself. Thanks to ColdFusion Builder, you are now able to instantly open up the Administrator or Server Monitor with two clicks of the mouse.

Right-click any server listed in the server panel to display a context menu as seen in Figure 2 (above). If you are using a JRun server instance, you can also to easily start/stop and restart the server from here. Selecting Launch ColdFusion Administrator option, the IDE will expand a new pane, inside of which the Administrator screen displays. There is no need for external browsers; you control all of it from within the IDE, thereby saving you time if you need to change settings, turn on debugging, or check data source references, for example.

Figure 3. Viewing and managing the ColdFusion Administrator directly with ColdFusion Builder is a massive timesaver and will help to increase productivity.

What does ColdFusion Builder do like no other?

IDEs and coding utilities share many common features and functions, typically those required as standard to make it a usable application to help the developer deliver applications and to assist in the development life cycle.

ColdFusion Builder shares many of these common features, which you would expect from any professional IDE, namely:

Code Assist

Snippets

Tag Wizard

Database Tools

Support for Remote Projects (including FTP integration)

There are, however, many extra features available as standard in ColdFusion Builder that exist only in ColdFusion Builder at this particular moment in time, and it is these extra features that truly define ColdFusion Builder as the IDE for any serious hardcore CFML developers.

Code Insight

Most, if not all IDEs, have code assist as a feature—this is the ability to assist the developer when writing tags and functions by hinting any attributes, arguments and parameters, as well as hints on functionality and purpose.

This feature is an incredibly useful tool to aid with development. However, for most IDEs that is where the integration with the code and syntax ends; reading from the pre-determined library of tags and functions. ColdFusion Builder takes this one step further, and is the only CFML editor to offer you the benefit of Code Insight.

Code Insight is an incredibly impressive addition to the IDE, and certainly helps to improve productivity and provides valuable assistance to the developer. Code Insight is instantly visible when instantiating a ColdFusion component (CFC) in your code. After typing the name of the new object in the editor, for example objFacade., a dialog box will appear that lists all non-private methods within the component, complete with the method’s arguments, as seen in Figure 4 (below).

Figure 4. Code Insight at work. Here, it displays all non-private methods available within the referenced component.

Code Insight also extends itself to reading variables from a specific scope. For example, when you type session. or application., Code Insight will once again display the dialog containing all available variables within those scopes. Inevitably, this seemingly small but obviously powerful functionality helps to improve productivity and to streamline the way the developer works to obtain data by helping to put as much information at your fingertips as possible.

SQL Code Insight

ColdFusion Builder really steps into action here to assist with SQL queries and database interactions through the RDS services. You now have quick access to the SQL Editor from a context-menu option, which is a very powerful tool with the ability to assist with table names, columns within tables and SQL syntax.

To open the SQL Editor window, simply right-click within the open Editor/Code window, and select SQL Editor from the context menu.

You can run the query and test it so that it returns data within the same dialog window. Once the required statement has been written, the editor will place the completed SQL into the open page within the editor.

The SQL Code Insight will also kick into action if you are typing your SQL statement between a <cfquery> tag block, assuming your RDS access was specified when setting up your server connections within ColdFusion Builder.

Code Refactoring

Refactoring, or the ability to successfully rename files, functions and methods throughout an entire project or application without damaging or breaking the underlying code and functions, is not only a mouthful, but also a highly important part of code management.

Guess what? ColdFusion Builder has refactoring built-in as a standard feature. This allows you to quickly and easily rename variables, methods, and file names throughout your project or application.

With this feature you also get the benefit of a clear visual list of all changes that will be made, and which files will be affected as seen in Figure 6 (above). You can now safely alter method names across the board without the worry of find/replace messing up your code.

CFML debugging

How many times as a ColdFusion developer have you had to test applications? If you said none, you’re either a genius or you’re fibbing. It’s something we’ve all done and do; debugging is an important part of the development life cycle. ColdFusion Builder makes debugging your CFML applications even easier thanks to the built-in debugging perspective.

The CFML Debugger allows you to watch and evaluate variables and expressions line by line as they are being run. You can easily step into code, including included files, or templates, as well as components and the contained methods, which gives you a greater level of control and understanding over what’s happening in your code as it executes. Setting breakpoints periodically throughout the code also lets you track down any problem areas of code.

This comes as standard with ColdFusion Builder and is another perfect example of how the IDE has been fine-tuned for CFML developers, and how ultimately it can increase your productivity and optimise your performance as a coder.

Secure FTP

As a development interface, it is important to include FTP functionality, especially to interact with remote servers for whichever reason.

ColdFusion not only supports standard FTP access, but also SFTP (Secure File Transfer Protocol) and FTPS (File Transfer Protocol Secure), both of which are a secure variation of the standard FTP service, encrypting any files transferred to and from the server.

Extensible through CFML

Most IDEs on the market are filled with a certain amount of features and tools/toolbars to assist the developer in their day-to-day development. What if you wanted to extend the functionality available within your IDE? Perhaps you want to create a custom function that checked your code for you or generated code on your behalf in a few clicks. Dreamweaver’s API allowed developers and users to extend it’s functionality using JavaScript. While this was an excellent solution, it might not have been ideal to any user who was not comfortable with JavaScript as a language.

One of the most exciting new features in ColdFusion Builder is the ability to extend the IDE using CFML. It makes sense—it’s an application aimed primarily at CFML developers, and so the ability to create custom extensions and enhanced functionality in their native language is not only empowering, but opens up the doors for a plethora of extensions and plug-ins to install into the application.

Indeed, at this time of writing, there are a total of 39 ColdFusion Builder extensions on riaforge.org alone, all of which are free, open-source extensions written by other developers for distribution amongst the community.

Some of the fantastic extensions available to download include:

Framework Utilities (ColdBox, Model Glue, F/W1)

varScoper (helps ensure that you have correctly scoped all variables)

Lorem Ipsum Text Generator (easily generates dummy text)

ExtensionBuilder (helps you build extensions)

Benefits of using an Eclipse-based platform

As mentioned at earlier on in this article, ColdFusion Builder is based upon the open-source Eclipse IDE, which itself offers many features that will increase your productivity as a developer.

Version control and tracking file differences

Eclipse-based platforms offer an incredibly useful tool in the form of local history and file comparison. Perhaps you have been working on a particular file and need to refer back to the original version of the file to check code compatibility or to ensure nothing was accidentally deleted.

Simply right-click your file in the IDE, go to the Project or File view, and select Compare With > Local History and select the automatically-saved version to compare against, the results of which are shown in Figure 7 (below).

Figure 7. Comparing code with a version from the local history, directly within the ColdFusion Builder workspace.

Importing an existing project into ColdFusion Builder

So, you’ve been developing your ColdFusion project in Dreamweaver and want to move over to use ColdFusion Builder. Importing an existing project into ColdFusion Builder is incredibly easy, and ensures that your project contents are available within your new development environment, ready for you to continue developing world-class applications.

Open the Import wizard. This is accessible from the main menu by going to File > Import or by right-clicking within either the Project or Navigator panels and selecting Import from the context menu.

Expand the ”Other” directory in the list and select “Existing Folder As New Project” and click Next to proceed.

Figure 8. Opening an existing folder as a new project.

Browse to the location of the folder containing the project and select the root directory. Provide a more meaningful project name if you wish, and click Finish.

Figure 9. Specifying the location of the folder and the root directory. Rename the project, as you wish.

At this moment, the project has been imported into ColdFusion Builder, but it contains no properties or references of a ColdFusion project. Right-click on the project folder and select Properties to display the dialog window. From here, you can see there is no reference to ColdFusion in the left-hand menu. Close the properties window.

Figure 10. Properties have not yet been set for the new ColdFusion project.

Right-click the project folder once again and select “Apply CF Nature.” The icon for the folder in the Project panel should change to display the initials “CF” to confirm that the nature has been applied to the project.

Figure 11. Applying CF Nature.

Right-click the project folder once more and select Properties again. You can now see the ColdFusion options in the left-hand menu. Select “ColdFusion Server Settings” and either add a new server or select an existing server to apply to this project. Click Apply to save any changes.

Figure 12. Properties for the project now show “ColdFusion Server Settings.”

Your ColdFusion project has now been imported into ColdFusion Builder and you are all set to continue your development within your new IDE.

Where to go from here

There are many more features and functions available within ColdFusion Builder that are beyond the scope of this article. Otherwise you would be reading a 75-page document outlining each and every one, for they all deserve attention for their own merits and benefits.

The bottom line is this: I used to be a Dreamweaver user. The application is superb at what it does, and it served me well for many years. I still use it occasionally when working on non-CFML projects, but the key words here are “used to.” I switched over to ColdFusion Builder at the time of the ColdFusion beta releases, and have seen the IDE develop into an even greater tool for ColdFusion developers up to the point of the initial public release. I haven’t looked back since. It contains everything I need on a daily basis, plus much more I have yet had a chance or excuse to experiment with.

If the core of your work revolves around DOM manipulation and developing sites or applications that require you to have an IDE with more of a focus on visual editing and graphical elements, Dreamweaver is still the tool for you. If, however, you are a ColdFusion developer who deals with CFML code and database interactions on a daily basis and minimal to no requirement for WYSIWIG editing, then ColdFusion Builder is certainly the right tool for you.

The sheer amount of functionality available and the ability and the control it gives you over not only the CFML code but also SQL, databases through the RDS, extending the IDE itself and controlling the servers means that ColdFusion Builder really provides a CFML developer with the correct tools to maximize their development time, and enhance productivity and performance. Take the next step and try out ColdFusion Builder (the trial version). The only way to discover the benefits is to try it and experience the effects for yourself.