Comments
Patrick Collands wrote: collands (AT) gmail com I'd be very grateful for an invitation. Thank you.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..

SYS-CON.TV
Today's Top SOA Links


The DRK Treasure Trove
DevNet Resource Kit may have just what you're looking for

Way back in the early Allaire days, registered ColdFusion users were given access to "fuel packs", product add-ons (in the form of custom tags) that may or may not have become part of the core product later. In fact, tags like <CFSEARCH>, <CFPOP>, and <CFLDAP> all started life as fuel packs, and later became part of the core ColdFusion product. Fuel packs allowed us to slipstream functionality into the product without actually requiring a product revision.

Fuel packs no longer exist, but their spirit lives on in the form of the DRK, the DevNet Resource Kit. Released quarterly, each DRK features content for ColdFusion, Dreamweaver, Flash, and more. And not just new tags; DRKs also contain technical documents, sample book chapters, and even complete applications. With the sixth DRK now available, I thought I'd take the opportunity to call out some of the content that I think will be of particular interest to ColdFusion developers.

CFNETTOOLS
Have you ever needed to do a DNS or reverse DNS lookup? I wrote UDFs way back when to do this, but here is a better way. CFNETTOOLS (in DRK6) is a collection of tags that provide DNS lookup functionality and more, even allowing you to perform WHOIS lookups and determine the mail server (MX record) for a specified domain.

CFNETTOOLS is made up of four custom tags and supporting Java code. Here are some simple usage examples:

<!--- Get current time --->
<CF_TIME NAME="time"
SERVER="time.nist.gov">
<!--- Display it --->
<CFOUTPUT>#time#</CFOUTPUT>

This example makes a SNTP (Simple Network Time Protocol) call to get the current time from the time server at www.nist.gov (the National Institute of Standards and Technology Web site), and then display that time.

This next example does a simple DNS lookup:

<!--- Get IP address --->
<CF_DNSLOOKUP NAME="ip"
ACTION="getip"
ADDRESS="www.forta.com">
<!--- Display it --->
<CFOUTPUT>#ip#</CFOUTPUT>

And there's more. Very useful, indeed.

JIMG
JIMG (in DRK4) is a set of graphics manipulation tools, exposed via custom tag and ColdFusion Components interfaces. JIMG is built on top of JAI (the Java Advanced Imaging API) and exposes all sorts of functionality, including image cropping and resizing, adding borders, placing text on top of an image, obtaining image height and width, image rotation, and more.

The following code snippet demonstrates basic JIMG usage:

<CFIMPORT TAGLIB="c:\cfusionmx\CustomTags\jimg" PREFIX="img">
<img:SEQUENCE>
<img:LOAD FILENAME="#imageSource#">
<img:SCALETOATLEAST WIDTH="75" HEIGHT="75">
<img:SAVE FILENAME="#imageDest#">
</img:SEQUENCE>

This code creates a thumbnail from a specified image. <CFIMPORT> imports the custom tags, SEQUENCE begins a sequence of operations, LOAD loads a specified image, SCALETOATLEAST scales the image to thumbnail size, and SAVE then saves that image.

Internally, the JIMG code makes a series of rather complex Java calls, but that is all hidden from you. Just call the custom tags or CFC methods, and graphics manipulation is a snap.

Lindex
Lindex (in DRK3) is a Verity replacement built using the Lucene open-source full-text search engine. The Lindex interface is modeled on that of Verity; the tags and attributes are similar enough that users familiar with ColdFusion's Verity support should have no problem using Lindex.

Lindex is distributed as a JAR file containing the core Lucene library, Java wrapper classes, and three ColdFusion custom tags that expose Lindex to your CFML code. <CF_LINDEXSEARCH> is used to perform searches (similar to <CFSEARCH>); <CF_LINDEXINDEX> is used to update indexes (similar to <CFINDEX>); and <CF_LINDEXCOLLECTION> is used to manage collections (similar to <CFCOLLECTION>).

And the best part is that as Lucene is pure Java, Lindex is supported on all platforms supported by ColdFusion (including those not supported by Verity).

Lindex is not as feature rich as Verity, and does not support as many languages and file types, but if it fits your needs it may well be worth a look.

Log4CF
Logging is an important part of application debugging, troubleshooting, and fine-tuning. ColdFusion's built-in logging support is powerful but lacks much of the granular control that developers need. This is where Log4CF (in DRK4) becomes useful. Using Log4CF you can create your own log entries with varying severity levels, have logs automatically sent to you via e-mail, manage and browse log file contents, and even leave logging inside of your application (so that it may be enabled if needed later on).

Log4CF is distributed as a custom tag that does the actual logging and an Administrator interface that plugs into the standard ColdFusion Administrator (see Figure 1), which can be used to configure Log4CF settings at the server or application level.

Log4CF improves a developer's or administrator's ability to monitor applications granularly. The simple API of this tag integrates with the existing ColdFusion logging paradigm, making it easy to adopt.

Blog Man
Do you have a blog yet? Need one? Blog Man (first introduced in DRK5 and then updated for DRK6) is a complete blog application written entirely in ColdFusion. The current version supports:

  • All the blogging features you'd expect
  • Configurable UI
  • Support for Access, SQL Server, and MySQL
  • Automatic archiving
  • Blog posting via e-mail
  • And more
This is another great ColdFusion-based blog.

Lighthouse Bug Tracker
If you write code, then you need to track bugs. It's an unfortunate fact of development life, and one we all need to deal with. Lighthouse Bug Tracker (in DRK5) is a complete bug-tracking application featuring:

  • Multiple tiers, with presentation entirely separated from underlying content (allowing developers to create their own front ends, if needed)
  • Simple data entry, search, and tracking screens (see Figure 2)
  • XML data storage
Sure, you could write your own bug tracker, or keep using yellow sticky notes, but this app could make your life a whole lot easier.

Pollster
Pollster is a polling application (first introduced in DRK4 and then updated for DRK5), a ColdFusion back end with an interactive Flash front end. Pollster allows you to easily embed polls and surveys into your sites. An administration screen (see Figure 3) is used to define surveys and even generate the needed Flash embedding code.

You can see an example of Pollster on my blog page at www.forta.com/blog. Many others are running this useful utility, too.

Socket.cfc
ColdFusion provides tags that are used to access common Internet protocols like POP, SMTP, LDAP, HTTP, and FTP. But what if you need lower-level connections? Socket.cfc (in DRK5) provides a mechanism by which to make low-level socket calls as needed.

Here is a simple example:

<!--- Get instance of socket object --->
<CFOBJECT COMPONENT="socket"
NAME="sockObj">
<!--- Connect to port 25 on mail server --->
<CFSET sockObj.Init("mail.mydomain.com", 25, false)>
<!--- Execute VRFY command --->
<CFSET response=sockObj.WriteText("VRFY #email#")>
<!--- Close connection --->
<CFSET sobkObj.Close()>

This code uses <CFOBJECT> to obtain an instance of the socket component. The Init() method is used to open a connection to a specified host and port. The WriteText() method is used to send a command to the remote host (here an SMTP VRFY command is being sent), and any response will be stored in a variable named "response". And finally, the Close() method is used to close the connection.

Socket.cfc makes Java calls internally, but these are all hidden from you. Just instantiate the component and make method calls; it's as simple as that.

Summary
I've listed just a few of the DRK tags and applications, the ones that I use myself. There are a lot more, too, and not just for ColdFusion. If you have not taken a look at the DRKs yet, visit www.macromedia.com/software/drk/. You may just find exactly what you were looking for (or exactly what you didn't know you needed).

About Ben Forta
Ben Forta is Adobe's Senior Technical Evangelist. In that capacity he spends a considerable amount of time talking and writing about Adobe products (with an emphasis on ColdFusion and Flex), and providing feedback to help shape the future direction of the products. By the way, if you are not yet a ColdFusion user, you should be. It is an incredible product, and is truly deserving of all the praise it has been receiving. In a prior life he was a ColdFusion customer (he wrote one of the first large high visibility web sites using the product) and was so impressed he ended up working for the company that created it (Allaire). Ben is also the author of books on ColdFusion, SQL, Windows 2000, JSP, WAP, Regular Expressions, and more. Before joining Adobe (well, Allaire actually, and then Macromedia and Allaire merged, and then Adobe bought Macromedia) he helped found a company called Car.com which provides automotive services (buy a car, sell a car, etc) over the Web. Car.com (including Stoneage) is one of the largest automotive web sites out there, was written entirely in ColdFusion, and is now owned by Auto-By-Tel.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Currently, Verity will not index PDFs on Linux. Does Lindex do this?? We are desperately searching for a search engine that will allow us to search our extensive PDF collection.

The DRK''s are not very valuable, and thae fault rests squarely on Macromedia''s shoulders.

There was a series of "non-kosher" actions on Macromedia''s part that has annoyed the hell out of users:

1. The "exclusivity" of DRK''s was just marketing hype. As soon as they were released, the became available to DevNet subscribers and non-subscribers. That was in direct contradiction to Macromedia''s stated policy.

2. The DRK''s, though a commercial product, include several products available for free elsewhere. Are we talking about "filling material"?
There''s no reason to charge for a product and then provide items freely available elsewhere.

3. The available DRK components cater to all and cater to no one. It''s an assortment of items (a few of them very good, in all honesty) that try to cover all the bases, but end up not covering any. The oft-suggested solution of providing a pool of items from which subscribers can choose has been completely ignored.

Well, sorry about the rant, Ben, but it had to be said...


Your Feedback
Ben Johnson wrote: Currently, Verity will not index PDFs on Linux. Does Lindex do this?? We are desperately searching for a search engine that will allow us to search our extensive PDF collection.
Irvin Gomez wrote: The DRK''s are not very valuable, and thae fault rests squarely on Macromedia''s shoulders. There was a series of "non-kosher" actions on Macromedia''s part that has annoyed the hell out of users: 1. The "exclusivity" of DRK''s was just marketing hype. As soon as they were released, the became available to DevNet subscribers and non-subscribers. That was in direct contradiction to Macromedia''s stated policy. 2. The DRK''s, though a commercial product, include several products available for free elsewhere. Are we talking about "filling material"? There''s no reason to charge for a product and then provide items freely available elsewhere. 3. The available DRK components cater to all and cater to no one. It''s an assortment of items (a few of them very good, in all honesty) that try to cover all the bases, but end up not covering any. The oft-suggested solution of providing a...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE