ColdFusion Application Development Environment


ColdFusion Studio, which is now bundled with Macromedia's Dreamweaver MX, is recommended for developing ColdFusion applications. A ColdFusion application is essentially a collection of pages. Unlike the pages in a static Web site, the pages in a ColdFusion application can contain both HTML and CFML. However, a page might not have HTML depending on the function of the page. When ColdFusion pages are requested, CFML tags are processed on the server. An HTML page is generated dynamically and returned to the browser.

With the code-editing features of ColdFusion Studio combined with the visual design features of Dreamweaver, Dreamweaver MX is the preferred development environment for building ColdFusion MX applications. It supports the latest ColdFusion MX features and tags. It also includes Macromedia HomeSite+, which combines all the features of ColdFusion Studio and HomeSite 5, along with support for the latest ColdFusion MX tags.

With Dreamweaver MX or HomeSite+, you can author and test your application code. These tools also allow you to save your code directly to the server where ColdFusion is installed.

The following sections provide an overview of Dreamweaver MX. They also explain how to integrate Dreamweaver MX into your ColdFusion development.

As a ColdFusion developer, you can build ColdFusion MX applications by writing the code manually, or you can generate it using one of the code-generating tools provided with Dreamweaver MX.

Dreamweaver has an editor that allows you to create and open files, write your code, and save files. Dreamweaver MX is covered in more detail in Appendix D, Using Dreamweaver MX." These features of Dreamweaver are useful for ColdFusion developers:

  • Multiple interfaces. Dreamweaver provides multiple-document interface and integrated project management. You can open and save files over an Internet connection (using HTTP or FTP). A remote ColdFusion server connection allows you to browse remote data sources and files.

  • User-friendly. Dreamweaver has menus and toolbars that provide shortcuts to the most common tags and functions.

  • Easy coding management. Dreamweaver provides edit dialog boxes for most HTML and CFML tags and automatic tag completion. You can also create dialog boxes for your own tags. Code hints help you write CFML tag attributes and pop-up help for all HTML and CFML tags. An integrated debugging display quickly pinpoints problems in the code. A code validator ensures code readiness against other ColdFusion versions.

  • Editing. Dreamweaver offers drag-and-drop editing and context-sensitive right-click options.

  • Designing. Dreamweaver's design mode simplifies the creation of HTML elements, such as tables. A built-in HTML validation facility is also available.

  • Image viewer. Dreamweaver provides an integrated image and thumbnail viewer.

  • Expression builder. Dreamweaver offers built-in expression and SQL query builders.

Before using Dreamweaver MX to create applications, you must configure it to recognize data sources. For example, if you want to build and use a site containing tutorials on ColdFusion, you should create a site that contains those tutorials.

Establishing a connection to the ColdFusion Server is a prerequisite for accessing ColdFusion data sources. To use HomeSite+ for ColdFusion development, establish a secure connection to the ColdFusion Server environment where the tutorial files are installed. You also need to enable internal browsing to view and process the ColdFusion application files. The Resource Area in the HomeSite + window allows you to view and access the tutorial files. Alternatively, you can set up a project to manage the files more efficiently.

Viewing ColdFusion Data Sources in the Workspace

Dreamweaver MX displays this information in the workspace:

  • The ColdFusion data sources as defined in ColdFusion Administrator.

  • The structure of the data sources, including the names of the tables, columns, views, and stored procedures.

  • The datatypes of each column and the primary key of each table.

  • The data stored in the database tables.

Define a ColdFusion testing server for the current site to enable the information display feature to work. Dreamweaver also uses this testing server. See the Dreamweaver documentation for information on the testing server.

To display the database structure:

  1. Define a ColdFusion testing server for the current site.

  2. Choose Window, Databases to open the Databases panel. Dreamweaver populates the panel with all the databases for which data sources have been defined.

  3. Click plus (+) to display the tables, stored procedures, and views in the database.

  4. Click a table name to display the columns in the table.

You can change or add data sources by accessing ColdFusion Administrator through Dreamweaver MX. Click Modify Data Source on the Databases panel to gain access to the ColdFusion Administrator.

The ColdFusion server provides debugging information about the ColdFusion pages in your application. Set the debugging option in ColdFusion Administrator to generate a report at the end of each page. This information details variable values, error information, and execution time.

You can use Dreamweaver MX to view the debugging information without going to ColdFusion Administrator.

To display the debugging information in Dreamweaver MX:

  1. Ensure that debugging is enabled in ColdFusion Administrator.

  2. Click Server Debug on the document toolbar. The ColdFusion page should be open in Dreamweaver MX. Alternately, choose View, Server Debug.

  3. Dreamweaver MX requests the file from the ColdFusion MX server and displays it. Error messages appear at the bottom of the page. The Server Debug panel provides information about the pages processed by the server, all the SQL queries executed on the page, and the execution time.

  4. If an Exceptions category appears on the screen, click plus (+) to expand it and find out the details of the problem. An Exceptions category is displayed when the server encounters a problem with the page.

  5. Usually, Dreamweaver MX opens the page with the problem lines highlighted. If it cannot locate the page, click on the URL of the page to open it and fix the code.

  6. Debug the code, save the file, and click Browse. Dreamweaver MX displays the page in the internal browser again. The Exceptions category doesn't appear on the panel if there are no more errors on the page.

  7. Leave the Server Debug mode and switch to either Code view or Design view.

Caution

The debug information needs to be refreshed every time a page is displayed. Set the page to refresh every time a newer version of the file is generated.

Dreamweaver MX also supports CFML. You can create and edit ColdFusion database components within Dreamweaver MX. Code view allows you to edit and manage ColdFusion files, objects, and code. Design view allows you to use the ColdFusion library by including functions and dynamic elements on the page.

Dreamweaver MX also has a complete set of form templates for database interfaces. These include button sets and dynamic drop-down lists, which can be dropped onto the page, reused and changed, and attached to a ColdFusion back end.

You can also use Dreamweaver MX outside the ColdFusion environment. It has tag support, debuggers, and template sets for common database elements in JSP/J2EE, ASP.NET, and PHP/MySQL server environments.




Macromedia ColdFusion MX. Professional Projects
ColdFusion MX Professional Projects
ISBN: 1592000126
EAN: 2147483647
Year: 2002
Pages: 200

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net