The following sections list ColdFusion by topics, meaning that the functions in each section perform related tasks. String-Manipulation Functions The ColdFusion string-manipulation functions can be used to perform operations on character data. Strings can be hard-coded constants, table column values, or ColdFusion fields. As with all ColdFusion functions, these string-manipulation functions can be nested. Table C.1 contains the available functions for string manipulationrelated processing. Table C.1. String-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
Asc() | Returns the ASCII value of the leftmost character of a string, 0 if the string is empty | BinaryDecode() | Converts binary data that has been encoded into string format back into binary object | BinaryEncode() | Converts a binary object to into an encoded string format | Chr() | Converts an ASCII value into a printable character | CJustify() | Centers a string within a field of a specified length | Compare() | Performs a case-sensitive comparison on two strings | CompareNoCase() | Performs a case-insensitive comparison on two strings | Decrypt() | Decrypts a string encrypted with Encrypt() | Encrypt() | Encrypts a string using a user-specified key | Find() | Performs a case-sensitive substring search | FindNoCase() | Performs a case-insensitive substring search | FindOneOf() | Returns the position of the first target string character that matches any of the characters in a specified set | GenerateSecretKey() | Produces a secure key for use with the encrypt() function | GetToken() | Extracts specific sets of data within a string by specifying its index | Hash() | Converts a string into a 32-byte hexadecimal string using the one-way MD5 algorithm | InputBaseN() | Converts a string into a number using the base specified by radix | Insert() | Inserts text into a string | LCase() | Converts a string to lowercase | Left() | Returns the specified leftmost characters from the beginning of a string | Len() | Returns the length of a specified string | LJustify() | Left-aligns a string within a field of a specified length | LTrim() | Trims white space from the beginning of a string | Mid() | Returns a string of characters from any location in a string | REFind() | Performs a case-sensitive search using regular expressions | REFindNoCase() | Performs a case-insensitive search using regular expressions | RemoveChars() | Returns a string with specified characters removed from it | RepeatString() | Returns a string made up of a specified string repeated multiple times | Replace() | Replaces text within strings with alternative text | ReplaceList() | Replaces all occurrences of elements in one string with corresponding elements in another | REReplace() | Performs a case-sensitive search and replace using regular expressions | REReplaceNoCase() | Performs a case-insensitive search and replace using regular expressions | Reverse() | Reverses the characters in a string | Right() | Returns the specified rightmost characters from the end of a string | RJustify() | Right-aligns a string within a field of a specified length | RTrim() | Trims white space from the end of a string | SpanExcluding() | Extracts characters from the beginning of a string until a character that is part of a specified set is reached | SpanIncluding() | Extracts characters from the beginning of a string only as long as they match characters in a specified set | StripCR() | Removes all carriage-return characters from a string | ToBase64() | Returns the Base64 representation of a specified string or binary object | ToBinary() | Converts a Base64-encoded string to a binary object | trim() | Trims white space from the beginning and end of a string | UCase() | Converts a string to uppercase | Val() | Converts the beginning of a string to a number | Wrap() | Wraps a string to a specified length |
Date and Time Functions The ColdFusion Date and Time functions enable you to perform date and time manipulations on table columns and user-supplied fields. Many of these functions work with date/time objects. A date/time object is a ColdFusion internal representation of a complete date and time. These objects are designed to facilitate the passing of date/time information between various ColdFusion functions and are not designed to be displayed as is. If you need to display a date/time object, you must use one of the date/time formatting functions. NOTE ColdFusion date/time objects are not the same as ODBC date/time fields. Use the CreateODBCDateTime() function to convert ColdFusion date/time objects to the ODBC format. Many ColdFusion date and time functions take date and time values as parameters. These parameters must be valid and within a set range; otherwise, a ColdFusion syntax error is generated. The range of values allowed for each date and time field is listed in Table C.2. Table C.2. Valid ColdFusion Date and Time ValuesFIELD | MIN. | MAX. |
---|
Year | 0 | 9999 | Month | 1 | 12 | Day | 1 | 31 | Hour | 0 | 23 | Minute | 0 | 59 | Second | 0 | 59 |
NOTE Year values of less than 100 are treated as 20th-century values, and 1900 is added automatically to them. Several of the ColdFusion date and time functions enable you to work with parts of the complete date/time objectto add days or weeks to a date, or to find out how many weeks apart two dates are, for example. These functions require you to pass a date/time part specifier that is passed as a string. (They must have quotation marks around them.) The complete list of specifiers is explained in Table C.3. Table C.3. ColdFusion Date/Time SpecifiersSPECIFIER | DESCRIPTION |
---|
D | Day | H | Hour | M | Month | N | Minute | Q | Quarter | S | Second | L | Millisecond | W | Weekday (day of week) | WW | Week | Y | Day of year | YYYY | Year |
Table C.4 contains the available functions for date- and time-related processing. Table C.4. Date and Time FunctionsFUNCTION | DESCRIPTION |
---|
CreateDate() | Returns a ColdFusion date/time object that can be used with other date-manipulation or formatting functions | CreateDateTime() | Returns a ColdFusion date/time object that can be used with other date- and time-manipulation or formatting functions | CreateODBCDate() | Returns a date in an ODBC date/time field that can safely be used in SQL statements | CreateODBCDateTime() | Returns an ODBC date/time field that can safely be used in SQL statements | CreateODBCTime() | Returns a time in an ODBC date/time field that can safely be used in SQL statements | CreateTime() | Returns a time in a ColdFusion date/time object that can be used with other time-manipulation or formatting functions | CreateTimeSpan() | Creates a date/time object that can be used to rapidly perform date- and time-based calculations | DateAdd() | Adds or subtracts values to a date/time object | DateCompare() | Compares two dates to determine whether they are the same or whether one is greater than the other | DateConvert() | Converts local machine time to UTC (Universal Coordinated Time) time or vice versa | DateDiff() | Returns the difference between two dates | DatePart() | Returns the specified part of a passed date | Day() | Returns a date/time object's day of month as a numeric value | DayOfWeek() | Returns a date/time object's day of week as a numeric value | DayOfWeekAsString() | Returns the English weekday name for a passed day-of-week number | DayOfYear() | Returns a date/time object's day of year as a numeric value | DaysInMonth() | Returns the number of days in a specified month | DaysInYear() | Returns the number of days in a specified year | FirstDayOfMonth() | Returns the day of year on which a specified month starts | GetHTTPTimeString() | Formats a ColdFusion date/time object according to the HTTP standard outlined in RFC 1123 | GetTimeZoneInfo() | Returns a structure containing relevant server time zone information | Hour() | Returns a date/time object's hour as a numeric value | IsDate() | Checks whether a string contains a valid date | IsLeapYear() | Checks whether a specified year is a leap year | IsNumericDate() | Checks whether a value passed as a date in the ColdFusion internal date format is in fact a legitimate date | Minute() | Returns a date/time object's minute as a numeric value | Month() | Returns a date/time object's month as a numeric value | MonthAsString() | Returns the English month name for a passed month number | Now() | Returns a date/time object containing the current date and time | ParseDateTime() | Converts a date in string form into a ColdFusion date/time object | Quarter() | Returns a date/time object's quarter as a numeric value | Second() | Returns a date/time object's second as a numeric value | Week() | Returns a date/time object's week in year as a numeric value | Year() | Returns a date/time object's year as a numeric value |
Data Formatting Functions Powerful data-manipulation functions and database-interaction capabilities are pretty useless unless you have ways to display data in a clean, readable format. ColdFusion data addresses this need by providing an array of highly capable formatting functions. Many of these functions take optional format masks as parameters, thereby giving you an even greater level of control over the final output. Table C.5 contains the available functions for data formatrelated processing. Table C.5. Data Formatting FunctionsFUNCTION | DESCRIPTION |
---|
DateFormat() | Displays the date portion of a date/time object in a readable format | DecimalFormat() | Outputs numbers with two decimal places, commas to separate the thousands, and a minus sign for negative values | DollarFormat() | Outputs numbers with a dollar sign at the front, two decimal places, commas to separate the thousands, and a minus sign for negative values | FormatBaseN() | Converts a number to a string using the base specified | HTMLCodeFormat() | Displays text with HTML codes using a preformatted HTML block | HTMLEditFormat() | Converts supplied text into a safe format, converting any HTML control characters to their appropriate entity codes | NumberFormat() | Displays numeric values in a readable format | TimeFormat() | Displays the time portion of a date/time object in a readable format | ParagraphFormat() | Converts text with embedded carriage returns for correct HTML display | YesNoFormat() | Converts trUE and FALSE values to Yes and No |
Mathematical Functions To assist you in performing calculations, ColdFusion comes with a complete suite of mathematical functions, random number-generation functions, and arithmetic expressions. As with all ColdFusion functions, these mathematical functions can be nested. Some of the mathematical functions take one or more numeric values as parameters. You can pass real values, integer values, and ColdFusion fields to these functions. Table C.6 lists the supported arithmetic expressions. Table C.6. ColdFusion Arithmetic ExpressionsEXPRESSION | DESCRIPTION |
---|
+ | Addition | - | Subtraction | * | Multiplication | / | Division | MOD | Modular (finds remainder) | \ | Integer division (both values must be integers) | ^ | Power |
Table C.7 contains the available functions for mathematical processing. Table C.7. Mathematical FunctionsFUNCTION | DESCRIPTION |
---|
Abs() | Absolute value of the passed number | Acos() | Arccosine of the passed number | Asin() | Arcsine of the passed number, in radians | Atn() | Arctangent of the passed number | Ceiling() | The closest integer greater than the passed number | Cos() | Cosine of the passed number | DecrementValue() | Number decremented by 1 | Exp() | E to the power of the passed number | Fix() | The closest integer smaller than the passed number, if the passed number is greater than or equal to 0. Otherwise, the closest integer greater than the passed number | IncrementValue() | Number incremented by 1 | Int() | The closest integer smaller than the passed number | Log() | Natural logarithm of the passed number | Log10() | Base 10 log of the passed number | Max() | The greater of two passed numbers | Min() | The smaller of two passed numbers | Pi() | Value of pi as 3.14159265359 | Rand() | A random number between 0 and 1 | Randomize() | The random number generator seeded with the passed number | RandRange() | A random integer value between two passed numbers | Round() | The integer closest (either greater or smaller) to the passed number | Sgn() | Signeither 1, 0, or 1, depending on whether the passed number is negative, 0, or positive | Sin() | Sine of the passed number | Sqr() | Square root of the passed number | Tan() | Tangent of the passed number |
International Functions ColdFusion fully supports the display, formatting, and manipulation of international dates, times, numbers, and currencies. To use ColdFusion's international support, you must specify the locale. A locale is an encapsulation of the set of attributes that govern the display and formatting of international date, time, number, and currency values. The complete list of supported locales is shown in Table C.8. Table C.8. ColdFusion LocalesJAVA STANDARD LOCALE | COLDFUSION LOCALE |
---|
nl_be | Dutch (Belgian) | nl_NL | Dutch (Standard) | en_AU | English (Australian) | en_CA | English (Canadian) | en_NZ | English (New Zealand) | en_GB | English (UK) | en_US | English (US) | fr_BE | French (Belgian) | fr_CA | French (Canadian) | fr_FR | French (Standard) | fr_CH | French (Swiss) | de_AT | German (Austrian) | de_DE | German (Standard) | de_CH | German (Swiss) | it_IT | Italian (Standard) | it_CH | Italian (Swiss) | ja_JP | Japanese | ko_KR | Korean | no_NO | Norwegian (Bokmal) | no_NO_nynorsk | Norwegian (Nynorsk) | pt_BR | Portuguese (Brazilian) | pt_PT | Portuguese (Standard) | Deprecated | Spanish (Mexican) | es_ES | Spanish (Modern) | es_ES | Spanish (Standard) | sv_SE | Swedish |
NOTE Note that because ColdFusion is now a Java-based application, you must use Java standard locales, as opposed to the locales supported by ColdFusion 5. You will find information on standard locales here: http://www.inter-locale.com/index.jsp You must use the SetLocale() function to set the locale. You can retrieve the name of the locale currently in use with the GetLocale() function. To use ColdFusion's international support, you must use the LS functions listed later in this section. These functions behave much like the standard date, time, and formatting functions, but they honor the current locale setting. NOTE The ColdFusion server variable SERVER.ColdFusion.SupportedLocales contains a comma-delimited list of the supported locales. Table C.9 contains the available functions for international-related processing. Table C.9. International FunctionsFUNCTION | DESCRIPTION |
---|
CharsetDecode() | Converts a string to a binary object, based on a character set for encoding | CharsetEncode() | Converts a binary object to a string, based on a specified character set for encoding | GetLocale() | Returns the name of the locale currently in use | LSCurrencyFormat() | Displays currency information formatted for the current locale | LSDateFormat() | Displays the date portion of a date/time object in a readable format | LSEuroCurrencyFormat() | Displays euro currency formatted correctly | LSIsCurrency() | Checks whether a string contains a valid currency for the current locale | LSIsDate() | Checks whether a string contains a valid date for the current locale | LSIsNumeric() | Checks whether a specified value is numeric, taking into account the current locale | LSNumberFormat() | Displays numeric values in a locale-specific, readable format | LSParseCurrency() | Converts a locale-specific number in string form into a valid number | LSParseDateTime() | Converts a locale-specific date in string form into a ColdFusion date/time object | LSParseEuroCurrency() | Converts a currency string containing the euro symbol or sign to a number | LSParseNumber() | Converts a locale-specific number in string form into a valid number | LSTimeFormat() | Displays the time portion of a date/time object in a locale-specific, readable format | SetLocale() | Sets the name of the locale to be used by any subsequent calls to the LS functions |
List-Manipulation Functions ColdFusion lists are an efficient way to manage groups of information. Lists are made up of elements, which are values separated by delimiting characters. The default delimiter is a comma, but you can change this to any character or string, as required. Lists are actually simple two-dimensional arrays. For more complex or multidimensional lists, use arrays instead. This list format is well suited for ColdFusion applications. It is both the format that HTML forms use to submit fields with multiple values and the format used by SQL to specify lists in SQL statements. When using the list-manipulation functions, remember the following: List-manipulation functions that add to, delete from, or change a list do not alter the original list passed to them. Rather, they return an altered list to you for manipulation. If you need to update the passed list itself, you must use <cfset> to replace the list with the newly modified list. All list functions accept as an optional last parameter a string with delimiters to be used in the processing of the list. If this parameter is omitted, the default comma delimiter is used. The number 1 is always the starting position in any list. When referencing list functions, remember that lists always start at position 1, never 0. When evaluating a list, be aware that ColdFusion will ignore any empty items in a list. If you have a list defined as "Laura, John, Sean, , ,Bryan", it will be evaluated as a four-element list, not a six-element list. NOTE All the ColdFusion list-manipulation functions have names that begin with the word list, making them easy to spot in your code. TIP Lists can be used in conjunction with the <cfloop> tag for processing. Table C.10 contains the available functions for list manipulationrelated processing. Table C.10. List-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
ListAppend() | Adds an element to the end of a list | ListChangeDelims() | Changes a list's delimiters | ListContains() | Performs a case-sensitive list search for an element containing specified text | ListContainsNoCase() | Performs a case-insensitive list search for an element containing specified text | ListDeleteAt() | Deletes an element from a list | ListFind() | Performs a case-sensitive list search for a specific element | ListFindNoCase() | Performs a case-insensitive list search for a specific element | ListFirst() | Returns the first element in a list | ListGetAt() | Gets a specific list element by index | ListInsertAt() | Inserts an element into a list | ListLast() | Returns the last element in a list | ListLen() | Returns the number of elements in a list | ListPrepend() | Inserts an element at the beginning of a list | ListSort() | Sorts a list | ListQualify() | Returns the contents of a specified list with qualifying characters around each list element | ListRest() | Returns a list containing all the elements after the first element | ListSetAt() | Sets a specific list element by index | ListValueCount() | Performs a case-sensitive search and returns the number of matching elements in a list | ListValueCountNoCase() | Performs a case-insensitive search and returns the number of matching elements in a list |
Array-Manipulation Functions Arrays are special variables made up of collections of data. Array elements are accessed via their indexes into the array; to access the third element of a simple array, for example, you would refer to array[3]. ColdFusion supports arrays that use between one and three dimensions. A one-dimensional array is similar to a list, whereas a two-dimensional array is similar to a grid. (Under the hood, ColdFusion queries are essentially two-dimensional arrays.) Three-dimensional arrays are more like cubes. Arrays are created using the ArrayNew() function. To create an array, you must specify the number of dimensions needed, from one to three. You don't need to specify how many elements will be stored in the array; ColdFusion automatically expands the array as necessary. NOTE Array elements can be added in any order. If you add an element 10 to an array that has only 5 elements, ColdFusion automatically creates elements 69 for you. Table C.11 contains the available functions for array manipulationrelated processing. Table C.11. Array-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
ArrayAppend() | Appends an element to an array | ArrayAvg() | Returns the average numeric value in an array | ArrayClear() | Deletes all data from an array | ArrayDeleteAt() | Deletes a specific array element | ArrayInsertAt() | Inserts an element into an array | ArrayIsEmpty() | Checks whether an array has any data | ArrayLen() | Returns the length of an array | ArrayMax() | Returns the greatest numeric value in an array | ArrayMin() | Returns the lowest numeric value in an array | ArrayNew() | Creates a new array | ArrayPrepend() | Inserts an element at the beginning of an array | ArrayResize() | Resizes an array | ArraySet() | Sets a specific array element | ArraySort() | Sorts an array | ArraySum() | Returns the sum of numeric values in an array | ArraySwap() | Swaps the values in two array elements | ArrayToList() | Converts a one-dimensional array to a list | IsArray() | Checks whether a variable is a valid ColdFusion array | ListToArray() | Converts a list to a one-dimensional array |
Structure-Manipulation Functions ColdFusion structures are special data types that contain one or more other variables. Structures are a way to group related variables together. Table C.12 contains the available functions for structure manipulationrelated processing. Table C.12. Structure-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
Duplicate() | Returns a deep copy of a structure | IsStruct() | Checks whether a variable is a valid ColdFusion structure | StructAppend() | Appends an item to a structure | StructClear() | Deletes all data from a structure | StructCopy() | Returns a clone of the specified structure, with all the keys and values of the specified structure intact | StructCount() | Returns the number of items in a specified structure | StructDelete() | Deletes an item from a structure | StructFind() | Searches through a structure to find the key that matches the specified search text | StructInsert() | Inserts an item into a structure | StructIsEmpty() | Checks whether a structure has data | StructKeyArray() | Returns the keys of a specified structure in an array | StructKeyExists() | Checks whether a structure contains a specified key | StructKeyList() | Returns a list of keys in the specified ColdFusion structure | StructFindKey() | Finds a structure item by key | StructFindValue() | Finds a structure item by value | StructGet() | Gets a structure item | StructNew() | Creates a new structure | StructSort() | Sorts a structure | StructUpdate() | Updates the specified key in a given structure with a specified value |
Query-Manipulation Functions ColdFusion uses queries to return sets of data. Most queries are created with the <cfquery> tag, but other tags (<cfpop> and <cfldap>) also return data in queries. Additionally, ColdFusion enables you to programmatically create your own queries using the QueryNew function and set query values using QuerySetCell. NOTE ColdFusion queries are essentially arrays with named columns. You therefore can use any of the array functions with queries. Table C.13 contains the available functions for query manipulationrelated processing. Table C.13. Query-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
IsQuery() | Checks whether a variable is a valid ColdFusion query | QueryAddColumn() | Adds a new column to a specified query | QueryAddRow() | Adds a row to an existing ColdFusion query | QueryNew() | Returns a new query object, optionally with specified columns | QuerySetCell() | Sets the values of specific cells in a query |
Security Functions ColdFusion supports advanced security contexts that let you create complete security systems to secure your applications. Security is managed and maintained using the ColdFusion Administrator. After security is established, you can make a call to the <Cfauthenticate> tag to return security information. Use these security functions to interact with that security information. Table C.14 contains the available functions for security-related processing. Table C.14. Security FunctionsFUNCTION | DESCRIPTION |
---|
AuthenticatedContext() | Deprecated (no longer in use) | AuthenticatedUser() | Deprecated (no longer in use) | GetAuthUser() | Returns the ID of the user currently logged in to the ColdFusion security framework | IsAuthenticated() | Deprecated (no longer in use) | IsAuthorized() | Deprecated (no longer in use) | IsProtected() | Deprecated (no longer in use) | IsUserInRole() | Checks to see if current user (logged in to the ColdFusion security framework) is in the specified role. Returns TRue or False |
System Functions The ColdFusion system functions let you manipulate file paths, create temporary files, and verify file existence. Table C.15 contains the available functions for system-related processing. Table C.15. System FunctionsFUNCTION | DESCRIPTION |
---|
DirectoryExists() | Checks for the existence of a specified directory | ExpandPath() | Converts a relative or absolute path into a fully qualified path | FileExists() | Checks for the existence of a specified file | GetCurrentTemlatePath() | Returns the complete path of the template calling this function | GetdirectoryFromPath() | Extracts the drive and directory (with a trailing backslash) from a fully specified path | GetFileFromPath() | Extracts the filename from a fully specified path | GetMetaData() | Gets metadata from an object that supports introspection | GetMetricData() | Deprecated (no longer in use) | GetProfileString() | Gets the value of a profile entry in an .ini-format initialization file | GetTempDirectory() | Returns the full path of the operating system temporary directory | GetTempFile() | Creates and returns the full path to a temporary file for use by your application | GetTemplatePath() | Deprecated (no longer in use) | SetProfileString() | Sets the value of a profile entry in an .ini-format initialization file |
Client VariableManipulation Functions Client variables enable you to store client information so it is available between sessions. Client variables can be accessed just like any other ColdFusion variables; standard variable access tools, such as <cfset>, can therefore be used to set variables. In addition, these functions provide special variable-manipulation capabilities. Table C.16 contains the available functions for client variable manipulationrelated processing. Table C.16. Client VariableManipulation FunctionsFUNCTION | DESCRIPTION |
---|
DeleteClientVariable() | Deletes specified client variables | GetClientVariablesList() | Returns a comma-delimited list of the read/write client variables available for use |
Expression Evaluation Functions ColdFusion enables you to perform dynamic expression evaluation. This is an advanced technique that allows you to build and evaluate expressions on the fly. Dynamic expression evaluations are performed on string expressions. A string expression is just thata string that contains an expression. The string "1+2" contains an expression that, when evaluated, returns 3. String expressions can be as simple or as complex as necessary. Table C.17 contains the available functions for expression evaluationrelated processing. Table C.17. Expression Evaluation FunctionsFUNCTION | DESCRIPTION |
---|
DE() | Flags an expression for delayed evaluation | Evaluate() | Evaluates string expressions | IIf() | Performs an inline if statement | SetVariable() | Sets a specified variable to a passed value |
Bit- and Set-Manipulation Functions ColdFusion provides a complete set of bit-manipulation functions for use by advanced developers only. These functions enable you to manipulate the individual bits within a 32-bit integer. NOTE Any start, length, or position parameters passed to the bit-manipulation functions must be in the range of 031. Table C.18 contains the available functions for bit- and set-manipulationrelated processing. Table C.18. Bit-Manipulation FunctionsFUNCTION | DESCRIPTION |
---|
BitAnd(x, y) | Returns x and y | BitMaskClear (x, start, length) | Returns x with bits of length cleared, beginning at the starting position | BitMaskRead (x, start, length) | The value of x with bits of length length, beginning at the starting position | BitMaskSet (x, mask, start, length) | Returns x with mask occupying the length bits beginning at the starting position | BitNot(x) | Returns not x | BitOr(x, y) | Returns x | y | BitSHLN(x, n) | Returns x << n | BitSHRN(x, n) | Returns x >> n | BitXor(x, y) | Returns x^y |
Conversion Functions These functions are provided to enable you to easily convert data from one type to another. This list is not all inclusive; some data-conversion functions are listed elsewhere throughout this appendix. Table C.19 contains the available functions for conversion-related processing. Table C.19. Conversion FunctionsFUNCTION | DESCRIPTION |
---|
JavaCast() | Casts a variable for use within a Java object | JSStringFormat() | Formats a specified string so that it is safe to use with JavaScript | toString() | Converts any value, including binary values, into a string | toScript() | Converts a ColdFusion variable to a Java Script or Action Script variable. |
XML Functions The following functions were introduced in ColdFusion MX and enable you to work with Extended Markup Language (XML) documents and ColdFusion XML objects. Table C.20 lists the functions that can be used to process XML. Also note that ToString() can be used on an XML document object. Table C.20. XML FunctionsFUNCTION | DESCRIPTION |
---|
IsXML() | Returns TRue or False indicating whether or not the string passed to it is valid XML | IsXMLAttribute() | Returns true or False indicating whether or not the object passed to it is an attribute node form an XML DOM | IsXMLDoc() | Returns true or False indicating whether the parameter is a valid XML document object | IsXMLElem() | Returns TRue or False indicating whether the parameter is an XML document object element | XMLGetNodeType() | Indicates the type of node being passed as a parameter (e.g., element node as opposed to an attribute note) | IsXMLNode() | Returns True or False indicating whether or not the parameter is a node from an XML DOM | IsXMLRoot() | Returns true or False indicating whether the function argument is the root element of an XML document object | XMLChildPos() | Returns the position of a child in an array of XML children | XMLElemNew() | Returns the XML document object (first parameter) with a new element (specified in the second parameter) | XMLFormat() | Returns a string formatted in which special XML characters are escaped | XMLNew() | Creates an XML document object | XMLParse() | Searches through a string of XML for a document tree object and returns that object | XMLSearch() | Returns an array of XML object nodes after searching for an XPath through an XML document string | XMLTransform() | Applies an XML style sheet (XSLT) to an XML document string and returns the XSL-formatted string | XMLValidate() | Validates XML files or documents against specified Schema or DTD |
Event Gateway Functions The functions listed in table C.21 relate to the use of ColdFusion's Event Gateway feature. Table C.21. Event Gateway FunctionsFUNCTION | DESCRIPTION |
---|
GetGatewayHelper() | Retrieves a Java "Gateway Helper" object for use with a ColdFusion event gateway | SendGatewayMessage() | Sends a message through the specified event gateway |
SOAP Functions The functions listed in table C.22 are useful when working with Simple Open Access Protocol data, as you do with Web Services. Table C.22. SOAP FunctionsFUNCTION | DESCRIPTION |
---|
AddSOAPRequestHeader() | Adds a SOAP header to a request you're sending to a Web Service | AddSOAPResponseHeader() | Adds a SOAP response header from your Web Service | GetSOAPRequest() | Returns an XML object containing a SOAP request | GetSOAPRequestHeader() | Retrieves a SOAP request header from a message | GetSOAPResponse() | Returns an XML object containing a SOAP response | GetSOAPResponseHeader() | Retrieves a SOAP response header from a message | IsSOAPRequest() | Indicates whether or not a CFC is being called as a Web Service |
Miscellaneous Functions The following functions are listed here to give you access to some lesser-known but important functions in ColdFusion. Table C.23 contains the available miscellaneous functions. Table C.23. Miscellaneous FunctionsFUNCTION | DESCRIPTION |
---|
CreateObject() | Instantiates COM, CORBA, Java objects, and ColdFusion components | CreateUUID() | Returns a 35-character string representation of a unique 128-bit number | GetBaseTagData() | Returns an object containing data from a specified ancestor tag | GetBaseTagList() | Returns a comma-delimited list of base tag names | GetBaseTemplatePath() | Returns the full path of the base template | GetContextRoot() | Provides a path to the J2EE server context root for the current request | GetException() | Retrieves a Java exception from a Java object | GetFunctionList() | Returns a structure containing all of the built-in functions available in ColdFusion | GetHTTPRequestData() | Retrieves the HTTP request headers and body and makes them available for use | GetK2ServerCollections() | Deprecated (no longer in use) | GetK2ServerDocCount() | Deprecated (no longer in use) | GetK2ServerDocCountLimit() | Deprecated (no longer in use) | GetPageContext() | ColdFusion wrapper for the Java PageContext object | GetTickCount() | Returns a tick count used to perform timing tests, with millisecond accuracy | IsBinary() | Tests whether a specified value is binary | IsBoolean() | Determines whether a value can be converted to a Boolean value | IsCustomFunction() | Checks whether a specified function is a user-defined function | IsDebugMode() | Checks whether a page is being sent back to the user in debug mode | IsDefined() | Determines whether a specified variable exists | IsK2ServerDocCountExceeded() | Deprecated (no longer in use) | IsK2ServerOnline() | Deprecated (no longer in use) | IsNumeric() | Checks whether a specified value is numeric | IsObject() | Determines whether the value is a specified type of object | IsSimpleValue() | Checks whether a value is a string, a number, a TRUE/FALSE value, or a date/time object | ParameterExists() | Deprecated (no longer in use). Use IsDefined() instead | PreserveSingleQuotes() | Instructs ColdFusion to not escape single quotation marks contained in values derived from dynamic parameters | ReleaseCOMObject() | Releases COM object from memory | QuotedValueList() | Returns a list of values in a specified query column, with all values enclosed within quotes | ToScript() | Produces Javascript variables from ColdFusion variables | URLDecode() | Decodes a URL-encoded string | URLEncodedFormat() | Encodes a string in a format that can safely be used within URLs | ValueList() | Returns a list of values in a specified query column | WriteOutput() | Appends text to the page output stream |
|