<?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>Resultant Systems</title>
	<atom:link href="http://www.resultantsys.com/index.php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.resultantsys.com</link>
	<description>Make the Web Work for Your Business</description>
	<lastBuildDate>Sat, 06 Mar 2010 15:55:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Make an RSS Feed for Your Splash Site</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/make-an-rss-feed-for-your-splash-site/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/make-an-rss-feed-for-your-splash-site/ #comments</comments>
		<pubDate>Sat, 06 Mar 2010 15:38:35 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Splash CMS]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=213</guid>
		<description><![CDATA[Using the new Splash Tags for the Splash CMS, you can easily make an RSS feed or an XML sitemap.
[cce_cfm]
&#60;cfcontent type="text/xml" reset="Yes"&#62;&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"&#62;
&#60;channel&#62;
  &#60;atom:link href="http://www.YourSite.com/index.cfm/feed"
    rel="self" type="application/rss+xml" /&#62;
  &#60;title&#62;YourSite.com&#60;/title&#62;
  &#60;link&#62;http://www.YourSite.com&#60;/link&#62;
  &#60;description&#62;Your Description Goes Here&#60;/description&#62;
  &#60;cfoutput&#62;
    &#60;pubDate&#62;#HTMLEditFormat(DateFormat(now(), 'ddd, [...]]]></description>
			<content:encoded><![CDATA[<p>Using the new Splash Tags for the Splash CMS, you can easily make an RSS feed or an XML sitemap.</p>
<pre>[cce_cfm]
&lt;cfcontent type="text/xml" reset="Yes"&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"&gt;
&lt;channel&gt;
  &lt;atom:link href="http://www.YourSite.com/index.cfm/feed"
    rel="self" type="application/rss+xml" /&gt;
  &lt;title&gt;YourSite.com&lt;/title&gt;
  &lt;link&gt;http://www.YourSite.com&lt;/link&gt;
  &lt;description&gt;Your Description Goes Here&lt;/description&gt;
  &lt;cfoutput&gt;
    &lt;pubDate&gt;#HTMLEditFormat(DateFormat(now(), 'ddd, dd mmm yyyy'))#
      #HTMLEditFormat(TimeFormat(now(), 'HH:mm:ss'))# EST&lt;/pubDate&gt;
  &lt;language&gt;en-us&lt;/language&gt;
  &lt;ttl&gt;40&lt;/ttl&gt;
  &lt;s:find slug="blog"&gt;
  &lt;s:children-each order="publishedAt desc" where="status='published'"&gt;
    &lt;item&gt;
      &lt;cfset thisChild = request.tags.currentChild&gt;
      &lt;title&gt;#HTMLEditFormat(thisChild.title)#&lt;/title&gt;
      &lt;description&gt;&lt;![CDATA[&lt;s:content part="body" page="#thisChild#"/&gt;]]&gt;&lt;/description&gt;
      &lt;pubDate&gt;#HTMLEditFormat(DateFormat(thisChild.publishedAt, 'ddd, dd mmm yyyy'))#
         #HTMLEditFormat(TimeFormat(thisChild.publishedAt, 'HH:mm:ss'))# EST&lt;/pubDate&gt;
      &lt;guid isPermaLink="true"&gt;http://www.yoursite.com/index.cfm/#thisChild.slug#&lt;/guid&gt;
      &lt;link&gt;http://www.yoursite.com/index.cfm/#thisChild.slug#&lt;/link&gt;
    &lt;/item&gt;
  &lt;/s:children-each&gt;
  &lt;/s:find&gt;
&lt;/channel&gt;&lt;/cfoutput&gt;
&lt;/rss&gt;&lt;/cfcontent&gt;&lt;cfabort&gt;
[/cce_cfm]</pre>
<p>Most of this code is the required RSS XML. Just drop in your site-specific domain name, description, etc.</p>
<p>The &lt;s:find slug=&#8221;blog&gt; tag finds the blog, and then &lt;s:children-each&gt; loops over all the children that are under the blog page. I used thisChild as a convenience variable instead of having to type request.tags.currentChild every time. The &lt;cfabort&gt; at the end keeps Splash from adding extra HTML tags at the end of the file.</p>
<p>You could also create an easy XML site map using a similar approach. Just change out the XML wrapper.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/make-an-rss-feed-for-your-splash-site/ /feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Splash Tags for the Splash CMS</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/new-splash-tags-for-the-splash-cms/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/new-splash-tags-for-the-splash-cms/ #comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:10:56 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Splash CMS]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=165</guid>
		<description><![CDATA[I recently added several new Splash Tags for the Splash content management system. If you don&#8217;t know about Splash, read my Introduction to Splash article.

&#60;s: find&#62;
&#60;s: children-each&#62;
&#60;s: children-first &#62;
&#60;s: children-last &#62;
&#60;s: ifFirst &#62;
&#60;s: unlessFirst &#62;
&#60;s: ifLast &#62;
&#60;s: unlessLast &#62;

There&#8217;s a complete list of tags and documentation over on the GitHub Wiki. But, I&#8217;ll give you [...]]]></description>
			<content:encoded><![CDATA[<p>I recently added several new Splash Tags for the Splash content management system. If you don&#8217;t know about Splash, read my <a title="Introduction to the Splash CMS" href="http://www.resultantsys.com/index.php/coldfusion/content-management-and-the-splash-cms-introduction/" target="_self">Introduction to Splash</a> article.</p>
<ul>
<li>&lt;s: find&gt;</li>
<li>&lt;s: children-each&gt;</li>
<li>&lt;s: children-first &gt;</li>
<li>&lt;s: children-last &gt;</li>
<li>&lt;s: ifFirst &gt;</li>
<li>&lt;s: unlessFirst &gt;</li>
<li>&lt;s: ifLast &gt;</li>
<li>&lt;s: unlessLast &gt;</li>
</ul>
<p>There&#8217;s a complete list of tags and documentation over on the <a title="Splash Tags Documentation" href="http://wiki.github.com/russjohnson/SplashCMS/splashtags" target="_blank">GitHub Wiki</a>. But, I&#8217;ll give you an overview and show you how to use these tags for a blog.</p>
<p>&lt;s:find&gt; This tag looks up a page and stores the page object so that subsequent tags can use that page object.</p>
<p>&lt;s: children-each&gt; The tag finds all the children of a page and loops over them.</p>
<p>&lt;s: children-first &gt; and &lt;s: children-last &gt; finds the first or last child page.</p>
<p>The rest of the tags are all used inside of a &lt;s: children-each&gt; tag. They check to see if the current child page is the first one, last one, or whatever.</p>
<h2>Making a Blog page with Splash Tags</h2>
<p>Let&#8217;s say you have a page named Blog, that has several posts that are child pages of Blog. Then, in the body for the blog page, put something like this:</p>
<pre>[cce_cfm]
&lt;h3&gt;Articles&lt;/h3&gt;
&lt;s:find slug="blog"&gt;
  &lt;s:children-each
   order="publishedAt desc"
   where="status='published'"&gt;
    &lt;cfset thisChild = request.tags.currentChild&gt;
    &lt;cfoutput&gt;
      &lt;dt class="blogList"&gt;
         &lt;a href="#thisChild.slug#"&gt;#thisChild.title#&lt;/a&gt;
            | #DateFormat(thisChild.publishedAt, 'long')#&lt;/dt&gt;
      &lt;dd class="blogDesc"&gt;#thisChild.description#&lt;/dd&gt;
    &lt;/cfoutput&gt;
  &lt;/s:children-each&gt;
&lt;/s:find&gt;
[/cce_cfm]</pre>
<p>&lt;s:find slug=&#8221;blog&#8221;&gt; finds the blog page, and then &lt;s:children-each&gt; loops over all the pages. By the way, &lt;s:children-each&gt; uses the CFWheels <a title="findAll Model Method" href="http://cfwheels.org/docs/function/findall" target="_blank">findAll model method</a>, so all of the cool CFWheels parameters are available in &lt;s:children-each&gt;!</p>
<p>If you want to see an example of what this looks like, visit the <a title="DonorUp Blog Example" href="http://www.donorup.com/index.cfm/blog" target="_blank">DonorUp blog page</a>.</p>
<p>All in all, that&#8217;s a lot of output for very little programming effort. That&#8217;s what I call the secret to programmer happiness!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/new-splash-tags-for-the-splash-cms/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Content Management and the Splash CMS &#8212; Introduction</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/content-management-and-the-splash-cms-introduction/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/content-management-and-the-splash-cms-introduction/ #comments</comments>
		<pubDate>Fri, 05 Mar 2010 20:02:46 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Splash CMS]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=156</guid>
		<description><![CDATA[Splash CMS is an open source content management system that runs on top of CFWheels. It&#8217;s designed to be a simple, but elegant content management solutions for websites that are managed by small teams.
CFWheels is an open source ColdFusion framework that is inspired by Ruby on Rails. Besides being easy to use and learn, using [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Splash CMS" href="http://www.splashcms.com/" target="_blank">Splash CMS</a> is an open source content management system that runs on top of <a title="CFWheels Framework" href="http://cfwheels.org/" target="_blank">CFWheels</a>. It&#8217;s designed to be a simple, but elegant content management solutions for websites that are managed by small teams.</p>
<p>CFWheels is an open source ColdFusion framework that is inspired by Ruby on Rails. Besides being easy to use and learn, using CFWheels lets you adapt great ideas from Ruby on Rails (RoR) applications. RoR has the Radiant CMS, and Splash is the ColdFusion/CFWheels adaptation!</p>
<p>You can easily download Splash from <a title="Download Splash CMS" href="http://wiki.github.com/russjohnson/SplashCMS/" target="_blank">http://wiki.github.com/russjohnson/SplashCMS/</a>. The documentation for Splash is still kind of sparse, but the <a title="Radiant CMS Documentation" href="http://wiki.github.com/radiant/radiant/" target="_blank">Radiant </a>documentation is mostly applicable, and you can easily see how most things are supposed to work. Then, if you get stuck, email the <a title="Splash CMS Google Group" href="http://groups.google.com/group/splashcms" target="_blank">Google Group</a>.</p>
<h2>Splash Layouts, Snippets, and Pages</h2>
<p>Splash uses Layouts, Snippets, and Pages to build a website.</p>
<p>A layout, as you might imagine, is like a skin for an entire website. You can have multiple layouts and use different layouts for different pages.</p>
<p>Pages are specific URLs on a Splash site, and each page has a specific layout specified. A page can have multiple &#8220;page parts.&#8221; Most pages will have a &#8220;Body&#8221; part, but some might also have a &#8220;Sidebar&#8221; or other parts.</p>
<p>Snippets are reusable content chunks. You might have a navigation snippet that displays the main navigation for your site. Headers and Footers are other common snippets.</p>
<h2>Splash Tags</h2>
<p>There is one other very powerful component to Splash &#8212; Splash Tags. These are ColdFusion custom tags that extend ColdFusion and HTML to work with Splash. Here&#8217;s a simple example: the [ccei_cfm]&lt;s:title /&gt; [/ccei_cfm] tag. This tag just retrieves the page&#8217;s title from the page object and inserts it in place of the tag. So, in your layout, you would typically have something like:</p>
<p>[ccei_cfm]&lt;title&gt;&lt;s:title /&gt;&lt;/title&gt;[/ccei_cfm]</p>
<p>The pages title information from the database is then easily inserted into the HTML title tag!</p>
<p>There are a lot more tags, so <a title="Splash Tags Documentation" href="http://wiki.github.com/russjohnson/SplashCMS/splashtags" target="_blank">see the Wiki</a>.</p>
<h2>Splash in Action</h2>
<p>I recently completed the <a title="DonorUp Website" href="http://www.donorup.com" target="_blank">DonorUp.com</a> website using Splash. I was really pleased with how easily I was able to get many thing to come together. So, try Splash and leave a comment to let me know how you like it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/content-management-and-the-splash-cms-introduction/ /feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Learning CFWheels &#8212; Debugging</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/learning-cfwheels-debugging/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/learning-cfwheels-debugging/ #comments</comments>
		<pubDate>Wed, 24 Feb 2010 22:06:55 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=137</guid>
		<description><![CDATA[CFWheels has some great documentation and examples, but there is still a small learning curve. As you are getting going, it helps to have a few debugging tips. So, keep reading &#8230;
On the CFWheels Google Group, Cathy recently asked about the sendEmail() function. This is a pretty good example to show you some debugging tips.
sendEmail() [...]]]></description>
			<content:encoded><![CDATA[<p>CFWheels has some great documentation and examples, but there is still a small learning curve. As you are getting going, it helps to have a few debugging tips. So, keep reading &#8230;</p>
<p>On the CFWheels Google Group, Cathy recently asked about the sendEmail() function. This is a pretty good example to show you some debugging tips.</p>
<p><a title="sendEmail()" href="http://cfwheels.org/docs/function/sendemail" target="_blank">sendEmail()</a> wraps the cfmail tag. Here&#8217;s some more information:</p>
<p><a title="Sending email with CFWheels" href="http://cfwheels.org/docs/chapter/sending-email" target="_blank">CFWheels on sending email</a>.</p>
<p>This all looks pretty straightforward, but what do you do if it&#8217;s not working?</p>
<p>First, setup a test view page. Go to the Wheels views folder and add a new folder called test. Then create a new file called index.cfm in the test folder. The path should be <span style="color: #993300;">/views/test/index.cfm</span>.</p>
<p>In the index.cfm file you just create, put the following:</p>
<pre>[cce_cfm]
&lt;cfset
	set(functionName="sendEmail",
	server="yourServer",
	username="yourUsername",
	password="yourPassword")
&gt;
[/cce_cfm]</pre>
<p>This will trigger the sendEmail() function. You can access the test page at <span style="color: #993300;">http://localhost/index.cfm/test</span>. But, if you go to this page, you&#8217;ll get an error because we didn&#8217;t create myemailtemplate, yet. So, make another CFM page in <span style="color: #993300;">/views/test/</span> called <span style="color: #993300;">myemailtemplate.cfm</span>. The content can be anything you want. Something like &#8220;Test email&#8221; is fine.</p>
<p>Wheels knows you are in the Test controller, so it looks for templates in the <span style="color: #993300;">/views/test</span> folder. Wait a minute! You never said anything about creating a controller. That&#8217;s one of the cool things about Wheels. Even without a controller, it will still show you the view page, and things still work!</p>
<p>Now, go back to the test page at <span style="color: #993300;">http://localhost/index.cfm/test</span>. If everything is working, you should get an email message. If it&#8217;s not working, you can put other stuff in your test page. Try these out:</p>
<ul>
<li>&lt;cfdump var=&#8221;#params#&#8221;&gt; will show you the params structure with your actions, controller, data you&#8217;re passing, etc.</li>
<li>&lt;cfdump var=&#8221;#wheels#&#8221;&gt; will show information on your filters.</li>
<li>&lt;cfdump var=&#8221;#application.wheels#&#8221;&gt; will show all the wheels settings, functions, routes &#8212; All kinds of cool things.</li>
</ul>
<p>Now sendEmail() is a little trickier. It uses ColdFusion&#8217;s &lt;cfmail&gt; tag. Put this in your /views/test/index.cfm file:</p>
<pre>[cce_cfm]
&lt;cfmail from="me@mydomain.com"
    to="me@mydomain.com"
    subject="Test Message"&gt;
  This is a test
&lt;/cfmail&gt;
[/cce_cfm]</pre>
<p>If this won&#8217;t work, then it&#8217;s your server configuration, not Wheels. You may have to specify your server name or login information. That&#8217;s pretty easy, too. Just put the following in your config/settings:</p>
<pre>[cce_cfm]
&lt;cfset
	set(functionName="sendEmail",
	server="yourServer",
	username="yourUsername",
	password="yourPassword")
&gt;
[/cce_cfm]</pre>
<p>I hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/learning-cfwheels-debugging/ /feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>onError Handling for CFWheels and Splash CMS</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/onerror-handling-for-cfwheels-and-splash-cms/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/onerror-handling-for-cfwheels-and-splash-cms/ #comments</comments>
		<pubDate>Thu, 04 Feb 2010 22:55:48 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Splash CMS]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=134</guid>
		<description><![CDATA[For most websites it&#8217;s usually a good idea to have error pages that have user-friendly error messages that are styled to look like the rest of the site.  Also, you may want to send yourself an eMail when an error happens. Read on to see how to make this work.
For the DonorUp website, I used [...]]]></description>
			<content:encoded><![CDATA[<p>For most websites it&#8217;s usually a good idea to have error pages that have user-friendly error messages that are styled to look like the rest of the site.  Also, you may want to send yourself an eMail when an error happens. Read on to see how to make this work.</p>
<p>For the <a title="DonorUp Website" href="http://www.DonorUp.com" target="_blank">DonorUp</a> website, I used CFWheels and the Splash CMS. Once I knew the tricks, it turned out to be really easy to make this work. So, I decided to write a post to explain what you need to know.</p>
<p>Typically, in ColdFusion, you add an onError() method to your Application.cfc file. Wheels gives you various hooks into Application.cfc, but Wheels already has an onError() method. So, you can&#8217;t add another one! Fortunately, Wheels has an easy way to handle most errors.</p>
<h2>How to send error messages from CFWheels</h2>
<p>All you have to do to get Wheels to send error message emails  is add the following into your <span style="color: #993300;">/config/settings.cfm</span> file:</p>
<p><span style="color: #993300;">&lt;cfset set(sendEmailOnError = true)&gt;<br />
&lt;cfset set(errorEmailAddress = &#8220;you@yourServer.com&#8221;)&gt;</span></p>
<p>Now, whenever there&#8217;s an error, you&#8217;ll get a really nice email with all the troubleshooting info you&#8217;ll need. Easy!</p>
<h2>How to setup a custom error page in CFWheels or Splash</h2>
<p>As part of its built-in error handling, Wheels runs the file at <span style="color: #993300;">/events/onerror.cfm</span>. Just put a redirect to your error page at the top of onerror.cfm and you&#8217;re done:</p>
<p><span style="color: #993300;">&lt;cfset redirectTo(route=&#8221;viewer&#8221;, slug=&#8221;error-page&#8221;)&gt;</span></p>
<p>In my case, I went into the Splash CMS admin and added a page called Error Page. This way, the page is automatically styled to match the rest of the site. The error page apologizes to the user for the error, and let&#8217;s them know I am going to fix it!</p>
<p>When Wheels does its error handling, it will run /events/onerror.cfm, and the redirectTo() will send them to my error page! If you aren&#8217;t running Splash, you could just use the other arguments of <a title="redirectTo() Documentation" href="http://cfwheels.org/docs/function/redirectto" target="_blank">redirectTo() </a>to send them to any controller and action.</p>
<p>You can also put your own HTML or CFML code in onerror.cfm, but I like doing it this way better as it uses all the layouts and styling of my site!</p>
<p>Please leave me a comment if you like this approach or have other ideas!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/onerror-handling-for-cfwheels-and-splash-cms/ /feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Adventures in Mura &#8212; Customizing a Site</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/adventures-in-mura-customizing-a-site/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/adventures-in-mura-customizing-a-site/ #comments</comments>
		<pubDate>Thu, 29 Oct 2009 21:38:20 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Mura]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=119</guid>
		<description><![CDATA[Mura has a lot of interesting capabilities. However, the documentation is a little sparse.
Recently, I have been customizing a Mura site, so I thought I&#8217;d document some of the key things you need to know!
1 &#8211; Create a New Site to Customize
When initially installed, Mura automatically creates the  &#8220;Default&#8221; site. But, don&#8217;t customize this site. [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Get Mura" href="http://www.getmura.com/" target="_blank">Mura </a>has a lot of interesting capabilities. However, the documentation is a little sparse.</p>
<p>Recently, I have been customizing a Mura site, so I thought I&#8217;d document some of the key things you need to know!</p>
<h2>1 &#8211; Create a New Site to Customize</h2>
<p>When initially installed, Mura automatically creates the  &#8220;Default&#8221; site. But, don&#8217;t customize this site. Make a new site and customize it. This way, you can still do Mura updates without overwriting your customizations.</p>
<ul>
<li>Login to your admin area</li>
<li>Go to <span style="color: #800000;">Site Settings -&gt; Add New Site</span>. (Site Settings is in the upper right of the admin screen.)</li>
<li>Name the site whatever you want. For example, you might call it <span style="color: #800000;">MySite</span>.</li>
<li>Now, when you go to customize things, don&#8217;t look in the Default folder. Instead find the MySite folder.</li>
<li>If you want MySite to come up automatically when you go to www.YourDomain.com, click on <span style="color: #800000;">Site Settings</span>. Then, use the Order drop downs to set MySite to 1.</li>
</ul>
<h2>2 &#8211; Customize /MySite/includes/</h2>
<p>Much of what you&#8217;ll want to customize is in the /MySite/Includes/ directory. Here are some things you might want to customize:</p>
<ul>
<li>If you are using a theme like Merced, customize the style sheet at <span style="color: #800000;">/MySite/includes/themes/merced/css/site.css</span>. It&#8217;s a good idea not to change the other style sheets. Just override the style in site.css. <a title="Mura CSS Info" href="http://docs.getmura.com/index.cfm/developer-guides/front-end-development/css-development/" target="_blank">More Info from Mura &#8230;</a></li>
<li>Again, if you&#8217;re using Merced or another theme, customize the templates at <span style="color: #800000;">/MySite/includes/themes/merced/templates/</span>.  Don&#8217;t forget to look in the <span style="color: #800000;">/inc </span>folder for the header and footer includes. <a title="Customizing Mura Templates" href="http://docs.getmura.com/index.cfm/developer-guides/front-end-development/template-development/" target="_blank">More Info from Mura &#8230;</a></li>
</ul>
<h2>3 &#8211; Change the behavior of Display Objects</h2>
<p>You can change how the Display Objects work! For many Display Objects, you can just copy the display object, put it in <span style="color: #800000;">/MySite/includes/display_objects/custom/</span> and modify your copy. I wanted to add a download link to the images in the image gallery, so it was <a title="Customizing Default Output" href="http://www.getmura.com/index.cfm/blog/customizing-default-output/" target="_blank">more complicated</a>. Matt Levine of Mura advised me to:</p>
<ul>
<li>Go get <span style="color: #800000;">/MySite/includes/eventHandler.cfc</span> and add a new <span style="color: #800000;">onGalleryBodyRender </span>function (See below).</li>
<li>Create a new directory named gallery at <span style="color: #800000;">/MySite/includes/display_objects/custom/gallery</span>. Into this new directory, copy <span style="color: #800000;">index.cfm</span> from <span style="color: #800000;">/default/includes/display_objects/gallery/index.cfm</span>. Now we have a copy of the gallery file to customize, so customize your heart out!</li>
<li>Stay in /gallery/index.cfm. Find the references to <span style="color: #800000;">getSite()</span> and <span style="color: #800000;">queryPermFilter()</span> method calls. Change these to <span style="color: #800000;">renderer.getSite()</span> and <span style="color: #800000;">renderer.queryPermFilter()</span>.</li>
<li>Still in /gallery/index.cfm, change the template path in <span style="color: #800000;">&lt;cfinclude template=&#8221;../dsp_nextN.cfm&#8221;&gt;</span>. The new path should be <span style="color: #800000;">../../../dsp_nextN.cfm</span>.</li>
<li>Reload the app either by clicking Reload Application in the admin, or adding ?appreload to the end of the url. A lot of the objects are loaded when the application starts, so I found it&#8217;s a good idea to reload after making changes.</li>
</ul>
<p>Here&#8217;s the code for the updated eventHandler.cfc:</p>
<p>[cf]</p>
<p>&lt;cffunction name=&quot;onGalleryBodyRender&quot; output=&quot;true&quot; returntype=&quot;void&quot;&gt;<br />
&lt;cfargument name=&quot;event&quot;&gt;<br />
&lt;cfset var renderer=event.getContentRenderer()&gt;<br />
&lt;cfsilent&gt;<br />
&lt;cfset renderer.loadShadowBoxJS() /&gt;<br />
&lt;cfset renderer.addToHTMLHeadQueue(&quot;custom/gallery/htmlhead/gallery.cfm&quot;)&gt;<br />
&lt;cfif not event.valueExists(&#8216;galleryItemID&#8217;)&gt;&lt;cfset event.setValue(&#8216;galleryItemID&#8217;,&#8221;)&gt;&lt;/cfif&gt;<br />
&lt;/cfsilent&gt;</p>
<p>&lt;!&#8212; When you override default output you need to run content throught the renderer.setDynamicContent() method to process [mura] tag calls&#8212;&gt;<br />
&lt;cfoutput&gt;#renderer.setDynamicContent(event.getValue(&#8216;contentBean&#8217;).getBody())#&lt;/cfoutput&gt;</p>
<p>&lt;!&#8212; Now include the customized display object &#8212;&gt;<br />
&lt;cf_CacheOMatic key=&quot;portalBody#event.getValue(&#8216;contentBean&#8217;).getcontentID()##event.getValue(&#8217;startRow&#8217;)##event.getValue(&#8216;galleryItemID&#8217;)#&quot; nocache=&quot;#event.getValue(&#8216;r&#8217;).restrict#&quot;&gt;<br />
&lt;cfinclude template=&quot;display_objects/custom/gallery/index.cfm&quot;&gt;<br />
&lt;/cf_CacheOMatic&gt;</p>
<p>&lt;/cffunction&gt;<br />
[/cf]</p>
<p>I hope this helps someone get started with Mura! If you have suggestions for improving this information or just have a question, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/adventures-in-mura-customizing-a-site/ /feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Using Layouts and Stylesheets</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-using-layouts-and-stylesheets/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-using-layouts-and-stylesheets/ #comments</comments>
		<pubDate>Sun, 06 Sep 2009 17:50:21 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=112</guid>
		<description><![CDATA[On Page 73 of Head First Rails, we need to add a design for the meBay site.
Just like Rails, CFWheels supports layouts to create a master template and to avoid repeating yourself.
For our simple app, we could just work with the default layout located at /views/layout.cfm. But, to follow the book, let&#8217;s create a controller-specific [...]]]></description>
			<content:encoded><![CDATA[<p>On <strong>Page 73</strong> of Head First Rails, we need to add a design for the meBay site.</p>
<p>Just like Rails, CFWheels <a title="Layouts in CFWheels" href="http://cfwheels.org/docs/chapter/using-layouts" target="_blank">supports layouts</a> to create a master template and to avoid repeating yourself.</p>
<p>For our simple app, we could just work with the default layout located at <span style="color: #800000;">/views/layout.cfm</span>. But, to follow the book, let&#8217;s create a controller-specific layout at: <span style="color: #800000;">/views/ads/layout.cfm</span>. So, this layout.cfm in the /view/ads/ subdirectory will only be used for views associated with the ads controller.</p>
<p>[cf]<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;cfoutput&gt;<br />
    &lt;title&gt;Ads: #params.action#&lt;/title&gt;<br />
    #stylesheetLinkTag(&quot;default&quot;)#<br />
    &lt;/cfoutput&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;cfoutput&gt;<br />
    &lt;div id=&quot;wrapper&quot;&gt;<br />
    &lt;div id=&quot;header&quot;&gt;<br />
      &lt;div&gt;<br />
      &lt;h1&gt;MeBay&lt;/h1&gt;<br />
      &lt;ul id=&quot;nav&quot;&gt;<br />
          &lt;li&gt;#linkTo(text=&quot;All Ads&quot;, route=&quot;adsNoKey&quot;)#&lt;/li&gt;<br />
      &lt;/ul&gt;<br />
    &lt;/div&gt;<br />
    &lt;/div&gt;</p>
<p>    &lt;div id=&quot;content&quot;&gt;<br />
        #contentForLayout()#<br />
    &lt;/div&gt;<br />
    &lt;div id=&quot;clearfooter&quot;&gt;&lt;/div&gt;<br />
    &lt;/div&gt;<br />
    &lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;<br />
    &lt;/cfoutput&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/cf]</p>
<p>Most of this code is HTML boilerplate. #params.action# inserts the name of the current action in the Title tag. The params structure is always passed from the controller to the view. It includes the name of the action, variables, etc. You can always cfdump it out if you want to see what all is in there.</p>
<p>#stylesheetLinkTag(&#8220;default&#8221;)# uses another CFWheels helper function. By convention, stylesheets are located in the <span style="color: #800000;">/stylesheets</span> directory. So this function builds the link to our stylesheet named default.css. <a title="Head First Rails Website" href="http://www.headfirstlabs.com/books/hfrails/" target="_blank">Download the code for Chapter 2</a> from the Head First Rails website, and get default.css from the <span style="color: #800000;">/public/stylesheets/</span> folder. In CFWheels, put default.css in your <span style="color: #800000;">/stylesheets</span> folder. If you have trouble with the stylesheet, make sure all the images references are correct. If your web server configuration is different, you might need to adjust the paths.</p>
<p>On line 16, we&#8217;ve setup a link to our index action.</p>
<p>On line 22, you see <span style="color: #800000;">#contentForLayout()#</span>. This is where CFWheels puts the content from the other view pages &#8212; show.cfm and index.cfm. It&#8217;s the equivalent of <span style="color: #800000;">&lt;%= yield %&gt;</span> in Rails.</p>
<p>That&#8217;s it! Now we have a pretty, styled meBay application. Visit <span style="color: #800000;">http://localhost/index.cfm/ads/</span> and see how pretty things look.</p>
<p>Next, it&#8217;s on to Chapter 3. In software development, things always change. And, now meBay wants to let people post ads online!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-using-layouts-and-stylesheets/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Adding a Custom Index Page</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-custom-index-page/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-custom-index-page/ #comments</comments>
		<pubDate>Sun, 06 Sep 2009 15:46:43 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=101</guid>
		<description><![CDATA[Starting on Page 73 of Head First Rails, we need to add an index page so that people can find the pages they want!
First, let&#8217;s add a new route so that http://localhost/index.cfm/ads/ goes to the new index action we&#8217;ll add in a minute.
Open up /config/routes.cfm, and change it to:
[cf]
&#60;cfset addRoute(name=&#34;ads&#34;, pattern=&#34;/ads/[key]&#34;, controller=&#34;ads&#34;, action=&#34;show&#34;)&#62;
&#60;cfset addRoute(name=&#34;adsNoKey&#34;, pattern=&#34;/ads/&#34;, [...]]]></description>
			<content:encoded><![CDATA[<p>Starting on <strong>Page 73</strong> of Head First Rails, we need to add an index page so that people can find the pages they want!</p>
<p>First, let&#8217;s add a new route so that <span style="color: #800000;">http://localhost/index.cfm/ads/</span> goes to the new index action we&#8217;ll add in a minute.</p>
<p>Open up <span style="color: #800000;">/config/routes.cfm</span>, and change it to:</p>
<p>[cf]<br />
&lt;cfset addRoute(name=&quot;ads&quot;, pattern=&quot;/ads/[key]&quot;, controller=&quot;ads&quot;, action=&quot;show&quot;)&gt;<br />
&lt;cfset addRoute(name=&quot;adsNoKey&quot;, pattern=&quot;/ads/&quot;, controller=&quot;ads&quot;, action=&quot;index&quot;)&gt;<br />
&lt;cfset addRoute(name=&quot;catchall&quot;, pattern=&quot;[path]&quot;, controller=&quot;redirect&quot;, action=&quot;index&quot;)&gt;<br />
&lt;cfset addRoute(name=&quot;home&quot;, pattern=&quot;&quot;, controller=&quot;redirect&quot;, action=&quot;index&quot;)&gt;<br />
[/cf]</p>
<p>Notice the new route on line 2: <span style="color: #800000;">&lt;cfset addRoute(name=&#8221;adsNoKey&#8221;, pattern=&#8221;/ads/&#8221;, controller=&#8221;ads&#8221;, action=&#8221;index&#8221;)&gt;</span>. CFWheels checks the routes in order. So, if the URL pattern matches <span style="color: #800000;">/ads/[key]</span>, it will go to the show action. But, if the key isn&#8217;t there, it matches the <span style="color: #800000;">/ads/</span> pattern and goes to the new index action.</p>
<p>Now, we need to add an index action to the controller and then an index.cfm view. Open up <span style="color: #800000;">/controllers/Ads.cfc</span> and add the new index function. Leave the show function alone.</p>
<p>[cf]<br />
&lt;!&#8212; ads/index &#8212;&gt;<br />
&lt;cffunction name=&quot;index&quot;&gt;<br />
    &lt;cfset ads = model(&quot;Ad&quot;).findAll()&gt;<br />
    &lt;cfdump var=&quot;#ads#&quot;&gt;&lt;cfabort&gt;<br />
&lt;/cffunction&gt;<br />
[/cf]</p>
<p>Notice the that we set <span style="color: #800000;">ads = model(&#8220;Ad&#8221;).findAll()</span>.  This tells Wheels, to go get the Ad model, and findAll the data &#8212; Pretty Powerful! The data comes back as a ColdFusion query object.</p>
<p>For testing, put the &lt;cfdump&gt;line  in your controller, and send your browser to:  <span style="color: #800000;">http://localhost/index.cfm/ads/</span>. You&#8217;ll see the query dumped out in all its glory! This is a pretty good debugging trick. Add a &lt;cfdump&gt; to your controller to see what variables and data the controller is passing to the view. Remove the &lt;cfdump&gt; line, and let&#8217;s go create the view.</p>
<p>Go create <span style="color: #993300;">/views/ads/index.cfm</span>:</p>
<p>[cf]<br />
&lt;h1&gt;All Ads&lt;/h1&gt;<br />
&lt;ul&gt;<br />
&lt;cfoutput query=&quot;ads&quot;&gt;<br />
    &lt;li&gt;#linkTo(text=&quot;#ads.name#&quot;, route=&quot;ads&quot;, key=&quot;#ads.id#&quot;)#&lt;/li&gt;<br />
&lt;/cfoutput&gt;<br />
&lt;/ul&gt;<br />
[/cf]</p>
<p>Pretty simple! Specifying the query attribute in <span style="color: #800000;">&lt;cfoutput&gt;</span> makes this just like a <span style="color: #800000;">&lt;cfloop&gt;</span>. You end up with a bunch of List Items (&lt;li&gt;) &#8212; One for each record in the query we got from the controller.</p>
<p><span style="color: #800000;">linkTo()</span> is another cool Wheels helper function. You could just use an &lt;a&gt; tag. However, using the linkTo() function is a <a title="CFWheels linkTo()" href="http://code.google.com/p/cfwheels/wiki/LinkingPages" target="_blank">best practice</a> because it makes your application more portable. We specified the &#8220;ads&#8221; route in the function. If, later on, we changed our subfolders or URL rewriting, everything would still work.</p>
<p>That&#8217;s it. Send your browser to: <span style="color: #800000;">http://localhost/index.cfm/ads/</span> and you should see a list of ads. Each ad will have a link that takes you to the show action and displays the ad.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-custom-index-page/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Fixing the Controller and View</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-fixing-the-controller-and-view/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-fixing-the-controller-and-view/ #comments</comments>
		<pubDate>Sun, 30 Aug 2009 15:21:04 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=95</guid>
		<description><![CDATA[Last time, we setup our route, and now if you go to: http://localhost/index.cfm/ads/3, you won&#8217;t get an error. But, just like on Page 63 of Head First Rails, the ads are blank and the page is kind of boring &#8212; There&#8217;s no data.
First, we need to fix our controller at /controllers/Ads.cfc. Make sure your show [...]]]></description>
			<content:encoded><![CDATA[<p>Last time, we setup our route, and now if you go to: <span style="color: #800000;">http://localhost/index.cfm/ads/3</span>, you won&#8217;t get an error. But, just like on Page 63 of Head First Rails, the ads are blank and the page is kind of boring &#8212; There&#8217;s no data.</p>
<p>First, we need to fix our controller at <span style="color: #800000;">/controllers/Ads.cfc</span>. Make sure your show function looks like:</p>
<p>[cf]<br />
&lt;cffunction name=&quot;show&quot;&gt;<br />
  &lt;!&#8212; Find the record &#8212;&gt;<br />
  &lt;cfset ad = model(&quot;Ad&quot;).findByKey(params.key)&gt;<br />
&lt;/cffunction&gt;<br />
[/cf]</p>
<p>When Wheels created the model, it automatically adds the findByKey method. All we have to do is tell it which key we want, and params.key has the key value!</p>
<p>We still need to fix <span style="color: #800000;">/views/ads/show.cfm</span> to display the data. Change this file to:</p>
<p>[cf]<br />
&lt;cfoutput&gt;<br />
&lt;p&gt;&lt;b&gt;Name:&lt;/b&gt;#ad.name#&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Description:&lt;/b&gt;#ad.description#&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Price:&lt;/b&gt;#ad.price#&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Seller Id:&lt;/b&gt;#ad.seller_id#&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Email:&lt;/b&gt;#ad.email#&lt;/p&gt;<br />
&lt;p&gt;&lt;img src=&quot;#ad.img_url#&quot;/&gt;&lt;/p&gt;<br />
&lt;/cfoutput&gt;<br />
[/cf]</p>
<p>Pretty neat. Just put the values in the view and wrap it up in a &lt;cfoutput&gt; tag! Wheels handles the hard part of getting the data from the database into the model.</p>
<p>Go back to: <span style="color: #800000;">http://localhost/index.cfm/ads/3</span>, and you&#8217;ll see that the data is now being correctly displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-fixing-the-controller-and-view/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; How to Setup and Use Routes</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-how-to-setup-and-use-routes/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-how-to-setup-and-use-routes/ #comments</comments>
		<pubDate>Sun, 30 Aug 2009 14:56:07 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=84</guid>
		<description><![CDATA[Routes offer a way to map web URLs to specific controllers in your application. It&#8217;s one place where you might use configuration in CFWheels.
There&#8217;s a good section in the CFWheels docs on Using Routes.  But, I&#8217;m going to continue following along with the examples in Head First Rails, starting on page 56.
If you try a [...]]]></description>
			<content:encoded><![CDATA[<p>Routes offer a way to map web URLs to specific controllers in your application. It&#8217;s one place where you might use configuration in CFWheels.</p>
<p>There&#8217;s a good section in the CFWheels docs on <a title="CFWheels -- Using Routes" href="http://cfwheels.org/docs/chapter/using-routes" target="_blank">Using Routes</a>.  But, I&#8217;m going to continue following along with the examples in Head First Rails, starting on page 56.</p>
<p>If you try a URL like this: <span style="color: #800000;">http://localhost/index.cfm/ads/3</span>, Wheels will give you an error: <span style="color: #800000;">Could not find the view page for the &#8216;3&#8242; action in the &#8216;ads&#8217; controller</span>. That&#8217;s because, Wheels is looking for the Ads controller with the &#8220;3&#8243; action. Rails would complain that there is no action (Method in the Ads controller) called &#8216;3&#8242;. But, Wheels is smarter and just goes straight to the view. We don&#8217;t have a &#8216;3&#8242; method in Ads.cfc, but Wheels still tries to load a view from <span style="color: #800000;">/views/ads/3.cfm</span>. The file isn&#8217;t there, so it throws an error.</p>
<p>Setting up a Route will let us fix this! Open up <span style="color: #800000;">/config/routes.cfm</span>. It defaults to something like:</p>
<p>[cf]<br />
&lt;cfset addRoute(name=&quot;home&quot;, pattern=&quot;&quot;, controller=&quot;wheels&quot;, action=&quot;congratulations&quot;)&gt;<br />
[/cf]</p>
<p>Did you ever wonder how you got to that nice congratulations page when you just go to:  <span style="color: #800000;">http://localhost/</span>? What happens is that our route, the &#8220;home&#8221; route, says, that if the URL pattern is &#8220;&#8221; (Blank String), Wheels should go the the wheels controller, and run the action congratulations.</p>
<p>Take a peek at <span style="color: #800000;">/controllers/Wheels.cfc</span>. Sure enough, there is a congratulations method that loads up info on the current version of Wheels. And, then of course, it looks for the view in <span style="color: #800000;">/views/wheels/congratulations.cfm</span>. The file is already there as part of the default Wheels installation. If you open it up, you can see the HTML code including the place where it inserts the version information Wheels got from the controller.</p>
<p>The default routes.cfm file is nice, but lets make some changes!</p>
<p>[cf]<br />
&lt;cfset addRoute(name=&quot;ads&quot;, pattern=&quot;/ads/[key]&quot;, controller=&quot;ads&quot;, action=&quot;show&quot;)&gt;<br />
&lt;cfset addRoute(name=&quot;catchall&quot;, pattern=&quot;[path]&quot;, controller=&quot;redirect&quot;, action=&quot;index&quot;)&gt;<br />
&lt;cfset addRoute(name=&quot;home&quot;, pattern=&quot;&quot;, controller=&quot;redirect&quot;, action=&quot;index&quot;)&gt;<br />
[/cf]</p>
<p>It&#8217;s important to understand that Wheels goes through the routes in order from top to bottom. As soon as it finds a match, it goes to the appropriate controller. Here&#8217;s how you interpret this route.cfm:</p>
<ul>
<li><strong>Ads</strong>. If the URL pattern looks like: <span style="color: #800000;">http//localhost/index.cfm/ads/3</span>, go to the show action in the ads controller. Did you notice the pattern includes [key]? This tells Wheels to set the key parameter to whatever is in the URL &#8212; 3 in this case.</li>
<li><strong>Catchall</strong>. If the URL doesn&#8217;t match the Ads pattern, Wheels will try the next pattern. This pattern matches <span style="color: #800000;">[path]</span>. In other words, it matches anything, and puts the value in the path parameter. Actually, it doesn&#8217;t put everything in the path paramter &#8212; Just the part before the next slash, &#8220;/&#8221;. <span style="color: #800000;">http//localhost/index.cfm/xxx/yyy/zzz/3</span> will only have &#8220;xxx&#8221; in the path parameter. A route like this is a good one to add to catch any unknown URLs a user might enter &#8212; Sort of like a 404 Error page.</li>
<li><strong>Home</strong>. If the URL pattern  is blank, we&#8217;ve got one more route to cover that case. Remember, the pattern is just the stuff that comes after <span style="color: #800000;">http//localhost/index.cfm/</span>.</li>
</ul>
<p>Ultimately Routes just offer a convenient way to map a URL to a controller. They are useful for having prettier URLs that make more sense to the users.  You can always use query params in your URL and completely bypass routes. This URL, <span style="color: #800000;">http://localhost/index.cfm?controller=ads&amp;action=show&amp;key=3</span> directly specifies the controller and action, so there&#8217;s no need for Wheels to check the route!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-how-to-setup-and-use-routes/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Creating a Custom Controller and View</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-controller-and-view/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-controller-and-view/ #comments</comments>
		<pubDate>Thu, 27 Aug 2009 20:47:36 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=69</guid>
		<description><![CDATA[We&#8217;re on Page 52 of Head First Rails, and we need to create a custom Controller and View.
I&#8217;m going to keep following the book, but there is a great tutorial that covers the same ideas over on the CFWheels website.
Convention Rules!  CFWheels has conventions for almost everything. As long as you follow the conventions, things [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re on Page 52 of Head First Rails, and we need to create a custom Controller and View.</p>
<p>I&#8217;m going to keep following the book, but there is a <a title="CFWheels Beginner Tutorial" href="http://cfwheels.org/docs/chapter/beginner-tutorial%3a-hello-world" target="_blank">great tutorial </a>that covers the same ideas over on the CFWheels website.</p>
<p>Convention Rules!  CFWheels has conventions for almost everything. As long as you follow the conventions, things just work naturally.</p>
<p>For example, look at a URL like this <span style="color: #993300;">http://localhost/ads/show/5</span>. CFWheels will automatically interpret this to run the <span style="color: #993300;">show </span>function in the <span style="color: #993300;">ads </span>controller. The number 5 is passed as a &#8220;key&#8221;.</p>
<p>Before I keep going, I have to touch on URL rewriting. The URL I just used as an example will only work if your server supports full URL rewriting. I&#8217;m using the ColdFusion development server, and it only offers &#8220;partial&#8221; URL rewriting. So, I have to use a URL like this: <span style="color: #993300;">http://localhost/<strong>index.cfm</strong>/ads/show/5.</span> Notice that <strong>index.cfm</strong> has to be inserted in the URL!</p>
<p>You can also specify the Controller and Action like this: <span style="color: #800000;">http://localhost/index.cfm?controller=ads&amp;action=show&amp;key=5</span>. Doing it this way will always work. It bypasses routes and any server URL rewriting problems. You might want to just use this form of URL while you are learning or if you are debugging a problem.</p>
<p>In any case, the idea is to run the show function in the ads controller. CFWheels will look for <span style="color: #800000;">Ads.cfc</span> in the controller folder, and will look for the show function inside Ads.cfc.</p>
<p>Then, it will run the show function and load the view. It will expect there to be a view file in <span style="color: #800000;">/views/ads </span>named <span style="color: #800000;">show.cfm</span> to match the function you called.</p>
<p>But, guess what? If you don&#8217;t create the Ads.cfc controller, CFWheels, will still try to run the view. Normally, you&#8217;ll want the controller to get some data for you, but if not, you could skip the controller altogether.</p>
<p>Here&#8217;s my controller code for <span style="color: #800000;">/controllers/Ads.cfc</span>:</p>
<p>[cf]<br />
&lt;cfcomponent extends=&quot;Controller&quot;&gt;</p>
<p>    &lt;cffunction name=&quot;index&quot;&gt;</p>
<p>    &lt;/cffunction&gt;</p>
<p>    &lt;cffunction name=&quot;show&quot;&gt;</p>
<p>    &lt;/cffunction&gt;</p>
<p>&lt;/cfcomponent&gt;<br />
[/cf]</p>
<p>Later, we&#8217;ll add some functionality to the controller, but I&#8217;m following the book. And, for now, the only two actions we need are index and show.</p>
<p>At this point, you could try to go to <span style="color: #800000;">http://localhost/index.cfm?controller=ads&amp;action=show&amp;key=5</span>. But, you&#8217;d get a Wheels error because there is no view file.</p>
<p>Here&#8217;s my view code for <span style="color: #993300;">/views/ads/show.cfm</span>:</p>
<p>[cf]<br />
&lt;p&gt;&lt;b&gt;Name:&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Description:&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Price:&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Seller Id:&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;b&gt;Email:&lt;/b&gt;&lt;/p&gt;<br />
&lt;p&gt;&lt;img src=&quot;&quot;/&gt;&lt;/p&gt;<br />
[/cf]</p>
<p>I know, this doesn&#8217;t do much either, but we&#8217;ll add on. Be Patient!</p>
<p>Now, if you go to <span style="color: #800000;">http://localhost/index.cfm?controller=ads&amp;action=show&amp;key=5</span>, you&#8217;ll see the lovely static view file you just created.</p>
<p>Next time, we&#8217;ll look at routes some more, and eventually, we&#8217;ll actually make this app work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-controller-and-view/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Creating a Custom Model</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-model/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-model/ #comments</comments>
		<pubDate>Tue, 25 Aug 2009 15:36:55 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=57</guid>
		<description><![CDATA[Continuing the series on using Head First Rails to learn CFWheels, lets move on to Chapter 2 &#8212; Beyond Scaffolding. We are going to create the MeBay application!
Starting on Page 45 in Head First Rails &#8230;
Whether we use scaffolding or not, we still have to create the database. In Rails, you do this with the [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing the series on using Head First Rails to learn CFWheels, lets move on to Chapter 2 &#8212; Beyond Scaffolding. We are going to create the MeBay application!</p>
<p>Starting on<strong> Page 45</strong> in Head First Rails &#8230;</p>
<p>Whether we use scaffolding or not, we still have to create the database. In Rails, you do this with the <span style="color: #800000;">script/generate model</span> command and then running <span style="color: #800000;">rake</span>. But, in CFWheels, it&#8217;s easiest to just use SQL and create the database directly. Here is some mySQL code to create the needed ads table.</p>
<p>[sql]</p>
<p>CREATE TABLE `ads` (<br />
`id` INTEGER PRIMARY KEY NOT NULL auto_increment,<br />
`name` varchar(255),<br />
`description` text,<br />
`price` decimal,<br />
`seller_id` integer,<br />
`email` varchar(255),<br />
`img_url` varchar(255),<br />
`created_at` datetime,<br />
`updated_at` datetime<br />
);<br />
[/sql]</p>
<p>Later on, we&#8217;ll want to populate the table with some sample data, so let me go ahead and show the full SQL that creates the table and adds the test data:</p>
<p>[sql]<br />
DROP TABLE IF EXISTS `ads` ;<br />
CREATE TABLE `ads` (<br />
`id` INTEGER PRIMARY KEY NOT NULL auto_increment,<br />
`name` varchar(255),<br />
`description` text,<br />
`price` decimal,<br />
`seller_id` integer,<br />
`email` varchar(255),<br />
`img_url` varchar(255),<br />
`created_at` datetime,<br />
`updated_at` datetime<br />
);<br />
INSERT INTO `ads` VALUES(1,&#8217;Typewriter&#8217;,'Old manual typewriter. Many years useful service. Works best with a bottle next to it.&#8217;,71.95,54,&#8217;dhammett@email.com&#8217;,'http://homepage.mac.com/david_griffiths/typewriter.png&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(2,&#8217;Football&#8217;,'Some strings frayed.&#8217;,74.02,45,&#8217;marty@googlemail.com&#8217;,'http://www.freefever.com/freeclipart/clipart/football2.gif&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(3,&#8217;Moosehead&#8217;,'Slightly moth-eaten. One of the antlers is broken and there&#8217;&#8217;s a strange buzzing sound behind the eyes&#8230;&#8217;,2978.25,56,&#8217;kathy@hotmail.com&#8217;,'http://saloon.javaranch.com/ubb/moosefly.gif&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(4,&#8217;Desk&#8217;,'Milk desk &#8211; go&#8230;&#8217;,4800,123,&#8217;andy@allmail&#8230;.&#8217;,'http://picasaweb.goog&#8230;&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(5,&#8217;Door curtain&#8217;,'Beaded door cu&#8230;&#8217;,11,773,&#8217;dawn@hotmail&#8230;.&#8217;,'http://www.freewebsit&#8230;&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(6,&#8217;Apple Newton&#8217;,'Still works! M&#8230;&#8217;,25,2,&#8217;ahertz@differ&#8230;&#8217;,'http://www.differnet&#8230;.&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(7,&#8217;Sinclair C5&#8242;,&#8217;Battery flat t&#8230;&#8217;,372.06,346,&#8217;clive@sinclai&#8230;&#8217;,'http://www.ebay.com/w&#8230;&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(8,&#8217;Edsel&#8217;,'Never used aut&#8230;&#8217;,355,755,&#8217;bing@badabing&#8230;&#8217;,'http://pages.google.c&#8230;&#8217;,&#8221;,&#8221;);<br />
INSERT INTO `ads` VALUES(37,&#8217;Diamond&#8217;,'203.4 carats, grade D pear cut diamond. Low price for quick sale. Owner leaving the country.&#8217;,1000000,5234,&#8217;pink@panther.com&#8217;,'http://&#8217;,&#8221;,&#8221;);<br />
[/sql]</p>
<p>It&#8217;s easy enough to manually create the Model, but for convenience, let&#8217;s use the scaffolding plugin anyway.</p>
<p>Click the <strong><span style="text-decoration: underline;"><span style="color: #993300;">Scaffold</span></span></strong> link at the bottom of any CFWHeels page &#8211;  In the debug section, next to Plugins. Then, on the scaffold page, enter <span style="color: #800000;">ad</span> as the Object name, select Model from the Type drop down, and click Generate. Remember, the table is named <span style="color: #800000;">ads</span> (plural with an “s”), but the the model is named <span style="color: #800000;">ad</span> (singular).</p>
<p>Now, open /models/Ad.cfc. You&#8217;ll see something that looks like:</p>
<p>[cf]<br />
&lt;cfcomponent extends=&quot;Model&quot;&gt;</p>
<p>&lt;!&#8212; All initialization related tasks are done in the &quot;init&quot; function which is run the first time the model is requested. &#8212;&gt;<br />
&lt;cffunction name=&quot;init&quot;&gt;<br />
&lt;/cffunction&gt;</p>
<p>&lt;/cfcomponent&gt;<br />
[/cf]</p>
<p>That&#8217;s all it takes to create a model! Your model must extend Model.cfc &#8212; That&#8217;s where all the CFWheels goodness happens. Other than that, all you need is an init function. Later on, you can use the init function to add extra capabilities, but for now, all that&#8217;s needed is a blank init function!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-creating-a-custom-model/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels &#8212; Adding a new table with model, view, and controller</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-new-table-with-model-view-and-controller/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-new-table-with-model-view-and-controller/ #comments</comments>
		<pubDate>Sun, 16 Aug 2009 18:34:16 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=43</guid>
		<description><![CDATA[In Part 2, we looked at Editing the View in CFWheels.
We thought we were done, but now the boss wants to record events along with ticket sales. Remember we are following along in Head First Rails, and converting everything to CFWheels!
Fortunately, with scaffolding, all we need to do is create the new database table and [...]]]></description>
			<content:encoded><![CDATA[<p>In Part 2, we looked at <a title="Editing the View in CFWheels" href="http://www.resultantsys.com/index.php/coldfusion/editing-the-view-in-cfwheels/" target="_blank">Editing the View in CFWheels</a>.</p>
<p>We thought we were done, but now the boss wants to record events along with ticket sales. Remember we are following along in <a title="Head First Rails" href="http://www.amazon.com/gp/product/0596515774?ie=UTF8&amp;tag=distanz&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596515774" target="_blank">Head First Rails</a>, and converting everything to CFWheels!</p>
<p>Fortunately, with scaffolding, all we need to do is create the new database table and run the scaffolding plugin.</p>
<p>Here&#8217;s the create table SQL query:</p>
<blockquote><p>CREATE TABLE `events` (<br />
`id` int(11) NOT NULL auto_increment,<br />
`artist` varchar(255) NOT NULL,<br />
`description` text,<br />
`price_low` decimal NOT NULL,<br />
`price_high` decimal NOT NULL,<br />
`event_date` date NOT NULL,<br />
PRIMARY KEY  (`id`)<br />
)</p></blockquote>
<p>I got the idea from a Rails app to create a &#8220;spec&#8221; directory to hold application specification information. And, I created a database sub-directory to hold all my table creation SQL. So the query is stored in <span style="color: #993300;">/spec/database/events.sql</span>.</p>
<p>Next, click the <strong><span style="text-decoration: underline;"><span style="color: #993300;">Scaffold</span></span></strong> link. Look in the debug information at the bottom of each page, next to Plugins. Then, on the scaffold page, enter <span style="color: #993300;">event </span>as the Object name, and click Generate. Remember, the table is named <span style="color: #993300;">events </span>(plural with an &#8220;s&#8221;), but the the object is named <span style="color: #993300;">event </span>(singular).</p>
<p>All that&#8217;s left is to open <span style="color: #993300;">/views/events</span>/ and edit the labels in <span style="color: #993300;">edit.cfm, index.cfm, new.cfm</span> and s<span style="color: #993300;">how.cfm</span>. This last step isn&#8217;t really needed to make things work, but the boss is kind of picky.</p>
<p>Great &#8212; We&#8217;ve finished with Chapter 1 of Head First Rails. You now know how to:</p>
<ul>
<li>Create a new CFWheels application</li>
<li>Install the scaffolding plugin to CFWheels</li>
<li>Setup a database table and  use scaffolding to automatically generate the Model, View, and Controller code.</li>
<li>Edit HTML in the View</li>
<li>Add fields and new tables to the database</li>
</ul>
<p>Next time, we&#8217;ll start Chapter 2, and build an application from scratch &#8212; Without using scaffolding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-adding-a-new-table-with-model-view-and-controller/ /feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Editing the View in CFWheels</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/editing-the-view-in-cfwheels/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/editing-the-view-in-cfwheels/ #comments</comments>
		<pubDate>Wed, 12 Aug 2009 15:55:29 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=36</guid>
		<description><![CDATA[In Part 1, we looked at Scaffolding Basics in CFWheels.
Now, I&#8217;ll continue working through the exercises in Head First Rails and converting things to CFWheels.
Page 27: Edit the HTML in the View
When you use scaffolding, the labels will be the same as the field names in the database. This may be OK, but if you [...]]]></description>
			<content:encoded><![CDATA[<p>In <strong>Part 1</strong>, we looked at <a title="Part 1: Scaffolding Basics" href="http://www.resultantsys.com/index.php/coldfusion/cfwheels-scaffolding-basics/" target="_blank">Scaffolding Basics in CFWheels</a>.</p>
<p>Now, I&#8217;ll continue working through the exercises in Head First Rails and converting things to CFWheels.</p>
<p><strong>Page 27: Edit the HTML in the View</strong></p>
<p>When you use scaffolding, the labels will be the same as the field names in the database. This may be OK, but if you need to change them to make them more readable by humans, it&#8217;s easy enough to edit the HTML in the views.</p>
<ul>
<li>Look at the directory for <span style="color: #993300;">webroot/views/tickets</span>. You&#8217;ll see four files named edit.cfm, index.cfm, new.cfm, and show.cfm. These are the four files that you need to edit.</li>
<li>Open up edit.cfm, and you&#8217;ll see the code like: <span style="color: #993300;">&lt;label&gt;Seat_id_seq&lt;/label&gt;</span>. Seat_id_seq isn&#8217;t a very human-friendly label, so let&#8217;s change it to Seat #.</li>
<li>Change the code to <span style="color: #993300;">&lt;label&gt;Seat ##&lt;/label&gt;</span>. Remember this is inside a &lt;cfoutput&gt; block, so you have to escape the # symbol by typing it twice.</li>
<li>Open index.cfm and change the appropriate line to <span style="color: #993300;">&lt;cfcol header=&#8221;Seat ##&#8221; text=&#8221;#seat_id_seq#&#8221; /&gt;</span>.</li>
<li>Now make similar changes to new.cfm and show.cfm.</li>
<li>Save everything, then go to <span style="color: #993300;">http://localhost/tickets/index.cfm?controller=tickets&amp;action=index<span style="color: #000000;"> to see your beautiful new labels!</span></span></li>
</ul>
<p>I made one other change to the code to make things work correctly! At the bottom of the show.cfm file, there&#8217;s a line that starts out with<br />
<span style="color: #993300;">#linkTo(text=&#8221;Return to the listing&#8221;, action=&#8221;action&#8221;)#</span>. This may be a bug in scaffolding, or maybe I did something wrong. This line should really say:<br />
#linkTo(text=&#8221;Return to the listing&#8221;, action=&#8221;<strong><span style="color: #993300;">index</span></strong>&#8220;)#. This way, the link will go back to the index view.</p>
<p><strong>Page 31: Adding a new data field</strong></p>
<p>The Boss forgot that we need a phone number field, so now we have to add it!</p>
<p>In Rails, you have to do<span style="color: #993300;"> &gt; script/generate migration &#8230;</span> and then run <span style="color: #993300;">&gt; rake db:migrate</span>. In CFWheels, we&#8217;ll just run an Alter Table query on the database. Here&#8217;s the query I ran:</p>
<blockquote><p>ALTER TABLE tickets<br />
ADD phone varchar(255)</p></blockquote>
<p>But, just like with Rails, changing the database isn&#8217;t enough (Page 36). We still have to update the code in the View files to handle the new field. Here&#8217;s the code I added to edit.cfm and new.cfm:</p>
<blockquote><p>&lt;p&gt;&lt;label&gt;Phone&lt;/label&gt; &lt;br /&gt;<br />
#textField(objectName=&#8217;ticket&#8217;, property=&#8217;phone&#8217;)#&lt;/p&gt;</p></blockquote>
<p>Notice the <span style="color: #800000;">textField()</span> function. This is the CFWheels equivalent of <span style="color: #800000;">&lt;%= f.text_field :phone %&gt;</span>. Rails also has the <span style="color: #800000;">f.label</span> function. I&#8217;m not sure of the advantages of using a helper function for labels. But, this doesn&#8217;t seem to be available in CFWheels &#8212; At least not yet!</p>
<p>By the way, you can get details on any helper function like the textField tag at:</p>
<p><a title="CFWheels at code.google.com" href="http://code.google.com/p/cfwheels/wiki/textFieldTag" target="_blank">http://code.google.com/p/cfwheels/wiki/textFieldTag</a></p>
<p>The changes to show.cfm and index.cfm are similar. If you have any trouble, leave me a comment!</p>
<p>I heard a rumor that the Boss wants to add event information to our application. We&#8217;ll look at this next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/editing-the-view-in-cfwheels/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFWheels Scaffolding Basics</title>
		<link>http://www.resultantsys.com/index.php/coldfusion/cfwheels-scaffolding-basics/ </link>
		<comments>http://www.resultantsys.com/index.php/coldfusion/cfwheels-scaffolding-basics/ #comments</comments>
		<pubDate>Tue, 11 Aug 2009 12:09:27 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[CFWheels]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=26</guid>
		<description><![CDATA[I choose CFWheels as my first ColdFusion framework to learn. I was going to learn ColdBox, but quickly discovered that I would really have to learn Transfer or Reactor and Coldspring at the same time. These may be good tools, but I wanted to focus mostly on mastering the Model View Controller pattern.
I&#8217;ve been really [...]]]></description>
			<content:encoded><![CDATA[<p>I choose CFWheels as my first ColdFusion framework to learn. I was going to learn ColdBox, but quickly discovered that I would really have to learn Transfer or Reactor and Coldspring at the same time. These may be good tools, but I wanted to focus mostly on mastering the Model View Controller pattern.</p>
<p>I&#8217;ve been really pleased with CFWheels. It&#8217;s the ColdFusion answer to Ruby on Rails, and it just makes sense to me!</p>
<p>The documentation is good. Still, for a new learner, some things are missing. So, I thought maybe I can leverage some Rails resources. I found a great book &#8212; Head First Rails. I&#8217;m going to do some posts on translating the book to CFML and to CFWheels. I think this will help my learning and may help others.</p>
<p>From here, I&#8217;m assuming that you know something about web development, CFML, and already have a ColdFusion server running on your computer. If not, this information may be too advanced for you. CFWheels runs great on the development edition of ColdFusion that&#8217;s available from Adobe. Railo is also supported. You can learn more about the requirements at: <a title="CFWheels System Requirements" href="http://cfwheels.org/docs/chapter/requirements" target="_blank">http://cfwheels.org/docs/chapter/requirements</a>.</p>
<p>Now on to <strong><a title="Head First Rails" href="http://www.amazon.com/gp/product/0596515774?ie=UTF8&amp;tag=distanz&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0596515774" target="_blank">Head First Rails</a>, Chapter 1: Really Rapid CFWheels</strong></p>
<p><strong>Page 7: Creating a New A</strong><strong>pplication<br />
</strong></p>
<p>In Rails, you open a command prompt and type <span style="color: #993300;">&gt; rails tickets</span>.  This sets up the folder structure for your app.</p>
<p>In CFWheels, you do the same thing by <a title="Download CFWheels" href="http://cfwheels.org/download" target="_blank">downloading the CFWheels files</a> and just unzipping them to a folder named <span style="color: #993300;">tickets </span>in your webroot. The name of the <em><strong>folder </strong></em>is <em><strong>very </strong></em>important. CFWheels and Rails both rely on convention instead of configuration. Things have to be named consistently!</p>
<p><strong>Page 14: Creating Tables (Migration)</strong></p>
<p>In Rails, you create tables in the database by going to a command prompt and typing <span style="color: #993300;">&gt; ruby script/generate scaffold tickets &#8230;</span> Then, you have to run a migration by typing <span style="color: #993300;">&gt; rake db.migrate</span>. These two commands also write code for your application! Rails will automatically create Model, View, and Controller files for your new table.</p>
<p>CFWheels handles this a little differently, but you can quickly get to the same place. First, you have to install the Scaffolding plugin.</p>
<ul>
<li><a title="Download Scaffolding" href="http://scaffoldwheels.riaforge.org/" target="_blank">Download the scaffolding plugin</a></li>
<li>Save the .zip file in your wwwroot/tickets/plugins folder.</li>
<li>Reload CFWheels by running this URL in your browser: <span style="color: #993300;">http://localhost/tickets/?reload=true</span></li>
<li>CFWheels will automatically unzip and install the file! You&#8217;ll see Scaffold listed as a plugin at the bottom of the page along with other debugging information.</li>
<li><span style="text-decoration: line-through;"><em><strong>NOTE: Apparently there&#8217;s a problem with the Plugin Manager right now. </strong></em>I had to delete the Plugin Manager files from the plugins directory. Then, this process worked for me.</span> I discovered the problem was with my ColdFusion server configuration. I had added a Dump() method to Component.cfc. When Wheels tried to load multiple plug-ins, it saw the duplicated method, and threw an error as a result of the naming conflict.</li>
</ul>
<p>You&#8217;ll only need to do the steps above once. Now, lets use scaffolding to create an app in CFWheels. Instead of using the script/generate syntax, CFWheels expects you to just create your table via a SQL query or whatever database tools you like to use. Most developers know how to do this, and I like this approach better than learning a new syntax in Rails!</p>
<p>Here&#8217;s my Create Table SQL script. This is essentially the same command you type into Rails via script/generate.</p>
<blockquote><p>CREATE TABLE `tickets` (<br />
`id` int(11) NOT NULL auto_increment,<br />
`name` varchar(255) NOT NULL,<br />
`seat_id_seq` varchar(255) NOT NULL,<br />
`address` text NOT NULL,<br />
`price_paid` decimal NOT NULL,<br />
`email_address` varchar(255) DEFAULT NULL,<br />
PRIMARY KEY  (`id`)<br />
)</p></blockquote>
<p>Now, it get&#8217;s really easy. Either click the Scaffold link on the bottom of your browser screen, or point your browser to <span style="color: #993300;">http://localhost/tickets/index.cfm?controller=wheels&amp;action=plugins&amp;name=scaffold</span>. This will display the scaffolding plugin screen.</p>
<p>Just enter the name of the table and click Generate. That&#8217;s it! Instant Application. Go to  <span style="color: #993300;">http://localhost/tickets/index.cfm?controller=tickets&amp;action=index</span> to see your new application. Rails automatically creates a route, so their URL is simpler, and you can easily do the same thing if you want. For me, when learning, I&#8217;d rather see the controller and action clearly shown in the URL. There&#8217;s always time to switch to pretty URL&#8217;s later on.</p>
<p>Next we&#8217;ll edit the HTML in the view. But, that&#8217;s another post. Please leave a comment if I got something wrong or you like my approach!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/coldfusion/cfwheels-scaffolding-basics/ /feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Rich User Interfaces for Web Applications</title>
		<link>http://www.resultantsys.com/index.php/ria/rich-user-interfaces-for-web-applications/ </link>
		<comments>http://www.resultantsys.com/index.php/ria/rich-user-interfaces-for-web-applications/ #comments</comments>
		<pubDate>Fri, 04 Apr 2003 00:56:27 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[Rich Internet Applications]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=3</guid>
		<description><![CDATA[Rich User Interfaces for Web Applications
In the early 1990&#8217;s, many companies were developing client/server applications. There would be a back end database, along with a server that accessed the database and added logic and processing to the data. And, there would be a custom client written with a tool like Visual Basic.
Then, in the mid-1990&#8217;s, [...]]]></description>
			<content:encoded><![CDATA[<p>Rich User Interfaces for Web Applications</p>
<p>In the early 1990&#8217;s, many companies were developing client/server applications. There would be a back end database, along with a server that accessed the database and added logic and processing to the data. And, there would be a custom client written with a tool like Visual Basic.</p>
<p>Then, in the mid-1990&#8217;s, the Web changed everything! Developers realized that a web browser could provide the functions of the custom client. The Internet made sure that the network was universally available, and nearly every Internet user had a web browser.</p>
<p>Unfortunately, HTML and other web standards were originally designed to provide layout for static, non-changing documents. By switching from custom client software to web browser clients, the applications became universally accessible. But, the user interface took a big step backwards!</p>
<p>Have you ever tried to go online to buy an airline ticket? As long as you know exactly what you want&#8211;Which flights and which days&#8211;Everything goes fairly smoothly. And, it still takes several mouse clicks and page reloads to get your ticket purchased. But, what if you just want to find a low cost way to take a vacation, and your flight plans and schedule are flexible. Most online travel sites aren&#8217;t designed to support flexible travelers. Users end up having to repeatedly go through all those mouse clicks and page reloads looking for a low cost option.</p>
<p>Wouldn&#8217;t it be much easier if a rich user interface was available? A rich user interface is one that minimizes mouse clicks, does not require page reloads, and makes it much easier to do flexible queries. Macromedia&#8217;s new Flash MX product provides the missing capabilities needed to build rich user interfaces.</p>
<p>The online reservation system shown below for the Broadmoor Hotel provides a great example of a rich user interface. With no page reloads, the user can choose a date in the left-hand panel, and see available rooms in the middle panel. Or, a user can pick a room type, and have the dates highlighted when that type of room is available! When it&#8217;s time to book a room, that happens in the right-hand panel. Everything is available on the single screen&#8211;Even validation for credit card or booking information. Try it yourself at http://reservations.broadmoor.com!</p>
<div id="attachment_5" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-5" title="broodmoor" src="http://www.resultantsys.com/wp-content/uploads/broodmoor.gif" alt="Broodmoor Rich Internet Application Example" width="600" height="447" /><p class="wp-caption-text">Broodmoor Rich Internet Application Example</p></div>
<p>It&#8217;s easy to imaging a wide variety of possible applications for rich user interfaces including:</p>
<ul>
<li>Reservation systems for sporting events, conference rooms, special events, etc.</li>
<li>Form processing for insurance companies, banks, or any other company needing flexible, validated forms.</li>
<li>Online report generation and data visualization.</li>
<li>e-Commerce</li>
<li>Customer or Employee self-service applications for customer service, HR, support, etc.</li>
</ul>
<p>Clearly, rich user interfaces will be critical for both external, customer-focused web applications and for internal, employee-focused applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/ria/rich-user-interfaces-for-web-applications/ /feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is a Web Application Server?</title>
		<link>http://www.resultantsys.com/index.php/general/what-is-a-web-application-server/ </link>
		<comments>http://www.resultantsys.com/index.php/general/what-is-a-web-application-server/ #comments</comments>
		<pubDate>Thu, 03 Apr 2003 14:18:08 +0000</pubDate>
		<dc:creator>Clarke Bishop</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.resultantsys.com/?p=9</guid>
		<description><![CDATA[First, What is a Web Server?
A web server is a specialized type of file server. Its job is to retrieve files from the server&#8217;s hard drive, format the files for the Web browser, and send them out via the network. Web servers are designed to do a great job of sending static content out to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>First, What is a Web Server?</strong></p>
<p>A web server is a specialized type of file server. Its job is to retrieve files from the server&#8217;s hard drive, format the files for the Web browser, and send them out via the network. Web servers are designed to do a great job of sending static content out to a large number of users. The pages delivered by the server are expected to be the same for everyone who visits the server.</p>
<p>The function of a typical Web server is shown below. The user requests a web page. The Web Server finds the web page file in a local directory and sends it back out to the user. When graphic files are requested, the same thing happens. The Web Server finds the requested graphic files and sends them back to the user.<br />
The Web Server standards were originally designed to publish static documents on the Internet. There was a limited capability for accessing dynamic content, but this was never intended to support high volume, highly interactive Web applications.</p>
<div id="attachment_11" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-11" title="How a Web server works" src="http://www.resultantsys.com/wp-content/uploads/webserver.gif" alt="How a Web server works" width="600" height="325" /><p class="wp-caption-text">How a Web server works</p></div>
<p>Then, as the Internet and Web browsers became popular in the mid-1990&#8217;s, organizations saw an opportunity to provide web pages that contained dynamic content like stock prices, weather information, inventory levels, and shipping status for a package. Web browsers became such a pervasive way to access information that users and organizations desired to access a wide variety of information and applications through their Web browser. So, Web servers had to be extended to allow software application development and access to databases.<br />
<strong>Then, What is a Web Application Server?</strong></p>
<p>Web application servers are designed specifically to extend web servers to support dynamic content. The application server software &#8220;hooks in&#8221; to the web server software and automatically intercepts any user requests for dynamic content. The web server still sends out static web pages and graphic files&#8211;Just like before. But now, the application server can create dynamic content by mixing data with templates, running programs, or by accessing databases.</p>
<div id="attachment_15" class="wp-caption alignnone" style="width: 610px"><img class="size-full wp-image-15" title="How a Web Application server works" src="http://www.resultantsys.com/wp-content/uploads/appserver.gif" alt="How a Web Application server works" width="600" height="418" /><p class="wp-caption-text">How a Web Application server works</p></div>
<p>There are a variety of Web Application Server product available. Some of the more popular products include:<br />
Macromedia:<br />
Cold Fusion</p>
<p>Cold Fusion is inexpensive and easy to learn resulting in low cost for both development and implementation. Its may be less applicable for complex or high-volume projects.</p>
<p>Microsoft:<br />
Active Server Pages and .Net</p>
<p>For companies that have already committed to Microsoft, the Active Server Pages (ASP) application server included with IIS is a good choice. ASP code is usually written in Visual Basic, and there a large number of qualified developers resulting in moderate development cost. ASP typically only runs with Microsoft operating systems, so it is not a great choice for high-volume projects that will run on Unix hardware..</p>
<p>Microsoft is migrating ASP to its new .Net product. This product offers a lot of potential, but as of May, 2002, all the components are still not released and .Net is still unproven.<br />
Java 2<br />
Enterprise Edition</p>
<p>Java 2 Enterprise Edition (J2EE) is a great choice for enterprise and mission critical applications. It is highly scalable and can run under almost any operating system from Windows to high-end Unix servers. J2EE code is written in Java.</p>
<p>J2EE application servers are available from over 30 vendors including IBM (WebSphere), Sun (iPlanet) BEA (WebLogic), Macromedia (jRun). There are even several open source J2EE servers (Tomcat, Resin, &amp; jBoss).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.resultantsys.com/index.php/general/what-is-a-web-application-server/ /feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

