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

<channel>
	<title>Polymorphism &#187; ColdFusion on Wheels</title>
	<atom:link href="http://www.clearcrystalmedia.com/pm/category/programming/wheels/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clearcrystalmedia.com/pm</link>
	<description>using the right technology at the right time</description>
	<lastBuildDate>Tue, 29 Nov 2011 13:53:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Loading &#8220;extra&#8221; queries for a form in ColdFusion on Wheels</title>
		<link>http://www.clearcrystalmedia.com/pm/loading-extra-queries-for-form-cfwheels/</link>
		<comments>http://www.clearcrystalmedia.com/pm/loading-extra-queries-for-form-cfwheels/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:51:15 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=632</guid>
		<description><![CDATA[Many times, you'll see this sort of situation when writing a form, where you need to load "extra" queries for things like state and country selectors:
<pre lang="cfm">
<!--- `views/customers/new.cfm` --->
<cfparam name="customer">
<cfparam name="countries" type="query">
<cfparam name="states" type="query">

<cfoutput>

#startFormTag(route="customer")#
    #textField(objectName="customer", property="name")#
    #textField(objectName="customer", property="email")#
    #select(objectName="customer", property="countryId", options=countries)#
    #select(objectName="customer", property="stateId", options=states)#
#endFormTag()#

</cfoutput>
</pre>
There are many ways that you can load the data that this view template is requiring, each with their pros and cons. I'll cover 3 different approaches.]]></description>
			<content:encoded><![CDATA[<p>Many times, you&#8217;ll see this sort of situation when writing a form, where you need to load &#8220;extra&#8221; queries for things like state and country selectors:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- `views/customers/new.cfm` ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;customer&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;countries&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;query&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;states&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;query&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#startFormTag(route=&quot;customer&quot;)#
    #textField(objectName=&quot;customer&quot;, property=&quot;name&quot;)#
    #textField(objectName=&quot;customer&quot;, property=&quot;email&quot;)#
    #select(objectName=&quot;customer&quot;, property=&quot;countryId&quot;, options=countries)#
    #select(objectName=&quot;customer&quot;, property=&quot;stateId&quot;, options=states)#
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>There are many ways that you can load the data that this view template is requiring, each with their pros and cons. I&#8217;ll cover 3 different approaches.</p>
<h2>Approach #1: Use before filters to stay DRY</h2>
<p>One way to solve this problem in the controller is to run before filters on the <code>new</code>, <code>create</code>, <code>edit</code>, and <code>update</code> actions:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">// `controllers/Customers.cfc`
component extends=&quot;Controller&quot; {
&nbsp;
    function init() {
        verifies(only=&quot;edit,update,show&quot;, params=&quot;key&quot;, paramsTypes=&quot;integer&quot;);
        verifies(only=&quot;create,update, params=&quot;customer&quot;);
        filters(only=&quot;new,create,edit,update&quot;, through=&quot;$setStates,$setCountries&quot;);
    }
&nbsp;
    function new() {
        customer = model(&quot;customer&quot;).new();
    }
&nbsp;
    function create() {
        customer = model(&quot;customer&quot;).new(params.customer);
        if (customer.save()) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;new&quot;);
        }
    }
&nbsp;
    function edit() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    function update() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
        if (customer.update(params.customer)) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;edit&quot;);
        }
    }
&nbsp;
    function show() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    private function $setStates() {
        states = model(&quot;state&quot;).findAll(order=&quot;name&quot;);
    }
&nbsp;
    private function $setCountries() {
        countries = model(&quot;countries&quot;).findAll(order=&quot;name&quot;);
    }
}</pre></div></div>

<p>Notice the call to <code>filters()</code> in <code>init()</code> to load the <code>$setStates()</code> and <code>$setCountries()</code> private filter methods.</p>
<p>Yes, this works. But one problem is that you only need to load <code>states</code> and <code>countries</code> if the form needs to be shown with errors. On <code>create</code> and <code>update</code>, those queries may not even need to be run, but they&#8217;re running anyway. Why hit the database if you don&#8217;t need to?</p>
<p>Depending on your caching strategy, this may not matter if you are caching the <code>findAll()</code> calls. But let&#8217;s say that you are running at least one of those queries in real time. How do you avoid running them if you don&#8217;t need them?</p>
<h2>Approach #2: Limiting the use of filters and calling them manually in <code>create</code> and <code>update</code></h2>
<p>An approach that alleviates that problem is to limit the before filters to <code>new</code> and <code>edit</code> and only run them when needed in <code>create</code> and <code>update</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">// `controllers/Customers.cfc`
component extends=&quot;Controller&quot; {
&nbsp;
    function init() {
        verifies(only=&quot;edit,update,show&quot;, params=&quot;key&quot;, paramsTypes=&quot;integer&quot;);
        verifies(only=&quot;create,update, params=&quot;customer&quot;);
        filters(only=&quot;new,edit&quot;, through=&quot;$setStates,$setCountries&quot;);
    }
&nbsp;
    function new() {
        customer = model(&quot;customer&quot;).new();
    }
&nbsp;
    function create() {
        customer = model(&quot;customer&quot;).new(params.customer);
        if (customer.save()) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            $setStates();
            $setCountries();
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;new&quot;);
        }
    }
&nbsp;
    function edit() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    function update() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
        if (customer.update(params.customer)) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            $setStates();
            $setCountries();
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;edit&quot;);
        }
    }
&nbsp;
    function show() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    private function $setStates() {
        states = model(&quot;state&quot;).findAll(order=&quot;name&quot;);
    }
&nbsp;
    private function $setCountries() {
        countries = model(&quot;countries&quot;).findAll(order=&quot;name&quot;);
    }
}</pre></div></div>

<p>Notice the modified call to <code>filters()</code> in <code>init()</code> and the manual calls to <code>$setStates()</code> and <code>$setCountries()</code> in the <code>create</code> and <code>update</code> actions.</p>
<p>This is better because now the <code>states</code> and <code>countries</code> are only being loaded when absolutely needed. This does make things slightly less DRY, but it&#8217;s not too bad of a trade-off.</p>
<h2>Approach #3: Using Automatic Data Functions to Load Data for the Form</h2>
<p>Yet another approach is to factor out the form into a partial and use what&#8217;s called an <em>automatic data function</em> to load the extra queries.</p>
<p>So the view template changes to this (which you may be doing anyway):</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- `views/customers/new.cfm` ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#startFormTag(route=&quot;customer&quot;)#
    #includePartial(&quot;form&quot;)#
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>And now you create a partial:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!--- `views/customers/_form.cfm` ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;customer&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;arguments.countries&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;query&quot;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;arguments.states&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;query&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#textField(objectName=&quot;customer&quot;, property=&quot;name&quot;)#
#textField(objectName=&quot;customer&quot;, property=&quot;email&quot;)#
#select(objectName=&quot;customer&quot;, property=&quot;countryId&quot;, options=arguments.countries)#
#select(objectName=&quot;customer&quot;, property=&quot;stateId&quot;, options=arguments.states)#
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>You may now notice that the <code>countries</code> and <code>states</code> variables are now being referenced in the <code>arguments</code> scope. That&#8217;s because we&#8217;re going to load them from an automatic data function.</p>
<p>The controller should now look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">// `controllers/Customers.cfc`
component extends=&quot;Controller&quot; {
&nbsp;
    function init() {
        verifies(only=&quot;edit,update,show&quot;, params=&quot;key&quot;, paramsTypes=&quot;integer&quot;);
        verifies(only=&quot;create,update, params=&quot;customer&quot;);
    }
&nbsp;
    function new() {
        customer = model(&quot;customer&quot;).new();
    }
&nbsp;
    function create() {
        customer = model(&quot;customer&quot;).new(params.customer);
        if (customer.save()) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;new&quot;);
        }
    }
&nbsp;
    function edit() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    function update() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
        if (customer.update(params.customer)) {
            redirectTo(route=&quot;customer&quot;, key=customer.key(), success=&quot;...&quot;);
        }
        else {
            flashInsert(error=&quot;...&quot;);
            renderPage(action=&quot;edit&quot;);
        }
    }
&nbsp;
    function show() {
        customer = model(&quot;customer&quot;).findByKey(params.key);
    }
&nbsp;
    private struct function form() {
        local.data.states = model(&quot;state&quot;).findAll(order=&quot;name&quot;);
        local.data.countries = model(&quot;countries&quot;).findAll(order=&quot;name&quot;);
        return local.data;
    }
}</pre></div></div>

<p>The true points of interest in this example are the <code>init()</code> and <code>form()</code>. We&#8217;re now no longer running before filters in <code>init()</code> to load the <code>states</code> and <code>countries</code>.</p>
<p>Also, there is a new private method named <code>form()</code> that acts as an automatic data function. Every time you call a partial, Wheels checks for a method in your controller with the name of the partial, <code>private</code> access, and a return type of <code>struct</code>. If it finds that method, it&#8217;ll run it and merge the struct that it returns into the <code>arguments</code> scope in the view.</p>
<p>So <code>form()</code> is only being run when the form is shown via the call to <code>#includePartial("form")#</code>. And the data loading is still happening in the controller where it belongs.</p>
<p>I&#8217;ve only begun playing around with this method and so far have been enjoying the results. I am slightly torn because I like the &#8220;self-documenting&#8221; nature of declaring filters in <code>init()</code>, but that method does have the caveat that I mentioned before. The automatic data function solves this problem, but it does make the functionality a little less obvious. You need to remember the extra step of checking to see if there is a method in the controller with the same name as the partial when you run across one.</p>
<p>Has anyone else play with this method? If so, how has this worked out for you?</p>

<!-- start wp-tags-to-technorati 1.01 -->

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/loading-extra-queries-for-form-cfwheels/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Restrict key ColdFusion on Wheels URL variables from Google Analytics</title>
		<link>http://www.clearcrystalmedia.com/pm/restrict-key-cfwheels-url-variables-from-google-analytics/</link>
		<comments>http://www.clearcrystalmedia.com/pm/restrict-key-cfwheels-url-variables-from-google-analytics/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 15:00:51 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web analytics]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=602</guid>
		<description><![CDATA[<p><a href="http://www.clearcrystalmedia.com/pm/wp-content/uploads/google-analytics-logo.gif"><img class="alignnone size-full wp-image-607" title="google-analytics-logo" src="http://www.clearcrystalmedia.com/pm/wp-content/uploads/google-analytics-logo.gif" alt="Google Analytics" width="213" height="40" /></a></p>
<p>Here's a little tip to keep anyone in your organization using Google Analytics from accidentally reloading your ColdFusion on Wheels application in the wrong <a title="Switching Environments" href="http://cfwheels.org/docs/chapter/switching-environments">environment</a>.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.clearcrystalmedia.com/pm/wp-content/uploads/google-analytics-logo.gif"><img class="alignnone size-full wp-image-607" title="google-analytics-logo" src="http://www.clearcrystalmedia.com/pm/wp-content/uploads/google-analytics-logo.gif" alt="Google Analytics" width="213" height="40" /></a></p>
<p>Here&#8217;s a little tip to keep anyone in your organization using Google Analytics from accidentally reloading your ColdFusion on Wheels application in the wrong <a title="Switching Environments" href="http://cfwheels.org/docs/chapter/switching-environments">environment</a>.</p>
<h2>Problem: people can see your reload URLs</h2>
<p>You wouldn&#8217;t think that Google Analytics would have anything to do with this, but consider this scenario:</p>
<ol>
<li>A non-technical teammate of yours runs some content reports in Google Analytics.</li>
<li>The teammate keeps seeing a URL appearing in the reports that looks something like this:<br />
<code>/?reload=maintenance&amp;password=123456</code>.</li>
<li>They eventually say to themselves, &#8220;Hmm, I wonder what that does. I&#8217;m going to click it.&#8221;</li>
<li>You get an emergency call because your website is in maintenance mode all of a sudden, and you&#8217;re not sure why it happened.</li>
</ol>
<h2>Solution: <em>Exclude URL Query Parameters</em> setting</h2>
<p>The solution is pretty simple. You just need to go into the Google Analytics settings area for each of your Wheels apps&#8217; profiles and exclude the <kbd>reload</kbd>, <kbd>password</kbd>, and <kbd>except</kbd> URL paramaters from appearing in Google Analytics.</p>
<p>Your settings would look something like this:</p>
<p><a class="screenshot" href="http://www.clearcrystalmedia.com/pm/wp-content/uploads/exclude-url-query-parameters-field.gif"><img class="size-full wp-image-606 alignnone" title="exclude-url-query-parameters-field" src="http://www.clearcrystalmedia.com/pm/wp-content/uploads/exclude-url-query-parameters-field.gif" alt="" width="469" height="283" /></a></p>
<p>Here&#8217;s how to get to the profile settings for your Wheels app:</p>
<ol>
<li>Open the reports for each profile</li>
<li>Click the Gear icon in the upper right</li>
<li>Click the Profile Settings tab</li>
<li>Edit the Exclude URL Query Parameters field.</li>
</ol>
<h2>More information</h2>
<ul>
<li><a href="http://www.google.com/support/analyticshelp/bin/answer.py?answer=1010249">Edit Profile Settings</a> article in Google Analytics Help</li>
<li><a href="http://cfwheels.org/docs/chapter/switching-environments">Switching Environments</a> chapter in ColdFusion on Wheels Reference Guide</li>
</ul>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/analytics' rel='tag' target='_self'>analytics</a>, <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion+on+Wheels' rel='tag' target='_self'>ColdFusion on Wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/google+analytics' rel='tag' target='_self'>google analytics</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/security' rel='tag' target='_self'>security</a>, <a class='technorati-link' href='http://technorati.com/tag/web+analytics' rel='tag' target='_self'>web analytics</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/restrict-key-cfwheels-url-variables-from-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Railo: Form field [asset[file]] doesn&#8217;t exist or has no content</title>
		<link>http://www.clearcrystalmedia.com/pm/railo-form-field-file-doesnt-exist-or-has-no-content/</link>
		<comments>http://www.clearcrystalmedia.com/pm/railo-form-field-file-doesnt-exist-or-has-no-content/#comments</comments>
		<pubDate>Thu, 12 May 2011 02:38:17 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[cffile]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=591</guid>
		<description><![CDATA[<p>I was trying to add file uploading to my Wheels + Railo application. But I kept getting this error message when trying to use <code>&#60;cffile action=&#34;upload&#34;&#62;</code>:</p>
<blockquote>
Form field [asset[file]] doesn't exist or has no content
</blockquote>
<p>After a couple hours of beating my head against the wall, I realized that I didn't set <code>enctype=&#34;multipart/form-data&#34;</code> on the form tag.</p>
<p>Fortunately, this is a fairly simple fix using the Wheels <code><a href="http://cfwheels.org/docs/function/startformtag">startFormTag()</a></code> form helper and its <code>multipart</code> argument.</p>]]></description>
			<content:encoded><![CDATA[<p>I was trying to add file uploading to my Wheels + Railo application. But I kept getting this error message when trying to use <code>&lt;cffile action=&quot;upload&quot;&gt;</code>:</p>
<blockquote><p>
Form field [asset[file]] doesn&#8217;t exist or has no content
</p></blockquote>
<p>After a couple hours of beating my head against the wall, I realized that I didn&#8217;t set <code>enctype=&quot;multipart/form-data&quot;</code> on the form tag.</p>
<p>Fortunately, this is a fairly simple fix using the Wheels <code><a href="http://cfwheels.org/docs/function/startformtag">startFormTag()</a></code> form helper and its <code>multipart</code> argument:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;">#startFormTag(route=&quot;assets&quot;, action=&quot;create&quot;, multipart=true)#
...
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span></pre></div></div>

<p>I&#8217;m sad to report that this isn&#8217;t the first time that this has happened to me, and it probably won&#8217;t be the last. I hope that my poor brain will remember the meaning of that error message the next time that I see it.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/cffile' rel='tag' target='_self'>cffile</a>, <a class='technorati-link' href='http://technorati.com/tag/cfml' rel='tag' target='_self'>cfml</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/error' rel='tag' target='_self'>error</a>, <a class='technorati-link' href='http://technorati.com/tag/errors' rel='tag' target='_self'>errors</a>, <a class='technorati-link' href='http://technorati.com/tag/railo' rel='tag' target='_self'>railo</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/railo-form-field-file-doesnt-exist-or-has-no-content/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Another bug fixed in ColdFISH on Wheels plugin</title>
		<link>http://www.clearcrystalmedia.com/pm/another-bug-fixed-coldfish-on-wheels-plugin/</link>
		<comments>http://www.clearcrystalmedia.com/pm/another-bug-fixed-coldfish-on-wheels-plugin/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 03:18:41 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[coldfish]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion framework]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[railo]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=588</guid>
		<description><![CDATA[<p><a href="http://angry-fly.com/">Russ Johnson</a> reported a <a href="https://github.com/clearcrystalmedia/ColdFISH-on-Wheels/issues/1">bug</a> with my <a href="http://cfwheels.org/plugins/listing/40">ColdFISH on Wheels plugin</a>. The bug affected the <code>formattedCode()</code> function's <code>wrapperElement</code> and <code>wrapperClass</code> arguments, which were being ignored accidentally.</p>
<p>I finally squashed the bug tonight in version 0.7 of the plugin. Be sure to <a href="http://cfwheels.org/plugins/listing/40">download the new version</a> if you're planning on using the plugin in your application.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://angry-fly.com/">Russ Johnson</a> reported a <a href="https://github.com/clearcrystalmedia/ColdFISH-on-Wheels/issues/1">bug</a> with my <a href="http://cfwheels.org/plugins/listing/40">ColdFISH on Wheels plugin</a>. The bug affected the <code>formattedCode()</code> function&#8217;s <code>wrapperElement</code> and <code>wrapperClass</code> arguments, which were being ignored accidentally.</p>
<p>I finally squashed the bug tonight in version 0.7 of the plugin. Be sure to <a href="http://cfwheels.org/plugins/listing/40">download the new version</a> if you&#8217;re planning on using the plugin in your application.</p>
<p>By the way, Russ has been a blogging machine lately. Be sure to <a href="http://angry-fly.com/">check out his blog</a> for some ColdFusion on Wheels goodness.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfish' rel='tag' target='_self'>coldfish</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+framework' rel='tag' target='_self'>coldfusion framework</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion+on+Wheels' rel='tag' target='_self'>ColdFusion on Wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/plugin' rel='tag' target='_self'>plugin</a>, <a class='technorati-link' href='http://technorati.com/tag/plugins' rel='tag' target='_self'>plugins</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/railo' rel='tag' target='_self'>railo</a>, <a class='technorati-link' href='http://technorati.com/tag/web+development' rel='tag' target='_self'>web development</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/another-bug-fixed-coldfish-on-wheels-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Presentation tomorrow: Migrating Existing Applications to ColdFusion on Wheels</title>
		<link>http://www.clearcrystalmedia.com/pm/presentation-migrating-existing-applications-cfwheels/</link>
		<comments>http://www.clearcrystalmedia.com/pm/presentation-migrating-existing-applications-cfwheels/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 04:09:09 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[application development]]></category>
		<category><![CDATA[ccm]]></category>
		<category><![CDATA[cfmeetup]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[chris peters]]></category>
		<category><![CDATA[clear crystal media]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[migrate]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[migrations]]></category>
		<category><![CDATA[polymorphism]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=585</guid>
		<description><![CDATA[<p>I'll be presenting about <a href="http://www.meetup.com/coldfusionmeetup/events/16349083/">migrating existing applications to the ColdFusion on Wheels framework</a> tomorrow night, February 10, on the <a href="http://www.meetup.com/coldfusionmeetup/">Online ColdFusion Meetup</a>.</p>
<p>I've been working on a plan for migrating a Fusebox application to Wheels, and it's been a pretty challenging task to think through it all. I don't care what framework or platform you're migrating to. It's not easy. It's much easier to start anew, but most of us do not have that leisure.</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be presenting about <a href="http://www.meetup.com/coldfusionmeetup/events/16349083/">migrating existing applications to the ColdFusion on Wheels framework</a> tomorrow night, February 10, on the <a href="http://www.meetup.com/coldfusionmeetup/">Online ColdFusion Meetup</a>.</p>
<p>I&#8217;ve been working on a plan for migrating a Fusebox application to Wheels, and it&#8217;s been a pretty challenging task to think through it all. I don&#8217;t care what framework or platform you&#8217;re migrating to. It&#8217;s not easy. It&#8217;s much easier to start anew, but most of us do not have that leisure.</p>
<p>The good news is that Wheels gives you a few tools to help out:</p>
<ul>
<li><a href="http://cfwheels.org/docs/chapter/object-relational-mapping">Object relational mapping</a> allows you to trick Wheels into using a database structure that doesn&#8217;t quite meet Wheels&#8217;s expectations for conventions</li>
<li><a href="http://cfwheels.org/docs/1-1/chapter/using-routes">URL routing</a> enables you to build sub-applications and then bubble them up to a single giant application (if that&#8217;s the path that you&#8217;ve chosen to take)</li>
<li>Different methods of <strong>refactoring, inheritance, and plugin development</strong> give you the ability to start with messy code and make it cleaner and <acronym title="Don't Repeat Yourself">DRY</acronym>er with each iteration—when you need it (and as you learn more about the Wheels framework)</li>
</ul>
<p>To be quite frank, I&#8217;m not sure what all I can share in 45 minutes. But I hope whatever I present will get the ideas flowing and the conversation going.</p>
<p>Also, if you <a href="http://feeds.clearcrystalmedia.com/polymorphism">subscribe to my posts</a>, I&#8217;ll share more of my experiences as I get deeper and deeper into this migration project. It involves moving a FoxPro database to SQL Server (which isn&#8217;t my responsibility, thank the Lord), translating it to match Wheels conventions, and building an application layer with some pretty convoluted business logic.</p>
<p>Isn&#8217;t that the way it always is? <img src='http://www.clearcrystalmedia.com/pm/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/application+development' rel='tag' target='_self'>application development</a>, <a class='technorati-link' href='http://technorati.com/tag/ccm' rel='tag' target='_self'>ccm</a>, <a class='technorati-link' href='http://technorati.com/tag/cfmeetup' rel='tag' target='_self'>cfmeetup</a>, <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/chris+peters' rel='tag' target='_self'>chris peters</a>, <a class='technorati-link' href='http://technorati.com/tag/clear+crystal+media' rel='tag' target='_self'>clear crystal media</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/framework' rel='tag' target='_self'>framework</a>, <a class='technorati-link' href='http://technorati.com/tag/frameworks' rel='tag' target='_self'>frameworks</a>, <a class='technorati-link' href='http://technorati.com/tag/migrate' rel='tag' target='_self'>migrate</a>, <a class='technorati-link' href='http://technorati.com/tag/migration' rel='tag' target='_self'>migration</a>, <a class='technorati-link' href='http://technorati.com/tag/migrations' rel='tag' target='_self'>migrations</a>, <a class='technorati-link' href='http://technorati.com/tag/polymorphism' rel='tag' target='_self'>polymorphism</a>, <a class='technorati-link' href='http://technorati.com/tag/presentation' rel='tag' target='_self'>presentation</a>, <a class='technorati-link' href='http://technorati.com/tag/presentations' rel='tag' target='_self'>presentations</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/presentation-migrating-existing-applications-cfwheels/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

