<?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>Web Development By George &#187; ColdFusion</title>
	<atom:link href="http://www.webdevelopmentbygeorge.com/tag/coldfusion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevelopmentbygeorge.com</link>
	<description>ColdFusion, JavaScript and more!</description>
	<lastBuildDate>Sat, 21 Aug 2010 00:16:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CFAjaxProxy Problems or RTFM</title>
		<link>http://www.webdevelopmentbygeorge.com/2010/05/17/cfajaxproxy/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2010/05/17/cfajaxproxy/#comments</comments>
		<pubDate>Mon, 17 May 2010 19:24:20 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=211</guid>
		<description><![CDATA[So recently I&#8217;d been doing a cfselect box using bind to create my desired linked drop down.  The problem I was having was that I wanted to do a zebra stripe on the select after it had been loaded.  I could not find a way to attach the bind event to anything else so I [...]]]></description>
			<content:encoded><![CDATA[<p>So recently I&#8217;d been doing a cfselect box using bind to create my desired linked drop down.  The problem I was having was that I wanted to do a zebra stripe on the select after it had been loaded.  I could not find a way to attach the bind event to anything else so I couldn&#8217;t call a function after the bind had actually completed.  The way I wanted to solve this was to use a setTimeout on the coloring process.  The problem I was having was that my serializedJSON output I was using was no longer working.  It turns out &#8211; if you read the documentation &#8211; that using cfajaxproxy to pull in a CFC automatically serializes your output.  So if you&#8217;re returning a result of String with a serializeJSON(myQuery) you will end up with the data being DOUBLE SERIALIZED! Oh what a headache that was.  The proper way to do this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="js" style="font-family:monospace;">   &lt;cfajaxproxy cfc=&quot;myData&quot; jsclassname=&quot;myDataClass&quot; /&gt;
&nbsp;
   &lt;script&gt;
	getData = function(){
		var o = new myDataClass();
		var dataset = o.getData($('toggleField').checked);
		return dataset;
	}
   &lt;/script&gt;</pre></td></tr></table></div>

<p>Is to have your CFC do this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</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;">cfcomponent</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;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;getData&quot;</span> <span style="color: #0000FF;">access</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;remote&quot;</span> returntype<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;query&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfargument</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;myToggle&quot;</span> <span style="color: #0000FF;">type</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;string&quot;</span> <span style="color: #0000FF;">required</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;yes&quot;</span> <span style="color: #0000FF;">default</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;false&quot;</span> <span style="color: #0000FF;">/&gt;</span></span>
&nbsp;
		<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> <span style="color: #000000; font-weight: bold;">var</span> qryData <span style="color: #0000FF;">=</span> <span style="color: #FF0000;">0</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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;qryData &quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;DATAS&quot;</span><span style="color: #0000FF;">&gt;</span></span>	
			SELECT *
                           FROM tableData
                <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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;">cfreturn</span> qryData<span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</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;">cfcomponent</span><span style="color: #0000FF;">&gt;</span></span></pre></td></tr></table></div>

<p>Rather than serializing it yourself first.  If you&#8217;re binding with a method of cfc: then you don&#8217;t need to do this, instead you need to change it to return text and use the SerializeJSON on your qryData query.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2010/05/17/cfajaxproxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interesting ColdFusion Survey</title>
		<link>http://www.webdevelopmentbygeorge.com/2010/05/07/interesting-coldfusion-survey/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2010/05/07/interesting-coldfusion-survey/#comments</comments>
		<pubDate>Fri, 07 May 2010 14:06:59 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=205</guid>
		<description><![CDATA[So CFUnited conducted a hosting survey and I thought the results were fun to look through:
http://survey.constantcontact.com/survey/a07e2usgru9g836jj3i/results
In the where do you host section, I think that the Other is probably GoDaddy.com, I notice they&#8217;re not included and they do offer ColdFusion hosting.  I was surprised Intermedia was so low.
I also thought it was interesting how few [...]]]></description>
			<content:encoded><![CDATA[<p>So CFUnited conducted a hosting survey and I thought the results were fun to look through:</p>
<p><a href="http://survey.constantcontact.com/survey/a07e2usgru9g836jj3i/results">http://survey.constantcontact.com/survey/a07e2usgru9g836jj3i/results</a></p>
<p>In the where do you host section, I think that the Other is probably GoDaddy.com, I notice they&#8217;re not included and they do offer ColdFusion hosting.  I was surprised Intermedia was so low.</p>
<p>I also thought it was interesting how few of those surveyed were using BlueDragon.</p>
<p>Many other things can probably be gleaned from this information, but it&#8217;s definitely fun to look at!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2010/05/07/interesting-coldfusion-survey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>script.aculo.us Ajax Sortable Lists adjustment for ColdFusion</title>
		<link>http://www.webdevelopmentbygeorge.com/2010/04/16/script-aculo-us-ajax-sortable-lists-adjustment-for-coldfusion/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2010/04/16/script-aculo-us-ajax-sortable-lists-adjustment-for-coldfusion/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 13:57:07 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=199</guid>
		<description><![CDATA[So normally I&#8217;m a YUI guy.  I enjoy their widgets and some of the other features available, and I&#8217;m comfortable with it.  I work with several sites here that my co-workers work on, and they often prefer different JS Libraries.  So I try to minimize the libraries on a site.  Nothing [...]]]></description>
			<content:encoded><![CDATA[<p>So normally I&#8217;m a YUI guy.  I enjoy their widgets and some of the other features available, and I&#8217;m comfortable with it.  I work with several sites here that my co-workers work on, and they often prefer different JS Libraries.  So I try to minimize the libraries on a site.  Nothing more difficult, I feel, when you&#8217;re maintaining a website and have to maintain YUI, jQuery, Dojo, and Script.aculo.us/Prototype all at the same time and with all of those libraries loading for a client!</p>
<p>So I had to repair something that wasn&#8217;t working in IE8 (imagine that <img src='http://www.webdevelopmentbygeorge.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) that was written quite some time ago.  The site had script.aculo.us/prototype on it so I wanted to stick with that library.  Thankfully, I came across this post:  <a href="http://zenofshen.com/posts/ajax-sortable-lists-tutorial">http://zenofshen.com/posts/ajax-sortable-lists-tutorial</a> and it&#8217;s a pretty handy layout for PHP and Script.aculo.us.  The problem arises at the bottom of the post.  In PHP, you would be fine using this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'data'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>ColdFusion won&#8217;t parse out the string of <em>list_to_sort[]=2&#038;list_to_sort[]=1&#038;list_to_sort[]=3</em> like that though.  So I recommend making this adjustment to what&#8217;s coming through:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</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> newList <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">ListChangeDelims</span><span style="color: #0000FF;">&#40;</span>url.<span style="color: #0000FF;">data</span>, <span style="color: #009900;">&quot;|&quot;</span>, <span style="color: #009900;">&quot;list_to_sort[]=,&amp;list_to_sort[]=&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> sortPos <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">listLen</span><span style="color: #0000FF;">&#40;</span>newList, <span style="color: #009900;">&quot;|&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;">cfloop</span> <span style="color: #0000FF;">list</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#newList#&quot;</span> delimiters<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;|&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;thisID&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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;insertSort&quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#request.source#&quot;</span><span style="color: #0000FF;">&gt;</span></span>
               INSERT INTO 'table' (listID, sortOrder)
                     VALUES (<span style="color: #0000FF;">#thisID#</span>, <span style="color: #0000FF;">#sortPos#</span>)
        <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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> sortPos <span style="color: #0000FF;">=</span> sortPos - <span style="color: #FF0000;">1</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;">cfloop</span><span style="color: #0000FF;">&gt;</span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2010/04/16/script-aculo-us-ajax-sortable-lists-adjustment-for-coldfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Access &#8211; Random Identity Seeds and @@Identity</title>
		<link>http://www.webdevelopmentbygeorge.com/2010/02/19/microsoft-access-random-identity-seeds-and-identity/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2010/02/19/microsoft-access-random-identity-seeds-and-identity/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 20:49:08 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Access]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=186</guid>
		<description><![CDATA[So I discovered a few things with Microsoft Access recently.  It&#8217;s not my database of choice, but it&#8217;s very easy in my current work environment to use it effectively &#8211; and effectiveness is always the key.  So we have been discussing more and better ways to implement security.  One of the ways [...]]]></description>
			<content:encoded><![CDATA[<p>So I discovered a few things with Microsoft Access recently.  It&#8217;s not my database of choice, but it&#8217;s very easy in my current work environment to use it effectively &#8211; and effectiveness is always the key.  So we have been discussing more and better ways to implement security.  One of the ways to do this is to change how the ID for a record is created.  Access provides a way to use GUIDs for the AutoNumber column of your choice, but they&#8217;re very cumbersome &#8211; especially if you&#8217;re going to be passing them around in a secure app environment as a URL string.  I know, URL Strings aren&#8217;t the best, but they&#8217;re fast.  That references back to the same thing as effectiveness in my book!  Well I didn&#8217;t like the way they looked so I changed back to a Number format and started getting very odd results for the AutoNumber.  Very long integers as well as negatives and they were no longer sequential.  That&#8217;ll teach me not to click on the &#8220;New Values&#8221; option of my AutoNumber fields.  There&#8217;s an option there to change them to &#8220;Random&#8221; from &#8220;Increment&#8221;.  This will help by providing a minor bit of security where users before might have been able to change the URL ID and change what record they were looking at.</p>
<p>The next problem this created for me was in the way I normally had been grabbing the newly created records in my Access tables.  I guess it&#8217;s pretty standard for most people to do something along these lines when creating and inserting values into your access tables:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;test1&quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;source1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
     INSERT INTO Table (datacol)
     VALUES (&quot;datapiece&quot;);
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;getID&quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;source1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    SELECT MAX(ID) as MaxID FROM Table
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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> myID <span style="color: #0000FF;">=</span> getID.MaxID <span style="color: #0000FF;">/&gt;</span></span></pre></td></tr></table></div>

<p>Well this didn&#8217;t work anymore with the Random seed for the AutoNumber.  The max was no longer the last one inserted.  It led to quite a bit of hair pulling on my part &#8211; and that&#8217;s an accomplishment when you&#8217;re bald.  So I had heard from a co-worker that @@Identity did in fact work in Access.  I hadn&#8217;t spent much time looking into it &#8211; being as I had a solution that worked (Max(id)) and I prefer to work in SQL Server or MySQL.  But now I was presented with a need to figure it out.  A few minutes of Googling led me to <a href="http://cfmxplus.blogspot.com/2002/08/oh-my-select-identity-works-in-access.html">this article by Charlie Arehart</a> from 2002(!)  I was a little surprised to see it had been working for this long.  So now I do my access inserts like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</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;">cftransaction</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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;test1&quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;source1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
             INSERT INTO Table (datacol)
             VALUES (&quot;datapiece&quot;);
      <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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;">cfquery</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;getID&quot;</span> <span style="color: #0000FF;">datasource</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;source1&quot;</span><span style="color: #0000FF;">&gt;</span></span>
             SELECT @@IDENTITY as MaxID;
      <span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfquery</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> myID <span style="color: #0000FF;">=</span> getID.MaxID <span style="color: #0000FF;">/&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cftransaction</span><span style="color: #0000FF;">&gt;</span></span></pre></td></tr></table></div>

<p>And everything works out just fine.  The keys are the CFTransaction tag and using two separate CFQuery tags.  Now to go revamp a whole section of code to use this little tidbit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2010/02/19/microsoft-access-random-identity-seeds-and-identity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PCI Compliance and Portcullis</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/11/10/pci-compliance-and-portcullis/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/11/10/pci-compliance-and-portcullis/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 15:59:16 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[PCI Compliance]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=181</guid>
		<description><![CDATA[So we&#8217;ve been doing a little bit of PCI Compliance work here at the office.  One of the things that we found that really helped us out was a program called Portcullis &#8211; http://www.codfusion.com/blog/post.cfm/portcullis-cfc-filter-to-protect-against-sql-injection-and-xss.  I suppose it&#8217;s not a full program, but a CFC to assist in how you do your security.  [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;ve been doing a little bit of PCI Compliance work here at the office.  One of the things that we found that really helped us out was a program called Portcullis &#8211; <a href="http://www.codfusion.com/blog/post.cfm/portcullis-cfc-filter-to-protect-against-sql-injection-and-xss">http://www.codfusion.com/blog/post.cfm/portcullis-cfc-filter-to-protect-against-sql-injection-and-xss</a>.  I suppose it&#8217;s not a full program, but a CFC to assist in how you do your security.  We used it to help secure a site and meet our requirements.  Much less expensive than some of the other web application firewalls out there, since it&#8217;s free <img src='http://www.webdevelopmentbygeorge.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/11/10/pci-compliance-and-portcullis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Guest Post: cftransaction &amp; multiple datasources</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/08/05/cftransaction-multiple-datasources/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/08/05/cftransaction-multiple-datasources/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 21:02:22 +0000</pubDate>
		<dc:creator>superdave</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=97</guid>
		<description><![CDATA[I ran across an interesting error today regarding cftransactions and multiple cfqueries inside of them.
The resulting error was
The root cause was that: java.sql.SQLException: Datasource names for all the database tags within CFTRANSACTION must be the same.
This seems pretty straightforward, until you start digging into the problem, and become led down a few wrongs paths courtesy [...]]]></description>
			<content:encoded><![CDATA[<p>I ran across an interesting error today regarding cftransactions and multiple cfqueries inside of them.<br />
The resulting error was</p>
<h2><strong><code>The root cause was that: java.sql.SQLException: Datasource names for all the database tags within CFTRANSACTION must be the same.</code></strong></h2>
<p>This seems pretty straightforward, until you start digging into the problem, and become led down a few wrongs paths courtesy of google serving up results that aren&#8217;t entirely true.<br />
One of the discussions I found was an <a href="http://kb2.adobe.com/cps/190/tn_19023.html" target="_blank">adobe tech note</a>, which I discovered via a link from a <a href="http://www.bennadel.com/blog/1146-Datasource-Names-For-All-The-Database-Tags-Within-CFTRANSACTION-Must-Be-The-Same.htm" target="_blank">post </a>by Ben Nadal.  In this tech note, the solution was to simply replace all cfexit tags, with a cfabort.</p>
<p>Simple, yes, except that I had NO cfexit tags within my cftry/cftransaction statement, they were already cfaborts!</p>
<p>Further investigation revealed that you simply cannot have multiple datasource names withing a cftransaction.</p>
<p>Now, with no actual documentation on the subject, and not actually knowing what spell coldfusion is uttering while it waves its wand over its magic hat, I cannot give a &#8216;good&#8217; reason as to why.  All I know is the problem was fixed once I removed the offending query to outside the cftransaction.</p>
<p>In order to duplicate the desired effect, you will have to keep track of the transactions, and rollback/commit based on the prior cftransaction attempts, which is a discussion for another post.</p>
<p>-Dave</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/08/05/cftransaction-multiple-datasources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guest Post: structDeleteAt() doesn&#8217;t play nice with webservice returns</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/08/05/structdeleteat-doesnt-play-nice-with-webservice-returns/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/08/05/structdeleteat-doesnt-play-nice-with-webservice-returns/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 20:54:25 +0000</pubDate>
		<dc:creator>superdave</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[web service]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=104</guid>
		<description><![CDATA[Sooner or later, we all experience it.  The chill runs down our spines, and we stare at the computer screen, not knowing whether to cry or curse at the cryptic error that rears its ugly head and laughs at us.
What I&#8217;m referring to is, of course, coldFusion deciding that it only wants to do things [...]]]></description>
			<content:encoded><![CDATA[<p>Sooner or later, we all experience it.  The chill runs down our spines, and we stare at the computer screen, not knowing whether to cry or curse at the cryptic error that rears its ugly head and laughs at us.</p>
<p>What I&#8217;m referring to is, of course, coldFusion deciding that it only wants to do things a certain way, regardless of how you *think* the process should go.</p>
<p>Not too long in the distant past, I encountered such a beast, and will relate my story now.</p>
<p>The task was simple:  connect to a webservice, and display the results.  As the project progressed, the rules changed slightly &#8211; now I needed to grab the results, and filter out any that didn&#8217;t belong based upon a criterion set.  Never you mind that usually, the web service would be changed or manipulated so that a parameter or two could be passed in &amp; perform the filtering on the server side.  That wasn&#8217;t a possibility in this case, and wouldn&#8217;t prove to have been near as much fun.</p>
<p>The rumblings and mutterings from the nether world began when I attempted to loop over the results and filter out any which didn&#8217;t fall within the specified criteria.  Normally, this would just involve a cfif tag to test each set of returned data to decide to display it or not.  The crux of the problem was that before entering the loop, the count of how many records were returned was displayed.  Depending on how many records were excluded, this count could be, and was, way off of the actual records that were displayed.</p>
<p>My initial theory was to loop over the record set returned from the webservice, and use a structDeleteAt() call to remove any records which did not match what I was trying to display.</p>
<p>*KABOOM*</p>
<p>ColdFusion refused to delete the record.  I tried everything.  Setting the value to empty, using a Javacast to set it to null, even copying the returned result set, and working with the copy.</p>
<p>None of it worked.</p>
<p>ColdFusion liked how the returned result tasted, and wasn&#8217;t about to let go, not for any amount of cajoling or cursing at it.</p>
<p>Finally, defeated, I tried a different approach.  Instead of using any trickery, or established CF functions or methods, I decided to bring a howitzer to this knife fight.</p>
<p>The answer lies in the code below.</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;">cfloop</span> <span style="color: #0000FF;">from</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;#ArrayLen(serviceReturn.contacts.anyType)#&quot;</span> <span style="color: #0000FF;">to</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;1&quot;</span> step<span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;-1&quot;</span> <span style="color: #0000FF;">index</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;i&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> tmp <span style="color: #0000FF;">=</span> serviceReturn.contacts.anyType<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</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> tmpPaidThrough <span style="color: #0000FF;">=</span> tmp.getPaidThrough<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;">cfif</span> EXPRESSION_TO_CHECK_AGAINST <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> tmpInsert <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">arrayappend</span><span style="color: #0000FF;">&#40;</span>session.searchResults,serviceReturn.contacts.anyType<span style="color: #0000FF;">&#91;</span>i<span style="color: #0000FF;">&#93;</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;">cfif</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;">cfloop</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>To explain:</p>
<ul>
<li>loop over the record set returned by the webservice.</li>
<li>set the record to a temp variable, and get the part that we want to check against (in this case, paidThrough)</li>
<li>if the record passes the test, append it to a new variable (session.searchResults)</li>
<li>note that I have gone from the end of the struct to the beginning, but I believe it would work either way</li>
</ul>
<p>Then, in the display portion of the code, instead of using the returned record set, we use the new variable we set up that only has the records in it that have passed the test for display purposes.</p>
<p>*VOILA*</p>
<p>ColdFusion, realizing that it has been defeated, slinks off to haunt some other poor soul.</p>
<p>I&#8217;m not entirely sure why CF would not relinquish the record of the returned set.  In discussion with other developers, we reasoned that perhaps since the return was a struct of struct of structs, somewhere in the vast underlying java mysteries, the pointers could not be moved or deleted, so CF did not want to delete the data.  Copying the returned structure resulted in a structure of the same design, so CF wasn&#8217;t able to delete from a copy any more than it could from the original record set.</p>
<p>So there you have it.  Wipe the blood off your sword, hoist a beer, and move on to another realm, full of it&#8217;s share of demons and battles.</p>
<p>-Dave</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/08/05/structdeleteat-doesnt-play-nice-with-webservice-returns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFGoogle &#8211; Now that&#8217;s neat</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/07/20/cfgoogle-now-thats-neat/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/07/20/cfgoogle-now-thats-neat/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:52:40 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=95</guid>
		<description><![CDATA[So I stumbled across this on my twitter feed while reading what Ray Camden had put up about the rework of the riaforge.org backend to incorporate the CFGoogle api interface written by Todd Sharp.  It looks really need and could provide a great deal of use to us ColdFusion junkies out there.  I [...]]]></description>
			<content:encoded><![CDATA[<p>So I stumbled across this on my twitter feed while reading what Ray Camden had put up about the rework of the riaforge.org backend to incorporate the CFGoogle api interface written by Todd Sharp.  It looks really need and could provide a great deal of use to us ColdFusion junkies out there.  I say check it out!</p>
<p>CFSilence:<br />
<a href="http://cfsilence.com/blog/client/index.cfm/2009/7/15/CFGoogle--A-ColdFusion-Package-For-Interacting-With-Several-Google-APIs">CFGoogle</a></p>
<p>RiaForge:<br />
<a href="http://cfgoogle.riaforge.org/">http://cfgoogle.riaforge.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/07/20/cfgoogle-now-thats-neat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>datefield cfinputs and _f is undefined</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/06/17/datefield-cfinputs-and-_f-is-undefined/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/06/17/datefield-cfinputs-and-_f-is-undefined/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 19:16:56 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=76</guid>
		<description><![CDATA[So there have been two occasions I&#8217;ve run into this error on a page &#8211; and it&#8217;s very ambiguous and hard to track down both times I&#8217;ve experienced it.  Fortunately, both times have also involved a very easy solution once I looked through the page for the 40th time.  The first time I encountered this, [...]]]></description>
			<content:encoded><![CDATA[<p>So there have been two occasions I&#8217;ve run into this error on a page &#8211; and it&#8217;s very ambiguous and hard to track down both times I&#8217;ve experienced it.  Fortunately, both times have also involved a very easy solution once I looked through the page for the 40th time.  The first time I encountered this, the previous form designer had named both cfforms on the page the same thing.  While this worked, it&#8217;s never advisable.  By doing this, the cfcalendar script could not locate the item because it couldn&#8217;t track down the form properly.</p>
<p>The second time I ran into this &#8211; just a few moments ago &#8211; was the same problem surfacing because the declaration for the form had been placed inside the declaration for the table.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;table&gt;
         &lt;form&gt;&lt;/form&gt;
&lt;/table&gt;</pre></td></tr></table></div>

<p>This just did not sit well with the browser, being invalid and all.  Once I moved them outside of that formation and made it this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;form&gt;
      &lt;table&gt;&lt;/table&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p>it worked like a champ.    Hopefully this helps someone out there with this error in the future!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/06/17/datefield-cfinputs-and-_f-is-undefined/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash Builder 4 and ColdFusion for Flex</title>
		<link>http://www.webdevelopmentbygeorge.com/2009/06/01/flash-builder-4-and-coldfusion-for-flex/</link>
		<comments>http://www.webdevelopmentbygeorge.com/2009/06/01/flash-builder-4-and-coldfusion-for-flex/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 14:34:38 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbygeorge.com/?p=72</guid>
		<description><![CDATA[Saw this video through a link provided by Hal Helms (@halhelms) on Twitter.   Really interesting stuff about using the new Flash Builder 4 interface to import Coldfusion CFCs directly and then once you have them imported, wire them right into your Flash piece without writing any Flex code at all.
http://snurl.com/j7e56
]]></description>
			<content:encoded><![CDATA[<p>Saw this video through a link provided by Hal Helms (@halhelms) on Twitter.   Really interesting stuff about using the new Flash Builder 4 interface to import Coldfusion CFCs directly and then once you have them imported, wire them right into your Flash piece without writing any Flex code at all.</p>
<p><a href="http://snurl.com/j7e56">http://snurl.com/j7e56</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdevelopmentbygeorge.com/2009/06/01/flash-builder-4-and-coldfusion-for-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
