Building Custom Cfxapi Tags - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Building Blocks of ColdFusion Applications
<cfoutput>
I'm running in the context of a custom tag named #inCustomTag#.<p>
</cfoutput>
<!--- Get the tag instance data. --->
<cfset tagdata = getbasetagdata(incustomtag)>
<!--- Find out the tag's execution mode. --->
I'm located inside the
<cfif tagdata.thisTag.executionmode neq 'inactive'>
custom tag code either because it is in its start or end execution mode.
<cfelse>
body of the tag
</cfif>
<p>
<cfelse>
<!--- Say that you are lonely. --->
I'm not nested inside any custom tags. :^( <p>
</cfif>
</cfif>
Save the page as nesttag2.cfm.
2
3
Open the file nesttest.cfm in your browser.

Building Custom CFXAPI Tags

Sometimes, the best approach to application development is to develop elements of your application by building
executable to run with ColdFusion. Perhaps the application requirements go beyond what is currently feasible in
CFML. Perhaps you can improve application performance for certain types of processing. Or, you have existing code
that already solves an application problem and you want to incorporate it into your ColdFusion application.
To meet these types of requirements, you can use the ColdFusion Extension Application Programming Interface (CFX
API) to develop custom ColdFusion tags based on Java or C++.
What are CFX tags?
ColdFusion Extension (CFX) tags are custom tags written against the ColdFusion Extension Application
Programming Interface. Generally, you create a CFX tag if you want to do something that is not possible in CFML, or
if you want to improve the performance of a repetitive task.
One common use of CFX tags is to incorporate existing application functionality into a ColdFusion application. That
means if you already have the code available, CFX tags make it easy to use it in your application.
CFX tags can do the following:
• Handle any number of custom attributes.
• Use and manipulate ColdFusion queries for custom formatting.
• Generate ColdFusion queries for interfacing with non-ODBC based information sources.
• Dynamically generate HTML to return to the client.
• Set variables within the ColdFusion application page from which they are called.
• Throw exceptions that result in standard ColdFusion error messages.
Last updated 1/20/2012
224

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents