Building on our popular Introduction to ColdFusion courses, WestLake's Advanced ColdFusion course teaches the advanced skills you need to build even more useful and efficient database-driven Web applications. We will also introduce you to powerful new features introduced in ColdFusion MX 7.
ColdFusion Training Objectives
Through class lectures, demonstrations, walkthroughs, and labs, you will learn to:
- Display data creatively
- Generate graphs
- Write queries of queries
- Reference stored procedures
- Reuse code
- Manipulate files on the server
- Handle errors and exceptions
- Validate data with regular expressions
ColdFusion Training Prerequisites
- Introduction to ColdFusion MX 7 for New Programmers
ColdFusion Training Course Duration
3 Days
ColdFusion Training Course Outline
Introduction
- Software for this Class
- Code Editors
- The Files for this Class
- Our Database: the WestLake Used Car Exchange
SECTION 1: Specialized Output
Output Shortcuts
Debugging Settings
- Limit Debugging to certain IP addresses
Charts & Graphs with CFCHART
- Additional attributes of CFCHART and CFCHARTSERIES
- Caching Charts
- Save charts for future use
- Settings for ColdFusion charting and graphing engine
Adding Links in Your Chart
- Adding Data Points Individually with CFCHARTDATA
Showing Portions of a Recordset
- Paging Through a Recordset
- Set up our variables
- Limit the loop for this page
- Insert links to move back or forward
- Hide the links at the beginning and the end
- Cache the query
Dividing into Table Columns
- Set up the variables
- Create the table structure
- Limit the CFOUTPUT loops
SECTION 2: Reusing Content: Reduce, Reuse, Recycle
Queries of Queries
- Performing a Query of Queries
- Benefits of Query of Queries
The CFLOCATION Tag
- Where and how is CFLOCATION used ?
- The CFINCLUDE Tag
Custom Tags
- Where to find custom-tag files
- Transmitting variables as attributes
- What if the attribute is missing ?
- Variable Scope
- CALLER variables
- Using CFMODULE
Using Stored Procedures
- Advantages of Stored Procedures
- An Example
Stored Procedures with Parameters
- The CFPROCPARAM Tag
- Using Stored Procedure Parameters for Safety
SECTION 3: State Management
- What does managing client state mean ?
- Context for the two mechanisms ColdFusion uses
Working with Cookies
- What is a Cookie ?
- Why do some consider Cookies bad ?
- Cookie Demonstration
- Implementation Characteristics Set by the User Agent
Working with Sessions
- What is a session ?
- When does the Session End ?
- Configuring and enabling session variables
- Enabling session variables in your application
- Storing session data in session variables
- Standard session variables
- Getting a list of session variables
- Creating and deleting session variables
- LifeCycle of a ColdFusion Template
- Uses for Applicaton.cfm
- Session and Application Variables
- Required CFAPPLICATION Tag
- Locking Session and Application variables with CFLOCK
Password Protection with Sessions
- Example: Pages with Password Protection
Encapsulating Data using Sessions
- The Basics of Encapsulation
- Example: Enapsulating Session Data
- Encapsulating a component within a session
- Outline of a component
- Accessing a component in session scope
- Removing the component from the session
- Advantages of Encapsulation
SECTION 4: Advanced Form Validation
Regular Expressions
- REFind and REFindNoCase
- Regular Expression Example
- Special Characters for Pattern Matching
- Escape Sequences for Special Characters
- Specifying Ranges in Patterns
- Matching a Specified Number of Occurrences
- Character-Range Escape Sequences
- Matching at the Beginning or End of a String with ^ and $
- The Word-Boundary Pattern Anchors: \b and \B
SECTION 5: Error Handling ,
Errors & Exceptions
- Terminology: Error vs. Exception
Identifying and Preventing the Problem
- The IsNumeric() Function
- An Ounce of Prevention
Standard Error Handling
- The CFERROR Tag
- Syntax of CFERROR
- The Error Page
- Sharing Your CFERROR Tag
Structured Error Handling
- CFTRY and CFCATCH Tags
- Creating Exceptions with CFTHROW
- Using CFTHROW with Custom Tags
Database Transactions
- The CFTRANSACTION Tag
- CFTRANSACTION and CFTRY
SECTION 6: Manipulating the File System
Manipulating Files with CFFILE
- Example: Reading a Text File
- The ExpandPath() Function
- Syntax of CFFILE
- Example: Writing to a Text File
- The FileExists() and DirectoryExists() Functions
- CFFILE Tags for Writing and Appending
Using CFFILE for HTML Pages
- An HTML Example
- Excessive Quoted Text: the CFSAVECONTENT Solution
- The ParagraphFormat() Function
- The Replace() Function
- Complicated line breaks on Windows computers
Uploading Files
- Sample: Uploading Photos
- Step 1: Form Features
- Step 2: Receiving the Uploaded File
- Displaying the Image in an IMG Tag
- The CFFILE Variables
Manipulating Files and Directories on the Server
- Additional CFFILE Features
- Directory Manipulation with CFDIRECTORY
- Example: Listing All Files of a Given Type
SECTION 7: Programming with ColdFusion
Complex Data Objects: Arrays, Lists and Structures
- Scalar Variables
- Lists
- Arrays
- Structures
CFLOOP: Another Looping Option
- Syntax of CFLOOP
- Weeding Out the FIELDNAMES Variable
- Using CFLOOP for automatic query output
- Display Web-safe Colors using CFLOOP
CFSCRIPT
- Capabilities of CFSCRIPT
- Syntax Rules
- Reserved Words
- Looping with CFSCRIPT
- GetTickCount() - testing the speed of your code
User Defined Functions (UDFs)
- Creating UDFs with CFSCRIPT
- Creating UDFs with the CFFUNCTION tag
Using Components
- Creating Components
- Calling or Invoking Components
- Passing Arguments to Components
- The main CFML page
- View a Component directly in the browser
- Web Services
- Selecting Among ColdFusion Code Resuse Methods
SECTION 8: Search Engine
Appendix A: Create a Search Engine - Verity
- Creating a Verity Collection
- Constructing the Search Interface
- Index Your Collection
- Warning: Syntax Error in Auto-Generated Code
- Using the Scheduler Feature of the Administrator
Appendix B: Recommended Resources
Appendix C: Selecting Among ColdFusion Code Resuse Methods