Category Archives:

Javi: CF Quick Tips

Posted on May 9, 2008 by Javier Julio

Multiple File Extension Filters For CFDirectory

In a recent blog post by Ben Nadel (which should be his...oh, I don't know...56,423rd CF tip?!) he explained that by using the pipe character you can specify multiple file extension filters on the cfdirectory tag. For example, you can do the following:

That would return only Excel and CSV files. You can specify more filters by simply separating them with a pipe character. It seems like the Adobe Documentation team needs to update the ColdFusion Reference because it currently states the following for the filter attribute:

"File extension filter applied to returned names, for example, *.cfm. One filter can be applied."

Such a helpful tip really ought to be stated in the documentation or, even better yet, used as an example. So instead, I'll do all the work for you! Here is an example I wrote up matching the style used in the cfdirectory reference page:

| Comments (4) | Technorati Tags :

Posted on April 5, 2008 by Javier Julio

ColdFusion 8.0.1 Released With New Features!



What's new you say? Well for starters we now have 64-bit support! AJAX libraries have been updated such as Ext to 1.1.1, Spry to 1.6 and YUI to 2.3. The <cftextarea> tag's rich text editor (using FCKEditor) now upgraded to 2.5. Not to mention some of the features that the CF team couldn't get into the initial release but we finally have.

1. Support for nested inline array and struct creation. You can now do the following:

<cfset myNestedArray = [ {version = "8.0.1"}, [1,2,3], [4,5,6], [7,8,9] ]>

2. Support for mixing attributeCollection and individual tag attributes with the latter replacing any occurrences in the former. So we can now do the following:

<cfquery attributeCollection="#queryProperties#" result="resultStatus">
...
</cfquery>

I definitely suggest checking out the release notes as the updater includes several bug fixes and a lot more specifics on what tags and other areas have been touched up. They also cover known issues with the updater that may affect you. A great release by the CF team with much appreciated features!

| Comments (0) | Technorati Tags :

Posted on April 4, 2008 by Javier Julio

Using ColdFusion Components (CFCs) in AIR Powered Flex Applications

Recently, I took one of my Flex/CF projects here at work to see how much effort and time it would take to deploy it on AIR without any of the desktop enhancements. I had no prior experience with AIR so I wasn’t sure what was involved.

The application uses the RemoteObject component in Flex to connect to CFCs to pass data and typed objects back and forth. Since it's deployed as a web application, Flex can figure out the “endpoint” automatically but since we are now on AIR, we need to provide that. An example if you were doing local development would be something like:

All I had to do was to add the "endpoint" property to all of my RemoteObject definitions. Since I used the PureMVC framework I had that nicely abstracted out as delegates within a business folder so it was even easier to find and get too. No other changes at all were required because my application now functioned on AIR as it would if it were in a browser.

| Comments (0) | Technorati Tags :

Posted on March 19, 2008 by Javier Julio

Debugging Data Through the Console in ColdFusion 8

If you start the ColdFusion server by using the command line, you should note several of the enhancements made to the <cfdump> tag. One of them is a new attribute named "output" which can dump data to the browser (default), output to a file (set an absolute file path), or output to the server console. A simple example:

<cfdump var="#variables#" output="console">

I've been working on a Flex/ColdFusion project that makes remoting calls to CFCs. Debugging has become a breeze by simply setting the output attribute to "console" which then appropriately formats the data dumped to the console. Out of the many new features in CF8, this is the one I've used the most.

| Comments (0) | Technorati Tags :

Posted on February 11, 2008 by Javier Julio

Using svn:ignore Through Command Line Or Subclipse

The documentation for svn:ignore is very confusing if using it through command line. I haven't been able to find any good material on the web so I thought I'd share the steps I've went through to set this up.

Continue reading "Using svn:ignore Through Command Line Or Subclipse" »

| Comments (4) | Technorati Tags :

Posted on January 22, 2008 by Javier Julio

Obtaining Original Query Column Order in ColdFusion

Using an undocumented Java method on a ColdFusion query object called getColumnList() returns an array of the original column order specified in the database or SQL statement. Using the built-in [query].columnList returns an alphabetized column list.

Useful Resources

Continue reading "Obtaining Original Query Column Order in ColdFusion" »

| Comments (2) | Technorati Tags :

Posted on December 28, 2007 by Javier Julio

Reading and Parsing XML In 1 ColdFusion Function

Did you know you can read an XML document and parse it as an XML object using only the ColdFusion xmlParse method? Some examples:

<cfset xml = xmlParse("test.xml")>

Or

<!--- valid protocols: http, https, ftp, and file --->
<cfset xml = xmlParse(" http://www.mysite.com/test.xml")>


No need to read the file beforehand. Simple as that.

| Comments (2) | Technorati Tags :

Posted on December 7, 2007 by Javier Julio

ColdFusion Structures: Differences in Version 7 and 8

I know my fair share of ColdFusion bloggers that have started to dig "under the hood" and see what Java objects are being used by CF even utilizing undocumented Java methods in their CF code. I never thought I'd actually take the plunge myself but I had to uncover an issue with one of our application's moving from CF7 to CF8.

Continue reading "ColdFusion Structures: Differences in Version 7 and 8" »

| Comments (10) | Technorati Tags :