1. Trang chủ
  2. » Công Nghệ Thông Tin

ColdFusion MX Bible phần 10 doc

133 255 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 133
Dung lượng 0,92 MB

Nội dung

1076 Part IX ✦ ColdFusion MX Language Reference IsXMLRoot( object) XmlChildPos() Returns an integer containing the position of the indexed element named the same as childName in xmlelement’s XMLChildren array. XmlChildPos( xmlelement, An XML document object element. childName, The name of a child of xmlelement. index) The indexth occurrence of childname inside xmlelement. XmlElemNew() Returns a new element created inside of xmlObject. After creating the element, it must be assigned to a specific position in the document object. XmlElemNew( xmlObject, The XML document object. childName) The name of the new child. Application Notes • XmlElemNew() creates a new element in a document object, but the element does not have a home yet. You must explicitly specify where the new element is in the hierarchy before it is truly part of the document object. XmlFormat() Returns a string escaped so that it may be used inside an XML element. Replaces any special characters with their XML-safe equivalents. XmlFormat( string) XmlNew() Returns a new XML document object. XmlNew( caseSensitive) “NO | YES”: If YES, CFXML treats tags with different case names as different types of elements. Defaults to NO. XmlParse() Returns an XML document object created by parsing the XML inside xmlString. 546228 Ch55.F 1/31/03 2:28 PM Page 1076 1077 Chapter 55 ✦ Working with Systems Outside ColdFusion XmlParse( xmlString, The XML string to parse. caseSensitive) “NO | YES”: If YES, CFXML treats tags with different case names as different types of elements. Defaults to NO. XmlSearch() Returns an array containing all the elements inside xmlObject that match xPathString. XmlSearch( xmlObject, The XML document object to search. xPathString) An XPath expression to apply to the document object. XmlTransform() Returns a string containing the XML resulting from applying the XSLT inside xslString to either xmlString or xmlObject. An XML String: XmlTransform( xmlString, The XML source document to transform. xslString) The XSL stylesheet to apply to the source. An object representing an XML document: XmlTransform( xmlObject, The XML document object to transform. xslString) The XSL stylesheet to apply to the source. WDDX <CFWDDX> Converts ColdFusion and JavaScript objects to and from WDDX (Web Development Data exchange, a data-centric flavor of XML). To serialize a ColdFusion variable into WDDX: <CFWDDX action = “CFML2WDDX” input = “#coldFusionObject#” output = “nameOfVariableToContainWDDX” This variable contains the WDDX that describes the variable passed in input. If you omit this attribute, CFWDDX outputs the serialized WDDX to the HTML stream. useTimeZoneInfo = “YES | NO”> If YES, ColdFusion includes time-zone information in any date-time values inside the packet. 546228 Ch55.F 1/31/03 2:28 PM Page 1077 1078 Part IX ✦ ColdFusion MX Language Reference To deserialize WDDX into a ColdFusion variable: <CFWDDX action = “WDDX2CFML” input = “#wddxPacket#” output = “nameOfColdFusionVariableToCreate” validate = “YES | NO”> If YES, ColdFusion validates the WDDX packet before deserializing and throws an error if the packet is invalid. To convert a ColdFusion variable to a JavaScript object: <CFWDDX action = “CFML2JS” input = “#coldFusionObject#” topLevelVariable = “nameOfJSVariable” This is the name of the JavaScript variable that this tag creates. output = “nameOfVariableToContainJavaScript”>This variable contains JavaScript code that creates the WDDX object. If you omit this attribute, the JavaScript is just output to the HTML stream. To deserialize WDDX into a JavaScript object: <CFWDDX action = “WDDX2JS” input = “#wddxPacket#” topLevelVariable = “nameOfJSVariable” The name of the JavaScript variable that this tag creates. output = “nameOfVariableToContainJavaScript” This variable contains JavaScript code that creates the WDDX object. If you omit this attribute, the JavaScript is just output to the HTML stream. validate = “YES | NO”> If YES, ColdFusion validates the WDDX packet before deserializing and throws an error if the packet is invalid. IsWDDX() Returns TRUE if value represents a valid WDDX packet, and FALSE otherwise. IsWDDX( value) Web Servers <CFHTTP> Requests a page from a remote server by using HTTP. Can also create a query object from a delimited text file on a remote machine. 546228 Ch55.F 1/31/03 2:28 PM Page 1078 1079 Chapter 55 ✦ Working with Systems Outside ColdFusion In getting data from a remote server: <CFHTTP url = “URLOfPageToCall” method = “GET” Any request parameters must be passed as part of the URL. port = “80” userName = “userNameForBasicAuthorization” password = “passwordForBasicAuthorization” path = “PathToDirectoryToStoreResults” You can save the results of the request by specifying path and file. If these attributes aren’t given, the output is available in CFHTTP.FileContent. file = “NameOfFileToStoreResults” resolveURL = “YES | NO” Modifies any URLs in the returned page content such that they include the full server and port so that all links remain functional. proxyServer = “NameOrIPOfProxyServer” proxyPort = “portNumber” userAgent = “customRequestUserAgent” To put a custom value in the HTTP user agent for the request, specify this attribute. throwOnError = “YES | NO” If YES, any HTTP error causes CFHTTP to throw a ColdFusion error. Default is NO. redirect = “YES | NO” If YES, ColdFusion follows up to four request redirections. If NO, ColdFusion treats a redirect as an error. timeOut = “60” charSet = “UTF-8 | ISO-8859-1 | UTF-16 | US-ASCII | UTF-16LE | UTF-16BE | otherCharacterSet”> In posting data to a remote server: <CFHTTP url = “URLOfPageToCall” method = “POST” port = “80” userName = “userNameForBasicAuthorization” password = “passwordForBasicAuthorization” path = “PathToDirectoryToStoreResults” You can save the results of the request by specifying path and file. If these attributes aren’t given, the output is available in CFHTTP.FileContent. file = “NameOfFileToStoreResults” resolveURL = “YES | NO” Modifies any URLs in the returned page content such that they include the full server and port so that all links remain functional proxyServer = “NameOrIPOfProxyServer” proxyPort = “portNumber” 546228 Ch55.F 1/31/03 2:28 PM Page 1079 1080 Part IX ✦ ColdFusion MX Language Reference userAgent = “customRequestUserAgent” To put a custom value in the HTTP user agent for the request, specify this attribute. throwOnError = “YES | NO” If YES, any HTTP error causes CFHTTP to throw a ColdFusion error. Default is NO. redirect = “YES | NO” If YES, ColdFusion follows up to four request redirections. If NO, ColdFusion treats a redirect as an error. timeOut = “60” charSet = “UTF-8 | ISO-8859-1 | UTF-16 | US-ASCII | UTF-16LE | UTF-16BE | otherCharacterSet”> POST operations must have at least one CFHTTPPARAM tag. </CFHTTP> In creating a query object from a text file: <CFHTTP url = “URLOfPageToCall” name = “nameOfConstructedQuery” This variable contains the query constructed from the data retrieved by CFHTTP. delimiter = “queryDelimiter” The delimiter that appears between each column. textQualifier = “queryValueQualifier” The qualifier that surrounds the values of each field. columns = “column1,column2,column3” The names of the query columns, if firstRowAsHeaders is NO. firstRowAsHeaders = “YES | NO” If YES, the first row of the retrieved data file contains the column names. method = “GET | POST” port = “80” userName = “userNameForBasicAuthorization” password = “passwordForBasicAuthorization” path = “PathToDirectoryToStoreResults” file = “NameOfFileToStoreResults” resolveURL = “YES | NO” proxyServer = “NameOrIPOfProxyServer” proxyPort = “portNumber” userAgent = “customRequestUserAgent” throwOnError = “YES | NO” redirect = “YES | NO” timeOut = “60” charSet = “UTF-8 | ISO-8859-1 | UTF-16 | US-ASCII 546228 Ch55.F 1/31/03 2:28 PM Page 1080 1081 Chapter 55 ✦ Working with Systems Outside ColdFusion | UTF-16LE | UTF-16BE | otherCharacterSet”> Cross References CFHTTPPARAM Describes the parameters to be passed to the called page. (POSTs only). <CFHTTPPARAM> Describes a parameter to pass during a POST made by using CFHTTP. <CFHTTPPARAM name = “nameOfParam” type = “URL | FORMFIELD | COOKIE | CGI | FILE” value = “#valueToSend#” file = “fullPathToFileToSend”> Cross References CFHTTP Defines the HTTP request. GetHttpRequestData() Returns a structure containing the HTTP headers in effect for the current HTTP request. GetHttpRequestData() Java, COM, and CORBA <CFAPPLET> Places a registered Java applet on the page. Any applet referenced by using CFAPPLET must be registered in ColdFusion Administrator. <CFAPPLET appletSource = “nameOfRegisteredApplet” name = “nameOfFormVariable” Applies only if the method was supplied as the applet was registered with ColdFusion Administrator. height = “300” width = “400” vSpace = “10” 546228 Ch55.F 1/31/03 2:28 PM Page 1081 1082 Part IX ✦ ColdFusion MX Language Reference hSpace = “10” align = “TOP | LEFT | BOTTOM | BASELINE | TEXTTOP | ABSBOTTOM | MIDDLE | ABSMIDDLE | RIGHT” notSupported = “messageIfNoJava” Any additional parameters become applet parameters. > Cross References CFFORM Describes the form containing this applet. <CFIMPORT> Imports a custom tag library and assigns it a tag prefix. Can import JSP custom tags based on a JAR or TLD file; can also import ColdFusion custom tags if given the name of a directory. <CFIMPORT taglib = “/taglib.jar The URL path of a JAR file to import as a tag library. Should be located inside the webroot; must also be located on the classpath in ColdFusion Administrator. | /taglib.tld The URL path of a Tag Library Description XML file describing the tag library to import. | /directoryContainingCFMLCustomTags” The URL path to a directory containing ColdFusion custom tags. prefix = “tagPrefix”> The imported tags can be called by using the prefix specified here. <CFOBJECT> Instantiates a COM, CORBA, Java, component, or web service object. To instantiate a COM object: <CFOBJECT action = “CREATE Creates a new instance of the COM object. | CONNECT” Connects to an existing instance of the COM object. class = “ProgIDOfCOMClass | NameOfCOMClass” name = “nameOfNewObject” Specifies the name of the variable that will contain the COM object. type = “COM” context = “INPROC In-process object. | LOCAL Out-of-process but on this machine. | REMOTE” Calls a DCOM object on a remote machine. server = “NameOfRemoteServer”> Required if context is REMOTE. 546228 Ch55.F 1/31/03 2:28 PM Page 1082 1083 Chapter 55 ✦ Working with Systems Outside ColdFusion To instantiate a component object: <CFOBJECT name = “nameOfNewObject” component = “nameOfComponent”> To instantiate a CORBA object: <CFOBJECT context = “IOR Use the Interoperable Object Reference (IOR) to access the CORBA server. | NAMESERVICE” Use a naming service to access the CORBA server. Valid only with a VisiBroker ORB (Object Request Broker). class = “NameOfServiceOrClass” If context is IOR, this attribute contains the path to a file containing the string IOR. If the context is NAMESERVICE, this is the naming context for a naming service. name = “nameOfNewObject” type = “CORBA” locale = “argumentsToVisiBrokerORB”> If the ORB needs any extra arguments, pass them in this attribute. Valid only for VisiBroker ORBs. To instantiate a Java or EJB (Enterprise JavaBean) object: <CFOBJECT action = “CREATE” class = “nameOfJavaClass” name = “nameOfNewObject” type = “JAVA”> To instantiate a web service object: <CFOBJECT webService = “mappedServiceName | URLToWSDLFile” name = “nameOfNewObject”> Cross References CreateObject() Instantiates an object inside of CFSCRIPT. <CFSERVLET> Deprecated. <CFSERVLETPARAM> Deprecated. CreateObject() Returns a new COM, CORBA, Java, component, or web service object. Equivalent to CFOBJECT but can be used inside CFSCRIPT. 546228 Ch55.F 1/31/03 2:28 PM Page 1083 1084 Part IX ✦ ColdFusion MX Language Reference To instantiate a COM object: CreateObject( “COM”, class, Can be either a ProgID or ProgName. context, INPROC, LOCAL, or REMOTE. server) Server name if context is REMOTE. To instantiate a component object: CreateObject( “component”, The literal string “component”. componentName) To instantiate a CORBA object: CreateObject( “CORBA”, context, IOR or NAMESERVICE. class, Class name or IOR file. locale) Extra arguments for a VisiBroker ORB. To instantiate a Java or EJB object: CreateObject( “Java”, class) To instantiate a web service object: CreateObject( “webservice”, wsdlURL) Cross References CFOBJECT Instantiates an object by using CFML. JavaCast() Returns a java-compatible value given a ColdFusion variable JavaCast( type, Boolean, int, long, double, or string. variable) ColdFusion variable to cast. Operating System <CFEXECUTE> Executes an external application or batch file. 546228 Ch55.F 1/31/03 2:28 PM Page 1084 1085 Chapter 55 ✦ Working with Systems Outside ColdFusion <CFEXECUTE name = “C:\dir\myapp.exe Executes a Windows .EXE file. | C:\dir\mybatchfile.bat Executes a Windows batch file. | home/dir/myapp” Executes a UNIX command. arguments = “executableArguments” outputFile = “fullPathOfOutputFile” To redirect output to a file instead of just showing it on the page, use this attribute. If you use the Windows file-redirect operator (>) in your batch file, however, this attribute has no effect. timeOut = “30”> Maximum amount of time in seconds that this CFEXECUTE call may take. Setting this to 0 makes the executable run asynchronously, also called “non-blocking mode”. . . . </CFEXECUTE> ✦✦✦ 546228 Ch55.F 1/31/03 2:28 PM Page 1085 [...]... GetK2ServerDocCountLimit() IsK2ServerABroker() Returns TRUE if the current K2 Server is a K2 Broker, and FALSE otherwise IsK2ServerABroker() IsK2ServerDocCountExceeded() Returns TRUE if the collections being managed by the K2 Server exceed the current limit for the current edition of ColdFusion MX and FALSE otherwise IsK2ServerDocCountExceeded() 109 3 546228 Ch57.F 109 4 1/31/03 2:31 PM Page 109 4 Part IX ✦ ColdFusion. .. automatically apply any operators to the search GetK2ServerDocCount() Returns the number of documents currently searchable by the Verity K2 Server See Chapter 32 for details about Verity K2 Server GetK2ServerDocCount() GetK2ServerDocCountLimit() Returns the maximum number of documents that the K2Server and the current installation of ColdFusion MX can handle: 10, 000 for Developer; 125,000 for Professional; and... TIMES | COURIER | ARIALUNICODEMS” Use ArialUnicodeMS for a double-byte character set on UNIX or a doublebyte character set with Flash fontSize = 10 fontBold = “NO | YES” fontItalic = “NO | YES” 546228 Ch59.F 1100 1/31/03 2:47 PM Page 1100 Part IX ✦ ColdFusion MX Language Reference labelFormat = “NUMBER | CURRENCY | PERCENT | DATE” xAxisTitle = “titleOfXAxis” yAxisTitle = “titleOfYAxis” sortXAxis = “YES... chart containing this series Data points within this series Deprecated Use CFCHART and CFCHARTSERIES instead Deprecated Use CFCHARTDATA instead 1101 546228 Ch59.F 1102 1/31/03 2:47 PM Page 1102 Part IX ✦ ColdFusion MX Language Reference Reporting Calls a Crystal Reports file Delete a file: Read a file... relative to the current template ExpandPath( relativePath) FileExists() Returns TRUE if absolutePath describes a valid file; FALSE otherwise FileExists( absolutePath) 1109 546228 Ch60.F 1 110 1/31/03 2:48 PM Page 1 110 Part IX ✦ ColdFusion MX Language Reference GetBaseTemplatePath() Returns the full disk path of the file at the root of the current request GetBaseTemplatePath() Cross References GetCurrentTemplatePath()... not save a copy of the message Cross References CFMAILPARAM CFPOP Describes a mail header or attachment for this mail message Retrieves mail from a POP server 546228 Ch58.F 109 6 1/31/03 2:33 PM Page 109 6 Part IX ✦ ColdFusion MX Language Reference Specifies a mail header or attachment for a call to CFMAIL The name and file attributes are mutually exclusive To include a message header:... for “.” and “ ” in the returned query object To create a new directory: 546228 Ch60.F 1106 1/31/03 2:48 PM Page 1106 Part IX ✦ ColdFusion MX Language Reference To delete a directory: This action fails if the directory is not empty To rename a directory: . current limit for the current edition of ColdFusion MX and FALSE otherwise. IsK2ServerDocCountExceeded() 546228 Ch57.F 1/31/03 2:31 PM Page 109 3 109 4 Part IX ✦ ColdFusion MX Language Reference IsK2ServerOnline() Returns. Server. GetK2ServerDocCount() GetK2ServerDocCountLimit() Returns the maximum number of documents that the K2Server and the current installation of ColdFusion MX can handle: 10, 000 for Developer;. Administrator. height = “300” width = “400” vSpace = 10 546228 Ch55.F 1/31/03 2:28 PM Page 108 1 108 2 Part IX ✦ ColdFusion MX Language Reference hSpace = 10 align = “TOP | LEFT | BOTTOM | BASELINE |

Ngày đăng: 14/08/2014, 01:21