Adobe ColdFusion 8 Web Application Construction Kit, Volume 3: Advanced Application Development

Book description

The ColdFusion Web Application Construction Kit is the best-selling ColdFusion series of all time—used by more ColdFusion developers to learn the product than any other books. Volume 3, Advanced Application Development introduces advanced ColdFusion features and technologies, including ensuring high availability, security and access control implementations, Java and .NET integration, using feeds and web services, connecting to IM networks, and server OS integration.
Complete coverage of ColdFusion 8 starts in Volume 1, Getting Started (ISBN 0-321-51548-X) and Volume 2 Application Development (ISBN 0-321-51546-3).

Table of contents

  1. Copyright
    1. Dedications
  2. Biographies
    1. Ben Forta
    2. Charlie Arehart
    3. Jeff Bouley
    4. Jeff Tapper
    5. Matt Tatam
    6. Ray Camden
    7. Robi Sen
    8. Sarge Sargent
  3. Acknowledgments
    1. Ben Forta
    2. Charlie Arehart
    3. Jeff Bouley
    4. Ray Camden
    5. Sarge Sargent
  4. Introduction
    1. Who Should Use This Book?
    2. How to Use This Book
    3. Part VIII: Advanced ColdFusion Development
    4. Part IX: Creating High-Availability Applications
    5. Part X: Ensuring Security
    6. Part XI: Extending ColdFusion
    7. The Web Site
  5. Online Content
    1. Part VIII: Advanced ColdFusion Development
  6. VIII. Advanced ColdFusion Development
    1. 41. More About SQL and Queries
      1. Advanced SQL Topics
        1. Getting Unique Records with DISTINCT
        2. Summarizing Data with Aggregate Functions
          1. Standard Aggregate Functions
          2. Getting More Selective with WHERE
          3. Breaking It Down with GROUP BY
          4. Filtering Summarized Records with HAVING
        3. Selecting Related Data with Joins
          1. Joining Two Tables
          2. Joining Three Tables
          3. Improving Readability with Table Aliases
          4. The Two Types of Join Syntax
          5. Using Outer Joins
        4. Subqueries
          1. Subqueries in WHERE Criteria
          2. Subqueries Are Often Just Alternatives
          3. Using Subqueries with IN
          4. Using Subqueries with NOT IN
          5. Calculating New Columns with Subqueries
        5. Combining Record Sets with UNION
        6. Working with NULL Values
          1. Setting Values to NULL
          2. Testing for NULL Values in SQL Code
          3. Testing for NULL Values in CFML Code
        7. Working with Date Values
          1. Specifying Dates in <cfquery> Tags
          2. Dates in Query Criteria
        8. Understanding Views
          1. Creating a View
          2. Advantages of Using Views
      2. Additional <cfquery> Topics
        1. Query of Queries (In Memory Queries)
          1. The Basics
          2. Using QofQ for Heterogeneous Data Analysis
          3. SQL Statements Supported by Query of Queries
          4. Using QofQ to Reduce Database Interaction
          5. ColdFusion Is Not a Database Server
          6. A Real-World Example
          7. Using QofQ with Nondatabase Queries
          8. Joining Database and Nondatabase Queries
          9. Case Sensitivity and Query of Queries
          10. Working with Column Types
          11. Reserved Words and Query of Queries
        2. Parameterized Queries
          1. Introducing <cfqueryparam>
        3. Using Parameterized Queries for Database Independence
          1. Using Parameterized Queries for Security
        4. Building Query Results Programmatically
      3. Using Database Transactions
        1. Using the <cftransaction> Tag
          1. Using Transactions for ID Number Safety
          2. Using Transactions for the Ability to Undo
        2. Transactions and CFML Error Handling
        3. Transactions and Stored Procedures
        4. Using <cfdbinfo>
          1. Other Information Returned By <cfdbinfo>
    2. 42. Working with Stored Procedures
      1. Why Use Stored Procedures?
        1. Advantages of Using Stored Procedures
          1. Modularity Is a Good Thing
          2. Sharing Code Between Applications
          3. Increasing Performance
          4. Making Table Schemas Irrelevant
          5. Addressing Security Concerns
        2. Comparing Stored Procedures to CFML Custom Tags
      2. Calling Stored Procedures from ColdFusion Templates
        1. Two Ways to Execute Stored Procedures
          1. With the <cfstoredproc> Tag
          2. With the <cfquery> Tag
        2. Using the <cfstoredproc> Tag
        3. Stored Procedures That Return Recordsets
          1. The <cfprocresult> Tag
          2. Using <cfprocresult>
          3. Using <cfprocresult> with Oracle
        4. Stored Procedures That Take Parameters and Return Status Codes
          1. Providing Parameters with <cfprocparam>
          2. Ordinal Versus Named Parameter Positioning
          3. Parameter Data Types
          4. Wrapping a Stored Procedure Call in a Custom Tag
          5. Multiple Recordsets Are Fully Supported
        5. Calling Procedures with <cfquery> Instead of <cfstoredproc>
          1. Using the ODBC/JDBC CALL Command
          2. Using Your Database’s Native Syntax
      3. Creating Stored Procedures
        1. Creating Stored Procedures with Microsoft SQL Server
          1. Creating Your First Stored Procedure
          2. Defining Status Codes, Input Parameters, and Output Parameters
          3. Returning Multiple Recordsets to ColdFusion
        2. Creating Stored Procedures with Oracle
          1. Creating the ImportCustomers Stored Procedure
          2. Creating the FetchRatingsList Stored Procedure
        3. Creating Stored Procedures with Sybase
    3. 43. Using Regular Expressions
      1. Introducing Regular Expressions
        1. What Are Regular Expressions?
          1. What Are Regular Expressions Similar To?
          2. What Are Regular Expressions Used For?
          3. What Do Regular Expressions Look Like?
          4. Do Regular Expressions Differ Among Languages?
      2. RegEx Support in ColdFusion
        1. Where Can You Use Regular Expressions?
      3. Using Regular Expressions in ColdFusion
        1. Finding Matches with reFind()
          1. A Simple Example
          2. ([\w._]+)\@([\w_]+(\.[\w_]+)+)
          3. Ignoring Capitalization with reFindNoCase()
          4. Getting the Matched Text Using the Found Position
          5. Getting the Matched Text Using returnSubExpressions
        2. Working with Subexpressions
          1. ([\w._]+)@([\w_]+(\.[\w_]+)+)
        3. Working with Multiple Matches
        4. Replacing Text using reReplace()
          1. Using reReplace to Filter Posted Content
        5. Altering Text with Backreferences
        6. Altering Text Using a Loop
      4. Some Convenient RegEx UDFs
        1. Using reFindString()
      5. Building a RegEx Testing Page
      6. Crafting Your Own Regular Expressions
        1. Understanding Literals and Metacharacters
          1. Including Metacharacters Literally
        2. Introducing the Cast of Metacharacters
        3. Metacharacters 101: Character Classes
          1. Specifying Character Classes with [ ]
          2. Negating a Character Class with ^
          3. Common Character Classes
        4. Metacharacters 102: Quantifiers
          1. Using Quantifiers
          2. Making Certain Portions Be Optional with ?
          3. Including One or More Matches with +
          4. Matching Any Number of Matches with *
          5. <b>[^<]*</b>
          6. Using Minimal Matching (Non-Greedy) Quantifiers
        5. Metacharacters 201: Alternation
        6. Metacharacters 202: Word Boundaries
        7. Metacharacters 203: String Anchors
          1. Understanding Multiline Mode
        8. Metacharacters 301: Match Modifiers
        9. Metacharacters 302: Lookahead Matching
        10. Metacharacters 303: Backreferences Redux
        11. Metacharacters 304: Escape Sequences
      7. Concluding Remarks
    4. 44. ColdFusion Scripting
      1. What Is <cfscript>?
        1. What You Can and Cannot Do with <cfscript>
          1. Assignment
          2. Output
          3. If-Elseif-Else
          4. Switch-Case
          5. For Loops
          6. While Loops
          7. Do-While Loops
          8. For-In Loops
          9. Array Loops
          10. List Loops
          11. Query Loops
          12. Break
          13. Continue
          14. Object Processing
          15. Exception Handling
          16. Throwing a Custom Exception
          17. Rethrowing a Caught Exception
          18. Functions
        2. Differences Between <cfscript> and JavaScript
        3. Why Use <cfscript>?
      2. Implementing <cfscript>
        1. Creating and Using Variables
        2. Commenting Code
        3. Calling ColdFusion Functions
        4. Flow Control Using <cfscript>
          1. if-elseif-else Constructs
          2. switch-case Constructs
        5. Loops
          1. for Loops
          2. while Loops
          3. do-while Loops
          4. for-in Loops
          5. Using continue and break
      3. Common Problems and Solutions
        1. A Note About the {} Symbols
        2. A Note About Quotes
      4. User-Defined Functions in <cfscript>
        1. Where to Define UDFs
      5. Exception Handling in <cfscript>
    5. 45. Working with XML
      1. XML Document Structure
        1. Elements and Their Attributes
        2. Naming Conventions
      2. Reading and Creating XML Documents
        1. Reading an XML File Using XmlParse()
        2. Creating XML Documents Using CFXML
        3. Creating XML Documents Using XmlNew()
        4. Accessing XML Elements and Attributes
          1. Using Array and Structure Functions
      3. Using Special Characters in XML
        1. Entity References
        2. CDATA Sections
      4. XML Namespaces
        1. The Default Namespace
        2. When to Use Namespaces
      5. Validating XML
        1. DTDs
        2. XML Schemas
          1. Walkthrough of a Basic Schema
        3. Validating XML in ColdFusion
          1. Validating by Using XmlValidate()
          2. Embedding Schema Information within a Document
      6. More XML Resources
    6. 46. Manipulating XML with XSLT and XPath
      1. Understanding XPath
        1. Example: A CD Collection
        2. XPath Syntax
          1. Selections Using / and //
          2. Restrictions Using []
        3. Using XmlSearch() to Retrieve an Array of Nodes
      2. Transforming XML into Content by Using XSLT
        1. Creating a Basic Transformation
          1. <xsl:transform>
          2. <xsl:output>
          3. <xsl:template> and <xsl:apply-templates>
          4. <xsl:value-of>
          5. <xsl:apply-templates> Revisited
        2. Performing the Transformation by Using XmlTransform()
        3. Ignoring Nodes in the Hierarchy
        4. Creating a More Complex Transformation
          1. <xsl:if>
          2. <xsl:choose>, <xsl:when>, and <xsl:otherwise>
          3. <xsl:for-each> and <xsl:text>
          4. <xsl:element> and <xsl:attribute>
          5. Using Named Templates
      3. More XPath and XSLT Resources
    7. 47. Using WDDX
      1. Introducing WDDX
        1. Some WDDX Terminology
          1. WDDX Packet
          2. Serializing
          3. Deserializing
        2. Tools and Languages Supported by WDDX
        3. WDDX or XML?
      2. Using WDDX with ColdFusion
        1. Introducing the <cfwddx> Tag
        2. Creating Your First WDDX Packet
        3. Deserializing Your First WDDX Packet
        4. Serializing and Deserializing Complex Data
        5. Validating Packets with IsWDDX()
      3. Anatomy of a WDDX Packet
      4. Using WDDX Packets to Store Information in Files
        1. About Storing Packets in Files
        2. Building a Simple WDDX Function Library
        3. Storing Application Settings as a WDDX Packet
        4. What Have We Learned?
      5. Other Places to Store WDDX Packets
        1. Storing Packets as Client Variables
        2. Storing Packets in Databases
      6. Exchanging WDDX Packets Among Web Pages
        1. The Concept of a Back-End Web Page
        2. Back-End WDDX Pages vs. Web Services
        3. Creating a Back-End Web Page
        4. Putting the Back-End Web Page to Use
        5. Understanding the Possibilities
      7. Binary Content in WDDX Packets
    8. 48. Using JavaScript and ColdFusion Together
      1. A Crash Course in JavaScript
        1. JavaScript Language Elements
          1. The Basic Statements
          2. Statements for Looping
          3. Statements for Creating Functions
          4. Statements for Error Handling
          5. JavaScript Operators
          6. Understanding the Core Objects
        2. Understanding JavaScript’s Relationship to Web Browsers
        3. Understanding Scripting Object Models
        4. JavaScript Objects Available in Web Pages
        5. Understanding JavaScript Events
        6. Including JavaScript Code in Web Pages
        7. Browser Specific Features and Compatibility Issues
        8. That’s the End of the Crash Course
      2. Working with Form Elements
      3. Passing Variables to JavaScript
        1. Passing Numbers to JavaScript
        2. Passing Strings to JavaScript
        3. Variable Passing Example: Mortgage Calculator
        4. Passing Arrays to JavaScript
        5. Passing Structures to JavaScript as Objects
        6. Passing Enough Data to Relate Two Select Boxes
        7. Cascading Selects, Approach #1: Creating an Array of Films
        8. Cascading Selects, Approach #2: Using a Custom JavaScript Object
      4. Passing Data to JavaScript Using <cfwddx>
        1. Using this Form of <cfwddx>
          1. Is This Serialization?
        2. Cascading Selects, Approach #3: Passing the Data Via <cfwddx>
        3. Working with WddxRecordset Objects
          1. Including the wddx.js JavaScript File
          2. Using WddxRecordset Methods
        4. Cascading Selects, Approach #4: Using a WddxRecordset Object
          1. Creating Recordsets from Scratch
      5. Working with WDDX Packets in JavaScript
        1. Serializing Packets with WddxSerializer
          1. Building a Simple Recordset-Editing Interface
          2. Processing the Posted Packet on the Server
        2. Deserializing Packets with WddxDeserializer
        3. Cascading Selects, Approach #5: Fetching Matching Films in Real Time
        4. Cascading Selects, Approach #6: Wrapping the WDDX Fetching in a Custom Tag
      6. Calling CFCs from JavaScript
      7. Passing Simple Variables to ColdFusion
        1. Passing Variables as URL Parameters
        2. Passing Variables as Form Parameters
        3. Opening Popup Windows
    9. 49. Using XForms
      1. What’s Wrong with HTML Forms?
      2. What Is XForms?
        1. Why Use XForms?
        2. Barriers to XForms Adoption
      3. Creating XForms in CFML
        1. The XForms Form Definition
        2. Skinning and Styling: Rendering the Form
      4. XSL: The Extensible Stylesheet Language
        1. Writing Extensions to XForms Using XSL
    10. 50. Internationalization and Localization
      1. Why Go Global?
      2. What Is Globalization?
        1. “Secret” Globalization Language Revealed
        2. Dancing the Globalization Jig
      3. Going Global
        1. Locales
          1. Determining a User’s Locale
          2. Locale Stickiness
          3. CLDR: The Common Locale Data Repository
          4. IBM’s ICU4J
          5. Collation
        2. Character Encoding
          1. Not Unicode? Not So Smart
          2. Unicode
        3. Resource Bundles
          1. Using a Resource Bundle
          2. What Isn’t a Resource Bundle?
          3. Resource Bundle Flavors
          4. Resource Bundle Tools
        4. Addresses
        5. Date/Time
        6. Calendars
          1. Gregorian Calendar
          2. Buddhist Calendar
          3. Chinese Calendar
          4. Hebrew Calendar
          5. Islamic Calendar
          6. Japanese Calendar
          7. Persian Calendar
        7. Calendar CFC Usage
        8. Time Zones
        9. Databases
          1. Microsoft Access
          2. Microsoft SQL Server
          3. MySQL
          4. PostgreSQL
          5. Oracle
        10. Display
        11. Text Searching
        12. What’s New in ColdFusion Internationalization
        13. Relevant ColdFusion Tags/Functions
      4. Better G11N Practices
        1. What Not to Do
        2. Monolingual or Multilingual Web Sites
        3. Locale Stickiness
        4. HTML
        5. CFML
        6. Resource Bundles
        7. Just Use Unicode
        8. When ColdFusion Isn’t Enough
    11. 51. Error Handling
      1. Catching Errors as They Occur
        1. What Is an Exception?
        2. Introducing <cftry> and <cfcatch>
        3. Basic Exception Handling
          1. A Typical Scenario
          2. A Basic Template, Without Exception Handling
          3. Adding <cftry> and <cfcatch>
        4. Understanding What Caused the Error
        5. Writing Templates That Work Around Errors
          1. Working Around a Failed Query
          2. Working Around Errors Silently
        6. Writing Templates That Recover from Errors
        7. Nesting <cftry> Blocks
        8. Deciding Not to Handle an Exception
          1. Exceptions and the Notion of Bubbling Up
          2. Using <cfrethrow>
        9. Examining Exception Messages to Improve Usability
        10. Using Exception Handling In UDFs
          1. Creating the UDFs
          2. Using the UDFs
      2. Throwing and Catching Your Own Errors
        1. Introducing <cfthrow>
          1. Throwing Custom Exceptions
          2. Creating Custom Exception Families
          3. Custom Exceptions and Custom Tags
        2. Exceptions and Database Transactions
    12. 52. Using the Debugger
      1. Overview
        1. Traditional Forms of Debugging
        2. Introducing Step Debugging
      2. Installing the Debugger
      3. Configuring ColdFusion and the Debugger
        1. Configuring the ColdFusion Administrator
          1. Enable Debugger Settings
          2. Configuring RDS to Secure the Server
          3. Increase Maximum Request Timeouts
          4. Special Considerations for MultiServer Deployment
        2. Configuring Eclipse
          1. Configuring RDS
          2. Debug Mappings
          3. Debug Settings: Variables Shown and Stop on Error
          4. Manage Debug Configurations
      4. Using the Debugger
        1. Opening a file (within a Project)
          1. Defining a New Project
          2. Switching to the Debug Perspective
          3. Opening a File
        2. Setting a Breakpoint
        3. Starting a Debugging Session
          1. When Starting a Debug Session Fails
        4. Browsing a Page to Be Debugged
          1. What You, the Developer, See
          2. What the User Sees
          3. Beware Page Timeouts
        5. Stepping Through Code
          1. Stepping Line by Line: Step Over, Step Into
          2. Step Return and Resume
        6. Observing Variables and Expressions
          1. The Variables Pane
          2. The Expressions Pane
          3. Changing Variables on the Fly
        7. Observing the Debug Output Buffer
          1. Server Output Buffer
          2. Browser
        8. Stopping the Debugger
          1. Terminating Debugging Within the Debugger
          2. Forcing Termination from the Server
    13. 53. Managing Your Code
      1. Coding Standards
        1. Separate Processing-oriented Code from Presentation-oriented Code
        2. Avoid Overuse of Subqueries in a Select Statement
        3. USE <cfQueryparam>
        4. Don’t Reassign Variable Values with Each Request
        5. Don’t Use If Statements to Test for the Existence of Variables
        6. Use <cfparam> at the Top of Your Templates
        7. Always Scope Your Variables
        8. Use <cfswitch> and <cfcase> in Place of <cfif>
        9. Don’t Overuse the # Sign
        10. Avoid Overuse of the <cfoutput> Tag
        11. Reduce White Space in Your Output
        12. Comment, Comment, Comment
      2. Documentation
      3. Version Control
        1. Planning for Version Control
        2. Version-Control Systems
    14. 54. Development Frameworks
      1. Why Use a Development Methodology or Framework?
      2. The Model Viewer Controller Design Pattern
      3. Fusebox
        1. How Fusebox 5.1 Works
          1. Using Fusebox to Display a List of Contacts
        2. Fusebox Benefits
        3. Drawbacks
      4. Mach-II
        1. How Mach-II Works
          1. Mach-II Building Blocks
          2. Further Exploration of the Contact Manager Example
        2. Mach-II Benefits
        3. Mach-II Drawbacks
      5. Model-Glue: Unity
        1. How Model-Glue Works
          1. A Simplified Contact Manager in Model-Glue
          2. Solving Common OOP Problems with Model-Glue: Unity
          3. Model-Glue: Unity Benefits
          4. Model-Glue: Unity Drawbacks
      6. Issues to Consider with All Development Frameworks
      7. Conclusions
  7. Appendices
    1. C. ColdFusion MX 8 and ICU4J-Supported Locales
      1. Introduction
    2. D. Locale Differences
      1. Introduction
  8. IX. Creating High-Availability Applications
    1. 55. Understanding High Availability
      1. High Availability Explained
      2. How Do I Know My Server Load?
        1. Load and Performance Testing
      3. The High-Availability Plan: Seven Must-Haves for Building High-Availability Solutions
        1. Implement a Load-Balanced Web-Server Cluster
          1. Software-Based Load Balancing
          2. Hardware-Based Load Balancing
          3. Combination Software and Hardware Load Balancing
        2. Choose a Network Provider with Circuit Redundancy
        3. Install a Firewall
        4. Use RAID Level 5 on Database Servers
        5. Calculate Acceptable Risk
        6. Redundant Server Components vs. Commodity Computing
        7. Disaster Planning
      4. Some Truths About Web Hosting
      5. Active Site Monitoring
      6. The Quality-of-Service Guarantee
      7. What Next?
    2. 56. Monitoring System Performance
      1. Monitoring Your ColdFusion 8 Server
        1. Developing a Baseline
        2. Historical Analysis
        3. Analyzing ColdFusion Log Files
          1. Other Logs
        4. JRun Metrics
        5. Analyzing Web Server Log Files
      2. Active Monitoring
        1. Server Probes
          1. Setting Up a Probe to Verify Content
        2. Other Probes
          1. Setting Up a System Probe to Verify External Connectivity
        3. The ColdFusion Server Monitor
          1. Starting Monitors
          2. Tracking Memory Utilization
          3. Monitoring the Database
          4. Monitoring ColdFusion Errors
          5. Using Server Statistics for Tuning
          6. ColdFusion Monitor Alerts and Snapshots
          7. Server Monitor API
      3. Deciding What to Do Next
        1. Some Issues to Consider When Looking for Performance Problems
        2. Typical Bottlenecks
    3. 57. Scaling with ColdFusion
      1. The Importance of Scaling
      2. Scaling Considerations
        1. Tiered Application Architecture
          1. Front-End Servers Vs. Back-End Servers
        2. Server and Hardware Components
        3. Considerations for Choosing a Load-Balancing Option
          1. Round-Robin DNS
        4. User-Request Distribution Algorithms
        5. Session State Management
        6. Failover
        7. Mixed Web Application Environments
      3. How to Write ColdFusion 8 Applications That Scale
        1. Code Organization
        2. Modularity
          1. Multithreading and Asynchronous Processing
        3. Streamlined, Efficient Code
        4. Avoiding Common Bottlenecks
          1. Querying a Database
          2. Absolute Path, Relative Path, and Other Links
          3. Nesting Files Too Deeply
      4. Keeping Web Site Servers in Sync
        1. What to Maintain?
        2. Archive and Deploy
        3. Other Options
      5. Multiple ColdFusion 8 Instances
      6. Hardware vs. Software Load Balancing Options
        1. ColdFusion 8 Load Balancing and Software-Based Load Balancing
        2. Dedicated Load-Balancing Hardware
      7. Scaling with ColdFusion 8 Load Balancing
        1. Understanding ColdFusion 8 Load Balancing
        2. Configuring a Load Balanced Cluster
      8. Hardware Load-Balancing Options
        1. LocalDirector
        2. Load-Balancing Algorithms
        3. Big IP
      9. Finishing Up
    4. 58. Scaling with J2EE
      1. Benefits of Deploying ColdFusion on J2EE Application Server
        1. Standards-Based
        2. Multiple Platforms
        3. Support for Legacy Infrastructure and Prior Investments
        4. Inheritance of Multiplatform Interoperability
      2. Development Values of ColdFusion 8 on J2EE
        1. Deploying Rich Internet Applications in Java
        2. Extending the Platform
        3. Ease of Development
        4. Leveraging Diverse Developer Skill Sets
        5. Using J2EE Built-In Security Features
        6. Improving Web Site Scalability
          1. Tiered Infrastructure
          2. Native Load Balancing and Failover
      3. How ColdFusion Lives on Top of Java Server
        1. Coding Implications from the Developer’s Perspective
          1. J2EE Session Management
      4. Scaling with ColdFusion and JRun
        1. Configuring a JRun Cluster
        2. Managing a JRun Cluster
      5. Scaling with Other Java Application Servers
      6. Tuning the Java Virtual Machine
        1. Introducing the JVM
        2. Tuning Garbage Collection
        3. Selecting a Collector
        4. Testing and Tuning
      7. Summary
    5. 59. Managing Session State in Clusters
      1. What Is Session State?
      2. The History of Managing State
        1. Enter Cookies
        2. Why Maintain State?
      3. Options for Managing Session State
        1. A Little About Server-Side ColdFusion CLIENT, APPLICATION, SERVER, and SESSION Variables
        2. Embedding Parameters in a URL or a FORM Post
        3. Cookies
        4. SESSION Variables vs. CLIENT Variables
        5. Keeping the User on the Same Machine
        6. Using a Central CLIENT Variable Repository
        7. Java Sessions
        8. Serializing ColdFusion Components
        9. Hardware-Based Session Management
        10. Hybrid Solutions
    6. 60. Deploying Applications
      1. Deployment Options
      2. ColdFusion Archives
        1. Defining the Archive
          1. Modifying the Definition
          2. Deleting the Definition
        2. Building the Archive
        3. Deploying the Archive
      3. J2EE Archives
        1. Defining J2EE Archives
          1. Modifying the Definition
          2. Deleting the Definition
          3. J2EE Archive Definition Considerations
        2. Deploying the Archive
          1. J2EE Archive Deployment Considerations
      4. ColdFusion Compiler
        1. Compiling Sourceless Templates
        2. Precompiling ColdFusion Templates
        3. ColdFusion Template Deployment Considerations
        4. Customizing the cfcompile Script
      5. Choosing the Right Deployment Option
  9. X. Ensuring Security
    1. 61. Understanding Security
      1. Security Risks
        1. What Is ColdFusion’s Concern and What Is Not
      2. Encryption
        1. Cleartext Risks
        2. ColdFusion Encryption Functions
        3. How Encrypt() and Decrypt() Work
        4. Encrypt() and Decrypt()Parameters
          1. string
          2. key
          3. algorithm
          4. encoding
          5. IVorSalt
          6. iterations
        5. ColdFusion’s Hash() Function
          1. string
          2. algorithm
          3. encoding
          4. Forcing a Page Request to Use SSL
          5. SSL Liabilities
          6. Securing ColdFusion in Distributed Mode
      3. Browser Validation
        1. Cross-Site Scripting (XSS)
          1. The Scriptprotect Setting
        2. Form and URL Hacks
        3. Validation Techniques
        4. File Uploads
      4. Authentication and Authorization
    2. 62. Securing the ColdFusion Administrator
      1. Administrator Security Options
      2. Administrator Page
      3. RDS Page
      4. User Manager Page
        1. Creating a New User
    3. 63. ColdFusion Security Options
      1. ColdFusion Security Framework
        1. Development Security
        2. User Security
          1. About Authentication
          2. About Authorization
          3. Security Tags and Functions
          4. Authenticating with <cflogin>
          5. Storing Login Information
          6. Best Practice: ColdFusion Sessions and CFLOGIN
          7. Logging Out
        3. Basic ColdFusion Login Example
      2. ColdFusion Login Wizard Extension
        1. ColdFusion Login Wizard Example
    4. 64. Creating Server Sandboxes
      1. Understanding Sandboxes
        1. Understanding File and Directory Permissions
        2. Changes in ColdFusion MX
          1. Changes in ColdFusion MX 7
          2. Changes in ColdFusion 8
          3. ColdFusion Edition Differences
          4. Security Defaults
      2. Creating and Securing Applications Using Sandboxes
        1. Enabling Sandbox Security
        2. Adding a Sandbox
        3. Configuring Your Sandbox
        4. The Blackbox Sandbox Example
    5. 65. Security in Shared and Hosted Environments
      1. CFML-Based Risks
      2. Securing ColdFusion ServiceFactory
      3. Securing RDS
        1. Enabling RDS Password Security
        2. Disabling RDS on Production Servers
      4. Applying ColdFusion Sandbox Security
      5. Securing Multiple Server Configurations
        1. Configuration Issues for Multi-homed Web Servers
          1. Problems with the Stand-Alone Web Server and Web Server Path Caching
          2. Issues with ColdFusion Administrator Access
          3. Access to CFIDE/scripts
      6. Configuring ColdFusion for Multiple Hosts
        1. Microsoft IIS 5.x, 6.0, and 7.0
        2. Creating the JRun Connector ISAPI Filter and the JRunScripts Virtual Directory
        3. Adding the ColdFusion Extensions
        4. Sun Java System Web Server
      7. Other Issues
        1. Running ColdFusion as a User
        2. Adobe Flex and LiveCycle Integration
          1. Flash Gateway Adapters
          2. Flash Gateway Security
        3. Disabling JSP Functionality
        4. Securing the CFIDE Directory
        5. Limiting Session Timeout Values
        6. Removing Help Docs and Example Applications
        7. Setting Debugging Restrictions
        8. Encrypting ColdFusion Templates
        9. Handling Error Messages
        10. Setting Custom Tag Paths
        11. Setting the File Name Extension
        12. Adding the Default Document
      8. Staying Informed
    6. 66. Using the Administrator API
      1. Understanding the Admin API
      2. Building Custom Admin Consoles
        1. The Façade Component
      3. Security Implications for the Admin API
        1. ColdFusion ServiceFactory
        2. Admin API Security Risks
        3. Securing the Admin API
          1. ColdFusion Administrator Security
          2. Securing the Admin API Directory
        4. Securing the Façade Component
      4. Admin API Best Practices
        1. Admin API Configuration
        2. Custom Console Coding Best Practices
  10. XI. Extending ColdFusion
    1. 67. Using Server-Side HTTP and FTP
      1. Overview
      2. <cfhttp>
        1. Errors and Results for a <cfhttp> Call
        2. Using the <cfhttpparam> Tag
      3. Putting <cfhttp> to Use
        1. Using the GET Method
        2. Building a Query from a Text File
        3. Using the POST Method
        4. Creating Intelligent Agents with <cfhttp>
          1. Server Interaction with Intelligent Agents
          2. Interacting with Planned Agents
        5. Summarizing the <cfhttp> Tag
      4. <cfftp>
        1. Connection Operations with <cfftp>
        2. File and Directory Operations with <cfftp>
        3. Errors and Results for a <cfftp> Call
      5. Putting <cfftp> to Use
        1. Displaying Available Files
        2. Using <cfftp> to Download a File
        3. Using <cfftp> to Upload a File
        4. Secure FTP Connections
        5. Summarizing the <cfftp> Tag
    2. 68. Creating and Consuming Web Services
      1. Understanding Web Services
        1. Evolution of the Web
        2. Business Models
          1. Provider Model
          2. Consumer Model
          3. Syndication Model
        3. Core Technologies
          1. HTTP (Hypertext Transfer Protocol)
          2. XML (Extensible Markup Language)
          3. SOAP (Simple Object Access Protocol)
          4. WSDL (Web Services Description Language)
          5. UDDI (Universal Description, Discovery, and Integration)
      2. WSDL
      3. Creating Web Services
        1. Components
        2. Defining Complex Data Types
      4. Consuming Web Services
        1. Consult the WSDL
        2. Invoking ColdFusion Web Services
          1. createObject()/<cfobject>
          2. <cfinvoke>
        3. Complex Data Types
        4. Invocation with Dreamweaver
        5. Invoking .NET Web Services
        6. Invoking Java Web Services
        7. Database Web Services
        8. Dealing with Generated WSDL
      5. Working with SOAP Requests
        1. Calling Web Services with Nillable Arguments
      6. Best Practices
        1. Error Handling
        2. Configuring in ColdFusion Administrator
        3. Security
    3. 69. Working with Feeds
      1. Why Use Feeds?
      2. Flavors of RSS and Atom
      3. Creating Feeds
      4. Reading Feeds
        1. Using Dublin Core and iTunes Extensions
          1. Dublin Core Extensions
          2. iTunes Extensions
    4. 70. Interacting with the Operating System
      1. Introduction to <cffile>
        1. The Varied Faces of <cffile>
      2. Accessing the Server’s File System
        1. Reading and Writing Files
        2. Copying, Moving, Renaming, and Deleting Files
      3. Uploading Files
        1. What If the File Already Exists on the Server?
        2. Determining the Status of a File Upload
        3. Building an Upload Interface
      4. Using File Functions
        1. Getting File Information
        2. Reading Files with <cfloop>
      5. Manipulating Folders on the Server with <cfdirectory>
        1. Using <cfdirectory>
        2. Getting the Contents of a Directory
        3. Building a Simple File Explorer
      6. Executing Programs on the Server with <cfexecute>
      7. Interacting with the System Registry Using <cfregistry>
      8. Working with Zip Files
        1. Creating Zip Files
        2. Expanding Zip Files
        3. Listing, Reading, and Deleting from Zip Files
        4. Working with <cfzipparam>
    5. 71. Server-Side Printing
      1. Overview
      2. Using <CFPRINT>
        1. Printing to the Default Printer
        2. Printing to Another Printer
      3. Controlling Printer Capabilities
        1. Primary <CFPRINT> Attributes
        2. Printer-Dependent Attributes
          1. Example: Determining One Printer’s Available Attributes
          2. Passing Printer-Dependent Attributes with AttributeStruct
        3. The fidelity Attribute
        4. Java Print Services and Attributes
        5. Additional <CFPRINT> Attributes
      4. Determining Available Printers
        1. Determining Available Printers
          1. What About Other Printers?
        2. Printer Permissions
      5. Related Features
        1. Print Log
        2. Using <CFTHREAD>
        3. Printing Other than PDFs
    6. 72. Interacting with Directory Services
      1. Understanding LDAP
        1. Directory Structures
        2. Name Conventions
      2. Using <cfldap>
        1. Tag Overview
        2. The ACTION Attribute
        3. The SCOPE Attribute
        4. The MODIFYTYPE Attribute
        5. The SECURE Attribute
      3. Querying Public LDAP Servers
      4. Interacting with Directories
        1. Active Directories
        2. Querying Directories
        3. Adding Entries
        4. Modifying Entries
          1. Modifying Existing Attribute Values
          2. Modification by Adding Entries
          3. Modifying Entries with ModifyType
          4. Modifying a Distinguished Name
        5. Deleting Entries
      5. Building an LDAP CFC
    7. 73. Integrating with Microsoft Exchange
      1. ColdFusion Exchange Server Tags
        1. <cfexchangeconnection>
        2. <cfexchangecalendar>
        3. <cfexchangecontact>
        4. <cfexchangefilter>
        5. <cfexchangemail>
        6. <cfexchangetask>
      2. Managing Exchange Server Connections
        1. Connection Requirements
        2. Persistent Connections
        3. Transient Connections
        4. Delegate Account Access
      3. Managing Exchange Server Items
        1. Retrieving Exchange Items and Attachments
        2. Deleting Exchange Items
        3. Modifying Exchange Items
          1. Managing Meeting Notifications and Requests
    8. 74. Integrating with .NET
      1. .NET Fundamentals
      2. Accessing .NET Services
        1. ColdFusion and .NET Local Integration Example
        2. ColdFusion and .NET Remote Integration Example
        3. .NET DataTable to ColdFusion Query Conversion Example
      3. .NET Web Service: Returning a Simple Type
        1. ColdFusion and .NET Web Service Integration Example
      4. .NET Web Service: Returning a Complex Type
      5. ColdFusion Web Service: Returning a Complex Type
      6. Summing Up
    9. 75. Extending ColdFusion with COM
      1. Understanding COM
      2. Working with COM Objects in ColdFusion
        1. Using COM with <cfobject>
        2. Using COM with CreateObject()
        3. Setting and Retrieving Properties
          1. Nested Attributes and Previous Versions of ColdFusion
          2. Nested Attributes and ColdFusion 8
        4. Using Methods
        5. ColdFusion Is Mostly Typeless; COM Is Mostly Not
        6. Registering Objects
        7. Viewing Objects with OLEView
        8. Accessing Remote Objects
      3. New Techniques for Improving Performance and Reliability
        1. Storing Objects in Shared Memory Scopes
          1. Creating a Custom Tag to Make the Practice Easier
        2. Creating Java Stubs for COM Objects
          1. Creating the Java Stub
          2. Using the Stub
        3. Using CFCs to Represent COM Objects
      4. Passing Complex Datatypes to COM Objects
      5. Common Questions and Problems
        1. Releasing COM Objects
        2. Troubleshooting COM
          1. COM Error 0x5 (Access Is Denied)
          2. COM Error 0x80040154 (Class Not Registered)
          3. COM Error 0x800401F3 (Invalid Class String)
    10. 76. Integrating with Microsoft Office
      1. Office Open XML
        1. Creating a New OOXML Container
        2. Accessing an Existing Container
      2. Word OOXML Containers
        1. Creating a New Word OOXML File
        2. Viewing a Word OOXML File
        3. Creating a Dynamic Word OOXML Document
      3. Excel OOXML Containers
        1. Creating a Dynamic Excel OOXML Document
        2. Building the OOXMLExcel Component
        3. Creating a Worksheet as a Structure
        4. Calling the OOXMLExcel Component
      4. Automation
    11. 77. Extending ColdFusion with CORBA
      1. Introduction to CORBA
        1. Who Is the OMG?
      2. How CORBA Works
        1. Object Request Broker
          1. OMG Interface Definition Language
      3. Configuring ColdFusion to Work with CORBA
      4. Working with CORBA in ColdFusion
        1. Handling CORBA Exceptions
    12. 78. Extending ColdFusion with Java
      1. Using Java Class Objects
        1. Instantiating Objects and Calling Methods
          1. <cfobject> and CreateObject(): Separated at Birth?
        2. Working with Constructors
        3. A Practical Example: Creating Histograms
        4. Using External Java Classes
          1. A Practical Example
        5. Managing Method-Selection Problems
      2. Using JavaBeans
      3. Using Tag Libraries
        1. Finding Tag Libraries
        2. Installing the Tag Library
        3. Importing the Library with <cfimport>
        4. Using the Tag Library’s Tags
        5. Using the Google Map Tag Library
        6. Creating Your Own JSP Tag Libraries
      4. Accessing the Underlying Servlet Context
      5. Integrating with Java Servlets and JSP Pages
        1. Understanding Which Variables Can Be Shared
        2. Sharing REQUEST Variables
          1. Shared Variables and Case-Sensitivity
          2. Shared Variables and Data Types
          3. Shared Variables and Multifaceted Values
        3. A Simple Example
      6. Integrating with EJBs
        1. A Simple Example
        2. Making It Easier with a Custom Tag
      7. Writing Java CFX Tags
    13. 79. Extending ColdFusion with CFX
      1. What Are CFX Tags?
        1. When to Write (and Avoid Writing) a CFX Tag
        2. Choosing Between C++ and Java
      2. Introducing the CFX API
        1. Working with the Tag’s Attributes
        2. Returning Variables and Text
        3. Working with Queries
        4. Working with Exceptions and Debugging
      3. Writing CFX Tags with Java
        1. Getting Started
          1. Writing the Java Code
          2. Understanding the Java Code
          3. Compiling the CFX Tag
          4. Registering the New Tag
          5. Using the New Tag
        2. A Word on Exceptions
        3. Returning Query Objects
          1. Writing the Java Code
          2. Using the New Tag in ColdFusion
        4. Writing CFX Tags with Visual C++
        5. Getting Started
          1. Installing the Tag Wizard and Libraries
        6. Starting a New CFX Tag Project
        7. Writing the C++ Code
        8. Compiling Your New CFX Tag
        9. Registering the New Tag
        10. Using the New Tag
        11. Other C++ Examples
      4. Generating Debug Output
      5. Returning Structures from CFX Tags
        1. CFX Tags Are Smart, Too
        2. An Important Warning
      6. Using CFX Tags Safely: Locking and Thread Safety
        1. Understanding Thread Safety
        2. Locking CFX Tags with <cflock>
        3. If the CFX Tag Works with Files
        4. Keeping the Page Itself in Mind
      7. Using CFX Tags with Previous Versions of ColdFusion
    14. 80. Working with Gateways
      1. What Is an Event Gateway?
        1. Categories of Event Gateways
        2. Creating a Simple Gateway Application
        3. Creating an Event Gateway Instance
      2. Creating an Initiator Application Using the ColdFusion Gateway
      3. Debugging CFML Applications for Event Gateways
      4. Creating Your Own Custom Gateways
        1. ColdFusion Event Gateway Architecture
        2. Event Gateway Elements
          1. Gateway Interface
          2. Gateway Services Class
          3. CFEvent Class
          4. Gateway Helper Class
          5. Gateway Configuration Files
          6. Gateway Development Tools
      5. A POP3 Custom Gateway
        1. Deploying a Custom Event Gateway
    15. 81. Integrating with SMS and IM
      1. Understanding IM
        1. Understanding Presence
        2. Creating a Development Environment
        3. XMPP Clients
      2. Defining IM Gateways
        1. The Gateway Configuration File
        2. Creating the Gateway Instance
      3. Creating Your First IM Application
        1. Generating IM Messages
        2. Making New Friends
        3. User Status Management
        4. The IM Gateway Helper
          1. Buddy List Management
          2. Gateway Status Management
          3. Permission Management
          4. Gateway Configuration
      4. Creating Interactive Applications
      5. Understanding SMS
        1. Testing Your SMS Applications
        2. Getting Your Messages Out
      6. Defining SMS Gateways
      7. Generating SMS Messages
      8. Responding to SMS Messages
        1. Ensuring Delivery of Your Messages
          1. Sessions and SMS
      9. Extending Your Application Even Further

Product information

  • Title: Adobe ColdFusion 8 Web Application Construction Kit, Volume 3: Advanced Application Development
  • Author(s): Ben Forta, Charlie Arehart, Jeffrey Bouley, Jeff Tapper, Matt Tatam, Raymond Camden, Robi Sen, Sarge Sargent
  • Release date: December 2007
  • Publisher(s): Adobe Press
  • ISBN: 9780321550057