Adobe COLDFUSION 9 Manual page 29

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
The CFML Programming Language
3
Execute one or more actions on the object.
Note: Unlike the corresponding tags, you cannot use application-specific parameters in these functions. You can only use
the parameters that ColdFusion supports directly.
Step 1: Instantiate a service object
To create a function object, such as a mail object, use the
following example:
myMail = new mail(server="sendmail.myCo.com");
Step 2a: Managing attributes
You can set attributes in several ways:
• As name=value parameters to the object initializer when you instantiate the object, as in the following example.
myMail = new mail(server="sendmail.myCo.com");
• As name=value parameters to an object action method, as in the following example:
Q = myQuery.execute(sql="select * from art");
• By using attribute setters, as in the following example:
myMail.setSubject("Hi");
Note: You cannot use a
getAttributeName
Instead, use
GetAttributes(AttributeName)
• By using the following functions:
SetAttributes(attrib1=value,attrib2=value,...);
GetAttributes([attribName1[,attribName2]]....);
ClearAttributes([attribName1[,attribName2]]...);
Note: If you specify a result attribute for a stored procedure, then calling
executionTime,statusCode,cached
and
executionTime
statusCode
Step 2b: Managing child tag operations
All service objects correspond to tags that have child tags. For example,
child tags.
To specify the child tag functionality, use the following methods:
httpObj.addParam
mailObj.addParam
mailObj.addPart
pdfObj.addParam
queryObj.addParam
storedProcObj.addParam
storedProcObj.addProcResult
For example:
operator or
new
function to get the value of the attribute specified by AttributeName.
.
. If you do not specify a result attribute,
.
Last updated 8/5/2010
function, as in the
createobject()
returns,
getPrefix()
returns only
getPrefix()
has
and
cfmail
cfmailpart
24
cfmailparam

Advertisement

Table of Contents
loading

Table of Contents