By barneyb on September 11, 2005
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 [...]
Posted in cfml
By barneyb on July 8, 2005
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 [...]
Posted in cfml
By barneyb on July 8, 2005
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 [...]
Posted in cfml
By barneyb on July 1, 2005
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 [...]
Posted in cfml
By barneyb on June 19, 2005
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, [...]
Posted in cfml
By barneyb on June 16, 2005
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 [...]
Posted in cfml
By barneyb on May 18, 2005
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, [...]
Posted in cfml
By barneyb on April 27, 2005
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 [...]
Posted in cfml
By barneyb on April 14, 2005
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 [...]
Posted in cfml
By barneyb on April 12, 2005
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 [...]
Posted in cfml