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 (Page 1 of 5 )
The ColdFusion MX 6.1 Administrator
ColdFusion MX 6.1 settings are defined in two places: the Web-based ColdFusion MX 6.1 Administrator (also known as the Admin), and within XML files in the ColdFusion MX 6.1 program directory.
Most of the changes youíll ever need to make can be done through the ColdFusion MX 6.1 Administrator, found athttp://localhost:8500/CFIDE/administrator/if you are using ColdFusion MX 6.1ís built-in web server by default. If using IIS, Apache, or have configured ColdFusion MX 6.1 to respond to a different port, then you must modify the port (and any other URLs in this book) accordingly. We assume that you are running the server on port 8500.
When you first connect to the Administrator, it will provide you with a login screen. This is where you enter your ColdFusion MX 6.1 Administrator password (which you selected while installing the ColdFusion MX 6.1 Server). Enter the password and click on the Login button. You will be taken to the administration homepage.
The Administrator has five major sections down the left side of the interface:
Data & Services
Debugging & Logging
All these sections have areas of their own you must consider while working with this tool. We describe all these areas next. However, we provide only a brief overview of Extensions and Security, two highly advanced areas of ColdFusion MX 6.1 development beyond the scope of this book.
The Server Settings area has ten different areas (nine if youíre using the J2EE version) primarily used to control server-wide settings, such as enabling and disabling certain variable scopes, and mail server and caching settings.
These are general server settings that control behavior and performance. You can set the number of seconds that a user request is allowed to run before it times out (if at all), and also limit the number of simultaneous requests a user can run. You can define which template will be called if ColdFusion MX 6.1 cannot find the requested template, and can also specify which template is called if an error occurs and is not handled in the ColdFusion MX 6.1 code. We cover error handling in detail in Chapter 8.
This is where you define how many ColdFusion MX 6.1 templates (.cfmfiles) and database queries can be cached in the server memory at one time. You can also specify if the server should check whether the file currently being served by ColdFusion MX 6.1 is the most recent version of the file. This last setting, called Trusted Cache, is an option you would enable only if your files never changed after you upload them to the server.
When ColdFusion MX 6.1 runs a template for the first time, it compiles the template into a.classfile and caches the file on the server. The next time the file is requested, ColdFusion MX 6.1 checks whether the requested file is newer then the one in the cache; if so, it recompiles the template and returns it to the visitor. If the file in the cache is the latest version, then the file is returned immediately to the visitor, and ColdFusion MX 6.1 doesnít need to recompile the file. This enables ColdFusion MX 6.1 to recompile files only when they have changed, greatly improving server performance.
ColdFusion MX 6.1 allows you to store persistent data for users. At a shopping site, for example, if a user were to leave the site and return later, you could save the contents of the visitorís shopping cart. ColdFusion MX 6.1 does this by issuing the visitor a unique key and storing the visitorís data in a database, cookie, or the system registry. This section is where you define which databases should store the persistent data, how long it is stored before being purged from the database, and whether ColdFusion MX 6.1 should store the data in the registry, in cookies, or in a particular database by default. We cover client variables in detail in Chapter 7.
ColdFusion MX 6.1 also allows developers to store data in server memory instead of saving it as session variables in a database, cookie, or registry. Memory variables and persistent data are covered in Chapter 7.
ColdFusion MX 6.1 mappings are aliases to directories, even those outside the Web-root, and are similar to the virtual directories that you would define in your web server. We mainly use them when creating custom tags in ColdFusion MX 6.1 or include files. Instead of including a file by specifying the path ../../includes/header.cfm, you could create a mapping named SiteA that points to the root of the SiteA.com web site. Then you could include this file in the following way:/SiteA/includes/header.cfm. This mapping will work no matter how deeplyheader.cfmis located within the siteís directory structure.
How to include external files by using the<cfinclude>tag is covered in Chapter 10.
This is where you enter your mail server settings into ColdFusion MX 6.1; this enables us to use the<cfmail>tag to send e-mails through ColdFusion MX 6.1. We cover<cfmail>in Chapter 5.
ColdFusion MX 6.1 lets you dynamically create bar charts, pie charts, line graphs, and several other types of charts in two or three dimensions. This is where you specify whether to cache charts to the hard drive or the server memory. You also choose where to save any charts that are cached to the disk, and also the maximum number of charts in either cache. You can also specify the maximum number of thread requests (between one and five) that can be processed at the same time.
Java and JVM
This is where you define settings relating to the JVM by specifying the location where the JVM is installed, and any initialization arguments that you need to pass to the JVM. Typically, you donít ever need to change these settings. You can specify any additional class paths for the JVM that are sometimes needed when adding Java custom tags. Note that in the J2EE version of ColdFusion MX 6.1, this section is omitted (the J2EE application server settings are used instead).
Archives and Deployment
ColdFusion MX 6.1 allows you to save your web serverís (or a specific applicationís) configuration information to an archive and migrate the archive to a different computer, or back up the archive and restore it later on the current machine.
This is just a report of the current configuration. The page makes it easy for you to see all your configuration settings in one place and print a record. You can also click on the different sections of the report, which takes you to the corresponding page in the Administrator.