macromedia® Coldfusion® MX 7 Web Application Construction Kit

Book description

With more than 75 of the Fortune 100 companies using it (and more than 10,000 organizations employing it worldwide), it’s pretty much a given that if you’re developing applications for the Web, you’re going to need to know ColdFusion at some point! Not to worry: Macromedia ColdFusion MX 7 Web Application Construction Kit provides everything you need to start creating Web-based applications immediately—including the latest version of the ColdFusion Web Application Server and development environment. Author and ColdFusion master Ben Forta starts by covering the fundamentals of Web-based database design and then proceeds to show you how to do everything from create data-driven pages to build complete applications, implement security mechanisms, integrate with e-mail, interact with Macromedia Flash, and more. From design and installation to application deployment and troubleshooting, this guide’s got ColdFusion covered, including all the features new to the latest version: structured business reports, rich forms, Enterprise Manager (which lets users cluster multiple ColdFusion servers on a single machine), and more!

Table of contents

  1. Copyright
    1. DEDICATION
  2. About the Author
  3. Acknowledgments
  4. Introduction
    1. Who Should Use This Book
    2. How to Use This Book
      1. Part I—Getting Started
      2. Part II—Using ColdFusion
      3. Part III—Building ColdFusion Applications
      4. Part IV—Advanced ColdFusion
      5. Part V—Appendixes
      6. The CD-ROM
  5. 1. Getting Started
    1. 1. Introducing ColdFusion
      1. The Basics
        1. The Internet
        2. Internet Applications
        3. DNS
        4. Intranets, Extranets, and Portals
        5. Web Servers
        6. Web Pages
        7. Web Browsers
          1. HTML
          2. JavaScript
          3. Other Client Technologies
        8. URLs
        9. Hosts and Virtual Hosts
      2. Understanding ColdFusion
        1. The Dynamic Page Advantage
        2. Understanding Web Applications
        3. What Is ColdFusion?
        4. ColdFusion and Your Intranet, Extranet, and Portal
      3. ColdFusion Explained
        1. The ColdFusion Application Server
        2. The ColdFusion Markup Language
        3. Linking to External Applications
        4. Extending ColdFusion
        5. Beyond the Web
        6. Inside ColdFusion MX 7
      4. Powered by ColdFusion
    2. 2. Introducing Macromedia Dreamweaver MX 2004
      1. Dreamweaver MX 2004 Overview
      2. Preparing to Use Dreamweaver
        1. Creating the Application Root
        2. Starting Dreamweaver for the First Time
      3. Site Definitions
        1. Creating the Site
        2. About the Advanced Site Definition Dialog
      4. Working with Files
        1. Creating a Work Directory and File
        2. Saving, Closing, and Opening Files
        3. Testing the Page
      5. The Dreamweaver Workspace
        1. The Files Panel
        2. The Document Window
          1. Managing Multiple Documents
      6. Managing Panels
      7. Code Editing
        1. Code Hints and Tag Completion
        2. The Code Panel Group
          1. The Snippets Panel
          2. The Reference Panel
        3. The Application Panel Group
          1. The Databases panel
          2. The Bindings panel
          3. The Server Behaviors panel
          4. The Components panel
      8. Design Tools
        1. The Design Panel Group
          1. The CSS Panel
          2. The Layers Panel
        2. The Insert Bar
          1. Common
          2. Layout
          3. Forms
          4. Text
          5. HTML
          6. CFML
          7. CFFORM
          8. Application
          9. Flash Elements
          10. Favorites
        3. The Property Inspector
      9. Customizing Dreamweaver
        1. Commands
        2. Keyboard Shortcuts
        3. Extensions
        4. Preferences
      10. Getting Help
        1. The Macromedia Forums
    3. 3. Accessing the ColdFusion Administrator
      1. Logging Into (and Out of) the ColdFusion Administrator
      2. Using the ColdFusion Administrator
        1. Creating a Data Source
        2. Defining a Mail Server
        3. Enabling Debugging
        4. Viewing Settings
    4. 4. Previewing ColdFusion
      1. Preparing to Learn ColdFusion
      2. Using Dreamweaver Code Generation
        1. Preparing to Create an Application
          1. Creating a Work Directory and File
          2. Saving, Closing, and Opening Files
          3. Testing the Page
        2. Creating an Application in Dreamweaver
          1. Creating a Recordset
          2. Displaying Dynamic Data
          3. Displaying Multiple Rows
          4. Implementing Page Navigation
      3. Trying It Yourself
      4. Browsing the Examples and Tutorials
    5. 5. Building the Databases
      1. Database Fundamentals
        1. Databases: A Definition
        2. Where Are Databases Used?
        3. Clarification of Database-Related Terms
        4. Data Types
      2. Using a Database
        1. A Database Primer
      3. Understanding Relational Databases
        1. Primary and Foreign Keys
        2. Different Kinds of Relationships
        3. Multi-Table Relationships
        4. Indexes
        5. Using Indexes
        6. Indexing on More than One Column
      4. Understanding the Various Types of Database Applications
        1. Shared-File–Based Databases
        2. Client/Server–Based Databases
        3. Which Database Product to Use
      5. Understanding the OWS Database Tables
        1. The Films Table
        2. The Expenses Table
        3. The Directors Table
        4. The FilmsDirectors Table
        5. The Actors Table
        6. The FilmsActors Table
        7. The FilmsRatings Table
        8. The UserRoles Table
        9. The Contacts Table
        10. The Merchandise Table
        11. The MerchandiseOrders Table
        12. The MerchandiseOrdersItems Table
    6. 6. Introducing SQL
      1. Understanding Data Sources
      2. Creating A Data Source
        1. Creating a Data Source From Within Dreamweaver
        2. Creating a Data Source Using The ColdFusion Administrator
      3. Preparing to Write SQL Queries
      4. Creating Queries
      5. Sorting Query Results
      6. Filtering Data
        1. Filtering on a Single Column
        2. Filtering on Multiple Columns
        3. The AND and OR Operators
        4. Evaluation Precedence
        5. WHERE Conditions
          1. Testing for Equality: =
          2. Testing for Inequality: <>
          3. Testing for Less Than: <
          4. Testing for Less Than or Equal To: <=
          5. Testing for Greater Than: >
          6. Testing for Greater Than or Equal To: >=
          7. BETWEEN
          8. EXISTS
          9. IN
          10. IS NULL and IS NOT NULL
          11. LIKE
    7. 7. SQL Data Manipulation
      1. Adding Data
        1. Using the INSERT Statement
        2. Understanding INSERT
      2. Modifying Data
        1. Understanding UPDATE
        2. Making Global Updates
      3. Deleting Data
  6. 2. Using ColdFusion
    1. 8. Using ColdFusion
      1. Working with Templates
        1. Creating Templates
        2. Saving Templates
        3. Executing Templates
        4. Templates Explained
      2. Using Functions
      3. Using Variables
        1. Variable Naming
        2. Using Prefixes
      4. Working with Expressions
        1. Building Expressions
        2. When To Use #, and When Not To
      5. Using ColdFusion Data Types
        1. Lists
        2. Arrays
        3. Structures
        4. “Dumping” Expressions
      6. Commenting Your Code
    2. 9. CFML Basics
      1. Working with Conditional Processing
      2. If Statements
        1. Basic If Statements
        2. Multi-condition If Statements
        3. If and Else
        4. Multiple If Statements
        5. Putting It All Together
        6. Switch Statements
      3. Using Looping
        1. The Index Loop
        2. The List Loop
        3. Nested Loops
      4. Reusing Code
      5. Revisiting Variables
    3. 10. Creating Data-Driven Pages
      1. Accessing Databases
        1. Static Web Pages
        2. Dynamic Web Pages
        3. Understanding Data-Driven Templates
          1. The <cfquery> Tag
          2. Using <cfoutput> to Display <cfquery> Data
          3. Using Table Columns
        4. The Dynamic Advantage
      2. Displaying Database Query Results
        1. Displaying Data Using Lists
        2. Displaying Data Using Tables
      3. Using Query Variables
      4. Grouping Result Output
      5. Using Data Drill-Down
        1. Introducing Dynamic SQL
        2. Implementing Data Drill-Down Interfaces
        3. Displaying Data Using Frames
      6. Debugging Dynamic Database Queries
    4. 11. The Basics of Structured Development
      1. Understanding Structured Development
        1. Single-Tier Applications
        2. Multi-Tier Applications
      2. Introducing ColdFusion Components
        1. Creating Your First CFC
          1. The <cfcomponent> Tag
          2. The <cffunction> Tag
          3. The <cfreturn> Tag
          4. The <cfargument> Tag
        2. Using ColdFusion Components
        3. Using Dreamweaver CFC Support
          1. Simplified CFC Method Invocation
          2. Wizard-Based CFC Creation
          3. Using CFCs as Recordsets
      3. More On Using ColdFusion Components
        1. Where to Save CFCs
        2. Unit Testing
        3. Documenting ColdFusion Components
    5. 12. ColdFusion Forms
      1. Using Forms
      2. Creating Forms
        1. Using HTML Form Tags
        2. Form Submission Error Messages
      3. Processing Form Submissions
        1. Processing Text Submissions
        2. Processing Check Boxes and Radio Buttons
        3. Processing List Boxes
        4. Processing Text Areas
        5. Processing Buttons
      4. Creating Dynamic SQL Statements
      5. Building Truly Dynamic Statements
        1. Understanding Dynamic SQL
        2. Concatenating SQL Clauses
      6. Creating Dynamic Search Screens
    6. 13. Form Data Validation
      1. Understanding Form Validation
        1. Comparing Server-Side and Client-Side Validation
        2. Pros and Cons of Each Option
      2. Using Server-Side Validation
        1. Using Manual Server-Side Validation
        2. Using <cfparam> Server-Side Validation
        3. Using Automatic Server-Side Validation
      3. Using Client-Side Validation
        1. Understanding Client-Side Validation
        2. Client-Side Validation Via <cfform>
        3. Extending <cfinput> Validation Options
        4. Specifying An Input Mask
        5. Validating On The Server And Client
        6. Preventing Multiple Form Submissions
      4. Putting It All Together
    7. 14. Using Forms to Add or Change Data
      1. Adding Data with ColdFusion
        1. Creating an Add Record Form
        2. Processing Additions
      2. Introducing <cfinsert>
        1. Controlling <cfinsert> Form Fields
        2. Collecting Data for More Than One INSERT
        3. <cfinsert> Versus SQL INSERT
      3. Updating Data with ColdFusion
        1. Building a Data Update Form
        2. Processing Updates
      4. Introducing <cfupdate>
        1. <cfupdate> Versus SQL UPDATE
      5. Deleting Data with ColdFusion
      6. Reusing Forms
      7. Creating a Complete Application
    8. 15. Beyond HTML Forms: Flash and XForms
      1. Using Flash Forms
        1. A Brief Introduction to Flash
        2. Introducing Flash Forms
        3. Getting Started With Flash Forms
        4. Flash Forms Controls
        5. Managing Form Layout
        6. Controlling Form Appearance
        7. Using Data Bindings
      2. Using XForms
        1. Understanding XForms
        2. Barriers to XForms Adoption
        3. ColdFusion and XForms
        4. Where Do XSL Files Go?
    9. 16. Graphing, Printing, and Reporting
      1. Generating Graphs
        1. Building Simple Charts
          1. Introducing <cfchart> and <cfchartseries>
          2. Creating Your First Chart
          3. Changing the Chart Type
        2. Formatting Your Charts
          1. Adding Depth with 3D Charts
          2. Controlling Fonts and Colors
          3. Controlling Grid Lines and Axis Labels
        3. Using Multiple Data Series
          1. Combining Multiple Chart Series
          2. Combining Series of Different Types
        4. Drilling Down from Charts
          1. Creating a Clickable Chart
          2. Creating the Detail Page
          3. Drilling Down to another Chart
        5. Additional Charting Topics
          1. Plotting Individual Points with <cfchartdata>
          2. Using Charts with Flash Remoting
          3. Controlling the Chart Cache
      2. Creating Printable Pages
        1. Using the <cfdocument> Tag
          1. What Is Supported by <cfdocument>?
          2. Creating Printable Versions Of Pages
          3. Saving Generated Output
        2. Controlling Output using The <cfdocumentitem> Tag
        3. Defining Sections with <cfdocumentsection>
      3. Generating Reports
        1. Understanding the ColdFusion Report Builder
        2. Using the Setup Wizard
        3. Introducing the ColdFusion Report Builder
        4. Using the Report Wizard
        5. Running Your Reports
        6. Invoking Reports from Within ColdFusion Code
        7. And A Whole Lot More Too
    10. 17. Debugging and Troubleshooting
      1. Troubleshooting ColdFusion Applications
        1. Understanding What Can Go Wrong
        2. Debugging Web Server Configuration Problems
        3. Debugging Data Driver Errors
          1. Receiving the Error Message Data Source Not Found
          2. Receiving the Error Message File Not Found
          3. Receiving Login or Permission Errors When Trying to Access a Data Store
          4. Receiving the Error Message Unknown Table
        4. Debugging SQL Statement or Logic Errors
        5. Debugging ColdFusion Syntax Errors
        6. Inspecting Variable Contents
        7. Using the Document Validator
        8. Debugging URL and Path Problems
          1. Images Are Not Displayed
          2. Passing Parameters That Aren't Processed
        9. Debugging Form Problems
      2. Using the ColdFusion Debugging Options
        1. Classic Debugging
        2. Dockable Debugging
        3. Dreamweaver Debugging
        4. Using Debugging Options
        5. Using Tracing
      3. Using the ColdFusion Log Files
      4. Preventing Problems
  7. 3. Building ColdFusion Applications
    1. 18. Planning an Application
      1. Getting Started on Your Application
        1. Defining the Project
          1. The Importance of Being Inspired
          2. Understanding the Project
          3. Conducting a Few Interviews
          4. Setting Expectations
        2. Knowing the Players
        3. Fact Finding
          1. Looking at Similar Sites
          2. Decide Which Technologies to Use
          3. Investigating Existing Custom Tags, UDFs, and ColdFusion Components
          4. Searching the ColdFusion Forums
          5. Investigating Standard or Third-Party Extensions
      2. Planning the Process
        1. Design Documents
          1. Specification Document
          2. Flowcharts and Storyboards
          3. Milestones Document
        2. Planning the Testing Phase
          1. Who Can Help with Q.A.?
          2. Beta Testing
          3. Tracking Bug Reports
          4. Separate Development Environment
          5. Staging/Production
      3. While You Are Working
        1. Charting Page Flow
        2. Include Files and Custom Tags
        3. Commenting Style
        4. Naming Conventions
        5. Keeping the Directory Structure in Mind
        6. Moving Targets and Feature Creep
    2. 19. Introducing the Web Application Framework
      1. Using Application.cfc
        1. Placement of Application.cfc
        2. Application.cfc Structure
        3. A Basic Application.cfc Template
        4. Using OnRequestEnd()
      2. Using Application Variables
        1. What Are Application Variables?
        2. When to Use Application Variables
        3. Using the Application.cfc Component
        4. Using Application Variables
        5. Initializing Application Variables
        6. Putting Application Variables to Work
      3. Customizing the Look of Error Messages
        1. Introducing the <cferror> Tag
        2. Request vs. Exception Error Templates
        3. Creating a Customized Request Error Page
        4. Additional ERROR Variables
        5. Creating a Customized Exception Error Page
        6. Creating a Customized Validation Error Page
        7. Using the OnError Method
      4. Using Locks to Protect Against Race Conditions
        1. What Is A Race Condition?
        2. <cflock> Tag Syntax
        3. Using Exclusive Locks
        4. Using ReadOnly Locks
        5. Using Named Locks instead of SCOPE
        6. Nested Locks and Deadlocks
        7. Locking with ColdFusion 5 and Earlier
      5. Application Variable Timeouts
        1. Adjusting Timeouts Using APPLICATIONTIMEOUT
        2. Adjusting Timeouts Using the ColdFusion Administrator
        3. Using onRequest()
    3. 20. Working with Sessions
      1. Addressing the Web's Statelessness
        1. The Problem of Maintaining State
        2. Solutions Provided by ColdFusion
          1. Cookies
          2. Client Variables
          3. Session Variables
        3. Choosing Which Type of Variables to Use
      2. Using Cookies to Remember Preferences
        1. Introducing the COOKIE Scope
        2. A Simple Cookie Exercise
        3. Using Cookies
        4. Gaining More Control with <cfcookie>
          1. Introducing the <cfcookie> Tag
          2. Controlling Cookie Expiration
          3. Controlling How Cookies Are Shared
        5. Sharing Cookies with Other Applications
        6. Cookie Limitation
      3. Using Client Variables
        1. How Do Client Variables Work?
        2. Enabling Client Variables
        3. Using Client Variables
          1. Remembering Values for Next Time
          2. Using Several Client Variables Together
        4. Deleting Client Variables
        5. Adjusting How Client Variables Are Stored
          1. Adjusting How Long Client Variables Are Kept
          2. Storing Client Variables in a Database
          3. Sharing Client Variables Between Servers
          4. Backing Up Your Server's Client Variables
          5. Storing Client Variables As a Cookie
        6. Using Client Variables Without Requiring Cookies
        7. Storing Complex Data Types in Client Variables
      4. Using Session Variables
        1. What Are Session Variables?
        2. Enabling Session Variables
        3. Using Session Variables
        4. Using Session Variables for Multiple-Page Data Entry
          1. Maintaining Structures in the SESSION Scope
          2. Putting It All Together
          3. Deleting Session Variables
        5. When Does a Session End?
          1. J2EE Session Variables and ColdFusion MX
          2. Default Behavior
          3. Adjusting the Session Time-out Period
          4. Expiring a Session Programmatically
          5. Ending the Session when the Browser Closes
        6. Using Session Variables without Requiring Cookies
        7. Other Examples of Session Variables
      5. Locking Revisited
        1. Sessions and the <cflock> Tag
          1. Exclusive vs. Read-Only Locks
          2. Scoped vs. Named Locks
      6. Working with onSessionStart and onSessionEnd
    4. 21. Securing Your Applications
      1. Options for Securing Your Application
        1. SSL Encryption
        2. HTTP Basic Authentication
        3. Application-Based Security
        4. ColdFusion's <cflogin> Framework
        5. ColdFusion Sandbox Security
        6. Operating System Security
      2. Using ColdFusion to Control Access
        1. Deciding What to Protect
      3. Using Session Variables for Authentication
        1. Checking and Maintaining Login Status
        2. Restricting Access to Your Application
        3. Creating a Login Page
        4. Verifying the Login Name and Password
        5. Personalizing Based on Login
        6. Being Careful with Passed Parameters
          1. Recognizing the Problem
          2. Checking Passed Parameters
          3. Putting It Together and Getting Interactive
        7. Other Scenarios
          1. Delaying the Login Until Necessary
          2. Implementing Different Access Levels
          3. Access Rights, Users, and Groups
        8. Using ColdFusion's <cflogin> Framework
        9. Tags and Functions Provided by the <cflogin> Framework
        10. Using <cflogin> and <cfloginuser>
        11. Using getAuthUser() in Your Application Pages
        12. Using Roles to Dynamically Restrict Functionality
      4. Using Operating System Security
      5. Defending against Cross-Site Scripting
    5. 22. Building User-Defined Functions
      1. Thinking About Extending CFML
      2. Functions Turn Input into Output
      3. Building Your First UDF
        1. Basic Steps
        2. Using the Function
        3. UDF Tag Syntax
        4. Using Local Variables
          1. Why Local Variables are Important
          2. How to Declare a Local Variable
        5. Where to Save Your UDFs
          1. Creating and Using a UDF in the Same File
          2. Saving UDFs in Separate Files for Easy Reuse
          3. Reusing Code Saves Time and Effort
      4. Creating Libraries of Related UDFs
        1. Designing the UDF Library
        2. Putting the UDF Library to Use
      5. Creating General-Purpose UDFs
        1. Things to Consider
        2. Writing the SimpleJavaScriptFunctions Library
        3. Another Example Library: ColorFunctions
      6. Sharing UDF Libraries with Others
    6. 23. Building Reusable Components
      1. Easy, Powerful Extensibility
      2. Introducing CFML Custom Tags
        1. The Basic Custom Tag Idea
        2. Why Modularity Is a Good Thing
          1. Modularity Means Having More Fun
          2. Modularity Means Being Self-Contained
          3. Modules Are Easy to Maintain
          4. Modularity Encourages Code Reuse
          5. Modules Can Be Traded or Sold
      3. How to Use Custom Tags
        1. Finding Tags on the Developer Exchange
        2. How to “Install” a Custom Tag
        3. Using Custom Tags
          1. Using <cf_CoolImage>
          2. Thinking About Custom Tags as Abstractions
          3. Using <cf_TwoSelectsRelated>
        4. Changing the Custom Tag Search Path
        5. Placing Custom Tags in the Current Directory
      4. Controlling Template Locations with <cfmodule>
        1. Introducing the <cfmodule> Tag
        2. Calling Modules by Name
          1. Understanding the name Attribute
          2. Using Dot Notation to Avoid Conflicts
        3. Calling Modules by Template Location
      5. Writing Custom Tags That Display Information
        1. Writing Your First Custom Tag
        2. Introducing the attributes Scope
          1. Outputting Attribute Values
          2. Using <cfparam> to Declare Attributes
        3. Making Attributes Optional or Required
        4. Using <cfparam> to Establish Default Values
          1. Using Functions to Test for Attributes
        5. Who Are You Developing For?
        6. Querying and Displaying Output
          1. Running Queries in Custom Tags
          2. Local Variables in Custom Tags
        7. Custom Tags Versus <cfinclude>
      6. Custom Tags That Process Data
        1. Introducing the CALLER Scope
        2. Returning Variables to the Calling Template
        3. Variable Names as Tag Attributes
        4. Using <cfparam> with type="variableName"
        5. Setting a Variable Dynamically
          1. Using Quoted <cfset> Syntax
          2. Using the setVariable() Function
          3. Using struct Notation
      7. Custom Tags That Encapsulate Business Rules
      8. Custom Tags for General-Purpose Use
        1. Sharing Your Custom Tags
          1. Providing Documentation
          2. Posting to the Developer Exchange
          3. Selling Your Custom Tags
      9. Additional Custom Tag Topics
        1. Paired Custom Tags
        2. Associating Nested Custom Tags
        3. Passing Attributes with attributeCollection
        4. The REQUEST Scope
          1. Making Variables Available to All Custom Tags
          2. Maintaining Per-Request Flags and Counters
      10. Introducing ColdFusion Components
        1. About ColdFusion Components
          1. CFCs Can be Called in Many Different Ways
          2. CFCs are Object-Oriented Tools
          3. CFCs and Method Inheritance
        2. The Two Types of Components
          1. Static Components
          2. Instance-Based Components
      11. Your First CFC
        1. The Structure of a CFC File
          1. Introducing the <cfcomponent> Tag
          2. Using <cffunction> to Create Methods
        2. A Simple Example
        3. Using the CFC in ColdFusion Pages
          1. Calling Methods with <cfinvoke>
          2. Supplying Arguments
          3. Calling an Instance's Methods
          4. Calling Methods with <cfscript> Syntax
          5. Instantiating Components with createObject()
      12. A More Complete CFC
        1. CFCs as Collections of Functions
        2. Using the FilmData CFC
        3. Separating Logic from Presentation
        4. Accessing a CFC via a URL
          1. Visiting the Correct URL
          2. Creating Methods That Generate HTML
          3. Other Ways of Separating CFC Logic from Presentation
        5. Accessing a CFC via a Form
        6. Exploring CFCs in Dreamweaver
          1. Viewing All Your CFCs
          2. Jumping to CFC Code from the Tree
          3. Inserting <cfinvoke> Tags via Drag and Drop
          4. Viewing CFC Details
          5. Viewing CFC Documentation
          6. Viewing CFC Documentation without Dreamweaver
          7. Using the Create Component Dialog
      13. Components that Hold Instance Data
        1. Introducing the THIS Scope
          1. The THIS Scope Represents an Instance
          2. Steps in the THIS Process
        2. An Instance Data CFC Example
          1. Designing FilmRotationCFC
          2. Building FilmRotationCFC
        3. Storing CFCs in the APPLICATION Scope
        4. Storing CFCs in the SESSION Scope
        5. Instance Data as Properties
          1. Modifying Properties from a ColdFusion Page
          2. CFCs and the VARIABLES Scope
          3. Documenting Properties With <cfproperty>
        6. CFCs, Shared Scopes, and Locking
          1. Direct Access to Shared Scopes from CFC Methods
          2. Locking Access to the THIS Scope
      14. Learning More About CFCs
        1. Learning About Advanced CFC Concepts
    7. 24. Improving the User Experience
      1. Usability Considerations
        1. Put yourself in the User's Shoes
          1. Think About Navigation
          2. Why it's good to be Predictable
          3. Anticipating the User's Next Move
          4. Scripting, Rollovers, and Widgets
          5. Dealing with Problems Gracefully
        2. Easing the Browser's Burden
          1. Dealing with Image Size
          2. Use Tables Wisely
          3. Use Frames Wisely
          4. Using External Script and Style Files
          5. Browser Compatibility Issues
      2. Remembering Settings
        1. Remembering User Names and Passwords
        2. Other Helpful Settings to Remember
        3. Avoid the “Big Brother” Effect
      3. Creating Next-n Records Interfaces
        1. Advantages of Next-n Interfaces
        2. When to Create a Next-n Interface
        3. Creating the Basic Interface
          1. Limiting the Number of Records Shown
          2. Adding Next and Back Buttons
        4. Alternating Row Colors for Readability
          1. Defining Styles
          2. A Note on the Use of iif()
        5. Letting the User Browse Page by Page
        6. Adding Show All and Filter Options
      4. Returning Page Output Right Away with <cfflush>
        1. When to Clear the Buffer
        2. The Exception, Not the Rule
        3. Introducing the <cfflush> Tag
        4. Flushing the Output Buffer for Large Pages
        5. Flushing the Output Buffer for Long-Running Processes
          1. Simulating a Long-Running Process
          2. Displaying a Please-Wait Type of Message
          3. Displaying a Graphical Progress Meter
          4. Flushing the Output Buffer Between Table Rows
        6. When You Can't Flush the Buffer
          1. Restrictions on Cookie Use
          2. Restrictions on <cflocation>
          3. Other Restrictions
    8. 25. Improving Performance
      1. Options in the ColdFusion Administrator
      2. Improving Query Performance with Caching
        1. Understanding Query Caching
        2. Using Cached Queries
        3. Refreshing Cached Queries Programmatically
          1. Flushing A Specific Cached Query after an Update
          2. Flushing All Cached Queries
        4. Limiting the Number of Cached Queries
        5. Controlling How Many Records Are Fetched at Once
      3. Caching Page Output
        1. Introducing the <cfcache> Tag
        2. Client-Side Page Caching
          1. Background
          2. Gaining More Control
          3. What It Means
        3. Server-Side Page Caching
          1. Enabling Server-Side Caching
        4. ColdFusion-Optimized Caching
          1. Caching Pages That Use URL Parameters
          2. Specifying the Cache Directory
        5. Flushing the Page Cache
          1. Using action="flush"
        6. Understanding the Issue
        7. Automatic White-Space Control
          1. Enabling White-Space Suppression
          2. Controlling White-Space Suppression Programmatically
        8. Suppressing White-Space Output with <cfsilent>
        9. Suppressing Specific White Space with <cfsetting>
    9. 26. Integrating with Macromedia Flash
      1. Flash Integration Concepts
        1. Macromedia Flash MX 2004
        2. The Flash 7 Player
        3. ColdFusion Components
        4. Flash Remoting
        5. ActionScript
      2. Your First Flash Movie
        1. What You Need to Install
        2. Creating a Movie
        3. Placing the Movie on a ColdFusion Page
          1. Copying and Pasting the HTML Code
          2. Inserting Movies with Dreamweaver
          3. Inserting Movies via Drag and Drop
      3. Using Flash Remoting
        1. ColdFusion Pages as Services
        2. Your First Flash Remoting Project
          1. Getting Started
          2. Drawing a Simple Search Interface
          3. Adding ActionScript Code
          4. Connecting to the Flash Remoting Gateway
          5. Executing a ColdFusion Page and Passing Parameters
          6. Accessing the Returned Value
        3. Creating the ColdFusion Code
          1. Introducing the FLASH Scope
        4. Testing the Example
        5. More About Returning Data to Flash
          1. Returning Multiple Values to Flash
          2. Returning Structures to Flash
          3. Returning Arrays to Flash
          4. Returning Queries to Flash
          5. Rich Text in Flash Text Boxes
      4. Working with Recordsets in Flash
        1. About RecordSet Objects
        2. RecordSet Functions
        3. A Complete Example
          1. The User Experience
          2. Building the Interface
          3. Writing the ActionScript Code
          4. Understanding the Code
      5. Calling CFC Methods from Flash
        1. ColdFusion Components as Services
        2. Calling CFC Methods
        3. Instantiated CFCs
      6. Other Cool Flash Remoting Features
        1. Debugging Flash Remoting Projects
        2. The Data Glue Object
        3. Incrementally Loading Recordsets
        4. Security and Logging In from Flash
        5. Other Integration Methods
    10. 27. Interacting with Email
      1. Sending Email from ColdFusion
        1. Introducing the <cfmail> Tag
        2. Specifying a Mail Server in the Administrator
        3. Sending Email Messages
          1. Sending a Simple Message
          2. Using Friendly Email Addresses
          3. Limiting Input
        4. Sending Data-Driven Mail
          1. Including Query Data in Messages
          2. Sending Bulk Messages
        5. Sending HTML-Formatted Mail
        6. Adding Custom Mail Headers
          1. Introducing the <cfmailparam> Tag
        7. Adding Attachments
        8. Overriding the Default Mail Server Settings
      2. Retrieving Email with ColdFusion
        1. Introducing the <cfpop> Tag
        2. Retrieving the List of Messages
        3. Receiving and Deleting Messages
        4. Receiving Attachments
          1. Retrieving the Attachments
          2. Deleting Attachments After Use
          3. Another Approach
        5. Creating Automated POP Agents
          1. Creating the Agent Template
          2. Scheduling the Agent Template
          3. Other Uses for POP Agents
    11. 28. Online Commerce
      1. Building E-commerce Sites
        1. Common Commerce-Site Elements
          1. Storefront Area
          2. Promotions and Featured Items
          3. Shopping Cart
          4. Checkout Process
          5. Order Status and Package Tracking
        2. Using a Secure Server
      2. Creating Storefronts
        1. Displaying Individual Items
        2. Collecting Items into a Store
      3. Creating Shopping Carts
        1. Storing Cart Information
          1. CLIENT-Scoped Lists
          2. SESSION-Scoped Structures and Arrays
          3. Cart Data in a Database
        2. Building a Shopping Cart
          1. The Simplest Approach
          2. Updating Cart Quantities
        3. Encapsulating the Shopping Cart in a Custom Tag
          1. Building <cf_ShoppingCart>
          2. Putting <cf_ShoppingCart> to Work
        4. A ColdFusion Component Version of the Shopping Cart
          1. Building the ShoppingCart Component
          2. Using the ShoppingCart Component
      4. Payment Processing
        1. Payment-Processing Solutions
        2. Processing a Payment
          1. Getting Started with Payflow Pro
          2. The <cf_VerisignPayflowPro> Custom Tag
          3. Writing a Custom Tag Wrapper to Accept Payments
        3. Processing a Complete Order
        4. Creating the Checkout Page
      5. Other Commerce-Related Tasks
        1. Order Tracking
        2. Order Fulfillment
        3. Cancellations, Returns, and Refunds
        4. Inventory Tracking
        5. Reporting
  8. 4. Advanced ColdFusion
  9. 5. Appendices
    1. A. Installing ColdFusion MX 7, Dreamweaver MX 2004, and the Sample Files
      1. Dreamweaver MX 2004
      2. ColdFusion MX 7
        1. The Different Flavors of ColdFusion MX 7
        2. Pre-Installation Checklist
        3. Checking Your Hardware
          1. Intel-Based Systems
          2. Solaris Systems
        4. Choosing Your Hardware
        5. Checking Your Web Server
        6. Installing ColdFusion On Windows
        7. Installing ColdFusion On Linux and Unix
      3. Installing the ColdFusion Report Builder
      4. Installing Dreamweaver Extensions
      5. Samples & Data Files
        1. What to Install
        2. Installing the OWS Files
    2. B. ColdFusion Tag Reference
      1. Tag Groups by Function
        1. Database Manipulation
        2. Data Output
        3. Extensibility
        4. Variable Manipulation
        5. Flow Control
        6. Debugging Tools
        7. Internet Protocols
        8. File Management
        9. Web Application Framework
        10. ColdFusion Forms
        11. Security
        12. CFML Utilities
        13. Verity Search
      2. Alphabetical List of ColdFusion Tags
        1. <cfabort>
        2. <cfapplet>
        3. <cfapplication>
        4. <cfargument>
        5. <cfassociate>
        6. <cfbreak>
        7. <cfcache>
        8. <cfcalendar>
        9. <cfcase>
        10. <cfcatch>
        11. <cfchart>
        12. <cfchartdata>
        13. <cfchartseries>
        14. <cfcol>
        15. <cfcollection>
        16. <cfcomponent>
        17. <cfcontent>
        18. <cfcookie>
        19. <cfdefaultcase>
        20. <cfdirectory>
        21. <cfdocument>
        22. <cfdocumentitem>
        23. <cfdocumentsection>
        24. <cfdump>
        25. <cfelse>
        26. <cfelseif>
        27. <cferror>
        28. <cfexecute>
        29. <cfexit>
        30. <cffile>
        31. <cfflush>
        32. <cfform>
        33. <cfformgroup>
        34. <cfformitem>
        35. <cfftp>
        36. <cffunction>
        37. <cfgraph>
        38. <cfgraphdata>
        39. <cfgrid>
        40. <cfgridcolumn>
        41. <cfgridrow>
        42. <cfgridupdate>
        43. <cfheader>
        44. <cfhtmlhead>
        45. <cfhttp>
        46. <cfhttpparam>
        47. <cfif>
        48. <cfimpersonate>
        49. <cfimport>
        50. <cfinclude>
        51. <cfindex>
        52. <cfinput>
        53. <cfinsert>
        54. <cfinvoke>
        55. <cfinvokeargument>
        56. <cfldap>
        57. <cflocation>
        58. <cflock>
        59. <cflog>
        60. <cflogin>
        61. <cfloginuser>
        62. <cflogout>
        63. <cfloop>
        64. <cfmail>
        65. <cfmailparam>
        66. <cfmailpart>
        67. <cfmodule>
        68. <cfntauthenticate>
        69. <cfobject>
        70. <cfobjectcache>
        71. <cfoutput>
        72. <cfparam>
        73. name
        74. <cfpop>
        75. <cfprocessingdirective>
        76. <cfprocparam>
        77. <cfprocresult>
        78. <cfproperty>
        79. <cfquery>
        80. <cfqueryparam>
        81. <cfregistry>
        82. <cfreport>
        83. <cfreportparam>
        84. <cfrethrow>
        85. <cfreturn>
        86. <cfsavecontent>
        87. <cfschedule>
        88. <cfscript>
        89. <cfsearch>
        90. <cfselect>
        91. <cfservlet>
        92. <cfservletparam>
        93. <cfset>
        94. <cfsetting>
        95. <cfsilent>
        96. <cfslider>
        97. <cfstoredproc>
        98. <cfswitch>
        99. <cftable>
        100. <cftextarea>
        101. <cftextinput>
        102. <cfthrow>
        103. <cftimer>
        104. <cftrace>
        105. <cftransaction>
        106. <cftree>
        107. <cftreeitem>
        108. <cftry>
        109. <cfupdate>
        110. <cfwddx>
        111. <cfxml>
    3. C. ColdFusion Function Reference
      1. Functions by Topic
        1. String-Manipulation Functions
        2. Date and Time Functions
        3. Data Formatting Functions
        4. Mathematical Functions
        5. International Functions
        6. List-Manipulation Functions
        7. Array-Manipulation Functions
        8. Structure-Manipulation Functions
        9. Query-Manipulation Functions
        10. Security Functions
        11. System Functions
        12. Client Variable–Manipulation Functions
        13. Expression Evaluation Functions
        14. Bit- and Set-Manipulation Functions
        15. Conversion Functions
        16. XML Functions
        17. Event Gateway Functions
        18. SOAP Functions
        19. Miscellaneous Functions
      2. Alphabetical List of ColdFusion Functions
        1. Abs()
        2. Acos()
        3. AddSOAPRequestHeader
        4. AddSOAPResponseHeader
        5. ArrayAppend()
        6. ArrayAvg()
        7. ArrayClear()
        8. ArrayDeleteAt()
        9. ArrayInsertAt()
        10. ArrayIsEmpty()
        11. ArrayLen()
        12. ArrayMax()
        13. ArrayMin()
        14. ArrayNew()
        15. ArrayPrepend()
        16. ArrayResize()
        17. ArraySet()
        18. ArraySort()
        19. ArraySum()
        20. ArraySwap
        21. ArrayToList()
        22. Asc()
        23. Asin()
        24. Atn()
        25. AuthenticatedContext()
        26. AuthenticatedUser()
        27. BinaryDecode
        28. BinaryEncode
        29. BitAnd()
        30. BitMaskClear()
        31. BitMaskRead()
        32. BitMaskSet()
        33. BitNot()
        34. BitOr()
        35. BitSHLN()
        36. BitSHRN()
        37. BitXor()
        38. Ceiling()
        39. CharsetDecode()
        40. CharsetEncode()
        41. Chr()
        42. Cjustify()
        43. Compare()
        44. CompareNoCase()
        45. Cos()
        46. CreateDate()
        47. CreateDateTime()
        48. CreateODBCDate()
        49. CreateODBCDateTime()
        50. CreateODBCTime()
        51. CreateObject()
        52. CreateTime()
        53. CreateTimeSpan()
        54. DateAdd()
        55. DateCompare()
        56. DateConvert()
        57. DateDiff()
        58. DateFormat()
        59. DatePart()
        60. Day()
        61. DayOfWeek()
        62. DayOfWeekAsString()
        63. DayOfYear()
        64. DaysInMonth()
        65. DaysInYear()
        66. DE()
        67. DecimalFormat()
        68. Decrypt()
        69. DeleteClientVariable()
        70. DirectoryExists()
        71. DollarFormat()
        72. Duplicate()
        73. Encrypt()
        74. Exp()
        75. ExpandPath()
        76. Evaluate()
        77. FileExists()
        78. Find()
        79. FindNoCase()
        80. FindOneOf()
        81. FirstDayOfMonth()
        82. Fix()
        83. FormatBaseN()
        84. GenerateSecretKey()
        85. GetBaseTagData()
        86. GetBaseTagList()
        87. GetBaseTemplatePath()
        88. GetClientVariablesList()
        89. GetContextRoot()
        90. GetCurrentTemplatePath()
        91. GetDirectoryFromPath()
        92. GetException()
        93. GetFileFromPath()
        94. GetFunctionList()
        95. GetGatewayHelper()
        96. GetHttpRequestData()
        97. GetHttpTimeString()
        98. GetLocale()
        99. GetLocaleDisplayName()
        100. GetMetaData()
        101. GetMetricData()
        102. GetPageContext()
        103. GetProfileString()
        104. GetSOAPRequest()
        105. GetSOAPRequestHeader()
        106. GetSOAPResponse()
        107. GetSOAPResponseHeader()
        108. GetTempDirectory()
        109. GetTempFile()
        110. GetTemplatePath()
        111. GetK2ServerCollections()
        112. GetK2ServerDocCount()
        113. GetK2ServerDocCountLimit()
        114. GetTickCount()
        115. GetTimeZoneInfo()
        116. GetToken()
        117. Hash()
        118. Hour()
        119. HTMLCodeFormat()
        120. HTMLEditFormat()
        121. IIf()
        122. IncrementValue()
        123. InputBaseN()
        124. Insert()
        125. Int()
        126. IsArray()
        127. IsAuthenticated()
        128. IsAuthorized()
        129. IsBinary()
        130. IsBoolean()
        131. IsCustomFunction()
        132. IsDebugMode()
        133. IsDefined()
        134. IsDate
        135. IsK2ServerDocCountExceeded()
        136. IsK2ServerOnline()
        137. IsLeapYear()
        138. IsNumeric()
        139. IsNumericDate()
        140. IsObject()
        141. IsProtected()
        142. IsSimpleValue()
        143. IsSOAPRequest()
        144. IsStruct()
        145. IsQuery()
        146. IsUserInRole()
        147. IsWDDX()
        148. IsXML()
        149. IsXmlAttribute()
        150. IsXMLDoc()
        151. IsXMLElem()
        152. IsXmlNode()
        153. IsXMLRoot()
        154. JavaCast()
        155. JSStringFormat()
        156. LCase()
        157. Left()
        158. Len()
        159. ListAppend()
        160. ListChangeDelims()
        161. ListContains()
        162. ListContainsNoCase()
        163. ListDeleteAt()
        164. ListFind()
        165. ListFindNoCase()
        166. ListFirst()
        167. ListGetAt()
        168. ListInsertAt()
        169. ListLast()
        170. ListLen()
        171. ListPrepend()
        172. ListSort()
        173. ListToArray()
        174. ListQualify()
        175. ListRest()
        176. ListSetAt()
        177. ListValueCount()
        178. ListValueCountNoCase()
        179. LJustify()
        180. Log()
        181. Log10()
        182. LSCurrencyFormat()
        183. LSDateFormat()
        184. LSEuroCurrencyFormat()
        185. LSIsCurrency()
        186. LSIsDate()
        187. LSIsNumeric()
        188. LSNumberFormat()
        189. LSParseCurrency()
        190. LSParseDateTime()
        191. LSParseEuroCurrency()
        192. LSParseNumber()
        193. LSTimeFormat()
        194. LTrim()
        195. Max()
        196. Mid()
        197. Min()
        198. Minute()
        199. Month()
        200. MonthAsString()
        201. Now()
        202. NumberFormat()
        203. ParagraphFormat()
        204. ParameterExists()
        205. ParseDateTime()
        206. Pi()
        207. PreserveSingleQuotes()
        208. Quarter()
        209. QueryAddColumn()
        210. QueryAddRow()
        211. QueryNew()
        212. QuerySetCell()
        213. QuotedValueList()
        214. Rand()
        215. Randomize()
        216. RandRange()
        217. REFind()
        218. REFindNoCase()
        219. ReleaseCOMObject()
        220. RemoveChars()
        221. RepeatString()
        222. Replace()
        223. REReplace()
        224. REReplaceNoCase()
        225. ReplaceList()
        226. Reverse()
        227. Right()
        228. RJustify()
        229. Round()
        230. RTrim()
        231. Second()
        232. SendGatewayMessage()
        233. SetLocale()
        234. SetProfileString()
        235. SetVariable()
        236. Sgn()
        237. Sin()
        238. SpanExcluding()
        239. SpanIncluding()
        240. Sqr()
        241. StripCR()
        242. StructAppend()
        243. StructClear()
        244. StructCopy()
        245. StructCount()
        246. StructDelete()
        247. StructFind()
        248. StructFindKey()
        249. StructFindValue()
        250. StructGet()
        251. StructInsert()
        252. StructIsEmpty()
        253. StructKeyArray()
        254. StructKeyExists()
        255. StructKeyList()
        256. StructNew()
        257. StructSort()
        258. StructUpdate()
        259. Tan()
        260. TimeFormat()
        261. ToBase64()
        262. ToBinary()
        263. ToScript()
        264. ToString()
        265. Trim()
        266. UCase()
        267. URLDecode()
        268. URLEncodedFormat()
        269. Val()
        270. WriteOutput()
        271. ValueList()
        272. Week()
        273. Wrap()
        274. XMLChildPos()
        275. XMLElemNew()
        276. XMLFormat()
        277. XMLGetNodeType()
        278. XMLNew()
        279. XMLParse()
        280. XMLSearch()
        281. XMLTransform()
        282. XMLValidate()
        283. Year()
        284. YesNoFormat()
    4. D. Special ColdFusion Variables and Result Codes
      1. Special ColdFusion Variables and Result Codes
        1. ATTRIBUTE Variables
        2. CALLER Variables
        3. CGI Variables
        4. <cfcatch> Variables
        5. <cfcollection action="list"> Query Columns
        6. <cfdirectory action="list"> Query Columns
        7. <cffile action="upload"> Variables
        8. <cfftp> Variables
        9. <cfftp action="ListDir"> Query Columns
        10. <cfhttp> Variables
        11. <cfldap action="query"> Query columns
        12. <cfpop action="GetHeaderOnly|GetAll"> Query Columns
        13. <cfquery> Variables
        14. <cfregistry> Query Variables
        15. <cfsearch> Results Variables
        16. <cfservlet> Variables
        17. <cfstoredproc> Variables
        18. CLIENT Variables
        19. COOKIE Variables
        20. ERROR Variables
        21. FORM Variables
        22. Query Variables
        23. REQUEST Variables
        24. SERVER Variables
        25. SESSION Variables
        26. ThisTag Variables
        27. URL Variables
    5. E. Verity Search Language
      1. Using Angle Brackets Around Operators
      2. Operators Are Not Case Sensitive
      3. Using Prefix Instead of Infix Notation
      4. Searching for Special Characters as Literals
      5. Understanding Concept Operators
      6. Understanding Evidence Operators
      7. Understanding Proximity Operators
      8. Understanding Relational Operators
      9. Understanding Search Modifiers
      10. Understanding Score Operators
    6. F. ColdFusion MX 7 Directory Structure
    7. G. Sample Application Data Files
      1. Sample Application Data Files
        1. The Actors Table
          1. Primary Key
          2. Foreign Keys
        2. The Contacts Table
          1. Primary Key
          2. Foreign Keys
        3. The Directors Table
          1. Primary Key
          2. Foreign Keys
        4. The Expenses Table
          1. Primary Key
          2. Foreign Keys
        5. The Films Table
          1. Primary Key
          2. Foreign Keys
        6. The FilmsActors Table
          1. Primary Key
          2. Foreign Keys
        7. The FilmsDirectors Table
          1. Primary Key
          2. Foreign Keys
        8. The FilmsRatings Table
          1. Primary Key
          2. Foreign Keys
        9. The Merchandise Table
          1. Primary Key
          2. Foreign Keys
        10. The MerchandiseOrders Table
          1. Primary Key
          2. Foreign Keys
        11. The MerchandiseOrdersItems Table
          1. Primary Key
          2. Foreign Keys
        12. The UserRoles Table
          1. Primary Key
          2. Foreign Keys

Product information

  • Title: macromedia® Coldfusion® MX 7 Web Application Construction Kit
  • Author(s):
  • Release date: March 2005
  • Publisher(s): Adobe Press
  • ISBN: 9780321223678