Atom support for Emmet in ColdFusion .cfm and .cfc files

I’m late to the party, but I’m trying out a new editor: GitHub’s Atom. My mission when I try out a new editor is to see if I can get the following 3 items set up properly (because if I can’t the editor is unfortunately not going to work for me).

  1. Language Support for ColdFusion
  2. An Emmet package
  3. Support for Emmet functionality within a .cfm, .cfc file

Setting up Language support for ColdFusion is easy. Simply install the language-cfml package. To install a package in Atom:

  • From the Atom editor menu, navigate to Atom -> Preferences
  • Click the Install button
  • Type language-cfml in the Search Packages field and click the Packages button
  • Click the Install button for the language-cfml package

Setting up Emmet is easy. Simply install the emmet package (see package install instructions above).

Setting up Emmet support for ColdFusion .cfm and .cfc files requires editing your Keymap. This step was derived from the emmet-atom Tab key documentation

  • Open the Keymap file (keymap.cson): Atom > Keymap...
  • Add the following to the keymap.cson file (proper indention counts):
'atom-text-editor[data-grammar="text html cfml"]:not([mini])':
    'tab': 'emmet:expand-abbreviation-with-tab'

Processing ColdFusion using .htm and .html files with Lucee

If you want Lucee to use the .htm and .html file extensions instead of (or in addition to) .cfm and .cfml you can set this up in 3 quick steps.

1. Stop Lucee
2. Edit the web.xml file located at

<Lucee Install Dir>/conf/web.xml





3. Start Lucee

Connecting ColdFusion 10 to FoxPro 9

My company has a legacy application built in FoxPro 9 which contains a table that I need to extract data from on a recurring basis. I have never worked with FoxPro. Apparently in FoxPro each table has a corresponding .dbf file. For this example we will say that the table file is persons.dbf, which resides at C:\legacyapp\data\.

The first step for connecting ColdFusion to the FoxPro database was to find an acceptable driver. I initially tried to use some ODBC drivers but abandoned this route. Not only was it just not working, but I do my development on a Mac (whereas production is Windows) and I really wanted a solution that did not involve a Windows and a Mac configuration.

So the following steps describe how I set up a jdbc connection to FoxPro 9 from ColdFusion.

  1. Download the StelsDBF JDBC Driver
  2. Place the dbfdriver.jar file in {ColdFusion-Home}/cfusion/lib aka C:\ColdFusion10\cfusion\lib\
  3. Restart the ColdFusion services
  4. Login to the CFADMIN and set up a Data Source
    • For ‘Data Source Name’ enter ‘legacyapp’
    • For ‘Driver’ select ‘Other’
    • Click ‘Add’
    • For JDBC URL enter ‘jdbc:jstels:dbf:c:/legacyapp/data’
    • For Driver Class enter ‘jstels.jdbc.dbf.DBFDriver2’
    • Click ‘Submit’
  5. When using cfquery to select data use the file name as the table name:

It was actually not too bad to set up once I located the driver.

Using a ColdFusion Ternary Operator for an Optional Tag Attribute

Today I had to write a script to process a form and send an email as part of the processing. The form allows the user to specify an email address to bcc, but it’s not required. I’m a big fan of using the Ternary Operator for doing either/or stuff like css classes. So I decided to extend that fandom to set the bcc attribute of the <cfmail> tag if the email specified in the form was valid.

Assumptions for this example:

1. You have validated form.bccEmail as a valid email.
2. You have a default mail server specified in Application.cfc or CFADMIN.
3. You may see more utility in using the Ternary Operator for other conditional cases.

The “magic” is in the bcc attribute below:

    <cfmail to="" 
        subject="An important message" 
	    Message Body here...

ColdFusion function returns space before value

I had an annoying issue this morning where a function I wrote that rounds and formats values for use in an internal financial app kept sticking a single space before the value returned. This was obviously not good for a financial app. After spending 10-15 minutes tearing the function’s innards apart it turns out what was going on in the function was not the cause. The cause was simple.

In a tag based ColdFusion function you need to be sure to include the ‘output=”no”‘ attribute.

<cffunction name="RoundMoney" returntype="numeric" output="no"> 
     ... MAGIC STUFF HERE ...

Helpful Commands for ColdFusion 10 on OSX… aka Start and Stop CF10 from the command line

This post assumes you are working with the default instance (cfsusion) and that you installed ColdFusion 10 to the default location on you Mac.

/Applications/ColdFusion10/cfusion/bin/coldfusion status

/Applications/ColdFusion10/cfusion/bin/coldfusion start

/Applications/ColdFusion10/cfusion/bin/coldfusion stop

/Applications/ColdFusion10/cfusion/bin/coldfusion restart

Launch GUI for configuring Web Connectors:
sudo /Applications/ColdFusion10/cfusion/runtime/bin/wsconfig

(Then Enter 1 for changing Admin Password and put in your new super strong password!)


RDS Query Viewer not working: How to fix the ColdFusion Builder error: ‘/YOURPROJECTFOLDER/.rdsTempFiles/RDS Query Viewer’ does not exist

I have had this issue for a while and it finally made me crazy enough to try to figure it out. It appears that this error occurs when the “RDS Query Viewer” file does not exist in the .rdsTempFiles folder within your project.

On Mac

  1. Open Terminal
  2. Navigate to the directory where your project is located. For example type: cd /Applications/ColdFusion9/wwwroot/YOURPROJECTFOLDER and hit <enter>
  3. If the “.rdsTempFiles” directory does not exist type: mkdir .rdsTempFiles and hit <enter>
  4. If the “RDS Query Viewer” file does not exist type: touch “.rdsTempFiles/RDS Query Viewer” and hit <enter>. BE SURE TO SURROUND THE COMMAND WITH THE DOUBLE QUOTES BECAUSE THE FILE NAME HAS SPACES.
  5. Refresh the “RDS Query Viewer” view. RDS Query View should work now.

On Windows

  1. Open DOS
  2. Navigate to the directory where your project is located. For example type: cd C:\ColdFusion9\wwwroot\YOURPROJECTFOLDER and hit <enter>
  3. If the “.rdsTempFiles” directory does not exist type: mkdir .rdsTempFiles\rdsTempFiles and hit <enter>
  4. If the “RDS Query Viewer” file does not exist type: fsutil file createnew “RDS Query Viewer” 0 and hit <enter>. BE SURE TO SURROUND THE COMMAND WITH THE DOUBLE QUOTES BECAUSE THE FILE NAME HAS SPACES.
  5. Refresh the “RDS Query Viewer” view. RDS Query View should work now.

ColdFusion 9 SELECT IN query using ormExecuteQuery()

For some reason this took me some effort to figure out. Maybe others will find it useful.

CategoryList = '1,2,3';
Categories = ormExecuteQuery("from Category where Id IN (:IdList)",{IdList=ListToArray(CategoryList)});

If you know a better way please drop me a comment. I posted this in the Adobe Coldfusion forum for a few days but didn’t get anything.

Adding more resource navigator filters to ColdFusion Builder (Eclipse) Redux

There is a post at for how to add resource navigator filters to CFBuilder:

The solution below is similar, but does not involve accessing .jar files.

Step 1: Locate your version of CFBuilder by selecting “About Adobe ColdFusion Builder 2”.  Make a note of the Version and Build numbers.  For this post I am on Version: 2.0.0 and Build: 277745
Step 2: Locate the plugin.xml file in the com.adobe.ide.coldfusion.rcp_X.X.X.XXXXXX folder (Notice how X.X.X.XXXXXX corresponds to the Version and Build from Step 1):
Step 2: Locate the following section:

Step 3: Add a block like this for each new filter you want:

Step 4: Start CFBuilder from the command line.  For me on the Mac I execute the following command in Terminal:
"/Applications/Adobe ColdFusion Builder 2/" -clean
Step 5: Enjoy your new navigator filter(s).

Add a last modified date to FW/1 (Framework One) pages


  1. I’m a total newb to FW/1.
  2. There is most likely a better, or built in way to do this.

Still with me?  Ok.  Here is the specification for this little ditty:

  1. The site I’m working on is mostly static.
  2. It is required (perhaps legally, definitely procedurally) that every page of the site must have a last modified date in the footer.
  3. The site is built using FW/1 (which is awesome).

Here are the cliff notes of what’s about to go down:

  1. I have a footer that is included in every page.
  2. In the footer view Im going to look at the current page’s action in the request context (rc) and figure out what the corresponding “view” is based on the action
  3. I’m going to use cfdirectory to find the lastmodifieddate of the view file from step 2.

Without further adieu:

<!— Start with the path to our views folder —>
<cfset local.viewPath=”#VARIABLES.FRAMEWORK.BASE#views” />
<!— Make an array of rc.action (we use this to append subfolders) —>
<cfset local.arrAction=ListToArray(rc.action,”.”) />
<!— Set the counter to be 1 short of the action array len b/c the last member will be our view page —>
<cfset local.counter=ArrayLen(local.arrAction)-1 />
<!— Set the last member of our action array to be our action page —>
<cfset local.viewPage=”#local.arrAction[ArrayLen(local.arrAction)]#.cfm” />
<!— Append any subfolders to our viewPath —>
<cfloop from=”1″ to=”#local.counter#” index=”local.a”>
<cfset local.viewPath=”#local.viewPath#/#local.arrAction[local.a]#” />
<!— Look for our viewPage cfm file in our viewPath —>
<cfdirectory action=”list”
filter=”#ListLast(local.viewPage, “/”)#”>
<!— If we have a record count then calculate the last modified date —>
<cfif qGetLastdateModified.recordCount>
<cfset local.siteLastUpdated=’#DateFormat(qGetLastdateModified.dateLastModified,”long”)# at #TimeFormat(qGetLastdateModified.dateLastModified,”hh:mm:ss tt”)#’ />
<cfset local.siteLastUpdated=”unknown :- (” />