Wednesday, March 18, 2009

ColdFusion Java CFX Reference

ColdFusion Java CFX Reference

Tacking from http://docs.fusionlink.com/coldfusion

ColdFusion includes Java interfaces for building ColdFusion custom CFXs in Java.

Contents

Class libraries overview

The following Java interfaces are available for building ColdFusion custom CFXs in Java:

:

Interface

Methods

Custom tag interface

processRequest

Query interface

addRow

getColumnIndex

getColumns

getData

getName

getRowCount

setData

Request interface

attributeExists

debug

getAttribute

getAttributeList

getIntAttribute

getQuery

getSetting

Response interface

addQuery

setVariable

write

writeDebug

Custom tag interface

public abstract interface CustomTag
Interface for implementing custom tags. 

Classes that implement this interface can be specified in the CLASS attribute of the Java CFX tag. For example, in a class MyCustomTag, which implements this interface, the following CFML code calls the MyCustomTag.processRequest method:

Query interface

public abstract interface Query
 

Interface to a query used or created by a custom tag. A query contains tabular data organized by named columns and rows.

Methods

Returns

Method

Description

int

addRow()

Adds a row to the query

int

getColumnIndex(String name)

Gets the index of a column given its name

String[]

getColumns()

Gets a list of the column names in a query

String

getData(int iRow, int iCol)

Gets a data element from a row and column of a query

String

getName()

Gets the name of a query

int

getRowCount()

Gets the number of rows in a query

void

setData(int iRow, int iCol, String data)

Sets a data element in a row and column of a query

Request interface

public abstract interface Request

Interface to a request made to a CustomTag. The interface includes methods for retrieving attributes passed to the tag (including queries) and reading global tag settings.

Response interface

public abstract interface Response

Interface to response generated from a custom tag. This interface includes methods for writing output, generating queries, and setting variables in the calling page.

Methods

Returns

Syntax

Description

Query

addQuery(String name, String[] columns)

Adds a query to the calling template.

void

setVariable(String name, String value)

Sets a variable in the calling template.

void

write(String output)

Outputs text back to the user.

void

writeDebug(String output)

Writes text output into the debug stream.

Debugging classes reference

The constructors and methods supported by the DebugRequest, DebugResponse, and DebugQuery classes are as follows. These classes also support the other methods of the Request, Response, and Query interfaces, respectively.

DebugRequest

// initialize a debug request with attributes
public DebugRequest( Hashtable attributes ) ;
 
// initialize a debug request with attributes and a query
public DebugRequest( Hashtable attributes, Query query ) ;
 
// initialize a debug request with attributes, a query, and settings
public DebugRequest( Hashtable attributes, Query query, Hashtable settings ) ;
 

1 comment:

  1. Good informative post I was seacrching for a methode that gets the index of a column given its name which is int getColumnIndex(String name).It solved my requirement in one of my assignment today.Thanks

    ReplyDelete