<?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>Cranky Bit &#187; Conferences</title>
	<atom:link href="http://blog.crankybit.com/tags/it/conf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crankybit.com</link>
	<description>Take a byte out of tech!</description>
	<lastBuildDate>Wed, 09 Mar 2011 17:23:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Notes: Improved Flash Remoting and Adobe AIR Integration in ColdFusion 9</title>
		<link>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/</link>
		<comments>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 00:57:25 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MAX2009]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=334</guid>
		<description><![CDATA[These notes are taken at Adobe MAX 2009. You can use HTTPService, WebService, RemoteObject components in Flex to pull data in different ways. Now what about ColdFusion 9? ColdFusion&#8217;s Flash Remoting has been improved. So Flash applications that have ColdFusion 9 as a backend will interact much faster, and it can handle circular references. There [...]]]></description>
			<content:encoded><![CDATA[<p>These notes are taken at Adobe MAX 2009.</p>
<p>You can use HTTPService, WebService, RemoteObject components in Flex to pull data in different ways. Now what about ColdFusion 9?</p>
<p>ColdFusion&#8217;s Flash Remoting has been improved. So Flash applications that have ColdFusion 9 as a backend will interact much faster, and it can handle circular references.</p>
<p>There is now direct data translation between ActionScript and CF types, instead of previously having an intermediate Java layer that handled this. This involves changes in services-config.xml, but no code changes are required in your apps. Support for the old style remoting is still present for backward compatibility.</p>
<p>So how much faster is it? Drastically faster. Easily x9 faster, and that increases as the number of transactions occurs, according to the whitepaper Adobe has released about it.</p>
<p><strong>BlazeDS.</strong> ColdFusion 9 is now integrated with BlazeDS as the default installation.</p>
<p><strong>Configuration File.</strong> Services-Config.xml is now split into 4 files. There are a handful of ColdFusion-specific properties under the channel definition now. An &#8220;enable-small-messages&#8221; property is there and should be set to &#8220;false&#8221;. This is important for the new Flash Remoting in CF9, because BlazeDS&#8217;s default is &#8220;true&#8221;. </p>
<p>There is an AMFChannel component in Flex for the new Flash Remoting (Note: You can alternatively tell the AMFChannel component to have enableSmallMessages=&#8221;false&#8221;). Finally, the endpoint class is changed for the new CF9 one.</p>
<p><strong>Offline AIR apps with ColdFusion 9</strong></p>
<p>Now the fun stuff. ColdFusion 9 has an ORM for AIR! Build offline AIR apps without the SQL mess and conflict handling. There is a CF-AIR persistent framework for SQLite on the client side. CF keeps track of all updates to local database and synchronizes with the server, including conflict resolution.</p>
<p>By having ORM on the client- and server-side, these two are integrated through the CF-AIR persistent framework.</p>
<p>In the application code for the demo, there were customer.cfc and address.cfc persistent objects. Then a sync CFC is used for providing the fetch and sync functions for communication with the AIR client.</p>
<p>Step #1: Create the persistent CFCs.</p>
<p>Step #2: Create the sync CFC. He called it custmgr.cfc. The CFC has implements=&#8221;ISyncManager&#8221; as an attribute. Then you have fetch() and sync() methods that handle the transactions. Here you can provide your logic for handling certain scenarios, such as conflicts.</p>
<p>Step #3: On client side, create equivalent AS classes that map to the CFC via the [RemoteClass(alias="")] metadata tag.</p>
<p>Step #4: Use the CF-built AIR libraries provided to fetch data from server, with the SyncManager component. It&#8217;s very simple, practically just point it to the sync CFC and do a fetch() method. To work with the database, you then openSession() and can create new AS objects and call save() on the session to insert/update/etc.  Finally, using commit() will commit the results and invoke the sync() process.</p>
<p>On the client side, it can receive conflict notification and receive both versions of the data so that you can decide what to do with the conflict.</p>
<p>It is very exciting to have some help implementing synchronization without having to purchase LCDS. Using the CF9/AIR integration libraries will be very nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Notes: Advanced ORM in ColdFusion 9</title>
		<link>http://blog.crankybit.com/notes-max09-advanced-orm-cf9/</link>
		<comments>http://blog.crankybit.com/notes-max09-advanced-orm-cf9/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 23:30:55 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MAX2009]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=333</guid>
		<description><![CDATA[These are notes from Adobe MAX 2009 about advanced ORM in ColdFusion 9. Join Mapping. You can have a CFC whose primary table is &#8220;Person&#8221;, but it has properties that fetch values from a joined table, such as the &#8220;City&#8221; property from an &#8220;Address&#8221; table. Interesting. ORM Initialization. When application first starts, it looks to [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from Adobe MAX 2009 about advanced ORM in ColdFusion 9.</p>
<p><strong>Join Mapping.</strong> You can have a CFC whose primary table is &#8220;Person&#8221;, but it has properties that fetch values from a joined table, such as the &#8220;City&#8221; property from an &#8220;Address&#8221; table. Interesting.</p>
<p><strong>ORM Initialization.</strong> When application first starts, it looks to see if ORM is enabled. If so, it creates/loads the Hibernate configuration, the loads Hibernate mapping files, searches for persistent CFCs (you can point it at only a particular directory to speed things up), generate Hibernate mapping for persistent CFCs, then even generate the schema on the database if it doesn&#8217;t exist, and then finally build the Hibernate Session Factory. Once this is done, it will not occur again unless you tell it to, because this initial setup is an expensive operation. You can use ormReload() to force it.</p>
<p><strong>ORM Session.</strong> All ORM operations happen in the session. It provides some simple caching. The session tracks changes made to the objects. So it doesn&#8217;t actually execute SQL until a session is flushed, which happens when the request completes or when you force it with ormFlush().</p>
<p>When using CFTRANSACTION, the Hibernate session will be flushed and closed at the end of your CFTRANSACTION.</p>
<p><strong>Object States.</strong> When you create an object with EntityNew(), CreateObject(), etc, the object is transient and is not known by Hibernate yet. Once an object is saved or loaded, it is in a persistent state. The kicker is &#8220;detached&#8221; objects. If the Hibernate session ends, and object that you have will become &#8220;detached&#8221; since the session ended. So if you have lazy loading for your object, for instance, it will throw an error because Hibernate has nowhere to lazy load the object&#8217;s data. However, you can use EntityMerge() or redo an EntityLoad() to bring it back into a persistent state.</p>
<p><strong>Concurrency Control.</strong> You can use the &#8220;optimisticlock&#8221; attribute of a CFC to &#8220;All&#8221;, &#8220;Dirty&#8221;, &#8220;Version&#8221;, or &#8220;None&#8221; to control how record updates occur. &#8220;Version&#8221; is the default which uses a timestamp to check the version of the record vs. the object. &#8220;All&#8221; does a where statement of all record fields, and &#8220;Dirty&#8221; only handles the changed fields.</p>
<p><strong>Fetching strategy.</strong> How will you fetch relationships of tables? &#8220;Immediate&#8221;, &#8220;Lazy&#8221;, &#8220;Eager&#8221;, or &#8220;Batch&#8221; fetching. &#8220;Immediate&#8221; fetches everything immediately. The default &#8220;Lazy&#8221; fetches things on demand. &#8220;Eager&#8221; fetching fetches everything in a single SQL statement, good for frequently used one-to-one relationships. There was a bit of confusion in regard to &#8220;Batch&#8221; fetching.</p>
<p><strong>Caching.</strong> Session-level cache fetches data the first time and will not reload subsequent requests. EntityReload() will force a reload. Secondary-level cache can cache data across Hibernate sessions. It can be in-memory, disk, clustered. They have the default caching engine as EHCache.</p>
<p>How to use secondary cache? Enable it first. In application.cfc, use ormsettings.secondarycacheenabled=&#8221;true&#8221;. Then in your ORM CFC, the cacheuse=&#8221;" attribute defines the caching strategy (such as &#8220;read-only&#8221;, the most performant), and cachename=&#8221;" defines the name of this specific cache.</p>
<p>Secondary cache can also be used on relationships. And when using ormExecuteQuery() functions to use HQL to query the database, you can cache as well with cacheable=&#8221;true&#8221; as one of the options. This can be used in EntityLoad() too.</p>
<p>When cleaning up caches, there are ormEvictXXX() functions to remove entities, collections, and queries.</p>
<p><strong>Event Handling.</strong> Hibernate lets you set ormsettings.eventhandling=&#8221;true&#8221; to have many CFC level events, like preLoad(), postLoad(), preInsert(), postInsert(), preLoad(), postLoad(), etc. This can be used for logging or other nifty features. Wow! That&#8217;s awesome. Nice hooks.</p>
<p><strong>Interesting user questions.</strong> One gentleman asked about using an XML file as a datasource through Hibernate. That would be interesting to try/use.</p>
<p>This session could have been 90 minutes. There are a lot of advanced things that can be done with the ColdFusion integration with Hibernate from the ColdFusion API.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-advanced-orm-cf9/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notes: Managing, Monitoring, and Upgrading Your ColdFusion Servers</title>
		<link>http://blog.crankybit.com/notes-max09-managing-monitoring-upgrading-cf-servers/</link>
		<comments>http://blog.crankybit.com/notes-max09-managing-monitoring-upgrading-cf-servers/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 22:13:23 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MAX2009]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=332</guid>
		<description><![CDATA[These are notes from Adobe MAX 2009. This is what is new in ColdFusion Administrator for ColdFusion 9. Mail. You can sign mail with a keystore. You can view undeliverable email by clicking a button instead of browsing to the directory on the server. Document. You can configure ColdFusion to point to an OpenOffice installation [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from Adobe MAX 2009. This is what is new in ColdFusion Administrator for ColdFusion 9.</p>
<p><strong>Mail.</strong> You can sign mail with a keystore. You can view undeliverable email by clicking a button instead of browsing to the directory on the server.</p>
<p><strong>Document.</strong> You can configure ColdFusion to point to an OpenOffice installation on the server. This is necessary for a lot of the document integration features in ColdFusion.</p>
<p><strong>Data Collections.</strong> You can now have Verity <em>or</em> Solr collections. You can configure Solr in the Administrator. So ColdFusion 9 includes both Verity and Solr.</p>
<p><strong>Security.</strong> Since there are ColdFusion services (CFaaS) now, you can configure which IP addresses may use your server for these services.</p>
<p><strong>Server Monitor.</strong> The server monitor allows you to see how the server is using memory, which templates are running slow, the database pooling, how are template and database queries running, etc. </p>
<p><strong>Server Manager.</strong> A basic AIR app that provides a way to perform administrative functions on ColdFusion server(s). It provides a nice way to manage multiple servers at once. At the CF Unconference, this became a topic of light debate on Wednesday at lunch, because there are typical 1.0 weaknesses in the interface of the server manager that make it a little bit of a pain to use. But it is a great start, and hopefully the next iteration will be a little more fine-tuned.</p>
<p><strong>Migrating to CF9.</strong> Beware using these keywords: interface, pageencoding, finally, import, local. These are new CF9 keywords that will cause a conflict if your code was using them. BlazeDS now ships out of the box with CF9, which is great. LCDS Express Edition is no longer supported. It is recommended to upgrade from Verity to Solr. To do this, you&#8217;ll need to add engine=&#8221;solr&#8221; in your CFCOLLECTION tags. What&#8217;s more, the CFSEARCH tag will need some slight syntax changes when migrating to Solr! Ugh.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-managing-monitoring-upgrading-cf-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes: Migrating from Flex 3 to Flex 4</title>
		<link>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/</link>
		<comments>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 18:57:16 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MAX2009]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=331</guid>
		<description><![CDATA[These are notes from Adobe MAX 2009. This session will help us see what problems we may encounter moving to Flex 4, as well as what new features we can use. Packages. The old mx packages are still there. But now everything new is in the spark packages. Why two different packages? At first, they [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from Adobe MAX 2009. This session will help us see what problems we may encounter moving to Flex 4, as well as what new features we can use.</p>
<p><strong>Packages.</strong> The old mx packages are still there. But now everything new is in the spark packages. Why two different packages? At first, they had them all in the same package, but the component had a prefix for the new version. It wasn&#8217;t received well. So instead, Adobe just put the new components in new namespaces.</p>
<p>The MX namespace is also called &#8220;Halo&#8221;. Don&#8217;t consider it a &#8220;legacy&#8221; namespace. These are still fully supported. Spark is all of the new stuff. The general MXML has a new 2009 namespace, but the legacy namespace is still supported.</p>
<p><strong>Graphics</strong></p>
<p>You can add graphic primitives enabling you to draw lines, ellipses, and curves, directly within the MXML. With the new FXG file format, you can import a graphic in as a vector graphic that appears as code. Cool. Using a static FXG image is great for icons or other static simple images, because its rendering is faster than an MXML graphic container.</p>
<p><strong>Flex States</strong></p>
<p>Instead of using AddChild and RemoveChild for changing states, you have includeIn=&#8221;" and excludeIn=&#8221;" attributes that go directly on components. What&#8217;s more, you can set various attributes of a component for the different states by using a dot notation. For instance, title.mystate=&#8221;Title&#8221;. This seems like a pretty drastic change.</p>
<p>With states, you have to use the OLD way with the 2006 namespace, and you have to use the NEW way with the 2009 namespace.</p>
<p><strong>Skinning</strong></p>
<p>Components all have separate skin files. This will allow you to create a custom skin for any component easily.</p>
<p><strong>Common migration issues</strong></p>
<p>Type selectors need namespaces now in your Flex CSS. For instance, if you&#8217;re styling a button, Flex doesn&#8217;t know if it is a Spark button or a Halo button. So you need to define the namespace in your stylesheet and update your selectors accordingly.</p>
<p>You must compile against Flash Player 10. This won&#8217;t be an issue if you use Flash Builder 4 with Flex 4.</p>
<p>Application.application should now be renamed to FlexGlobals.topLevelApplication. Just a direct rename.</p>
<p>RSLs are on by default.</p>
<p>The &#8220;Declarations&#8221; tag is a problem child. In Flex 4, anything that is not a display object or default property must be within the fx:Declarations tag. Even tags like RadioButtonGroup. Formatters, Effects, RPC stuff, Validators, etc. need to go in the Declarations.</p>
<p>&#8220;If Looks Could Kill.&#8221; The default theme is now Spark, which looks different than the old Halo theme. You can switch back to the Halo theme. To do so, turn on &#8220;Use Flex 3 compatibility mode&#8221; in the project properties, or go into the &#8220;Flex Theme&#8221; panel and change the theme (this is the preferred way).</p>
<p>If moving to Flex 4, try to use as many Spark components as you can. They <em>should</em> play nicely with MX components. You can intermix them together. Caveats: (1) The graphic primitives cannot go in an MX component, just wrap them with a group; (2) you cannot put MX components in Spark containers; (3) MX effects do not work on Spark graphic primitives; (4) MX navigators (ViewStack, Accordion, etc) should use NavigatorContent component.</p>
<p>Other things to watch out for:</p>
<ul>
<li>Spark components don&#8217;t support the Halo theme.</li>
<li>Cannot create spark component based itemRenderers for MX List based components</li>
<li>APIs between MX and Spark components are different (e.g. addChild vs. addElement)!</li>
<li>When using MX and Spark components together, you may see a text difference since they are themed differently. There is a TLFText theme that can help with this.</li>
</ul>
<p>So, migrating an app from Flex 3 to Flex 4 is a bit of a slippery slope. And even just beginning to use Flex 4 with current Flex 3 knowledge will require a bit of a slowdown as you undo some of those brain synapses to do things the new Flex 4 way. But these changes going forward are good for the Flex framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Notes: What&#8217;s New in ColdFusion 9</title>
		<link>http://blog.crankybit.com/notes-max09-whats-new-in-coldfusion-9/</link>
		<comments>http://blog.crankybit.com/notes-max09-whats-new-in-coldfusion-9/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 17:36:30 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MAX2009]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=330</guid>
		<description><![CDATA[These are notes from Adobe MAX 2009. The talk was given by Adam Lehman. First, ColdFusion 9 also introduces the new ColdFusion Builder product, an Eclipse-based IDE &#8220;to rule them all&#8221;. Because it is based on Eclipse, you can also combine other products, like Flash Builder, so that one IDE gets the job done for [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from Adobe MAX 2009. The talk was given by Adam Lehman.</p>
<p>First, ColdFusion 9 also introduces the new <strong>ColdFusion Builder</strong> product, an Eclipse-based IDE &#8220;to rule them all&#8221;. Because it is based on Eclipse, you can also combine other products, like Flash Builder, so that one IDE gets the job done for everything, whether it is HTML, CFML, JS, Flex, ActionScript, CSS, etc.</p>
<p>ColdFusion Builder also supports some interesting server integration features. You can access ColdFusion Administrator and other functionality right from ColdFusion Builder; you can see and browse all of the databases that ColdFusion has datasources for. With such functionality, you can do cool stuff like auto-generate ORM-based CFCs by pointing it to an existing database table! Now, it doesn&#8217;t generate <em>just</em> the bean CFC. It generates the entire service layer: DAO and Gateway beans as well!! Now, this obviously is just a starter step. It&#8217;s expected that you&#8217;d tweak it from that point. With the Flash Builder integration, you can take this to the next step by also generating ActionScript objects to help with Flex integration as well.</p>
<p><strong>CFML Enhancements</strong></p>
<p>Well, in CF7, they introduced Application.cfc that supported hooks for application events. But now in CF9, there is a Server.cfc with an onServerStart() method for handling that event.</p>
<p>Various other holes have been filled. You can now have nested CFTRANSACTION tags. Error catching now supports &#8220;finally&#8221;. And looping now supports CFCONTINUE.</p>
<p>Variable level enhancements: You can now pass implicit structures/arrays to tags and functions. Before you had to assign it to a var and then pass it. There is assignment chaining (a=b=c). Direct access to elements of returned arrays (i.e. myFunction()[x] couldn&#8217;t be done previously). And, finally, ternary operators! For instance, you can do something like:  a = (b&lt;c)?b:c</p>
<p>CFSCRIPT enhancements. Starting in CF9, you can now write 100% script-based code, including classes/components.</p>
<p>CFC enhancements. There is now an explicit LOCAL scope. Instead of doing var myvar=1, you can do LOCAL.myvar=1.  What&#8217;s more, you can declare a variable with <em>var</em> anywhere in the code, not just at the top. CFCs also support implicit getters/setters by using the CFPROPERTY tag. These are worth using if there is no special handling going on, because they&#8217;re 7x faster than your own getters/setters.</p>
<p>Here&#8217;s an awesome feature. You no longer have to use CreateObject() to create a CFC. You can use the IMPORT keyword to point to a directory of CFCs and have them be first-class citizens in your code. And you can use the NEW keyword to create CFCs, like user = new User(). Looking more Java-like all the time.</p>
<p><strong>How to convince your boss to upgrade</strong> </p>
<p>First, with CFIMAP, you can now access email with IMAP support, such as GMail.</p>
<p>There are many PDF support enhancements. Create PDF packages, add/remove headers and footers, optimize PDFs (down-sample images, for instance), extract text/images, high-quality thumbnails, convert Word documents to PDF.</p>
<p>There are presentation options. The CFPRESENTATION tag will generate PPT files from CFML/HTML content. And you can go the other way: Convert PPT <em>to</em> HTML or Flash. Supports Microsoft PowerPoint &#8217;97 to &#8217;08 and Open Office Presentations.</p>
<p>Spreadsheet support. The CFSPREADSHEET helps you create, read, and merge native Excel spreadsheets. This isn&#8217;t just a CSV file. This is a real Excel spreadsheet with formulas and formatting support.</p>
<p>SharePoint integration. Native access to SharePoint data and services (Sites, templates, sub-sites, web parts, and workspaces). You can get lists including data, views, and alerts and querying against lists. Users, permissions, site groups, cross-site groups, security groups, and distribution groups. Build web parts with CFML. Integrate with SharePoint Single sign-on. You may wonder, &#8220;Why is this necessary since SharePoint has web services and exposes information as XML?&#8221; Because it&#8217;s painful. ColdFusion makes it significantly easier and faster.</p>
<p>ColdFusion Server Manager. A Flex-based AIR application that helps you manage multiple ColdFusion servers. And it receives system notifications and alerts. Helps apply settings for multiple servers.</p>
<p><strong>The next generation of applications</strong></p>
<p>Coldfusion 9 ORM functionality. Powered by the Java Hibernate framework, so it is industry standard. Various ormXXX() and entityXXX() functions provide this functionality for you. With this feature, no more SQL is necessary, so apps can be developed faster (and potentially with fewer errors). CFCs will just be automagically saved. But it&#8217;s not <em>just</em> a matter of saving time on development; it also makes it so that your app is no longer database-dependent. It can point to any database server and it should just work.</p>
<p>Enhanced caching. ColdFusion is already pretty optimized for speed (esp. between CF7 to CF8). So to get more speed, developers need to use these new caching features. Using cacheGet(), cachePut(), and cacheGetMetaData(), you can save/retrieve objects from a built-in cache. Page fragment caching allows you to have a combination of static and dynamic content on a page. This provides a HUGE performance boost, depending on what you&#8217;re doing. For instance, you only want to generate a menu dynamically the first time, but then another area of the page is dynamic every time.</p>
<p>Performance gains. Okay, Adam lied. ColdFusion 9 is actually 40% faster than ColdFusion 8, with no changes to code, just upgrading ColdFusion. CFC creation is 8x faster, method invocation is 3x faster. And UUID creation is 100x faster. These are some huge bottlenecks that have been blown away. There is a performance brief that Adobe will be releasing on ColdFusion 9 in the near future.</p>
<p>Search engine. ColdFusion 9 now includes Apache Solr. Verity is still included, but so is Solr, which is actually even faster than Verity. So you may choose to upgrade to Solr! They even provide a Verity-to-Solr migration utility.</p>
<p>ColdFusion Server API. You can have direct access to ColdFusion services for CFCHART, CFDOCUMENT, CFPDF, CFIMAGE, and more. This makes it even easier to access ColdFusion mail/pdf/images services directly within Flex without having to custom code some ColdFusion code.</p>
<p>What&#8217;s more, Flash Remoting is 9x faster. It may arguably be the fastest flash remoting server-side technology around.</p>
<p>There are various JavaScript/Ajax tags, like CFMAP for Google Maps, CFMESSAGEBOX, CFSLIDER, and more. Ajax functionality in CF is powered by ExtJS 3.0 (which is nice, because ExtJS isn&#8217;t free anymore, so getting CF9 gets you a copy of ExtJS basically), and JQuery is also supported.</p>
<p>This presentation was very rapid fire, which is testimony to how feature-rich of an upgrade ColdFusion 9 is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-whats-new-in-coldfusion-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Notes: What&#8217;s Coming in AIR 2</title>
		<link>http://blog.crankybit.com/notes-max09-whats-coming-in-air-2/</link>
		<comments>http://blog.crankybit.com/notes-max09-whats-coming-in-air-2/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 00:32:09 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MAX2009]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=329</guid>
		<description><![CDATA[These are notes taken at MAX 2009. This is obviously subject to change before AIR 2 is launched. Multi-touch gestures. This is especially useful for Flash&#8217;s new ability to compile down to iPhone, but it will even work on tablets or laptops that support multi-touch, such as the track pad on MacBooks. Opening Files. There [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes taken at MAX 2009. This is obviously subject to change before AIR 2 is launched.</p>
<p><strong>Multi-touch gestures.</strong> This is especially useful for Flash&#8217;s new ability to compile down to iPhone, but it will even work on tablets or laptops that support multi-touch, such as the track pad on MacBooks.</p>
<p><strong>Opening Files.</strong> There is now a File.openWithDefaultApplication() method which does just what it says. So you can open data document of any type in its native app from your AIR app, i.e. open a Word document in Word from your AIR app. Executables are blacklisted, such as *.exe, *.bat, or other executables.</p>
<p><strong>File &#8220;downloaded&#8221;.</strong> You can use myFile.downloaded=true to set the bit on a file that will notify the user with a message like, &#8220;This file has been downloaded from the Internet. Are you sure you want to open it?&#8221; the first time it opens.</p>
<p><strong>Volume Detection.</strong> Listen for mounting and unmounting of volumes. Query system for volume info. So this gives you the ability to work with external volumes including optical media or attached cameras.</p>
<p><strong>Native processes.</strong> You can start native processes outside of AIR, or even reference it and launch it. This includes passing in arguments and utilizing stdin, stdout, stderr! Now, you can&#8217;t use this ability from an app that has been installed straight from an AIR file. You have to have the app in a native installer. This way, someone on a Mac won&#8217;t try to run an app that wants to run a Windows executable, or something similar. In the demo, the Mac screenshot process was invoked, and in another demo, Spotlight functionality was invoked and its output was incorporated into the app!</p>
<p><strong>File promises.</strong> Ability to tell the OS about files you don&#8217;t have yet. Gives you the ability to drag and drop files in cases when they are on the network or Internet.</p>
<p><strong>Listening on a socket.</strong> Ability for inter-application communication. Better protocol support (such as FTP). Networking utilities. You just use ServerSocket.bind() and ServerSocket.listen() methods in conjunction with an event listener to act on activity. Demonstrated it with an HTTP proxy app called HTTPeek (on Google Code). Very fast. Handles the socket connection well.</p>
<p><strong>Advanced Networking.</strong> Get network information. Support for IPv6. UDP support. A DNS resolver. More coming.</p>
<p><strong>Audio Encoding.</strong> Surprisingly, this wasn&#8217;t supported before. Now you can encode data directly from the microphone.</p>
<p><strong>Global Error Handling.</strong> You can now catch all uncaught errors and error events in your app. This is useful because on a client that does not have the debugger version of Flash, the app will just stop working. With this global error handling feature, you can log the errors to a file or over the network, or do other things.</p>
<p><strong>Accessibility.</strong> Functionality from Flash Player 10 will now be supported in AIR. It has 28 accessible Flex components, supporting MSAA (Microsoft Active Accessibility) in JAWS or Microsoft Narrator, for example.</p>
<p><strong>JavaScript Profiling.</strong> Can access profiling information via Aptana.</p>
<p><strong>Optimization.</strong> Lower memory consumption, lower CPU utilization especially when the app is idle.</p>
<p><strong>Misc.</strong> Improved printing. SQLite supports nested transactions. Exit even on shutdown (can now see when the event is not cancelable). Various WebKit enhancements.</p>
<p>Flex 3 will work for AIR 2, but Flex 4 with Flash Builder 4 will be a cleaner, more set up approach for developing AIR 2. You&#8217;ll have to overlay AIR 2 SDK on your Flex Builder 3 installation if you want to develop for AIR 2 in Flex 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-whats-coming-in-air-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Radio Silence</title>
		<link>http://blog.crankybit.com/radio-silence-wwdc-2008/</link>
		<comments>http://blog.crankybit.com/radio-silence-wwdc-2008/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 14:03:09 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[IT Industry]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Macintosh]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=302</guid>
		<description><![CDATA[Like I have done in the past, I am declaring radio silence today. I will not be check my feeds, look at any Apple news sites, or check my personal email until I can view Apple&#8217;s video stream of the WWDC keynote.  You can view the MacRumors WWDC 2008 Spoiler Free news page if you [...]]]></description>
			<content:encoded><![CDATA[<p>Like I have <a href="http://blog.crankybit.com/radio-silence/">done in the past</a>, I am declaring radio silence today. I will not be check my feeds, look at any Apple news sites, or check my personal email until I can view Apple&#8217;s video stream of the <a href="http://developer.apple.com/wwdc/" target="_blank">WWDC</a> keynote. </p>
<p>You can view the <a href="http://www.macrumors.com/2008/06/02/wwdc-2008-spoiler-free-keynote-stream/" target="_blank">MacRumors WWDC 2008 Spoiler Free news page</a> if you want to do the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/radio-silence-wwdc-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML 101</title>
		<link>http://blog.crankybit.com/xml-101/</link>
		<comments>http://blog.crankybit.com/xml-101/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 15:30:52 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/xml-101/</guid>
		<description><![CDATA[The following are notes from the XML 101 class at Adobe MAX 2007. I&#8217;m skipping over the extremely basic XML principles and covering the more interesting stuff. When use XML nodes over attributes? Attributes are good for set, simple values. If you have complex values, multiples of a particular entry, or you want more extensibility, [...]]]></description>
			<content:encoded><![CDATA[<p>The following are notes from the XML 101 class at Adobe MAX 2007. I&#8217;m skipping over the extremely basic XML principles and covering the more interesting stuff.</p>
<p>When use XML nodes over attributes? Attributes are good for set, simple values. If you have complex values, multiples of a particular entry, or you want more extensibility, use nodes for XML.</p>
<p>The presenter demonstrated using DTDs over XML Schemas. The DTDs use a very specific grammar that is not even XML-ish. It&#8217;s kind of yesterday&#8217;s XML descriptor. Nowadays, better to use XML Schemas, which are actually XML defining XML. Both are ugly in my opinion, and XML Schemas are more verbose (as XML usually is), but you might as well go with the latest, most accepted convention, which is the XML Schema approach.</p>
<p>By using DTDs and XML Schemas, apps can be cognizant of the structure of your XML language. Even from a developer&#8217;s viewpoint, this can be useful when editing XML within an IDE.</p>
<p>The real fun part is formatting the XML with XSL (eXtensible Stylesheet Language). Supports loops, conditional logic, and other processing. Think of it as CSS on steroids, for XML. With XSL, you can transform XML to HTML, or PDF, or other fun stuff.</p>
<p>XPath is the heart of XSL processing. Allows you to traverse the XML document and find exactly what you&#8217;re looking for, whether it&#8217;s a particular node or looping over a group of items (xsl:for-each).</p>
<p>You CAN send the XML and XSL to the client and have the transformation be done client-side. All modern browsers include the XML/XSL engine. But generally it is wiser to do the transformation on the server side.</p>
<p>In my opinion, this approach lowers the value of XSL, because I can just as easily write some CF that will act on the XML. Yeah, I can write numerous XSLs for different presentations (text-only, XHTML, PDF, etc), but I&#8217;d have to do the effort of writing different XSL docs for that, when I could just as easily write different CF processors that accomplish the same thing. Unless you are working with a huge number of documents of varying types, XSL may not provide a large enough of an advantage for a language like CF that so easily manipulates XML.</p>
<p>The final step is grabbing XML with Ajax (such as Spry) that will populate document spaces (tables, divs, etc) with the XML data very easily as well. Again, this approach is similar to the CF approach, but with a more JavaScript-heavy slant.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/xml-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leveraging ColdFusion With AIR</title>
		<link>http://blog.crankybit.com/leveraging-coldfusion-with-air/</link>
		<comments>http://blog.crankybit.com/leveraging-coldfusion-with-air/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 21:48:00 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/leveraging-coldfusion-with-air/</guid>
		<description><![CDATA[AIR does not have a CFML engine. ColdFusion cannot be packaged within AIR apps. Traditionally, we use CF to generate the UI. However, in AIR, typically the UI is pre-designed and packaged. How does ColdFusion fit in, then? Use ColdFusion apps directly, use ColdFusion as the data provider, or use ColdFusion as the data provider [...]]]></description>
			<content:encoded><![CDATA[<p>AIR does not have a CFML engine. ColdFusion cannot be packaged within AIR apps. Traditionally, we use CF to generate the UI. However, in AIR, typically the UI is pre-designed and packaged. How does ColdFusion fit in, then?</p>
<p>Use ColdFusion apps directly, use ColdFusion as the data provider, or use ColdFusion as the data provider <em>and </em>as a UI provider.</p>
<p>To use a <strong>CF web app directly</strong>, just wrap it in a frameset. This is so kludgy, I can hardly stand it. But it will work to put your web app in a desktop app at some basic level. I suppose it could be handy since it hides the URL, it can make a more kiosk-ish look. Could also be useful if <em>part</em> of your app is a normal app, but part of it should mimic the web app exactly and you don&#8217;t want to rewrite anything.</p>
<p>Better to use <strong>CF as a data provider</strong>.  ColdFusion is best at connecting with other systems, connecting to remote DBs, etc. Then communicate with web services, XML, flash remoting, JSON.  There is nothing new here, at this point, you just build typical connectivity that AJAX or Flash would use.</p>
<p>Flash remoting would probably be the best when using Flex. Provides a handy proxy-like access to your CFC.  Web services can also be done very easily with Flex.</p>
<p>Now, how about HTML/JavaScript (AJAX) in AIR? CFAjaxProxy, XMLHttpRequest, or plain HTTP (CF returns the data in XML, JSON, or text).</p>
<p><strong>CFAjaxProxy. </strong>Makes a CFC available inside AIR app. Creates a JS proxy for a CF component. So on the CF side, you use cfajaxproxy, point it to a CFC, and instantiate the CFC in JS. Now, some initialization code is required. It is generated by the cfajaxproxy tag. So just copy the literal HTML/JavaScript generated by cfajaxproxy, and drop that into your HTML for AIR (just change the URL to the CFC to be the absolute URL; cfajaxproxy will write it as a relative URL).</p>
<p>It wouldn&#8217;t hurt to just write some basic AJAX code on the web, using cfajaxproxy, and then copy that to your AIR HTML.</p>
<p>Now what about <strong>taking your apps offline</strong>? Well, you&#8217;ll need to identify what is going to work offline, and store offline data (either to the filesystem or to a local database). Decide how the app will go offline: Modal (distinct offline/online mode, user driven, easiest to implement), or modeless (seamless offline/online mode, most of data is stored locally, better user experience but more work for the developer). Then, synchronization strategy: Manual sync, background client-driven sync, or server-driven sync.</p>
<p>Synchronization and online/offline management can be improved. They will describe more at the sneak peak session. Code samples will be at his website, <a href="http://coldfused.blogspot.com" target="_blank">http://coldfused.blogspot.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/leveraging-coldfusion-with-air/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Working With Persistent Data in AIR</title>
		<link>http://blog.crankybit.com/working-with-persistent-data-in-air/</link>
		<comments>http://blog.crankybit.com/working-with-persistent-data-in-air/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 20:43:55 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/working-with-persistent-data-in-air/</guid>
		<description><![CDATA[Why care about caching data on the client? There are 3 types of apps out there: Thin Client (HTML/JavaScript to web browser), Thick Client (Word, Excel, etc), Smart Client (RIA, a hybrid between the thick and the thin). Thin client and smart client both allow ease of deployment, but offline capability and access to hardware [...]]]></description>
			<content:encoded><![CDATA[<p>Why care about caching data on the client? There are 3 types of apps out there: Thin Client (HTML/JavaScript to web browser), Thick Client (Word, Excel, etc), Smart Client (RIA, a hybrid between the thick and the thin). Thin client and smart client both allow ease of deployment, but offline capability and access to hardware resources is problematic for the thin client.</p>
<p>AIR allows web technology to be deployed directly to the desktop.  Flex, flash, PDF, HTML, JavaScript, CSS, Ajax.  Always starts with a root document (HTML or SWF). HTML may contain PDF or SWF. Both have renderer, VM, and DOM.  Code between the VMs can interoperate.  All can be display in native OS chrome. And you can persist data locally (hence this preso!).</p>
<p>Storage models: Local shared objects, encrypted local store, file system, embedded SQL database.</p>
<p><strong>Local shared objects.</strong> There are in package flash.net.*.  Used to serialize memory resident data structures. Runs in synchronous mode. This is a monolithic storage model. So it is fine for writing huge amounts of data, but when going to retrieve a single entry out of thousands, can take a proportionately long time.</p>
<p><strong>Encrypted local store.</strong> In package flash.filesystem.*. Used to store sensitive data. Runs in synchronous mode also. All data is serialized using ByteArray. So it&#8217;s like blob storage with keys. A ByteArray is like an in-memory stream of information. So you take an array, put it in a ByteArray, then add the ByteArray to the encrypted local store. This encrypted local store is just this space that is available to you based on the application and user.  And it is faster at accessing the record you want. But the point isn&#8217;t that it&#8217;s faster at accessing records; the point is that it is doing security to make sure no one can read it without authorization.</p>
<p><strong>File system.</strong> In package flash.filesystem.*. Provides random access to file system data. Can be asynchronous or synchronous. Two main components: File and FileStream. File represents a path to a particular file or directory. Completely OS-independent. FileStream does the actual work. Handles binary, object, text data.</p>
<p>Path handling: nativePath(), canonicalize(), resolvePath().</p>
<p>Cataloging: userDirectory(), desktopDirectory(), documentsDirectory(), applicationResourceDirectory(), applicationStorageDirectory(). File info (size, createDate, etc). copyTo(), moveTo(), etc. upload(), download(), send(), etc.  browse(), browseForDirectory(), etc.</p>
<p>FileStream implements the IDataInput/IDataOutput APIs. Can put binary data in &#8212; readBytes(), writeBytes(), readInt(), writeInt(), readDouble, writeDouble, etc.  Can do AMF3/AMF0 object serialization &#8212; readObject(), writeObject().</p>
<p><strong>Embedded SQL Database.</strong>  Self-contained factor is nice. You have no external dependencies; it will work the same on any OS. Each database is stored completely within a single file. Zero setup. No configuration or administration required. It just starts working.  No server process required, no need for an administrator to create the database and user accounts. Handles transactions! Has a large capacity: Theoretical limit of over 2TB.</p>
<p>Package is in flash.data.*. Can be asynchronous and synchronous.  Uses SQLConnection and SQLStatement.</p>
<p>SQLConnection. Establishes connection state, configuration, transactions, schema access. In async mode, also creates its own background thread. So you can create five SQLConnections to run five database operations simultaneously.</p>
<p>SQLStatement. Does CRUD operations. Does parameters, paging, and custom result row data types.</p>
<p>The database functionality is VERY fast. Can work with thousands&#8211;millions&#8211;of records in less than 1 second. Data reads are even faster.</p>
<p>SQLConnection: open(), attach(). The attach() will allow you to run queries on tables across multiple databases. Comes in handy during certain circumstances. Handled not too unlike SQL Server, when you are referencing an external database in your SQL statements.</p>
<p>SQLStatement.getResult() &#8212; Returns a SQLResult object.</p>
<p>SQLResult: data() returns an array of objects that contain each row of the result. complete() indicates if you pulled the whole result set. lastInsertRowID() is self-explanatory. rowsAffected() is also self-explanatory.</p>
<p>Note! Putting data on disk via the database can be slow <em>sometimes</em>. Recognize that it is a 6-step process: (1) Acquire shared lock on the database. (2) Acquire a RESERVED lock on the database. (3) In-memory rollback journal is updated. (4) Contents of rollback journal are physically written to disk. (5) Acquire an EXCLUSIVE lock to the database. (6) Write all modifications for the DB to the disk.</p>
<p>At this rate, you&#8217;re probably only going to get 5-6 database transactions per second.  Maybe as many as 20 on a high-end box. So the key is to put MANY database operations all in a single transaction.</p>
<p><strong>Transactions.</strong> SQLConnection manages the transaction. Use SQLConnection.begin() to start the transaction. Then, commit() and rollback() work as expected.</p>
<p><strong>Storage classes. </strong>There are numbers (int/real), text, and blobs.</p>
<p><strong>Affinity.</strong> Declaring a data type on a column determines the column&#8217;s affinity. You&#8217;re saying, &#8220;I want this field to be stored like this.&#8221; However, if you send a string to a field that should be a number, it won&#8217;t throw an error, it will just put it in there as a string.  Supports ActionScript affinities of boolean, date, int. Next beta should support XML, XMLList, Object, etc.  But currently, you can put arrays or objects in with blob, which will then treat it like a ByteArray.</p>
<p><strong>Introspection.</strong> Access to the table/view, column, index, and trigger information, including the SQL used to create the entity. But you can do selective loading, i.e. I want to see the tables in this database. Just use SQLConnection.loadSchema(). Will return a SQLSchemaResult that has tables, views, triggers, and indexes. These are all arrays of objects with the associated values.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/working-with-persistent-data-in-air/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AIR Tips and Tricks</title>
		<link>http://blog.crankybit.com/air-tips-and-tricks/</link>
		<comments>http://blog.crankybit.com/air-tips-and-tricks/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 19:28:45 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/air-tips-and-tricks/</guid>
		<description><![CDATA[Window API. Lightweight windows are nice because they won&#8217;t appear in the taskbar/dock.  Utility windows don&#8217;t even have title bars and are nice for toolbars or similar things. You can have transparent windows so that the only content you&#8217;ll see is the Flex/HTML content you put in there. Transparent windows require that you build your [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Window API.</strong> Lightweight windows are nice because they won&#8217;t appear in the taskbar/dock.  Utility windows don&#8217;t even have title bars and are nice for toolbars or similar things. You can have transparent windows so that the only content you&#8217;ll see is the Flex/HTML content you put in there.</p>
<p>Transparent windows require that you build your own functionality for window handling: Closing, minimizing, moving, resizing, etc. Now, when you use custom chrome, you can use Scale-9 in Flash/Flex to make it really easy to handle how resizing of the graphic works. You can do this with the &lt;mx:canvas&gt; tags in Flex.</p>
<p><strong>HTML Control.</strong> WebKit is entirely integrated into the Flash Rendering Pipeline. Using the bridge, you can use functionality in either JavaScript or ActionScript and use it in the other environment: AS called within JavaScript; JavaScript called within AS.</p>
<p><strong>File I/O. </strong>Full read/write access within the access provided the user running the OS. Have asynchronous and synchronous versions of the API. So quick and small file access can be done in a synchronous manner quickly, and longer access can be done asynchronously to maintain a quality user experience. Use standard native file dialogs: Save, select, select multiple, directory.</p>
<p>File I/O can save not just text/binary stuff, but you can read/write serialized AS objects. So, you can create an AS object with the info you need, then very rapidly write it out and have it very easy to read back in as that object.  Just use the writeObject() method of the filestream! Similarly, just use loadObject() when reading.  To make this work, you <u>will</u> need to add a tad of metadata to the object to make it work. Another caveat, the data will not be human-readable. But if human-readability is not important, this is much more rapid for writing a lot of data than it would be to save in some text or XML format and needing methods to write out and read back in the data.</p>
<p>Another solution could be to write this kind of data to the database via the database API. But sometimes that may be overkill, plus this can write files anywhere.</p>
<p><strong>Database.</strong> A fully-embedded SQLite database engine. You&#8217;re accessing a <u>local database</u>. This is not for accessing remote databases. To do that, you&#8217;ll want a webservice that provides access to that database.  This database support is great for providing online/offline support. You can sync the information locally and then just utilize the local version.</p>
<p>One note: Every database function will be a separate transaction. If you have hundreds/thousands of database functions to perform, wrap them into one transaction so that the filesystem can do the file transaction more efficiently. In his sample, writing 1,000 database records took 2.3 seconds with no transactions; it took 0.1 second with transactions.</p>
<p>When handling database connectivity, you will: (a) Point to the database file. (b) If it doesn&#8217;t exist, do the code to create the database. (c) Do your database statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/air-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ColdFusion 8 Server Monitoring</title>
		<link>http://blog.crankybit.com/coldfusion-8-server-monitoring/</link>
		<comments>http://blog.crankybit.com/coldfusion-8-server-monitoring/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 15:00:34 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/coldfusion-8-server-monitoring/</guid>
		<description><![CDATA[The following are notes from an Adobe MAX 2007 session. Server monitoring can help you get rid of some of your bottlenecks. Can make a big difference. The general server monitoring can even be used in production,  but DO NOT use the memory monitoring on a production site. May bring it down, even on low [...]]]></description>
			<content:encoded><![CDATA[<p>The following are notes from an Adobe MAX 2007 session.</p>
<p>Server monitoring can help you get rid of some of your bottlenecks. Can make a big difference. The general server monitoring can even be used in production,  but DO NOT use the memory monitoring on a production site. May bring it down, even on low load.</p>
<p>The <strong>Overview Screen</strong> will let you see slow active requests, charts of the number of requests, average response time, etc. What errors have been thrown lately? What alerts have been posted (will explain later)?  Various other statistics like that.</p>
<p>The <strong>Statistics Screen</strong> will display a bunch of various useful bits of info.</p>
<p><em>Requests.</em> Active CF threads, slowest threads, active sessions, cumulative server usage, highest hit counts, cache status, etc. By looking at this info, you can find long-running active requests that can actually wreak havoc on the whole server. You start chopping those down, and before you know it, your server will run like a race horse. There&#8217;s also a memory statistics section.</p>
<p><em>Memory.</em> Shows general memory usage, requests by memory usage, threads by memory usage, queries by memory usage, sessions by memory usage, application scope mrmory usage. You may at times find large amounts of memory that aren&#8217;t even used effectively in your apps, thus can slightly tweak the way things are being done. Beware: Garbage Collection isn&#8217;t always the answer. Memory can be hidden in shared scopes or caches.</p>
<p><em>Database.</em> Active queries, slowest queries, cached queries, etc. Most frequently run queries.</p>
<p><em>Errors.</em> Requests with errors, requests that have timed out. Having a lot of errors used to cause stability issues; not as much now, although if your logs fill up the whole hard drive, ColdFusion will have a problem! Plus, if you&#8217;re having that many errors, won&#8217;t you want to know about it?</p>
<p><em>Alerts.</em> Can set alerts for various circumstances you&#8217;ll want to be notified on. If the hung thread count reaches a certain maximum, or if a thread has run for x seconds, you can do certain actions (send email, dump snapshot, kill thread, reject any more requests) or you can supply a processing CFC that can then do anything you want.</p>
<p>The <strong>Snapshots Screen</strong> will give you all the details of the server at the moment the snapshot was taken. Will save all the detail into a text file. Can&#8217;t automate regular snapshots, although you probably could do it with the Admin API. Just set up a scheduled task that tells the Admin API to take a snapshot.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/coldfusion-8-server-monitoring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>eBay&#8217;s Lessons Learned on AIR</title>
		<link>http://blog.crankybit.com/ebays-lessons-learned-on-air/</link>
		<comments>http://blog.crankybit.com/ebays-lessons-learned-on-air/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 22:34:01 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/ebays-lessons-learned-on-air/</guid>
		<description><![CDATA[eBay has an AIR app for managing your eBay activity. Launched during MAX 2007, even though it has been around since last year&#8217;s MAX. They learned things from it. First, recognize that desktop apps have much more power than a web app. Why doesn&#8217;t everyone do them then? Desktop apps are a lot more expensive [...]]]></description>
			<content:encoded><![CDATA[<p>eBay has an AIR app for managing your eBay activity. Launched during MAX 2007, even though it has been around since last year&#8217;s MAX. They learned things from it.</p>
<p>First, recognize that desktop apps have much more power than a web app. Why doesn&#8217;t everyone do them then? Desktop apps are a lot more expensive to build! Web apps have been getting more expensive as standards of quality rise, but they&#8217;re still cheaper than full-fledged desktop apps.</p>
<p>eBay built a fully-functioning prototype in just 3 months. Here are some lessons learned.</p>
<p><strong>1. Start with a good foundation.</strong> They started the AIR app because they had already been building web services and API for eBay. So all they really had to do is build a UI. All the web service hype from 2002 was indeed hype, but now, five years later, the concept is finally coming together in a very key and important way. These web services are a great way to connect desktop apps to the web. Store your business logic in the web services that the desktop apps can access.</p>
<p><strong>2. Design takes a long time.</strong> Of the first 3 months, six weeks were spent on design alone. Why? (a) AIR offers a lot of freedom. If it was more restrictive, it would have been more straightforward. <img src='http://blog.crankybit.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (b) They were pioneering things. There is not a prescribed manner to address a lot of the questions that come up. (c) Expectations have been raised for user experience.</p>
<p><strong>3. Betas are really useful.</strong> I mean <em>real</em> betas, not marketing betas. They have thousands of users in the beta program and they get tons of feedback.</p>
<p><strong>4. The most important AIR feature is&#8230; Freedom from constraints of the browser. </strong>No frustrating back button. No location bar.</p>
<p><strong>5. Users don&#8217;t care about software platforms.</strong> A <u>good</u> platform, like AIR, just gets out of the way. Installation, auto software update, startup,  etc. Beta users haven&#8217;t complained about these kinds of things&#8211;the kinds of things that typically hinder Java apps or some other platforms.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/ebays-lessons-learned-on-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAX 2007</title>
		<link>http://blog.crankybit.com/max-2007/</link>
		<comments>http://blog.crankybit.com/max-2007/#comments</comments>
		<pubDate>Mon, 01 Oct 2007 02:25:13 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/max-2007/</guid>
		<description><![CDATA[During CFUnited, it didn&#8217;t look like I was going to be able to make it to MAX, which was ironic, since it&#8217;s in Chicago this year and I live not too far from Chicago. Well, things worked out and now I&#8217;ll be going to MAX. See you all there. I&#8217;ll be taking notes feverishly during [...]]]></description>
			<content:encoded><![CDATA[<p>During CFUnited, it didn&#8217;t look like I was going to be able to make it to MAX, which was ironic, since it&#8217;s in Chicago this year and I live not too far from Chicago.</p>
<p>Well, things worked out and now I&#8217;ll be going to MAX. See you all there. I&#8217;ll be taking notes feverishly during the sessions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/max-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR APIs</title>
		<link>http://blog.crankybit.com/air-apis/</link>
		<comments>http://blog.crankybit.com/air-apis/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 02:47:13 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/air-apis/</guid>
		<description><![CDATA[Here are some notes regarding some of the APIs for AIR that were showcased at the on AIR Bus Tour in Chicago. Window API Multi-window support. Transparent windows. Z-Ordering. All of the various aspects of OS windows can be applied to your AIR windows. When you use transparent windows with no chrome, the arrow will [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some notes regarding some of the APIs for AIR that were showcased at the on AIR Bus Tour in Chicago.</p>
<p><strong>Window API</strong></p>
<p>Multi-window support. Transparent windows. Z-Ordering. All of the various aspects of OS windows can be applied to your AIR windows. When you use transparent windows with no chrome, the arrow will click through the transparent part of images as well. Nice.</p>
<p><strong>File I/O</strong></p>
<p>Reading and writing of files. No problem. Can launch native file dialogs. Can handle selection, selecting multiples, directories, etc. Async and sync versions of the APIs.  Would use async API if you&#8217;re doing very heavy processing.</p>
<p><strong>Database Support</strong></p>
<p>SQLite embedded database. Zero setup, uses a single file. Not for accessing remote databases. This is for using a completely local database. Easily storing data in a database format, but in a local manner.  He didn&#8217;t show any examples of this. <img src='http://blog.crankybit.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p><strong>Drag and Drop / Clipboard</strong></p>
<p>System level drag and drop support is there! AIR app to AIR app, or AIR app to OS app and back again. Or to the desktop. Can use it for handling URLs, files, text, or even AS objects.  When marking something as draggable, you can assign one or many &#8220;transfer formats&#8221;. So when you drag an item to another app, if it doesn&#8217;t accept one data type, perhaps it will recognize another data type. For instance, if you have an image and a text transfer format, the receiving app may not like the image format, but it recognizes the text format, so it proceeds without a problem.</p>
<p><strong>Service Monitoring</strong></p>
<p>Handles the online/offline support. Will monitor the network interface for changes. Will detect not just network connectivity, but you can test access to a particular service. Do I have access to http://my.address.com/myservice?</p>
<p><strong>Conclusion</strong></p>
<p>These APIs work in JavaScript too because of the bridge, but it all works very well in Flex.  Daniel Dura was the presenter, and hit site at <a href="http://www.danieldura.com" target="_blank">http://www.danieldura.com</a> has a lot of AIR information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/air-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes: Are You &#8220;Cashing In&#8221; on Caching?</title>
		<link>http://blog.crankybit.com/notes-are-you-cashing-in-on-caching/</link>
		<comments>http://blog.crankybit.com/notes-are-you-cashing-in-on-caching/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 19:34:14 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-are-you-cashing-in-on-caching/</guid>
		<description><![CDATA[Caching is a way of saving data after it has been originally computed or loaded. Alleviates load from server(s). Makes them faster and &#8220;healthier&#8221;. Also improves the users&#8217; experience. On the server level, we can cache templates. ColdFusion has a trusted cache of compiled CFML. We can also cache data objects (queries, structs, arrays, CFCs, [...]]]></description>
			<content:encoded><![CDATA[<p>Caching is a way of saving data after it has been originally computed or loaded. Alleviates load from server(s). Makes them faster and &#8220;healthier&#8221;. Also improves the users&#8217; experience.</p>
<p>On the server level, we can cache templates. ColdFusion has a trusted cache of compiled CFML.  We can also cache data objects (queries, structs, arrays, CFCs, etc), and then render HTML content, either entire pages or HTML regions.</p>
<p><strong>What is good to cache?</strong> Things that are global to all users, like lists of states, navigation, etc. Even if not for <u>all</u> users, things that are used repeatedly in the application. Things that aren&#8217;t subject to much change. The more variants of something (based on the number of inputs), the less it will benefit from caching.</p>
<p><strong>So how do we <em>find</em> these things?</strong> Examine ColdFusion logs, look for long-running pages. Ugh. Better: Go through debugging output. Look for poor execution times.  But usually we look at it in a dev environment where load isn&#8217;t heavy. Can also use getTickCount(), &lt;cflog&gt;, &lt;cftrace&gt;.  Best: SeeFusion, FusionReactor, CF8 Admin will now give us more insight into performance of server and, more specifically, the threads or tasks that might be causing the heavy load.</p>
<p>Ask yourself:</p>
<p>1. How often do changes take place? The more the item is in flux, the less it is a caching candidate.</p>
<p>2. Up-to-the-second data is critical? No good.</p>
<p>3. How many cache variants are possible based on the variable input arguments?</p>
<p>4. What is the average count/size/length of each cache variant? Memory footprint might become an issue.</p>
<p><strong>What is a &#8220;Cache Variant&#8221;?</strong> A single set of data derived from the application code and based on a single combination of values for its arguments.  So if we have SQL with userid=#userID and active=#active#, these are two distinct inputs.  If you have 1,000 users, and 2 active states, you have 1,000 x 2 = 2,000 variants for the query cache. Obviously, the number of inputs drastically increases the variant pool. But ask yourself: How many <strong>likely</strong> variants exist? There likely are many permutations that you know are very unlikely to happen. Consider this when thinking about the likely footprint of your caching. Give attention to <em>where </em>you cache as well. Perhaps memory, disk, database.</p>
<p><strong>Measuring effects of caching.</strong> A 500ms page executed 60 times per minute is effectively taking 30s/1m. 30s x 60m = 1,800s per hour. If caching that page takes it down to 20ms, this will be 12s/1m x 60m = 72s per hour. You can see how drastic the caching is on overall system performance.</p>
<p><strong>Trusted Cache. </strong>Only have this turned on in the production environment. Can be problematic for a dev server since files are changing constantly. Will recompile or depend on compiled cache based on date/time stamps of the files. This could cause problems when templates are deployed via FTP or source control. For instance, if you deploy an older version to roll back some code, if may not recompile the new code! It will use the cache! So be cognizant of this and clear the cache if that occurs.</p>
<p>Restarting entire cache: Restart Application Server. Ugh. But in CFMX7, can &#8220;Clear Template Cache Now&#8221; in ColdFusion Administrator. Brian Szoszorek have an <a href="http://www.adobe.com/devnet/coldfusion/articles/cacheclear.html" target="_blank">article</a> for clearing just specific caches.</p>
<p>&#8220;Save Class Files&#8221; option. In the CF Admin &#8220;Caching&#8221; settings. When enabled, generates and saves a *.class file for each CFML template executed in WEB-INF/cfclasses/ directory. Can save a small bit of load when server is restarted. Server-wide setting. This option often doesn&#8217;t actually give any decent speed gain, because it uses File I/O.</p>
<p><strong>Query Caching.</strong> Adding cachedWithin or cachedAfter to &lt;cfquery&gt; tag. Note that CF Admin has a &#8220;Maximum number of cached queries&#8221; setting. Should be set high for a server-wide multi-application environment to be useful. Query caching is driven by: Query name, SQL statement, datasource, username/password, input arguments to SQL statement. All of these must be the same to use the cache. Even the tabbing/spacing of the SQL statement will cause it to not reference the cache if different!</p>
<p>Good caching examples: CachedWithin is good if something isn&#8217;t changing for a short period of time. Especially great when no inputs that would cause variants. Show top 10 news articles, cache for 15 minutes.  CachedAfter is good when running a query on data that won&#8217;t change after a certain time. Show records for month of 6/2007. You could do cachedAfter with a date of 6/30/2007.</p>
<p>Pros of query caching: Built-in. Debugging output will show that it was cached.  But many cons: No control of where queries &#8220;go&#8221; when being cached. In one big shared resource pool. Max number of cached queries is hard to set reasonably. Difficult to clear particular items unless clear whole cache. Cannot cache queries with &lt;cfqueryparam&gt; (until CF8). Cannot cache with &lt;cfstoredproc&gt;, however you can invoke the stored procs inside of &lt;cfquery&gt; with the EXEC command. No way to track or view the whole cache. Service/instance specific, not application specific.</p>
<p><strong>Alternatives to data caching.</strong> Take queries and put them in Server, Application, or Session scope. But you will have to programmatically start managing that. This obviously can be done with not just queries but also structs, arrays, objects, simple vars.</p>
<p><strong>Content Caching.</strong> You can use the &lt;cfcache&gt; tag. Allows you to cache entire contents of a page. Like &lt;cfquery&gt;, you give it a cachedWithin value. Stores the pushed HTML to disk. Decision to use cache is based on the URL requested.</p>
<p><strong>Alternatives for content caching.</strong> You can use &lt;cfsavecontent&gt; then put it in a shared scope (server, application, session, etc).  Various custom solutions (cf_superCache, cf_accelerate, cf_cacheOmatic, cf_turboCache, etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-are-you-cashing-in-on-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes: Advanced CFEclipse</title>
		<link>http://blog.crankybit.com/notes-advanced-cfeclipse/</link>
		<comments>http://blog.crankybit.com/notes-advanced-cfeclipse/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 18:29:43 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[IDEs]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-advanced-cfeclipse/</guid>
		<description><![CDATA[Presented by Mark Drew. CFEclipse was started by Rob Rohan in 2003. Mark joined in 2004. Macromedia endorses it in 2005, and was bought by Adobe he joined the Eclipse Foundation. Flex Builder was built on Eclipse in 2006, and added the RDS plugin for Eclipse. And CFEclipse 1.3 has been released in 2007. Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>Presented by <a href="http://www.markdrew.co.uk/blog/" target="_blank">Mark Drew</a>.</p>
<p>CFEclipse was started by Rob Rohan in 2003. Mark joined in 2004. Macromedia endorses it in 2005, and was bought by Adobe he joined the Eclipse Foundation. Flex Builder was built on Eclipse in 2006, and added the RDS plugin for Eclipse. And CFEclipse 1.3 has been released in 2007.</p>
<p>Eclipse automatically gives us cross-platform capability, version control (with CVS), Ant task runner, a generic text editor, a built-in web browser, search, and more. CFEclipse sits on top of this functionality.</p>
<p>CFEclipse gives us tag completion, syntax highlighting, outline view of code, methods view, web help, snippets. It has a file explorer view for those of us who like the HomeSite style of editing files. Scribble pad for quick code testing. Multiple syntax libraries (to support BlueDraon, Railo, etc), toolbars like HomeSite, component explorers, variable insight.</p>
<p><strong>Snippets</strong></p>
<p>Can create snippets to effectively &#8220;paste in&#8221; code you may use over and over again. Hit Ctrl-J or Cmd-J to pull up a snippet after typing the trigger text. Can have snippet variables to insert custom code when pasting the snippet.</p>
<p>&lt;mycode&gt;$${MyCustomVar}&lt;/mycode&gt;, for example, will insert what you put in msgbox when it asks for that variable. You can also define default values. For instance, $${MyCustomVar:The default value} will put &#8220;The default value&#8221; in there.</p>
<p><strong>Development Patterns and Support</strong></p>
<p>The typical Eclipse project paradigm is for local development. Working in the Eclipse workspace and probably use Subversion.</p>
<p>Otherwise, can use &#8220;File Location&#8221; or &#8220;FTP/SFTP&#8221; locations to directly edit some text that is somewhere outside your workspace, either on another machine, a file share, etc.</p>
<p><strong>Ant</strong></p>
<p>Ant scripts are typically called build.xml. When in the build.xml file, hit Ctrl-Space to get a build file template.  You can then just work on the template.</p>
<p>Ant builds are &#8220;Target&#8221; oriented. They are basically collections of tasks that can be accomplished. A target can have a depends=&#8221;" attribute that will not run until another target is executed. You can then use commands to copy files, zip files, etc. For instance, &lt;copydir&gt;, &lt;mkdir&gt;, &lt;input&gt;, &lt;echo&gt;, &lt;svn&gt;, &lt;ftp&gt;, etc.</p>
<p>Good articles on <a href="http://www.phillnacelli.net/blog/index.cfm/2007/2/8/ANT-Builds-and-MS-SQL--Run-sql-scripts-in-your-build" target="_blank">Ant with SQL Scripts</a>, <a href="http://www.phillnacelli.net/blog/index.cfm/2007/1/28/ANT-Builds-and-Subversion-SVN" target="_blank">Ant with Subversion</a>, and <a href="http://www.phillnacelli.net/blog/index.cfm/2006/6/15/ANT-Builds-and-FTP" target="_blank">Ant with FTP</a>.<br />
<strong>Unit Testing</strong></p>
<p>A CFUnit plugin just had a soft release at CFUnited! Supports both CFUnit and cfcUnit. With it, you can do unit testing from right within Eclipse rather than going to a web page and doing it. <em>Sweeeet!</em></p>
<p><strong>Framework Explorer</strong></p>
<p>Just like there is a CFC explorer, there is a framework explorer. When you open the view in your project, it will automatically figure out what frameworks you&#8217;re using, it will show them, and you can open them up and see your beans and other various components of your frameworks. <em>Sweeeeet!</em></p>
<p><strong>SnipEx</strong></p>
<p>Can have snippets that are stored on a central server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-advanced-cfeclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes: LiveCycle Data Services</title>
		<link>http://blog.crankybit.com/notes-livecycle-data-services/</link>
		<comments>http://blog.crankybit.com/notes-livecycle-data-services/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 15:41:18 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-livecycle-data-services/</guid>
		<description><![CDATA[LiveCycle Data Services used to be separate from CF. Now they are together, so you don&#8217;t have to configure the RMI to have them talk to each other. With it, using AS3 and Flash Remoting, you can do stuff like invoke CFC methods from within ActionScript!  No Flex server is involved. Messaging. Publish and subscribe. [...]]]></description>
			<content:encoded><![CDATA[<p>LiveCycle Data Services used to be separate from CF. Now they are together, so you don&#8217;t have to configure the RMI to have them talk to each other.</p>
<p>With it, using AS3 and Flash Remoting, you can do stuff like invoke CFC methods from within ActionScript!  No Flex server is involved.</p>
<p><strong>Messaging.</strong> Publish and subscribe. I say hello and everyone will listen to me. Someone says goodbye and I hear, and know not to talk to them anymore. ColdFusion can be both a Producer and a Consumer. Publish with sendGatewayMessage() and subscribe with an event gateway CFC.</p>
<p>New in CF8? Faster. Now uses Java API instead of that RMI.  Starting with CF8, it is included right in the CF installer. An express version comes right with CF8.</p>
<p>Not many notes on this, I wasn&#8217;t following too closely since we won&#8217;t be getting LCDS, at least not until I&#8217;m more heavy into Flex.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-livecycle-data-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes: Working With RSS in CF</title>
		<link>http://blog.crankybit.com/notes-working-with-rss-in-cf/</link>
		<comments>http://blog.crankybit.com/notes-working-with-rss-in-cf/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 14:44:31 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-working-with-rss-in-cf/</guid>
		<description><![CDATA[Presented by Pete Freitag. Really Simple Syndication. Just an XML file. Like WDDX: They're both syndication structures. But RSS is a defined structure, so it makes it easier to consume because you know exactly what the standards should be for it. Studies have shown that 69% of those surveyed don't use RSS, 27% are unaware [...]]]></description>
			<content:encoded><![CDATA[<p>Presented by <a href="http://www.petefreitag.com/" target="_blank">Pete Freitag</a>.</p>
<p><strong>R</strong>eally <strong>S</strong>imple <strong>S</strong>yndication. Just an XML file. Like WDDX: They're both syndication structures. But RSS is a defined structure, so it makes it easier to consume because you know exactly what the standards should be for it.</p>
<p>Studies have shown that 69% of those surveyed don't use RSS, 27% are unaware of it, but use RSS, and 4% are aware RSS users. So about 1/3 of population use RSS, but it has successfully evaded technical knowledge requirements for people to use it. RSS feed is one file (called a channel) with multiple articles (called items).</p>
<p>Why publish RSS? Can increase traffic; people subscribed will return to your site when their reader notifies them that new info is available. Also more convenient for your readers.  What are the downsides? Easier to steal your content when it is in a prestructured RSS feed. Can actually <em>increase</em> your bandwidth too, because readers may check your feed every hour or something.</p>
<p>How used? Portals like Google Homepage, RSS readers (desktop apps, Google Reader), Aggregators (like MXNA, Fullasagoog), RSS to email. Not just for blogs; can be used for news articles, forums, newsletters.</p>
<p>RSS vs. ATOM. RSS 2.0 is simple and gets the job done. ATOM is more complex with some add'l features. Typically, the add'l features are not used. For instance, you can post multiple versions for different content types (e.g. plaintext vs. HTML).</p>
<p><strong>Generating an RSS Feed</strong></p>
<p>Start by resetting any content. Then immediately do the XML header because it MUST be on the first line.</p>
<div class="igBar"><span id="lcfm-8"><a href="#" onclick="javascript:showCodeTxt('cfm-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CFM:</span>
<div id="cfm-8">
<div class="cfm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #990000;">&lt;cfcontent</span> reset=<span style="color: #009900;">"true"</span><span style="color: #990000;">&gt;</span></span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>?xml <span style="color: #0000FF;">version</span>=<span style="color: #009900;">"1.0"</span> ?<span style="color: #990000;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #990000;">&lt;cfheader</span> <span style="color: #0000FF;">name</span>=<span style="color: #009900;">"Content-Type"</span> <span style="color: #0000FF;">value</span>=<span style="color: #009900;">"text/xml"</span><span style="color: #990000;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Nice thing about setting it to "text/xml" is it will actually display the XML when opening in the browser. Nice for viewing the results. Can also choose "application/RSS+XML".</p>
<div class="igBar"><span id="lxml-9"><a href="#" onclick="javascript:showCodeTxt('xml-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-9">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;rss</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"2.0"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;title<span style="font-weight: bold; color: black;">&gt;</span></span></span>My News Feed<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>This is my news feed!<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;language<span style="font-weight: bold; color: black;">&gt;</span></span></span>en-us<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/language<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;lastBuildDate<span style="font-weight: bold; color: black;">&gt;</span></span></span>Wed, 27 Jun 2007 16:46:00 GMT<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/lastBuildDate<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;item<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;title<span style="font-weight: bold; color: black;">&gt;</span></span></span>This Article Title<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/title<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;link<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://you.com/news.cfm?id=1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/link<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;description<span style="font-weight: bold; color: black;">&gt;</span></span></span>My article content.<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/description<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;pubDate<span style="font-weight: bold; color: black;">&gt;</span></span></span>Wed, 27 Jun 2007 16:46:00 GMT<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/pubDate<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;guid<span style="font-weight: bold; color: black;">&gt;</span></span></span>http://you.com/news.cfm?id=1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/guid<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/item<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channel<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/rss<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Dates in RSS feed must be RFC 822 compliant. Use the <strong>GetHttpTimeString()</strong> function to display it in the proper format.</p>
<p>So, when doing this with &lt;cfquery&gt;/&lt;cfoutput&gt;, you might do something like:</p>
<div class="igBar"><span id="lcfm-10"><a href="#" onclick="javascript:showCodeTxt('cfm-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CFM:</span>
<div id="cfm-10">
<div class="cfm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;">&lt;rss <span style="color: #0000FF;">version</span>=<span style="color: #009900;">"2.0"</span><span style="color: #990000;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #333333;">&lt;channel&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></span>My Feed<span style="color: #333333;"><span style="color: #990000;">&lt;</span>/title&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;">&lt;description&gt;</span>My feed description.<span style="color: #333333;"><span style="color: #990000;">&lt;</span>/description&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;">&lt;language&gt;</span>en-us<span style="color: #333333;"><span style="color: #990000;">&lt;</span>/language&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;">&lt;lastBuildDate&gt;</span><span style="color: #0000FF;">#GetHttpTimeString<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">Now</span><span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&#41;</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/lastBuildDate&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;"><span style="color: #990000;">&lt;cfoutput</span> <span style="color: #0000FF">query</span>=<span style="color: #009900;">"myArticles"</span><span style="color: #990000;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #333333;">&lt;item&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></span><span style="color: #0000FF;">#myArticles.<span style="color: #0000FF;">Title</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/title&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;link&gt;</span></span>http://you.com/news.cfm?id=<span style="color: #0000FF;">#myArticles.<span style="color: #0000FF;">ID</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/link&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333333;">&lt;description&gt;</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>!<span style="color: #0000FF;">&#91;</span>CDATA<span style="color: #0000FF;">&#91;</span>#xmlFormat<span style="color: #0000FF;">&#40;</span>MyArticle.Story<span style="color: #0000FF;">&#41;</span>#<span style="color: #0000FF;">&#93;</span><span style="color: #0000FF;">&#93;</span><span style="color: #990000;">&gt;</span></span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/description&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333333;">&lt;pubDate&gt;</span><span style="color: #0000FF;">#GetHttpTimeString<span style="color: #0000FF;">&#40;</span>myArticles.DT<span style="color: #0000FF;">&#41;</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/pubDate&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #333333;">&lt;guid&gt;</span>http://you.com/news.cfm?id=<span style="color: #0000FF;">#myArticles.<span style="color: #0000FF;">ID</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/guid&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #333333;"><span style="color: #990000;">&lt;</span>/item&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #333333;"><span style="color: #990000;">&lt;/cfoutput&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #333333;"><span style="color: #990000;">&lt;</span>/channel&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/rss&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Send your feed to <a href="feedvalidator.org">feedvalidator.org</a> to see if it is valid. Helps you get your feed up and running.</p>
<p>You can also use enclosures, which is most used for podcasting. It's like an "attachment" to your feed. Technically, you can only have one enclosure. It may allow multiple enclosures, but because you're not supposed to, this can be problematic.</p>
<div class="igBar"><span id="lxml-11"><a href="#" onclick="javascript:showCodeTxt('xml-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-11">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;enclosure</span> <span style="color: #000066;">url</span>=<span style="color: #ff0000;">"http://you.com/audio.mp3"</span> <span style="color: #000066;">length</span>=<span style="color: #ff0000;">"12345"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"audio/mpeg"</span> <span style="font-weight: bold; color: black;">/&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Length is in bytes. Can obviously be more than just audio files. Could be a Word or PDF file.</p>
<p>Can also add a &lt;category&gt; tag within the &lt;item&gt; tag. Can add multiple tags. <a href="http://www.technorati.com/">Technorati</a> bases its "tags" on these categories in RSS feeds.  Can also add &lt;author&gt; (must be an email). Can also add &lt;source&gt;, where it refers to a source article you may be writing about or rebutting. </p>
<p>More &lt;channel&gt; tags: </p>
<ul>
<li>copyright: Copyright notice.
<li>ttl: Time to live. Number of minutes to cache the feed.
<li>image: Include an image for the RSS feed.
<li>skipDays: Listing of days that the feed will not change.
<li>skipHours: Listing of hours where the feed is not changed.
</ul>
<p>Can see the <a href="http://blogs.law.harvard.edu/tech/rss">RSS 2.0 spec</a> for more info.</p>
<p><strong>Feeds in ColdFusion 8</strong></p>
<p>The new &lt;cffeed&gt; tag can create AND parse RSS feeds.</p>
<div class="igBar"><span id="lcfm-12"><a href="#" onclick="javascript:showCodeTxt('cfm-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CFM:</span>
<div id="cfm-12">
<div class="cfm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;">&lt;cffeed <span style="color: #0000FF;">action</span>=<span style="color: #009900;">"create"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">name</span>=<span style="color: #009900;">"#feed#"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; outputfile=<span style="color: #009900;">"rss.xml"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; overwrite=<span style="color: #009900;">"true"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; xmlVar=<span style="color: #009900;">"xmlout"</span><span style="color: #990000;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Name will be a struct with the content. xmlVar allows you to put the generated RSS XML into a variable instead of the file.</p>
<p>So create a struct that contains title, description, link, and item which would be an array of structs with the various item elements (title, description, pubDate, link). This way, you can work with familiar ColdFusion structs and arrays when generating this stuff, then just feed it all to &lt;cffeed&gt;.</p>
<p>Parsing feeds is pretty easy.</p>
<div class="igBar"><span id="lcfm-13"><a href="#" onclick="javascript:showCodeTxt('cfm-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CFM:</span>
<div id="cfm-13">
<div class="cfm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;">&lt;cffeed <span style="color: #0000FF;">action</span>=<span style="color: #009900;">"read"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; source=<span style="color: #009900;">"http://you.com/rrs/"</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF">query</span>=<span style="color: #009900;">"feed"</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; properties=<span style="color: #009900;">"feedMetaData"</span><span style="color: #990000;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>feedMetaData will be the general channel metadata, and the feed variable from the query="" attribute will be a query form of the items.</p>
<p>Problem with the returned query is that it returns a million columns, and the columns you need to use are different for ATOM vs. RSS. It would be nice if there was one common set of fields that are set depending on whether the feed is ATOM or RSS.</p>
<p>So if using RSS, you may do something like:</p>
<div class="igBar"><span id="lcfm-14"><a href="#" onclick="javascript:showCodeTxt('cfm-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CFM:</span>
<div id="cfm-14">
<div class="cfm">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;h1&gt;</span></span><span style="color: #333333;"><span style="color: #990000;">&lt;cfoutput&gt;</span></span><span style="color: #0000FF;">#feedMetaData.<span style="color: #0000FF;">title</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;/cfoutput&gt;</span></span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/h1&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #990000;">&lt;cfoutput</span> <span style="color: #0000FF">query</span>=<span style="color: #009900;">"feed"</span><span style="color: #990000;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;h2&gt;</span></span><span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #0000FF;">href</span>=<span style="color: #009900;">"#feed.rsslink#"</span><span style="color: #990000;">&gt;</span></span><span style="color: #0000FF;">#feed.<span style="color: #0000FF;">title</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/a&gt;</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/h2&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #333333;"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></span><span style="color: #0000FF;">#feed.<span style="color: #0000FF">description</span>#</span><span style="color: #333333;"><span style="color: #990000;">&lt;</span>/p&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #333333;"><span style="color: #990000;">&lt;/cfoutput&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>So &lt;cffeed&gt; is really nice, although problematic due to the different ways it handles ATOM vs. RSS feeds. This isn't really their <em>fault</em>, but it would be nice if there was a black box that took care of the translation between the two feeds.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-working-with-rss-in-cf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notes: Ajax Development with ColdFusion Frameworks</title>
		<link>http://blog.crankybit.com/notes-ajax-development-with-coldfusion-frameworks/</link>
		<comments>http://blog.crankybit.com/notes-ajax-development-with-coldfusion-frameworks/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 19:34:52 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-ajax-development-with-coldfusion-frameworks/</guid>
		<description><![CDATA[Presented by Joe Rinehart. What's Ajax?  Classically, it means "Asynchronous JavaScript and XML", although also used with JSON a lot. For today, it will mean "using JavaScript to update a portion of an already displayed page without reloading." So, for an example: Deleting a single record is so server-heavy. Make the request, delete the record, [...]]]></description>
			<content:encoded><![CDATA[<p>Presented by <a href="http://www.firemoss.com/" target="_blank">Joe Rinehart</a>.</p>
<p><strong>What's Ajax? </strong></p>
<p>Classically, it means "Asynchronous JavaScript and XML", although also used with JSON a lot. For today, it will mean "using JavaScript to update a portion of an already displayed page without reloading."</p>
<p>So, for an example: Deleting a single record is so server-heavy. Make the request, delete the record, then reget the list, and rerender the entire list page. In Ajax, we now make the request, the server just deletes the record and sends a small token indicating that it did it.</p>
<p>So we balance the load between the client and the server more efficiently.  It also doesn't interrupt the experience for the user.  And the experience is just richer in general.</p>
<p><strong>"Unstructured Ajax".</strong> Calls made to the server don't return data, they return pre-rendered HTML. Very easy to implement, doesn't require major changes in architecture towards service layers. All we need are some scripts that generate HTML!</p>
<p>But you have now <em>bound</em> your data and presentation together. Isn't flexible for changing. Similarly, Ajax request "handlers" on the server side tend to be very single-purpose. They are used for that specific Ajax call and can't do much else.</p>
<p><strong>"Structured Ajax".</strong> Not just replacing regions of screen with the response. Instead, you're taking XML, JSON, or even perhaps delimited lists of strings and using the pure data. No intermingling with presentation. Thus, it will work better with service layers that are focused on data, not presentation. What if you want to update two regions of the page, for instance? Unstructured Ajax would get messy that way, but when returning just data, you can do this.</p>
<p>This is more difficult to implement though. Need extensive knowledge of JavaScript and DOM. And what do you use for your structured data? XML? SOAP? JSON?</p>
<p>When it comes right down to it though, both types use the same technology, the XmlHttpRequest. Just creating this object is troublesome. Very different from one browser to the other. This is where nice JavaScript libraries come in. CFAjax, Spry, Dojo, AjaxCFC, Prototype + Scriptaculous. But there are others! Zoop, Plex, Rico, sajax, MochiKit, Taco, MagicAjax, Microsoft Atlas, yada, yada, yada.</p>
<p>So we will use Prototype and Scriptaculous in this example.</p>
<p><strong>Implementing Ajax with Model-Glue</strong></p>
<p>For today, we'll just do unstructured Ajax. Not the best, but a great way to get started in this demo. Will be faster for demoing.</p>
<p><em>Prototype. </em>Great, and easy for unstructured Ajax, all on its own. Wraps around the XmlHttpRequest calls. It <u>does</u> have structured Ajax features, but it's custom to Prototype.</p>
<p><em>Scriptaculous.</em> An "add-on" to Prototype. Provides effects, drag-and-drop, unit testing.</p>
<p><em>Model-Glue. </em>Framework for developing HTML-based apps that use CFCs for business logic.</p>
<p>Model-Glue can work seamlessly with these Ajax frameworks. Can return some HTML which Prototype will put in a region via unstructured Ajax.</p>
<p>The example app is a list of tasks. You can create, edit, complete, and delete tasks.</p>
<p>What can we Ajaxify? Delete existing items. Add more tasks. Inline item editing.</p>
<p><strong>Ajax Delete.</strong> Create an event handler that deletes a task but returns nothing. Then, include our Ajax frameworks and add some JavaScript to call the event handler in an asynchronous manner. Third, use scriptaculous to make the row fade out. Finally, a few more visual clues.</p>
<p>With a two-line delete function in JavaScript, you make the Ajax request and then fade the row with Scriptaculous.  The Ajax request will just call a Model-Glue event that uses the built-in Model-Glue generic database management to delete the record in the database.</p>
<p>First create the MG event, then write the Prototype code to make the Ajax.request(), then write the Scriptaculous code to give visual feedback.</p>
<p>A big problem with Ajax is that it is harder to debug. Use cfcUnit for testing the CFCs. You should do this anyway. It's a lot easier to run unit tests than to put fake data in your forms and seeing what happens, over and over again. On the client side, debug with FireBug! But beyond that, do your client-side testing, even testing DOM results, with Selenium. With cfcUnit and Selenium, you can walk your way up the tiers to see where the errors occurred.</p>
<p><strong>ColdSpring.</strong> With it, you can expose existing components <em>as they are</em> to be services for Ajax.  Google "Remote Proxy ColdSpring" to read some articles by Chris Scott on this. ColdSpring will effectively generate the facades for you! Very service-oriented approach and requires no extra code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-ajax-development-with-coldfusion-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

