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

<channel>
	<title>WebProNews &#187; coldfusion</title>
	<atom:link href="http://www.webpronews.com/tag/coldfusion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webpronews.com</link>
	<description>Breaking News in Tech, Search, Social, &#38; Business</description>
	<lastBuildDate>Mon, 13 Feb 2012 02:38:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Experimental Google Search Options</title>
		<link>http://www.webpronews.com/experimental-google-search-options-2007-10</link>
		<comments>http://www.webpronews.com/experimental-google-search-options-2007-10#comments</comments>
		<pubDate>Wed, 24 Oct 2007 21:44:17 +0000</pubDate>
		<dc:creator>Sean Corfield</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[Options]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=41387</guid>
		<description><![CDATA[<p>Google is experimenting with some <a title="very cool options for searching" href="http://www.google.com/experimental/">very cool options for searching</a>. First off, they have show new view: keywords that display additional ways to view / filter search results:</p>
]]></description>
			<content:encoded><![CDATA[<p>Google is experimenting with some <a title="very cool options for searching" href="http://www.google.com/experimental/">very cool options for searching</a>. First off, they have show new view: keywords that display additional ways to view / filter search results:</p>
<p><span id="more-41387"></span></p>
<ul>
<li>view:timeline &#8211; displays a graph indicating the number of results by date so you can track trends, e.g., <a title="coldfusion view:timeline" href="http://www.google.com/views?q=coldfusion+view:timeline">coldfusion view:timeline</a></li>
<p></p>
<li>view:map &#8211; displays a map highlighting top search results, e.g., <a title="sean corfield view:map" href="http://www.google.com/views?q=sean+corfield+view:map">sean corfield view:map</a></li>
<p></p>
<li>view:info &#8211; displays additional ways to highlight parts of the results based on dates, measurements, locations and images, e.g., <a title="sean corfield view:info" href="http://www.google.com/views?q=sean+corfield+view:info">sean corfield view:info</a> (then select &quot;Locations&quot;)</li>
</ul>
<p>In addition, from the experimental page you can choose keyboard shortcuts (to navigate your search results) or left-hand / right-hand search menus (they&#8217;re slightly different).</p>
<p>You can choose to &quot;join&quot; one of the experiments which makes it your default Google results format (assuming you&#8217;re logged in). I picked the left-hand context menus which seem to be richer. </p>
<p><a href="http://corfield.org/blog/index.cfm/do/blog.entry/entry/Experimental_Google_Search_Options#postcomment" title="Comment on Google"> Comments</a></p>
<p>Tag: </p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/experimental-google-search-options-2007-10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Spins Up LiveCycle ES</title>
		<link>http://www.webpronews.com/adobe-spins-up-livecycle-es-2007-06</link>
		<comments>http://www.webpronews.com/adobe-spins-up-livecycle-es-2007-06#comments</comments>
		<pubDate>Mon, 04 Jun 2007 16:15:27 +0000</pubDate>
		<dc:creator>WebProNews Staff</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[LiveCycle ES]]></category>
		<category><![CDATA[Product]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=38150</guid>
		<description><![CDATA[<p>The financial and government sectors drove plenty of the work performed in preparing LiveCycle ES for its debut in the enterprise market.   ]]></description>
			<content:encoded><![CDATA[<p>The financial and government sectors drove plenty of the work performed in preparing LiveCycle ES for its debut in the enterprise market.   <span id="more-38150"></span> The ES stands for Enterprise Suite, and until today the <a title="ColdFusion" href="http://www.webpronews.com/topnews/2007/05/30/coldfusion-8-brands-with-adobe">ColdFusion product</a> was the only enterprise app available from Adobe. This release of <a href="http://www.adobe.com/products/livecycle/" title="Adobe LiveCycle">LiveCycle ES</a> will be significant for the company, as only a handful of firms will really compete with the product.</p>
<p>After talking with Adobe&#8217;s Brian Wick and Marc Eamon about LiveCycle ES, I&#8217;ve found it difficult to think of the product as just automation for processes, which is its essential function. I worked with EDI for a company over a decade ago, when the federal government was threatening its vendors to go paperless and switch to EDI or lose its business.</p>
<p>As anyone who has done business with the government knows, paper hasn&#8217;t gone anywhere in the past ten years. Had they been doing then what Adobe is doing now with LiveCycle ES, I think there would be a lot less paper in the federal RFP/RFQ processes now.</p>
<p>Adobe&#8217;s first task with LiveCycle ES involved taking what had been a multi-product line requiring multiple servers, and turning it into a single disc installation. From there, an enterprise can license the services it needs, provided on LiveCycle&#8217;s service-oriented architecture.</p>
<p>Then they had to make it more useful for the people who would interface with it the most: the users. Doing this required updates to the way developers build applications. Adobe built in features like its Form Guides for assembling interactive documents, and their LiveCycle Workbench is an Eclipse-based IDE, which customers demanded.</p>
<p>Once constructed, an application can make its output available electronically with persistent rights management in place. This security feature allows the output creator to restrict access to a document like a completed insurance form to the login of a valid policyholder.</p>
<p>That persistence extends beyond just login requirements. Developers can enable users to create time-expiring documents. The EDI situation I mentioned earlier could be one place to use it for RFPs; once the due date passes, the RFP expires and cannot be opened.</p>
<p>Policy creation is available to designate content for certain users and groups. Information on members can be pulled from a LDAP server, making it easier for administrators to control who can access what applications.</p>
<p>The essential idea behind LiveCycle ES should make enterprises using it much more likely to draw help-seekers to the online process, rather than picking up a phone to call for assistance. Paper-heavy sectors like finance and government can make themselves more efficient by giving people the ability to get what they want, when they need it.</p>
<p>Eamon called the barrier to this self-service concept &quot;the engagement gap.&quot; While paper is still required, people cannot help themselves effectively. Closing the gap means providing engagement services to one&#8217;s customers.</p>
<p>Adobe already has the front end of their engagement in front of potential application-using clients. Flash and the Adobe Reader are on millions of desktops, and they cross platforms. That&#8217;s certain to be part of Adobe&#8217;s enterprise pitch: customers already have the tools they need to use the apps you create.</p>
<p>Developers should be intrigued by the output possibilities for their LiveCycle ES applications. HTML exists as one option, of course, but they can also create output in Accessible HTML for speech-reading browsers, or Compact HTML for mobile devices.</p>
<p>Those options open what government or financial industry developers can promise their managers in terms of the audience an application can reach. Accessible HTML should be especially pertinent to government <a href="http://www.gfxrebels.com/">designers</a>, whose agencies have to be available to all citizens, not just those with good vision.</p>
<p>A lot exists for LiveCycle ES developers and their company or government managers to consider. I don&#8217;t think the paperless society has arrived, but any broadening of paperless efforts across government and financial creators has to be beneficial.</p>
<p><small></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/adobe-spins-up-livecycle-es-2007-06/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>ColdFusion 8 Brands With Adobe</title>
		<link>http://www.webpronews.com/coldfusion-8-brands-with-adobe-2007-05</link>
		<comments>http://www.webpronews.com/coldfusion-8-brands-with-adobe-2007-05#comments</comments>
		<pubDate>Wed, 30 May 2007 16:05:44 +0000</pubDate>
		<dc:creator>WebProNews Staff</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[brands]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[LiveCycle]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=38041</guid>
		<description><![CDATA[ColdFusion's latest version emerges for the first time under the Adobe brand name; it's changed a lot since its early dot-com days of doing database calls for HTML.
]]></description>
			<content:encoded><![CDATA[<p>ColdFusion&#8217;s latest version emerges for the first time under the Adobe brand name; it&#8217;s changed a lot since its early dot-com days of doing database calls for HTML.<br />
<span id="more-38041"></span><br />
The arrival of the public beta of <a href=http://labs.adobe.com/technologies/coldfusion8/ title="ColdFusion 8">Adobe ColdFusion 8</a> finds a substantially different product than what existed in the late 20th Century.</p>
<p>
Adobe senior product manager for ColdFusion, Tim Buntel, discussed with WebProNews some of the changes and growth associated with the newest version of the product. He&#8217;s been with the product for seven years, and he opened up by acknowledging the difference in the web development environment today.</p>
<p>
Since there are more choices today for web application development than there were at the end of the last century, Buntel indicated that ColdFusion&#8217;s approach would be to interoperate with other technologies. </p>
<p>
The main example of this is demonstrated through ColdFusion&#8217;s ability to tap some Microsoft technologies. Buntel said both .NET and Exchange Server are natively supported, thanks to integration performed on the ColdFusion platform.</p>
<p>
ColdFusion shares data with more technologies now, according to Buntel. RDBMS, Java, HTML, Perl, Ruby, and PHP all merited mentions here. </p>
<p>
Developers using Eclipse should find plenty of excuses to play with ColdFusion 8. An Eclipse plug-in delivers debugging capabilities for ColdFusion applications. Programmers can set breakpoints, watch variables, and step through code that doesn&#8217;t run in a browser to find bugs.</p>
<p>
Those applications can utilize Ajax or Adobe Flex on the client-side to access logic on the server. Developers will be able to combine and merge PDF documents and forms as desired, to turn static documents into interactive ones.</p>
<p>
Buntel noted how Adobe has received a number of requests for virtualization support for ColdFusion over the past couple of years. Once a trickle, those requests became more numerous as security concerns about web applications increased.</p>
<p>
Adobe also improved thread performance, always a concern when creating an application. Thanks to new server monitoring capabilities, developers will be able to see where bottlenecks are happening with slow pages, queries, and threads.</p>
<p>
Memory and database usage can be tracked to find potential problems. ColdFusion 8 can provide alerts and snapshots with its server monitoring to aid the diagnosis of issues too. Adobe also plans to expose an API for monitoring, so administrators can pull that information into whatever tool they prefer.</p>
<p>
Along with the ColdFusion 8 release, developers should start hearing more about Adobe&#8217;s LiveCycle Data Services 2.5 as well. Those Data Services allow for data synchronization and &#8220;pull.&#8221;</p>
<p>
I asked how the two technologies, Cold Fusion and Data Services, might reach the mobile market. Buntel said that ColdFusion can be used to build mobile-specific applications, while Data Services may get into mobile applications by being part of a Flash app, for example.</p>
<p>
Search optimization pros should appreciate the continued inclusion of the Verity search product in Cold Fusion. It&#8217;s embedded within the new release, and can be used to enhance the SEO tweaks developers perform.</p>
<p>
While the public beta of Cold Fusion 8 is available today, the commercial release will probably hit in the third quarter of this year.</p>
<p>
<small></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/coldfusion-8-brands-with-adobe-2007-05/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Yahoo&#8217;s Search SDK Updated</title>
		<link>http://www.webpronews.com/yahoos-search-sdk-updated-2007-03</link>
		<comments>http://www.webpronews.com/yahoos-search-sdk-updated-2007-03#comments</comments>
		<pubDate>Tue, 06 Mar 2007 01:26:02 +0000</pubDate>
		<dc:creator>Raymond Camden</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[Yahoo]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=35865</guid>
		<description><![CDATA[<p>So I've been ranting and raving about how we need to make this the year <em>everyone</em> knows about ColdFusion.</p>
<p>Well, I am <em>very</em> happy to say that Yahoo has just updated their <a href="http://developer.yahoo.com/search/">Search SDK</a>, and guess what language makes a <strong>brand new appearance??</strong>.</p>
<p>Yep - that's right. <strong>COLDFUSION!</strong> Sorry to &#34;yell&#34; but I'm just that happy about it. The SDK includes both a simple search example and my <a href="http://cfyahoo.riaforge.org/">ColdFusion Yahoo package</a>.</p>]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been ranting and raving about how we need to make this the year <em>everyone</em> knows about ColdFusion.</p>
<p>Well, I am <em>very</em> happy to say that Yahoo has just updated their <a href="http://developer.yahoo.com/search/">Search SDK</a>, and guess what language makes a <strong>brand new appearance??</strong>.</p>
<p>Yep &#8211; that&#8217;s right. <strong>COLDFUSION!</strong> Sorry to &quot;yell&quot; but I&#8217;m just that happy about it. The SDK includes both a simple search example and my <a href="http://cfyahoo.riaforge.org/">ColdFusion Yahoo package</a>.</p>
<p>And there is more coming soon&#8230;</p>
<p><a href="http://ray.camdenfamily.com/index.cfm/2007/3/5/Yahoos-Search-SDK-Updated-And-guess-what-new-language-is-included#comments">Comments</a></p>
<p><!-- AddThis Bookmark Button BEGIN --></p>
<p><a target="_blank" title="Bookmark using any bookmark<br />
manager!" return="" cation="no,status=no');&quot;" onclick="window.open('http://www.addthis.com/bookmark.php?pub=H5ZWTJ6T94YMQR<br />
KP&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(docu<br />
ment.title), 'addthis',<br />
'scrollbars=" href="http://www.addthis.com/bookmark.php"><img width="160" height="24" border="0" alt="AddThis social<br />
bookmark button" src="http://www.addthis.com/images/button2-bm.png" /></a></p>
<p><!-- AddThis<br />
Bookmark Button END --></p>
<p>Bookmark WebProNews: <a href="http://www.webpronews.com"><img border="0" src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/yahoos-search-sdk-updated-2007-03/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Tip for Flex/ColdFusion</title>
		<link>http://www.webpronews.com/debugging-tip-for-flexcoldfusion-2007-01</link>
		<comments>http://www.webpronews.com/debugging-tip-for-flexcoldfusion-2007-01#comments</comments>
		<pubDate>Mon, 29 Jan 2007 14:03:16 +0000</pubDate>
		<dc:creator>Raymond Camden</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Reddit]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34841</guid>
		<description><![CDATA[There are multiple methods of debugging applications, including the very cool <a href="http://www.fusion-reactor.com/fusiondebug/" class="bluelink">FusionDebug</a>, log files, <a href="http://kevinlangdon.com/serviceCapture/" class="bluelink">ServiceCapture</a>, and the debugging rolled into Flex Builder 2 itself.
]]></description>
			<content:encoded><![CDATA[<p>There are multiple methods of debugging applications, including the very cool <a href="http://www.fusion-reactor.com/fusiondebug/" class="bluelink">FusionDebug</a>, log files, <a href="http://kevinlangdon.com/serviceCapture/" class="bluelink">ServiceCapture</a>, and the debugging rolled into Flex Builder 2 itself.</p>
<p>Here is a quick tip for another method to use. It&#8217;s ugly &#8211; but effective. </p>
<p>Modify your onError to dump the errors and log to a file like so: </p>
<p><code>&lt;cffunction name="onError" returnType="void" output="false"&gt;<br />
&nbsp;&nbsp;   &lt;cfargument name="exception" required="true"&gt;<br />
&nbsp;&nbsp;   &lt;cfargument name="eventname" type="string" required="true"&gt;<br />
&nbsp;&nbsp;   &lt;cfset var temp = ""&gt;</p>
<p>&nbsp;&nbsp;   &lt;cflog file="my app" text="#arguments.exception.message#, #arguments.exception.detail#"&gt;<br />
&nbsp;&nbsp;   &lt;cfsavecontent variable="temp"&gt;<br />
&nbsp;&nbsp;   &lt;cfdump var="#arguments#"&gt;<br />
&nbsp;&nbsp;   &lt;/cfsavecontent&gt;<br />
&nbsp;&nbsp;   &lt;cffile action="write" file="c:kuler.html" output="#temp#"&gt;<br />
&nbsp;&nbsp;   &lt;cfdump var="#arguments#"&gt;&lt;cfabort&gt;<br />
&lt;/cffunction&gt;</code></p>
<p>I wrapped a dump of the arguments (which contain my exception) and simply save it to the C drive as an HTML file. I then have this file open in my browser. </p>
<p>As I debug, I can simply reload the tab in Firefox to see what the latest error was. </p>
<p>I find this especially useful when the exception message is a bit too vague. </p>
<p>With the dump I get the full trace of files where the error occurred. </p>
<p>Let me be absolutely clear: Do not use this code in production. It isn&#8217;t nice. It doesn&#8217;t play well with others. It runs with scissors. </p>
<p>You get the idea. But I thought I&#8217;d share. </p>
<p><a href="http://ray.camdenfamily.com/index.cfm/2007/1/29/Quick-and-dirty-debugging-tip-for-FlexColdFusion#comments" class="bluelink">Comments</a></p>
<p>Tag:   </p>
<p><a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.   location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img   src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img  src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '   '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a> </p>
<p> Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Raymond Camden, ray@camdenfamily.com<br />
<a href="http://ray.camdenfamily.com">http://ray.camdenfamily.com</a></p>
<p>Raymond Camden is Vice President of Technology for roundpeg, Inc. A long<br />
time ColdFusion user, Raymond has worked on numerous ColdFusion books<br />
and is the creator of many of the most popular ColdFusion community web<br />
sites. He is an Adobe Community Expert, user group manager, and the<br />
proud father of three little bundles of joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/debugging-tip-for-flexcoldfusion-2007-01/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Administration via ColdFusion</title>
		<link>http://www.webpronews.com/mysql-administration-via-coldfusion-2007-01</link>
		<comments>http://www.webpronews.com/mysql-administration-via-coldfusion-2007-01#comments</comments>
		<pubDate>Wed, 24 Jan 2007 16:59:04 +0000</pubDate>
		<dc:creator>Raymond Camden</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34717</guid>
		<description><![CDATA[A user asked me if it was possible to backup and restore a MySQL database from ColdFusion.
]]></description>
			<content:encoded><![CDATA[<p>A user asked me if it was possible to backup and restore a MySQL database from ColdFusion.</p>
<p>There are multiple ways of doing this, but the basic answer is that you can do this very easily. MySQL ships with a set of utilities that ColdFusion can run via CFEXECUTE to perform various tasks.<br />
So for example, to backup a database you can use the MySQL dump command: </p>
<p><code>mysqldump --user=USER --password=PASSWORD dbname > filename</code></p>
<p>From ColdFusion this would look look like so (username, passwords, and database names changed to protect the innocent): </p>
<p><code>&lt;cfexecute name="c:program filesmysqlmysql server 4.1binmysqldump" arguments="--user=xxx --password=yyy dharma" outputfile="#expandPath("./ao.sql")#" timeout="30"/&gt;</code></p>
<p>This creates a nice file that contains not only the SQL needed to create your database but all the data as well. You could then use a zip utility and move/mail/do whatever with the file. </p>
<p>Restoring is a bit trickier. You have to do different things based on if your database exists or not. If your database does exist, then the restore will overwrite the existing tables, but not remove tables that don&#8217;t exist in the backup file. If this doesn&#8217;t concern you, you can do it with this command: </p>
<p><code>mysql --user=USER --password=PASSWORD dbname < filename</code></p>
<p>Now I had a lot of trouble getting this to run from CFEXECUTE. I believe because of the <. So I used a bat file instead that looked like so: </p>
<p><code>"c:program filesmysqlmysql server 4.1binmysql.exe" --user=xxx --password=yyy somebackup < "c:apache2htdocstestingzoneao.sql"</code></p>
<p>I then ran the bat file from ColdFusion: </p>
<p><code>&lt;cfexecute name="#expandPath("./restore.bat")#" timeout="30" variable="result"/&gt;</code></p>
<p>Obviously you could make the bat file a bit more dynamic instead of hard coding everything. </p>
<p>For more information, check the MySQL 5 doc on backup and restoring databases. </p>
<p>Would folks be interested in a MySQL CFC wrapper? You know - in my spare time. </p>
<p><a href="http://ray.camdenfamily.com/index.cfm/2006/12/7/MySQL-administration-via-ColdFusion#comments" class="bluelink">Comments</a></p>
<p>Tag:   </p>
<p><a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.   location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img   src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img  src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '   '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a> </p>
<p> Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Raymond Camden, ray@camdenfamily.com<br />
<a href="http://ray.camdenfamily.com">http://ray.camdenfamily.com</a></p>
<p>Raymond Camden is Vice President of Technology for roundpeg, Inc. A long<br />
time ColdFusion user, Raymond has worked on numerous ColdFusion books<br />
and is the creator of many of the most popular ColdFusion community web<br />
sites. He is an Adobe Community Expert, user group manager, and the<br />
proud father of three little bundles of joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/mysql-administration-via-coldfusion-2007-01/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Warn a User About a Session Timeout with Javascript</title>
		<link>http://www.webpronews.com/warn-a-user-about-a-session-timeout-with-javascript-2007-01</link>
		<comments>http://www.webpronews.com/warn-a-user-about-a-session-timeout-with-javascript-2007-01#comments</comments>
		<pubDate>Tue, 23 Jan 2007 15:23:46 +0000</pubDate>
		<dc:creator>Raymond Camden</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Session]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34667</guid>
		<description><![CDATA[A coworker asked me this so I thought I'd whip up a quick example.
]]></description>
			<content:encoded><![CDATA[<p>A coworker asked me this so I thought I&#8217;d whip up a quick example.</p>
<p>Many bank sites like to use a JavaScript warning to let you know when your session is about to end. Personally these things bug the heck out of me, but in the interest of helping her out (and others), here is a way to do it in ColdFusion and JavaScript. (Explanation follows the code.) </p>
<p><code>&lt;!--- Minutes into MS ---&gt;<br />
&lt;cfset sessionTimeout = 2&gt;<br />
&lt;html&gt;</p>
<p>&lt;head&gt;<br />
&lt;title&gt;Timeout Example&lt;/title&gt;</p>
<p>&lt;script&gt;<br />
&lt;cfoutput&gt;<br />
var #toScript((sessionTimeout-1)*60*1000,"sTimeout")#<br />
&lt;/cfoutput&gt;<br />
setTimeout('sessionWarning()', sTimeout);</p>
<p>function sessionWarning() {<br />
&nbsp;&nbsp;   alert('Hey bonehead, your session is going to time out unless you do something!');<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>Let me go down line by line. First off &#8211; you can&#8217;t introspect an application to see what the session time out value is. (I&#8217;m sure you could with ServiceFactory methods, but that&#8217;s cheating.) So I&#8217;m using a variable to stand in for the number of minutes a session will last. </p>
<p><code>&lt;cfset sessionTimeout = 2&gt;</code></p>
<p>I would probably have set this in the application scope somewhere, but again, this is just a simple demo. I used 2 to make it a bit quicker to test. Now I need to get that value into JavaScript, but there are two things I need to change. First &#8211; I want to give the user a warning so she has time to do something. So, I subtract one from the number of minutes. You can obviously subtract more or less depending on how much of a warning you want to give. Secondly, the JavaScript code I&#8217;m going to use, setTimeout, expects time in milliseconds. So I take my number of minutes and multiply it by 60 and then 1000. </p>
<p><code>&lt;cfoutput&gt;<br />
var #toScript((sessionTimeout-1)*60*1000,"sTimeout")#<br />
&lt;/cfoutput&gt;</code></p>
<p>Why didn&#8217;t I just multiply by 60000? Because I&#8217;m dumb and tend to forget things. The 60*1000 helps me remember. What is the toScript function? It lets you convert a ColdFusion variable into a valid JavaScript variable. For more information, check the <a href="http://www.cfquickdocs.com/?getDoc=ToScript" class="bluelink">toScript documentation</a>. Honestly, it&#8217;s a bit overkill for what I&#8217;m doing, but I thought I&#8217;d remind folks of this cool little utility. The next line simply tells JavaScript to call my function in the proper number of seconds: </p>
<p><code>setTimeout('sessionWarning()', sTimeout);</code></p>
<p>Lastly, my &#8220;warning&#8221; function is a simple alert. You can use DHTML instead of an Alert or any other JavaScript obviously. But the alert is the simplest way to get your message across. </p>
<p><code>function sessionWarning() {<br />
&nbsp;&nbsp;   alert('Hey bonehead, your session is going to time out unless you do something!');<br />
}</code></p>
<p>There ya go. To use this on your site you could simply include it in your layout code. Of course, you want to ensure it <b>isn&#8217;t </b>loaded if the user isn&#8217;t logged in. </p>
<p><a href="http://ray.camdenfamily.com/index.cfm/2006/9/20/Using-JavaScript-to-warn-a-user-about-a-session-timeout#comments" class="bluelink">Comments</a></p>
<p>Tag:   </p>
<p><a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.   location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img   src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img  src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '   '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a> </p>
<p> Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Raymond Camden, ray@camdenfamily.com<br />
<a href="http://ray.camdenfamily.com">http://ray.camdenfamily.com</a></p>
<p>Raymond Camden is Vice President of Technology for roundpeg, Inc. A long<br />
time ColdFusion user, Raymond has worked on numerous ColdFusion books<br />
and is the creator of many of the most popular ColdFusion community web<br />
sites. He is an Adobe Community Expert, user group manager, and the<br />
proud father of three little bundles of joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/warn-a-user-about-a-session-timeout-with-javascript-2007-01/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flex/ColdFusion Mystery and a Very Simple Answer</title>
		<link>http://www.webpronews.com/flexcoldfusion-mystery-and-a-very-simple-answer-2007-01</link>
		<comments>http://www.webpronews.com/flexcoldfusion-mystery-and-a-very-simple-answer-2007-01#comments</comments>
		<pubDate>Mon, 22 Jan 2007 19:05:23 +0000</pubDate>
		<dc:creator>Raymond Camden</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34639</guid>
		<description><![CDATA[I was working on a Flex project when I hit a brick wall. I had a very simple form.
]]></description>
			<content:encoded><![CDATA[<p>I was working on a Flex project when I hit a brick wall. I had a very simple form.</p>
<p>Flex was using remoting to send the form information to ColdFusion. ColdFusion was doing <i>nothing</i> with the data. </p>
<p>It was just an empty method. However, every time I&#8217;d try to send the data I&#8217;d get an error. </p>
<p>Here is where things got weird. The first thing I tried was launching ServiceCapture so I could see the response from ColdFusion. </p>
<p>However &#8211; when I would send the form data, ServiceCapture would actually hang. I had to force it down. </p>
<p>So then I went to my ColdFusion logs. Nothing was reported in the error log but an empty string. At this point I&#8217;m really confused. </p>
<p>I go into my Application.cfc file&#8217;s onError and added this: </p>
<p><code>&lt;cfsavecontent variable="temp"&gt;<br />
&lt;cfdump var="#arguments#"&gt;<br />
&lt;/cfsavecontent&gt;<br />
&lt;cffile action="write" file="c:foo.html" output="#temp#"&gt;</code></p>
<p>Now I get somewhere. When I look at the file, I see no message, no detail, but I do see a type for the error: </p>
<p><code>java.lang.StackOverflowError </code></p>
<p>What the heck? (Ok, I didn&#8217;t say heck.) So now I start trying random crap. First I change the method names. Doesn&#8217;t help. Finally I change my Flex code to send nothing to ColdFusion. And it works. </p>
<p>Um. Ok. </p>
<p>I restored my code and noticed something&#8230;. </p>
<p><code>core.addAdminUser(username,password);</code></p>
<p>username and password were the <b>form elements</b>, not the <b>values</b> of the form elements. Somehow Flex thought this was ok. Can you really send a <i>component</i> over the wire? Flex could. And while it didn&#8217;t die, it was enough to freak out ServiceCapture and ColdFusion. </p>
<p>Changing my Flex to: </p>
<p><code>core.addAdminUser(username.text,password.text);</code></p>
<p>made everything kosher. Whew! </p>
<p><a href="http://ray.camdenfamily.com/index.cfm/2007/1/19/FlexColdFusion-Mystery-with-a-very-simple-answer#comments" class="bluelink">Comments</a></p>
<p>Tag:   </p>
<p>Add to <a href="http://del.icio.us/post"onclick="window.open('http://del.icio.us/post?v=4&#038;partner=wpn&#038;noui&#038;jump=close&#038;url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.t  itle),'delicious','toolbar=no,width=700,height=400'); return false;"   CLASS="printMailTop"><img src="http://images.ientrymail.com/webpronews/delicious-pic.png" border=0> Del.icio.us</a> | <a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.   location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img   src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img  src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '   '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a> </p>
<p> Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Raymond Camden, ray@camdenfamily.com<br />
<a href="http://ray.camdenfamily.com">http://ray.camdenfamily.com</a></p>
<p>Raymond Camden is Vice President of Technology for roundpeg, Inc. A long<br />
time ColdFusion user, Raymond has worked on numerous ColdFusion books<br />
and is the creator of many of the most popular ColdFusion community web<br />
sites. He is an Adobe Community Expert, user group manager, and the<br />
proud father of three little bundles of joy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/flexcoldfusion-mystery-and-a-very-simple-answer-2007-01/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Parsing XML As Query Object In Coldfusion</title>
		<link>http://www.webpronews.com/parsing-xml-as-query-object-in-coldfusion-2007-01</link>
		<comments>http://www.webpronews.com/parsing-xml-as-query-object-in-coldfusion-2007-01#comments</comments>
		<pubDate>Wed, 17 Jan 2007 15:23:32 +0000</pubDate>
		<dc:creator>Ben Cortese</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Phone]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34492</guid>
		<description><![CDATA[I work in the financial industry as a developer and not that the financial industry has any greater implementation of XML than any other, but web applications that utilize back office processing for loan applications, or new account opening processes, or retail internet banking applications all to some extent make calls to a host. Many times it's a DB2 database, and many times some other process that returns account information or validation information in xml format.
]]></description>
			<content:encoded><![CDATA[<p>I work in the financial industry as a developer and not that the financial industry has any greater implementation of XML than any other, but web applications that utilize back office processing for loan applications, or new account opening processes, or retail internet banking applications all to some extent make calls to a host. Many times it&#8217;s a DB2 database, and many times some other process that returns account information or validation information in xml format.</p>
<p>One of the fun things that I found working in ColdFusion is the many ways you can manipulate xml data. I&#8217;m certain this type of process isn&#8217;t exclusive to ColdFusion, but I wanted to put it out there anyway. Many developers have a little apprehension about working with new technologies at first, or trying something that hasn&#8217;t been already tried and true and of course documented heavily. And frankly it&#8217;s hard to find the extra time with a heavy work load and deadlines to meet to go off experimenting But I managed to put aside some time to look at parsing XML into an object that developers are all familiar with, the Query object. As a developer, writing SQL is common place, so I figured maybe looking at a hybrid approach to XML and SQL in ColdFusion, might prove to offer some benefit.   </p>
<p>So I&#8217;ll show an example of reading in a Phonebook xml document. It will look like this: You can copy this and save it off as phonebook.xml if you like.   </p>
<p><code>&lt;?xml version="1.0"?&gt;<br />
&lt;phonebook&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;John&lt;/firstName&gt;<br />
&lt;lastName&gt;Smith&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1212&lt;/phone&gt;<br />
&lt;email&gt;johnsmith@email.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;Jane&lt;/firstName&gt;<br />
&lt;lastName&gt;Smith&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1212&lt;/phone&gt;<br />
&lt;email&gt;janesmith@email.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="enemy"&gt;<br />
&lt;firstName&gt;Bob&lt;/firstName&gt;<br />
&lt;lastName&gt;Jones&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1213&lt;/phone&gt;<br />
&lt;email&gt;bob-jones@mailserver.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="co-worker"&gt;<br />
&lt;firstName&gt;Bill&lt;/firstName&gt;<br />
&lt;lastName&gt;Johnson&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1214&lt;/phone&gt;<br />
&lt;email&gt;bill.johnson@someserver.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;Jack&lt;/firstName&gt;<br />
&lt;lastName&gt;Robinson&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1215&lt;/phone&gt;<br />
&lt;email&gt;www.jackrobinson.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;/phonebook&gt; </code></p>
<p>Reading in the xml is short and sweet simply by using this little block of code. </p>
<p><code>&lt;cfhttp<br />
url="http://www.mywebsite.com/myxmldocs/phonebook.xml"<br />
method="GET" resolveurl="No" &gt;&lt;/cfhttp&gt;<br />
&lt;cfset mydoc = XmlParse(CFHTTP.FileContent)&gt; </code></p>
<p>Now you&#8217;ve got the xml object in a defined variable name called &#8220;mydoc&#8221;. </p>
<p>Next you set a variable to contain the child element nodes of the xml document and do the same to define the size of the document, which you will see in a bit as to what it&#8217;s used for.</p>
<p><code>&lt;cfset pb = http://mydoc.phonebook.XmlChildren&gt;<br />
&lt;cfset size = ArrayLen(pb)&gt; </code></p>
<p>Now create a query object with the phonebook data. As you can see we already know what the node properties and names are to create the myquery object containing the xml &#8220;column names&#8221;. I say column names to relate the data to a structure like a database. </p>
<p><code>&lt;cfset myquery = QueryNew("cat, firstName, lastName, phone, email")&gt; </code></p>
<p>Now that we have the &#8220;Columns&#8221; of the query object, we use the Size object to give us the parameters to define the Rows like this. </p>
<p><code>&lt;cfset temp = QueryAddRow(myquery, #size#)&gt; </code></p>
<p>Now you&#8217;ve established a Query Object &#8216;temp&#8217;. </p>
<p>Now comes the part where you fill the Query Object with the data from the XML document. Loop through every &#8220;row&#8221; in the object adding its value from the xml object like an array. </p>
<p><code>&lt;cfloop index="i" from = "1" to = #size#&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "cat",<br />
#mydoc.phonebook.contact[i].XMLAttributes['category']#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "firstName",<br />
#mydoc.phonebook.contact[i].firstName.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "lastName",<br />
#mydoc.phonebook.contact[i].lastName.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "phone",<br />
#mydoc.phonebook.contact[i].phone.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "email",<br />
#mydoc.phonebook.contact[i].email.XmlText#, #i#)&gt;<br />
&lt;/cfloop&gt; </code></p>
<p>Essentially what you&#8217;ve just done is take the xml and turn it into the same type of data structure you would have when you query a database.    </p>
<p>The rest should look familiar to many ColdFusion developers who use ColdFusion Components which is a great practice.    </p>
<p>Call the query function using the CFINVOKE. This particular function is if you were to sort the phonebook individuals by last name. </p>
<p><code>&lt;cfinvoke component="pbook_meths" method="sortLName"<br />
returnVariable="Result"&gt;<br />
&lt;cfinvokeargument name="q_obj" value="#myquery#"&gt;<br />
&lt;/cfinvoke&gt; </code></p>
<p>The output of the result from the function would be no different than that of a normal SQL query. </p>
<p><code>&lt;table border=1 width=500 align=center&gt;<br />
&lt;th&gt;category&lt;/th&gt;&lt;th&gt;fist name&lt;/th&gt;&lt;th&gt;last<br />
name&lt;/th&gt;&lt;th&gt;phone&lt;/th&gt;&lt;th&gt;email&lt;/th&gt;<br />
&lt;cfoutput query="Result"&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;#cat#&lt;/td&gt;&lt;td&gt;#firstName#&lt;/td&gt;<br />
&lt;td&gt;#lastName#&lt;/td&gt; &lt;td&gt;#phone#&lt;/td&gt;<br />
&lt;td&gt;#email#&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/cfoutput&gt;<br />
&lt;/table&gt; </code> </p>
<p>The function being called would be stored in its own file as components are in ColdFusion and would look like this. </p>
<p><code>&lt;cffunction name="sortLName" access="remote"<br />
returnType="query"&gt; </p>
<p>&lt;cfargument name="q_obj" required="Yes" &gt; </p>
<p>&lt;cftry&gt; </p>
<p>&lt;cfquery name="pbTest" dbType="query"&gt;<br />
SELECT *<br />
FROM arguments.q_obj<br />
order by lastName,cat<br />
&lt;/cfquery&gt; </p>
<p>&lt;cfcatch type="Any"&gt; </p>
<p>&lt;P&gt;&lt;cfoutput&gt;#cfcatch.message#&lt;/cfoutput&gt;&lt;/P&gt; </p>
<p>&lt;/cfcatch&gt; </p>
<p>&lt;/cftry&gt; </p>
<p>&lt;cfreturn pbTest&gt; </p>
<p>&lt;/cffunction&gt; </code> </p>
<p>Your component can contain numerous functions manipulating the xml query object just the same as you would a normal query from a database. You don&#8217;t have the power that a relational database offers of course, but if you&#8217;re comfortable writing SQL, you may find yourself hitting the ground running with working with xml in ColdFusion. </p>
<p>Thanks and Happy Coding.</p>
<p>Tag:   </p>
<p>Add to <a href="http://del.icio.us/post"onclick="window.open('http://del.icio.us/post?v=4&#038;partner=wpn&#038;noui&#038;jump=close&#038;url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.t  itle),'delicious','toolbar=no,width=700,height=400'); return false;"   CLASS="printMailTop"><img src="http://images.ientrymail.com/webpronews/delicious-pic.png" border=0> Del.icio.us</a> | <a href="javascript:void   window.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.   location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img   src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img  src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '   '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a> </p>
<p> Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Ben Cortese is a developer and business<br />
analyst for the financial industry and develops affiliate<br />
powered websites. http://www.inetsite.net Copyright 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/parsing-xml-as-query-object-in-coldfusion-2007-01/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ColdFusion / XML Query Style</title>
		<link>http://www.webpronews.com/coldfusion-xml-query-style-2007-01</link>
		<comments>http://www.webpronews.com/coldfusion-xml-query-style-2007-01#comments</comments>
		<pubDate>Tue, 09 Jan 2007 21:24:02 +0000</pubDate>
		<dc:creator>Ben Cortese</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Phone]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.webpronews.com/?p=34283</guid>
		<description><![CDATA[At one point or another, whether it's an enterprise level website, or one of your own, you're going to have the burning desire to see how you can take advantage of what XML can do for your applications.
]]></description>
			<content:encoded><![CDATA[<p>At one point or another, whether it&#8217;s an enterprise level website, or one of your own, you&#8217;re going to have the burning desire to see how you can take advantage of what XML can do for your applications.</p>
<p>I work in the financial industry as a developer and not that the financial industry has any greater implementation of XML than any other, but web applications that utilize back office processing for loan applications, or new account opening processes, or retail internet banking applications all to some extent make calls to a host. Many times it&#8217;s a DB2 database, and many times some other process that returns account information or validation information in xml format.</p>
<p>One of the fun things that I found working in ColdFusion is the many ways you can manipulate xml data. I&#8217;m certain this type of process isn&#8217;t exclusive to ColdFusion, but I wanted to put it out there anyway. Many developers have a little apprehension about working with new technologies at first, or trying something that hasn&#8217;t been already tried and true and of course documented heavily. And frankly it&#8217;s hard to find the extra time with a heavy work load and deadlines to meet to go off experimenting But I managed to put aside some time to look at parsing XML into an object that developers are all familiar with, the Query object. As a developer, writing SQL is common place, so I figured maybe looking at a hybrid approach to XML and SQL in ColdFusion, might prove to offer some benefit.</p>
<p>So I&#8217;ll show an example of reading in a Phonebook xml document. It will look like this: You can copy this and save it off as phonebook.xml if you like.</p>
<p><code>&lt;?xml version="1.0"?&gt;<br />
&lt;phonebook&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;John&lt;/firstName&gt;<br />
&lt;lastName&gt;Smith&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1212&lt;/phone&gt;<br />
&lt;email&gt;johnsmith@email.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;Jane&lt;/firstName&gt;<br />
&lt;lastName&gt;Smith&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1212&lt;/phone&gt;<br />
&lt;email&gt;janesmith@email.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="enemy"&gt;<br />
&lt;firstName&gt;Bob&lt;/firstName&gt;<br />
&lt;lastName&gt;Jones&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1213&lt;/phone&gt;<br />
&lt;email&gt;bob-jones@mailserver.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="co-worker"&gt;<br />
&lt;firstName&gt;Bill&lt;/firstName&gt;<br />
&lt;lastName&gt;Johnson&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1214&lt;/phone&gt;<br />
&lt;email&gt;bill.johnson@someserver.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;contact category="friend"&gt;<br />
&lt;firstName&gt;Jack&lt;/firstName&gt;<br />
&lt;lastName&gt;Robinson&lt;/lastName&gt;<br />
&lt;phone&gt;412-555-1215&lt;/phone&gt;<br />
&lt;email&gt;www.jackrobinson.com&lt;/email&gt;<br />
&lt;/contact&gt;<br />
&lt;/phonebook&gt;</code></p>
<p>Reading in the xml is short and sweet simply by using this little block of code.</p>
<p><code>&lt;cfhttp url="http://www.mywebsite.com/myxmldocs/phonebook.xml" method="GET" resolveurl="No" &gt;&lt;/cfhttp&gt;<br />
&lt;cfset mydoc = XmlParse(CFHTTP.FileContent)&gt;</code></p>
<p>Now you&#8217;ve got the xml object in a defined variable name called &#8220;mydoc&#8221;.</p>
<p>Next you set a variable to contain the child element nodes of the xml document and do the same to define the size of the document, which you will see in a bit as to what it&#8217;s used for.</p>
<p><code>&lt;cfset pb = mydoc.phonebook.XmlChildren&gt;<br />
&lt;cfset size = ArrayLen(pb)&gt;</code></p>
<p>Now create a query object with the phonebook data. As you can see we already know what the node properties and names are to create the myquery object containing the xml &#8220;column names&#8221;. I say column names to relate the data to a structure like a database.</p>
<p><code>&lt;cfset myquery = QueryNew("cat, firstName, lastName, phone, email")&gt;</code></p>
<p>Now that we have the &#8220;Columns&#8221; of the query object, we use the Size object to give us the parameters to define the Rows like this.</p>
<p><code>&lt;cfset temp = QueryAddRow(myquery, #size#)&gt;</code></p>
<p>Now you&#8217;ve established a Query Object &#8216;temp&#8217;.</p>
<p>Now comes the part where you fill the Query Object with the data from the XML document. Loop through every &#8220;row&#8221; in the object adding its value from the xml object like an array.</p>
<p><code>&lt;cfloop index="i" from = "1" to = #size#&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "cat", #mydoc.phonebook.contact[i].XMLAttributes['category']#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "firstName", #mydoc.phonebook.contact[i].firstName.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "lastName", #mydoc.phonebook.contact[i].lastName.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "phone", #mydoc.phonebook.contact[i].phone.XmlText#, #i#)&gt;<br />
&lt;cfset temp = QuerySetCell(myquery, "email", #mydoc.phonebook.contact[i].email.XmlText#, #i#)&gt;<br />
&lt;/cfloop&gt;</code></p>
<p>Essentially what you&#8217;ve just done is take the xml and turn it into the same type of data structure you would have when you query a database. </p>
<p>The rest should look familiar to many ColdFusion developers who use ColdFusion Components which is a great practice.</p>
<p>Call the query function using the CFINVOKE. This particular function is if you were to sort the phonebook individuals by last name. </p>
<p><code>&lt;cfinvoke component="pbook_meths" method="sortLName" returnVariable="Result"&gt;<br />
&lt;cfinvokeargument name="q_obj" value="#myquery#"&gt;<br />
&lt;/cfinvoke&gt;</code></p>
<p>The output of the result from the function would be no different than that of a normal SQL query.</p>
<p><code>&lt;table border=1 width=500 align=center&gt;<br />
&lt;th&gt;category&lt;/th&gt;&lt;th&gt;fist name&lt;/th&gt;&lt;th&gt;last name&lt;/th&gt;&lt;th&gt;phone&lt;/th&gt;&lt;th&gt;email&lt;/th&gt;<br />
&lt;cfoutput query="Result"&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;#cat#&lt;/td&gt;&lt;td&gt;#firstName#&lt;/td&gt; &lt;td&gt;#lastName#&lt;/td&gt; &lt;td&gt;#phone#&lt;/td&gt; &lt;td&gt;#email#&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/cfoutput&gt;<br />
&lt;/table&gt;</code></p>
<p>The function being called would be stored in its own file as components are in ColdFusion and would look like this.</p>
<p><code>&lt;cffunction name="sortLName" access="remote" returnType="query"&gt;<br />
&lt;cfargument name="q_obj" required="Yes" &gt;<br />
&lt;cftry&gt;<br />
&lt;cfquery name="pbTest" dbType="query"&gt; SELECT * FROM arguments.q_obj order by lastName,cat &lt;/cfquery&gt;<br />
&lt;cfcatch type="Any"&gt;</p>
<p>&lt;cfoutput&gt;#cfcatch.message#&lt;/cfoutput&gt;<br />
&lt;/cfcatch&gt;<br />
&lt;/cftry&gt; &lt;cfreturn pbTest&gt;<br />
&lt;/cffunction&gt;</code></p>
<p>Your component can contain numerous functions manipulating the xml query object just the same as you would a normal query from a database. You don&#8217;t have the power that a relational database offers of course, but if you&#8217;re comfortable writing SQL, you may find yourself hitting the ground running with working with xml in ColdFusion.</p>
<p>Thanks and Happy Coding.</p>
<p>Tag:     </p>
<p>Add to <a href="http://del.icio.us/post"onclick="window.open('http://del.icio.us/post?v=4&#038;partner=wpn&#038;noui&#038;jump=close&#038;url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=700,height=400'); return false;"   CLASS="printMailTop"><img   src="http://images.ientrymail.com/webpronews/delicious-pic.png" border=0> Del.icio.us</a> | <a href="javascript:voidwindow.open('http://digg.com/submit?phase=2&#038;url='+encodeURIComponent(window.location.href)+'&#038;ei=UTF-8','popup','width=520px,height=420px,status=0,location=0,resizable=1,scrollbars=1,left=100,top=50',0)"><img     src="http://images.ientrymail.com/webpronews/digg-pic.png" border=0> Digg</a> | <a   href="javascript:location.href='http://reddit.com/submit?url='+encodeURIComponent(location.href)+'&#038;title='+encodeURIComponent(document.title)"><img    src="http://images.ientrymail.com/webpronews/reddit.png" border=0>Reddit</a> | <a   href="javascript:location.href='http://www.furl.net/storeIt.jsp?u='+encodeURIComponent(document.location.href)+'&#038;t='+encodeURIComponent(document.title)+ '     '"><img src="http://images.ientrymail.com/webpronews/furl-pic.png" border=0> Furl</a>    </p>
<p>Bookmark WebProNews: <a href="http://www.webpronews.com"><img src="http://images.ientrymail.com/webpronews/wpn-readit.jpg" border=0></a></p>
<p>Ben Cortese is a developer and business<br />
analyst for the financial industry and develops affiliate<br />
powered websites. http://www.inetsite.net Copyright 2007.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webpronews.com/coldfusion-xml-query-style-2007-01/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 1/45 queries in 0.027 seconds using memcached
Object Caching 608/716 objects using memcached

Served from: webpronews.com @ 2012-02-12 21:39:34 -->
