Welcome!

ColdFusion Authors: Maureen O'Gara, Hovhannes Avoyan, Yakov Fain, Pat Romanski, Liz McMillan

Related Topics: ColdFusion

ColdFusion: Article

How ColdFusion MX 7 Made Me a "Hero" at the Office...

Making valuable and useful business information easily accessible

After the resounding (and somewhat unexpected) success of the salient issues applications, my next project was to build a ColdFusion application that would serve as a comprehensive inventory of clean diesel fuel projects in the U.S. This new application was named the "National Clean Diesel Database" (NCDD) and it has become an agency-wide intranet tool that EPA employees can access and use from any of our 10 regional offices (located in major cities throughout the U.S.) and headquarters. I used ColdFusion's <CFCHART> tag to generate attractive and informative bar and pie charts that neatly summarize the voluminous clean diesel project data (project cost, projected emission reductions, number of projects and vehicles per region, and so forth). I also used the <CFFUNCTION> tag to write UDFs that encapsulated redundant formatting and processing to further streamline my code and make it reusable. Some of the functions that I created while working on the NCDD were later used in my other ColdFusion applications. In the NCDD, I made frequent and effective use of the <CFOUTPUT> tag's "group" attribute to create grouped output of query results by region. I also used the "Query of Queries" feature to keep database interaction to an absolute minimum. I ended up receiving an award in 2005 for my work on the NCDD.

In early 2006 I added the <CFDOCUMENT> tag to my code arsenal so that users could easily retrieve "printable" (and portable) versions of application pages in Adobe Acrobat (PDF) format. I think the ability to dynamically render Web pages in PDF (or Flashpaper) format is one of the most exciting and truly useful new features in ColdFusion MX 7. In addition to being a tremendous time-saver, it has allowed me to accomplish certain things that would have otherwise been impossible. For example, I'm currently using the <CFSCHEDULE> and <CFDOCUMENT> tags to automatically publish static pages in both HTML and PDF format. PDF and/or HTML versions of Web documents published via our intranet can be moved to a public Web site that has no ColdFusion support. In other words, with ColdFusion MX 7 I am able to use an intranet application to generate documents for use on a static (non-ColdFusion) Web site. This is a critically important feature for me because having an actual ColdFusion application on my agency's public Web site is out of the question due to the high cost. The ability to produce static PDF (and HTML) documents from intranet database information for use on our public site is an effective, no-cost solution to this problem; this technique produces up to date, high-quality documents that can be deployed immediately on our public Web site. For examples of static Web documents that I have created using an intranet ColdFusion application, see www.epa.gov/reg3artd/permitting/permits1c.htm#lists and www.epa.gov/reg3artd/permitting/petitions2.htm.

Recently, while experimenting with some code, I found that I could use ColdFusion as a "JavaScript code generator." This technique takes the publication of static Web pages one step further by dynamically rendering JavaScript code in a browser; the code is then copied and pasted (by me) into static Web pages for use on the EPA's public Web site. Just as ColdFusion MX 7 can be used to create static HTML Web pages and PDFs, it can also be used to generate JavaScript code for use in static Web pages. One example of this technique is my division's "Title V Air Permits Search" Web page at www.epa.gov/reg3artd/permitting/t5permitsearch.htm. This is a standard HTML Web page with a twist: it utilizes an external JavaScript file (permitdata.js) that contains over 1,500 lines of JavaScript code. This JavaScript source code is effortlessly generated in seconds (by me) using a ColdFusion template on our intranet that queries our internal Air Permits Tracking System (Oracle) database and then renders, in the browser, all of the JavaScript code that's needed by the Title V Air Permits Search Web page. It's then a simple matter of copying and pasting the generated JavaScript from the browser to a text file and naming the file with a ".js" extension. I have also used UDFs to create dynamic JavaScript links (for lack of a better term) within ColdFusion pages that, when clicked, generate descriptive popup messages using the JavaScript "alert" method. These special popup message links are used throughout my ColdFusion applications to describe acronyms that appear on certain pages. These links make the applications much more user-friendly since users can click on them to quickly find out what the various acronyms mean.

Some things I'm working on for the future include the use of Flash forms for data entry; and the <CFHTTP>, <CFFILE> and <CFFTP> tags for file manipulation, uploads to our public Web server, and interaction with other federal government Web sites. I have also begun experimenting with the <CFTRY> and <CFCATCH> tags to catch and programmatically handle database errors when they occur in my applications. I've been using <CFMAIL> to send myself an e-mail whenever our database server encounters a problem; I have found this to be a very useful technique since I am notified immediately whenever the server goes down. I can then investigate and attempt to correct the problem.

By using ColdFusion MX 7, we have dramatically improved access to our most critical business information. With the salient issues applications, we transformed an archaic, inefficient business practice into a powerful data management tool that can be used by all Region 3 employees. Using ColdFusion MX 7, we were able to overcome Web publication obstacles that had prevented us from providing important environmental information to the public on the EPA Web site. I can't even imagine the exciting and productive things that we'll be doing with ColdFusion MX 7 (or Scorpio) a year or two from now. The future looks very bright indeed for ColdFusion developers, and I am glad to be a part of that future. By the way, what are these Event Gateway things I keep reading about in CFDJ? Maybe it's time to start experimenting with some code again...

More Stories By Michael Markowski

Michael Markowski works for the Air Protection Division at the Environmental Protection Agency and is a Macromedia/Adobe Certified Professional.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.