Building ColdFusion components
241
In this case, a ColdFusion page with the following code sets the MetaTypeInfo variable to Float:
<cfobject component="mathCFC" name="MathFuncs">
<cfset MetaTypeInfo=GetMetadata(MathFuncs).MetaType>
Note:
Avoid using expressions in custom metadata attributes. Using expressions in metadata
attributes can cause unpredictable behavior, because all metadata expressions are replaced by
strings in the metadata structure returned from the GetMetadata function. Also, do not use the
reserved attributes as your metadata attribute names. The reserved words for the
cfcomponent
tag are
name, path, properties, functions, and extends. The reserved words for the
cffunction
tag are name,
returnType, access, roles, output, and arguments. The reserved words for the
cfargument
tag are
name, required, default, and type. The reserved words for the
cfproperty
tag are name and type.
The cfproperty tag
The
cfproperty
tag has several purposes:
•
It can create complex data types with WSDL descriptions for ColdFusion web services. For
more information, see
“Using ColdFusion components to define data types for web services”
on page 724
of
Chapter 32, Using Web Services
.
•
It can provide documentation of component properties in the ColdFusion introspection
output. The introspection information includes the values of the standard
cfproperty
tag
attributes.
Note:
The
cfproperty
tag does
not
create a variable or assign it a value. It is used for information
purposes only. You use a
cfset
tag, or CFScript assignment statement to create the property and
set its value.
Saving and naming ColdFusion components
The following table lists the locations in which you can save component files and how they can be
accessed from each location:
Note:
ColdFusion MX mappings and custom tag roots can exist within the web root. If so, they are
accessible to remote requests, including URL, form, Flash Remoting, and web service invocation.
Your application can refer to any component in one of these directories specifically by using a
qualified component name that starts with a subdirectory of one of the accessible directories and
uses a period to delimit each directory in the path to the directory that contains the component.
For example, the following example is a qualified name of a saw component:
com.mycompany.catalog.product.saw
In this example, the saw.cfc file must be in the com\mycompany\catalog\product subdirectory of
a directory that ColdFusion searches for components, as listed in the preceding table. When you
refer to a component using the qualified name, ColdFusion looks for the component in the order
described in
“Specifying the CFC location” on page 224
.
Web root
ColdFusion
mappings
Custom
tag roots
Current
directory
URL
Yes
No
No
N/A
Form
Yes
No
No
Yes
Flash Remoting
Yes
No
No
N/A
Web services
Yes
No
No
N/A
ColdFusion page
Yes
Yes
Yes
Yes
Summary of Contents for COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Page 1: ...Developing ColdFusion MX Applications...
Page 22: ...22 Contents...
Page 38: ......
Page 52: ...52 Chapter 2 Elements of CFML...
Page 162: ......
Page 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Page 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Page 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Page 266: ......
Page 314: ...314 Chapter 14 Handling Errors...
Page 344: ...344 Chapter 15 Using Persistent Data and Locking...
Page 349: ...About user security 349...
Page 357: ...Security scenarios 357...
Page 370: ...370 Chapter 16 Securing Applications...
Page 388: ...388 Chapter 17 Developing Globalized Applications...
Page 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Page 410: ......
Page 426: ...426 Chapter 19 Introduction to Databases and SQL...
Page 476: ...476 Chapter 22 Using Query of Queries...
Page 534: ...534 Chapter 24 Building a Search Interface...
Page 556: ...556 Chapter 25 Using Verity Search Expressions...
Page 558: ......
Page 582: ...582 Chapter 26 Retrieving and Formatting Data...
Page 668: ......
Page 734: ...734 Chapter 32 Using Web Services...
Page 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Page 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Page 788: ......