In ColdFusion (2018 release), script functions implemented as CFCs are deprecated in ColdFusion.
The following table lists the script functions and the equivalent ColdFusion tag.
Function |
Equivalent ColdFusion Tag |
|---|---|
dbinfo |
cfdbinfo |
imap |
cfimap |
pop |
cfpop |
ldap |
cfldap |
feed |
cffeed |
Used in CFScript to retrieve information about a data source such as database details, tables, queries, procedures, foreign keys, indexes, and version information about the database, driver, and JDBC.
Mode |
Syntax |
|---|---|
Creating the service |
new dbinfo() or createObject("component", "dbinfo"); |
Executing the service action |
dbinfoService.action_method(attribute-value_pair); |
Initializing the attributes |
See Initializing the attributes below. |
Getting the CFC properties |
See Getting the CFC Properties below. |
Working with the data returned |
data=dbinfoService.action_method(attribute-value_pair);writedump(data); |
datasource |
dbname |
name |
password |
pattern |
table |
username |
All attributes supported by the tag cfdbinfo can be used as attribute-value pairs. For example,
<cfdbinfo userName="myUserName"> |
can be used as
dbinfoService.setUserName("myUserName"); |
For details, see the Attributes section for the cfdbinfo tag.
ColdFusion 9.0.1: Added this function.
The following dbinfo types are available as methods. All methods have similar arguments and syntax.
dbnames |
tables |
columns |
version |
procedures |
foriegnkeys |
index |
Description |
All methods correspond to the type of information supported by the tag cfdbinfo. For details of each method, see the relevant section for the tag cfdbinfo in ColdFusion 9 CFML Reference. |
Returns |
All methods return a query object. |
Syntax |
dbinfoService.methodName(attribute-value pair); |
Arguments |
All attributes supported by the tag cfdbinfo. |
This function corresponds to the tag cfdbinfo. For details, see the Usage section for the tag cfdbinfo.
<cfscript> |
Used in CFScript to query an IMAP server to retrieve and manage mails within multiple folders.
Mode |
Syntax |
|---|---|
Creating the service |
new imap(); or createObject("component", "imap"); |
Initializing the attributes |
See Initializing the attributes below. |
Executing the service action |
imapService.methodName(_attribute-value_pair_) |
Getting the CFC properties |
See Getting the CFC Properties below. |
Working with returned data |
imapResult=imapService.action_method(_attribute-value_pair_); |
attachmentpath |
connection |
folder |
generateuniquefilenames |
maxrows |
messagenumber |
name |
newfolder |
password |
port |
recurse |
secure |
server |
startrow |
stoponerror |
timeout |
uid |
username |
|
|
All attributes supported by the tag cfimap can be used as attribute-value pairs. For example,
<cfimap action="open" connection = "myconnection"> |
can be used as
imapService = new imap(server="myimapserver",username="myusername",password="mypassword",port= |
Note: If connection properties such as server, username, password, port, and secure are specified either during initialization or when open method is called, a connection is created implicitly. Therefore, you need not specify the properties for further actions. If sandbox security is turned on, the directory referred to by the property attachmentPath must be given the required permission. By default, the temp directory is used. |
For details of the attributes, see the Attributes section for the tag cfimap.
ColdFusion 9.0.1: Added this function.
The following imap actions are available as methods. All methods have similar arguments and syntax.
getAll |
delete |
open |
close |
markRead |
createFolder |
deleteFolder |
renameFolder |
listAllFolders |
moveMail |
getHeaderOnly |
Description |
All methods correspond to the type of information supported by the tag cfimap. For details of each method, see the relevant section of cfimap in the ColdFusion 9 CFML Reference. |
Returns |
A query object for methods getAll, getHeaderOnly, and listAllFolders. Else, nothing. |
Syntax |
imapService.methodName(attribute-value pair); |
Arguments |
All attributes supported by the tag cfimap. |
This function corresponds to the tag cfimap. See the Usage section for cfimap in the ColdFusion 9 CFML Reference for details.
<cfscript> |
Used in CFScript to retrieve or delete e-mail messages from a POP mail server.
Mode |
Syntax |
|---|---|
Creating the service |
new pop(); or createObject("component", "pop"); |
Initializing the attributes |
See Initializing the attributes below. |
Executing the service action |
popService.action_method(_attribute-value_pair_); |
Getting the CFC properties |
See Getting the CFC Properties below. |
Working with data returned |
popresult = popService.action_method (attribute-value pair); where popresult is a query object if the action_method is getAll or getHeaderOnly. For any other method, nothing is returned. |
server |
attachmentPath |
debug |
|
|---|---|---|---|
generateUniqueFilenames |
maxRows |
messageNumber |
name |
password |
port |
startRow |
timeout |
uid |
username |
|
|
All attributes supported by the tag cfpop can be used as attribute-value pairs. For example,
<cfpop server = "#form.popserver# " action = "getHeaderOnly" name = "GetHeaders"> |
can be used as
popHeaders = popService.getHeaderOnly(server="#form.popserver#"); |
Note: name is a required attribute in cfpop, but not in CFScript. |
ColdFusion 9.0.1: Added this function.
The following pop actions are available as methods. All methods have similar arguments and syntax.
getHeaderOnly |
getAll |
delete |
Description |
All methods correspond to the type of information supported by the tag cfpop. For details of each method, see the relevant section of cfpop in the ColdFusion 9 CFML Reference. |
Returns |
All methods except delete returns a query object. |
Syntax |
popService.methodName(attribute-value pair) |
Arguments |
All attributes supported by the tag cfpop. |
This function corresponds to the tag cfpop. For usage details, see the Usage section for cfpop__.
<cfscript> |
Used in CFScript to provide an interface to a Lightweight Directory Access Protocol (LDAP) directory server, such as the Netscape Directory Server.
Mode |
Syntax |
|---|---|
Creating the service |
new ldap(); or createObject("component", "ldap"); |
Initializing the attributes |
See Initializing the attributes below. |
Executing the service action |
ldapService.action_method(attribute-value pair); |
Getting the CFC properties |
See Getting the CFC Properties below. |
Working with data |
ldapresult = ldapService.query(attribute-value pair).For other methods, nothing is returned. |
server |
attributes |
delimiter |
|
|---|---|---|---|
dn |
filter |
maxRows |
modifyType |
name |
password |
port |
rebind |
referral |
returnAsBinary |
scope |
secure |
separator |
sort |
sortcontrol |
start |
startRow |
timeout |
userName |
|
All attributes supported by the tag cfldap can be used as attribute-value pairs. For example,
<cfldap action="add" server="ldap.uconn.edu"> |
can be used as
ldapService.add(server="ldap.uconn.edu"); |
For details, see the Attributes section for the tag cfldap.
The following ldap actions are available as methods. All methods have similar arguments and syntax.
query |
add |
modify |
modifyDn |
delete |
|
|---|
Description |
All methods correspond to the actions supported by the tag cfldap. For details of each method, see the relevant section of cfldap in the ColdFusion 9 CFML Reference. |
Returns |
If method is query, returns a query object. Else, none. |
Syntax |
ldapService.methodName(attribute-value pair) |
Arguments |
All attributes supported by the tag cfldap. |
setLdapAttributes
Description |
Sets the property attributes. |
Returns |
Nothing |
Syntax |
ldapService.setLdapAttributes(attribute-value); |
Arguments |
A string that contains the value of the property attributes. |
getLdapAttributes
Description |
Gets the property attributes. |
Returns |
A string that contains the value of the property attributes. |
Syntax |
myattributes = ldapService.getLdapAttributes(__); |
ColdFusion 9.0.1: Added this function.
This function corresponds to the tag cfldap. For usage details, see the Usage section for cfldap.
<cfscript> |
Used in CFScript to read or create an RSS or Atom syndication feed. This service reads RSS versions 0.90, 0.91, 0.92, 0.93, 0.94, 1.0, and 2.0, and Atom 0.3 or 1.0. It can create RSS 2.0 or Atom 1.0 feeds.
Mode |
Syntax |
|---|---|
Creating the service |
new feed() or createObject("component" "feed") |
Initializing the attributes |
See Initializing the attributes below. |
Executing the service action |
feedService.action_method(attribute-value_pair) |
Getting the CFC properties |
See Getting the CFC Properties below. |
Working with the data returned |
|
columnMap |
enclosureDir |
escapeChar |
ignoreEnclosureError |
name (optional in CFScript) |
outputFile |
overwrite |
overwriteEnclosure |
properties (optional in CFScript) |
proxyPassword |
proxyPort |
proxyServer |
proxyUser |
query (optional in CFScript) |
source |
timeout |
useragent |
xmlvar (optional in CFScript) |
|
|
All attributes supported by the tag cffeed can be used as attribute-value pairs. For example,
<cffeed action="read" source="http://googleblog.blogspot.com/atom.xml" |
can be used as
feedservice.read(source="http://googleblog.blogspot.com/atom.xml", |
ColdFusion 9.0.1: Added this function.
create
Description |
Creates an RSS 2.0 or Atom 1.0 feed XML document and saves it in a variable, writes it to a file, or both. |
Returns |
String representing the xmlvar |
Syntax |
feedService.create (attribute-value pair); |
Arguments |
All attributes supported by the tag cffeed. |
read
Description |
Parses an RSS or Atom feed from a URL or an XML file and saves it in a structure or query. You can also get feed metadata in a separate structure. |
Returns |
Struct with the following keys: |
xmlvar
Syntax |
feedService.read (attribute-value pair); |
Arguments |
All attributes supported by the tag cffeed. |
getFeedProperties
Description |
Returns the value of the property properties. |
Returns |
Struct or error (if property is not set) |
Syntax |
feedService.getFeedProeprties() |
Arguments |
None |
setFeedProperties
Description |
Sets the value of the property properties. |
Returns |
Nothing |
Syntax |
feedService.setFeedProperties() |
Arguments |
properties struct |
This service corresponds to the tag cffeed. For usage, see Usage section for cffeed.
<cfscript> |
The following methods are common to all script functions:
setAttributes
Description |
Sets attributes for the function. |
Returns |
Nothing |
Syntax |
service_name.setAttributes (attribute-value pair); |
Arguments |
All attributes supported by the equivalent tag. |
getAttributes
Description |
Gets the attributes set for the function. |
Returns |
Returns a struct with all or some attribute values. |
Syntax |
service_name.get_Attributes_ (attributelist); |
Arguments |
A comma-separated list of attributes. If no list is specified, all defined attributes are returned. |
clearAttributes
Description |
Removes all attributes added for the function. |
Returns |
Nothing |
Syntax |
_service_name.clearAttributes(_attribute_list); |
Arguments |
A comma-separated list of attributes. |
clear
Description |
Removes all attributes added for the function. |
Returns |
Nothing |
Syntax |
service_name.clear(); |
Arguments |
None |
clearProperties
Description |
Removes all properties added for the function. |
Returns |
Nothing |
Syntax |
service_name.clearProperties(attribute_list); |
Arguments |
If nothing is specified, all properties are cleared. |
setProperties
Description |
Sets properties for the function. |
Returns |
Nothing |
Syntax |
service_name.setproperties (attribute-value pair); |
Arguments |
All attributes supported by the equivalent tag. |
getProperties
Description |
Gets the properties set for the function. |
Returns |
Returns a struct with all or some attribute values. |
Syntax |
service_name.getproperties (attributelist); |
Arguments |
A comma-separated list of attributes. If no list is specified, all defined attributes are returned. |
You can initialize the attributes using one of the following ways:
Get the CFC properties using one of the following ways:
Sign in to your account