<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>RSS feed for InstantSpot site Sam Farmer&apos;s ColdFusion Blog</title><link>http://samfarmer.instantspot.com</link><description>Tips and thoughs on ColdFusion and other technologies that make the web go...</description><language>en-us</language><copyright>This work is Copyright &#xA9; 2010 by Sam Farmer&apos;s ColdFusion Blog</copyright><generator>RSSVille ColdFusion FeedMaker, version 1.0</generator><pubDate>Fri, 30 Jul 2010 19:06:15 GMT</pubDate><item><title>Tips for having a good conference</title><link>http://samfarmer.instantspot.com/blog/2010/07/26/Tips-for-having-a-good-conference/</link><description>&lt;p&gt;With CFUnited around the corder, here are my tips for having a good conference. &amp;nbsp;I&apos;d love to hear your tips as well!&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Attend Sessions&lt;/strong&gt;&lt;br /&gt; And by attend, I mean, really attend sessions. &amp;nbsp;Sit near the front and focus on the presentation. Turn off email and Twitter.&amp;nbsp; Take notes with a laptop but try not to use it for anything else. &amp;nbsp;You&apos;ll get much more out of a session this way.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Talk to Everyone&lt;/strong&gt;&lt;br /&gt; Talk to as many people as you can. &amp;nbsp; Personally I find this one kinda hard since I&apos;m somewhat shy but this is key to getting a lot out of a conference. &amp;nbsp;I&apos;m going with a huge generalization here and come up with three groups; 1) those more advanced than you, 2) those at your level or more junior, 3) exhibitors. &amp;nbsp;You should talk to them all. &amp;nbsp;Here&apos;s why: &amp;nbsp; Group 1 will help expand your knowledge. &amp;nbsp;Group 2 will help expand your knowledge as well. &amp;nbsp;Wait, you may ask, how can those more junior expand your knowledge? &amp;nbsp;Because growing as a developer is not a simple ladder that you just move up one step at a time. &amp;nbsp;A developer of six months may have focussed exclusively on one area and be able to give insights on that. &amp;nbsp;Likewise for both these groups you can provide insight to them.&lt;br /&gt; &lt;br /&gt; The final group, exhibitors. &amp;nbsp;Go talk to them. &amp;nbsp;Sure some will be a little pushy and sales-ey but you will gain knowledge of what they do. &amp;nbsp;And while you might not need them now, knowing what they do can help in the future.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Be Nice to the Organizers&lt;/strong&gt;&lt;br /&gt; Having worked in the background of conferences I can attest how much works goes into them. And also how much work happens during the conference. &amp;nbsp;Pretty much the whole time you are awake at a conference they are working. &amp;nbsp;So be nice to them and patient if something goes wrong.&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; Relax, Have Fun and Learn!&lt;/strong&gt;&lt;br /&gt; I&amp;nbsp;don&apos;t have much more to add to this one.&lt;/p&gt; &lt;p&gt;What are your tips for having a good conference?&lt;/p&gt;</description><pubDate>Mon, 26 Jul 2010 12:58:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/07/26/Tips-for-having-a-good-conference/</guid><category>CFUnited</category></item><item><title>Changing Jobs, Going to work at Politico</title><link>http://samfarmer.instantspot.com/blog/2010/07/25/Changing-Jobs-Going-to-work-at-Politico/</link><description>&lt;p&gt;Starting in August I will be working at the Politico.&amp;nbsp; I&apos;m not changing professions -- they are not hiring me for my political &amp;quot;insight&amp;quot; -- but rather as a Senior ColdFusion Developer. I&apos;m excited to join their talented and large team to work on &lt;a href=&quot;http://www.politico.com/&quot;&gt;Politico.com&lt;/a&gt; and and their other sites.&amp;nbsp; For a start its my first exposure to really popular sites, in March Politico had 1.8 million visitors, and that brings about different challenges.&amp;nbsp; There is also a new site called &lt;a href=&quot;http://tbd.com/&quot;&gt;tbd.com&lt;/a&gt; which is going to be released soon.&lt;br /&gt; &lt;br /&gt; I&apos;ve enjoyed my time in my current position at &lt;a href=&quot;http://webfirst.com/&quot;&gt;WebFirst&lt;/a&gt;.&amp;nbsp; During this time I have launched my first C&lt;a href=&quot;http://samfarmer.instantspot.com/blog/2010/02/10/Thoughts-on-my-first-ColdFusion-9-application-going-into-production&quot;&gt;oldFusion 9 and ORM&lt;/a&gt; application, my first &lt;a href=&quot;http://samfarmer.instantspot.com/blog/2010/03/05/Thoughts-on-first-FlexAir-app&quot;&gt;Flex/Air&lt;/a&gt; talking to ColdFusion application and one in the wings.&lt;br /&gt; &lt;br /&gt; This will be the first time since 2003 that I won&apos;t be able to walk to work.&amp;nbsp; Politico&apos;s offices are in Rosslyn, VA and a whopping 4 miles from my house in Washington, DC!&amp;nbsp; While I won&apos;t be able to walk I generally ride my bike and am looking forward to some slightly longer rides along the Mall and across the Potomac every day.&lt;/p&gt;</description><pubDate>Mon, 26 Jul 2010 00:14:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/07/25/Changing-Jobs-Going-to-work-at-Politico/</guid><category>Me</category></item><item><title>Virtual File Explorer and c:\wtf.html</title><link>http://samfarmer.instantspot.com/blog/2010/07/17/Virtual-File-Explorer-and-cwtfhtml/</link><description>&lt;p&gt;After dinner I&amp;nbsp;checked Twitter and saw the following tweet from &lt;a href=&quot;http://twitter.com/marcesher/statuses/18800631860&quot;&gt;@marcesher&lt;/a&gt;:&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;500&quot; height=&quot;165&quot; src=&quot;/userfiles/040107/117/marcTweet.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;It didn&apos;t take long for me to track down the cause of this problem. &amp;nbsp;In the &lt;a href=&quot;http://vfsexplorer.riaforge.org/&quot;&gt;Virtual File&amp;nbsp;Explorer&lt;/a&gt; code on line 50 of Service.cfc there it was:&lt;/p&gt; &lt;p&gt;&lt;div class=&quot;code&quot; &gt;&lt;pre&gt;writeDump(var=q, output=&amp;quot;c:\wtf.html&amp;quot;, format=&amp;quot;html&amp;quot;);&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt; &lt;p&gt;My apologies to anyone who had downloaded and installed Virtual File Explorer.&amp;nbsp; To fix either remove the line in question or download and install again.&lt;/p&gt;</description><pubDate>Sun, 18 Jul 2010 01:58:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/07/17/Virtual-File-Explorer-and-cwtfhtml/</guid><category>Virtual File Explorer</category></item><item><title>Example of multiple datasources for ORM in 9.0.1</title><link>http://samfarmer.instantspot.com/blog/2010/07/14/Example-of-multiple-datasources-for-ORM-in-901/</link><description>&lt;p&gt;ColdFusion 9.0.1 brings multiple datasources support for ORM. Here is how to set it up.&lt;/p&gt; &lt;p&gt;In this example, we are going to use both the cfartgallery and cfbookclub datasources.&amp;nbsp; In the Application.cfc we will make the cfartgallery the default datasource.&amp;nbsp; Optionally we are going to set the dbcreate rules differently for the two datasources.&amp;nbsp; (We could also do this for the schema, catalog, dialect and sqlscript settings.)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;this.name&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;multi&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;this.ormEnabled&lt;span style=&quot;color: black;&quot;&gt;=true&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;this.datasource&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;cfartgallery&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;this.ormsettings &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt; dbcreate&lt;span style=&quot;color: black;&quot;&gt;={ &lt;/span&gt;cfartgallery&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;update&amp;quot;&lt;/span&gt;, &lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;margin-left: 1in; text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;cfbookclub&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;none&amp;quot;}&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;From cfartgallery we will use the Art table as an object.&amp;nbsp; As cfartgallery is the default datasource, this is set up as usual:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;persistent&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;artID&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;fieldtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt; ;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;artistID&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;artname&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;description&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;prize&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;largeimage&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;mediaID&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;issold&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;samColumn&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;For any tables from the cfbookclub datasource there is an additional attribute &amp;quot;&lt;span style=&quot;font-family: Courier New;&quot;&gt;datasource&lt;/span&gt;&amp;quot; for the component:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;persistent&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;strong&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;datasource&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;cfbookclub&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;bookID&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;fieldtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;authorID&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;bookdescription&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;isspotlight&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;We can then get the data and dump it like so:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;books &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityLoad&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&amp;quot;BOOKS&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;{}&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;maxResults&lt;span style=&quot;color: black;&quot;&gt;=2})&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeDump&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;books&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;art &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityLoad&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&amp;quot;ART&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;{}&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;maxResults&lt;span style=&quot;color: black;&quot;&gt;=2})&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeDump&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;art&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;350&quot; height=&quot;652&quot; alt=&quot;&quot; src=&quot;/userfiles/040107/117/bookAndArt.png&quot; /&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;Pretty straighforward and pretty cool stuff.&lt;/p&gt;</description><pubDate>Wed, 14 Jul 2010 12:02:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/07/14/Example-of-multiple-datasources-for-ORM-in-901/</guid><category>ColdFusion 9,ORM,ColdFusion 9.0.1</category></item><item><title>ColdFusion Builder Extensions and forms: The easy way</title><link>http://samfarmer.instantspot.com/blog/2010/06/30/ColdFusion-Builder-Extensions-and-forms-The-easy-way/</link><description>&lt;p&gt;In my previous post I&amp;nbsp;chronicled&amp;nbsp;my experiences building a ColdFusion Builder extension. &amp;nbsp;&lt;a href=&quot;http://coldfusionjedi.com/&quot;&gt;Raymond Camden&lt;/a&gt;, very politely, stated that some of my&amp;nbsp;assertions&amp;nbsp;where wrong.&amp;nbsp; Turns out Ray was right. I did some investigation and found that ColdFusion Builder extensions can in fact handle forms. &amp;nbsp;I didn&apos;t find a particularly good documentation of this so here is how to set up extensions to use html forms, javascript and html. &amp;nbsp;Even better it requires no parsing of XML to get form data.&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; ide_config.xml&lt;/strong&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;application&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;menucontributions&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;contribution&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;projectview&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;samEXT&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;action&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;Browser&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;handlerid&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;showresponse&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;menu&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;contribution&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;menucontributions&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;handlers&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;handler&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;browser&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;cfm&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;filename&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;browser/index.cfm&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;handlers&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;application&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Nothing special or different in this file. &amp;nbsp;In the above code we add a menu item and have the action point to an index.cfm file.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;index.cfm&lt;/strong&gt;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfsetting&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;showdebugoutput&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfheader&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;text/xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;showresponse&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;http://play/extensions/SamExt/handlers/browser/aform.cfm&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;dialog&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;500&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;600&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;This file will be called when the menu item is clicked on. &amp;nbsp;The key line is the ide tag which points to a URL. &amp;nbsp;You can see this called aform.cfm and doing this method breaks out of the Eclipse controls and into the default browser for Eclipse (or your system...I&apos;m not sure which).&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; aform.cfm&lt;/strong&gt;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfsetting&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;showdebugoutput&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfform&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;method&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;action&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;formresults.cfm&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinput&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;30&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;Give me some text, baby!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;Date&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinput&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;datefield&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;size&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;30&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;date&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;date&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;Come on...pick a date.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinput&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;sub&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;Show me&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfform&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Love or loath cfform, I used it above to illustrate that JavaScript works. This makes a form in the extension:&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;336&quot; height=&quot;455&quot; alt=&quot;&quot; src=&quot;/userfiles/040107/117/formExtension.png&quot; /&gt;&lt;/p&gt; &lt;p&gt;It posts to formresults.cfm which simply dumps out the form results as seen below:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;formresults.cfm&lt;/strong&gt;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfdump&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#form#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&lt;img width=&quot;335&quot; height=&quot;454&quot; src=&quot;/userfiles/040107/117/formExtensionDump.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</description><pubDate>Thu, 01 Jul 2010 01:36:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/06/30/ColdFusion-Builder-Extensions-and-forms-The-easy-way/</guid><category>ColdFusion Builder</category></item><item><title>Thoughts on building with a ColdFusion Builder extension with Flex</title><link>http://samfarmer.instantspot.com/blog/2010/06/20/Thoughts-on-building-with-a-ColdFusion-Builder-extension-with-Flex/</link><description>&lt;p&gt;I thought Builder extensions operated in a funny web browser that meant you could use html, including forms, but returned data in some funny XML format. &amp;nbsp;Oh how wrong I was. &amp;nbsp;You can use html but only for outputting information. &amp;nbsp;The most common way to write extensions is by using the built in Eclipse input types which pass data to ColdFusion via that funny XML format I spoke about earlier. &amp;nbsp;They are great if you are looking to tie into Eclipse but I wanted some UI tools to list data, a textarea to edit and a nice chart.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[UPDATE 6/30/10:&amp;nbsp;There is an easier way. &amp;nbsp;&lt;/strong&gt;&lt;a href=&quot;http://samfarmer.instantspot.com/blog/2010/06/30/ColdFusion-Builder-Extensions-and-forms-The-easy-way/&quot;&gt;&lt;strong&gt;Read this blog entry&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;br /&gt; &lt;br /&gt; So, it was on to using Flex to build a front end that had the UI controls I needed and started by reading this &lt;a href=&quot;http://www.terrenceryan.com/blog/post.cfm/coldfusion-builder-extension-using-flex&quot;&gt;great blog post by Terry Ryan&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt; This method works by writing a CFC webservice exposed via WSDL to pass data back and forth. &amp;nbsp;Terry used XML as a data transformation protocol. &amp;nbsp;Now, for me, XML is like warm beer.&amp;nbsp; Its there to be drunk, but first, lets see if there&apos;s a cold one around. &amp;nbsp;I decided to go with using cf queries to pass data around. &amp;nbsp;Combined with the Data Services panel in Flex Builder 4 this made the data transmission easy.&lt;br /&gt; &lt;br /&gt; One drawback to this approach is that Data Services assumes the URL for the webservice will not change. &amp;nbsp;To get around this I we need to pass that path to Flex via URL variables when we call the swf from within our extension. &amp;nbsp;Don&apos;t worry its actually simpler than that sounds.&lt;/p&gt; &lt;p&gt;Starting on the Flex side, I opened up the generated services file and removed any mention of the wsdl path. &amp;nbsp;This gets replaced with what is passed in during the declaration of the service, which I bind to a variable that is set based on a function called during preinitialize. &amp;nbsp;Here&apos;s the code:&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;s:Application&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:fx&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;http://ns.adobe.com/mxml/2009&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;&quot;&gt; &lt;div style=&quot;margin: 0px; padding: 5px; background-color: rgb(255, 255, 255); font-size: 12px;&quot;&gt; &lt;div&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;  &lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:s&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;library://ns.adobe.com/flex/spark&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:mx&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;library://ns.adobe.com/flex/mx&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;xmlns:service&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;services.service.*&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;preinitialize&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;init()&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;fx:Script&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;![CDATA[&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;[Bindable]&lt;/span&gt;&lt;/u&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public var wsdlPath:String = &amp;quot;&amp;quot;;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected function init():void&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wsdlPath = this.parameters.wsdlPath;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;]]&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;fx:Script&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;fx:Declarations&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;service:Service&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;service&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;wsdl&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;{wsdlPath}&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;useProxy&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;fx:Declarations&lt;/font&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&lt;font size=&quot;4&quot; color=&quot;#0000ff&quot;&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;/span&gt;&lt;/p&gt; &lt;p&gt;Thats a slightly simplified version.&amp;nbsp; All the code is available in the &lt;a href=&quot;http://svn.riaforge.org/vfsexplorer/VFSe/&quot;&gt;subversion repository&lt;/a&gt;.&amp;nbsp; (If you are a Flex developer and you know a better way please let me know. &amp;nbsp;I&apos;m a newbie when it comes to Flex.)&lt;br /&gt; &lt;br /&gt; On the ColdFusion side we need to pass in the server path to the swf. &amp;nbsp;Here&apos;s code for that, loosely based on Terry&apos;s code.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfscript&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;!&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;len&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; cgi.HTTPS &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; serverRoot &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;http://&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; cgi.HTTP_HOST &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; cgi.SERVER_PORT;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;else&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; serverRoot &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;https://&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; cgi.HTTP_HOST &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; cgi.SERVER_PORT_SECURE;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;serverRoot &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;getDirectoryFromPath&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; cgi.script_name &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;wsdlPath &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; serverRoot &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;Service.cfc?wsdl&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;flashPath &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; serverRoot &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;quot;flash/VFSe.swf?wsdlPath=#urlEncodedFormat( wsdlPath )#&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfscript&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfcontent&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;reset&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfheader&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;text/xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfoutput&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;showresponse&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;url&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;#flashPath#&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;dialog&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;All these files are virtual...&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;ide&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfoutput&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Overall I&amp;nbsp;found building an extension with Flex pretty straightforward and just by using the default Spark look the UI&amp;nbsp;is pretty attractive.&lt;/p&gt;</description><pubDate>Mon, 21 Jun 2010 01:34:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/06/20/Thoughts-on-building-with-a-ColdFusion-Builder-extension-with-Flex/</guid><category>ColdFusion Builder,ColdFusion 9</category></item><item><title>Virtual File Explorer Released!  ColdFusion Builder Extension to view, edit and delete your virtual files and directories.</title><link>http://samfarmer.instantspot.com/blog/2010/06/14/Virtual-File-Explorer-Released--ColdFusion-Builder-Extension-to-view-edit-and-delete-your-virtual-files-and-directories/</link><description>&lt;p&gt;The addition of a virtual file system, essentially RAM based files, in ColdFusion 9 is a very cool one and very useful at times.&amp;nbsp; Working with the virtual file system can be problematic though as, well, its virtual and therefore hard to see!&lt;/p&gt; &lt;p&gt;Enter the ColdFusion Builder extension called &lt;a href=&quot;http://vfsexplorer.riaforge.org/&quot;&gt;Virtual File Explorer&lt;/a&gt; that provides this insight.&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;499&quot; height=&quot;305&quot; alt=&quot;&quot; src=&quot;/userfiles/040107/117/main.png&quot; /&gt;&lt;/p&gt; &lt;p&gt;The image above is shrunk so you&apos;ll have to download and install the extension to see its true beauty.&amp;nbsp; The interface above shows the following features:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;Pie chart of free and used space&lt;/li&gt;     &lt;li&gt;List of all directories with total size, files with file size&lt;/li&gt;     &lt;li&gt;Delete button for deleting a file or directory&lt;/li&gt;     &lt;li&gt;Edit button for viewing or editing a file (or double-click).&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;The edit file interface is basic but functional:&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;499&quot; height=&quot;309&quot; alt=&quot;&quot; src=&quot;/userfiles/040107/117/VFedit.png&quot; /&gt;&lt;/p&gt; &lt;p&gt;I&apos;ve tagged this as version 0.8.&amp;nbsp; I&amp;nbsp;have some ideas for what would be nice for version 1 but I&apos;d also love to hear from you for any ideas or problems you come across. Thanks also to &lt;a href=&quot;http://coldfusionjedi.com/&quot;&gt;Raymond Camden&lt;/a&gt; for testing and providing great feedback.&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;http://vfsexplorer.riaforge.org/&quot;&gt;Download Virtual File&amp;nbsp;Explorer now!&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Later in the week I&apos;ll blog my thoughts about building an extension.&lt;/p&gt;</description><pubDate>Tue, 15 Jun 2010 01:05:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/06/14/Virtual-File-Explorer-Released--ColdFusion-Builder-Extension-to-view-edit-and-delete-your-virtual-files-and-directories/</guid><category>ColdFusion 9,Virtual File Explorer</category></item><item><title>ColdFusion Builder Variable Mappings is Cool, Useful (but Unfinished)</title><link>http://samfarmer.instantspot.com/blog/2010/06/03/ColdFusion-Builder-Variable-Mappings-is-Cool-Useful-but-Unfinished/</link><description>&lt;p&gt;I&amp;nbsp;used this feature today and it really sped up my development so while a few others have &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2010/3/9/ColdFusion-Builder--Code-Assist-for-Scoped-Variables&quot;&gt;blogged&lt;/a&gt; &lt;a href=&quot;http://blog.multipliedbyinfinity.com/post.cfm/coldfusion-variable-mappings-in-cf-builder&quot;&gt;about&lt;/a&gt; it I&amp;nbsp;thought I&amp;nbsp;would mention it.&lt;/p&gt; &lt;p&gt;Variable mappings are a ColdFusion project setting that maps a variable anywhere in your project to a CFC and provides code assist/insight on it.&lt;/p&gt; &lt;p&gt;Its simple to set up:&lt;/p&gt; &lt;ol&gt;     &lt;li&gt;Right click on a project and select &apos;Properties&apos;&lt;/li&gt;     &lt;li&gt;From the left menu click on &apos;ColdFusion Variable Mappings&apos;&lt;/li&gt;     &lt;li&gt;To add a mapping click on &apos;New&apos; enter in a variable name and the path to the cfc.&amp;nbsp; This is the same path you would use in your code and can include mappings but is case-sensative.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;Its extremely useful and a productivity boost.&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;439&quot; height=&quot;403&quot; src=&quot;/userfiles/040107/117/variableMapping.png&quot; alt=&quot;Variable Mapping&quot; /&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;How could it be improved?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;1. A setting to turn this on automatically for all persistent cfc&apos;s.&amp;nbsp; As persistent cfc&apos;s are unique accross an application there would be no name clashes. The variable name would be the entity name. (I&apos;ve added this as an enhancement but can not find it)&lt;/p&gt; &lt;p&gt;2. Make the mapped to field case insensitive.&lt;/p&gt; &lt;p&gt;3. Improve the UI: Add an edit option. (&lt;a href=&quot;http://cfbugs.adobe.com/bugreport/flexbugui/cfbugtracker/main.html#bugId=82490&quot;&gt;Vote for this bug&lt;/a&gt;)&amp;nbsp; Add some intelligence to the mapped to cfc. (&lt;a href=&quot;http://cfbugs.adobe.com/bugreport/flexbugui/cfbugtracker/main.html#bugId=79183&quot;&gt;Vote for this bug&lt;/a&gt;)&lt;/p&gt;</description><pubDate>Thu, 03 Jun 2010 23:47:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/06/03/ColdFusion-Builder-Variable-Mappings-is-Cool-Useful-but-Unfinished/</guid><category>ColdFusion Builder</category></item><item><title>5 Things I love about ColdFusion Builder</title><link>http://samfarmer.instantspot.com/blog/2010/04/28/5-Things-I-love-about-ColdFusion-Builder/</link><description>&lt;p&gt;I&apos;ve been using &lt;a href=&quot;http://www.adobe.com/products/coldfusion/cfbuilder/features/&quot;&gt;ColdFusion Builder&lt;/a&gt; for a while and am a big fan.&amp;nbsp; Here are my five favorite features in no particular order:&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;It provides great CF insight&lt;/strong&gt;&lt;br /&gt; The ColdFusion language insight is great but its a bit of a given that an Integrated Development Environment (IDE) would have this so lets move on.&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; It provides insight on code I write&lt;/strong&gt;&lt;br /&gt; To this which is cool.&amp;nbsp;&amp;nbsp; Builder parses the code I write and provides insight on it.&amp;nbsp; So if I write a cfc called Book with 5 functions and then in a separate file use the new operator, Builder will show the cfc&apos;s I&apos;ve written and after picking Book will then show the insight on the 5 functions I wrote.&amp;nbsp; It also does all this for ORM entities and ORM functions.&amp;nbsp; Also, Builder provides insight on the variables I am using on a page.&amp;nbsp; Parsing them as added and then providing insight on them.&amp;nbsp; These two feature not only save time but they also significantly cut down on typos.&amp;nbsp; In these ways Builder feels like it is working for me.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;It shows parsing errors&lt;/strong&gt;&lt;br /&gt; Parsing errors are annoying and generally a small typo here or a missed quote there.&amp;nbsp; When they happen its a trip to the browser, an error screen and then back to the IDE.&amp;nbsp; Not so with Builder which shows them right away.&amp;nbsp; I also find it satisfying when the red X&apos;s go away. (On some early betas this was quite slow but its performance has increased greatly on the final version.)&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Its shows my logs&lt;/strong&gt;&lt;br /&gt; Before Builder I almost never read log files for errors during development.&amp;nbsp; It took too long to find them or there was/is that tool that kinda works in the Admin but it was a real pain.&amp;nbsp; With Builder, configure the Tailview tab and logs show up.&amp;nbsp; Even better when something is added to the logs there is an indication by the tab going bold.&amp;nbsp; This is extremely useful during Flex or AJAX development but also good during regular old page refresh development.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;It works with virtual hosts&lt;/strong&gt;&lt;br /&gt; I generally don&apos;t develop in the web root but in virtual hosts.&amp;nbsp; Builder handles this really well and even with some complex set ups it has worked well.&lt;br /&gt; &lt;br /&gt; I was one of the many developers bugging, pleading and jumping loudly up and down for Adobe to build an Eclipse based IDE so I&apos;m very happy they did so.&amp;nbsp; There are some areas I think could be improved for the next version such as an easier project and set up process and a better SQL editor.&amp;nbsp; I look forward to seeing what they come up with next.&lt;/p&gt;</description><pubDate>Wed, 28 Apr 2010 12:59:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/04/28/5-Things-I-love-about-ColdFusion-Builder/</guid><category>ColdFusion Builder</category></item><item><title>Liking using implicit arguments for ColdFusion 9 functions</title><link>http://samfarmer.instantspot.com/blog/2010/04/12/Liking-using-implicit-arguments-for-ColdFusion-9-functions/</link><description>&lt;p&gt;Each new version of a computer language inevitably brings about changes, mostly for the better, in the style of writing that language.&lt;br /&gt; &lt;br /&gt; One change I have enjoyed with ColdFusion 9 is using implicit structures as arguments to a function. &amp;nbsp;This leads to bundling of arguments into structures in cases where it makes more sense.&amp;nbsp; Granted this has been going on in languages like JavaScript (and even the ColdFusion Javascript functions!) for a long time. &amp;nbsp;There are definitely good and bad reasons to use this style.&lt;br /&gt; &lt;br /&gt; Lets take a function, written with arguments individually defined, and see how this works:&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;getAndCache&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;url&lt;/span&gt;, &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;cacheType&lt;/span&gt;, &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;cacheTime&lt;/span&gt;, &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;cacheContent&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;That can be rewritten to:&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;getAndCache&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;url&lt;/span&gt;, &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;cache&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;This time we put all the cache settings in the cache argument.&lt;br /&gt; &lt;br /&gt; Advantages:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;All cache settings are put in one structure.&lt;/li&gt;     &lt;li&gt;These arguments can potentially be defined in one application wide place and passed in easily (in a similar way that argumentCollection can be used).&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;Disadvantages:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;Slightly harder to document and validate&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;As I mentioned earlier I&apos;m not suggesting using this for every function but for those that have a collection of config or style options it can work well. &amp;nbsp;This is seen in a lot of JavaScript functions and used widely by jQuery.&lt;/p&gt;</description><pubDate>Tue, 13 Apr 2010 02:54:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/04/12/Liking-using-implicit-arguments-for-ColdFusion-9-functions/</guid><category>ColdFusion 9</category></item><item><title>Infinite entities, cfgrid and one cfc to handle the data</title><link>http://samfarmer.instantspot.com/blog/2010/03/09/Infinite-entities-cfgrid-and-one-cfc-to-handle-the-data/</link><description>&lt;p&gt;While writing SpreadEdit I&amp;nbsp;wanted every entity to be editable via cfgrid.&amp;nbsp; In particular I thought it would be cool to have one cfc on the back end to process the data from cfgrid no matter what entity it was working with.&amp;nbsp; With ColdFusion 9 and ORM&amp;nbsp;this proved possible and is pretty cool, check out the screencast.&amp;nbsp; Code the other side of the embed.&lt;/p&gt; &lt;p&gt;&lt;object width=&quot;746&quot; height=&quot;518&quot; id=&quot;scPlayer&quot;&gt;  &lt;param value=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/mp4h264player.swf&quot; name=&quot;movie&quot; /&gt; &lt;param value=&quot;high&quot; name=&quot;quality&quot; /&gt; &lt;param value=&quot;#FFFFFF&quot; name=&quot;bgcolor&quot; /&gt; &lt;param value=&quot;thumb=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/FirstFrame.jpg&amp;amp;containerwidth=746&amp;amp;containerheight=518&amp;amp;content=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/GenericGridORM.mp4&quot; name=&quot;flashVars&quot; /&gt; &lt;param value=&quot;true&quot; name=&quot;allowFullScreen&quot; /&gt; &lt;param value=&quot;showall&quot; name=&quot;scale&quot; /&gt; &lt;param value=&quot;always&quot; name=&quot;allowScriptAccess&quot; /&gt; &lt;param value=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/&quot; name=&quot;base&quot; /&gt;  &lt;embed width=&quot;746&quot; height=&quot;518&quot; scale=&quot;showall&quot; base=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/&quot; allowfullscreen=&quot;true&quot; flashvars=&quot;thumb=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/FirstFrame.jpg&amp;amp;containerwidth=933&amp;amp;containerheight=648&amp;amp;content=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/GenericGridORM.mp4&quot; allowscriptaccess=&quot;always&quot; type=&quot;application/x-shockwave-flash&quot; bgcolor=&quot;#FFFFFF&quot; quality=&quot;high&quot; src=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/ff52f57b-8d91-4096-9675-c29784730edd/mp4h264player.swf&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;  &lt;p&gt;Here is the code for genericGrid.cfc:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfcomponent&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;getData&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;access&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;remote&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;returnformat&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;JSON&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;page&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;pageSize&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;gridSortColumn&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;gridSortDirection&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;entity&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;!&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;len&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; arguments.gridSortColumn &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; arguments.gridSortColumn &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; local.getTasks &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;ormExecuteQuery&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot; FROM #arguments.entity# ORDER BY #arguments.gridSortColumn# #arguments.gridSortDirection#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfreturn&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;queryconvertforgrid&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityToQuery&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; local.getTasks &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;, Arguments.page, Arguments.pageSize&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;setData&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;access&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;remote&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;action&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;row&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;changed&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;entity&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; arguments.action &lt;span style=&quot;color: black;&quot;&gt;eq&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;U&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; local.obj &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityLoad&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; arguments.entity, arguments.row, &lt;span style=&quot;color: black;&quot;&gt;true&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;collection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.changed#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;local.key&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvoke&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;component&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.obj#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;method&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvokeargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.changed[ local.key ]#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfinvoke&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfelseif&lt;/span&gt; arguments.action &lt;span style=&quot;color: black;&quot;&gt;eq&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;I&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; local.obj &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityNew&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; arguments.entity &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;collection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.row#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;local.key&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; local.key &lt;span style=&quot;color: black;&quot;&gt;neq&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;CFGRIDROWINDEX&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvoke&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;component&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.obj#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;method&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvokeargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#cleaned( arguments.row[ local.key ] )#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfinvoke&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entitySave&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; local.obj &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;cleaned&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;access&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;private&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;string&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;var&lt;/span&gt;&lt;/b&gt; ret &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; arguments.string&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--- check for date ---&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;reFind&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}T[[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}&amp;quot;&lt;/span&gt;,&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt; ret &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;rereplaceNoCase&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; ret, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;T&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfreturn&lt;/span&gt; ret&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfcomponent&amp;gt;&lt;/span&gt;&lt;/div&gt;</description><pubDate>Wed, 10 Mar 2010 03:47:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/03/09/Infinite-entities-cfgrid-and-one-cfc-to-handle-the-data/</guid><category>ColdFusion 9,ORM</category></item><item><title>Thoughts on first Flex/Air app</title><link>http://samfarmer.instantspot.com/blog/2010/03/05/Thoughts-on-first-FlexAir-app/</link><description>&lt;p&gt;Recently I&amp;nbsp;launched my first Flex-based Air application.&amp;nbsp; Here are my thoughts:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Flex apps are real apps&lt;/strong&gt;&lt;br /&gt; Previously I thought Flex applications where simply the V in an MVC framework with a bunch of fancy UI&amp;nbsp;widgets.&amp;nbsp; Now I see differently and the value of a Flex MVC framework becomes clear.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Value-Objects and ORM is beautiful&lt;/strong&gt;&lt;br /&gt; I used the Data/Services feature of Flash Builder 4 to get a quick start on the application. The object it creates can be sent to ColdFusion and saved to the database by simply using entitySave().&amp;nbsp; Powerful stuff.&amp;nbsp; Exactly how this is used is dependent on the whole architecture architecture.&amp;nbsp; I ended up having some Controller work in both Flex and ColdFusion, whether good or bad is for another day, because I needed to send some emails and notify other users via Messaging.&amp;nbsp; I now see where the CFaaS feature could allow Actionscript programmers to add the features they need like email to their applications without writing any ColdFusion.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Messaging, Gateways and Config Madness&lt;/strong&gt;&lt;br /&gt; The messaging feature of Blaze DS/ColdFusion combined with Flex was the deciding reason for writing this application in Air.&amp;nbsp; Its ridiculously cool to use but also ridiculously hard to set up.&amp;nbsp; A whole bunch of XML files, Event Gateways, other gateways.&amp;nbsp; Definitely an area that could be improved in the ColdFusion administrator and documentation.&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; Spark looks good out the box&lt;/strong&gt;&lt;br /&gt; One thing I did not like about Flex 3 apps was the default look.&amp;nbsp; The new Spark look is great and looks lovely straight away.&amp;nbsp; I have done almost no design for this application, the users like the look and feel, and overall that has been a big timesaver.&lt;br /&gt; &lt;br /&gt; Overall I have really enjoyed writing my first Flex application.&amp;nbsp; I&apos;m definitely not an expert in it but was able to make a great desktop application with it.&amp;nbsp; I can see that I need to learn more about architecting Flex applications to truly get the full benefits of it.&lt;/p&gt;</description><pubDate>Fri, 05 Mar 2010 13:29:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/03/05/Thoughts-on-first-FlexAir-app/</guid><category>Flex,ColdFusion 9,Air</category></item><item><title>In ColdFusion 9, what isNull() and what is it good for</title><link>http://samfarmer.instantspot.com/blog/2010/02/23/In-ColdFusion-9-what-isNull-and-what-is-it-good-for/</link><description>&lt;p&gt;ColdFusion 9 brings us a new function called isNull.&amp;nbsp; But, you may say ColdFusion doesn&apos;t support null&apos;s and you would still be mostly right.&amp;nbsp; As of ColdFusion 9 certain objects can be null.&amp;nbsp; Sound tricky?&amp;nbsp; Here are a couple handy uses for isNull.&lt;br /&gt; &lt;br /&gt; &lt;strong&gt;Working with caches&lt;/strong&gt;&lt;br /&gt; When using CacheGet if the id you pass does not exist then the returned object will be null.&amp;nbsp; Its therefore best to check after getting the data:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;myData &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;cacheGet&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;coolCacheName&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;isNull&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;myData&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: gray;&quot;&gt;//do something&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;strong&gt;Working with entityLoad or entityLoadByPK&lt;/strong&gt;&lt;br /&gt; When using either entityLoad with unique=true or entityLoadByPK which is required to change values of an existing object (in db terms: a row you want to do an update on) if the id you pass in does not return an object then you get a null object back.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;a &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;entityLoad&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;ART&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;artID&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 10, 10);&quot;&gt;3000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;, &lt;span style=&quot;color: black;&quot;&gt;true)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;!&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;isNull&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;a&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: gray;&quot;&gt;//some sort of logic or error handling&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&lt;br /&gt; &lt;strong&gt;Checking to see if a variable exists&lt;/strong&gt;&lt;br /&gt; While not an object its possible to check for an undefined variable with isNull.&amp;nbsp; (Queue debate on which is quicker/better for determining if a variable exists isNull, isDefined or structKeyExists!)&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;variables.name &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;Sam&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;isNull&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; variables.nane &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: gray;&quot;&gt;//there&apos;s a typo!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; line-height: 115%;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;isNull is a minor addition but one that proves quite useful when working with caching and/or ORM.&lt;/p&gt;</description><pubDate>Wed, 24 Feb 2010 01:26:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/02/23/In-ColdFusion-9-what-isNull-and-what-is-it-good-for/</guid><category>ColdFusion 9</category></item><item><title>Thoughts on my first ColdFusion 9 application going into production</title><link>http://samfarmer.instantspot.com/blog/2010/02/10/Thoughts-on-my-first-ColdFusion-9-application-going-into-production/</link><description>&lt;p&gt;I&amp;nbsp;recently released my first application built with ColdFusion 9 to production and it took full advantage of some of the new features of ColdFusion 9.&amp;nbsp; Overall these features sped up development and have nudged me to become a better developer.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;ORM&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Damn this is cool.&amp;nbsp; Create a new cfc with persistent=true, write all the needed properties, and as long as the ormsettings include dbupdate=update and ormReload() is called all the database table creation is complete.&amp;nbsp; Then use entityNew, entityLoad and entitySave to work with the object(s).&amp;nbsp; Making changes to the model is as simple as adding a property.&amp;nbsp; Setting up event handlers &lt;a href=&quot;http://samfarmer.instantspot.com/blog/2010/01/23/Using-ORM-Event-Handler-to-easily-and-automatically-add-audit-information&quot;&gt;to automatically deal with audit data&lt;/a&gt; improves the applications quality and is also damn cool!&amp;nbsp; That added with the code assist from CFBuilder makes development very rapid.&lt;/p&gt; &lt;p&gt;But beyond the ease and speed I also feel that ORM&amp;nbsp;has made me a better object-oriented developer as I&amp;nbsp;noticed&amp;nbsp; I&amp;nbsp;&lt;em&gt;finally really&lt;/em&gt; stopped thinking about tables and instead objects.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Improved CFScript&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;After all these years of loving writing everything CF&amp;nbsp;in tags it feels a little weird to switch to loving script but its less code, cleaner and easier to read.&amp;nbsp; Now I love using cfscript for writing CF in the model and controller layers.&amp;nbsp; For views good old tags are still my preferences.&amp;nbsp;&amp;nbsp; The only disapointment is that not all tags are available in script (and way fewer than as suggested by &lt;a href=&quot;http://forta.com/blog/index.cfm/2009/7/9/CFML-Enhancements-Coming-Soon&quot;&gt;Ben Forta&lt;/a&gt;).&amp;nbsp; I&amp;nbsp;hope that will be enhanced in either 9.0.1 or 10.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Caching&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This application retrieved a lot of information from third parties so to increase speed and reliability I did a fair amount of caching.&amp;nbsp; It doesn&apos;t get much easier than using cachePut and cacheGet which work with every data type (xml, structures, strings, etc).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Virtual File System&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;While I&amp;nbsp;have not done any fully scientific, load balanced tests my quick tests show code running faster from the VFS which makes sense as its in RAM.&amp;nbsp; ColdFusion treats the VFS&amp;nbsp;just like any other file system which makes using the VFS&amp;nbsp;extremely easy.&amp;nbsp; The only problems I encountered came about if the VFS connection was not closed properly and that file could then often not be used until a restart.&amp;nbsp; To accomodate for this I&amp;nbsp;added try/catch around use of VFS where an error might occur and closed the files in the catch.&lt;/p&gt; &lt;p&gt;There are many, many more features of ColdFusion 9 and I tried to cram as many as possible into my Best of ColdFusion 9 submission &lt;a href=&quot;http://www.coldfusionjedi.com/index.cfm/2009/12/7/Best-of-CF9-spreadEdit&quot;&gt;SpreadEdit&lt;/a&gt; as possible but this application only used the above ones!&lt;/p&gt; &lt;p&gt;Overall I&apos;ve really enjoyed building applications with ColdFusion 9.&amp;nbsp; Its definitely faster in both performance and development, especially when combined with ColdFusion Builder.&amp;nbsp; I think it may well shift how we build applications.&lt;/p&gt;</description><pubDate>Thu, 11 Feb 2010 03:00:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/02/10/Thoughts-on-my-first-ColdFusion-9-application-going-into-production/</guid><category>ColdFusion 9,ORM</category></item><item><title>How in one line to extend ColdFusion by writing CFC&apos;s</title><link>http://samfarmer.instantspot.com/blog/2010/01/28/How-in-one-line-to-extend-ColdFusion-by-writing-CFCs/</link><description>&lt;p&gt;There have always been ways to extend ColdFusion through custom tags (and its variations like cfmodule) or by adding a library cfc or by including a file before every page.&lt;/p&gt; &lt;p&gt;I&amp;nbsp;now present another way;&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;a way to write a cfc&lt;/li&gt;     &lt;li&gt;place it in a folder&lt;/li&gt;     &lt;li&gt;and call it via the new operator.&amp;nbsp;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;And its all done by one setting:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;this.customtagpaths = pathToExtensionFolder!&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Lets see it in action.&amp;nbsp; First, set up an Application.cfc like so:&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.customtagpaths &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;getDirectoryFromPath&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;GetCurrentTemplatePath&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;languageExtension/&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Then in the langaugeExtension folder add as many cfc&apos;s as you want for my example I&amp;nbsp;included one called Invoke.cfc (yes, I&apos;ve wanted a script based version of this for a while! ;)&amp;nbsp;):&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(128, 64, 0);&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;first&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;return&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;Sam&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;In the root folder I&amp;nbsp;created a test.cfm with the following code:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfscript&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;a &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;new&lt;/span&gt;&lt;/b&gt; languageExtension.Invoke&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeDump&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;i &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;new&lt;/span&gt;&lt;/b&gt; Invoke&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeDump&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;o&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;i.first&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeOutput&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;o&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfscript&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Being in the root folder the first line should always work.&amp;nbsp; Nothing exciting there.&amp;nbsp; But whats cool is line 4 where variable i is set with no path to Invoke().&amp;nbsp; And it works.&amp;nbsp; Here is a screenshot:&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;324&quot; height=&quot;486&quot; src=&quot;/userfiles/040107/117/languageExtension1.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt; &lt;p&gt;Next I&amp;nbsp;created a sub folder structure to see if this would still work further down the chain.&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;181&quot; height=&quot;146&quot; src=&quot;/userfiles/040107/117/languageExtensionFolder.png&quot; alt=&quot;Folder Set Up&quot; /&gt;&lt;/p&gt; &lt;p&gt;And here is the code for dirB/test.cfm:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfscript&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;i &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;new&lt;/span&gt;&lt;/b&gt; Invoke&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeDump&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;o&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;i.first&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;writeOutput&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;o&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfscript&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Which works as well!&amp;nbsp; Here is its screenshot:&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;320&quot; height=&quot;257&quot; alt=&quot;Dump of dirB/test.cfm&quot; src=&quot;/userfiles/040107/117/languageExtension2.png&quot; /&gt;&lt;/p&gt; &lt;p&gt;You can also place extra CFCs in the servers root CustomTags folder and use new on them.&amp;nbsp; &lt;strong&gt;I think this is a bad idea&lt;/strong&gt;.&amp;nbsp; Its better to write applications that can be dropped anywhere and are not dependent on special server set ups.&lt;/p&gt; &lt;p&gt;So a pretty easy way to more natively expand upon the ColdFusion language and while I&amp;nbsp;mention this.customtagpaths above it is also possible thanks to the new operator introduced in 9.&lt;/p&gt;</description><pubDate>Fri, 29 Jan 2010 01:10:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/01/28/How-in-one-line-to-extend-ColdFusion-by-writing-CFCs/</guid><category>ColdFusion 9</category></item><item><title>Using ORM Event Handler to easily and automatically add audit information</title><link>http://samfarmer.instantspot.com/blog/2010/01/23/Using-ORM-Event-Handler-to-easily-and-automatically-add-audit-information/</link><description>&lt;p&gt;Using the event handling features in ORM&amp;nbsp;in ColdFusion 9 makes it easy to automatically add audit information such as last updated and last modified by to all objects, well technically tables, in the database.&amp;nbsp; I&apos;m about to launch my first ColdFusion 9 application and the technique below has worked well and sped up development.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Step 1: Decide on audit colum names&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;There really is no right or wrong way here.&amp;nbsp; Go for something readable and easily understandable (for those lucky future developers who will look at your code!).&amp;nbsp; Once you pick them add them as properties to your CFC:&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;persistent&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;teamID&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;fieldtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;generator&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;native&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;generated&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;always&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;teamName&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;ormtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;string&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;dateCreated&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;ormtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;timestamp&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;dateModified&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;ormtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;timestamp&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;createdBy&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;ormtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;integer&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;lastModifiedBy&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;ormtype&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;integer&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&lt;strong&gt;Step 2: Turn on Event Handling and Hander&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;In your Application.cfc in addition to ormEnabled=true, turn on event handling and an event handler like so:&lt;/p&gt; &lt;p&gt;this.ormsettings = { &lt;strong&gt;eventHandling&lt;/strong&gt;=true, &lt;strong&gt;eventHandler&lt;/strong&gt;=&amp;quot;myEventHandler&amp;quot; };&lt;/p&gt; &lt;p&gt;The eventHandler points to a valid CFC &amp;quot;myEventHandler.cfc&amp;quot; which is what we will create next.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Step 3:&amp;nbsp;Create an Event Handler CFC (See I&amp;nbsp;told ya!)&lt;/strong&gt;&lt;/p&gt; &lt;div&gt;The event handler must implement &lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;CFIDE.orm.IEventHandler&lt;/span&gt;.&amp;nbsp;CFBuilder makes this easy, add a new ColdFusion Component file and on the New ColdFusion Component screen under &amp;lsquo;Implements&amp;rsquo; click on &amp;lsquo;Add&amp;rsquo;, and select CFIDE.orm.IEventHandler.&amp;nbsp;If you script style components, as I do, click the &amp;lsquo;Generate Script Style Code&amp;rsquo; option.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Your new file will look like this:&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;implements&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;CFIDE.orm.IEventHandler&amp;quot; &lt;br /&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;preDelete&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;preInsert&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;preLoad&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;postDelete&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;postLoad&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;preUpdate&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;, &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;Struct&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;oldData&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;postUpdate&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;postInsert&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&lt;strong&gt;Step 4:&amp;nbsp;Add code to preInsert and preUpdate functions&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The preInsert and preUpdate functions in the event handler CFC are the last functions that get run before ColdFusion hands over to Hibernate for persistence&amp;nbsp;(a fancy way of saying saving to database).&amp;nbsp; All of the functions in eventHandler take in the entity as an argument called entity (if you are new to cfscript within the parenthesis its saying a type of any and an argument called entity).&amp;nbsp; We simply call the various functions and pass in the values.&amp;nbsp; I&amp;nbsp;found I&amp;nbsp;got an error at first matching the session userID to createBy and lastModifiedBy and needed to use JavaCast.&amp;nbsp; [Update Feb 6 &apos;10: This bug is scheduled to be fixed in 9.0.1] After making a change to myEventHandler.cfc run ormReload() (I&apos;ve gotten used to having this in onRequestStart and commenting it out when not needed).&lt;/p&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(45, 45, 247);&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;void&lt;/span&gt; &lt;span style=&quot;color: rgb(128, 64, 0);&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;preInsert&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;any&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entity&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entity.setCreatedBy&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;JavaCast&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;int&amp;quot;&lt;/span&gt;, session.userID &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entity.setLastModifiedBy&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;JavaCast&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;int&amp;quot;&lt;/span&gt;, session.userID &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entity.setDateCreated&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;now&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entity.setDateModified&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;now&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;p&gt;The preUpdate function is very similar except just has the setLastModifiedBy and setDateModified calls.&amp;nbsp; If all your entities don&apos;t have the audit properties/columns use this &lt;a href=&quot;http://samfarmer.instantspot.com/blog/2009/12/15/Using-StructKeyExists-to-find-if-an-object-has-a-function/&quot;&gt;technique for checking if the function exists&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Lets see it in action.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Using the Team object from above:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; t &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityNew&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;Team&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; t.setTeamName&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;Arsenal&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entitySave&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; t &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;Thats all the code needed.&amp;nbsp; Here&apos;s a screenshot of the database after insert that shows all the audit data.&lt;/p&gt; &lt;p&gt;&lt;img width=&quot;495&quot; height=&quot;135&quot; alt=&quot;Database with Audit Information&quot; src=&quot;/userfiles/040107/117/ormAuto.png&quot; /&gt;&lt;/p&gt;</description><pubDate>Sat, 23 Jan 2010 20:52:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/01/23/Using-ORM-Event-Handler-to-easily-and-automatically-add-audit-information/</guid><category>ColdFusion 9,ORM</category></item><item><title>2010: Speaking at CFUnited and an Adobe Community Professional!</title><link>http://samfarmer.instantspot.com/blog/2010/01/19/2010-Speaking-at-CFUnited-and-an-Adobe-Community-Professional/</link><description>&lt;p&gt;In the past few days I&apos;ve received some pretty exciting news.&amp;nbsp; First I got word that I have been selected to speak at CFUnited on &lt;a href=&quot;http://cfunited.com/blog/index.cfm/2010/1/18/Lo-and-Behold--What-You-All-Have-Been-Waiting-For&quot;&gt;ColdFusion One Liners&lt;/a&gt;.&amp;nbsp; I&amp;nbsp;gave this topic at CFinNC and am looking forward to building on the feedback I&amp;nbsp;received and some new ideas for CFUnited this year.&amp;nbsp; I&apos;ve never given a presentation again so I&apos;m looking forward to a chance to make it better.&lt;/p&gt; &lt;p&gt;Second I&amp;nbsp;got chosen as an &lt;a href=&quot;http://lizfrederick.blogspot.com/2010/01/new-acps-for-2010.html&quot;&gt;Adobe Community Professional&lt;/a&gt;.&amp;nbsp; This is a real honor to be amongst a group of community members that I&amp;nbsp;admire a great deal.&amp;nbsp; I&apos;m looking forward to learning from them and passing on as much as possible.&amp;nbsp; The first thing I want to do is create a series of screencasts about my experiences with ColdFusion 9.&lt;/p&gt;</description><pubDate>Wed, 20 Jan 2010 03:18:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/01/19/2010-Speaking-at-CFUnited-and-an-Adobe-Community-Professional/</guid><category>CFUnited,ColdFusion 9,Adobe Community Professional</category></item><item><title>Adding ExtJS Effects to cfwindow</title><link>http://samfarmer.instantspot.com/blog/2010/01/14/Adding-ExtJS-Effects-to-cfwindow/</link><description>&lt;p&gt;Underneath the hood cfwindow uses ExtJS to make modal windows.&amp;nbsp; This means with a little bit of JavaScript its possible to add effects to a cfwindow.&amp;nbsp; First lets create a cfwindow:&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfwindow&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;myWindow&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;title&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;My Window&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;initshow&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;windowContent&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Some text about how cool something is.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Some text about how cool something is.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Some text about how cool something is.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;br&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfwindow&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Nothing special here.&amp;nbsp; To tie it in with some ExtJS effects we need to get at its inners using the ColdFusion.Window.getWindowObject()&amp;nbsp;function.&amp;nbsp; In the example below once we get the window object we add a listener to it using the shorthand ExtJs notation of &amp;quot;on&amp;quot; to look for when the mouse enters and leaves the window.&amp;nbsp; When the mouse enters we log to the console the id of the element (it can be useful to know the id of it) and then perform a highlight effect on the windowContent div.&amp;nbsp; When the mouse leaves we hide the window.&lt;/p&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;Ext&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;onReady&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(0, 0, 192);&quot;&gt;function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;(){&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(0, 0, 192);&quot;&gt;var&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: black;&quot;&gt;myWin&lt;/span&gt; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ColdFusion&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;getWindowObject&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&apos;myWindow&apos;&lt;/span&gt; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;myWin&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;getEl&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: black;&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&apos;mouseenter&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;:&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(0, 0, 192);&quot;&gt;function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(){&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: rgb(0, 0, 192);&quot;&gt;this&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;);&lt;/span&gt; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;Ext&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&apos;windowContent&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;highlight&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&amp;quot;ffff9c&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;{&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;endColor&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&amp;quot;ffffff&amp;quot;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;},&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&apos;mouseleave&apos;&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;:&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(0, 0, 192);&quot;&gt;function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(){&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;ColdFusion&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;hide&lt;/span&gt;&lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(0, 92, 0);&quot;&gt;&apos;myWindow&apos;&lt;/span&gt; &lt;span style=&quot;color: rgb(92, 92, 92);&quot;&gt;);}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;});&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(92, 92, 92);&quot;&gt;});&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: rgb(163, 21, 21);&quot;&gt;script&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Thats it!&amp;nbsp; ExtJs has a &lt;a href=&quot;http://www.extjs.com/deploy/ext-3.0.0/docs/?class=Ext.Fx&quot;&gt;bunch of cool effects&lt;/a&gt; that can be applied to an element.&lt;/p&gt; &lt;p&gt;Here&apos;s a short screencast showing the code above in action:&lt;/p&gt; &lt;p&gt;&lt;embed width=&quot;583&quot; height=&quot;442&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; src=&quot;http://www.screencast.com/t/ZGI2NzRjY2&quot; scale=&quot;exactfit&quot; play=&quot;false&quot; loop=&quot;false&quot; menu=&quot;true&quot;&gt;&lt;/embed&gt;&lt;/p&gt; &lt;p&gt;&lt;object width=&quot;583&quot; height=&quot;442&quot;&gt; &lt;/object&gt;&lt;/p&gt;  &lt;param value=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/mp4h264player.swf&quot; name=&quot;movie&quot; /&gt; &lt;param value=&quot;high&quot; name=&quot;quality&quot; /&gt; &lt;param value=&quot;#FFFFFF&quot; name=&quot;bgcolor&quot; /&gt; &lt;param value=&quot;thumb=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/FirstFrame.jpg&amp;amp;containerwidth=583&amp;amp;containerheight=442&amp;amp;content=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/cfWindowEffects.mp4&quot; name=&quot;flashVars&quot; /&gt; &lt;param value=&quot;true&quot; name=&quot;allowFullScreen&quot; /&gt; &lt;param value=&quot;showall&quot; name=&quot;scale&quot; /&gt; &lt;param value=&quot;always&quot; name=&quot;allowScriptAccess&quot; /&gt; &lt;param value=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/&quot; name=&quot;base&quot; /&gt;  &lt;embed width=&quot;583&quot; height=&quot;442&quot; scale=&quot;showall&quot; base=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/&quot; allowfullscreen=&quot;true&quot; flashvars=&quot;thumb=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/FirstFrame.jpg&amp;amp;containerwidth=583&amp;amp;containerheight=442&amp;amp;content=http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/cfWindowEffects.mp4&quot; allowscriptaccess=&quot;always&quot; type=&quot;application/x-shockwave-flash&quot; bgcolor=&quot;#FFFFFF&quot; quality=&quot;high&quot; src=&quot;http://content.screencast.com/users/Sam.Farmer/folders/Default/media/7878e3b3-dcfd-4592-a904-40fac96378ce/mp4h264player.swf&quot;&gt;&lt;/embed&gt;</description><pubDate>Fri, 15 Jan 2010 01:41:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2010/01/14/Adding-ExtJS-Effects-to-cfwindow/</guid><category>ColdFusion 9,ExtJs</category></item><item><title>Dynamically injecting data into an Object</title><link>http://samfarmer.instantspot.com/blog/2009/12/17/Dynamically-injecting-data-into-an-Object/</link><description>&lt;div&gt;I like to write as little code as possible (that&amp;rsquo;s the whole point of coding, right?) and recently, since I started working with ORM, have found the need to inject data into an object.&amp;nbsp;Often with an ORM object -- though this isn&amp;rsquo;t limited just to ORM -- you create a new object then have lines of setXXX functions like so:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;s &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityNew&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&apos;Sample&apos;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;s.setAge&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; form.age &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;s.setFirstname&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; form.firstname &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Well I got pretty bored of writing all those setXXX lines.&amp;nbsp;So I wrote a function to do it.&amp;nbsp;(This is not the only way or necessarily the best way but I thought I would put it out there).&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;injectInto&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;obj&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;hint&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;I am an object for injecting&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;st&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;hint&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;I am a structure of data.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfloop&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;collection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.st#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;local.key&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;structKeyExists&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; obj, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvoke&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;component&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.obj#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;method&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvokeargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.st[ local.key ]#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfinvoke&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;First off this is all in tags as there is no invoke function in cfscript.&amp;nbsp;Originally the if structKeyExists line was a try and catch.&amp;nbsp;That worked but felt a little like overkill so I experimented around and found that structKeyExists works &lt;a href=&quot;http://samfarmer.instantspot.com/blog/2009/12/15/Using-StructKeyExists-to-find-if-an-object-has-a-function&quot;&gt;as I blogged about&lt;/a&gt;.&amp;nbsp;I also tried using getComponentData which returns all functions but again this felt heavy to me.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;So, what does the function do?&amp;nbsp;It takes in an object that you want injected and a structure of data to inject into it, loops over that data, checks to see if the object publicly wants it and if so uses cfinvoke to give it to the object.&amp;nbsp;The above code now becomes:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;s &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;entityNew&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&apos;Sample&apos;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;s injectInto( s, form );&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;But what if you have data in multiple structures; form, url, request for instance?&amp;nbsp;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;injectInto&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfargument&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;obj&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;required&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;hint&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;I am an object for injecting&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfloop&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#structCount( arguments )#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;index&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;local.collection&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;isStruct&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; arguments&lt;span style=&quot;color: black;&quot;&gt;[&lt;/span&gt; local.collection &lt;span style=&quot;color: black;&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfloop&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;collection&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments[ local.collection ]#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;local.key&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;structKeyExists&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; obj, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvoke&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;component&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments.obj#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;method&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;set#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfinvokeargument&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#local.key#&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;#arguments[ local.collection ][ local.key ]#&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfinvoke&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfloop&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;The above function will take in any number of structures and inject their data into the object.&amp;nbsp;You may notice that the function only has one argument even though I just said it can have an endless number of arguments.&amp;nbsp;That&amp;rsquo;s because I am going to programatically deal with them.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Regardless of how many arguments a ColdFusion function has defined it will always take in everything you give it.&amp;nbsp;(Its generous like that! ;) ) If the arguments are not named then they take a number in the arguments structure.&amp;nbsp;Let&amp;rsquo;s call the above function and then dump its arguments passed into injectInto.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;em&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;//setting up some &amp;ldquo;fake&amp;rdquo; structures for form, url and request &lt;/span&gt;&lt;/em&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;f &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt; age&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;23&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;u &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt; firstname&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;Sam&amp;quot;&lt;/span&gt;, age&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;21&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;r&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt; userID&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;2134132&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;sObj &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;new&lt;/span&gt;&lt;/b&gt; Sample&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;injectInto&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; sObj, f, u, r &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;img width=&quot;286&quot; height=&quot;327&quot; src=&quot;/userfiles/040107/117/injectIntoArguments.png&quot; alt=&quot;&quot; /&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;As you can see the only named argument is the first one passed in &amp;ndash; obj, the others get numbers for names.&amp;nbsp;This is useful as it preserves the order they are passed and means we can loop over them and inject their data into the object which going back to the injectInto function is exactly what happens.&lt;/div&gt;</description><pubDate>Fri, 18 Dec 2009 05:14:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2009/12/17/Dynamically-injecting-data-into-an-Object/</guid><category>ColdFusion,ColdFusion 8,ColdFusion 9</category></item><item><title>Using StructKeyExists to find if an object has a function</title><link>http://samfarmer.instantspot.com/blog/2009/12/15/Using-StructKeyExists-to-find-if-an-object-has-a-function/</link><description>&lt;div&gt; &lt;div&gt;Recently I have needed to dynamically know if an object has a public function.&amp;nbsp;I found this can be achieved using structKeyExists.&amp;nbsp;First, lets set up a cfc:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;component&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;accessors&lt;/span&gt;=&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;{&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;firstname&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;property&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;age&amp;quot;&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;getaddress&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;return&lt;/span&gt;&lt;/b&gt; variables.address;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(45, 45, 247);&quot;&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;function&lt;/span&gt;&lt;/b&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;setaddress&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; &lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;address&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; variables.address &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; arguments.address;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Or if you prefer a tag based cfc:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfcomponent&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;accessors&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfproperty&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;firstname&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfproperty&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;age&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;getaddress&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;access&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;private&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;cfreturn&lt;/span&gt; variables.address&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cffunction&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;setaddress&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;access&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;&amp;quot;private&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;cfset&lt;/span&gt; variables.address &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; arguments.address&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cffunction&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfcomponent&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;An object of this cfc will have 6 functions, 4 public ( getFirstname(), setFirstname(), getAge(), setAge() ) and 2 private ( getAddress(), setAddress() ).&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Now based on getting errors when leaving off the parenthesis from a function call, I thought I would try and see if I could use structKeyExists to test if a function exists.&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfset&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; s &lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;new&lt;/span&gt;&lt;/b&gt; Sample&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;structKeyExists&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; s, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;setFirstname&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;background: white none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;The function setFirstname EXISTS!!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfelse&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;The function setFirstname can not be accessed&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt; or does not exist&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfif&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt; &lt;b&gt;&lt;span style=&quot;color: rgb(45, 45, 247);&quot;&gt;structKeyExists&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt; s, &lt;span style=&quot;color: blue;&quot;&gt;&amp;quot;setAddress&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(154, 41, 10);&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;The function setAddress EXISTS!!&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;cfelse&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;The function setAddress can not be accessed or does not exist&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;&amp;lt;br&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 10pt; color: rgb(154, 41, 10);&quot;&gt;&amp;lt;/cfif&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;This will output:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;&lt;span style=&quot;font-size: 13.5pt; color: black;&quot;&gt;The function setFirstname EXISTS!!&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt; color: black;&quot;&gt;&lt;br /&gt; The function setAddress can not be accessed or does not exist&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;I was a little surprised it worked and can&amp;rsquo;t decide if its hackey or cool (or if hackey is even a word!).&amp;nbsp;Next up I&amp;rsquo;ll show why I wanted to do this and use it dynamically.&lt;/div&gt; &lt;/div&gt;</description><pubDate>Tue, 15 Dec 2009 19:10:00 GMT</pubDate><guid>http://samfarmer.instantspot.com/blog/2009/12/15/Using-StructKeyExists-to-find-if-an-object-has-a-function/</guid><category>ColdFusion,ColdFusion 8,ColdFusion 9</category></item></channel></rss>