<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>CFWheels Bloggers</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=4258363960ec2fbd438d68d764c7faa6</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=4258363960ec2fbd438d68d764c7faa6&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 01 Oct 2015 22:15:35 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Easily build where clauses for the CFWheels ORM with this whereify helper</title>
         <link>http://chapmandu.com/2015/09/11/easily-build-where-clauses-for-the-cfwheels-orm-with-this-whereify-helper/</link>
         <description>Rather than stuff around building up a string when one&amp;#8217;s WHERE clause is conditional.. I make heavy use of this simple little helper which takes an array, and returns a finished string ready to pass to the CFWheels ORM. And &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/09/11/easily-build-where-clauses-for-the-cfwheels-orm-with-this-whereify-helper/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=344&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=344</guid>
         <pubDate>Fri, 11 Sep 2015 07:40:17 +0000</pubDate>
         <content:encoded><![CDATA[<p>Rather than stuff around building up a string when one&#8217;s WHERE clause is conditional.. I make heavy use of this simple little helper which takes an array, and returns a finished string ready to pass to the CFWheels ORM.</p>
<pre>
// helpers.cfm

/**
 * Hint
 * I surround each array element in brackets and return delimited by an operator
 */
public string function whereify(required array array, string operator=&quot;AND&quot;) {
	var loc = {};
	loc.array = [];
	for (loc.i=1; loc.i &lt;= ArrayLen(arguments.array); loc.i++) {
		loc.array[loc.i] = &quot;(#arguments.array[loc.i]#)&quot;;
	}
	return ArrayToList(loc.array, &quot; #arguments.operator# &quot;);
}
</pre>
<p>And here&#8217;s how I use it..</p>
<pre>
// YourController.cfc

var loc = {};
// build a sexy where clause array..
loc.where = [];
ArrayAppend(loc.where, &quot;foo = 'bar'&quot;);
if (StructKeyExists(params, &quot;slayer&quot;)) {
	ArrayAppend(loc.where, &quot;somecolumn IN (1,2,3)&quot;);
}

// use the whereify helper in your ORM call
// Produces: (foo = 'bar') AND (somecolumn IN (1,2,3))
users = model(&quot;User&quot;).findAll(whereify(loc.where));

// You can also specify an operator
// Produces: (foo = 'bar') OR (somecolumn IN (1,2,3))
users = model(&quot;User&quot;).findAll(whereify(loc.where, &quot;OR&quot;));
</pre><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/344/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=344&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Deploying a Lucee application to an Amazon Elastic Beanstalk Environment</title>
         <link>http://chapmandu.com/2015/06/09/deploying-a-lucee-application-to-an-amazon-elastic-beanstalk-environment/</link>
         <description>If there was a piece of interwebs kit I would like to buy flowers, it would without doubt be Amazon&amp;#8217;s Elastic Beanstalk with autoscaling.. Couple it with the Lucee scripting language and I&amp;#8217;d happily take it home to meet my &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/06/09/deploying-a-lucee-application-to-an-amazon-elastic-beanstalk-environment/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=316&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=316</guid>
         <pubDate>Tue, 09 Jun 2015 06:27:51 +0000</pubDate>
         <content:encoded><![CDATA[<p>If there was a piece of interwebs kit I would like to buy flowers, it would without doubt be Amazon&#8217;s Elastic Beanstalk with autoscaling.. Couple it with the <a rel="nofollow" target="_blank" href="http://lucee.org/">Lucee</a> scripting language and I&#8217;d happily take it home to meet my parents..</p>
<p>After much experimentation and many iterations (failed attempts and hair-pulling), I&#8217;ve managed to deploy Lucee applications (with my fave framework.. <a rel="nofollow" target="_blank" href="http://www.cfwheels.org">CFWheels</a>) to the AWS Elastic Beanstalk platform and have it running reliably in production for a number of months.</p>
<p>My setup is a bit more complex than described below, but hopefully these bare bones will get you started on the path to automated utopia.. Those bare bones will result in a finished .war file that you can upload to EB using their deploy by file upload feature. You could also use the AWS command line tools, AWS toolkit for Eclipse, a Jenkins plugin or one of the many SaaS deployment platforms around.</p>
<p>I personally use <a rel="nofollow" target="_blank" href="https://jenkins-ci.org/">Jenkins</a> (on an AWS EC2 instance) to pull, build, test and deploy. I prefer this type of setup as there is much less margin for human error, and the resulting 60Mb+ war file is transferred within your Virtual Private Cloud rather than travelling across the interwebs if you were to manually upload it for every deployment.. oh, and it&#8217;s open source.</p>
<p>At a high level, I will outline how to download the Lucee server war file, combine your application&#8217;s code, and use some AWS sorcery to configure your Lucee application. There are some pre-requisites:</p>
<ul>
<li>The settings that you would normally configure in Lucee admin, should be in Application.cfc (See the Export feature in Lucee admin)</li>
<li>The commands to create the finished war file are written for Linux (If you&#8217;re Windows inclined , you could either &#8216;translate&#8217; them to Windows commands, try Cygwin or a Virtual Machine)</li>
<li>You&#8217;ll need a src/ directory in your application containing the files outlined below</li>
<li>An <a rel="nofollow" target="_blank" href="http://aws.amazon.com/">AWS</a> account with an empty Tomcat 8 <a rel="nofollow" target="_blank" href="http://aws.amazon.com/elasticbeanstalk/">Elastic Beanstalk</a> environment</li>
</ul>
<p>In a nutshell, what happens is the Lucee jars, your code and some config files are all copied to the &#8220;build&#8221; directory, then zipped into a sexy war file ready for upload/deploy to the Elastic Beanstalk environment.</p>
<p><strong>src directory</strong><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/3e2fd99a8e19ec8acffd">web.xml</a><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="http://tuckey.org/urlrewrite/">urlrewritefilter-4.0.3.jar</a><br />
src/eb-tomcat/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/faacf4dbe7ab77b12745">urlrewritefilter.xml</a><br />
src/eb-tomcat/.ebextensions<br />
src/eb-tomcat/.ebextensions/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/248142ca7f8c5825face">lucee-server.xml</a><br />
src/eb-tomcat/.ebextensions/<a rel="nofollow" target="_blank" href="https://gist.github.com/chapmandu/2df65694a580617c0341">01-copy-lucee-server-xml.config</a></p>
<p><a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png"><img class=" size-medium wp-image-332 alignleft" src="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png?w=300&#038;h=203" alt="src-directory-structure" width="300" height="203"/></a></p>
<p>These are configuration files.. for a production application, you&#8217;ll need to provide your own lucee-server.xml and most likely your own rewrite rules in urlrewrite.xml. If you don&#8217;t need url rewriting, then remove all reference to them. The .ebextensions execute EB container commands.. the one provided simply copies your lucee-server.xml file into place. To create your finished war file, <code>cd</code> to your application&#8217;s root directory then run these commands. I&#8217;d suggest creating a shell script.. and if you feel adventurous, allow an &#8216;environment&#8217; option that will create different environment builds for your application&#8217;s deployment pipeline</p>
<pre>
# some vars..
DOWNLOADS_PATH=&quot;/tmp/downloads/&quot;
LUCEE_VERSION=&quot;4.5.1.000&quot;
LUCEE_WAR=&quot;lucee-$LUCEE_VERSION.war&quot;
LUCEE_WAR_PATH=&quot;$DOWNLOADS_PATH$LUCEE_WAR&quot;
FINISHED_WAR_PATH=&quot;/var/www/myapp/war/&quot;

# ensure the required packages are installed
sudo apt-get install unzip wget
# sudo yum install unzip wget # (or using yum)

# create required directories
mkdir build
mkdir -p $DOWNLOADS_PATH
mkdir -p $FINISHED_WAR_PATH
# only download the lucee war file once
if ! [ -e &quot;$LUCEE_WAR_PATH&quot; ]
then
  wget -O $LUCEE_WAR_PATH http://bitbucket.org/lucee/lucee/downloads/$LUCEE_WAR
fi

# unzip the lucee war file into the build utility directory
unzip $LUCEE_WAR_PATH -d build
rm -rf build/assets

# explicitly copy required code (this is cfwheels specific.. but just plonk in your own directory names)
cp -r config controllers customtags events images javascripts models plugins  stylesheets tests views wheels build
cp -r Application.cfc index.cfm rewrite.cfm root.cfm build
# remove any peksy files that you don't want deployed to production
rm -r build/favicon.ico build/License.txt
# copy config files
cp -r src/eb-tomcat/.ebextensions build
cp -f src/eb-tomcat/web.xml build/WEB-INF/web.xml
# copy tuckey url rewrite jar if required
cp src/eb-tomcat/urlrewritefilter-4.0.3.jar build/WEB-INF/lib/urlrewritefilter-4.0.3.jar
cp src/eb-tomcat/urlrewrite.xml build/WEB-INF/urlrewrite.xml

# this is how I force my app into 'production' mode.. again very cfwheels-centric
rm build/config/environment.cfm
echo 'set(environment=&quot;production&quot;);' &gt; build/config/environment.cfm
# create le war file
cd build &amp;&amp; zip -r -q $FINISHED_WAR_PATH&quot;app-production-master.war&quot; . &amp;&amp; cd ..
# cleanup
rm -r build
</pre>
<p>This should give you a <a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2014/08/borat_great_success-320x229.jpg">production ready</a> war file located at: build/app-production-master.war. Now you can manually upload your app-production-master.war and be on your way..</p>
<p>Some of my recommendations:</p>
<ul>
<li>Build in the cloud using Jenkins (or your choice of CI server)</li>
<li>Host the Lucee war file in your own S3 bucket.. you&#8217;re less at the mercy of 3rd parties connectivity issues.</li>
<li>You can easily incorporate additional jar files as per the tuckey rewrite tool.. just copy them into <code>build/WEB-INF/lib/</code></li>
</ul>
<p>Any suggestions, improvements &amp; feedback welcome.</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/316/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=316&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
         <media:content medium="image" url="https://chapmanic.files.wordpress.com/2015/06/src-directory-structure.png?w=300">
            <media:title type="html">src-directory-structure</media:title>
         </media:content>
      </item>
      <item>
         <title>Enforcing the use of routes in CFWheels</title>
         <link>http://chapmandu.com/2015/03/13/enforcing-the-use-of-routes-in-cfwheels/</link>
         <description>If you really like routing (you&amp;#8217;d find that really funny if you&amp;#8217;re Australian) and want to enforce their use in all linkTo(), urlFor() and startFormTag() function calls.. Do as I do.. Put the function below into your /controllers/Controller.cfc This overrides, &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/03/13/enforcing-the-use-of-routes-in-cfwheels/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=314&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=314</guid>
         <pubDate>Fri, 13 Mar 2015 05:07:20 +0000</pubDate>
         <content:encoded><![CDATA[<p>If you really like routing (you&#8217;d find that really funny if you&#8217;re Australian) and want to enforce their use in all linkTo(), urlFor() and startFormTag() function calls.. Do as I do..</p>
<p>Put the function below into your /controllers/Controller.cfc</p>
<pre>
&lt;!--- /controllers/Controller.cfc ---&gt;
&lt;cffunction name=&quot;urlFor&quot; access=&quot;public&quot; output=&quot;false&quot; hint=&quot;ensure routes are used for all urls&quot;&gt;
    &lt;cfif ! StructKeyExists(arguments, &quot;noroute&quot;) &amp;&amp; ! ( (StructKeyExists(url, &quot;controller&quot;) &amp;&amp; url.controller == &quot;wheels&quot;) || StructKeyExists(arguments, &quot;url&quot;) )&gt;
      &lt;cfif ! (StructKeyExists(arguments, &quot;route&quot;) &amp;&amp; Len(arguments.route) gt 0)&gt;
        &lt;cfthrow message=&quot;Please use a route rather than an action.. Thanks!&quot;&gt;
      &lt;/cfif&gt;
    &lt;/cfif&gt;
    &lt;cfreturn core.urlFor(argumentCollection=arguments)&gt;
  &lt;/cffunction&gt;
&lt;/code&gt;
</pre>
<p>This overrides, the core urlFor() method, checking for the existence of a route argument.. UNLESS, the controller is &#8220;wheels&#8221; which probably means you&#8217;re using the test framework or managing a plugin. There is also a way to bypass the route nazi.. by using the noroute=true arguments.</p>
<p>Happy <a rel="nofollow" target="_blank" href="http://www.urbandictionary.com/define.php?term=root">routing</a>.. Teehee!</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/314/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=314&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>CFWheels Calculated Properties on Steroids using an afterFind Callback</title>
         <link>http://chapmandu.com/2015/01/15/cfwheels-calculated-properties-on-steroids-using-an-afterfind-callback/</link>
         <description>One limitation with using calculated properties in your CFWheels models is that one is limited to what can be achieved using SQL. CFML has almost infinite possibilities for formatting strings which simply cannot be done easily (or at all) in &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2015/01/15/cfwheels-calculated-properties-on-steroids-using-an-afterfind-callback/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=306&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=306</guid>
         <pubDate>Thu, 15 Jan 2015 23:51:09 +0000</pubDate>
         <content:encoded><![CDATA[<p>One limitation with using calculated properties in your CFWheels models is that one is limited to what can be achieved using SQL. CFML has almost infinite possibilities for formatting strings which simply cannot be done easily (or at all) in SQL.</p>
<p>A technique that I use to get around this limitation is to create new properties using an afterFind callback for both objects AND queries in a single callback. </p>
<p>In the code below I create two new properties, createdAtShort and createdAtLong which are just different date masks applied to the trusty createdat property. It&#8217;s a fairly simple example, but highlights the huge potential of keeping this type of logic in your model and out of your views. Hopefully this will get your brain moist.</p>
<pre>
&lt;!--- /models/User.cfc ---&gt;

&lt;cfcomponent extends=&quot;Model&quot; output=&quot;false&quot;&gt;

  &lt;cffunction name=&quot;init&quot;&gt;
    &lt;cfset afterFind(&quot;$$setStuffAfterFind&quot;)&gt;
  &lt;/cffunction&gt;

  &lt;cffunction name=&quot;$$setStuffAfterFind&quot; access=&quot;private&quot;&gt;
    &lt;cfif StructKeyExists(arguments, &quot;createdAt&quot;)&gt;
      &lt;cfset arguments.createdAtShort = DateFormat(arguments.createdAt, &quot;d/m/yy&quot;)&gt;
      &lt;cfset arguments.createdAtLong = DateFormat(arguments.createdAt, &quot;dddd, dd mmmm yyyy&quot;) &amp; &quot; &quot; &amp; TimeFormat(arguments.createdAt, &quot;hh:mmtt&quot;)&gt;
      &lt;cfreturn arguments&gt;
    &lt;/cfif&gt;
  &lt;/cffunction&gt;

&lt;/cfcomponent&gt;
</pre>
<p>Now you can call your model and the result should contain your new properties..</p>
<pre>
&lt;!--- /controllers/Users.cfc ---&gt;

&lt;cfset user = model(&quot;User&quot;).findOne()&gt;
&lt;cfset users = model(&quot;User&quot;).findAll(maxrows=5)&gt;

&lt;cfdump var=&quot;#user.properties()#&quot;&gt;
&lt;cfdump var=&quot;#users#&quot;&gt;
</pre>
<p>Notes:</p>
<ol>
<li>Avoid performing further database operations inside the callback when using findAll.. y&#8217;know the whole querying within a recordset loop thing..</li>
<li>afterFind callbacks are not called on included models. So.. <code>model("Company").findAll(include="Users")</code> won&#8217;t contain your new properties.</li>
</ol>
<p>UPDATE: <a rel="nofollow" target="_blank" href="https://twitter.com/_chrisdpeters" title="https://twitter.com/_chrisdpeters">Chris Peters</a> has since shown me the error of my ways.. it turns out that the arguments scope can be used for both queries and objects. This has simplified the entire concept considerably (and made &#8216;my&#8217; code look eerily similar to the official CFWheels <a rel="nofollow" target="_blank" href="http://cfwheels.org/docs/1-3/chapter/object-callbacks" title="http://cfwheels.org/docs/1-3/chapter/object-callbacks">docs</a>! The code and description above have been modified to use arguments scope.</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/306/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=306&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Run your CFWheels database migrations automatically on application start</title>
         <link>http://chapmandu.com/2014/11/06/run-your-cfwheels-database-migrations-automatically-on-application-start/</link>
         <description>It&amp;#8217;s no secret that I&amp;#8217;m a massive fan of the Coldfusion on Wheels framework.. and there are a couple of tools that I use in my deployment process that are invaluable to me. One of those is the DBMigrate plugin. &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2014/11/06/run-your-cfwheels-database-migrations-automatically-on-application-start/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=299&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=299</guid>
         <pubDate>Thu, 06 Nov 2014 22:00:20 +0000</pubDate>
         <content:encoded><![CDATA[<p>It&#8217;s no secret that I&#8217;m a massive fan of the <a rel="nofollow" target="_blank" href="http://cfwheels.org" title="Coldfusion on Wheels">Coldfusion on Wheels</a> framework.. and there are a couple of tools that I use in my deployment process that are invaluable to me.</p>
<p>One of those is the <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/28" title="DBMigrate">DBMigrate</a> plugin. I recently came up with a way to automatically migrate to the latest database version when the application first starts.</p>
<p>This can be useful/essential when:</p>
<ul>
<li>Your deployment process doesn&#8217;t use post-deploy hooks</li>
<li>You want to make your application more portable</li>
<li>You want to simplify your deployment script</li>
</ul>
<p>Essentially, it calls a couple of the plugin&#8217;s methods whilst doing a little array-fu.</p>
<p><strong>/events/onapplicationstart.cfm</strong></p>
<pre>
&lt;cfscript&gt;
// migrate database
_dbm = {}
// create a pointer to the dbmigrate plugin
_dbm.plugin = application.wheels.plugins.dbmigrate
// create an array of available migrations sorted by version in descending order
_dbm.available = []
for(item in _dbm.plugin.getAvailableMigrations()){
_dbm.available.Append(item.version)
}
ArraySort(_dbm.available, &quot;numeric&quot;, &quot;desc&quot;)
// migrate to the most recent version
_dbm.plugin.migrateTo(_dbm.available[1])
&lt;/cfscript&gt;
</pre>
<p>There are a few caveats:</p>
<ul>
<li>It will execute every time the application loads OR is manually reloaded via the reload=true parameter (though it&#8217;s fairy lightweight when there are no migrations to execute)</li>
<li>It will execute on every server in your cluster</li>
<li>There is (currently) no error handling</li>
<li>It could disable your application if your migrations fail</li>
</ul><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/299/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/299/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=299&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Passing a list of strings to CFWheels’ findAll() where argument</title>
         <link>http://chapmandu.com/2014/08/08/passing-a-list-of-strings-to-cfwheels-findall-where-argument/</link>
         <description>Use the ListQualify() function to pass a list of strings to the where argument in CFWheels ORM finders. ListQualify() encloses each list element in with the string specified (in this case, a single quote). Without it, CFWheels interprets the list &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2014/08/08/passing-a-list-of-strings-to-cfwheels-findall-where-argument/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=282&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=282</guid>
         <pubDate>Fri, 08 Aug 2014 05:30:00 +0000</pubDate>
         <content:encoded><![CDATA[<p>Use the <code>ListQualify()</code> function to pass a list of strings to the <code>where</code> argument in CFWheels ORM finders. <code>ListQualify()</code> encloses each list element in with the string specified (in this case, a single quote). Without it, CFWheels interprets the list as a single value.</p>
<pre>
&lt;cfscript&gt;
names = &quot;Foo,Bar&quot;;
users = model(&quot;User&quot;).findAll(where=&quot;firstname IN ('#names#')&quot;);
/*
 * Generates SQL Query.. Not so good
SELECT firstname, lastname FROM users WHERE firstname IN ('Foo,Bar')
*/

users = model(&quot;User&quot;).findAll(where=&quot;firstname IN (#ListQualify(names, &quot;'&quot;)#)&quot;);
/* 
 * Generates SQL Query. Great success!
SELECT firstname, lastname FROM users WHERE firstname IN ('Foo','Bar')
*/
&lt;/cfscript&gt;
</pre>
<p><a rel="nofollow" target="_blank" href="https://chapmanic.files.wordpress.com/2014/08/borat_great_success-320x229.jpg">Great success!</a></p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/282/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=282&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>The Importance of URL Rewriting</title>
         <link>http://flexicons.blogspot.com/2013/05/the-importance-of-url-rewriting.html</link>
         <description>I am terrible about explaining things sometimes, and lately I've been working with a client on URL rewriting. I've done a lot of techno-speak but I'm not sure that I have really explained in laymans terms what URL rewriting is, and why it's important.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;What is it?&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;When you go to your About us page on your web site right now, if you typed in the whole address into your browser, it might look something like this:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/index.cfm/sitepages/show/2&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;That URL doesn't tell us anything about the page, and it's very hard to remember. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Wouldn't it be better to have that URL be this?&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/About-Us&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;That is URL rewriting. It's the process of making your page names descriptive, instead of cryptic.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;When we start rewriting those URL's, a great thing happens... you can now &lt;i&gt;anticipate&lt;/i&gt; what a page will be. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Want to find out about services? My guess would be the URL would be:&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/services&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Want to go to the contact us page? My guess would be:&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;u&gt;http://www.yoursite.com/Contact-Us&lt;/u&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Best of all, those guesses would be right! So by rewriting the URL's, the first thing we've done is make those pages easy to remember. If I'm on my smart phone and don't want to have to go to the home page of your site, to get to your contact page, I can now easily remember how to get there. With so many people using the browsers on their phones, making those pages easy to get to is going to increase your traffic.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;But URL rewriting isn't just for people, it's for search engines too. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Google and other search engines give your pages a &quot;rank.&quot;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;When you do a search, the pages with the highest rankings show up first. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;By making the name of the page descriptive of the content, your rank will improve, and therefore your pages will show up higher in searches. &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;So hopefully that is a simple explanation of what URL rewriting is, and why it's so important. If you are serious about SEO, URL rewriting is a smart thing to do.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Implementing URL rewriting in CFWheels&lt;/b&gt;&lt;br /&gt;This is just how I do it in CFWheels. I'd really like to hear how others are accomplishing it to see if I can improve on the method.&lt;br /&gt;&lt;br /&gt;Let's create a hypothetical table called &quot;sitepages.&quot;&lt;br /&gt;In that table, I create a field for the title of the page and a unique field for the &quot;slug.&quot;&lt;br /&gt;&lt;br /&gt;In the sitepages model, I add a beforeSave callback.&lt;br /&gt;&amp;lt;!---Add this to the models init method---&amp;gt;&lt;br /&gt;&amp;lt;cfset beforeSave(&quot;checktheslug&quot;)&amp;gt;&lt;br /&gt;&lt;br /&gt;Then, I create the &quot;checktheslug&quot; function:&lt;br /&gt;&lt;br /&gt; If the user doesn't specify a slug, then the slug takes the title of the page, replaces spaces with hyphens, and then strips out any extraneous characters like quotation marks, exclamation points, etc.&lt;br /&gt;&lt;br /&gt;Then all I have to do is set up a route, and I'm in business:&lt;br /&gt;&amp;lt;!---Add this to the routes ---&amp;gt;&lt;br /&gt;addRoute(name=&quot;sitepages&quot;, pattern=&quot;pages/[slug]&quot;, controller=&quot;sitepages&quot;, action=&quot;show&quot;); &lt;/div&gt;</description>
         <author>Cathy Shapiro</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-140258686176088525.post-1512943589802362190</guid>
         <pubDate>Wed, 01 May 2013 12:37:00 +0000</pubDate>
      </item>
      <item>
         <title>HTML5 Video</title>
         <link>http://flexicons.blogspot.com/2012/12/html5-video.html</link>
         <description>I recently had to post a lot of videos on a cfwheels site.&lt;br /&gt;The videos needed to be behind a login, so to achieve that I put a little function in the Controllers/Controller.cfc. I was passing the videoid in the url so I just cued off that. &lt;br /&gt;&lt;br /&gt; So then I just set a filter on my sitepages controller to run on the page.&lt;br /&gt;&amp;lt;cfset filters(through=&quot;memberloginRequired&quot;, only=&quot;show&quot;)&amp;gt;&lt;br /&gt;&lt;br /&gt;I had to report on the videos, so for the video playback, I used the Projekktor video player. It has a flash fallback and it had a tracking plugin that I bought to keep track of all player events and states.&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.projekktor.com/docs/plugins_tracking&quot;&gt;http://www.projekktor.com/docs/plugins_tracking&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To make the video available to the most people, we used mp4 and ogv&lt;br /&gt;I had a little trouble figuring out how everything has to fit together, but basically you have to go into IIS and add support for the video types, so you have to add MIME types for video/mp4 and video/ogg with an ogv extension. This will add the following to your web.config file just under your rewrite tag: &lt;br /&gt;&lt;br /&gt;One problem I ran into was browser's not recognizing the mp4 so I ended up taking the type out of that in the video page script: &lt;br /&gt; Altogether adding html5 videos was very nice. However, we are still having some people reporting problems, so next I'm going to write a little script to help with debugging. I will try to post that later.</description>
         <author>Cathy Shapiro</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-140258686176088525.post-1847472339660127692</guid>
         <pubDate>Tue, 04 Dec 2012 10:27:00 +0000</pubDate>
      </item>
      <item>
         <title>Ensuring Full Unit Test Coverage In Your CFWheels App</title>
         <link>http://chapmandu.com/2012/07/12/ensuring-full-unit-test-coverage-in-your-cfwheels-app/</link>
         <description>Ensuring that you have unit tested all (or most) of your code in your CFWheels app is an important part of any test suite. As you hopefully know by now, the CFWheels framework features an in-built unit test framework. The &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2012/07/12/ensuring-full-unit-test-coverage-in-your-cfwheels-app/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=257&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=257</guid>
         <pubDate>Thu, 12 Jul 2012 01:32:21 +0000</pubDate>
         <content:encoded><![CDATA[<p>Ensuring that you have unit tested all (or most) of your code in your CFWheels app is an important part of any test suite. As you hopefully know by now, the CFWheels framework features an in-built unit test framework.</p>
<p>The code below is a test itself, that will scan your controllers, models and views folders and make sure that you have a corresponding &#8220;test&#8221; cfc for each. If it discovers that a test is missing, it will fail.. so your app will not pass unless it has full test coverage.</p>
<p>To get it working, just copy the code below and save it into a file in <code>/tests/TestsExist.cfc</code> (or anywhere under the <code>tests</code> folder actually). You can retro-fit it to any app, though you may need to re-organise your test files somewhat.</p>
<p>There are some conventions that you need to follow to have it work properly, but I consider this being well organised (and you should be used to conventions by now). Your folder structure under <code>/myapp/tests/</code> should look like this..<a rel="nofollow" target="_blank" href="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg"><img src="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg?w=584" alt="" class="alignleft size-full wp-image-258"/></a>. Say you have a <code>Login.cfc</code> controller, your controller test cfcs themselves should be named like this <code>TestLogin.cfc</code>.. but you could also have multiple test files for your <code>Login.cfc</code>, just as long as the file BEGINS with &#8220;TestLogin&#8221;, eg: <code>TestLoginRedirects.cfc</code>, <code>TestLoginBusinessLogic.cfc</code>.. you get the idea.</p>
<p>The same goes for models and views. There is much one could do to improve/re-factor/customise this code, but it will hopefully catch anything you may have forgotten to test. Feel free to contribute to this <a rel="nofollow" target="_blank" href="https://github.com/chapmandu/cfwheels-hastests">project on GitHub</a>.</p>
<p>So to summarise:</p>
<ul>
<li>Re-organise your folders as per the example above</li>
<li>Re-name your test cfc files using <code>Test{YourControllerName}.cfc</code></li>
<li>Copy the code into a TestsExist.cfc file under the <code>/tests/</code> folder</li>
<li>Run your unit tests</li>
</ul>
<pre>
&lt;cfcomponent extends=&quot;wheelsMapping.Test&quot;&gt;
	
	&lt;cffunction name=&quot;setup&quot;&gt;
		&lt;cfset testsPath = ExpandPath(&quot;tests&quot;)&gt;
		&lt;cfset controllersPath = ExpandPath(&quot;controllers&quot;)&gt;
		&lt;cfset modelsPath = ExpandPath(&quot;models&quot;)&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;test_00_setup_and_teardown&quot;&gt;
		&lt;cfset assert(&quot;true&quot;)&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;test_01_all_controller_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#controllersPath#&quot; filter=&quot;*.cfc&quot; name=&quot;controllers&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'controllers'#&quot; filter=&quot;*.cfc&quot; name=&quot;controllerTests&quot; /&gt;
		&lt;cfset assert(&quot;controllerTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;controllers&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Controller.cfc,Wheels.cfc&quot;, controllers.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(controllers.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;controllerTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, controllerTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;controllers.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;
	
	&lt;cffunction name=&quot;test_02_all_model_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#modelsPath#&quot; filter=&quot;*.cfc&quot; name=&quot;models&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'models'#&quot; filter=&quot;*.cfc&quot; name=&quot;modelTests&quot; /&gt;
		&lt;cfset assert(&quot;modelTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;models&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Model.cfc,Wheels.cfc&quot;, models.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(models.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;modelTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, modelTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;models.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;test_03_all_view_tests_exist&quot;&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#controllersPath#&quot; filter=&quot;*.cfc&quot; name=&quot;controllers&quot; /&gt;
		&lt;cfdirectory action=&quot;list&quot; directory=&quot;#testsPath &amp; '/' &amp; 'views'#&quot; filter=&quot;*.cfm&quot; name=&quot;viewTests&quot; /&gt;
		&lt;cfset assert(&quot;viewTests.recordCount gt 0&quot;)&gt;
		&lt;cfloop query=&quot;controllers&quot;&gt;
			&lt;cfif ListFindNoCase(&quot;Controller.cfc,Wheels.cfc&quot;, controllers.name) eq 0&gt;
				&lt;cfset abbrev = ListFirst(controllers.name, &quot;.&quot;)&gt;
				&lt;cfset isTestFileFound = false&gt;
				&lt;cfloop query=&quot;viewTests&quot;&gt;
					&lt;cfif FindNoCase(&quot;Test&quot; &amp; abbrev, viewTests.name) gt 0&gt;
						&lt;cfset isTestFileFound = true&gt;
						&lt;cfbreak&gt;
					&lt;/cfif&gt;
				&lt;/cfloop&gt;
				&lt;cfset assert(&quot;isTestFileFound&quot;, &quot;controllers.name&quot;)&gt;
			&lt;/cfif&gt;
		&lt;/cfloop&gt;
	&lt;/cffunction&gt;

	&lt;cffunction name=&quot;teardown&quot;&gt;
	&lt;/cffunction&gt;

&lt;/cfcomponent&gt;
</pre><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/257/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=257&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/07/testsdirs.jpg"/>
      </item>
      <item>
         <title>Displaying PDF Form Fields Using iText and ColdFusion</title>
         <link>http://talltroym.blogspot.com/2012/07/displaying-pdf-form-fields-using-itext.html</link>
         <description>&lt;p&gt;One of my most recently developed web application is a new health care system for a number of laborites that perform various testing. The initial workflow has the central office receiving the lab test order and sample, entering it into the system, and then sending the sample and five or six (depending on the test ordered) worksheets along to the lab techs. Currently the worksheets that have to be completed are a variety of MS Excel, MS Word and an Adobe PDF file. This can take anywhere between 3 to 8 minutes to complete, depending on which forms are needed and what information is available on the test order. They asked for an easier way to do this.&lt;/p&gt;

&lt;p&gt;I decided to explore generating a single PDF file that would be generated after the test order is entered in the system. The fields on the various documents that normally the administrative staff have to fill in would be populated by the web application. Normally this would be easy to do using &lt;code&gt;cfpdfform&lt;/code&gt;, however for this project we&amp;#8217;re using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.getrailo.org/&quot;&gt;Railo&lt;/a&gt; instead of Adobe ColdFusion and the &lt;code&gt;cfpdfform&lt;/code&gt; tag isn&amp;#8217;t available. I was hoping that Railo 4 would include this tag as a feature, but there was no mention of it being included at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.cfobjective.com/sessions/railo-4ever/&quot;&gt;cf.Objective() 2012&lt;/a&gt; by the Railo team when I asked. I&amp;#8217;ve asked on the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://groups.google.com/forum/?fromgroups#!topic/railo/npqhUfUxd6k&quot;&gt;Railo list twice&lt;/a&gt;, initially they said yes but most recently they haven&amp;#8217;t responded. Therefore I needed to find an alternative solution, which I did, and here&amp;#8217;s what I ended up doing.&lt;/p&gt;

&lt;h2 id=&quot;createasingleadobeacrobatpdfform&quot;&gt;Create a single Adobe Acrobat PDF Form&lt;/h2&gt;

&lt;p&gt;The first step was to use Adobe Acrobat Professional to combine the MS Excel, MS Word and Adobe PDF files into a single PDF file. The next step was to create the form fields within the PDF for the web application to populate from the database. Since every page had a &amp;#8220;name&amp;#8221; field, we just made that field name the same on each page.&lt;/p&gt;

&lt;h2 id=&quot;getitext&quot;&gt;Get iText&lt;/h2&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.itextpdf.com/&quot;&gt;iText&lt;/a&gt; is a Java component that is designed to work with PDF files. It can create, read and update PDF files. The technical documentation on the website is pretty thin, they really encourage you to buy a copy of their &amp;#8220;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://affiliate.manning.com/idevaffiliate.php?id=223_212&quot;&gt;iText in Action&lt;/a&gt;&amp;#8221; book. I&amp;#8217;d have no problem with this, but they &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.amazon.com/iText-Action-Bruno-Lowagie/dp/1935182617/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1341246415&amp;amp;sr=1-1&amp;amp;keywords=itext+in+action&quot;&gt;don&amp;#8217;t currently offer a Kindle version&lt;/a&gt; yet so I&amp;#8217;m holding off on that. I did find the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://api.itextpdf.com/&quot;&gt;API documentation is available online&lt;/a&gt; that you can use, and they do have the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.itextpdf.com/examples/&quot;&gt;samples from the book available for download&lt;/a&gt; that may help.&lt;/p&gt;

&lt;p&gt;Download the iText PDF community version from &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.itextpdf.com/download.php&quot;&gt;here&lt;/a&gt;. I decompressed these files and placed them in the same directory as I had my Railo JAR files, then I restarted Apache Tomcat. I&amp;#8217;m pretty sure I could put these in my &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;ColdFusion on Wheels&lt;/a&gt; application directory &lt;code&gt;/lib&lt;/code&gt; directory and load them using the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/plugins/listing/27&quot;&gt;javaLoader for CFWheels&lt;/a&gt;, but I haven&amp;#8217;t tried it yet.&lt;/p&gt;

&lt;h2 id=&quot;cfdumptheformfields&quot;&gt;CFDump the form fields&lt;/h2&gt;

&lt;p&gt;The next thing I wanted to do was to dump the form fields from the PDF file to make sure I was able to read the file correctly. I placed the single PDF file that we had created with all of the form fields with my &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;ColdFusion on Wheels&lt;/a&gt; application directory. I then created a CFML page and used the following code to dump the form fields that are found within the entire file.&lt;/p&gt;

&lt;pre&gt;
 
readPDF = expandpath(&quot;the_file_name_here.pdf&quot;);
writePDF = expandpath(&quot;#createUUID()#.pdf&quot;);
fileIO = createObject(&quot;java&quot;,&quot;java.io.FileOutputStream&quot;).init(writePDF);
reader = createObject(&quot;java&quot;,&quot;com.itextpdf.text.pdf.PdfReader&quot;).init(readPDF);
stamper = createObject(&quot;java&quot;,&quot;com.itextpdf.text.pdf.PdfStamper&quot;).init(reader, fileIO);
pdfForm = stamper.getAcroFields();
 
 
&lt;/pre&gt;

&lt;p&gt;This dumped out a list of all of the form fields within the PDF so I can make sure that iText was able to read them, and that I spelled them correctly.&lt;/p&gt;

&lt;h2 id=&quot;populatetheformfields&quot;&gt;Populate the Form Fields&lt;/h2&gt;

&lt;p&gt;The next step was to populate these fields with data from my database. I also wanted to display this PDF in the users browser. I was able to to this pretty much as I did above, but just with a minor changes.&lt;/p&gt;

&lt;pre&gt;
 
readPDF = expandpath(&quot;the_file_name_here.pdf&quot;);
writePDF = expandpath(&quot;#createUUID()#.pdf&quot;);
fileIO = createObject(&quot;java&quot;,&quot;java.io.FileOutputStream&quot;).init(writePDF);
reader = createObject(&quot;java&quot;,&quot;com.itextpdf.text.pdf.PdfReader&quot;).init(readPDF);
stamper = createObject(&quot;java&quot;,&quot;com.itextpdf.text.pdf.PdfStamper&quot;).init(reader, fileIO);
pdfForm.setField(&quot;date_sample_collected&quot;, &quot;#date_sample_collected#&quot;);
pdfForm.setField(&quot;patient_name&quot;, &quot;#patient_name#&quot;);
pdfForm.setField(&quot;date_of_birth&quot;, &quot;#date_of_birth#&quot;);
pdfForm.setField(&quot;order_number&quot;, &quot;#order_number#&quot;);
stamper.setFormFlattening(true);
stamper.close();
reader.close();
fileIO.close();
 
 
&lt;/pre&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;

&lt;p&gt;Using this code I was able to satisfy the initial request that the administrative staff, to save them from creating these additional forms manually with the data they had just entered into the web application.&lt;/p&gt;

&lt;p&gt;I know I can make this better though, since not every page of that PDF is needed, it depends on the test selected. I plan to re-factor this application code in the future to to determine which test was selected, then only grab those worksheets. This means I&amp;#8217;ll need to separate each of the worksheets out into a separate PDF file, then stitch them together, depending on what the user has entered for the order, into a single file. &lt;/p&gt;

&lt;h2 id=&quot;thanksto&quot;&gt;Thanks To&lt;/h2&gt;

&lt;p&gt;Thanks to this &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfsearching.blogspot.com/2009/04/itext-preview-of-things-to-come-someday.html&quot;&gt;cfSearching blog post&lt;/a&gt; that helped, as well as &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://stackoverflow.com/questions/697122/adding-a-dynamic-image-to-a-pdf-using-coldfusion-and-itext&quot;&gt;rip747&amp;#8217;s Stackoverflow posting&lt;/a&gt; that helped me complete this task.&lt;/p&gt;</description>
         <author>Troy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-7716316.post-4844374802467762405</guid>
         <pubDate>Mon, 02 Jul 2012 12:51:00 +0000</pubDate>
      </item>
      <item>
         <title>Simple jquery form in cfwheels</title>
         <link>http://flexicons.blogspot.com/2012/06/simple-jquery-form-in-cfwheels.html</link>
         <description>Quite often I find myself needing a simple contact form in my main layout. I want the form available on all pages, and I don't want a page refresh when the form is submitted. It needs some simple validation too.   So here's how I accomplish that.  First I build a form in the layout.  &lt;br /&gt; The important parts of the form are: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;The form and all elements have id's&lt;/li&gt;&lt;li&gt;There are labels after form fields that need validation&lt;/li&gt;&lt;/ul&gt;Make sure you include jquery in the head of your layout  &lt;br /&gt;&lt;br /&gt;Okay, so now let's add some jquery. We have a lot going on here so I tried to put good notes in the script. The important thing to remember here is that on the ajax submission it's very important that you append ?format=json on the end of the url. &lt;br&gt;&lt;br&gt;Now let's enable json in cfwheels.  &lt;br&gt;&lt;br&gt;Just go to your contacts controller, and in your init function, add the provides function that our cfwheels developers have provided for us. &lt;br&gt;&lt;br&gt;  Now we'll use the renderWith() function when we create our method.  &lt;br&gt;&lt;br&gt;So all that remains is to handle the form submission in a controller action.  &lt;br&gt;&lt;br&gt; The action should be self explanatory. We are taking the form fields and saving them to the database and sending out an email if the save is successful.  If you want to use wheels to validate your email field, you could put validation in the model, and then send back the error message.  &lt;br&gt;&lt;br&gt;Couple of notes. Doing it this way, I don't get isJSON to equal true. If I stringify the form fields, then isJSON equals true but then I can't figure out how to pull out my individual form fields. Also, make sure you turn off debugging in ColdFusion to see the response. Otherwise, you won't see it. &lt;br&gt;&lt;br&gt;So anyway, this works for me for now. Would appreciate any comments or suggestions to make it easier!</description>
         <author>Cathy Shapiro</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-140258686176088525.post-4309018438264581277</guid>
         <pubDate>Mon, 11 Jun 2012 08:47:00 +0000</pubDate>
      </item>
      <item>
         <title>Automated Testing with CFWheels, Jenkins &amp; Ant Tutorial</title>
         <link>http://chapmandu.com/2012/05/25/automated-testing-with-cfwheels-jenkins-ant/</link>
         <description>Automated Testing / Continuous Integration sounds complex and intimidating, but its like brain surgery.. its not that hard once you know the concepts and how the different elements fit together. Well maybe brain surgery wasn&amp;#8217;t such a good example.. but &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2012/05/25/automated-testing-with-cfwheels-jenkins-ant/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=98&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=98</guid>
         <pubDate>Fri, 25 May 2012 00:13:47 +0000</pubDate>
         <content:encoded><![CDATA[<p>Automated Testing / Continuous Integration sounds complex and intimidating, but its like <a rel="nofollow" target="_blank" href="http://ecx.images-amazon.com/images/I/51GDRKVHCRL._SL500_AA300_.jpg">brain surgery</a>.. its not that hard once you know the concepts and how the different elements fit together. Well maybe brain surgery wasn&#8217;t such a good example.. but you get the idea. Just think of a CI server as a fancy scheduled task manager.. with a few extra bits &amp; pieces bolted on.</p>
<p>One of my pet projects this year has been to completely automate the testing and build of a CFWheels application. This guide is a bare-bones, no-frills installation to get you up and running. Assuming you already have written your unit tests, you should be able to get this up and running in under an hour.</p>
<p>There are many ways to skin this cat, but for this example I have used Jenkins as the CI server, Git as the version control system and Ant to do the builds. All elements are open source, so you can get up and running for zero dollars. I&#8217;m sure there are arguments for or against these choices and it&#8217;s quite possible to substitute any of them with your preferred method. There are an extensive array of plugins available for different source control flavours and build &#8216;tools&#8217; (Ant, Maven, Command Line). My installation is on a 64bit version of Windows 7 using default installation paths.</p>
<p>Ideally, you would have a dedicated CI server which has its own application server (ColdFusion/Railo) and database. This is not essential.. in fact, my working example was installed on my laptop.. the only drawback with having the installation on your development machine, it that you will have to deploy your app to your webroot using a different foldername. Eg: &#8220;{webroot}/wheelsapp&#8221; source code will have to be deployed to &#8220;{webroot}/wheelsorama&#8221; so it can be tested without affecting your source code.</p>
<p>If you wanted to make your configuration even simpler, you could remove the Git repository configuration, and just run the unit tests directly on your source code.. but this is not ideal. * <strong>Be VERY careful</strong> with taking this approach as the example build script deletes the destination app folder before each deployment.. and that would be bad mmkay.</p>
<p>The example below will enable you to test your application, your plugins, the core wheels framework or a combination of the three (see the build.xml file).</p>
<p><strong>Software Installation</strong></p>
<p>As a general rule, I have install all software in their default locations, as you will see in the Jenkins configuration steps.</p>
<p>1. Install <a rel="nofollow" target="_blank" href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java JDK</a><br />
2. Install <a rel="nofollow" target="_blank" href="http://ant.apache.org/bindownload.cgi">Ant</a> (I recommend <a rel="nofollow" target="_blank" href="http://code.google.com/p/winant/">Winant</a> if you&#8217;re on Windows)<br />
3. Install <a rel="nofollow" target="_blank" href="http://git-scm.com/download">Git</a><br />
4. Install <a rel="nofollow" target="_blank" href="http://jenkins-ci.org/">Jenkins</a></p>
<p>Windows users may need to re-boot (surprise surprise!) if the Jenkins service is not running (Check your Windows Services to confirm), if the service still fails to start, you may need to execute this from a command prompt (Run as administrator) An inconvenient workaround!</p>
<pre>cd C:&#92;Program Files (x86)&#92;Jenkins
java -jar jenkins.war --ajp13Port=8010</pre>
<p>5 .Visit your Jenkins server at <a rel="nofollow" target="_blank" href="http://localhost:8080">http://localhost:8080</a> (or port 8010 if you had to start Jenkins via the command prompt)</p>
<p>You should have a brand-spanking new Jenkins server with which to unleash your automated <a rel="nofollow" target="_blank" href="http://www.honcho-sfx.com/Images/Products/jules_bk_wh_cl.jpg">wrath</a>!</p>
<p><img class="alignleft size-full wp-image-163" title="Clean Jenkins" src="http://chapmanic.files.wordpress.com/2012/05/cleanjenkins.jpg?w=584&#038;h=284" alt="" width="584" height="284"/></p>
<p><strong>Configure Jenkins</strong></p>
<p>1. Click &#8220;Manage Jenkins&#8221; &gt; &#8220;Manage Plugins&#8221; &gt; &#8220;Available&#8221; Tab<br />
2. Find the Git Plugin and install it<br />
3. Click the &#8220;Installed&#8221; tab and ensure you have the Git and Ant plugins. (Ant plugin should be bundled with the Jenkins install)<br />
<img class="alignleft size-full wp-image-164" title="InstalledPlugins" src="http://chapmanic.files.wordpress.com/2012/05/installedplugins.jpg?w=584&#038;h=301" alt="" width="584" height="301"/></p>
<p>4. Return to the Jenkins dashboard and click &#8220;Manage Jenkins&#8221; &gt; &#8220;Configure System&#8221;<br />
5. In the JDK section, uncheck the &#8220;Install automatically&#8221; option and enter a name and the path to your JDK folder.<br />
<img class="alignleft size-full wp-image-171" title="JDKSetup" src="http://chapmanic.files.wordpress.com/2012/05/jdksetup1.jpg?w=584&#038;h=156" alt="" width="584" height="156"/></p>
<p>6. In the Git section, uncheck the &#8220;Install automatically&#8221; option and enter the path to your git executable<br />
<img class="alignleft size-full wp-image-172" title="GitSetup" src="http://chapmanic.files.wordpress.com/2012/05/gitsetup1.jpg?w=584&#038;h=166" alt="" width="584" height="166"/></p>
<p>7. In the Ant section, click the &#8220;Add Ant&#8221; button, uncheck the &#8220;Install automatically&#8221; option and enter a name and the path to your Ant folder (or WinAnt if installed).<br />
<img class="alignleft size-full wp-image-173" title="AntSetup" src="http://chapmanic.files.wordpress.com/2012/05/antsetup1.jpg?w=584&#038;h=166" alt="" width="584" height="166"/></p>
<p><strong>Create your Job</strong></p>
<p>1. Return to the Jenkins dashboard and click &#8220;New Job&#8221;<br />
2. Enter a job name and select &#8220;Build a free-style software project&#8221;<br />
<img class="alignleft size-full wp-image-174" title="NewJob" src="http://chapmanic.files.wordpress.com/2012/05/newjob1.jpg?w=584&#038;h=259" alt="" width="584" height="259"/></p>
<p>3. Under the &#8220;Source Code Management&#8221; section, check the &#8220;Git&#8221; option<br />
4. Specify your app&#8217;s Git repository. If you are unfamiliar with this, it&#8217;s time to <a rel="nofollow" target="_blank" href="http://git-scm.com/book/en/Getting-Started">click here</a>. This can be a local path, a network path or an ssh address.<br />
<img class="alignleft size-full wp-image-175" title="JobGitRepo" src="http://chapmanic.files.wordpress.com/2012/05/jobgitrepo1.jpg?w=584&#038;h=130" alt="" width="584" height="130"/></p>
<p>5. Under the &#8220;Build Triggers&#8221; section, choose your preferred build interval. I like to have Jenkins poll my SCM (Git repository)  for changes every few minutes and build automatically if it finds any commits since the last build. */5 * * * * means every 5 minutes.. Click on the help icon for more info about intervals.<br />
<img class="alignleft size-full wp-image-176" title="JobBuildTriggers" src="http://chapmanic.files.wordpress.com/2012/05/jobbuildtriggers.jpg?w=584&#038;h=176" alt="" width="584" height="176"/></p>
<p>6. Under the build section, click the &#8220;Add Build Step&#8221; button and select the &#8220;Invoke Ant&#8221; option. Select the &#8220;Default Ant&#8221; configuration you added earlier. Since we will be using the default Ant convention (using build.xml), this is all that&#8217;s required.. but more about that shortly.<br />
<img class="alignleft size-full wp-image-179" title="JobAnt" src="http://chapmanic.files.wordpress.com/2012/05/jobant.jpg?w=584&#038;h=136" alt="" width="584" height="136"/></p>
<p>7. In the Post-build action section, click the &#8220;Add post-build action&#8221; button and select the &#8220;Publish JUnit test result report&#8221; option. Specify where your unit test result xml files will be written to. In this case <code>build-report/test_result_*.xml</code>, a folder called build-report with the files being called test_result_{something}.xml. Don&#8217;t worry too much about any warning messages here.. as the folders don&#8217;t exist yet.<br />
<img class="alignleft size-full wp-image-180" title="JobPublishJUnit" src="http://chapmanic.files.wordpress.com/2012/05/jobpublishjunit.jpg?w=584&#038;h=163" alt="" width="584" height="163"/></p>
<p><strong>Prepare your Wheels app </strong><br />
There are a few steps here..</p>
<ul>
<li>Initialise your wheels app as a Git repository</li>
<li>Download the <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/83">JUnify</a> Wheels plugin (the most dangerous plugin in the <a rel="nofollow" target="_blank" href="http://a8.sphotos.ak.fbcdn.net/hphotos-ak-ash3/p480x480/564311_10151121451458572_1796112147_n.jpg">galaxy</a>) which will return your unit tests in JUnit format (Ties in very nicely with Jenkins)</li>
<li>(Optional) Download the <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/28">DBMigrate </a>plugin for making automated database changes during the build</li>
<li>Now we need to tell Ant what to do to build and test your app. We will do this by creating 2 files in your app&#8217;s root folder. The 2 files are ant.properties and build.xml. ant.properties is for setting variables for use in build.xml. build.xml tells Ant what to do. * You will most likely need to modify the ant.properties file to suit your environment</li>
</ul>
<p><strong>ant.properties</strong></p>
<pre>
# for running start/stop bat files
railo_bin=C:/railo/tomcat/bin
# cf_bin=C:/ColdFusion9/bin
# your webroot.. where jenkins will deploy your code (Apache/IIS)
web_root_dir=C:/railo/tomcat/webapps/ROOT
# web_root_dir=C:/inetpub/wwwroot
# where jenkins will git pull your code.. then deploy from
jenkins_workspace_dir=C:/Program Files (x86)/Jenkins/jobs/Wheels-O-Rama Deploy/workspace
# where jenkins will deploy to
destination_app_dir=${web_root_dir}/wheelsorama
# where unit test results will be written to
build_report_dir=${jenkins_workspace_dir}/build-report
# your app's url
app_root_url=http://localhost:8888/wheelsorama/index.cfm
# the unit test base url
unit_test_url=${app_root_url}?controller=JUnify&amp;amp;action=index&amp;amp;
</pre>
<p><strong>build.xml</strong></p>
<pre>
&lt;project default=&quot;initialize&quot;&gt;

	&lt;!-- this is the default target (function) --&gt;
	&lt;target name=&quot;initialize&quot;&gt;

		&lt;!-- import properties --&gt;
		&lt;property file=&quot;ant.properties&quot; /&gt;

		&lt;!-- stop railo service.. not always needed! --&gt;
		&lt;!-- &lt;exec dir=&quot;${railo_bin}&quot; executable=&quot;cmd&quot; os=&quot;Windows NT&quot;&gt;
			&lt;arg line=&quot;shutdown.bat&quot;/&gt;
		&lt;/exec&gt; --&gt;

		&lt;!-- once jenkins has pulled the code into its workspace, i want to delete the previous deployment, but keeping root folder --&gt;
		&lt;mkdir dir=&quot;${destination_app_dir}&quot; /&gt;
		&lt;delete includeemptydirs=&quot;true&quot;&gt;
			&lt;fileset dir=&quot;${destination_app_dir}&quot; includes=&quot;**/*&quot; /&gt;
		&lt;/delete&gt;

		&lt;!-- then get a fresh copy of the latest code into the webroot for testing --&gt;
		&lt;copy todir=&quot;${destination_app_dir}&quot;&gt;
	    	&lt;fileset dir=&quot;${jenkins_workspace_dir}&quot;/&gt;
	    	&lt;!-- exclude any files you don't want/need --&gt;
	    	&lt;!-- &lt;exclude name=&quot;**/.gitignore&quot;/&gt; --&gt;
	    	&lt;!-- &lt;exclude name=&quot;**/*.php&quot;/&gt; --&gt;
	    	&lt;!-- &lt;exclude name=&quot;**/*.asp&quot;/&gt; --&gt;
		&lt;/copy&gt;

		&lt;!-- make a folder in the workspace to keep my build reports --&gt;
		&lt;mkdir dir=&quot;${build_report_dir}&quot; /&gt;

		&lt;!-- start railo service --&gt;
		&lt;!-- &lt;exec dir=&quot;${railo_bin}&quot; executable=&quot;cmd&quot; os=&quot;Windows NT&quot;&gt;
			&lt;arg line=&quot;startup.bat&quot;/&gt;
		&lt;/exec&gt; --&gt;

		&lt;!-- migrate database using a call to the dbmigrate plugin url --&gt;
		&lt;!-- &lt;get src=&quot;${app_root_url}?controller=wheels&amp;amp;action=wheels&amp;amp;view=plugins&amp;amp;name=dbmigrate&amp;amp;password=yourpassword&amp;amp;migrateToVersion=999999999&quot; dest=&quot;${build_report_dir}&#92;dbmigrate_result.html&quot; /&gt; --&gt;

		&lt;!-- make a get request to your unit test url, writing the result to a file. Jenkins will use it to determine the success of your build
			== possible type param values ==
			# type=app		: runs the tests in /myapp/tests
			# type={myplugin}	: runs the tests in /myapp/plugins/{myplugin}/tests
			# type=core		: runs the tests in /myapp/wheels/tests
		--&gt;
		&lt;get src=&quot;${unit_test_url}type=app&quot; dest=&quot;${build_report_dir}&#92;test_result_app.xml&quot; /&gt;
		&lt;!-- &lt;get src=&quot;${unit_test_url}type=myplugin&quot; dest=&quot;${build_report_dir}&#92;test_result_myplugin.xml&quot; /&gt; --&gt;
		&lt;!-- &lt;get src=&quot;${unit_test_url}type=core&quot; dest=&quot;${build_report_dir}&#92;test_result_core.xml&quot; /&gt; --&gt;

	&lt;/target&gt;

&lt;/project&gt;
</pre>
<p><strong>Unit Tests</strong></p>
<p>This is the final piece of the puzzle. The Wheels team have done a great job <a rel="nofollow" target="_blank" href="http://code.google.com/p/cfwheels/wiki/TestingFramework">documenting</a> unit testing your app using the Wheels test framework, and there is a post by someone about <a rel="nofollow" title="CFWheels Plugins and My Unit Testing&#xa0;Adventures!" target="_blank" href="http://chapmandu.com/2012/04/03/cfwheels-plugins-and-my-unit-testing-adventures/">unit testing your plugins</a>.. So get on it.</p>
<p><strong>Build your app</strong></p>
<p>Now that you are all configured and unit tests written.. its time to build! Click on the &#8220;Wheels-O-Rama Deploy&#8221; job then in the left menu click &#8220;Build Now&#8221;. You should see a progress bar appear under the menu.. it should either return a blue (<a rel="nofollow" target="_blank" href="http://i.crackedcdn.com/phpimages/topic-frontend/2/3/1/79231_v1.jpg">good</a>) or red (<a rel="nofollow" target="_blank" href="http://upload.wikimedia.org/wikipedia/en/thumb/7/76/Michael_jackson_bad_cd_cover_1987_cdda.jpg/220px-Michael_jackson_bad_cd_cover_1987_cdda.jpg">bad</a>) icon. If you mouseover the build link and click the &#8220;Console Output&#8221; link you will see the output that was produced by Jenkins &amp; Ant. You can watch the console output in real time by clicking the link whilst the build is in progress. If the build fails, this is where you will find the clues to its resolution.</p>
<p><strong>Umm.. so WTF is actually happening?</strong></p>
<p>I&#8217;m glad you asked..</p>
<ul>
<li>Jenkins polls your Git repository looking for commits</li>
<li>When a commit it found, it will pull your source code into its workspace</li>
<li>Jenkins will use Ant to run your build.xml file which will&#8230;
<ul>
<li>Delete the previous code deployment from your webroot</li>
<li>Copy the latest source code from Jenkins workspace into your webroot</li>
<li>Call your unit tests via a URL and write the results to the Jenkins workspace</li>
</ul>
</li>
<li>Jenkins will analyse the unit test results</li>
<li>Jenkins will report whether the build passed or failed</li>
</ul>
<p><strong>Where to from here?</strong></p>
<p>This post is really just a minimal working example of automated testing. Here are a few ideas to play around with:</p>
<ul>
<li>Setup a post build action to alert you of build failures</li>
<li>Break the existing job into separate &#8220;Deploy&#8221; and &#8220;Test&#8221; jobs (using a &#8220;Post Build Action&#8221; to kick off the Test job)</li>
<li>Build and test with different CFML engines, CFWheels framework versions and database engines for wide compatibility</li>
<li>Use the dbmigrate plugin to automatically make database changes upon building (See build.xml example)</li>
<li>Create another job that uses Ant to FTP your successful build to your production server</li>
<li>Use <a rel="nofollow" target="_blank" href="http://seleniumhq.org/">Selenium</a> to do automated functional browser testing</li>
<li>Push your successful build to GitHub</li>
<li>Extending Jenkins further with the smorgasbord of plugins. The <a rel="nofollow" target="_blank" href="https://wiki.jenkins-ci.org/display/JENKINS/ChuckNorris+Plugin">Chuck Norris</a> plugin is a favourite of mine!</li>
</ul>
<p>Feel free to comment regarding your experiences using this guide.. Thanks for reading!</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/98/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=98&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/cleanjenkins.jpg">
            <media:title type="html">Clean Jenkins</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/installedplugins.jpg">
            <media:title type="html">InstalledPlugins</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/jdksetup1.jpg">
            <media:title type="html">JDKSetup</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/gitsetup1.jpg">
            <media:title type="html">GitSetup</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/antsetup1.jpg">
            <media:title type="html">AntSetup</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/newjob1.jpg">
            <media:title type="html">NewJob</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/jobgitrepo1.jpg">
            <media:title type="html">JobGitRepo</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/jobbuildtriggers.jpg">
            <media:title type="html">JobBuildTriggers</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/jobant.jpg">
            <media:title type="html">JobAnt</media:title>
         </media:content>
         <media:content medium="image" url="http://chapmanic.files.wordpress.com/2012/05/jobpublishjunit.jpg">
            <media:title type="html">JobPublishJUnit</media:title>
         </media:content>
      </item>
      <item>
         <title>JUnify Plugin for CFWheels</title>
         <link>http://chapmandu.com/2012/05/05/junify-plugin-for-cfwheels/</link>
         <description>Make the CFWheels test framework return jUnit XML JUnify will run your CFWheels unit tests, then return the results in jUnit formatted XML. Use it for automated testing with your Continuous Integration server. Following the road to jUnit Glory Download &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2012/05/05/junify-plugin-for-cfwheels/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=131&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=131</guid>
         <pubDate>Sat, 05 May 2012 06:01:06 +0000</pubDate>
         <content:encoded><![CDATA[<p>Make the <a rel="nofollow" target="_blank" href="http://cfwheels.org/">CFWheels</a> test framework return jUnit XML</p>
<p>JUnify will run your <a rel="nofollow" target="_blank" href="http://code.google.com/p/cfwheels/wiki/TestingFramework">CFWheels unit tests</a>, then return the results in jUnit formatted XML. Use it for automated testing with your <a rel="nofollow" target="_blank" href="http://jenkins-ci.org/">Continuous Integration</a> server.</p>
<p><strong>Following the road to jUnit Glory</strong></p>
<ul>
<li>Download and install the JUnify plugin from <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/83">CFWheels </a>or <a rel="nofollow" target="_blank" href="https://github.com/chapmandu/junify-cfwheels-plugin">GitHub</a></li>
<li>Create a JUnifyController.cfc controller that calls the JUnify() function*</li>
<li>Write some unit tests for your app or plugin</li>
<li>Make a call to your JUnify url</li>
</ul>
<p>* Controller filename and action names are unimportant</p>
<p><strong>JUnifyController.cfc</strong></p>
<pre>
&lt;cfcomponent extends=&quot;Controller&quot;&gt;
	
	&lt;cffunction name=&quot;index&quot;&gt;
		&lt;cfset JUnify(params)&gt;
	&lt;/cffunction&gt;
		
&lt;/cfcomponent&gt;
</pre>
<p><strong>Your JUnify URL</strong><br />
<a rel="nofollow" target="_blank" href="http://yourserver/index.cfm?controller=junifycontroller&#038;action=index&#038;type=app">http://yourserver/index.cfm?controller=junifycontroller&#038;action=index&#038;type=app</a></p>
<p>Pay particular attention to the type parameter.<br />
&#8211; type=app will run tests for your application<br />
&#8211; type=myplugin will run tests for your plugin<br />
&#8211; type=core will run tests for the CFWheels framework itself</p>
<p>Props to <a rel="nofollow" target="_blank" href="http://rocketboots.com.au">Rocketboots</a> for their RocketUnit test framework</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/131/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=131&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>DatePicker Plugin for CFWheels</title>
         <link>http://chapmandu.com/2012/05/05/datepicker-plugin-for-cfwheels/</link>
         <description>Use a jQuery UI datePicker widget in your CFWheels forms datePicker and datePickerTag functions accept the same arguments as CFWheels textField and textFieldTag functions respectively, but they also accept all options for the jQuery datePicker widget Following the road to &amp;#8230; &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://chapmandu.com/2012/05/05/datepicker-plugin-for-cfwheels/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://pixel.wp.com/b.gif?host=chapmandu.com&amp;#038;blog=27782653&amp;#038;post=120&amp;#038;subd=chapmanic&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://chapmandu.com/?p=120</guid>
         <pubDate>Sat, 05 May 2012 05:46:47 +0000</pubDate>
         <content:encoded><![CDATA[<p>Use a jQuery UI <a rel="nofollow" target="_blank" href="http://jqueryui.com/demos/datepicker/">datePicker</a> widget in your CFWheels forms</p>
<p>datePicker and datePickerTag functions accept the same arguments as CFWheels textField and textFieldTag functions respectively, but they also accept all options for the jQuery datePicker widget</p>
<p><strong>Following the road to DatePicker Glory</strong></p>
<p>1. Install the DatePicker plugin from <a rel="nofollow" target="_blank" href="http://cfwheels.org/plugins/listing/82">CFWheels</a> or <a rel="nofollow" target="_blank" href="https://github.com/chapmandu/datepicker-cfwheels-plugin">GitHub</a><br />
2. Make sure you have setup jQuery AND jQuery UI in your app (consider my <a rel="nofollow" target="_blank" href="http://chapmandu.com/2012/04/03/jquack-for-jquery-cfwheels-plugin/" title="JQuack for jQuery CFWheels&#xa0;Plugin">JQuack plugin</a>)<br />
3. Use the <code>datePicker()</code> and <code>datePickerTag()</code> form helpers</p>
<p><strong>Examples</strong></p>
<pre>
&lt;!--- Use with objects ---&gt;
#datePicker(label=&quot;Birthday&quot;, objectName=&quot;user&quot;, property=&quot;birthday&quot;)#

&lt;!--- Use without objects ---&gt;
#datePickerTag(label=&quot;Birthday&quot;, name=&quot;birthday&quot;, value=Now())#
</pre>
<p>Note: All jQuery specific arguments (jQuery datePicker options) are case-sensitive</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/chapmanic.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chapmanic.wordpress.com/120/"/></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=chapmandu.com&#038;blog=27782653&#038;post=120&#038;subd=chapmanic&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="http://1.gravatar.com/avatar/a47432c17792247e305cde5689823425?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">adamc1974</media:title>
         </media:content>
      </item>
      <item>
         <title>Beating the Flying Spaghetti Code Monster with CFWheels - Part 2</title>
         <link>http://talltroym.blogspot.com/2011/12/beating-flying-spaghetti-code-monster_11.html</link>
         <description>&lt;img alt=&quot;Beating the Spaghetti Code Monster&quot; height=&quot;210&quot; src=&quot;http://4.bp.blogspot.com/_vNxb90bzAdg/S8LTQXN2W6I/AAAAAAAAA3g/jd6LdODCjYo/s1600/COTT.jpg&quot; width=&quot;150&quot;/&gt;&lt;br /&gt;
&lt;h2 id=&quot;recap&quot;&gt;
Recap&lt;/h2&gt;
As I mentioned in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://talltroym.blogspot.com/2011/12/beating-flying-spaghetti-code-monster.html&quot;&gt;part 1&lt;/a&gt; of this post, when I started writing web applications with ColdFusion I quickly amassed a large collection of autonomous files that would often break if I changed a variable or parameter that should be passed into the next. Adding or removing a column to a form / database table could take 25 minutes to update all of the SQL files. I had become enslaved to the “Flying Spaghetti Code Monster”, as I like to call it, and knew there was a better way and wanted to find it.&lt;br /&gt;
&lt;h2 id=&quot;theapplication&quot;&gt;
The Application&lt;/h2&gt;
As I also mentioned in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://talltroym.blogspot.com/2011/12/beating-flying-spaghetti-code-monster.html&quot;&gt;part 1&lt;/a&gt;, I had been re-hired to maintain and update a web application I wrote 7 years prior. This application had well over 350 individual files and the folder size was near 80MB. Although I had started to use the Fusebox framework, which helped start to organize my files, I didn’t follow-through on converting everything to Fusebox. This meant that my directory structure looked something like this&lt;br /&gt;
&lt;img alt=&quot;Spaghetti Code Directories&quot; height=&quot;500&quot; src=&quot;http://farm8.staticflickr.com/7147/6495974383_f23c158372.jpg&quot; width=&quot;378&quot;/&gt;&lt;br /&gt;
&lt;h2 id=&quot;conversion&quot;&gt;
Conversion&lt;/h2&gt;
As also mentioned in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://talltroym.blogspot.com/2011/12/beating-flying-spaghetti-code-monster.html&quot;&gt;part 1&lt;/a&gt; of this post that I decided to slowly convert the application to the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;Coldfusion on Wheels&lt;/a&gt; framework. I decided to do this cutting off one “tenticle” at a time, or one section/feature at a time.&lt;br /&gt;
First I identified a small section of the application that I could replace with the CFWheels framework. I selected one of the “system options” that allows users to add new values to a drop-down list of patient types. The code for this was located off the root of my application in a /system folder along 15 other similiar system options that were almost identifcal. I also needed a place to put my CFWheels core files.&lt;br /&gt;
I decided to put the CFWheels framework files in a directory named “hla”, which is the web application name as referred to by the staff, under the /system folder, so /system/hla/&lt;br /&gt;
&lt;img alt=&quot;CFWheels framework location&quot; height=&quot;389&quot; src=&quot;http://farm8.staticflickr.com/7153/6495974889_96c00fbaec.jpg&quot; width=&quot;500&quot;/&gt;&lt;br /&gt;
I setup my database connection info in the /conf/settings.cfm file so that my database connection would be the same as the spaghetti code portion. Next, I didn’t want to have two sets of Javascript, CSS or other asset files like images, so I had to modify my CFWheels layout.cfm file to reference the ones that the spaghetti code files were using.&lt;br /&gt;
&lt;img alt=&quot;layout.cfm&quot; height=&quot;420&quot; src=&quot;http://farm8.staticflickr.com/7174/6496109573_3b26bbca3e.jpg&quot; width=&quot;500&quot;/&gt;&lt;br /&gt;
At this point I could browse to the CFWheels portion, by manually entering the URL, and receive the default CFWheels welcome page. I then added a new entry on my system options menu to point to the new CFWheels location where the system option I was going to convert would live.&lt;br /&gt;
At this point I created a model file, Patiettype.cfc, and in the init function I added code to specify my database table names that didn’t follow the Wheels convention, but were used by the Spaghetti Code application&lt;br /&gt;
&lt;code&gt; &amp;lt;cfset table(&quot;tbl_authors&quot;)&amp;gt; &lt;/code&gt;&lt;br /&gt;
Next I followed with each database table column as a property, using the current database column name for the column attribute but a CFWheels convention name for the name attribute, as outlined in the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/docs/1-1/chapter/object-relational-mapping&quot;&gt;CFWheels documentation&lt;/a&gt;.&lt;br /&gt;
&lt;code&gt; &amp;lt;cfset property(name=&quot;firstName&quot;, column=&quot;tbl_auth_f_name&quot;)&amp;gt; &lt;/code&gt;&lt;br /&gt;
These system options required that I setup some &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/docs/1-1/chapter/associations&quot;&gt;associations&lt;/a&gt;, and this was a great place to learn about that as I’d need it for every other part of the application.&lt;br /&gt;
At this point I could follow the CFWheels conventions and develop the CRUD for the Patienttype just like I would a brand new CFWheels app. After I have the CRUD working for this system option, I’d then remove the link to the old files and leave just the new one. Then I’d have the users work with that section for about a week. Once we were sure everything worked correctly, I’d slowly remove the old files (that I now had in Git version control).&lt;br /&gt;
Using this same method I slowly worked through all of the 16 system options, as if cutting off one “tenticle” of the Spaghetti Monster at a time. After I finished with those small, simple CRUD actions, I moved onto more complicated sections. The whole Contacts portion, then Hospitals portion, etc.&lt;br /&gt;
&lt;h2 id=&quot;progress&quot;&gt;
Progress&lt;/h2&gt;
I found the Coldfusion on Wheels framework in February 2011, then started implementing it in March 2011, working part-time and slowly through each of the tenticles I mentioned. If new features were requested, or something needed to be changed, I fought the urge to do a “quick and easy” one or two file solution and forced myself to do it the CFWheels way. At first this was challenging, but once I got use to it, the changes happened faster.&lt;br /&gt;
At this point, December 2011, I’ve removed at least 23 of these “tenticles” with two medium sized tenticles and one large tenticle left to remove from the monster. I’m excited to finish these sections off and sever the head of this monster once and for all. In hindsight I’m glad I started with smaller tenticles as it allowed me to learn CFWheels with smaller sections of code, but also to find “gotchas” early on.&lt;br /&gt;
&lt;h2 id=&quot;gotchas&quot;&gt;
Gotchas&lt;/h2&gt;
One of the things I didn’t expect was the Spaghetti Monsters session scope being overwritten when I moved went to a CFWheels framework page. This made it a little tricky because I’d use the session scope to retain the currently logged in user ID and if they were a valid user or not (to prevent unauthorized access). After I’d leave a CFWheels page and go back to the Spaghetti Monster code I’d be kicked out of my application. My “fix” for this, at least for the time being, was to use client variables for the Spaghetti code portion of the application and session variables for the CFWheels portion of the application.&lt;br /&gt;
The next thing I ran into, since my session scope was being overwritten, was once I moved to a CFWheels portion of the application I’d didn’t have my session variable with the user ID from the Spaghetti Monster code. To fix this I added an obtuse URL variable on the menu links in the Spaghetti Monster code that CFWheels would then use to identify the user and create the session scope variables I wanted.&lt;br /&gt;
&lt;h2 id=&quot;summary&quot;&gt;
Summary&lt;/h2&gt;
I feel converting this application to the CFWheels framework has helped with the following:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Brought some sanity back to how this application is structured and maintained (huge benefit)&lt;/li&gt;
&lt;li&gt;Saved gobs of time not having to maintain query files with endless CFIF statements and cfqueryparam tags (CFWheels ORM does that all for me, huge benefit)&lt;/li&gt;
&lt;li&gt;Made the application run faster, I mean noticably faster to my users&lt;/li&gt;
&lt;li&gt;Decreased the code folder from 80MB to 33MB&lt;/li&gt;
&lt;li&gt;Allows me to add new features or make changes in less time then before because things break less when changes are made&lt;/li&gt;
&lt;li&gt;Allows anyone that knows about the MVC pattern to help or take over this application&lt;/li&gt;
&lt;li&gt;Made Coldfusion programming fun again (most important of course)&lt;/li&gt;
&lt;/ol&gt;
While converting this application from the Spaghetti code to the CFWheels framework from “the inside out” has been a slow process (because of my, not the framework), I don’t regret doing it at all for the reasons stated above. It’s been a great way to learn CFWheels and to work with the CFWheels community. At this point I can’t imagine developing Coldfusion applications without using the CFWheels framework.</description>
         <author>Troy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-7716316.post-6856710574461759317</guid>
         <pubDate>Sun, 11 Dec 2011 21:49:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/_vNxb90bzAdg/S8LTQXN2W6I/AAAAAAAAA3g/jd6LdODCjYo/s72-c/COTT.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Beating the Flying Spaghetti Code Monster with CFWheels - Part 1</title>
         <link>http://talltroym.blogspot.com/2011/12/beating-flying-spaghetti-code-monster.html</link>
         <description>&lt;img alt=&quot;Flying Spaghetti Code Monster&quot; id=&quot;flyingspaghetticodemonster&quot; src=&quot;http://s3-2.kiva.org/img/w800/196261.jpg&quot; title=&quot;Flying Spaghetti Code Monsterr&quot;/&gt;&lt;br /&gt;
&lt;h2 id=&quot;background&quot;&gt;
Background&lt;/h2&gt;
I started writing web application using Coldfusion in 2000 with version 4.5.  Like probably most of us back in those early days, we had one hand on the keyboard and a copy of &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.forta.com/books/032151548x/&quot;&gt;Ben Forta’s Web Application Contrution Kit (WACK)&lt;/a&gt; in the other.  My development of applications consisted of creating a single autonomous file, with both database queries and conditional display code.  This of course was tied to yet another autonomous which did the same, etc, etc, etc.  Thus the “Flying Spaghetti Code Monster” Even after I started to use the Application.cfm “framework” within ColdFusion, I still had all of these autonomous files that would often break if I changed a variable or parameter that should be passed into the next.&lt;br /&gt;
After developing a few applications like this I realized there had to be a better way.  Somehow I came across the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fusebox.org/&quot;&gt;Fusebox&lt;/a&gt; 2 framework and started to look into it.  This framework encouraged you to break the application up into separate files, query file, action file, display file, and then “chain” these together like fuses in an electrical circuit.  &lt;br /&gt;
Shortly after &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fusebox.org/&quot;&gt;Fusebox&lt;/a&gt; version 3 was released and I begin using this framework to develop my applications.  I especially loved the formurl2attributes function that put all of your url and form variables into a single scope.  I &lt;em&gt;started&lt;/em&gt; to convert small pieces of my existing applications from my spaghetti code to organized code following the Fusebox methodology, however I ended up sticking more with the file naming then actually using the framework after a while.  When &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fusebox.org/&quot;&gt;Fusebox&lt;/a&gt; version 4 was released I found it difficult to grasp, as well as the CFC concept that was brand new.  My two and a half years of part-time web application programming was coming to a close though as I left to work full-time as a systems administrator.&lt;br /&gt;
Over the next 7 years the largest of the web applications I wrote, a Laboratory Information System (LIS), continued to work for the University lab I wrote it for with minimal adjustments to it.  &lt;br /&gt;
&lt;h2 id=&quot;backtodeveloping&quot;&gt;
Back to Developing&lt;/h2&gt;
At the end of those 7 years I was hired back, part-time, for this same lab, and part-time for another lab (so it’s a full-time position) on campus.  When I looked at this old source code I saw the “Flying Spaghetti Code Monster” glaring back at me.  I had well over 350 individual files and the folder size was near 80MB, not to mention &lt;em&gt;no&lt;/em&gt; source control software to help manage it.  I knew there had to be a better way to handle this, I didn’t want to continue to develop this way.&lt;br /&gt;
The first thing I did was get the software into a source control system.  Subversion was the choice as it was the easiest for me to grasp initially.  I went back to look at the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fusebox.org/&quot;&gt;Fusebox&lt;/a&gt; framework and saw it was still around, but it didn’t seem like many were using it any longer.  There was the Mach-II framework, but I couldn’t seem to understand that either.  In the meantime I continued to serve the hard master known as the “Flying Spaghetti Code Monster” and maintain the code as it was, even adding new features, without much difference in my development pattern.&lt;br /&gt;
After five months of developing this way I came across the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;ColdFusion on Wheels&lt;/a&gt; framework website, not sure how (probably Twitter).  After greedily consuming all of the available screencasts I &lt;em&gt;knew&lt;/em&gt; this was the way I needed to develop the application.  The question was, how do I learn the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;CFWheels&lt;/a&gt; framework and use it to power this application?  I saw two choices:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;start from scratch in a parallel environment using &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://cfwheels.org/&quot;&gt;CFWheels&lt;/a&gt; and recreate all of the functionality&lt;/li&gt;
&lt;li&gt;slowly, one “tenticle” at a time, battle the “Flying Spaghetti Code Monster” by converting a section to the CFWheels framework&lt;/li&gt;
&lt;/ol&gt;
After considering it I decided choice 2 was for me, to slowly convert the application.  In the following post I’ll explain how I’m doing this.</description>
         <author>Troy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-7716316.post-2410543748889088283</guid>
         <pubDate>Thu, 01 Dec 2011 20:18:00 +0000</pubDate>
      </item>
      <item>
         <title>Railo on IIS6 installation and configuration errors</title>
         <link>https://rip747.wordpress.com/2011/10/17/railo-on-iis6-installation-and-configuration-errors/</link>
         <description>railo is a great alternative to adobe&amp;#8217;s cfml server, but there lets face it&amp;#8230; it&amp;#8217;s a pain in the ass to get configured on iis6! rather then have you fight through all these errors, i&amp;#8217;ve documented the errors that not only i encountered during the setup, but also was able to create. hopefully this will [&amp;#8230;]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://pixel.wp.com/b.gif?host=rip747.wordpress.com&amp;#038;blog=295460&amp;#038;post=939&amp;#038;subd=rip747&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://rip747.wordpress.com/?p=939</guid>
         <pubDate>Tue, 18 Oct 2011 01:28:04 +0000</pubDate>
         <content:encoded><![CDATA[<p>railo is a great alternative to adobe&#8217;s cfml server, but there lets face it&#8230; it&#8217;s a pain in the ass to get configured on iis6! rather then have you fight through all these errors, i&#8217;ve documented the errors that not only i encountered during the setup, but also was able to create. hopefully this will save you from getting frustrated.</p>
<p>the following errors may happen when installing railo on IIS6 and visiting the site. (note: all paths assume that you installed railo to the c:&#92;railo directory)</p>
<h3>Error: Invalid function</h3>
<p>Cause: This happens when you haven&#8217;t chosen to install the iis connector or something screwed up in the installation of the iis connector. you can see this if you go into the C:&#92;railo&#92;connector&#92;isapi_redirect-1.2.31.properties and you see @@install_dir@@ in the file. those markers were suppose to be replaced with the directory you installed railo.</p>
<p>Fix: don&#8217;t just try to change these markers to the installation directory as they aren&#8217;t just in this file. the best bet is to run the installation again and make sure you check to install the iis connector.</p>
<h3>Error: The system cannot find the path specified.</h3>
<p>Cause: you forgot to configure the jakarta virtual directory for the site in iis.</p>
<p>Fix: go into iis and add a virtual directory called &#8220;jakarta&#8221; to the site experiencing the error. make sure to point it to the c:&#92;railo&#92;connector directory. Make sure to give the virtual directory &#8220;scripts and executables&#8221; permissions.</p>
<h3>Error: You get prompted to download the cfm file</h3>
<p>Cause: you forgot to give the jakarta virtual directory &#8220;scripts and executables&#8221; permissions.</p>
<p>Fix: give the jakarta virtual directory &#8220;scripts and executables&#8221; permissions.</p>
<h3>Error: you get a 404, page not found error (from IIS)</h3>
<p>Cause: you have not allowed unknown cgi and isapi extensions in IIS</p>
<p>Fix: click on the web server extenstions folder in iis admin. allow both unknown cgi extensions and unknown isapi extensions.</p>
<p>Cause: this could also be because the application extension aren&#8217;t configured for *.cfm extensions.</p>
<p>Fix: the railo installation instructions forgets to mention that you need to configure the site with application extensions for *.cfm extensions. go into the properties for the site and click the &#8220;home directory&#8221; tab. next click the &#8220;configuration&#8221; button next to where the execute permissions drop down is. on the next page, click the &#8220;add&#8221; button under the application extensions section. for the executable, browse to the  isapi_redirect dll located in the c:&#92;railo&#92;connector directory. for extension, enter in *.cfm. uncheck the &#8220;verify that file exists&#8221; checkbox. repeat this process for *.cfc if you site uses components.</p>
<p>PROTIP!!!!: if you want you can configure all the sites and future sites with these application extension by right clicking on the &#8220;web sites&#8221; folder and following the instructions above.</p>
<h3>Error: you get a railo missinginclude error</h3>
<p>Cause: you have configured the host section of server.xml wrong</p>
<p>Fix: most likely the cause is when you have misspelled an alias. make sure that all the aliases are spelled correctly and that the host section is configured properly.</p>
<h3>Error: Unspecified error</h3>
<p>Cause: you don&#8217;t have the isapi filter configured for your website.</p>
<p>Fix: the installation instructions for railo forget to mention that you need to configure an isapi filter for the website in order for railo to work. go into the properties of the site and click on the ispai filter tab. add a filter called &#8220;railo&#8221; and for the executable, point it to the isapi_redirect-X.dll located in the connector directory. so for 3.3.1 the path would be c:&#92;railo&#92;connector&#92;isapi_redirect-1.2.31.dll.</p><br />  <a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/rip747.wordpress.com/939/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rip747.wordpress.com/939/"/></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=rip747.wordpress.com&#038;blog=295460&#038;post=939&#038;subd=rip747&#038;ref=&#038;feed=1" width="1" height="1"/>]]></content:encoded>
         <media:content medium="image" url="https://0.gravatar.com/avatar/f09f0a0d45c19276540a9899d0e6b667?s=96&amp;amp;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96">
            <media:title type="html">rip747</media:title>
         </media:content>
      </item>
      <item>
         <title>Coda book for CFWheels // Stofke on wheels</title>
         <link>http://talltroym.blogspot.com/2011/07/coda-book-for-cfwheels-stofke-on-wheels.html</link>
         <description>&lt;div class=&quot;posterous_bookmarklet_entry&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://wheels.onebuttonapps.net/2010/09/coda-book-for-cfwheels/&quot;&gt;&lt;img class=&quot;posterous_download_image&quot; src=&quot;http://wheels.onebuttonapps.net/wp-content/uploads/2010/09/wpid-coda-2010-09-29-16-31.png&quot; border=&quot;0&quot; alt=&quot;&quot; width=&quot;497&quot; height=&quot;265&quot;/&gt;&lt;/a&gt;
&lt;div class=&quot;posterous_quote_citation&quot;&gt;via &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://wheels.onebuttonapps.net/2010/09/coda-book-for-cfwheels/&quot;&gt;wheels.onebuttonapps.net&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;This is a great reference tool for looking at the ColdFusion on Wheels framework documentation within the Coda web editor from Panic&lt;/p&gt;
&lt;/div&gt;</description>
         <author>Troy</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-7716316.post-3885744949685035230</guid>
         <pubDate>Fri, 01 Jul 2011 16:19:00 +0000</pubDate>
      </item>
      <item>
         <title>Accessing the Flickr API from our CFWheels-powered site</title>
         <link>https://kwbarrett.wordpress.com/2011/06/17/accessing-the-flickr-api-from-our-cfwheels-powered-site/</link>
         <description>Recently at work, I was tasked with adding a one-off page to our site.  Normally, I hate these kinds of assignments. They tend to break any rules you already have established for the site architecture and style; and once you say “yes” to one such project, you open the floodgates for others.  However, I jumped [&amp;#8230;]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://pixel.wp.com/b.gif?host=kwbarrett.wordpress.com&amp;#038;blog=1166602&amp;#038;post=374&amp;#038;subd=kwbarrett&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot;/&gt;</description>
         <guid isPermaLink="false">http://kwbarrett.wordpress.com/?p=374</guid>
         <pubDate>Fri, 17 Jun 2011 15:50:04 +0000</pubDate>
         <media:content medium="image" url="https://2.gravatar.com/avatar/592c13df5d497f5527bcaebf643220d5?s=96&amp;amp;d=identicon&amp;amp;r=G">
            <media:title type="html">kwbarrett</media:title>
         </media:content>
      </item>
      <item>
         <title>Picasa model in Wheels</title>
         <link>http://www.blayter.com/john/index.cfm/2011/4/3/Picasa-model-in-Wheels</link>
         <description>I am in the process of converting my site over to CFWheels. In this journey I wanted to bring in the pictures that my wife uploads to her Picasa site. (Attached) is a model file in that you can adjust to suck in the Picasa photos that you desire into your site.</description>
         <guid isPermaLink="false">http://www.blayter.com/john/index.cfm/2011/4/3/Picasa-model-in-Wheels</guid>
         <pubDate>Sun, 03 Apr 2011 23:59:00 +0000</pubDate>
         <enclosure length="1295" type="application/x-zip-compressed" url="http://www.blayter.com/john/enclosures/Picasa.zip"/>
      </item>
   </channel>
</rss>
<!-- fe6.yql.bf1.yahoo.com compressed/chunked Thu Oct  1 22:15:32 UTC 2015 -->
