<?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>#Adam.Blog# &#187; ColdFusion</title>
	<atom:link href="http://blog.adampresley.com/tag/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adampresley.com</link>
	<description>I&#039;m bringin&#039; nerdy back.</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:59:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/><atom:link rel="hub" href="http://github.com/tonyg/rabbithub"/>		<item>
		<title>My Resume on ColdFusion + FW/1 + CouchDB</title>
		<link>http://blog.adampresley.com/2010/my-resume-on-coldfusion-fw1-couchdb/</link>
		<comments>http://blog.adampresley.com/2010/my-resume-on-coldfusion-fw1-couchdb/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 00:29:58 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[CouchDB]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1084</guid>
		<description><![CDATA[The last few days I decided I wanted to play around with Apache&#8217;s CouchDB, one of the more popular database engines in the No-SQL movement. For those who have never heard of it CouchDB is a database engine written in Erlang, and is an Apache Foundation project. One of the neatest things about CouchDB is [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The last few days I decided I wanted to play around with Apache&#8217;s CouchDB, one of the more popular database engines in the No-SQL movement. For those who have never heard of it <a href="http://couchdb.apache.org/">CouchDB</a> is a database engine written in Erlang, and is an Apache Foundation project. One of the neatest things about CouchDB is that the API is based entirely on RESTful JSON services, so all command to it are HTTP commands like PUT, GET, POST, and DELETE. All data is stored as JSON objects known as &#8220;documents&#8221;. When you have a chance take a look at it.</p>

<p>For me the project I always fall back to when I want to try something new is my Resume project. I&#8217;ve kept my resume online for several years now. My first version of it was to proof-of-concept my PHP framework, and this worked well for a long time. I then modified it to work with ColdFusion, Groovy, and Hibernate with MySQL as the persistence layer. That was fun too. Now I set out to redo this in ColdFusion with CouchDB as the persistence layer.</p>

<p>The result is a ColdFusion application using Sean Corfield&#8217;s excellent <a href="http://fw1.riaforge.org/">FW/1</a> framework, my <a href="https://sourceforge.net/projects/couchdb4cf/">CouchDB4CF</a> Java facade, and Apache CouchDB. Check it out at <a href="http://resume.adampresley.com">http://resume.adampresley.com</a>. I&#8217;ll post more soon about how it is built.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/my-resume-on-coldfusion-fw1-couchdb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adding Namespaces to HTML Tag Using Regular Expressions</title>
		<link>http://blog.adampresley.com/2010/adding-namespaces-to-html-tag-using-regular-expressions/</link>
		<comments>http://blog.adampresley.com/2010/adding-namespaces-to-html-tag-using-regular-expressions/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 23:37:44 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Regex]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1077</guid>
		<description><![CDATA[My friend, Mr. Steve Good, approached me about a problem he was having where he needed to add a namespace to an HTML tag at runtime. Essentially he was parsing some dynamic HTML and wished to inject an additional namespace into the HTML declaration. Regular expressions to the rescue! The first test I ran was [...]


Related posts:<ol><li><a href='http://blog.adampresley.com/2009/finding-specific-text-in-a-string-using-coldfusion-and-java/' rel='bookmark' title='Permanent Link: Finding Specific Text in a String using ColdFusion and Java'>Finding Specific Text in a String using ColdFusion and Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>My friend, <a href="http://stevegood.org">Mr. Steve Good</a>, approached me about a problem he was having where he needed to add a namespace to an HTML tag at runtime. Essentially he was parsing some dynamic HTML and wished to inject an additional namespace into the HTML declaration. Regular expressions to the rescue! The first test I ran was with a blank &lt;HTML&gt; tag. For this example I will be injecting the SVG, or Scalable Vector Graphics namespace. To accomplish this in ColdFusion we simply are using the <strong>replaceAll</strong> method against the <strong>String</strong> class in Java.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> old <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;&lt;html&gt;&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;">cfset</span> new <span style="color: #0000FF;">=</span> old.replaceAll<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;(?i)(?&lt;=&lt;html)(.*?)&gt;&quot;</span>, <span style="color: #009900;">&quot;$1 xmlns:svg=&quot;</span><span style="color: #009900;">&quot;http://www.w3.org/2000/svg&quot;</span><span style="color: #009900;">&quot;&gt;&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfdump</span> <span style="color: #000000; font-weight: bold;">var</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#new#&quot;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>


<p>When you run that you will get something that looks like this.</p>

<p><a class="thickbox" rel="same-post-1077" title = "Namespace Replace 1" href="http://blog.adampresley.com/wp-content/uploads/2010/08/namespace-replace-1.png"><img src="http://blog.adampresley.com/wp-content/uploads/2010/08/namespace-replace-1.png" alt="" title="Namespace Replace 1" width="384" height="45" class="alignnone size-full wp-image-1079" /></a></p>

<p>The next task was to ensure that if the HTML tag already had a namespace our regex won&#8217;t erase it, but will instead append the new namespace to it. Let&#8217;s see that code.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> old <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;&lt;html xmlns=&quot;</span><span style="color: #009900;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #009900;">&quot;&gt;&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;">cfset</span> new <span style="color: #0000FF;">=</span> old.replaceAll<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;(?i)(?&lt;=&lt;html)(.*?)&gt;&quot;</span>, <span style="color: #009900;">&quot;$1 xmlns:svg=&quot;</span><span style="color: #009900;">&quot;http://www.w3.org/2000/svg&quot;</span><span style="color: #009900;">&quot;&gt;&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfdump</span> <span style="color: #000000; font-weight: bold;">var</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#new#&quot;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>


<p><a class="thickbox" rel="same-post-1077" title = "Namespace Replace 2" href="http://blog.adampresley.com/wp-content/uploads/2010/08/namespace-replace-2.png"><img src="http://blog.adampresley.com/wp-content/uploads/2010/08/namespace-replace-2.png" alt="" title="Namespace Replace 2" width="613" height="43" class="alignnone size-full wp-image-1080" /></a></p>

<p>Yup, as we can see by the above screenshot it seems to work! I love me some regular expressions. Happy coding!</p>


<p>Related posts:<ol><li><a href='http://blog.adampresley.com/2009/finding-specific-text-in-a-string-using-coldfusion-and-java/' rel='bookmark' title='Permanent Link: Finding Specific Text in a String using ColdFusion and Java'>Finding Specific Text in a String using ColdFusion and Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/adding-namespaces-to-html-tag-using-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Code for my Dallas TechFest 2010 Presentation Available</title>
		<link>http://blog.adampresley.com/2010/code-for-my-dallas-techfest-2010-presentation-available/</link>
		<comments>http://blog.adampresley.com/2010/code-for-my-dallas-techfest-2010-presentation-available/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 15:45:08 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1072</guid>
		<description><![CDATA[Finally, as requested, my code and slides for my Dallas TechFest 2010 presentation are available for download. If you missed it I presented on taking an existing ColdFusion application (could be anything, PHP, JSP, Groovy + Grails) and incrementally spicing it up with jQuery. Click here to download the code and instructions on getting setup! [...]


Related posts:<ol><li><a href='http://blog.adampresley.com/2010/using-jqgrid-with-coldfusion/' rel='bookmark' title='Permanent Link: Using jqGrid with ColdFusion'>Using jqGrid with ColdFusion</a></li>
<li><a href='http://blog.adampresley.com/2010/fisheye-menu-with-jquery/' rel='bookmark' title='Permanent Link: Fisheye Menu with jQuery'>Fisheye Menu with jQuery</a></li>
<li><a href='http://blog.adampresley.com/2009/example-of-jquery-autocomplete-with-coldfusion/' rel='bookmark' title='Permanent Link: Example of jQuery Autocomplete with ColdFusion'>Example of jQuery Autocomplete with ColdFusion</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Finally, as requested, my code and slides for my Dallas TechFest 2010 presentation are available for download. If you missed it I presented on taking an existing ColdFusion application (could be anything, PHP, JSP, Groovy + Grails) and incrementally spicing it up with <a href="http://jquery.com">jQuery</a>. Click <a href="http://blog.adampresley.com/software-development/movie-mania-dallas-techfest-2010-presentation/">here</a> to download the code and instructions on getting setup!</p>


<p>Related posts:<ol><li><a href='http://blog.adampresley.com/2010/using-jqgrid-with-coldfusion/' rel='bookmark' title='Permanent Link: Using jqGrid with ColdFusion'>Using jqGrid with ColdFusion</a></li>
<li><a href='http://blog.adampresley.com/2010/fisheye-menu-with-jquery/' rel='bookmark' title='Permanent Link: Fisheye Menu with jQuery'>Fisheye Menu with jQuery</a></li>
<li><a href='http://blog.adampresley.com/2009/example-of-jquery-autocomplete-with-coldfusion/' rel='bookmark' title='Permanent Link: Example of jQuery Autocomplete with ColdFusion'>Example of jQuery Autocomplete with ColdFusion</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/code-for-my-dallas-techfest-2010-presentation-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merging Two ColdFusion Structs</title>
		<link>http://blog.adampresley.com/2010/merging-two-coldfusion-structs/</link>
		<comments>http://blog.adampresley.com/2010/merging-two-coldfusion-structs/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 17:19:47 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1048</guid>
		<description><![CDATA[Here&#8217;s a quick little tidbit. My coworker Steve Good asked me if I knew of a quick way to merge two ColdFusion structures together, kind of like how jQuery has the $.extend() method. Well there is in fact a way to do this! And it&#8217;s super easy. Let&#8217;s say you have structure one that has [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick little tidbit. My coworker <a href="http://stevegood.org">Steve Good</a> asked me if I knew of a quick way to merge two ColdFusion structures together, kind of like how jQuery has the <strong>$.extend()</strong> method. Well there <strong>is</strong> in fact a way to do this! And it&#8217;s super easy.</p>

<p>Let&#8217;s say you have structure one that has two keys, <em>firstName</em> and <em>lastName</em>.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> struct1 <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">&#123;</span> firstName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;Adam&quot;</span>, lastName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;Presley&quot;</span> <span style="color: #0000FF;">&#125;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>


<p>And now we have structure two that has two keys, <em>firstName</em> and <em>age</em>.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> struct2 <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">&#123;</span> firstName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;Michael&quot;</span>, age <span style="color: #0000FF;">=</span> <span style="color: #FF0000;">33</span> <span style="color: #0000FF;">&#125;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>


<p>Using a nifty ColdFusion method we can mash the two together in a single line of code.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #0000FF;">structAppend</span><span style="color: #0000FF;">&#40;</span>struct1, struct2<span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span> <span style="color: #808080; font-style: italic;">&lt;!--- &lt;cfset struct1.putAll(struct2) /&gt; ---&gt;</span></pre></div></div>


<p>Woah, that was easy! The end result will be a structure that would look like this.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> struct1 <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">&#123;</span> firstName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;Michael&quot;</span>, lastName <span style="color: #0000FF;">=</span> <span style="color: #009900;">&quot;Presley&quot;</span>, age <span style="color: #0000FF;">=</span> <span style="color: #FF0000;">33</span> <span style="color: #0000FF;">&#125;</span> <span style="color: #0000FF;">/&gt;</span></span></pre></div></div>


<p>Notice the commented out version. That is the underlying method to do the same thing as StructAppend. The benefit? Nothing I can think of. <img src='http://blog.adampresley.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>Enjoy, and happy coding!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/merging-two-coldfusion-structs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Community Professional Pins Are In!</title>
		<link>http://blog.adampresley.com/2010/adobe-community-professional-pins-are-in/</link>
		<comments>http://blog.adampresley.com/2010/adobe-community-professional-pins-are-in/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 21:53:53 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[ACP]]></category>
		<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1022</guid>
		<description><![CDATA[Sweeeet. I got home and on my keyboard is sitting a letter from Liz Frederick at Adobe. I open it up and discover that my nifty magnetic ACP pin is in there, as well as stickers! I love stickers! No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Sweeeet. I got home and on my keyboard is sitting a letter from Liz Frederick at Adobe. I open it up and discover that my nifty magnetic ACP pin is in there, as well as stickers! I love stickers!</p>


<a href='http://blog.adampresley.com/2010/adobe-community-professional-pins-are-in/acp-pin-2/' title='ACP Pin'><img width="150" height="150" src="http://blog.adampresley.com/wp-content/uploads/2010/07/acp-pin-2-150x150.jpg" class="attachment-thumbnail" alt="ACP Pin" title="ACP Pin" /></a>
<a href='http://blog.adampresley.com/2010/adobe-community-professional-pins-are-in/acp-pin-1/' title='ACP Pin'><img width="150" height="150" src="http://blog.adampresley.com/wp-content/uploads/2010/07/acp-pin-1-150x150.jpg" class="attachment-thumbnail" alt="ACP Pin" title="ACP Pin" /></a>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/adobe-community-professional-pins-are-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on the Demise of the CFML Advisory Committee</title>
		<link>http://blog.adampresley.com/2010/thoughts-on-the-demise-of-the-cfml-advisory-committee/</link>
		<comments>http://blog.adampresley.com/2010/thoughts-on-the-demise-of-the-cfml-advisory-committee/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:50:08 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Culture: Pop and Otherwise]]></category>
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=1014</guid>
		<description><![CDATA[Today was a busy news day for me. Most of it just personal stuff, but the story of the day in the world of ColdFusion is the departure of Adobe, or more specifically Adam Lehman, from the CFML Advisory Committee. I say it&#8217;s big news, but it seems to me that it will be the [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Today was a busy news day for me. Most of it just personal stuff, but the story of the day in the world of ColdFusion is the departure of Adobe, or more specifically Adam Lehman, from the CFML Advisory Committee. I say it&#8217;s big news, but it seems to me that it will be the big event in ColdFusion history that no one will really know, or care too much about. Sad? Perhaps.</p>

<p>For those who do not know what the CFML Advisory Committee is allow me a brief detour to give the 60-second rundown. The CFML Advisory Committee, as defined by their own website is to &#8220;&#8230;define what is &#8216;core&#8217; to the ColdFusion Markup Language, how that core should behave and what is considered &#8216;extended core&#8217; &#8211; what language features useful CFML processors should implement &#8211; as well as offering guidelines for vendors to provide extensions to CFML in a consistent manner.&#8221; It seems like a noble goal for certain.</p>

<p><span id="more-1014"></span></p>

<p>For those who might wonder why such a concept would even matter, consider the C++ language. Originally created by one guy in 1979 it gained an enormous amount of popularity. With this popularity and general acceptance by the development community, as well as the growing software industry, comes vendors, developers, and businesses clamoring to get in on the action. Libraries are built, custom extensions to the language, with each one trying to be the next &#8220;standard&#8221;. Over time you had various flavors or the language, extensions that cause portability issues, all which violated the original intent of the language.</p>

<p>Then in 1998 the ISO standards group (and a few others who&#8217;s acronyms I cannot name) finalized a standards document detailing how the language should behave, the semantics of code, and what libraries would come standard with the language.</p>

<p>This is the idea behind CFML Advisory Committee. Standardize the CFML language. Ensure that regardless of the vendor certain behaviors and language elements will be present and accounted for. An idea that, from the day I heard about it, I have agreed with. This is good for ColdFusion.</p>

<p>It would seem that the committee will not be able to achieve its goal. Blame politics, corporate agenda, or even personality conflicts, the end result remains the same. We are back to Adobe defining how the language will work, and the other vendors follow suit.</p>

<p>This is not necessarily a bad thing entirely. I won&#8217;t go on the record and state it&#8217;s a good thing entirely either. But it does raise some interesting questions in my mind, especially for me.</p>

<p>In his post Adam Lehman states &#8220;&#8230;the ColdFusion ACPs will be the CFML Advisory Panel for ColdFusion X and beyond.&#8221; As I am an Adobe ColdFusion ACP I certainly appreciate being able to provide my feedback to Adobe regarding the direction of the language.</p>

<p>Being in the ACP program, however, presents an interesting challenge. Adobe generally does not see fit to share information about the direction of the ColdFusion language to the general populous, and as an ACP I am under NDA for a good number of things. If Adobe were to formalize our role in the feedback process I wonder how much tighter the NDA becomes. Should that happen how limiting will my discussions with individuals involved in open source CFML be? Is that good for the ColdFusion language, such restrictions, or is it better perhaps to encourage open communication and solicit valuable feedback from the very community that supports your product?</p>

<p>Whatever the case I will continue supporting the ColdFusion community, it&#8217;s members, the language, and my desire to spread the nerdy love. To all I say happy coding!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/thoughts-on-the-demise-of-the-cfml-advisory-committee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SES URLs With Mura on Tomcat</title>
		<link>http://blog.adampresley.com/2010/ses-urls-with-mura-on-tomcat/</link>
		<comments>http://blog.adampresley.com/2010/ses-urls-with-mura-on-tomcat/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 23:08:58 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Mura]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=962</guid>
		<description><![CDATA[Tonight as I&#8217;m setting up a new server I wanted to make sure I had URL rewrite ability. Normally this is no issue as I use Apache for most anything web server related. However this time I am setting up a Mura site on Railo running on Tomcat. And yes, I&#8217;m using Tomcat for both [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Tonight as I&#8217;m setting up a new server I wanted to make sure I had URL rewrite ability. Normally this is no issue as I use Apache for most anything web server related. However this time I am setting up a Mura site on Railo running on Tomcat. And yes, I&#8217;m using Tomcat for both my Java Servlet engine and my web server. As such I wanted to ensure I have &#8220;pretty URLs&#8221; for my Mura-based application. In this post I will attempt to show you how to set that up.</p>

<p><span id="more-962"></span></p>

<p>At this point I am going to assume you have a running Tomcat and Mura application. The first thing we need to do is download Paul Tuckey&#8217;s excellent UrlRewriteFilter Java filter. This can be located at <a href="http://www.tuckey.org/urlrewrite/">http://www.tuckey.org/urlrewrite/</a>. The version I downloaded as of this writing is 3.2.0. Once downloaded you can extract the contents anywhere you wish to keep it. You will notice there isn&#8217;t much there&#8230; in fact at the top level there is only a folder named <em>WEB-INF</em>. Opening that folder doesn&#8217;t reveal much more.</p>

<p>If you have Tomcat running you&#8217;ll need to stop it temporarily for this next part. After stopping Tomcat, copy the file <em>/WEB-INF/lib/urlrewrite-3.2.0.jar</em> into your lib folder, found at <em>{TOMCAT}/lib</em>, where <em>{TOMCAT}</em> is the folder where you have placed your Tomcat installation. By copying this JAR file there you are making the URL re-writer filter available to all Java applications running in your Tomcat instance.</p>

<p>The next phase is to setup Railo (yes, you can do this in Adobe CF as well) to use this Java re-writer filter. Where you do this varies based on how you have setup your Railo application, but I have my Railo files extracted in my Mura application&#8217;s web root directory. So in my main Mura directory I have a <em>WEB-INF</em> folder containing the entire Railo <strong>library</strong>.</p>

<p>If you open up that <em>WEB-INF</em> folder there should be a <em>web.xml</em> file. Open this file in your favorite text editor. Near the top, after the <strong>&lt;display-name&gt;</strong> node and before the <strong>&lt;servlet&gt;</strong> nodes paste the following XML.</p>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #808080; font-style: italic;">&lt;!-- URL Rewrite Filter --&gt;</span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>logLevel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>WARN<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/param-value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UrlRewriteFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CFMLServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<p>This block of XML tells Tomcat, when loading your application, to install this URL re-write filter, and to map any requests that come through the <strong>CFMLServlet</strong> to it. Basically that means that any CFM or CFC requests will go through the filter.</p>

<p>The next part of this same file that must be altered is the servlet mappings to allow paths after &#8220;index.cfm&#8221;. This allows Mura to execute requests like &#8220;/index.cfm/contact-us/&#8221;. To do this find the following block of XML:</p>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CFMLServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.cfm<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<p>Once you find this, you want to insert this next block of XML <strong>right after it</strong>.</p>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CFMLServlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/index.cfm/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<p>Now we are ready to configure the re-writer filter to forward our &#8220;pretty&#8221; SES URLs to index.cfm! In the extracted files there is a file named <strong>urlrewrite.xml</strong>. Copy this file into the same folder as your Railo <strong>web.xml</strong> file that we just got done modifying. Now open it up. Fortunately this file is pretty well documented, and the online docs have even more information! For the moment, though, we just want to make sure that all of our SES URLs go to the right place. The other concern here is to also ensure that when we go to Mura&#8217;s administrator, the URLs <strong>DO NOT</strong> get forwarded to <strong>index.cfm</strong>. So, with a little bit of regular expression magic, we can make UrlRewriteFilter do this.</p>


<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE urlrewrite PUBLIC &quot;-//tuckey.org//DTD UrlRewrite 3.2//EN&quot; &quot;http://tuckey.org/res/dtds/urlrewrite3.2.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--</span>
&nbsp;
<span style="color: #808080; font-style: italic;">    Configuration file for UrlRewriteFilter</span>
<span style="color: #808080; font-style: italic;">    http://tuckey.org/urlrewrite/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">--&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urlrewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;note<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			Makes all requests forward to /index.cfm/whatever-came-next
			Ignores admin URLs so the admin still works correctly for Mura.
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/note<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>^/(?!admin|plugins|js|css|assets|images|tasks|railo-context|flex2gateway|wysiwyg)(.*)$<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/from<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/index.cfm/$1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/to<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urlrewrite<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>


<p>Ok, super. The final phase is to tell Mura that we wish to make our URL&#8217;s pretty! To do this, start Tomcat back up, then log into your Mura administrator and browse to <strong>File Manager -> Application Root</strong> and click on the folder <strong>config</strong>. In this folder there is a file named <strong>settings.ini.cfm</strong>. Click on the <em>pencil</em> icon to the right of the file name to edit it. Once inside we are looking for two settings: <em>siteidinurls</em> and <em>indexfileinurls</em>. These settings should both be set to zero (0). Once you save those changes make sure to click on <strong>Reload Application</strong>.</p>

<p>And with that you should be able to browse to your Mura site <em>without</em> the crazy question marks or <strong>index.cfm</strong> in the URL. But if you are in the administrator you should still have all the question marks so it behaves as expected.</p>

<p>I hope this helped somebody out there. Cheers, and happy coding!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/ses-urls-with-mura-on-tomcat/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How To Get the Server Name Running Your ColdFusion Page</title>
		<link>http://blog.adampresley.com/2010/how-to-get-the-server-name-running-your-coldfusion-page/</link>
		<comments>http://blog.adampresley.com/2010/how-to-get-the-server-name-running-your-coldfusion-page/#comments</comments>
		<pubDate>Wed, 05 May 2010 16:46:44 +0000</pubDate>
		<dc:creator>Adam Presley</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.adampresley.com/?p=900</guid>
		<description><![CDATA[ColdFusion is a great language in its own right. What makes it even more awesome? The fact that it is a Java application. Why is this cool? Because you can dig into Java to do all the dirty stuff ColdFusion shields you from, should you desire to do so. While writing this profiling code this [...]


Related posts:<ol><li><a href='http://blog.adampresley.com/2009/coldfusion-searching-structure-values-with-regular-expressions/' rel='bookmark' title='Permanent Link: ColdFusion &#8211; Searching Structure Values with Regular Expressions'>ColdFusion &#8211; Searching Structure Values with Regular Expressions</a></li>
<li><a href='http://blog.adampresley.com/2009/round-robin-display-of-data-java-style/' rel='bookmark' title='Permanent Link: Round Robin Display of Data &#8211; Java Style'>Round Robin Display of Data &#8211; Java Style</a></li>
<li><a href='http://blog.adampresley.com/2009/removing-duplicate-array-items-in-coldfusion/' rel='bookmark' title='Permanent Link: Removing Duplicate Array Items in ColdFusion'>Removing Duplicate Array Items in ColdFusion</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>ColdFusion is a great language in its own right. What makes it even more awesome? The fact that it is a Java application. Why is this cool? Because you can dig into Java to do all the dirty stuff ColdFusion shields you from, should you desire to do so.</p>

<p>While writing this profiling code this last week I had the need to get information specific to the server executing my ColdFusion code. The first bit of information I need is the host name, or the proper name of the server running ColdFusion. Java to the rescue! The Java package <strong>java.net</strong> contains what we need to do this.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> inet <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">createObject</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;java&quot;</span>, <span style="color: #009900;">&quot;java.net.InetAddress&quot;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> hostName <span style="color: #0000FF;">=</span> inet.getLocalHost<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>.getHostName<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</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>This computer's name is <span style="color: #0000FF;">#hostName#</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></pre></div></div>


<p><a href="http://blog.adampresley.com/wp-content/uploads/2010/05/ScreenHunter_01-May.-05-16.10.gif"><img src="http://blog.adampresley.com/wp-content/uploads/2010/05/ScreenHunter_01-May.-05-16.10.gif" alt="" title="Host Name" width="281" height="62" class="size-full wp-image-902" /></a></p>

<p>The other piece of information I needed was something to identify the <em>instance</em> of ColdFusion I was running on in a multi-instance environment. I&#8217;m betting the way I did this could be done better, but for now it is doing the job. By default ColdFusion installs JRun as the J2EE server that runs ColdFusion as a Java application. As such I was able to delve into the Java classes provided by JRun to get the JNDI port number, which is of course unique per instance.</p>

<p>The code below shows how to do that. Also note I have a try/catch around that code, and in the catch I am trying to create a different object of type <strong>org.apache.catalina.ServerFactory</strong>. This is because my co-workers are running JRun, and I am running Tomcat, and that object is what get&#8217;s me a server class from Tomcat, which in turn can give me the port Tomcat listens on for the shutdown command.</p>


<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!---</span>
<span style="color: #808080; font-style: italic;">	Get the port number. This is *J2EE server specific*!</span>
<span style="color: #808080; font-style: italic;">---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cftry</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> j2eeService <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">createObject</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;java&quot;</span>, <span style="color: #009900;">&quot;jrun.naming.NamingService&quot;</span><span style="color: #0000FF;">&#41;</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;">cfcatch</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> j2eeService <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">createObject</span><span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;java&quot;</span>, <span style="color: #009900;">&quot;org.apache.catalina.ServerFactory&quot;</span><span style="color: #0000FF;">&#41;</span>.getServer<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span> <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfcatch</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;">cftry</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;">cfset</span> port <span style="color: #0000FF;">=</span> j2eeService.getPort<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</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>This instance is running against port <span style="color: #0000FF;">#port#</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></pre></div></div>


<p><a href="http://blog.adampresley.com/wp-content/uploads/2010/05/ScreenHunter_02-May.-05-16.18.gif"><img src="http://blog.adampresley.com/wp-content/uploads/2010/05/ScreenHunter_02-May.-05-16.18.gif" alt="" title="Port Number" width="257" height="62" class="size-full wp-image-903" /></a></p>

<p>And this, ladies and gentlemen, is why ColdFusion rocks! Happy coding!</p>


<p>Related posts:<ol><li><a href='http://blog.adampresley.com/2009/coldfusion-searching-structure-values-with-regular-expressions/' rel='bookmark' title='Permanent Link: ColdFusion &#8211; Searching Structure Values with Regular Expressions'>ColdFusion &#8211; Searching Structure Values with Regular Expressions</a></li>
<li><a href='http://blog.adampresley.com/2009/round-robin-display-of-data-java-style/' rel='bookmark' title='Permanent Link: Round Robin Display of Data &#8211; Java Style'>Round Robin Display of Data &#8211; Java Style</a></li>
<li><a href='http://blog.adampresley.com/2009/removing-duplicate-array-items-in-coldfusion/' rel='bookmark' title='Permanent Link: Removing Duplicate Array Items in ColdFusion'>Removing Duplicate Array Items in ColdFusion</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.adampresley.com/2010/how-to-get-the-server-name-running-your-coldfusion-page/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
