The Developer's Tidbit

July 16, 2009

ColdFusion 9’s New Functions (so-far)

Filed under: coldfusion, transfer orm — Ben @ 10:05 pm
Tags: , , ,

Today I will be looking at the new functions that have been introduced into ColdFusion 9. This information is currently in flux as Adobe have not completed their documentation and even some of the function names have not been cemented as of yet.

First up there are a few new Array functions that now put arrays on par with Structures for flexibly of use.

ArrayContains() allows you to search for array values that contain a string.

ArrayDelete() allows you to remove an array, by its value.

ArrayFind() allows you to search for an array, by its value.

ArrayFindNoCase() allows you to search for an array, by its value irrelevant of the letter cases used.

The Cache related functions seem to be an expanded CFSCRIPT implementation of the <CFCACHE> tag.

The Entity functions are related to the new ColdFusion ORM (Object-relational mapping) that I will not cover here. If you are after an introduction to ORM or the implementation in ColdFusion 9 I would recommend Mark Mandel’s article.

There are a few new decision functions introduced.

The IsIPv6() function tells you if the provided host name supports IPv6. IP version 6 is a new, much needed yet more complex and incompatible update to the Internet Protocol version 4 that is in use today.

IsNull() allows you to determine if an object is a NULL value. In relation to ColdFusion null values can often be found in database cells, Java or JavaScript values.

The IsSpreadSheetFile() and IsSpreadSheetObject() determines whether the input is a spreadsheet while being supported by the ColdFusion spreadsheet functions and tags.

Location() is a the function equivalent of the <CFLOCATION> tag.

The ObjectSave() and the ObjectLoad() functions enable you to save and later use any type of ColdFusion object as a binary file on the server. This would be great for frequently used, resource hungry queries where the data does not change.

There are a huge number of new spreadsheet related functions that won’t be covered here.

The ThreadTerminate() is a function implementation of the of the <CFTHREAD action=terminate> tag and attribute. While the ThreadJoin() is the <CFTHREAD action=join> equivalent.

The Throw() function has the same role as the <CFTHROW> tag, to display custom debugging information and abort the page.

The Trace() function has the same job as the <CFTRACE> tag, to display and log application debugging data.

The series of Transaction functions which currently have no documentation would probably be the equivalent to the <CFTRANSATION> tag, which is used for the safety rollback of database revision queries.

WriteDump() is a function implementation of the <CFDUMP> tag. Mainly used in debugging to allow you to display most kinds of ColdFusion objects, values, variables and elements.

WriteLog() is the equivalent to <CFLOG> which allows you to add messages or entries to log files.

More important ColdFusion 9 Resources and Links

Filed under: coldfusion — Ben @ 8:51 pm

July 14, 2009

The New ColdFusion 9 Tags

Filed under: coldfusion — Ben @ 8:14 pm

Today I have been browsing the ColdFusion 9 online documentation to get an idea of what new improvements have been included in this update. This is just a brief overview, with links but I will not cover anything in great detail.

New Tags

<cfcontinue>

This tag has been available in other CFML engines for some time now. It enables you to resume a <cfloop> allowing you to simplify conditional statements ( <cfif><cfelse></cfif> ) within loops.

<cffileupload>

Using Adobe Flash, this tag creates a dialog enabling users to upload multiple files to the ColdFusion server.

<cffinally>

Adds an interesting new option to the functionality of exception handling tags (<cfcatch> and <cftry>). Currently when you execute a <cfcatch> the code will abruptly halt. While if the <cfcatch> fails, the code will continue. If you include the <cffinally> your code </cffinally> tag, ColdFusion will execute the code enclosed within, whether the <cfcatch> was triggered or ignored.

<cfimap>

Is an expansion of the <cfmail> range of tags enabling you to communicate with IMAP e-mail servers. IMAP does have some advantages over the more popular POP3 e-mail services, which might be worth looking into.

<cfmap> <cfmapitem>

Lets you quickly and easily incorporate Google Maps onto your pages. All you need to provide is a Google map API key and an address or coordinates of a location. While the <cfmapitem> enables you to place markers onto those maps.

<cfmediaplayer>

Is an Adobe Flash based, video player that only plays locally stored or online FLV (Flash video) files.

<cfmessagebox>

Pops up customizable, message box within the web browser can be used for user notifications.

<cfprogressbar>

Another often requested feature, this brings up an AJAX based dialog to indicate the progress of a task. You use this in combination with the ColdFusion.ProgressBar functions; then enclose them within a page to set the start and end points for the bar.

<cfsharepoint>

An interesting tag that lets the ColdFusion server interact with Microsoft SharePoint servers. SharePoint is a system for user collaboration and content management systems.

<cfspreadsheet>

One of the big, new features for ColdFusion 9, this tag enables allows full interaction with Microsoft Excel spreadsheet files. This tag, I would image would be very helpful for developers who deal with small businesses.

Next Page »

Blog at WordPress.com.