This article, the second of two parts, explains how to use ColdFusion 6.1 in conjunction with Dreamweaver MX 2004 to build dynamic web sites. It is excerpted from chapter one of the book ColdFusion Web Development with Dreamweaver MX 2004, written by Jen and Peter deHaan et al. (Apress, 2004; ISBN: 1590592379).
Welcome to Coldfusion MX 6.1, concluded - Setting Up a Site in Dreamweaver MX 2004 (Page 4 of 5 )
Dreamweaver MX 2004 is the recommended IDE for developing CFML applications, and it does everything in the context of a site. Fortunately, setting up a ColdFusion MX 6.1–based site in Dreamweaver MX 2004 is extremely easy. Follow the simple steps listed here, and you will be ready to start developing your web site. Because we required only the basic features for setting up my site, and the site definition wizard nicely steps through each required piece of information, we use it in the following section. If you need any additional features, simply click on the Advanced tab at any time and enter your custom settings along with the following ones.
In Dreamweaver MX 2004, open the Files panel and select the Site tab. In the site menu at the top, click Manage Sites->New->Site, and the site definition wizard dialog box will open. If the Basic tab is not already selected at the top of your screen, select it.
You must give your site a name (Figure 1-1). For the purpose of this example, call it “cfbook” and click Next. (This name needs to be a unique identifier for Dreamweaver MX 2004.)
Figure 1-1. Enter the name of your site into this box.
You want to use a server technology to build your web site, so make sure the “Yes, I want to use a server technology” option is selected here. For the server technology, select ColdFusion from the drop-down menu as shown in Figure 1-2. Click on the Next button.
Figure 1-2. Select ColdFusion as the server technology you want to use.
You will be working with your files locally during development, so in the Editing Files, Part 3 section of the Site Definition dialog box, choose the first option and enter the path to a folder to store your ColdFusion MX 6.1 files in (see Figure 1-3). If you want or need to edit your files on a remote server (or edit them locally then upload them) using FTP, enter the location of the remote server at this point.
Here, you will be using the default location specified by Dreamweaver MX 2004. This will be the install location of ColdFusion MX 6.1, typicallyC:\CFusionMX. The Web-root directory for ColdFusion MX 6.1 iswwwroot—within this, create a new folder for this site. You will probably want to use the site name, but this can be changed by using the browse button (the folder icon to the right) or by typing in a new name. When finished, press the Next button.
Figure 1-3. Choose where to edit and store files.
For the Testing Files section of the Site Definition dialog box, enter your local testing server and the root folder for this particular site. If using the standalone server, enter a URL similar to the following:http://localhost:8500/cfbook. If you are unsure, click on the Test URL button, which checks whether you are using a valid address. As long as ColdFusion MX 6.1 is running and you are targeting a valid server, you will be presented with a message that says “The URL Prefix test was successful” as seen in Figure 1-4. If you get an error message, make sure your server is running and that you are using the correct port number. If you were running a server such as IIS, your URL would behttp://localhost/cfbook. If you were using a remote server running ColdFusion MX 6.1, this would be the location provided by the company hosting your site. When finished, click Next.
Figure 1-4. Successful URL prefix dialog
Finally, in the Site Definition dialog box, select the No radio button if you do not want to upload your files to another machine (see Figure 1-5).
We will not be using this feature in this book. However, you may want to use this for testing if your ColdFusion MX 6.1 server is on another machine or on your hosting provider’s server. Click the Next button.
Figure 1-5. If you are not using a remote server, click the No option.
When finished, you will see a summary screen showing all your settings. To further configure these settings, select the Advanced tab at this time and make the desired modifications. Otherwise, click on the Done button.
Now you are back in Dreamweaver MX 2004, and you should notice a few changes in the authoring environment. First, there are certain additions specific to ColdFusion MX 6.1 in the Application panel group (Database, Bindings, Server Behaviors, and Components). You can define RDS logins (the RDS password is the one you defined earlier during installation), create data sources, and select Recordsets using these new features. The Insert bar now has tabs for CFML (and are labeled appropriately).