Using the Extensions Pages  
 
 

Use the ColdFusion Administrator Extensions pages to register Java applets and CFX tags, custom tags built with C++.

 
 
  Managing CFX tags  
 
 

The CFX Tags page in the ColdFusion Administrator is used to Register and manage ColdFusion custom tags built with C++.

ColdFusion allows you to build extensions or custom tags in two ways:

  • Using C++ to code DLLs (Windows) or shared objects (Solaris) that provide a custom tag you can use in your application pages.
  • Using CFML to create custom tags you invoke in your application pages.

To use a CFX tag you must first register it with ColdFusion. This process simply tells ColdFusion where to find the required DLL when it attempts to process the CFX tag in an application page.

 
 
  Note  
 

A wide variety of custom tags of both types is available from the ColdFusion Tag Gallery.

 
 
  CFX tag samples  
 
 

Source code and compiled versions of two sample CFX tags are installed with ColdFusion (you can register and use them in your application pages). You must first compile this code before registering the DLLs or shared objects in the ColdFusion Administrator. These examples can be found in opt/coldfusion/cfx/examples (Solaris) and cfusion\cfx\examples (Windows).

The two CFX tag examples installed with ColdFusion are as follows:

  • directorylist -- Returns a directory listing.
  • ntuser_db -- (Windows NT only) Allows you to modify Windows NT user permissions.
 
 
  To register a CFX tag:  
 
  1. Open the CFX Tags page in the ColdFusion Administrator.
  2. Enter a name for the CFX tag you are adding. Tag names must be prefixed with CFX_.
  3. Click Add to open the New CFX Tag page.
  4. Enter the path to the library you want to use or browse your system to locate the library you want to use.
  5. Enter the procedure that implements the tag. The procedure name must correspond with an existing procedure in the DLL or shared object you've specified. Procedure names are case-sensitive.
  6. Click Keep library loaded to prevent reloading the library into memory each time a referenced page is accessed.
  7. Enter a description and click Add to finish.
 
 
  Registering a Java applet  
 
 

The Applets page in ColdFusion allows you to register Java applets for use in ColdFusion forms with the CFAPPLET tag. Registering the applet before using it in ColdFusion applications allows you to encapsulate the applet in a simple, easy-to-use interface. The CFAPPLET tag you use to place the applet can be used to override any parameters you define in the Administrator Registered Applets page.

Before you can use CFAPPLET to place a Java applet in your CFFORM, you must register the applet in the ColdFusion Administrator.

 
 
  Applets Administrator page  
 

You can use the CFAPPLET tag to place Java applets in a CFFORM. However, before you can use the tag you need to register your applet using the ColdFusion Administrator. Once your applet is registered with ColdFusion, using the CFAPPLET tag in your code is very simple since all parameters are predefined in the Administrator. Since parameters are predefined in the Administrator, you only need to specify parameter values you want to override for a particular instance. With CFAPPLET, you could enter just the applet source and the form variable name you want to use:

<CFAPPLET APPLETSOURCE="Calculator"
    NAME="calc_value">

You can define all other parameters when you register the applet in the Administrator. Using the HTML APPLET tag, you'd have to invoke all the applet's parameters every time you wanted to use it in an page.

The new Registered Applets page in the ColdFusion Administrator allows you to register Java applets you want to place in your ColdFusion pages with the CFAPPLET tag.

 
 
  To register a Java applet:  
 
  1. Install the Java class files and any other files required for the class. You'll need to specify the codebase argument when registering the applet, so take note of the installed path.
  2. In the ColdFusion Administrator, open the Register New Applet page by clicking the Applets button.
  3. Enter the necessary information. Each field corresponds to values you would enter in the HTML APPLET tag.
  4. Enter the parameter name and value pairs required for your applet. If necessary, you may need to refer to whatever documentation exists for your applet.
  5. When you're done, click Create.

Applet registration fields are explained in the following table.

Java Applet Registration Fields 
Field
Description
Codebase
Enter the base URL of the applet: the directory that contains the applet components. The applet class files must be located within the Web browser root directory. Example:
http://servername/classes
Code
This is the name of the file that contains the applet subclass. The filename is relative to the codebase URL. The *.class file extension is not required.
Method
Enter the method name in the applet that returns a string value. You use this method name in the NAME attribute of the CFAPPLET tag to populate a form variable with the method's value. If the applet has no method, leave this field blank.
Height
Enter a measurement in pixels for the vertical space for the applet.
Width
Enter a measurement in pixels for the horizontal space for the applet.
Vspace
Enter a measurement in pixels for the space above and below the applet.
Hspace
Enter a measurement in pixels for the space on each side of the applet.
Align
Choose the alignment you want.
Java Not Supported Message
This message is displayed by browsers that do not support Java applets. If you want to override this message, you specify a different message in the CFAPPLET tag NOTSUPPORTED attribute.
Parameter Name
Enter a name for a required applet parameter. Your Java applet will typically provide the parameter name needed to use the applet. Enter each parameter in a separate parameter field.
Value
For every parameter you enter, define a default value. Your applet documentation will provide guidelines on valid entries.



 
 
BackUp LevelNext
 
 

allaire     AllaireDoc@allaire.com
    Copyright © 1998, Allaire Corporation. All rights reserved.