Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 237

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
import java.util.Hashtable ;
import com.allaire.cfx.* ;
public class OutputQuery implements CustomTag {
// debugger testbed for OutputQuery
public static void main(String[] argv) {
try {
// initialize attributes
Hashtable attributes = new Hashtable() ;
attributes.put( "HEADER", "Yes" ) ;
attributes.put( "BORDER", "3" ) ;
// initialize query
String[] columns = { "FIRSTNAME", "LASTNAME", "TITLE" } ;
String[][] data = {
{ "Stephen", "Cheng", "Vice President" },
{ "Joe", "Berrey", "Intern" },
{ "Adam", "Lipinski", "Director" },
{ "Lynne", "Teague", "Developer" } };
DebugQuery query = new DebugQuery( "Employees", columns, data ) ;
// create tag, process debugging request, and print results
OutputQuery tag = new OutputQuery() ;
DebugRequest request = new DebugRequest( attributes, query ) ;
DebugResponse response = new DebugResponse() ;
tag.processRequest( request, response ) ;
response.printResults() ;
}
catch( Throwable e ) {
e.printStackTrace() ;
}
}
public void processRequest(Request request, Response response) throws Exception {
// ...code for processing the request...
}
}
Developing CFX tags in C++
You can develop CFX tags in C++.
Sample C++ CFX tags
Before you begin development of a CFX tag in C++, you can study the two CFX tags included with ColdFusion. These
examples can help you get started working with the CFXAPI. The two example tags are as follows:
: Queries a directory for the list of files it contains.
CFX_DIRECTORYLIST
(Windows only): Lets you add and delete Windows NT users.
CFX_NTUSERDB
In Windows, these tags are located in the cf_root\cfx\examples directory. In UNIX, these tags are in the
cf_root/coldfusion/cfx/examples directory.
Last updated 1/20/2012
232

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents