<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dan's Drivelings</title>
	<atom:link href="http://dan.skaggsfamily.ws/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.skaggsfamily.ws</link>
	<description>Random Thoughts of a Techno-Hermit</description>
	<lastBuildDate>Mon, 22 Feb 2010 18:19:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Can you code with 9 fingers?</title>
		<link>http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/</link>
		<comments>http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:19:45 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=375</guid>
		<description><![CDATA[That&#8217;s what I&#8217;m doing today thanks to a relatively freak accident with a staple gun yesterday. I won&#8217;t bore you with the details (that would confirm what a bonehead I can be sometimes). Just suffice it to say that, it could have been a lot worse.
]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s what I&#8217;m doing today thanks to a relatively freak accident with a staple gun yesterday. I won&#8217;t bore you with the details (that would confirm what a bonehead I can be sometimes). Just suffice it to say that, it could have been a lot worse.</p>

<a href='http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/staple/' title='staple'><img width="150" height="150" src="http://dan.skaggsfamily.ws/wp-content/uploads/2010/02/staple-150x150.jpg" class="attachment-thumbnail" alt="" title="staple" /></a>
<a href='http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/xray1/' title='xray1'><img width="150" height="150" src="http://dan.skaggsfamily.ws/wp-content/uploads/2010/02/xray1-150x150.jpg" class="attachment-thumbnail" alt="" title="xray1" /></a>
<a href='http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/xray2/' title='xray2'><img width="150" height="150" src="http://dan.skaggsfamily.ws/wp-content/uploads/2010/02/xray2-150x150.jpg" class="attachment-thumbnail" alt="" title="xray2" /></a>
<a href='http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/xray3/' title='xray3'><img width="150" height="150" src="http://dan.skaggsfamily.ws/wp-content/uploads/2010/02/xray3-150x150.jpg" class="attachment-thumbnail" alt="" title="xray3" /></a>

]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2010/02/22/can-you-code-with-9-fingers/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Be careful with the &#8216;local&#8217; scope when migrating from CF8 to CF9</title>
		<link>http://dan.skaggsfamily.ws/2010/02/08/be-careful-with-the-local-scope-when-migrating-from-cf8-to-cf9/</link>
		<comments>http://dan.skaggsfamily.ws/2010/02/08/be-careful-with-the-local-scope-when-migrating-from-cf8-to-cf9/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 14:24:15 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=355</guid>
		<description><![CDATA[One of the really nice &#8220;fixes&#8221; included in ColdFusion 9 from a developer&#8217;s perspective is the inclusion of an implicit &#8220;local&#8221; variable scope into which variables created within the body of a &#60;cffunction&#62; tag are placed by default. Previously, developers had to manually add a &#8220;var&#8221; keyword to variables that should only exist within the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the really nice &#8220;fixes&#8221; included in ColdFusion 9 from a developer&#8217;s perspective is the inclusion of an implicit &#8220;local&#8221; variable scope into which variables created within the body of a &lt;cffunction&gt; tag are placed by default. Previously, developers had to manually add a &#8220;var&#8221; keyword to variables that should only exist within the confines of the function.</p>
<p>One of the ways of simplifying this that gained some traction among various developers prior to the release of ColdFusion 9 was to &#8220;var&#8221; a single variable at the top of the function as an empty structure then store any additional variables needed in the function inside it. Many folks, myself included, named this structure &#8220;local&#8221; so that it would be readily apparent that the values inside were local to that function. This approach worked fine and dandy on ColdFusion 8 and below.<br />
<span id="more-355"></span></p>
<p>I recently migrated one of my clients to ColdFusion 9 and not long after the client started getting isolated reports from his people having javascript errors in a data management application that uses AJAX-driven forms talking to CFCs.  At first these were very isolated and we weren&#8217;t able to reproduce the error, but, as time went on, the reports became more widespread. As I was troubleshooting this over the weekend, I discovered that we were getting javascript errors when trying to interact with this RemoteFacade CFC about 40% of the time.</p>
<p>Using <a href="http://www.getfirebug.com" target="_blank">Firebug</a>, I was able to watch the results come back from ColdFusion and noticed a very odd trend. Approximately 60% of the time, the JSON returned from the remote CFC call was as expected. In the other 40%, one of the main data structure names was an arbitrary, machine-generated name instead of the name we had specified in the code.</p>
<p>Here is an example of what we were expecting in the JSON returned from the RemoteFacade.cfc method:</p>

<div class="wp_syntax"><div class="code"><pre class="json" style="font-family:monospace;">{&quot;DATA&quot;:{&quot;CANEDIT&quot;:true,&quot;RECORDDATA&quot;:{&quot;Field1&quot;:&quot;value1&quot;} } }</pre></div></div>

<p>This is an example of what we would get back from the same request when we would see the javascript errors</p>

<div class="wp_syntax"><div class="code"><pre class="json" style="font-family:monospace;">{&quot;___IMPLICITARRYSTRUCTVAR5&quot;:{&quot;CANEDIT&quot;:true,&quot;RECORDDATA&quot;:{&quot;Field1&quot;:&quot;value1&quot;} } }</pre></div></div>

<p>See the difference?  Our &#8220;DATA&#8221; key was named completely differently which caused javascript to throw some error saying that variableName.DATA did not exist.</p>
<p>After looking over the ColdFusion code for quite a while and doing some step debugging with <a href="http://www.fusion-debug.com" target="_blank">FusionDebug</a> I had an idea.  I changed all the function-specific structures I had been using from:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #000000; font-weight: bold;">var</span> local <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">structNew</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
   ....
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> local <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>

<p>to:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #000000; font-weight: bold;">var</span> ret <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">structNew</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
   ....
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfreturn</span> ret <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>

<p>Once I changed those throughout the code base and reinitialized my application, all the javascript errors that we&#8217;d been experiencing across multiple request types went completely away.</p>
<p>I have an unconfirmed theory that in using the name &#8220;local&#8221; for my structure, ColdFusion was sometimes getting &#8220;confused&#8221; on what to return&#8211;ColdFusion&#8217;s built-in local scope or the method-specific variable I had named local. I don&#8217;t really have any way to prove that beyond a shadow of a doubt, but when I made the change, all my errors went away, so I decided chalk it up as a lesson learned for future development and move on to the next problem.  Needless to say the client was happy that the issue was fixed and I can say I learned something that day.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2010/02/08/be-careful-with-the-local-scope-when-migrating-from-cf8-to-cf9/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>jQuery head-scratcher and lesson learned</title>
		<link>http://dan.skaggsfamily.ws/2010/02/01/jquery-head-scratcher/</link>
		<comments>http://dan.skaggsfamily.ws/2010/02/01/jquery-head-scratcher/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:42:02 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ModelGlue]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=343</guid>
		<description><![CDATA[As I mentioned in my last post, I&#8217;m working on a pet project in my spare time. It uses jQuery in various places including in the site design template that I purchased to use with the site. The template uses jQuery to expand and collapse menu items in the left sidebar to show sub items [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my <a href="/2010/01/31/coldfusion-9-caching-settings-to-watch-out-for">last post</a>, I&#8217;m working on a pet project in my spare time. It uses <a href="http://www.jquery.com" target="_blank">jQuery</a> in various places including in the site design template that I purchased to use with the site. The template uses jQuery to expand and collapse menu items in the left sidebar to show sub items for that selection. Because of this, jQuery and a javascript file named custom.js was included in the template.  After breaking the template apart to work inside my <a href="http://www.model-glue.com" target="_blank">ModelGlue</a> application, I started implementing some other features that used jQuery with their own associated javascript files, one of which was <a href="http://cfuniform.riaforge.org" target="_blank">cfUniform</a>.</p>
<p>As soon as I put the cfUniform code into the page, I started getting javascript errors in the console pane of Firebug. The error would state something similar to &#8220;$(document) not a function&#8221; or &#8220;$ not a function&#8221;.  Now, I&#8217;ve not had a ton of experience with jQuery, but I have used several pre-built jQuery plugins in sites before and I had seen errors similar to this.  Normally this error is caused by one of two issues.  Either a) you&#8217;ve forgotten to include the script block to load the jQuery library or b) your code is loading the jQuery library twice.</p>
<p>I was able to use <a href="http://www.getfirebug.com" target="_blank">Firebug</a> to verify that I was indeed loading it and loading it only once but couldn&#8217;t for the life of me figure out why I was getting an error. Obviously cfUniform wasn&#8217;t really at fault (the error pointed to a line in one of the cfUniform javascript files) so I knew it had to be something on my side.  I did some searching on the phrase and found some discussions around jQuery&#8217;s noConflict() feature that allows you to reference jQuery with a notation other than using the familiar &#8220;$&#8221;.  </p>
<p>After reading for a while, I opened the custom.js file that came with the site template and found the code below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #006600; font-style: italic;">//contents snipped</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Since I&#8217;m not using any other javascript libraries in this application that might conflict with using the &#8220;$&#8221; to access jQuery, I removed the noConflict() line, but that didn&#8217;t fix my problem. On a hunch I did a search/replace through the custom.js file replacing &#8220;jQuery(&#8221; with &#8220;$(&#8221; so that references to the jQuery library in this file would be accessed with the same syntax as in all the other javascript files. Lo and behold, all my errors in Firebug&#8217;s console went away and CFUniform began behaving as expected.</p>
<p>While I don&#8217;t understand all the underpinnings of why this worked, I&#8217;ll take it as my &#8220;lesson for the day&#8221; that in the future I need to always make sure that all the various jQuery plugins and code that is used in my applications need to reference the jQuery library with the same syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2010/02/01/jquery-head-scratcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion 9 caching settings to watch out for</title>
		<link>http://dan.skaggsfamily.ws/2010/01/31/coldfusion-9-caching-settings-to-watch-out-for/</link>
		<comments>http://dan.skaggsfamily.ws/2010/01/31/coldfusion-9-caching-settings-to-watch-out-for/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:14:09 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ModelGlue]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=340</guid>
		<description><![CDATA[Like a lot of developers, I&#8217;ve got this pet project I&#8217;m working on in whatever spare time I can find between client engagements, home maintenance, family obligations, etc.  I&#8217;m using it as an opportunity to work with some of the new features of ColdFusion 9 (ORM mainly), ColdFusion Builder Beta and features in development [...]]]></description>
			<content:encoded><![CDATA[<p>Like a lot of developers, I&#8217;ve got this pet project I&#8217;m working on in whatever spare time I can find between client engagements, home maintenance, family obligations, etc.  I&#8217;m using it as an opportunity to work with some of the new features of ColdFusion 9 (ORM mainly), ColdFusion Builder Beta and features in development for the next release of <a href="http://www.model-glue.com" target="_blank">ModelGlue 3</a>.</p>
<p>Recently, <a href="http://www.silverwareconsulting.com/" target="_blank">Bob Silverburg</a> has been working on a significant overhaul of the scaffolding feature used by ModelGlue to automatically create CRUD forms for the various data objects in your application. Particularly exciting to me is that you can now override the built-in code templates with your own. Bob wrote a proof-of-concept application that uses the excellent <a href="http://cfuniform.riaforge.org/" target="_blank">cfUniform</a> custom tag library to build standardized forms and validations (see my <a href="/2009/04/29/standardizing-html-forms-with-the-cfuniform-custom-tag-library/">previous post</a> on cfUniform if you&#8217;re not familiar with it). Since I&#8217;m pretty particular about how my project files are arranged, I proceeded to place the css, javascript and image assets into the folders where I wanted them and use ColdSpring to create a configuration bean to pass to cfUniform when I called it. That&#8217;s where the trouble began.</p>
<p>I had to make a couple of changes to the code generated in the custom scaffold CFC in order to have cfUniform see the custom configuration that I had set up. No matter what I did, when the scaffolding engine generated the code for the view and the XML fragment for the event-handler, the changes I made inside the CFC weren&#8217;t included. I spent a couple hours scratching my head, tracing the request cycle, restarting my local ColdFusion instance and always got the exact same code that was in Bob&#8217;s original example CFC. Finally, I decided to change the name of the CFC and update the associated bean configuration in ColdSpring. On the next refresh, I saw my changes reflected in the code generated by the scaffold!</p>
<p>With that in mind, I checked the settings on the Caching page of that instance&#8217;s CF Administrator. Sure enough, the Cache Template In Request,  Component cache, and Save class files options were checked.  I cleared those check boxes, pressed the Clear Template Cache Now and Clear Component Cache Now buttons below and have had no trouble since. Obviously there are situations where you want these enabled, but rarely ever should they be needed on a local system being used for development.</p>
<p>So, the moral of my painful story&#8211;if you&#8217;re making changes to code that&#8217;s not being reflected when you test browse your application, don&#8217;t forget to check the settings on the Caching page in CF Admin. It just might save you a couple hours and a few gray hairs.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2010/01/31/coldfusion-9-caching-settings-to-watch-out-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going beyond CFPDF with iText</title>
		<link>http://dan.skaggsfamily.ws/2009/11/19/going-beyond-cfpdf-with-itext/</link>
		<comments>http://dan.skaggsfamily.ws/2009/11/19/going-beyond-cfpdf-with-itext/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 15:39:15 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=323</guid>
		<description><![CDATA[This week I was working on a proof-of-concept for a customer in which we wanted to extract attachments from a fillable PDF form after its submission. After trying the usual CFPDF tags, reading the documentation, and getting nowhere, we decided to try to attempt to use the iText PDF library for Java from within ColdFusion [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was working on a proof-of-concept for a customer in which we wanted to extract attachments from a fillable PDF form after its submission. After trying the usual CFPDF tags, reading the documentation, and getting nowhere, we decided to try to attempt to use the <a href="http://www.lowagie.com/iText/" target="_blank">iText PDF library for Java</a> from within ColdFusion to extract the attachments.</p>
<p>After doing some reading through the JavaDocs for iText, I found that it includes a class called ExtractAttachments that &#8220;&#8230;lets you extract the attachemnts of a PDF.&#8221;  Since this is precisely what we wanted to do, I thought for sure this would be a simple affair and I&#8217;d be able to finish what I needed to do and turn in early for the evening.  Not quite!<br />
<span id="more-323"></span><br />
I downloaded Mark Mandel&#8217;s excellent <a href="http://javaloader.riaforge.org/" target="_blank">JavaLoader project</a> and dropped it into my webroot. Then I grabbed the <a href="http://www.lowagie.com/iText/download.html" target="_blank">2 JAR files</a> from iText that I needed and put them in a folder named &#8220;lib&#8221; in the web root (remember this is a POC so I didn&#8217;t mind having that stuff in the web root).</p>
<p>Making the classes contained in the JARs available to ColdFusion was a snap thanks to JavaLoader.  You create an array of paths to your JAR files (in my case&#8211;it also works with directories of class files) and pass that into the constructor for JavaLoader like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- Build an array of JAR files that JavaLoader should reference ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> loadPaths <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">arrayNew</span><span style="color: #0000FF;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #0000FF;">arrayAppend</span><span style="color: #0000FF;">&#40;</span> loadPaths, <span style="color: #0000FF;">expandPath</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;/lib/iText-2.1.7.jar&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #0000FF;">arrayAppend</span><span style="color: #0000FF;">&#40;</span> loadPaths, <span style="color: #0000FF;">expandPath</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;/lib/iText-toolbox-2.1.7.jar&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">/&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- Create the JavaLoader object to dynamically load Java classes ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> loader <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">createObject</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;component&quot;</span>, <span style="color: #009900;">&quot;javaloader.JavaLoader&quot;</span><span style="color: #0000FF;">&#41;</span></span>
<span style="color: #333333;">                .init<span style="color: #0000FF;">&#40;</span>loadPaths<span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>

<p>Once the classes were available, it was very simple to get an instance of the ExtractAttachments class created.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- Create the extractor object ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> extractor <span style="color: #0000FF;">=</span> </span>
<span style="color: #333333;">       loader.create<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;com.lowagie.toolbox.plugins.ExtractAttachments&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>

<p>Ok, so now we have the ExtractAttachments class loaded into a ColdFusion variable so we can use it. But now what? Outside of the JavaDoc, there is precious little documentation on how to use this particular feature of iText so it took quite a bit of experimentation and tracing through the Java source code to figure out how to get my particular test PDF file to be used by the extractor object.</p>
<p>The ExtractAttachments class constructor does not allow you to pass in any arguments, so I couldn&#8217;t give it my file that way. In looking through the Java code, I found that the constructor was creating an empty FileArgument object and putting it into its internal arguments variable (which is an array that can hold various types of arguments). Turns out there is a setValue() method in the FileArgument that takes a Java file object.  Upon finding that, I created a Java file object that pointed to my test PDF and passed it into the setValue() method of the FileArgument like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- Create a java file object for our source PDF file ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> inputFile <span style="color: #0000FF;">=</span> loader.create<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;java.io.File&quot;</span><span style="color: #0000FF;">&#41;</span></span>
<span style="color: #333333;">                   .init<span style="color: #0000FF;">&#40;</span> <span style="color: #0000FF;">expandPath</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">'/test.pdf'</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- Set our java file object into the FileArgument argument </span>
<span style="color: #808080; font-style: italic;">created by ExtractAttachments constructor ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> extractor.getArguments<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #0000FF;">&#93;</span>.setValue<span style="color: #0000FF;">&#40;</span> inputFile <span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>

<p>The ExtractAttachments constructor only ever puts one argument into its internal array, so I was able to reliably hard code the array index (the [1] in the code sample). Once that file object was passed into the FileArgument, all that remained was telling the extractor object to go to work:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- Extract the attachment(s) ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> extractor.execute<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>

<p>The result was a newly created PNG file (which is what I had attached to the PDF) created in the same directory where the file CFML page was executing.  I&#8217;m sure there are ways to specify where that file gets created and do some more intricate things with iText, but for a proof-of-concept test, this one was highly successful. </p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/11/19/going-beyond-cfpdf-with-itext/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Slides from my ColdSpring session at CFinNC</title>
		<link>http://dan.skaggsfamily.ws/2009/10/18/slides-from-my-coldspring-session-at-cfinnc/</link>
		<comments>http://dan.skaggsfamily.ws/2009/10/18/slides-from-my-coldspring-session-at-cfinnc/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 22:21:52 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdSpring]]></category>
		<category><![CDATA[Speaking Engagements]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=315</guid>
		<description><![CDATA[I&#8217;ve attached my slides from the my CFinNC session called &#8220;ColdSpring: Solution to a Problem You May Not Know You Have&#8221;. I&#8217;ve also included the example files that I referenced during the presentation.
The slides have been uploaded to SlideSix.com or you can view them below. A PDF version of the slides is also available for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve attached my slides from the my <a href="http://www.cfinnc.com" target="_blank">CFinNC</a> session called &#8220;ColdSpring: Solution to a Problem You May Not Know You Have&#8221;. I&#8217;ve also included the <a href='http://dan.skaggsfamily.ws/wp-content/uploads/2009/10/ColdSpring-Demo-CFinNC-2009.zip'>example files</a> that I referenced during the presentation.</p>
<p>The slides have been uploaded to <a href="http://slidesix.com/view/ColdSpring-A-Solution-to-a-Problem-You-May-Not-Know-You-Have" target="_blank">SlideSix.com</a> or you can view them below. A <a href='http://dan.skaggsfamily.ws/wp-content/uploads/2009/10/CFinNC-09-Preso.pdf'>PDF version</a> of the slides is also available for download.</p>
<p>Thanks to all those folks that attended my session. Also a huge thanks and a job well done to the conference committee and volunteers that made the conference happen.</p>
<p><object height="425" width="550"><param name="movie" value="http://slidesix.com/viewer/SlideSixViewer.swf?alias=ColdSpring-A-Solution-to-a-Problem-You-May-Not-Know-You-Have" /><param name="menu" value="false"/><param name="scale" value="noScale"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always" /><param value="transparent" name="wmode" /><param value="quality" name="best" /><embed src="http://slidesix.com/viewer/SlideSixViewer.swf?alias=ColdSpring-A-Solution-to-a-Problem-You-May-Not-Know-You-Have" allowscriptaccess="always" allowFullScreen="true" height="425" width="550" type="application/x-shockwave-flash" wmode="transparent" quality="best" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/10/18/slides-from-my-coldspring-session-at-cfinnc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to learn ModelGlue&#8230;.for (nearly) free?</title>
		<link>http://dan.skaggsfamily.ws/2009/09/29/want-to-learn-modelglue-for-nearly-free/</link>
		<comments>http://dan.skaggsfamily.ws/2009/09/29/want-to-learn-modelglue-for-nearly-free/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:42:56 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ModelGlue]]></category>
		<category><![CDATA[Speaking Engagements]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=307</guid>
		<description><![CDATA[Have you ever been curious about building CFML applications using the ModelGlue framework but just not had time to sit down and learn it on your own? If your answer is yes, then October 24th is your lucky day my friend. That&#8217;s the date for the BFusion half of the BFusion/BFlex conference in Bloomington, IN. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever been curious about building CFML applications using the <a href="http://www.model-glue.com/" target="_blank">ModelGlue</a> framework but just not had time to sit down and learn it on your own? If your answer is yes, then October 24th is your lucky day my friend. That&#8217;s the date for the <a href="http://www.bflex-info/bfusion-2009">BFusion</a> half of the BFusion/BFlex conference in Bloomington, IN. </p>
<p><a href="http://www.nodans.com" target="_blank">Dan Wilson</a> will be giving an all-day training session on ModelGlue. Dan is the managing director of the ModelGlue project so you&#8217;ll be getting training from one of the main folks responsible for the framework. I have the honor of filling the role of teaching assistant for the class and I am really excited about the event.</p>
<p>Cost for BFusion/BFlex is $10 per person per day so it&#8217;s nearly as close to free training as you&#8217;re going to find. Registration is not open as of this writing, so be sure to watch the <a href="http://www.bflex.info" target="_blank">BFusion/BFlex</a> site for more details as they become available.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/09/29/want-to-learn-modelglue-for-nearly-free/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two weeks until 360&#124;iDev</title>
		<link>http://dan.skaggsfamily.ws/2009/09/11/two-weeks-until-360idev/</link>
		<comments>http://dan.skaggsfamily.ws/2009/09/11/two-weeks-until-360idev/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 12:37:52 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=300</guid>
		<description><![CDATA[I&#8217;m so looking forward to heading out to the 360&#124;iDev conference in Denver in a couple of weeks (Sept 27-30). This will be my first foray in to the world of Apple Development and I&#8217;m really excited. 
ColdFusion  is the technology that puts a roof over my head and is like that best friend [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m so looking forward to heading out to the <a href="http://www.360idev.com/" target="_blank">360|iDev</a> conference in Denver in a couple of weeks (Sept 27-30). This will be my first foray in to the world of Apple Development and I&#8217;m really excited. </p>
<p>ColdFusion  is the technology that puts a roof over my head and is like that best friend that always makes you feel super comfortable. But, in the last few months, I&#8217;ve had this nagging urge to dabble in something different.  Call it a mid-programmer-life crisis if you want, but sometimes as I sit at my computer working, the thought crosses my mind that I want to do something new again. &#8220;Build something in Flex&#8221; my fellow Adobe-centric developer friends might say. I&#8217;ve worked a little with Flex in the past and really enjoyed it for the most part (and would really love to get to do some more work on larger projects with it) so that doesn&#8217;t really count as something new.  I thought about learning Ruby on Rails as that seems to be generating a lot of buzz lately. In the end, however, I felt like something REALLY different from what I do on a daily basis was called for.</p>
<p>I decided on trying my hand at iPhone development for two main reasons. One, I had an idea for an application that would actually be useful to someone besides just me. No, it won&#8217;t make me the next iPhone App Store millionaire, but it could potentially generate a few bucks a month that I wouldn&#8217;t otherwise have.  Secondly, I&#8217;ve loved my iPhone immensely since I got my first one over 2 years ago so I thought I&#8217;d try to build something that might put teensy-tiny stamp on someone else&#8217;s iPhone.</p>
<p>I went to the first ever 360Flex conference that <a href="http://lordbron.wordpress.com/" target="_blank">Tom</a> and <a href="http://johnwilker.com/" target="_blank">John</a> put on in San Jose, CA back in March of 2007 and, even as a first event, the content and atmosphere was incredible. They&#8217;ve learned a bunch since then with several successive events under their belts so I&#8217;m expecting this conference to be great as well. I&#8217;m especially looking forward to the entire day of &#8220;101&#8243; hands-on stuff on Sunday before the main part of the conference kicks off on Monday. I&#8217;ve been reading up some on using the Apple development software and watching some of the iPhone development video content that&#8217;s available trying to at least start crawling before the &#8220;starting gun&#8221; goes off at the event and, I must say, it definitely fits the bill of &#8220;different&#8221;.</p>
<p>So, if you&#8217;re interested in iPhone development and haven&#8217;t registered, head on over to the site and <a href="http://360idev.eventbrite.com/" target="blank">get your ticket</a> now before the price goes up again.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/09/11/two-weeks-until-360idev/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My short foray into Linux on the desktop</title>
		<link>http://dan.skaggsfamily.ws/2009/08/31/my-short-foray-into-linux-on-the-desktop/</link>
		<comments>http://dan.skaggsfamily.ws/2009/08/31/my-short-foray-into-linux-on-the-desktop/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 22:06:01 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=297</guid>
		<description><![CDATA[For the last few months, I&#8217;ve had this idea that I wanted to try a linux desktop machine as my main development computer for a while.  With the release of Ubuntu 9.04 in April, I decided to put together a machine and give it a try.  Unfortunately, I had to wait a while [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few months, I&#8217;ve had this idea that I wanted to try a linux desktop machine as my main development computer for a while.  With the release of Ubuntu 9.04 in April, I decided to put together a machine and give it a try.  Unfortunately, I had to wait a while in order to get a large project completed so I&#8217;d have time to do the testing an building.</p>
<p>Finally, in July, the project was completed and I ordered a few hundred dollars worth of new gear to update a desktop machine that I had sitting idle and installed Ubuntu 9.04 64-bit. There are a lot of great things about Ubuntu linux and I was very impressed with the performance of the OS on a quad-core processor with a pile of RAM. </p>
<p>Unfortunately, it wasn&#8217;t a Mac. Let me explain what I mean by that.<span id="more-297"></span>I was able to get a bunch of things working correctly on Ubuntu including multiple monitors, my development environment, and email/calendar/address book integration. It seemed with every thing that I tried to do, there was some little &#8220;gotcha&#8221;.</p>
<p>I installed the 64-bit version of Ubuntu 9.04 on my new hardware. Almost immediately I needed to get Flash player running inside Firefox.  That turned into a 30 minute exercise of unzipping the 64-bit beta from Adobe and following a couple different blog posts to get it installed&#8211;only to have to redo the entire exercise when I updated to Firefox 3.5.</p>
<p>Then there was the issue of mail and calendar support.  All my various email accounts are serviced by Google Apps and I use IMAP connections so that my desktop client and my iPhone stay in sync.  Neither Evolution or Thunderbird let me set which folders were to be used for Trash, which meant that I now had an extra [Trash] folder in the list of IMAP folders. Had I been one of those folks that just use the web client, it wouldn&#8217;t have been an issue. Oddly enough (odd since I&#8217;m a web developer) I don&#8217;t like using web clients for mail all the time. </p>
<p>I mentioned that I got my multiple monitors working on Ubuntu. I&#8217;d purchased a GeForce card with twin DVI connectors so I could run both my monitors natively (as opposed to using the <a href="http://dan.skaggsfamily.ws/2008/11/05/external-monitor-solution-for-your-laptop/">USB to DVI adapter</a> like I do with my Macbook Pro). Multi-monitor support worked, but it treated the two monitors quite differently than any other OS I&#8217;ve used multiple monitors on. Application splash screens that displayed at startup were centered across both monitors as if they were one big desktop instead of 2 distinct monitors sitting side by side. That in and of itself wasn&#8217;t a deal breaker, but just another example of things you get used to working differently as I&#8217;ve used OS X for the last nearly 3 years.</p>
<p>Finally, not having as much choice in good, polished applications even though there are thousands of titles in the package manager contributed to me coming back to the Apple &#8220;fold&#8221;. GTD apps that fit my working style and a full-featured alternative to iTunes are two examples.</p>
<p>There were several software packages that were analogous to things I&#8217;d gotten used to on the Mac. GnomeDo is a respectable Linux alternative to QuickSilver which I use constantly. Workspaces in Linux operate much the same as Spaces in OS X, although there are some key differences when &#8220;ALT-Tabbing&#8221; between applications.</p>
<p>I&#8217;ll be the first to admit that Linux as a desktop operating system has come an incredibly long way in the last couple of years, but after having gotten used to the &#8220;fit and finish&#8221; of Mac OS X, it just doesn&#8217;t quite come close enough for me to leave the Mac.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/08/31/my-short-foray-into-linux-on-the-desktop/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Registration for ColdFusion in North Carolina 2009 Conference now open</title>
		<link>http://dan.skaggsfamily.ws/2009/08/26/registration-for-coldfusion-in-north-carolina-2009-conference-now-open/</link>
		<comments>http://dan.skaggsfamily.ws/2009/08/26/registration-for-coldfusion-in-north-carolina-2009-conference-now-open/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 16:30:47 +0000</pubDate>
		<dc:creator>Dan Skaggs</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Speaking Engagements]]></category>

		<guid isPermaLink="false">http://dan.skaggsfamily.ws/?p=288</guid>
		<description><![CDATA[Registration for CFinNC is now open! CFinNC is a free web development conference held in Raleigh, North Carolina during the weekend of October 17th and 18th with an International line-up of speakers presenting on timely and relevant topics on web development. Thanks to the generosity of our sponsors and the creativity of the planning committee, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cfinnc09.eventbrite.com/">Registration</a> for CFinNC is now open! CFinNC is a free web development conference held in Raleigh, North Carolina during the weekend of October 17th and 18th with an International line-up of speakers presenting on timely and relevant topics on web development. Thanks to the generosity of our sponsors and the creativity of the planning committee, registration for the event will be free and includes entry to the weekend event and to all presentations. </p>
<p>In order to keep the event free we have removed some hard costs and some benefits you normally get from paid-registration events.   </p>
<p>Please be aware of the following:</p>
<ol>
<li>You are responsible for paying for lunch for both days. We have enlisted the services of a local caterer and will be providing lunch each day for $10/day. This includes a sandwich, chips and drink. <strong>Please bring cash the day of the event! We will not be able to process credit cards!</strong></li>
<li>Limited Edition, Collectible CFinNC conference t-shirts will be available for purchase for $15 with any proceeds going to offset costs and possibly sponsor a planning committee dinner (if we sell them all). </li>
</ol>
<p><strong>Lunch and shirt purchase is completely optional.</strong>  You may indicate if you would like to purchase lunch and/or a t-shirt on the <a href="http://cfinnc09.eventbrite.com/">registration</a> form.</p>
<p>For more information, please check the CFinNC website at:  <a href="http://www.cfinnc.com">http://www.cfinnc.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.skaggsfamily.ws/2009/08/26/registration-for-coldfusion-in-north-carolina-2009-conference-now-open/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
