Monthly Archives: November 2004

ColdFusion Blackstone Coolness

So I’ve been testing Macromedia’s next version of Cold Fusion, named: Blackstone.
I was writing a component, and used the self-doccumenting feature of cfc’s to create a little documentation. However when I went to print it, it came out all crappy. For some reason these things never print right.

So I got to thinking wouldn’t it be cool if you could output this documentation in flashpaper, since that’s one of the features of Blackstone. Then I took a look at the url for the documentation, I noticed that the renderer for the cfc documentation was a cfc named “cfcexplorer.cfc,” and the documentation was created using the “getcfcinhtml” mehtod. Since the cfc was installed on myserver I opend it up and saw this:

<cffunction name=”getcfcinhtml” access=”remote”
hint=”Generates html descriptor of a component with the specified name or URI path as the http response.”>
<cfargument name=”name” type=”string” required=”yes” />
<cfargument name=”path” type=”string” required=”no” />

<cftry>
<cfscript>
if ( IsDefined(‘arguments.path’) and arguments.path neq ” ) {
proxy = CreateObject( “java”, “coldfusion.runtime.TemplateProxyFactory” ) ;
comp = proxy.ResolvePath( arguments.path, getPageContext() ) ;
} else {
comp = CreateObject( “component”, name ) ;
}

utils = CreateObject( “component”, “utils” ) ;
WriteOutput( utils.cfcToHTML(comp) ) ;
</cfscript>
<cfcatch type=”coldfusion.runtime.CfJspPage$NoSuchTemplateException”>
<cfoutput><h4>Component not found</h4>
The component definition file for component ‘#name#’ cannot be found on this server.</cfoutput>
</cfcatch>
</cftry>
</cffunction>

So I got to thinking, couldn’t I just wrap the whole thing in a <cfdocument> tag. I tried it, and it worked.

<cffunction name=”getcfcinfp” access=”remote”
hint=”Generates flashpaper descriptor of a component with the specified name or URI path as the http response.”>
<cfargument name=”name” type=”string” required=”yes” />
<cfargument name=”path” type=”string” required=”no” />

<cftry>
<cfdocument format=”flashpaper”>

<cfscript> if ( IsDefined(‘arguments.path’) and arguments.path neq ” ) {
proxy = CreateObject( “java”, “coldfusion.runtime.TemplateProxyFactory” ) ;
comp = proxy.ResolvePath( arguments.path, getPageContext() ) ;
} else {
comp = CreateObject( “component”, name ) ;
}

utils = CreateObject( “component”, “utils” ) ;
WriteOutput( utils.cfcToHTML(comp) ) ;
</cfscript>

</cfdocument>
<cfcatch type=”coldfusion.runtime.CfJspPage$NoSuchTemplateException”>
<cfoutput><h4>Component not found</h4>
The component definition file for component ‘#name#’ cannot be found on this server.</cfoutput>
</cfcatch>

</cftry>
</cffunction>

Once that’s done, all you have to do is change the method called in the URL when you browse your cfc from “cfcexplorer.cfc?method=getcfcinhtml” to “cfcexplorer.cfc?method=getcfcinfp”

Cool huh? From the flashpaper, it prints beautifully.

Back from MAXX

I just got back from Macromedia MAXX and I learned a whole bunch of cool stuff. I fooled around with a bunch of it, and have added a few extra pieces to the website. I hope to drop a more detailed report on the Conference in the next few day, but for now here’s more on the new pieces of my site. I encorporated two relatively new technologies to a set of pages dedicated to It’s a Wonderful Mensch, a short I made for work about a year ago.

The first technology I used was Flash Paper. This has been out for a little while, and basically competes with Adobe Acrobat. The difference is that like all Macromedia products of late, it generates .swf output. This is readable by anyone who has the Flash plugin, which is practically everyone. The whole thing, content and reader, is combined into one file and is less than 64kb.

The second technology I used was Flash Video. This also seems to compete with existing technology, this time specifically in the web video space. This one is different from Flash Paper, in that you compress a file into Flash Video, then bind a player .swf file to it. The video was compressed to about a 12 MB file, that can be progressively downloaded.

The thing I have to commend about both of these technologies is that they build on the Flash Player framework. This makes it have tremendous reach and cross platform compatibility. I don’t even need the Macromedia marketers to tell me that. The compression is good, and it was also extremely easy to create the .swf files and embed them into my webpages. Another thing about them was the ease of creating them. It took me all of about 5 seconds to create the Flash Paper .swf. (In fact I did it on the plane back from New Orleans) The video took me a little longer, but then that’s video. The swf player interface for it took a few seconds.

Check out these features at:
It’s a Wonderful Mensch