Application files in eCM

e-CM comes with a number of application files that get loaded on each page call within the e-CM framework. Some of these files can be used to inject your own processing into e-CM to manage different elements. I will look at the various files and give some hints as to what you can do with them.

Let's assume to start that the application has been initialized and your session has already been set up, which is probably about 98% of all page hits to e-CM.

1) Application.cfm (ApplicationOriginal.cfm): this file is built by the quick start wizard and while it is unencrypted, I do not recommend you make any modifications to this file. If you do you will have to put those modifications back each time to run the e-CM wizard, which is just too prone to error.

2) ApplicationUDFs.cfm: this file is the second to last line run in the Application.cfm file. This is meant as place for you to place any user-defined functions you want to create for your system. There are some placed in here by default, but you can add your own as you need. This file is not encrypted but might be modified in a later release.

3) ApplicationCustom.cfm: here is where you can place any custom code you want in order to give global control over custom code you might be putting within the application.

Now, if you want to create your own application variables, I do not recommend putting them in this file. There are two places you can put these variables. One I will discuss below, as for the other, you can place them in the Site Maintenance settings available in e-CM administrator. It is possible to even build your own custom components to separate your unique variables from those of the system. To do this you need to create an entry in the component_ref table, activate it, and reset the application variables. I will blog on this more extensively in the future.

Let's step back and look at what gets called when e-CM is first initialized or when the application variables are reset:

1) Application.cfm: see above

2) LoadApplicationVariables.cfm: this file is encrypted and you cannot change it. However, it is pulling all the variables found in the site maintenance area in the e-CM admin. So if you created your own variables as I mentioned above, they would get pulled into the application scope at this time.

3) ApplicationQueries.cfm: this is another encrypted file that cannot be changed. This file pulls in other files throughout the system and loads application queries that are located in those individual files. These files are all encrypted as well. HOWEVER, at the end of ApplicationQueries.cfm there is a call to ApplicationClient.cfm

4) ApplicationClient.cfm: if you have custom queries or information that you need loaded when the application is initialized and should not get loaded on each page call, you can put that processing in here. This file is only called on when the system is reset, so it should only be used for loaded variables into memory. If you need some processing done each time a page is called, then you should use the ApplicationCustom.cfm for that.

 

So the key files that you want to look at for putting in your own application-level processing:

1) ApplicationCustom.cfm: when this processing should happen each page call.

2) ApplicationClient.cfm: when this processing should only happen when e-CM is initialized.

 

There is one final technique that I want to mention when it comes to adding processing to e-CM. request.l_HTMLHeadContentInformation is a variable that can be added to:

This variable is used in the CFHTMLHEAD call at the very end of the template call. This allows you to put information into the ... block in your HTML code. So you can add javascript and other processing into here as needed by adding to this variable. NOTE: you should add to it and not replace it.

Hope this all helps you get the most out of e-CM.

Thanks,

Beau