We left off last week just after I had installed the FusionDebug plug-in to Eclipse. I was surprised at how quick it was to install FusionDebug. Within just a few minutes I was ready to debug my CFML application on a ColdFusion 9 developer server.
At the start of this week, I was issued a new project to create a ColdFusion application that interacts with the Harvest time tracking software. Harvest provides an API that is well documented for PHP, Ruby, Pearl etc. but not for ColdFusion! All that is provided is a simple URL based API that returns XML data once a request has been made. I know I can use CFHTTP to send the request, but the structure of the XML returned is a mystery.
I began my investigation by using the built-in debugging feature <CFDUMP>. By passing the parsed XML to CFDUMP it presents you with the XML structure and the data within it, this is what I got.
I am a web developer; I like to see my XML looking like XML. I don’t want to see a formatted table, I want to see raw XML so I can easily use the data.
I thought about how I could get the raw XML. I didn’t want to write anymore CFML code. As readers from last week will know, I am new to CFML and still learning, so I don’t feel confident creating code to print out this XML to the screen. It also seems like a waste of time as the application does not require the raw XML to be printed to the screen. So, I fire up FusionDebug.
I discovered this by accident, but I am glad I did! By pausing the application just after you make the CFHTTP query you can actually see all the elements that the request returns! You can see in the image below where I positioned my breakpoint.
As soon as the breakpoint is hit in the code, FusionDebug displays all the variables currently set. When you make a CFHTTP request this creates a variable called CFHHTP. CFHHTP contains information about the request that has been made, including “Filecontent”. This is where the raw XML I was looking for is stored. Below you can see that by selecting “Filecontent” Eclipse displays the XML that was returned.
Now I know the exact structure of the XML without any ColdFusion formatting making things hard to read. FusionDebug has proven itself to me as a learning tool. I can use FusionDebug to work with API data I don’t understand. It helped me to learn how the XML data was structured and how I can use that to perform my required tasks. Over the last week I have used FusionDebug on several occasions.
Next week I will discuss some even more inventive ways of using FusionDebug to make life as a CFML developer easier.
As the new web guy here at Intergral it is my job to maintain our public sites as well as our internal system known as FusionOrders. Our system is written in ColdFusion, so the Team recommended that I install and use FusionDebug. I have never used a code debugger, why would I need one?! We are all super coders, we don’t need such things!
Over the next few weeks I will be installing, using and learning why I need a CFML step debugger. At the same time I will be evaluating the FusionDebug user experience. If I can’t find the information online, you can’t either! Difference is I have access to do what I like to the website. If the process is not fluid, I’m going to change it!
Today I took some time to install and configure FusionDebug with Eclipse, this is the primary IDE used here at Intergral to develop our products.
As you may or may not know, there are a two ways you can install FusionDebug. I tried both – and immediately became a fan of installing FusionDebug by using the Eclipse plug-in manager – which I will explain below. For our next version release (coming soon!), I have recommended we provide this download option as the primary way to download and install FusionDebug. I will remove the complete IDE installer as I found it confusing.
I boot up Eclipse after installing it and begin to read, to find that the installation instructions on the FusionDebug website are not updated for the latest version of Eclipse. These instructions will soon be updated on the FusionDebug website!
After spending a few moments trying to figure out what is going on, I finally work out that the new version of Eclipse has a new name for the plug-in manger. I added the FusionDebug update site to my new package installer interface and hit next, everything went great. FusionDebug is now installed and ready to go!
The installation of FusionDebug using the Eclipse Update Site is really simple; it takes less than 5minutes
Next week I’ll give you some insight into what I think after my first week of CFML step debugging.
Do you find the FusionDebug install easy or challenging? Let me know on Twitter, Facebook or just reply to this post.