Editable Files
The following files can be edited by the programmer when adding application specific code to the framework:
Folder Name |
File Name |
Purpose |
(installation folder) |
cfinclude_index_body.cfm |
Application Body |
(installation folder) |
userDefined_application.cfm |
Application.cfm code |
(installation folder)\ezAjax |
ezAJAX_Init.cfm |
AJAX Server Initialization Code |
(installation folder)\ezAjax\cfc |
userDefinedAJAXFunctions.cfc |
AJAX Server Code |
“cfinclude_index_body.cfm”
Notice the file named “cfinclude_index_body.cfm”. This file is the default ColdFusion MX 7 source file into which you may place application specific code for your ezAJAX Application. The file named “cfinclude_index_body.cfm” is used exactly like the typical file named “index.cfm” except you are not allowed to edit the “index.cfm” that is part of the Framework. You can define other files that have the same purpose as the “cfinclude_index_body.cfm” file by editing the file named “userDefined_application.cfm”.
“userDefined_application.cfm”
The file named “userDefined_application.cfm” is to be used exactly like the file named “application.cfm” file except you are allowed to edit file named “userDefined_application.cfm” but you cannot edit the file named “application.cfm”. Take a look at the contents of the file named “userDefined_application.cfm” and you will see what values and variables are used to define additional files that serve the same purpose as the file named “cfinclude_index_body.cfm”.
“ezAJAX_Init.cfm”
The file named “ezAJAX_Init.cfm” contains AJAX Server Initialization Code statements that are executed every time an AJAX Server Command is transmitted to the ezAJAX Server. As you can see from looking at the contents of the “ezAJAX_Init.cfm” file there is not much going on with this file other than to enable or disable Debugging Information when AJAX Server Commands are executed using the <iframe> method. It is not meaningful to enable Debugging of AJAX Server Commands when the <iframe> method is not being used because it is not possible for you as the programmer to “see” or make use of Debugging information when the <iframe> method is not being used. It is advantageous to enable Debugging Information when writing your own AJAX Server Commands because you can use the Floating Debugging Menu (see the following section of the Programmer’s Guide for the details) to show the contents of the hidden <iframe> during development. You would not want to allow the hidden <iframe> to be shown when your application is running on your Production Server however – this is when you would want to use the “oAJAXEngine.isXmlHttpPreferred” Boolean flag which when set to “true” causes the AJAX Engine to use the “XmlHttp” method rather than the hidden <iframe> method for transmitting AJAX Server Commands to the AJAX Server. The “XmlHttp” method is much faster than the hidden <iframe> method but it is more difficult to debug AJAX Server Commands using the “XmlHttp” method. Just to recap the “XmlHttp” method uses whichever one of the following the client browser allows in order of appearance: “Msxml2.XMLHTTP” or “Microsoft.XMLHTTP” or “XMLHttpRequest()”. Both the “XmlHttp” and hidden <iframe> method are known to be 100% compatible with IE 6.x, FireFox 1.5.x, Netscape 8.x and Opera 8.x/9.x.
“userDefinedAJAXFunctions.cfc”
The file named “userDefinedAJAXFunctions.cfc” is where you may place your application specific AJAX Server Commands using the coding technique(s) with which you are comfortable. We use the Java coding technique for all our CFC’s because Java code that is placed between <cfscript> tags executes faster at runtime than any other coding technique for ColdFusion. We have provided ample support within the Framework to allow the Java coding technique to be used exclusively, if you desire maximum performance. If you encounter any ColdFusion functions that are not accessible via the Java coding technique just drop our Support Department an email and make a request and our programming staff will be happy to provide the level of support you require for your specific application.
Prior to version 0.93 the user-defined server-side logic would have been placed into the “userDefinedAJAXFunctions.cfc” file however now this has changed. Beginning with version 0.93 and after the user-defined server-side logic would be placed into CFC’s, one for each Server Command, the name of each CFC is the name of the Server Command. Notice the Server Command known as “performPopulateContentFor” that resides in the CFC known as “performPopulateContentFor.CFC” which has been placed into the folder known as “\ezAjax\cfc”.
Each specific Server Command has a corresponding CFC. The name of the CFC is the same as the Server Command identifier. You can use any valid CFC name (minus the .CFC file type) to name your Server Commands.
This makes it easier to make your ezAJAX Apps modular and it makes it easier for you to manage your server-side logic since now each Server Command goes into a separate CFC.
We have included the whole ezAJAX Site as a working sample which you can download from the Downloads Section of our site so you can see how we used ezAJAX to give you more ideas as to how you can use ezAJAX.
|