Adobe 38043740 - ColdFusion Standard - Mac, COLDFUSION 9 User manual

  • Hello! I am an AI chatbot trained to assist you with the Adobe 38043740 - ColdFusion Standard - Mac User manual. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
Developing Applications
ADOBE
®
COLDFUSION
9
®
Last updated 1/20/2012
Copyright
© 2009 Adobe Systems Incorporated. All rights reserved.
Developing Adobe® ColdFusion® 9 Applications
This guide is licensed for use under the terms of the Creative Commons Attribution Non-Commercial 3.0 License. This License allows users to copy, distribute,
and transmit the guide for noncommercial purposes only so long as (1) proper attribution to Adobe is given as the owner of the guide; and (2) any reuse or
distribution of the guide contains a notice that use of the guide is governed by these terms. The best way to provide notice is to include the following link. To
view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/3.0/
Adobe, the Adobe logo, ColdFusion, and Flash are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other
countries. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. All other trademarks are the property
of their respective owners.
Adobe Systems Incorporated, 345 Park Avenue, San Jose, California 95110, USA.
iii
Last updated 1/20/2012
Contents
Chapter 1: What’s New
What’s new in ColdFusion 9.0 Update 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
What’s new in ColdFusion 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Chapter 2: Introduction
Using the Developing ColdFusion Applications guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
About Adobe ColdFusion 9 documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 3: Introducing ColdFusion
About Internet applications and web application servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
About ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
About J2EE and the ColdFusion architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 4: The CFML Programming Language
Elements of CFML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Using ColdFusion Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Using Expressions and Number Signs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Using Arrays and Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Extending ColdFusion Pages with CFML Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Using Regular Expressions in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Chapter 5: Building Blocks of ColdFusion Applications
Creating ColdFusion Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Writing and Calling User-Defined Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Building and Using ColdFusion Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Creating and Using Custom CFML Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Building Custom CFXAPI Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Chapter 6: Developing CFML Applications
Designing and Optimizing a ColdFusion Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Handling Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Using Persistent Data and Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Using ColdFusion Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Securing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Developing Globalized Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Debugging and Troubleshooting Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Using the ColdFusion Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Chapter 7: Accessing and Using Data
Introduction to Databases and SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Accessing and Retrieving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Updating Your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Using Query of Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Managing LDAP Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
iv
DEVELOPING COLDFUSION 9 APPLICATIONS
Contents
Last updated 1/20/2012
Building a Search Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Using Verity Search Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Solr search support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Chapter 8: ColdFusion ORM
Introducing ColdFusion ORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Configure ORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Define ORM mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
Working with objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
Using queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Transaction and concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
Performance optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
ORM session management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Event Handling in CFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
Autogenerating database schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Support for multiple data sources for ORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Chapter 9: Flex and AIR Integration in ColdFusion
Using the Flash Remoting Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
Using Flash Remoting Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
Offline AIR Application Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Proxy ActionScript Classes for ColdFusion Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Using the LiveCycle Data Services ES Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
Using Server-Side ActionScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
Chapter 10: Requesting and Presenting Information
Introduction to Retrieving and Formatting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
Building Dynamic Forms with cfform Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
Validating Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
Creating Forms in Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Creating Skinnable XML Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783
Using Ajax User Interface Components and Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
Using Ajax Data and Development Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
Chapter 11: Office file interoperability
Using cfdocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
Using cfpresentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
Using cfspreadsheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Supported Office conversion formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
SharePoint integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 894
Chapter 12: ColdFusion Portlets
Run a ColdFusion portlet on JBoss Portal Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
Common methods used in portlet.cfc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
ColdFusion portlet components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
JSR-286 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
Run a ColdFusion portlet on WebSphere Portal Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
v
DEVELOPING COLDFUSION 9 APPLICATIONS
Contents
Last updated 1/20/2012
Chapter 13: Working with Documents, Charts, and Reports
Manipulating PDF Forms in ColdFusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 914
Assembling PDF Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 930
Creating and Manipulating ColdFusion Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 959
Creating Charts and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 982
Creating Reports and Documents for Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1007
Creating Reports with Report Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015
Creating Slide Presentations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1048
Chapter 14: Using Web Elements and External Objects
Using XML and WDDX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058
Using Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1093
Using ColdFusion Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122
Integrating J2EE and Java Elements in CFML Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1125
Using Microsoft .NET Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1149
Integrating COM and CORBA Objects in CFML Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1170
Chapter 15: Using External Resources
Sending and Receiving E-Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1192
Interacting with Microsoft Exchange Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1207
Interacting with Remote Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233
Managing Files on the Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1243
Using Event Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1254
Using the Instant Messaging Event Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276
Using the SMS Event Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292
Using the FMS event gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1308
Using the Data Services Messaging Event Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1311
Using the Data Management Event Gateway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316
Creating Custom Event Gateways . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1320
Using the ColdFusion Extensions for Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1334
1
Last updated 1/20/2012
Chapter 1: What’s New
The following sections explain what is new and changed in ColdFusion 9 and ColdFusion 9 update.
What’s new in ColdFusion 9.0 Update 1
Area What’s new and changed
Language Support for the following:
for-in construct (for arrays) in CFScript
var declaration within for loop in CFScript
Function argument metadata
Function equivalents for cfile action="upload" (FileUpload) and cffile
action="uploadall" (FileUploadAll)
The following script functions have been implemented as CFCs:
dbinfo
imap
pop
ldap
feed
Caching
New function cacheGetSession
New parameter template in the function cacheGetMetadata
cacheGetProperties and cacheSetProperties support
diskSpoolBufferSizeMB, clearOnFlush, and
diskExpiryThreadIntervalSeconds
Using user-defined caching regions in all cache functions except
cacheGetProperties and cacheSetProperties
IIS 7 IIS 7 configuration for ColdFusion has no dependency on IIS 6 Metabase compatibility.
2
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
ColdFusion Ajax
Support for CFCs outside webroot
ColdFusion.FileUpload.getselectedfiles returns the status of upload
operation
While using cffileupload, the url attribute is now optional and it defaults to
cgi.script_name
Support for selecting multiple rows in cfgrid
Support for turning on/off grid column headers
New attribute autoExpand in cfgridcolumn
Supports mask attribute for HTML grids
The fileupload control now passes session information implicitly to the target page if
session management is turned on either in Application.cfc or Application.cfm.
Added the following JavaScript Functions:
ColdFusion.Autosuggest.getAutosuggestObject
ColdFusion.Layout.disableSourceBind
ColdFusion.Layout.enableSourceBind
Coldfusion.fileUpload.setUrl
ColdFusion.grid.getSelectedRows
ColdFusion.Map.show
ColdFusion.Map.hide
ColdFusion.Map.refresh
ColdFusion.Grid.getTopToolbar
ColdFusion.Grid.getBottomToolbar
ColdFusion.Grid.showTopToolbar
ColdFusion.Grid.hideTopToolbar
ColdFusion.Grid.showBottomToolbar
ColdFusion.Grid.hideBottomToolbar
ColdFusion.Grid.refreshTopToolbar
ColdFusion.Grid.refreshBottomToolbar
Area What’s new and changed
3
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
ORM
Supports multiple data sources for ORM in ColdFusion applications
The following enhancements:
New attribute MappedSuperClass added to cfcomponent/component
New attributes skipCFCWithError and automanagesession added to
the
ormsettings struct in the THIS scope of Application.cfc
Attribute missingrowignored in cfproperty now supports one-to-
one relationship
The function EntityNew takes the property values as struct in a
second argument
Amazon S3 Support ColdFusion customers can now store data in Amazon S3.
SpreadSheet Support for the following:
New functions SpreadsheetRemoveSheet and SpreadsheetFormatCellRange
New attribute excludeHeaderRow in cfspreadsheet
Performance improvements for formatting huge number of rows and columns using the
SpreadSheet format functions
Preformatting of a cell while you use SpreadSheetformatcell or
SpreadSheetformatcellrange
Vertical alignment in format struct using the key verticalalignment
AIR integration The following enhancements:
Support for auto-generating primary keys
Support for encrypted database (introduced in AIR 1.5)
Cache file used by ActionScript ORM to track the operations on SQLite database is now
in the applicationStoragedirectory instead of applicationDirectory. You can specify the
location of the cahceDirectory in openSession API on syncmanager
Self Join relationships for one-to-one, one-to-many and many-to-many database
relationships
Supports both Array and ArrayCollection for use in ActionScript Entity to represent a
collection in a database relationship
ActionScript ORM logs all the SQL statements that ORM uses to persist entities into the
SQLite database
New APIs keepClientObject and keepAllClientObjects to ensure that the server
updates are not retained when ColdFusion server raises conflict
The class SessionToken is dynamic and therefore, data can be stored on the token
returned from the ORM APIs
Supports autocommit mode
Flash Remoting A channel-definition construct has been introduced in services-config.xml
(CF_root/wwroot/WEB-INF/flex/) named serialize-array-to-arraycollection.
Area What’s new and changed
4
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
BlazeDS 4 and LCDS Support for the following:
LCDS 3 and LCDS 3.1
BlazeDS 4
New methods allowSend and allowSubscribe in ColdFusion Messaging Gateway
CFCs
Solr Apart from overall improvement in the accuracy of indexing, the following enhancements:
Displays correct MIME types for all documents
Enhanced support for indexing of metadata for binary files
Support for the attribute previousCriteria (in the tag cfsearch)
Both the tags cfindex and cfsearch support the attribute categoryTree
Option to enable/disable term highlighting for entire document
Logging The following enhancements
ColdFusion generates log files for the following services: http, ftp, web service, Portlet,
Derby, and Feed
Enable/Disable logging: A new icon has been added in the Actions column of the Log
Files page (ColdFusion Administrator > Debugging & Logging)
Support for automatic logging of scheduled tasks
Server monitoring Enhancements in this release help you use Server Monitoring effectively in load conditions.
ColdFusion Administrator has the following monitoring options: Enable monitoring,
Enable profiling, and Enable memory tracking.
Configurable seed for password
encryption
Option to specify a new seed value to encrypt data source passwords
OEM upgrades The following versions are supported:
Microsoft .NET Framework 4
Ehcache 2.0
Hibernate 3.5.2
ExtJS 3.1
Solr 1.4
DataDirect Connect for JDBC 4.1
MySQL 5.1.11
Other enhancements
Application.cfc lets you specify data source authentication details in the attribute
datasource
Support for HQL in cfquery
•New actions for cfpdf AIR Proxy
The ActionScript proxy class for PDF service has the following new attributes:
extracttext and extractimage
CFID, CFTOKEN, and jsessionid are marked httpOnly
Area What’s new and changed
5
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
What’s new in ColdFusion 9
ColdFusion 9 offers new and enhanced features that help you develop and manage applications effectively. This release
provides improved application performance with more granular control over code, templates, and applications.
The following is a list of top new features for ColdFusion 9.
ORM support
ColdFusion Object-relational mapping (ColdFusion ORM) is a powerful Rapid Application Development (RAD)
solution to build data-centric applications. It provides a bridge between relational databases and ColdFusion
components by allowing you to build applications using only objects, without writing any SQL code. It uses the open-
source Hibernate library as the underlying engine.
ColdFusion ORM provides:
Enterprise infrastructure for Rapid Application Development
In-built performance optimization that include caching and lazy loading
Cleaner and more manageable application code
Database vendor independence
For more information, see ColdFusion ORM.
Flex and AIR integration
Adobe AIR applications
Offline capabilities Offline application support for AIR applications includes data persistence and synchronization.
ColdFusion uses SQLite in the client and ORM on the server to automatically manage conflict resolution and data
synchronization when the application comes back online.
ActionScript proxies For AIR/Flex clients to access ColdFusion services. The MXML tags can map to ColdFusion tags
on the server.
For more information, see Offline AIR Application Support.
Enhanced Flash Remoting
Flash Remoting has been re-engineered in ColdFusion 9 to allow high performance and faster remoting. This release
supports circular reference.
For more information, see Using Flash Remoting Update.
Integration with BlazeDS
BlazeDS allows messaging support for ColdFusion. By default, ColdFusion installs BlazeDS.
Language enhancements
CFScript
Language constructs You can now use the following basic language constructs: throw, writedump, writelog,
location, and trace.
6
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
Script functions This release has introduced the following new functions implemented as CFCs: query, mail, http,
storedproc, pdf, and ftp.
Keywords This release has introduced keywords for abort, exit, include, param, property, rethrow, and throw.
Operations CFScript now supports import and new operations.
In addition, ColdFusion now supports the following:
Writing component and interface entirely in CFScript
Complete control over function declaration in CFScript
Java Doc style comments
Ternary operator
For more information, see Extending ColdFusion Pages with CFML Scripting.
onServerStart
ColdFusion now supports a CFC with onServerStart method that runs only when the server starts. The function is
useful for application-independent tasks, such as instantiating the applications, configuring logging, or setting up the
scheduler.
For more details, see the section onServerStart in ColdFusion CFML Reference.
Other language enhancements
Apart from new cfsrcipt features and onServerStart, this release has the following language enhancements:
Nested cftransaction
UDF name conflict resolution for CFCs
Local scope
Var scope support anywhere in functions
Implicit getters and setters for cfproperty in CFCs
Integration with other products and technologies
New Ajax controls
With ColdFusion 9, you now have access to a broader set of Ajax controls that leverage the new Ext JS 3.0 library using
CFML tags and attributes. You can utilize Ajax without knowing its inner workings and writing less code.
The new Ajax controls support:
Geographical maps
Media player
Multi-file upload
Enhanced data grid
Improved Ajax plumbing
Enhanced auto-suggest
Accordion navigation
Progress indicator
7
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
Confirm, alert, and prompt dialog boxes
Slider
For more information, see Using Ajax User Interface Components and Features.
Integration with SharePoint
The cfsharepoint tag lets you interact with Microsoft Office SharePoint Servers from a ColdFusion application. You
can now use ColdFusion with Microsoft Windows SharePoint Services 2.0 or 3.0 and Microsoft Office SharePoint
Portal Server 2003 or 2007.
You can now:
Load SharePoint actions from a ColdFusion application
Access a ColdFusion application from SharePoint using custom Web Parts
Use Single Sign-On to access and display ColdFusion applications using SharePoint
For more information, see SharePoint integration.
Office file interoperability
ColdFusion provides interfaces to work with PDF, Adobe Flash, and Adobe Connect. ColdFusion now extends the
integration support to Office applications such as Excel and PowerPoint.
Using this feature, you can:
Create, read, and update MS Excel spreadsheets using the cfspreadsheet tag
Generate PDFs from MS Word and MS PowerPoint automatically using the cfdocument tag
Generate PowerPoint presentations dynamically from HTML using the cfpresentation tag
Create Connect presentations from MS PowerPoint using the cfpresentation tag
For more information, see Office file interoperabilityOffice file interoperability.
Integration with Apache Solr server
Solr is an open-source enterprise search server based on the Lucene Java search library. It is a powerful alternative to
Verity.
Solr provides better performance while indexing and searching. You can index unlimited number of documents and
access using the
cfsearch tag.
ColdFusion provides an easy migration path from Verity. Also, Solr supports Macintosh environments.
For more information, see Solr search support and the section Solr Server and Collections in Configuring and
Administering ColdFusion.
Performance enhancements
Granular control over caching
ColdFusion 9 provides better control over caching.
The following features help to improve the performance of your application:
Caching page fragments
Caching in memory. Memory is now the default cache location.
8
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
Caching specific objects. Includes the ability to put, get, and flush cached objects.
Setting cache dependencies
Setting idle timeout
Getting metadata about cached objects
For more information, see Optimizing ColdFusion applications.
In-memory files
In-memory files allow you to dynamically generate CFM files and execute them directly from memory. Memory-based
virtual file system speeds up the processing of transient data. In-memory files are not written to disk and are saved on RAM.
In ColdFusion, in-memory files help you simplify the execution of dynamic code. Though they function in the same
manner as disk files, they are faster. In-memory files are supported across all tags and functions that take file/directory
as input or output. They work in the same manner as files saved on the disk.
For more information, see Working with in-memory files.
Improved Clustering
This release supports serialization of query, array, and datetime types in CFC.
Other performance enhancements
Improved CFC performance
Faster Java method invocation
Database enhancements
DataDirect
This release supports DataDirect driver version 4.0 SP 1. The feature helps to enhance database operations by
providing the following features:
Support for MySQL (Enterprise and Commercial editions), Oracle11g, DB2v9.5, Informix 11, and SQL Server 2008
Support for IPv6
Option to set a default query timeout value
For more information, see the DataDirect Connect JDBC Support in the Configuring and Administering ColdFusion.
Note: By default, the datasource property MaxPooledStatements is set to 100 (and not 1000 as in the previous releases)
for the drivers DB2, Informix, MSSQLServer, Oracle, Sybase, and MySQL(DataDirect). Adobe recommends that you
maintain the default number of max pooled statements to avoid memory-related issues.
datasource is optional attribute
The attribute datasource is an optional attribute for the tags cfquery, cfinsert, cfupdate, and cfdbinfo. You can
specify this in the Application.cfc.
Code Analyzer
You can migrate code from ColdFusion 7 or ColdFusion 8 to ColdFusion 9.
For more information, see Using the Code Analyzer.
9
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
Service features
ColdFusion as a service
ColdFusion exposes many existing enterprise services as web services. You can access these services using SOAP and
AMF/Flash remoting.
The following are the exposed services:
cfpdf
cfImage
cfdocument
cfmail
cfpop
cfchart
You can secure the exposed services to prevent access by unknown applications and users. You can do this by
configuring the client IP address range to which services are accessible. You can also set up user access control for the
services.
Other enhancements
Server Manager
Server Manager is an AIR-based desktop application that allows you to centrally manage multiple ColdFusion servers
from one location.
The application enables ColdFusion server administrators to monitor and manage multiple servers and apply the
settings from one ColdFusion server to other ColdFusion servers.
Server Manager provides improved system management and minimizes errors by ensuring a consistent configuration
across multiple servers or clusters.
You can use Server Manager to:
Create data sources
Schedule tasks and notify alerts
Apply hot fixes
Clear cache across a cluster of ColdFusion servers
Compare settings across servers
Monitor server health
For more information, see Working with Server Manager.
Built-in support for portlet standards
This release supports JSR-168, JSR-286, and WSRP specifications. Now you can easily build ColdFusion-powered
content for leading portal servers.
You can define a ColdFusion component as a portlet. Exposing of all enterprise applications, including ColdFusion
applications, in one integrated portal has improved application user experience.
For more information, see ColdFusion Portlets.
10
DEVELOPING COLDFUSION 9 APPLICATIONS
What’s New
Last updated 1/20/2012
PDF functionality
The following list includes new features and improved functionality:
FDF support in PDF forms
PDF package
Size optimization
Adding headers and footers to PDF documents using the cfpdf tag
Support for RGB/ARGB, cfimage and accessible images in watermarking a pdf using the cfpdf tag
Improved quality and performance of thumbnail generation
Support for extracting image and text from PDF.
For more information, see Assembling PDF Documents.
IMAP support
You can query an IMAP server to retrieve and manage mails within multiple folders using the cfimap tag.
This feature lets you:
Retrieve messages and store information in a query object. You can also download attachments in a temporary
ColdFusion folder or a new folder.
Delete any unnecessary mail or user-created folders
Mark multiple messages as read
Manage mail folders by creating folders, renaming them, or moving messages across folders
For more information, see the section cfimap in ColdFusion CFML Reference.
JRE specifications
This release includes JRE version JRE 6 Update 14 for all platforms except Solaris which has the version JRE 6 Update 12.
11
Last updated 1/20/2012
Chapter 2: Introduction
The Developing Adobe® ColdFusion® 9 Applications guide provides tools for developing Internet applications using
Adobe ColdFusion. The guide is intended for web application programmers who are learning ColdFusion or want to
extend their ColdFusion programming knowledge. It provides a solid grounding in the tools that ColdFusion provides
to develop many different types of web applications of varying complexity.
Using the Developing ColdFusion Applications guide
The Developing ColdFusion Applications guide includes basic and advanced information on CFML. However, it is most
useful if you have basic ColdFusion experience or have viewed the Getting Started experience, which is available from
the Adobe ColdFusion Administrator. Use the guide in conjunction with the CFML Reference, which contains detailed
information on the CFML language elements.
About Adobe ColdFusion 9 documentation
The ColdFusion documentation is designed to provide support for the complete spectrum of participants.
Documentation set
The ColdFusion documentation set includes the following titles:
Viewing online documentation
All ColdFusion documentation is available online in HTML and Adobe Acrobat Portable Document Format (PDF)
files. Go to the ColdFusion Help and Support page at
www.adobe.com/go/learn_cfu_support_en to view the online
documentation. In addition to viewing the online documentation, you can also add and view comments to the
documentation.
Book Description
Installing Adobe® ColdFusion® 9
Describes system installation and basic configuration for Windows, Macintosh, Solaris, Linux, and AIX.
Configuring and Administering
Adobe® ColdFusion® 9
Describes how to perform ColdFusion administration tasks such as managing server settings, configuring
datasources, managing security, deploying ColdFusion applications, caching, setting up CFX tags,
monitoring server activity using the ColdFusion Server Monitor, and configuring web servers.
Developing Adobe® ColdFusion® 9
Applications
Describes how to develop your dynamic web applications. This book provides detailed information about
using the CFML programming language and ColdFusion features, such as ColdFusion Web Services,
ColdFusion Portlets, ColdFusion ORM, AJAX support, Flex and AIR integration, and integration with other
products and technologies such as Microsoft Office, OpenOffice, and SharePoint.
Adobe® ColdFusion® 9 CFML
Reference
Provides descriptions, syntax, usage, and code examples for all ColdFusion tags, functions, and variables.
12
Last updated 1/20/2012
Chapter 3: Introducing ColdFusion
You use Adobe ColdFusion to create dynamic Internet applications.
About Internet applications and web application
servers
With ColdFusion, you develop Internet applications that run on web application servers.
About web pages and Internet applications
The Internet has evolved from a collection of static HTML pages to an application deployment platform. First, the
Internet changed from consisting of static web pages to providing dynamic, interactive content. Rather than providing
unchanging content where organizations merely advertise goods and services, dynamic pages enable companies to
conduct business ranging from e-commerce to managing internal business processes. For example, a static HTML
page lets a bookstore publish its location, list services such as the ability to place special orders, and advertise upcoming
events like book signings. A dynamic website for the same bookstore lets customers order books online, write reviews
of books they read, and even get suggestions for purchasing books based on their reading preferences.
More recently, the Internet has become the underlying infrastructure for a wide variety of applications. With the
arrival of technologies such as XML, web services, J2EE (Java 2 Platform, Enterprise Edition), and Microsoft .NET, the
Internet has become a multifaceted tool for integrating business activities. Now, enterprises can use the Internet to
integrate distributed activities, such as customer service, order entry, order fulfillment, and billing.
Adobe ColdFusion is a rapid application development environment that lets you build dynamic websites and Internet
applications quickly and easily. It lets you develop sophisticated websites and Internet applications without knowing
the details of many complex technologies, yet it lets advanced developers take advantage of the full capabilities of many
of the latest Internet technologies.
About web application servers
Typically, web browsers make requests, and web servers, such as Microsoft Internet Information Server (IIS) and the
Apache web server, fulfill those requests by returning the requested information to the browser. This information
includes, but is not limited to, HTML and FLA files.
Web server capabilities are limited because all it does is wait for requests to arrive and attempt to fulfill those requests
as soon as possible. A web server does not let you do the following tasks:
Interact with a database, other resource, or other application.
Serve customized information based on user preferences or requests.
Validate user input.
A web server, basically, locates information and returns it to a web browser.
To extend the capabilities of a web server, you use a web application server, a program that extends web server
capabilities to do tasks such as those in the preceding list.
13
DEVELOPING COLDFUSION 9 APPLICATIONS
Introducing ColdFusion
Last updated 1/20/2012
How a web server and web application server work together
The following steps explain how a web server and web application server work together to process a page request:
1 The user requests a page by typing a URL in a browser, and the web server receives the request.
2 The web server looks at the filename extension to determine whether a web application server must process the
page. Then, one of the following actions occur:
If the user requests a file that is a simple web page (often one with an HTM or HTML extension), the web server
fulfills the request and sends the file to the browser.
If the user requests a file that is a page that a web application server must process (one with a CFM, CFML, or
CFC extension for ColdFusion requests), the web server passes the request to the web application server. The
web application server processes the page and sends the results to the web server, which returns those results to
the browser. The following image shows this process:
Because web application servers interpret programming instructions and generate output that a web browser can
interpret, they let web developers build highly interactive and data-rich websites, which can do tasks such as the
following:
Query other database applications for data.
Dynamically populate form elements.
Dynamically generate Flash data.
Provide application security.
Integrate with other systems using standard protocols such as HTTP, FTP, LDAP, POP, and SMTP.
Create shopping carts and e-commerce websites.
Respond with an e-mail message immediately after a user submits a form.
Return the results of keyword searches.
About ColdFusion
Adobe ColdFusion is a rapid scripting environment server for creating dynamic Internet Applications. ColdFusion
Markup Language (CFML) is a tag-based scripting language that is easy to learn. CFML provides connectivity to
enterprise data and powerful built-in search and charting capabilities. ColdFusion enables developers to easily build
and deploy dynamic websites, content publishing systems, self-service applications, commerce sites, and more.
2. W eb server receives
the page reques t..
5. The web server
sends the output
to the browser.
3. W eb server instructs
application server to
process the page.
4. The application server
processes the page and
generates output.
Web Server
Application
Server
1. W eb browser
requests a web page..
Internet
14
DEVELOPING COLDFUSION 9 APPLICATIONS
Introducing ColdFusion
Last updated 1/20/2012
ColdFusion pages are plain text files that you use to create web applications. You can create your ColdFusion
applications by writing all the code manually or by using wizards (provided with some editors) to generate the majority
of the code for you.
Saving ColdFusion pages
In order for the ColdFusion server to process a page, save the ColdFusion page on a computer where ColdFusion is
installed. If you are creating your pages on a local server (on which ColdFusion is running), you can save the pages
locally; if you are using a remote server, save your pages on that server.
If you are using the J2EE configuration, you typically save ColdFusion pages under the ColdFusion web application
root. For example, in the default directory structure when you use the J2EE configuration with JRun, you save pages
under jrun_root/servers/cfusion/cfusion-ear/cfusion-war.
Testing ColdFusion pages
To ensure that the code you wrote is working as expected, you view the ColdFusion page in a browser by going to the
appropriate URL, for example
http://localhost/test/mypage.cfm. If you are using the built-in web server,
specify the port to use in the URL, for example,
http://localhost:8500/test/cfpage.cfm. The address localhost
is only valid when you view pages locally.
Note: On Vista, the address ::1 is equivalent to localhost. You can use the ColdFusion GetLocalHostIP function to get
the IP address of localhost.
The URL for a remote site includes the server name or IP address of the server where ColdFusion is installed; for
example,
http://<serveripaddress>/test/mypage.cfm. Some ColdFusion J2EE configurations require a context
root in the URL; for example,
http://<server>/<context-root>/mypage.cfm. For example, if you deploy an EAR
file and use the default context root of cfconroot, you specify
http://localhost/cfconroot/test/mypage.cfm.
Elements of ColdFusion
ColdFusion consists of the following core elements:
ColdFusion scripting environment
CFML
ColdFusion Administrator
Verity Search Server
The ColdFusion scripting environment
The ColdFusion scripting environment provides an efficient development model for Internet applications. At the
heart of the ColdFusion scripting environment is the ColdFusion Markup Language (CFML), a tag-based
programming language that encapsulates many of the low-level details of web programming in high-level tags and
functions.
ColdFusion Markup Language
ColdFusion Markup Language (CFML) is a tag-based language, like HTML, that uses special tags and functions. With
CFML, you can enhance standard HTML files with database commands, conditional operators, high-level formatting
functions, and other elements to rapidly produce web applications that are easy to maintain. However, CFML is not
limited to enhancing HTML. For example, you can create Flash output that consist entirely of Flash elements and
CFML. Similarly, you can use CFML to create web services for use by other applications.
15
DEVELOPING COLDFUSION 9 APPLICATIONS
Introducing ColdFusion
Last updated 1/20/2012
For more information, see “Elements of CFML” on page 17.
CFML tags
CFML looks like HTML—it includes starting and, in most cases, ending tags, and each tag is enclosed in angle brackets.
All ending tags are preceded with a forward slash (/) and all tag names are preceded with
cf; for example:
<cftagname>
tag body text and CFML
</cftagname>
CFML increases productivity by providing a layer of abstraction that hides many low-level details involved with
Internet application programming. At the same time, CFML is powerful and flexible. ColdFusion lets you easily build
applications that integrate files, databases, legacy systems, mail servers, FTP servers, objects, and components.
CFML tags serve many functions. They provide programming constructs, such as conditional processing and loop
structures. They also provide services, such as charting and graphing, full-text search, access to protocols such as FTP,
SMTP/POP, and HTTP, and much more. The following table lists a few examples of commonly used ColdFusion tags:
CFML Reference describes the CFML tags in detail.
CFML functions and CFScript
CFML includes built-in functions that perform a variety of roles, including string manipulation, data management,
and system functions. CFML also includes a built-in scripting language, CFScript, that lets you write code in a manner
that is familiar to programmers and JavaScript writers.
CFML extensions
You can extend CFML further by creating custom tags or user-defined functions (UDFs), or by integrating COM,
C++, and Java components (such as JSP tag libraries). You can also create ColdFusion components (CFCs), which
encapsulate related functions and properties and provide a consistent interface for accessing them.
All these features let you easily create reusable functionality that is customized to the types of applications or websites
that you are building.
Tag Purpose
cfquery Establishes a connection to a database (if one does not exist), executes a query, and returns results to the
ColdFusion environment.
cfoutput Displays output that can contain the results of processing ColdFusion functions, variables, and expressions.
cfset Sets the value of a ColdFusion variable.
cfmail Lets an application send SMTP mail messages using application variables, query results, or server files. (Another
tag,
cfpop, gets mail.)
cfchart Converts application data or query results into graphs, such as bar charts or pie charts, in Flash, JPG, or PNG
format.
cfobject Invokes objects written in other programming languages, including COM (Component Object Model)
components, Java objects such as Enterprise JavaBeans, or Common CORBA (Object Request Broker Architecture)
objects.
/