cfml

Impetus for an OO Backend

After a long, multi-faceted discussions on CFCDev a few weeks ago,
one of the participants contact me off-list wondering about a sample
app that illustrated some of the concepts I'd mentioned in the
discussion. I don't have one, and while I could make one up, the
implementation is the easy part. It's the reasoning behind doing
things a certain way [...]

TreeManager CFC Released

I put together this component a while back, intending to eventually
release it, and it's now time.  Basically it manages a tree of
records in a databas table using the nested set model.  It acts
independantly of your existing persistance operations, and only
requires the addition of two fields to your table for it's use. 
You continue to manage your [...]

More J2EE Goodness

I recently needed to capture output for a page to email, as well as
actually output it to the page.  No big deal with CFSAVECONTENT,
of course, but there was one little glitch: occasionally, the core code
needed to use CFFLUSH, and in those cases, the email wasn't needed,
just the screen output.  Rather than screw around with separate
page [...]

The MySpace.com Cowboys

I've been at CFUNITED all week, and based
on the amount of blog coverage that's occurred without my help, I
didn't feel compelled to post.  However, the day three New Atlanta
/ MySpace.com keynote was an amazing talk that couldn't go without my
opinions being expressed to the world.
First, some background.  MySpace.com is a huge
CFML site that has recently [...]

Naming CFC Instance Variables

I was working on a little app of mine over the weekend that uses a
closed-source (encrypted) CFC for some of it's functionality.  The
CFC (which will go unnamed to protect the innocent), does a number of
things, but it's functionality wasn't quite "complete" enough for my
application, so I extended it to add a couple more features.  No
problem, [...]

Another CFML w/ Java Trick

I just wrote a script that would check for orphaned files in an
uploads directory.  Orphan meaning the file still exists, but the
database doesn't have record of it.  Those files needed to either
be reclaimed or deleted, but finding them is cumbersome (and slow!)
process.
What I discovered is that CFDIRECTORY ACTION="list" is really slow if you just need [...]

CFARGUMENT/CFPARAM and DEFAULT

Say I have code like this (intentionally left incomplete):
<cffunction name="myMethod" …>
  <cfargument name="item" … required="true" />
  <cfargument name="childList" … required="false"
    default="#getChildList(item.id)#" />
  … do some stuff …
</cffunction>

Now you'd hope that CF wouldn't actually execute the getChildList
method unless it the variable was missing, but from the structure of
code, you might expect it to anyway.  Fortunately, [...]

XPath, xmlSearch, and Namespaces

I've been doing a bunch of XML stuff over the past few days, and ran
into an interesting issue.  If you have a default namespace
defined in a document that you're going to run xmlSearch on, you have
to respect that namespace.  What does that mean?  You need to
prefix your element names with a colon.  Take these three [...]

Watch out for Inherited Meta Data

I've been working on a project that makes heavy use of metadata over
the past few weeks and just got bit hard by a little quirk with
metadata.  Metadata is created on the first call to getMetaData()
for a given CFC type, and then cached for quicker subsequent
recall.  That's a good thing.  However, you can run into
issues with [...]

CFSCRIPT List Loop?

Ever wanted to do a list loop inside a CFSCRIPT block?  I mean,
you can already loop over an array or a structure just as easily as you
can with tags, why not a list?  Well, for some reason Macromedia
decided that capability wasn't particularly important, but you can work
around it using function variables.
runningTotal = 0;
listLoop("1,2,3", loopBody);
function [...]