Adding ModelGlue’s event API to ColdFusion Builder’s code insight

For the last year or so, all of my ColdFusion development projects have been built using the Model-Glue MVC framework. Over time, you get to where you know the most commonly used methods that are used to interact with the framework by heart. Sometimes there are lesser-used methods that you have to go look up. All the time (for me at least) I’m trying to find a way to write code faster and with less errors.

ColdFusion Builder has done a very nice job of providing code insight for ColdFusion tags, functions and CFC methods. This is especially true if you have a server configured in the “Servers” panel and mapped to your CF Builder project as it then will provide code insight for your own CFCs that you create on the page. However, when using Model-Glue, the “event” object is created for you and is always there. Because it’s not explicitly created on the page, CF Builder can’t provide code insight when you need to interact with it. However, it only takes a couple of settings in your project to make CF Builder aware of the event object and start providing help for it.

Here’s the process:

  1. Right click on your project and choosing “Properties”.
  2. In the left pane of the window that comes up, click on “ColdFusion Variable Mappings”.
  3. On the right side, click the “New” button and enter the following values into the boxes
    • Variable Name: event
    • Mapped To: html.ModelGlue.gesture.eventrequest.EventContext
  4. Press the “New” button and enter the following values into the boxes
    • Variable Name: arguments.event
    • Mapped To: html.ModelGlue.gesture.eventrequest.EventContext
  5. Press the Apply button then the OK button

    * Note that the value in the “Mapped To” box is the actual dot-notated path to the EventContext.cfc file from your CF Builder project root. I happen to have my webroot files in a folder named “html” under the project root (see screenshot #1 below).

    Once you have those settings saved, any time you type “event.” or “arguments.event.” you’ll get the list of methods contained in the Event object. Of course, this doesn’t only work with Model-Glue. Any CFC that you regularly use the same name with can be configured this same way.

    I’ve attached some screenshots for reference. If you have any questions or something isn’t working, feel free to ping me.

Speaking to the CFMeetup group on August 20

Charlie Arehart posted this to the CFMeetup site this morning so I thought I’d announce it here too. I will be speaking to the CFMeetup group on Thursday, August 20th at 12:00pm ET. We are going to be talking about one way to set up a development environment for ColdFusion application development that will use Eclipse 3.5 and Tomcat 6 to allow you to develop your applications against any of the major CFML server engines out there today.

This will be my first CFMeetup presentation and I’m both nervous and excited.

The link for the CFMeetup is http://www.meetup.com/coldfusionmeetup/calendar/11128508/.

UPDATE: I’ve attached the slides and XML snippet that I referenced in the presentation. The URL for the recording is http://experts.na3.acrobat.com/p39094247/. Thanks to everyone for attending and for all the feedback.

Configure FusionDebug 3 Beta for use with Railo 3.1 on Tomcat

For the past couple of months, I’ve been running my CFML server engines (yes engines, plural) on top of Tomcat on my local development environment. This offers me, as an independent developer that works on a number of different client projects, a great deal of flexibility in matching a particular client’s production configuration. Also lately, I’ve been working on a couple of projects using Railo 3.1 as well as a project for a client that still uses CFMX 7. One of the things that I really missed when not developing with ColdFusion 8 is the step debugger that ships with CF8. I’d used FusionDebug some time ago with CFMX 7 when I was running it on top of JRun 4 but had never gotten around to getting it configured under my current, Tomcat-based setup. Until tonight that is.

I ran into a situation while working on a MachII application running on Railo 3.1 where I REALLY need to see what was going on with the various variable scopes during the request cycle, so I decided tonight to see if I could get FusionDebug 3 Beta up and running with Railo and Tomcat.

Read More

Interesting ColdFusion 8 debugger behavior

I sometimes have to remind myself what a useful tool the debugger that’s built into ColdFusion 8 is. Today I was debugging a fairly involved process that I’ve been writing that uses several CFCs including on CFC that contains methods to apply all the business rules to the particular process. I had a couple of values that weren’t getting set just correctly so I fired up a debugging session and started to work through the process flow to determine where I was losing the value in question.

Read More