<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead</title>
	
	<link>http://www.designdisclosure.com</link>
	<description>Developing web and iphone applications for fun, profit or distraction</description>
	<lastBuildDate>Mon, 07 Dec 2009 23:28:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/designdisclosure" /><feedburner:info uri="designdisclosure" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><item>
		<title>symfony APC cache and Memcache session storage</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/8vP3LKDPOwQ/</link>
		<comments>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 23:22:43 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=138</guid>
		<description><![CDATA[In a previous post I described some of the reasons why you would want to store your session data in an alternate location to temporary files on your server. I explained the setup of database session storage using Doctrine and how this would allow you to take advantage of storing session data in a database. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-145" title="symfony-memcache" src="http://www.designdisclosure.com/wp-content/uploads/2009/12/symfony-memcache.jpg" alt="symfony-memcache" width="570" height="300" /></p>
<p>In a previous post I described some of the reasons why you would want to store your session data in an alternate location to temporary files on your server. I explained the<a title="symfony Doctrine database session storage" href="http://www.designdisclosure.com/2009/11/symfony-doctri…ession-storage/"> setup of database session storage using Doctrine</a> and how this would allow you to take advantage of storing session data in a database. However depending upon your application requirements storing your session data in a database may cause excessive load on you database. You could of course use a separate dedicated database server to store your session data. However there is an alternate setup that will allow you to centralise your session storage ready for horizontal scaling of your hosting e.g. adding additional web servers.</p>
<p><span id="more-138"></span></p>
<p>symfony provides a very easy way for you to configure your application to use a number of alternate session storage strategies. In this article I will explain the steps needed to setup your application to use first APC as your session storage and then Memcache. Both of these strategies result in the session data being stored in volatile memory on your server and a cookie is stored on the client to maintain reference to the session data. You can set the lifetime of the cookie to control your session timeout.</p>
<h2>Install APC and Memcached modules</h2>
<p>First we need to ensure that your server has the required packages installed. I am using Ubuntu 9.04 in this example but the packages are available for your preferred linux distro. To install the required packages run the following commands.</p>
<p>Install the required PHP modules and the correct version of apache to successfully install APC, then install the Pecl APC module.</p>
<pre class="textmate-source"><span class="source source_shell">sudo apt-get install php5-dev php-pear apache2-threaded-dev
sudo pecl install apc</span></pre>
<p>Install memcache</p>
<pre class="textmate-source"><span class="source source_shell">sudo apt-get install memcached</span></pre>
<h2>Configure APC session storage</h2>
<p>Once you have your server setup with the required packages you need to configure symfony to use your preferred session storage strategy. To do this you simply need to modify the factories.yml file for you application. You need to modify the section of the factories.yml that defines your application storage strategy e.g.</p>
<p>Amend your factories.yml to include the following settings then change the parameters to reflect you setup such as the domain and session name.</p>
<pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfCacheSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_name<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfproject </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] name of session to use
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_path<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">/ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie path
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_domain<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">example.com </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie domain
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_lifetime<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">+30 days </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] liftime of cookie
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_secure<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] send only if secure connection
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_http_only<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] accessible only via http protocol
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">cache<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">
</span></span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfAPCCache </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] define the cache strategy
</span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] this empty key is required or you will get warnings</span></span></pre>
<p>Once you have made this change clear the symfony cache and try your application. You will not see any noticeable difference unless you check the symfony toolbar and look for the additional cookie stored on the client.</p>
<p>This example defines the use of sfAPCCache as the session storage strategy. APC stores the session data in memory on your web server making it quicker to access than reading a file or database record.</p>
<h2>Configure Memcache session storage</h2>
<p>To setup memcache session storage it is almost as simple. Amend your factories.yml to include the following settings then change the parameters to reflect your setup including any specific values for your memcache server if you set it up differently.</p>
<pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfCacheSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_name<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfproject </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] name of session to use
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_path<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">/ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie path
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_domain<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">example.com </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie domain
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_lifetime<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">+30 days </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] liftime of cookie
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_secure<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] send only if secure connection
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_http_only<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] accessible only via http protocol
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">cache<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">
</span></span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfMemcacheCache </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] define the cache strategy
</span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>          <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">servers<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Array of servers
</span>            <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">localserver<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>              <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">host<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">localhost </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> hostname or IP of mamcache server
</span>              <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">port<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">11211 </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> default memcache port</span></span></pre>
<p>Once you have made this change clear your symfony cache and test your application.</p>
<p>Memcache is a volatile storage strategy very similar to RAM in you PC or Mac. It is very quick to access as the session data is held in the server memory rather than in a file or database. Memcache can also be centralised onto a dedicated memcache server allowing your application to be scaled. The example above uses localhost as the memcache server but the host value of the configured server could be modified to be an alternate dedicated memcache server.</p>
<p>I will be running some performance tests using these strategies and also compare the default file based session storage and also the database session storage strategy. If you have already run these tests I would be keen to see your results.</p>
<p>I hope these examples prove useful. If you have any queries or questions please leave a comment.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=symfony+APC+cache+and+Memcache+session+storage+-+http://tr.im/GfDQ&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage&amp;summary=%0D%0A%0D%0AIn%20a%20previous%20post%20I%20described%20some%20of%20the%20reasons%20why%20you%20would%20want%20to%20store%20your%20session%20data%20in%20an%20alternate%20location%20to%20temporary%20files%20on%20your%20server.%20I%20explained%20the%20setup%20of%20database%20session%20storage%20using%20Doctrine%20and%20how%20this%20would%20allow%20you%20to%20take%20advantage%20of%20storing%20session%20data%20in%20&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;t=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/&amp;title=symfony+APC+cache+and+Memcache+session+storage&amp;description=%0D%0A%0D%0AIn%20a%20previous%20post%20I%20described%20some%20of%20the%20reasons%20why%20you%20would%20want%20to%20store%20your%20session%20data%20in%20an%20alternate%20location%20to%20temporary%20files%20on%20your%20server.%20I%20explained%20the%20setup%20of%20database%20session%20storage%20using%20Doctrine%20and%20how%20this%20would%20allow%20you%20to%20take%20advantage%20of%20storing%20session%20data%20in%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>November 25, 2009 -- <a href="http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/" title="symfony Doctrine database session storage">symfony Doctrine database session storage</a></li><li>October 8, 2009 -- <a href="http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/" title="Propel doUpdate update multiple records in a single statement">Propel doUpdate update multiple records in a single statement</a></li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/8vP3LKDPOwQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/</feedburner:origLink></item>
		<item>
		<title>symfony Doctrine database session storage</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/VMYtXreD3tw/</link>
		<comments>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 22:23:26 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[sessions]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=128</guid>
		<description><![CDATA[Sessions are normally managed by your server and depending upon how involved you get with the PHP setup you need never know how this data is stored. The default setup for PHP is to store session data in temporary files on the server. So why would we want to change how sessions are handled and [...]]]></description>
			<content:encoded><![CDATA[<p>Sessions are normally managed by your server and depending upon how involved you get with the PHP setup you need never know how this data is stored. The default setup for PHP is to store session data in temporary files on the server. So why would we want to change how sessions are handled and what advantage can we gain from any changes we make.</p>
<h2>Why use database session management?</h2>
<p>Sessions allow you maintain persistence within PHP applications. With every HTTP request a PHP application must re-assign every variable and object needed in your application. Sessions allow you to store data that is required to persist past each HTTP request allowing it to be easily retrieved and used.</p>
<p><span id="more-128"></span></p>
<p>Sessions are commonly used when  creating a secure application, used to store the state of a user e.g. if they are logged in or credentials to control access to content.</p>
<p>By storing session data in a database table you are able to create an application interface that will show information about the users that are logged in. This for example could show the number of users logged into the application or show administrators who is logged in.</p>
<p>If you  need to scale your application by adding more than one server, saving your session data in temporary files can lead to major problems. By using database storage you can optimise and unify the session storage, ensuring that session data is always available and consistent.</p>
<p>Obviously there are other solutions for scalable session storage such as APC or MemCache but these solutions are for another post.</p>
<h2>How to setup Doctrine database session storage</h2>
<p>You first need to add a table to you database schema that will be used to store your session data. Although you can create this table manually, adding it to your scheme also created the model classes that you can later use to interact with the table data.</p>
<pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">Session<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">columns<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">id<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">string(32)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">primary<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}
    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">data<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">string(4000)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}
    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">time<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">integer(4)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}</span></pre>
<p>Once you have added the table to your schema you can build your model and database:</p>
<pre class="textmate-source"><span class="source source_shell">./symfony doctrine:build-all</span></pre>
<p>You then need to configure your symfony application to use this table to store all session data. To do this you need to modify the factories.yml file for your application. Update your file to include the following lines:</p>
<pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfPDOSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_table<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">session </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Name of the table storing the sessions
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_id_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">id </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The primary key column
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_data_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">data </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The column where the session data will be stored
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_time_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">time </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The column where the timestamp of the session will be stored
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">database<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">doctrine </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Name of the database connection to use</span></span></pre>
<p>Once you have modifies your factories.yml file you will need to clear the symfony cache. After that your application should run exactly as it did before except that your users session data will be stored in the database table.</p>
<p>The data column stores all the session data in a serialised form this is deserialized each time a user requests the data. There are many uses for this type of session storage and I hope this brief explanation helps you.</p>
<p>Subscribe to my <a title="Designdisclosure.com RSS Feed" href="feed://www.designdisclosure.com/feed/">RSS feed</a> or follow <a title="Alistair Stead on Twitter" href="http://twitter.com/alistairstead">me on twitter</a> to find out about <a title="setup symfony to use apc or memcache session storage" href="http://www.designdisclosure.com/2009/11/symfony-apc-ca…ession-storage/">setting up symfony to use APC or MemCache session storage.</a></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=symfony+Doctrine+database+session+storage+-+http://tr.im/FNF3&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage&amp;summary=Sessions%20are%20normally%20managed%20by%20your%20server%20and%20depending%20upon%20how%20involved%20you%20get%20with%20the%20PHP%20setup%20you%20need%20never%20know%20how%20this%20data%20is%20stored.%20The%20default%20setup%20for%20PHP%20is%20to%20store%20session%20data%20in%20temporary%20files%20on%20the%20server.%20So%20why%20would%20we%20want%20to%20change%20how%20sessions%20are%20handled%20and%20what%20a&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;t=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/&amp;title=symfony+Doctrine+database+session+storage&amp;description=Sessions%20are%20normally%20managed%20by%20your%20server%20and%20depending%20upon%20how%20involved%20you%20get%20with%20the%20PHP%20setup%20you%20need%20never%20know%20how%20this%20data%20is%20stored.%20The%20default%20setup%20for%20PHP%20is%20to%20store%20session%20data%20in%20temporary%20files%20on%20the%20server.%20So%20why%20would%20we%20want%20to%20change%20how%20sessions%20are%20handled%20and%20what%20a" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>November 30, 2009 -- <a href="http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/" title="symfony APC cache and Memcache session storage">symfony APC cache and Memcache session storage</a></li><li>October 8, 2009 -- <a href="http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/" title="Propel doUpdate update multiple records in a single statement">Propel doUpdate update multiple records in a single statement</a></li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/VMYtXreD3tw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/</feedburner:origLink></item>
		<item>
		<title>YUI Connect asynchronous file uploads</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/GveKgOZgSuc/</link>
		<comments>http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 14:26:16 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=122</guid>
		<description><![CDATA[I&#8217;m sure the problems with multi-part data that I have been working through this morning is very simple but there are a number of forum posts about this, so I will share my findings. When using YUI Connection Manager in conjunction with multi-part form data I have experienced problems creating the asynchronous request and canceling [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure the problems with multi-part data that I have been working through this morning is very simple but there are a number of forum posts about this, so I will share my findings. When using YUI Connection Manager in conjunction with multi-part form data I have experienced problems creating the asynchronous request and canceling the form submission. Even after setting up the request and callback object and checking the YUI API repeatedly the problem resides elsewhere.</p>
<pre class="textmate-source"><span class="source source_js">YAHOO.util.Event<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>addListener<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>forms<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>submit<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="variable variable_language variable_language_js">this</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_onFormSubmit<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="variable variable_language variable_language_js">this</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>

<span class="meta meta_function meta_function_json meta_function_json_js"><span class="entity entity_name entity_name_function entity_name_function_js">_onFormSubmit</span>: <span class="storage storage_type storage_type_function storage_type_function_js">function</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_js">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_js">e, o</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_end punctuation_definition_parameters_end_js">)</span></span>
<span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
  YAHOO&gt;util.Event<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>preventDefault<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>e<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Set the form
</span>  YAHOO<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>util<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>Connect<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>setForm<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>e<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>currentTarget<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Configure the callback object
</span>  callBackObj <span class="keyword keyword_operator keyword_operator_js">=</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
    success: o<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_loadRemoteFormSubmissionTemplateComplete<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>
    failure: o<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_loadRemoteFormSubmissionTemplateFailed<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>
    argument: <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
      objType: objType<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>
      region: regionObj<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,  </span>
      mode: submitbutton<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_constant support_constant_dom support_constant_dom_js">value</span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span>
  <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Make the request
</span>  YAHOO<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>util<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>Connect<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>asyncRequest<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>POST<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>e<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>currentTarget<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_constant support_constant_dom support_constant_dom_js">action</span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>callBackObj<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
<span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span></span></pre>
<p>With non multi-part forms you can hijack the submit event of the form and create an asynchronous request. However once you try with multi-part data no matter how you set this up and attempt to cancel the form submit action the form will still make an HTTP request in the main window.</p>
<h2>The YUI Multi-Part Data Solution</h2>
<p>The solution is very simple once you find it but it is easy to overlook! In order to use YUI connect to create an asynchronous request you must remove the &#8216;submit&#8217; button and replace it with a &#8216;button&#8217; then assign it an eventListener that will create the asyncRequest.</p>
<pre class="textmate-source"><span class="source source_js"><span class="storage storage_type storage_type_js">var</span> alternateButton <span class="keyword keyword_operator keyword_operator_js">=</span> <span class="support support_class support_class_js">document</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_function support_function_dom support_function_dom_js">getElementById</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>alternateButtonId<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span>
YAHOO.util.Event<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>addListener<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>alternateButton<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>click<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="variable variable_language variable_language_js">this</span><span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_onFormSubmit<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span><span class="variable variable_language variable_language_js">this</span><span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>

<span class="meta meta_function meta_function_json meta_function_json_js"><span class="entity entity_name entity_name_function entity_name_function_js">_onFormSubmit</span>: <span class="storage storage_type storage_type_function storage_type_function_js">function</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_js">(</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_js">e, o</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_end punctuation_definition_parameters_end_js">)</span></span>
<span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
  YAHOO.util.Event<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>preventDefault<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>e<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Set the form
</span>  YAHOO<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>util<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>Connect<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>setForm<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span>e<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>currentTarget<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Configure the callback object
</span>  callBackObj <span class="keyword keyword_operator keyword_operator_js">=</span> <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
    success: o<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_loadRemoteFormSubmissionTemplateComplete<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>
    failure: o<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>_loadRemoteFormSubmissionTemplateFailed<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,</span>
    argument: <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">{</span>
      objType: objType<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>
      region: regionObj<span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">,  </span>
      mode: submitbutton<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_constant support_constant_dom support_constant_dom_js">value</span><span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span>
  <span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span>
  <span class="comment comment_line comment_line_double-slash comment_line_double-slash_js"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_js">//</span> Make the request
</span>  YAHOO<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>util<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>Connect<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>asyncRequest<span class="meta meta_brace meta_brace_round meta_brace_round_js">(</span><span class="string string_quoted string_quoted_single string_quoted_single_js"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_js">'</span>POST<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_js">'</span></span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>e<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span>currentTarget<span class="meta meta_delimiter meta_delimiter_method meta_delimiter_method_period meta_delimiter_method_period_js">.</span><span class="support support_constant support_constant_dom support_constant_dom_js">action</span><span class="meta meta_delimiter meta_delimiter_object meta_delimiter_object_comma meta_delimiter_object_comma_js">, </span>callBackObj<span class="meta meta_brace meta_brace_round meta_brace_round_js">)</span><span class="punctuation punctuation_terminator punctuation_terminator_statement punctuation_terminator_statement_js">;</span>
<span class="meta meta_brace meta_brace_curly meta_brace_curly_js">}</span></span></pre>
<p>When trying to use multi-part data YUI Connection Manager will create an iframe in the document that your form will submit the data to. If you try and use the submit handler YUI currently does not change the target value of the submit event.</p>
<p>The YUI examples do all show the use of alternate buttons rather than a standard submit button however it can be easily overlooked. I hope this helps someone!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=YUI+Connect+asynchronous+file+uploads+-+http://tr.im/FzoQ&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads&amp;summary=I%27m%20sure%20the%20problems%20with%20multi-part%20data%20that%20I%20have%20been%20working%20through%20this%20morning%20is%20very%20simple%20but%20there%20are%20a%20number%20of%20forum%20posts%20about%20this%2C%20so%20I%20will%20share%20my%20findings.%20When%20using%20YUI%20Connection%20Manager%20in%20conjunction%20with%20multi-part%20form%20data%20I%20have%20experienced%20problems%20creating%20the%20a&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;t=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/&amp;title=YUI+Connect+asynchronous+file+uploads&amp;description=I%27m%20sure%20the%20problems%20with%20multi-part%20data%20that%20I%20have%20been%20working%20through%20this%20morning%20is%20very%20simple%20but%20there%20are%20a%20number%20of%20forum%20posts%20about%20this%2C%20so%20I%20will%20share%20my%20findings.%20When%20using%20YUI%20Connection%20Manager%20in%20conjunction%20with%20multi-part%20form%20data%20I%20have%20experienced%20problems%20creating%20the%20a" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/GveKgOZgSuc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/11/yui-connect-asynchronous-file-uploads/</feedburner:origLink></item>
		<item>
		<title>Propel doUpdate update multiple records in a single statement</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/lic1zM4t5yA/</link>
		<comments>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 19:59:09 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=103</guid>
		<description><![CDATA[I&#8217;ve been very busy with a number of project launches lately. While working on a little problem today I re-discovered a little gem for use with Propel to update multiple rows in a single statement, rather than iterating through a collection updating and saving each object in turn. This task is simple in SQL but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been very busy with a number of project launches lately. While working on a little problem today I re-discovered a little gem for use with Propel to update multiple rows in a single statement, rather than iterating through a collection updating and saving each object in turn.</p>
<p>This task is simple in SQL but after a while using any abstraction layer you may find like me you forget about the simple solutions as you spend you day working with complex objects and trying to hydrate custom objects. Blah blah blah&#8230;</p>
<p>The complex solution to a simple problem:</p>
<pre class="textmate-source"><span class="source source_php"><span class="source source_php source_php_embedded source_php_embedded_block source_php_embedded_block_html"><span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Obtain the connection configured
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>conn</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="support support_class support_class_php">Propel</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="meta meta_function-call meta_function-call_static meta_function-call_static_php">getConnection</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">DATABASE_NAME</span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Create a Criteria object that will select the correct rows from the database
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="keyword keyword_other keyword_other_new keyword_other_new_php">new</span> <span class="support support_class support_class_php">Criteria</span>()<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">-&gt;</span><span class="meta meta_function-call meta_function-call_object meta_function-call_object_php">add</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">COLUMB_TO_SELECT</span>, <span class="string string_quoted string_quoted_single string_quoted_single_php"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php">'</span><span class="meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php">value_to_match</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php">'</span></span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Create a Criteria object includes the value you want to set
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="keyword keyword_other keyword_other_new keyword_other_new_php">new</span> <span class="support support_class support_class_php">Criteria</span>()<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">-&gt;</span><span class="meta meta_function-call meta_function-call_object meta_function-call_object_php">add</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">COLUMB_TO_CHANGE</span>, <span class="string string_quoted string_quoted_single string_quoted_single_php"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php">'</span><span class="meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php">value_to_be_set</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php">'</span></span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Execute the query
</span><span class="support support_class support_class_php">BasePeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="meta meta_function-call meta_function-call_static meta_function-call_static_php">doUpdate</span>(<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span>, <span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span>, <span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>conn</span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span></span></span></pre>
<p>Thats it! I hope it helps&#8230;</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Propel+doUpdate+update+multiple+records+in+a+single+statement+-+http://tr.im/BsUt&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement&amp;summary=I%27ve%20been%20very%20busy%20with%20a%20number%20of%20project%20launches%20lately.%20While%20working%20on%20a%20little%20problem%20today%20I%20re-discovered%20a%20little%20gem%20for%20use%20with%20Propel%20to%20update%20multiple%20rows%20in%20a%20single%20statement%2C%20rather%20than%20iterating%20through%20a%20collection%20updating%20and%20saving%20each%20object%20in%20turn.%0D%0A%0D%0AThis%20task%20is%20si&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;t=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/&amp;title=Propel+doUpdate+update+multiple+records+in+a+single+statement&amp;description=I%27ve%20been%20very%20busy%20with%20a%20number%20of%20project%20launches%20lately.%20While%20working%20on%20a%20little%20problem%20today%20I%20re-discovered%20a%20little%20gem%20for%20use%20with%20Propel%20to%20update%20multiple%20rows%20in%20a%20single%20statement%2C%20rather%20than%20iterating%20through%20a%20collection%20updating%20and%20saving%20each%20object%20in%20turn.%0D%0A%0D%0AThis%20task%20is%20si" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>November 30, 2009 -- <a href="http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/" title="symfony APC cache and Memcache session storage">symfony APC cache and Memcache session storage</a></li><li>November 25, 2009 -- <a href="http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/" title="symfony Doctrine database session storage">symfony Doctrine database session storage</a></li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/lic1zM4t5yA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/</feedburner:origLink></item>
		<item>
		<title>How to: Magento eCommerce help and tutorials</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/GYFZorOSqZ8/</link>
		<comments>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 22:34:09 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=91</guid>
		<description><![CDATA[Magento is an Open Source eCommerce platform developed using the Zend Framework by Varien. It is a fabulously customizable and extendible platform that once mastered can allow you to develop feature rich eCommerce solutions for your clients quickly and effectively. However for some mastering the Magento platform may not be that easy. Magento uses common [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-99" title="Magento how to" src="http://www.designdisclosure.com/wp-content/uploads/2009/07/Magento-How-TO1.jpg" alt="Magento how to" width="570" height="300" /></p>
<p><a title="Magento - Home  - eCommerce Software for Growth" href="http://www.magentocommerce.com/">Magento</a> is an Open Source eCommerce platform developed using the Zend Framework by <a title="Home :: Varien :: Open Source eCommerce Development and Consulting Firm" href="http://www.varien.com/">Varien</a>. It is a fabulously customizable and extendible platform that once mastered can allow you to develop feature rich eCommerce solutions for your clients quickly and effectively. However for some mastering the Magento platform may not be that easy.</p>
<p>Magento uses common design patterns such as <a title="P of EAA: Model View Controller" href="http://www.martinfowler.com/eaaCatalog/modelViewController.html">MVC</a>, <a title="P of EAA: Application Controller" href="http://www.martinfowler.com/eaaCatalog/applicationController.html">Application Controller</a> and <a title="P of EAA: Two Step View" href="http://www.martinfowler.com/eaaCatalog/twoStepView.html">Two Step View</a> to structure the application and provide mechanisms to extend and override the functionality and presentation. The platform has a huge number of files and directories that can cause confusion for newcomers to the platform. However this extended folder structure clearly defines where the platforms core files exist and where you can place your custom code and modules. Allowing you to extend the platform without modifying the core and breaking the upgrade process.</p>
<p>However daunting the platform appears or skeptical you may be due to the unfamiliar concepts, invest a small amount of time with the platform and it will soon start to payoff. This list of tutorials and resources will help you get up to speed quickly.<span id="more-91"></span></p>
<h2>Magento eCommerce Tutorials and Resources</h2>
<p>I have compiled the following list of resources that have helped me while developing for the Magento platform.</p>
<h3>Developing Themes</h3>
<ul>
<li><a title="Learning to Design and Code for Magento Themes «  Mike Smullin" href="http://www.mikesmullin.com/development/learning-to-design-and-code-for-magento-themes/">Learning to Design and Code for Magento Themes</a></li>
<li><a title="Magento - Designer's Guide to Magento  - eCommerce Software for Growth" href="http://www.magentocommerce.com/design_guide/articles/how-magento-builds-content">Designer&#8217;s Guide to Magento</a></li>
<li><a title="Web Design Tips: Configuring Templates, Adding a Product Grid in Magento  | Practical eCommerce" href="http://www.practicalecommerce.com/articles/1037-Web-Design-Tips-Configuring-Templates-Adding-a-Product-Grid-in-Magento-">Configuring Templates, Adding a Product Grid in Magento</a></li>
<li><a title="Cult-foo     » Magento Template Advices" href="http://www.cult-f.net/2008/11/17/magento-template-advices/">Magento Template Advices</a></li>
</ul>
<h3>Custom Code and Modules</h3>
<ul>
<li><a title="Writing a custom module in Magento, detailed walktrough | ActiveCodeline" href="http://activecodeline.com/writing-a-custom-module-in-magento-detailed-walktrough/">Writing a custom module in Magento, detailed walktrough</a></li>
<li><a title="How To Write Magento Custom Module: Cash On Delivery Payment Method | Elias Interactive" href="http://eliasinteractive.com/blog/magento-create-new-payment-method-cash-on-delivery/">How To Write Magento Custom Module: Cash On Delivery Payment Method</a></li>
<li><a title="Magento Design and Magento Development blog" href="http://www.exploremagento.com/">Magento Design and Magento Development blog</a></li>
<li><a title="snippi | MAGENTO CODE SNIPPETS" href="http://snippi.net/">snippi | MAGENTO CODE SNIPPETS</a></li>
<li><a title="Magento - Wiki - Create Payment Method Module" href="http://www.magentocommerce.com/wiki/how-to/create-payment-method-module">Create Payment Method Module</a></li>
<li><a title="Tips for Twits  » Blog Archive   » Howto: Repackageable custom extension development in Magento" href="http://t.wits.sg/2009/03/31/howto-repackageable-custom-extension-development-in-magento/">HOWTO: Repackageable custom extension development in magento</a></li>
</ul>
<h3>API Documentation</h3>
<ul>
<li><a title="Magento Documentation (phpdoc)" href="http://docs.magentocommerce.com/">Magento Documentation (phpdoc)</a></li>
</ul>
<h3>Tips and Advice</h3>
<ul>
<li><a title="MageTips - Published by Simon Young" href="http://magetips.com/">MageTips</a></li>
<li><a title="Magento Beginners • Hints for Start | Inchoo" href="http://inchoo.net/ecommerce/top-3-mistakes-by-magento-beginners/">Top 3 mistakes by Magento beginners</a></li>
</ul>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=How+to%3A+Magento+eCommerce+help+and+tutorials+-+http://tr.im/BuKJ&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials&amp;summary=%0D%0A%0D%0AMagento%20is%20an%20Open%20Source%20eCommerce%20platform%20developed%20using%20the%20Zend%20Framework%20by%20Varien.%20It%20is%20a%20fabulously%20customizable%20and%20extendible%20platform%20that%20once%20mastered%20can%20allow%20you%20to%20develop%20feature%20rich%20eCommerce%20solutions%20for%20your%20clients%20quickly%20and%20effectively.%20However%20for%20some%20mastering%20the&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;t=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/&amp;title=How+to%3A+Magento+eCommerce+help+and+tutorials&amp;description=%0D%0A%0D%0AMagento%20is%20an%20Open%20Source%20eCommerce%20platform%20developed%20using%20the%20Zend%20Framework%20by%20Varien.%20It%20is%20a%20fabulously%20customizable%20and%20extendible%20platform%20that%20once%20mastered%20can%20allow%20you%20to%20develop%20feature%20rich%20eCommerce%20solutions%20for%20your%20clients%20quickly%20and%20effectively.%20However%20for%20some%20mastering%20the" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/GYFZorOSqZ8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/</feedburner:origLink></item>
		<item>
		<title>Where to start learning Cocoa and Cappuccino?</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/z5QEiTNZrrc/</link>
		<comments>http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 12:58:00 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[Cappuccino]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[objective-j]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=79</guid>
		<description><![CDATA[I don&#8217;t think I&#8217;m alone in the fact that over the past twelve months I have been learning Cocoa specifically Cocoa Touch for the iPhone. Apps and tutorials will follow! However I have also been looking at Cappuccino (http://cappuccino.org/) a direct port of Cocoa to JavaScript. The intention of Cocoa and Cappuccino is to make [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-87" title="Cocoa Cappuccino" src="http://www.designdisclosure.com/wp-content/uploads/2009/07/cocoa-cappuccino.jpg" alt="Cocoa Cappuccino" width="570" height="300" /></p>
<p>I don&#8217;t think I&#8217;m alone in the fact that over the past twelve months I have been learning Cocoa specifically Cocoa Touch for the iPhone. Apps and tutorials will follow! However I have also been looking at Cappuccino (<a href="http://cappuccino.org/">http://cappuccino.org/</a>) a direct port of Cocoa to JavaScript. The intention of Cocoa and Cappuccino is to make the development of applications a quick, simple and fun exercise, however if like me you are approaching this from a web development standpoint those first steps can be a little hard.</p>
<p>However I have found a set of resources that will be invaluable if you too are trying to get to grips with Cocoa or Cappuccino.</p>
<p><span id="more-79"></span></p>
<h2>Cocoa &amp; Objective-C</h2>
<p>Cocoa is an Object Orientated MVC framework build in Objective-C a superset of C. It is the framework used to develop the native applications for Mac and the iPhone. It is a well proven framework created and supported by Apple with a vast developer community.</p>
<h2>Cappuccino &amp; Objective-J</h2>
<p>Cappuccino is and Object Orientated MVC framework built in Objective-J a superset of JavaScript. It is a direct port of Cocoa by the guys behind (http://www.280north.com/). It runs directly in any JavaScript enabled web browser. Cappuccino has been used in a number of applications such as:</p>
<ul>
<li><a href="http://280slides.com/">http://280slides.com/</a></li>
<li><a href="http://almost.at/">http://almost.at/</a></li>
</ul>
<h2>Where do you start?</h2>
<p>Cocoa has vast amounts of very very high quality documentation on the Apple site (http://developer.apple.com/) however it is not the most accessible read. It is amazing once you have made those first steps but there are not many step by step tutorials or lesson based examples. However after a lot of searching and reading I have found some great starting points:</p>
<ul>
<li><a href="http://andymatuschak.org/articles/2007/09/09/getting-started-with-cocoa-a-friendlier-approach/">http://andymatuschak.org/articles/2007/09/09/getting-started-with-cocoa-a-friendlier-approach/</a></li>
<li><a href="http://cocoadevcentral.com/">http://cocoadevcentral.com/</a></li>
<li><a href="http://www.teachmecocoa.com/">http://www.teachmecocoa.com/</a></li>
</ul>
<p>Cappuccino when compared to Cocoa is in it&#8217;s infancy. As such the documentation is not as complete, however you can transfer a lot of knowledge from the Cocoa documentation. Again here is a list of the resources I have found when learning Cappuccino:</p>
<ul>
<li><a href="http://www.littletreesoftware.com/blog/">http://www.littletreesoftware.com/blog/</a></li>
<li><a href="http://cappuccino.org/learn/tutorials/">http://cappuccino.org/learn/tutorials/</a></li>
<li><a href="http://cappuccino.org/learn/documentation/">http://cappuccino.org/learn/documentation/</a></li>
</ul>
<h2>Conclusion</h2>
<p>These frameworks can be very daunting at first and the syntax alien but after I while using them they can be a very intuitive and expressive languages. The Cocoa community is very large with a wealth of knowledge however it appears that not may developers pass on the experiences online so it can be very hard to find good examples online. Cappuccino opens the door for existing Cocoa developers to move to building for the web. This hopefully will lead to much more content being made available for people new to the language.</p>
<p>I have found the learning Cappuccino and Cocoa together very helpful and the examples I have found transfer very well. I look forward to seeing the rich web applications that will come out of the meeting of these two communities and technologies.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Where+to+start+learning+Cocoa+and+Cappuccino%3F+-+http://tr.im/Bufj&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F&amp;summary=%0D%0A%0D%0AI%20don%27t%20think%20I%27m%20alone%20in%20the%20fact%20that%20over%20the%20past%20twelve%20months%20I%20have%20been%20learning%20Cocoa%20specifically%20Cocoa%20Touch%20for%20the%20iPhone.%20Apps%20and%20tutorials%20will%20follow%21%20However%20I%20have%20also%20been%20looking%20at%20Cappuccino%20%28http%3A%2F%2Fcappuccino.org%2F%29%20a%20direct%20port%20of%20Cocoa%20to%20JavaScript.%20The%20intention%20of%20&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;t=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/&amp;title=Where+to+start+learning+Cocoa+and+Cappuccino%3F&amp;description=%0D%0A%0D%0AI%20don%27t%20think%20I%27m%20alone%20in%20the%20fact%20that%20over%20the%20past%20twelve%20months%20I%20have%20been%20learning%20Cocoa%20specifically%20Cocoa%20Touch%20for%20the%20iPhone.%20Apps%20and%20tutorials%20will%20follow%21%20However%20I%20have%20also%20been%20looking%20at%20Cappuccino%20%28http%3A%2F%2Fcappuccino.org%2F%29%20a%20direct%20port%20of%20Cocoa%20to%20JavaScript.%20The%20intention%20of%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/z5QEiTNZrrc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/07/where-to-start-learning-cocoa-and-cappuccino/</feedburner:origLink></item>
		<item>
		<title>Make MDM Zinc applications with the Gaia framework for Adobe flash</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/vYBVe5dm7wY/</link>
		<comments>http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 11:59:02 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[actionscript mdm zinc flash application]]></category>

		<guid isPermaLink="false">http://www.designdisclosure.com/?p=68</guid>
		<description><![CDATA[The Gaia Framework for Adobe Flash is a something I have been using for some time. It is one of the most useful frameworks I have found for use with Flash. It adds a great deal of useful functionality and can generate large swathes of source code that you would otherwise need to write from [...]]]></description>
			<content:encoded><![CDATA[<p>The Gaia Framework for Adobe Flash is a something I have been using for some time. It is one of the most useful frameworks I have found for use with Flash. It adds a great deal of useful functionality and can generate large swathes of source code that you would otherwise need to write from scratch. However it is a very lightweight and unobtrusive ActionScript framework, you are still free to build your flash application in the same way you always have. You can continue to use your existing workflow but also take advantage of the framework features such as scaffolding, swfAddress, SEO optimization and asset loading and pre-loading.</p>
<p>With all this said when using the Gaia Framework with MDM Zinc application wrapper you have a couple of issues to resolve.</p>
<ul>
<li>File paths and references from the application executable.</li>
<li>External Interface calls.</li>
</ul>
<p>Most flash developers are likely unfamiliar with developing installable applications so these issues may be daunting when first encountered. However once explained there are simple solutions to both these issues that I will explain in detail.</p>
<p><span id="more-68"></span></p>
<h2>File Paths and References</h2>
<p>When Flash is used within a website it is served by a webserver and files can always be referenced from the root of the website e.g. /flv/example-video.flv or relative to the location of the .swf e.g. flv/example-video.flv.</p>
<p>However when your .swf is running inside the MDM Zinc wrapper it can no longer reliably reference files using the absolute path from root or a relative path. To resolve this you will need to evaluate the location that the application is running at before creating a path to the files based on this computed path.</p>
<h3>Zinc Context Object</h3>
<p>To solve this problem I have created a singleton context object. This object allows me to run the required application setup code and access the application properties from everywhere within my Gaia based application.</p>
<pre class="textmate-source sunburst"><span class="source source_actionscript source_actionscript_3"><span class="meta meta_package meta_package_actionscript meta_package_actionscript_3"><span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">package</span> <span class="entity entity_name entity_name_type entity_name_type_package entity_name_type_package_actionscript entity_name_type_package_actionscript_3">com.designdisclosure.utils.mdm</span></span>
<span class="meta meta_package meta_package_actionscript meta_package_actionscript_3">{
  <span class="storage storage_type storage_type_import storage_type_import_actionscript storage_type_import_actionscript_3">import <span class="support support_class support_class_actionscript support_class_actionscript_3">mdm.*</span><span class="punctuation punctuation_terminator punctuation_terminator_actionscript punctuation_terminator_actionscript_3">;</span></span>
  <span class="storage storage_type storage_type_import storage_type_import_actionscript storage_type_import_actionscript_3">import <span class="support support_class support_class_actionscript support_class_actionscript_3">flash.events.Event</span><span class="punctuation punctuation_terminator punctuation_terminator_actionscript punctuation_terminator_actionscript_3">;</span></span>
  <span class="storage storage_type storage_type_import storage_type_import_actionscript storage_type_import_actionscript_3">import <span class="support support_class support_class_actionscript support_class_actionscript_3">flash.events.EventDispatcher</span><span class="punctuation punctuation_terminator punctuation_terminator_actionscript punctuation_terminator_actionscript_3">;</span></span>
  <span class="storage storage_type storage_type_import storage_type_import_actionscript storage_type_import_actionscript_3">import <span class="support support_class support_class_actionscript support_class_actionscript_3">flash.display.*</span><span class="punctuation punctuation_terminator punctuation_terminator_actionscript punctuation_terminator_actionscript_3">;</span></span>

<span class="meta meta_class meta_class_actionscript meta_class_actionscript_3">  <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_actionscript entity_name_type_class_actionscript_3">ZincContext</span>  <span class="meta meta_definition meta_definition_class meta_definition_class_extends meta_definition_class_extends_actionscript meta_definition_class_extends_actionscript_3"><span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">extends</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_actionscript entity_name_type_class_actionscript_3">Sprite</span>
  {</span>
    <span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">private</span> <span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">static</span>  <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_instance</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span>ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    <span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">public</span> <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> zincGlobals<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span>ZincGlobals<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>

    <span class="comment comment_block comment_block_documentation comment_block_documentation_asdoc"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_begin punctuation_definition_comment_begin_asdoc">/**</span>
<span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">    </span><span class="meta meta_documentation meta_documentation_comment meta_documentation_comment_asdoc">* Public static method to instantiate the ZincContext object.
</span><span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">    </span><span class="meta meta_documentation meta_documentation_tag meta_documentation_tag_return meta_documentation_tag_return_asdoc">* <span class="keyword keyword_other keyword_other_documentation keyword_other_documentation_return keyword_other_documentation_return_asdoc"><span class="punctuation punctuation_definition punctuation_definition_keyword punctuation_definition_keyword_asdoc">@</span>return</span> ZincContext Object Instance
</span><span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">    </span><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_asdoc">*/</span></span>
<span class="meta meta_definition meta_definition_getter meta_definition_getter_actionscript meta_definition_getter_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">static</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="storage storage_type storage_type_accessor storage_type_accessor_actionscript storage_type_accessor_actionscript_3">get</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">instance</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_end punctuation_definition_parameters_end_actionscript punctuation_definition_parameters_end_actionscript_3">)</span>:ZincContext
    </span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_instance</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">===</span> <span class="constant constant_language constant_language_null constant_language_null_actionscript constant_language_null_actionscript_3">null</span>)
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_instance</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> ZincContext(<span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> SingletonEnforcer())<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}

      <span class="keyword keyword_control keyword_control_end keyword_control_end_actionscript keyword_control_end_actionscript_3">return</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_instance</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span>

<span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">ZincContext</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span><span class="variable variable_paramater variable_paramater_method variable_paramater_method_actionscript variable_paramater_method_actionscript_3">pvt</span><span class="punctuation punctuation_seperator punctuation_seperator_actionscript punctuation_seperator_actionscript_3">:</span><span class="support support_class support_class_actionscript support_class_actionscript_3">SingletonEnforcer</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span><span class="keyword keyword_void keyword_void_actionscript keyword_void_actionscript_3">void</span>
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span>(pvt <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="constant constant_language constant_language_null constant_language_null_actionscript constant_language_null_actionscript_3">null</span>)
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
         <span class="keyword keyword_control keyword_control_catch-exception keyword_control_catch-exception_actionscript keyword_control_catch-exception_actionscript_3">throw</span> <span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> <span class="support support_class support_class_top-level support_class_top-level_actionscript support_class_top-level_actionscript_3">Error</span>(<span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"Error: Instantiation failed: Use ZincContext.instance instead of new."</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}

      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// Initialize an MDMZinc application and create a callback method for when this is completed
</span>      mdm<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_class support_class_mx support_class_mx_actionscript support_class_mx_actionscript_3">Application</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_mx support_function_mx_actionscript support_function_mx_actionscript_3">init</span>(<span class="variable variable_language variable_language_actionscript variable_language_actionscript_3">this</span>, onMDMinit)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span>

<span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">private</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">onMDMinit</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span><span class="keyword keyword_void keyword_void_actionscript keyword_void_actionscript_3">void</span>
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// Use this method to setup your Zinc application
</span>      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// This is the same as applicationDidFinishLaunching from cocoa
</span>    }</span>

    <span class="comment comment_block comment_block_documentation comment_block_documentation_asdoc"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_begin punctuation_definition_comment_begin_asdoc">/**</span>
<span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">     </span><span class="meta meta_documentation meta_documentation_comment meta_documentation_comment_asdoc">*  Get the absolute path to the application and its files.
<span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">     </span>*  I use a VMWare machine during testing and found
<span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">     </span>*  that the application path is alittle un-reliable
<span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">     </span>*  and needs modification when running in the VM.
</span><span class="comment comment_block comment_block_documentation comment_block_documentation_left-margin comment_block_documentation_left-margin_asdoc">     </span><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_asdoc">*/</span></span>
<span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">getApplicationPath</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> path<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> mdm<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_class support_class_mx support_class_mx_actionscript support_class_mx_actionscript_3">Application</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>path<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>

      <span class="keyword keyword_control keyword_control_end keyword_control_end_actionscript keyword_control_end_actionscript_3">return</span> path<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span>

<span class="meta meta_definition meta_definition_getter meta_definition_getter_actionscript meta_definition_getter_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="storage storage_type storage_type_accessor storage_type_accessor_actionscript storage_type_accessor_actionscript_3">get</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">isZincApplication</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_end punctuation_definition_parameters_end_actionscript punctuation_definition_parameters_end_actionscript_3">)</span>:<span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">Boolean</span>
    </span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="keyword keyword_control keyword_control_end keyword_control_end_actionscript keyword_control_end_actionscript_3">return</span> (getApplicationPath<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">length</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">?</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_true constant_language_boolean_true_actionscript constant_language_boolean_true_actionscript_3">true</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_false constant_language_boolean_false_actionscript constant_language_boolean_false_actionscript_3">false</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span>
  }</span>
}</span>

<span class="meta meta_class meta_class_actionscript meta_class_actionscript_3"><span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">internal</span> <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">class</span> <span class="entity entity_name entity_name_type entity_name_type_class entity_name_type_class_actionscript entity_name_type_class_actionscript_3">SingletonEnforcer</span> {}</span></span></pre>
<p>This object can be used to obtain the application path, an absolute location at which the Zinc application is running. The can then be used in any function the loads external resources. However here is the main problem within the Gaia framework. It is possible to update the path to the site.xml file that is loaded in main.as but even if you load the file from an absolute path the framework does not update the paths used to load any assets referenced in the xml file its self.</p>
<h3>Fixing the file paths</h3>
<p>Although my next suggestion is not by any means ideal as it involves modifying the framework, I have yet to find a better solution. This obviously will lead to problems when updating the framework to future revisions. However these changes re fairly limited in scope as it is only a single file SiteModel.as. Here are my modifications that inject the application path if it exists into any location where external files are loaded.</p>
<pre class="textmate-source"><span class="source source_actionscript source_actionscript_3"><span class="meta meta_package meta_package_actionscript meta_package_actionscript_3"><span class="meta meta_class meta_class_actionscript meta_class_actionscript_3"><span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3">    <span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">public</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">load</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span><span class="variable variable_paramater variable_paramater_method variable_paramater_method_actionscript variable_paramater_method_actionscript_3">path</span><span class="punctuation punctuation_seperator punctuation_seperator_actionscript punctuation_seperator_actionscript_3">:</span><span class="support support_class support_class_actionscript support_class_actionscript_3">String</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span><span class="keyword keyword_void keyword_void_actionscript keyword_void_actionscript_3">void</span>
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (path <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="constant constant_language constant_language_null constant_language_null_actionscript constant_language_null_actionscript_3">null</span>) path <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"site.xml"</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (path <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!=</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"xml/site.xml"</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&amp;&amp;</span> path <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!=</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"site.xml"</span>) GaiaDebug<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">log</span>(<span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"site.xml path = "</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">+</span> path)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">request</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_class support_class_flash support_class_flash_actionscript support_class_flash_actionscript_3">URLRequest</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> <span class="support support_class support_class_flash support_class_flash_actionscript support_class_flash_actionscript_3">URLRequest</span>(CacheBuster<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_mx support_function_mx_actionscript support_function_mx_actionscript_3">create</span>(ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>instance<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>getApplicationPath()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">+</span>path))<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="support support_property support_property_flash support_property_flash_actionscript support_property_flash_actionscript_3">loader</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> <span class="support support_class support_class_flash support_class_flash_actionscript support_class_flash_actionscript_3">URLLoader</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="support support_property support_property_flash support_property_flash_actionscript support_property_flash_actionscript_3">loader</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_mx support_function_mx_actionscript support_function_mx_actionscript_3">addEventListener</span>(<span class="support support_class support_class_flash support_class_flash_actionscript support_class_flash_actionscript_3">Event</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">COMPLETE</span>, onLoadComplete)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="support support_property support_property_flash support_property_flash_actionscript support_property_flash_actionscript_3">loader</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_mx support_function_mx_actionscript support_function_mx_actionscript_3">load</span>(<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">request</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span></span></span></span></pre>
<pre class="textmate-source"><span class="source source_actionscript source_actionscript_3"><span class="meta meta_package meta_package_actionscript meta_package_actionscript_3"><span class="meta meta_class meta_class_actionscript meta_class_actionscript_3"><span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3"><span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">private</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">parseSite</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span><span class="keyword keyword_void keyword_void_actionscript keyword_void_actionscript_3">void</span>
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_title</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">""</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_preloader</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">preloader</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>instance<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>getApplicationPath()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">+</span><span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"preload.swf"</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"true"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_delimiter</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@delimiter <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">": "</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_routing</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@routing <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"false"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_history</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@history <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"false"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_indexFirst</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@indexFirst <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"true"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_assetPath</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@assetPath <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>instance<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>getApplicationPath()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// preloaderDepth
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@preloaderDepth)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">MIDDLE</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">BOTTOM</span>) <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_preloaderDepth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_preloaderDepth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">TOP</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// preloaderDomain
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@preloaderDomain)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">DOMAIN_CURRENT</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">DOMAIN_NEW</span>) <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_preloaderDomain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_preloaderDomain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">DOMAIN_NULL</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// defaultFlow
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> flow<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_xml</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@flow)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">PRELOAD</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">REVERSE</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">CROSS</span>) <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_defaultFlow</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> flow<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_defaultFlow</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">NORMAL</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_routing</span>) <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_routes</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> {}<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span></span></span></span></pre>
<pre class="textmate-source"><span class="source source_actionscript source_actionscript_3"><span class="meta meta_package meta_package_actionscript meta_package_actionscript_3"><span class="meta meta_class meta_class_actionscript meta_class_actionscript_3"><span class="meta meta_definition meta_definition_method meta_definition_method_actionscript meta_definition_method_actionscript_3"><span class="storage storage_type storage_type_namespace storage_type_namespace_actionscript storage_type_namespace_actionscript_3">private</span> <span class="storage storage_type storage_type_function storage_type_function_actionscript storage_type_function_actionscript_3">function</span> <span class="entity entity_name entity_name_function entity_name_function_actionscript entity_name_function_actionscript_3">parsePage</span><span class="punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_actionscript punctuation_definition_parameters_begin_actionscript_3">(</span><span class="variable variable_paramater variable_paramater_method variable_paramater_method_actionscript variable_paramater_method_actionscript_3">node</span><span class="punctuation punctuation_seperator punctuation_seperator_actionscript punctuation_seperator_actionscript_3">:</span><span class="support support_class support_class_actionscript support_class_actionscript_3">XML</span><span class="punctuation punctuation_separator punctuation_separator_actionscript punctuation_separator_actionscript_3">,</span> <span class="variable variable_paramater variable_paramater_method variable_paramater_method_actionscript variable_paramater_method_actionscript_3">parent</span><span class="punctuation punctuation_seperator punctuation_seperator_actionscript punctuation_seperator_actionscript_3">:</span><span class="support support_class support_class_actionscript support_class_actionscript_3">PageAsset</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="constant constant_language constant_language_null constant_language_null_actionscript constant_language_null_actionscript_3">null</span>)<span class="meta meta_method-return meta_method-return_actionscript meta_method-return_actionscript_3"><span class="punctuation punctuation_seperator punctuation_seperator_return-type punctuation_seperator_return-type_actionscript punctuation_seperator_return-type_actionscript_3">:</span>PageAsset
    </span></span><span class="meta meta_function meta_function_actionscript meta_function_actionscript_3">{
      validateNode(node, <span class="constant constant_language constant_language_boolean constant_language_boolean_true constant_language_boolean_true_actionscript constant_language_boolean_true_actionscript_3">true</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> isIndex<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">Boolean</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_indexID</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span>PageAsset <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="keyword keyword_operator keyword_operator_actionscript keyword_operator_actionscript_3">new</span> PageAsset()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>node <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>src <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>instance<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>getApplicationPath()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">+</span>node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@src<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_flash support_property_flash_actionscript support_property_flash_actionscript_3">bytes</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_flash support_property_flash_actionscript support_property_flash_actionscript_3">bytes</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>assetPath <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> ZincContext<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>instance<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>getApplicationPath()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">+</span>node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@assetPath <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_assetPath</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>

      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>preloadAsset <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_true constant_language_boolean_true_actionscript constant_language_boolean_true_actionscript_3">true</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"true"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&amp;&amp;</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>() <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"about"</span>) GaiaDebug<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_mx support_function_mx_actionscript support_function_mx_actionscript_3">warn</span>(<span class="string string_quoted string_quoted_single string_quoted_single_actionscript string_quoted_single_actionscript_3">'* Warning * "About" is not permitted in Flash context menus'</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">menu</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&amp;&amp;</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">length </span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&gt;</span> <span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">0</span>) <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_menuArray</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">push</span>(page)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>landing <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@landing <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"true"</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// domain
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">DOMAIN_NEW</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">DOMAIN_CURRENT</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">domain</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// depth
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!</span>isIndex)
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>setParent(<span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">parent</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>external <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@src<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">split</span>(<span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"."</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">pop</span>() <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!=</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"swf"</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@src<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">indexOf</span>(<span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"javascript"</span>) <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&gt;</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">-</span><span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">1</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>external) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">window</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">window</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">"_self"</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">TOP</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">BOTTOM</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">NESTED</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">MIDDLE</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span>
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">TOP</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">MIDDLE</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">depth</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">BOTTOM</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// flow
</span>      <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> flow<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span>(node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@flow)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">NORMAL</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">PRELOAD</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">REVERSE</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> Gaia<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="constant constant_language constant_language_conventional constant_language_conventional_actionscript constant_language_conventional_actionscript_3">CROSS</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>flow <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> flow<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// assets
</span>      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>asset<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">length</span>() <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&gt;</span> <span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">0</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@seo <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!=</span> <span class="constant constant_language constant_language_actionscript constant_language_actionscript_3">undefined</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>assets <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> parseAssets(node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>asset, page, node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@seo, <span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">int</span>(node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@seoBytes))<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// child pages
</span>      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">length</span>() <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&gt;</span> <span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">0</span>)
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>defaultChild <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@defaultChild<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">children </span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> parseChildren(page, node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>page)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">!</span>page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">children</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">hasOwnProperty</span>(page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>defaultChild)) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>defaultChild <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">[</span><span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">0</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">]</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@<span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// terminal page
</span>      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">else</span>
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>src<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">substr</span>(page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>src<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">length </span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">-</span> <span class="constant constant_numeric constant_numeric_actionscript constant_numeric_actionscript_3">4</span>) <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">==</span> <span class="string string_quoted string_quoted_double string_quoted_double_actionscript string_quoted_double_actionscript_3">".swf"</span>) page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>landing <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_true constant_language_boolean_true_actionscript constant_language_boolean_true_actionscript_3">true</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (isIndex) GaiaSWFAddress<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>isSinglePage <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_true constant_language_boolean_true_actionscript constant_language_boolean_true_actionscript_3">true</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}
      <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// only add terminal and landing pages to routes
</span>      <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (<span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_routing</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">&amp;&amp;</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>landing)
      {<span class="meta meta_scope meta_scope_block meta_scope_block_actionscript meta_scope_block_actionscript_3">
        <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> route<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">String</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> node<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>@route <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">title</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="keyword keyword_control keyword_control_actionscript keyword_control_actionscript_3">if</span> (isIndex) route <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> route <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">||</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>route <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> getValidRoute(route, page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_property support_property_mx support_property_mx_actionscript support_property_mx_actionscript_3">id</span>)<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span><span class="support support_function support_function_top-level support_function_top-level_actionscript support_function_top-level_actionscript_3">toLowerCase</span>()<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
        <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_routes</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">[</span>page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>route<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">]</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_dot keyword_operator_symbolic_dot_actionscript keyword_operator_symbolic_dot_actionscript_3">.</span>branch<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
      </span>}
      <span class="keyword keyword_control keyword_control_end keyword_control_end_actionscript keyword_control_end_actionscript_3">return</span> page<span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span>
    }</span></span></span></span></pre>
<p>These changes allow you to test your application within the flash authoring environment as the application path will be empty and it will load the files with local references. If you run the application inside a Zinc wrapper the files will be references with an absolute path.</p>
<h2>External Interface calls</h2>
<p>In order for flash applications to communicate with the browser they use External Interface. This is used extensively within the Gaia framework for logging and also search engine optimization with swfAddress. However MDM Zinc does not handle these calls particularly gracefully and as it is not possible to turn this functionality off within the framework we again need to make a couple of modifications.</p>
<h3>Blocking external calls</h3>
<p>Inside SWFAdress.as there is a test for ExternalInterface.available however inside Zinc this will incorrectly report true. The only fix for this is as follows:</p>
<pre class="textmate-source"><span class="source source_actionscript source_actionscript_3"><span class="meta meta_package meta_package_actionscript meta_package_actionscript_3"><span class="meta meta_class meta_class_actionscript meta_class_actionscript_3"><span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">private</span> <span class="storage storage_modifier storage_modifier_actionscript storage_modifier_actionscript_3">static</span> <span class="storage storage_type storage_type_actionscript storage_type_actionscript_3">var</span> <span class="variable variable_language variable_language_private variable_language_private_actionscript variable_language_private_actionscript_3">_availability</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">:</span><span class="support support_type support_type_function support_type_function_global support_type_function_global_actionscript support_type_function_global_actionscript_3">Boolean</span> <span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">=</span> <span class="constant constant_language constant_language_boolean constant_language_boolean_false constant_language_boolean_false_actionscript constant_language_boolean_false_actionscript_3">false</span><span class="keyword keyword_operator keyword_operator_symbolic keyword_operator_symbolic_actionscript keyword_operator_symbolic_actionscript_3">;</span> <span class="comment comment_line comment_line_double-slash comment_line_double-slash_actionscript comment_line_double-slash_actionscript_3">// used to be ExternalInterface.available;</span></span></span></span></pre>
<h2>Conclusion</h2>
<p>The solutions I have proposed here will resolve the issues the prevent you from using Gaia within a Zinc application. However I believe that these issues could be resolved in a number of ways within the respective products.</p>
<p>MDM Zinc need resolve the issue with ExternalInterface and the its incorrect implementation as this is essentially a bug in the platform.</p>
<p>The issues with the Gaia framework can not be considered bugs as the framework does exactly what it was intended to do. However I would suggest that the framework would be greatly improved if additional configuration were made available to users. Being able to turn off the SEO modules such as SWFAddress and external calls would be very helpful. Not only for use within MDM Zinc but also in situations where the flash application is not the entire web page. If you use Gaia to be build a smaller component within a page the SWFAddress calls can also cause problems.</p>
<p>The loading of assets would also be greatly improved if it were possible to update their paths at run time. Obviously this is not a common requirement but it would make the framework much more flexible and far more useful.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash+-+http://tr.im/Bxar&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash&amp;summary=The%20Gaia%20Framework%20for%20Adobe%20Flash%20is%20a%20something%20I%20have%20been%20using%20for%20some%20time.%20It%20is%20one%20of%20the%20most%20useful%20frameworks%20I%20have%20found%20for%20use%20with%20Flash.%20It%20adds%20a%20great%20deal%20of%20useful%20functionality%20and%20can%20generate%20large%20swathes%20of%20source%20code%20that%20you%20would%20otherwise%20need%20to%20write%20from%20scratch.%20&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;t=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/&amp;title=Make+MDM+Zinc+applications+with+the+Gaia+framework+for+Adobe+flash&amp;description=The%20Gaia%20Framework%20for%20Adobe%20Flash%20is%20a%20something%20I%20have%20been%20using%20for%20some%20time.%20It%20is%20one%20of%20the%20most%20useful%20frameworks%20I%20have%20found%20for%20use%20with%20Flash.%20It%20adds%20a%20great%20deal%20of%20useful%20functionality%20and%20can%20generate%20large%20swathes%20of%20source%20code%20that%20you%20would%20otherwise%20need%20to%20write%20from%20scratch.%20" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/vYBVe5dm7wY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/07/make-mdm-zinc-applications-with-the-gaia-framework-for-adobe-flash/</feedburner:origLink></item>
		<item>
		<title>sfPokaYokePlugin symfony Client Side Validation</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/vYQJ1NmfoyU/</link>
		<comments>http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 17:05:28 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[None]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.blog.co.uk/?p=18</guid>
		<description><![CDATA[The sfPokaYokePlugin (pronounced with the &#8216;e&#8217; on the end e.g. poka-yoki). Simply put it is the use of simple mechanisms that stop mistakes being made. sfPokaYoke provides client-side form validation based on existing action.yml validation files. This validator will provide fully configurable inline errors on blur events and listed errors once the form is submitted. [...]]]></description>
			<content:encoded><![CDATA[<p>The <tt>sfPokaYokePlugin</tt> (pronounced with the &#8216;e&#8217; on the end e.g. poka-yoki).  Simply put it is the use of simple mechanisms that stop mistakes being made.   sfPokaYoke provides client-side form validation based on existing <tt>action.yml</tt> validation files.  This validator will provide fully configurable inline errors on blur events and listed errors once the form is submitted.</p>
<p>This plugin was built after reading &#8220;Designing the Obvious&#8221; by Robert Hoekman, jr. and working with a number of unsatisfactory  validation libraries. It is intended that this plugin will allow you to configure the validation and feedback to make your forms poka yoke devices i.e. impossible for users to make any errors while entering data.</p>
<p>Thanks to Alon Noy for a starting point for the validators! The following symfony validators have been ported to JavaScript implemented in the plugin:</p>
<ul>
<li>sfStringValidator</li>
<li>sfNumberValidator</li>
<li>sfRegexValidator</li>
<li>sfEmailValidator</li>
<li>sfCompareValidator</li>
</ul>
<p>I also plan to implement a client side callback validator that will allow you to call your own client side validators or even call ajax function to run server side validation in real time.<span id="more-18"></span></p>
<h2 id="Installation">Installation</h2>
<p>To install the plugin you can either download the latest files from the symfony wiki or you can checkout the SVN version.</p>
<h3>Install the plugin</h3>
<pre class="textmate-source sunburst"><span class="text text_plain"><span class="meta meta_paragraph meta_paragraph_text">symfony plugin-install <span class="markup markup_underline markup_underline_link markup_underline_link_text">http://plugins.symfony-project.com/sfPokaYokePlugin</span></span></span></pre>
<h3>Add the sfPokaYoke filter to your app filters.yml</h3>
<pre class="textmate-source sunburst"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">rendering<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">web_debug<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">security<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~
</span></span>
<span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> generally, you will want to insert your own filters here
</span>
<span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">poka_yoke<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfPokaYokeFilter
</span></span>
<span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">cache<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span>     <span class="string string_unquoted string_unquoted_yaml">~
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">common<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span>    <span class="string string_unquoted string_unquoted_yaml">~
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">flash<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span>     <span class="string string_unquoted string_unquoted_yaml">~
</span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">execution<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~</span></span></span></pre>
<h3>Clear you cache</h3>
<pre class="textmate-source sunburst"><span class="text text_plain"><span class="meta meta_paragraph meta_paragraph_text">symfony cc</span></span></pre>
<p>You&#8217;re done. Any forms that have validation rules will have client-side rules applied too. sfPokaYoke looks for validation rules that match the action name the form will be submitted to. This will also now work with named routes.</p>
<h2>Usage Example</h2>
<p>Once any validation rules are applied to the actions for your form, rules will be created for the client-side validation.</p>
<p>You can configure the client side validation to be triggered on the form submit or when the individual field loses focus. This is done by adding config values to your app.yml and will define how sfPokaYokePlugin responds to the users interaction</p>
<p>If the input value fails any validation rules that error will be inserted next to the input.</p>
<p>You do not need to add any <tt>&lt;div&gt;</tt> tags to capture these in-line errors unless you have a specific location in you form markup where you wish the error to be displayed. sfPokaYoke will look for the symfony form error locations and use those <tt>&lt;div&gt;</tt> tags if available.</p>
<p>If your template includes the following symfony form helper, sfPokaYoke will insert the errors into this location.</p>
<pre class="textmate-source sunburst"><span class="source source_php"><span class="source source_php source_php_embedded source_php_embedded_block source_php_embedded_block_html"><span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_begin punctuation_section_embedded_begin_php">&lt;?php</span> <span class="support support_function support_function_construct support_function_construct_php">echo</span> <span class="meta meta_function-call meta_function-call_php">form_error</span>(<span class="string string_quoted string_quoted_single string_quoted_single_php"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php">'</span><span class="meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php">name</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php">'</span></span>) <span class="punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_end punctuation_section_embedded_end_php"><span class="source source_php">?</span>&gt;</span></span></span></pre>
<p>On form submission a list of all error is inserted as the first child of the form. Each listed error item has an onclick event attached to allow the user to click on the error to focus the form field and resolve the problem.</p>
<pre class="textmate-source sunburst"><span class="text text_html text_html_basic"><span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">pkykGlobalErrors</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>
   <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>globalErrorTitle<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>The following form information has been completed but it contains errors:<span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>
   <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>errors<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">pkykGlobal_username</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>Please enter your username.<span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>
   <span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span> <span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_html">class</span>=<span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span>errors<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span> <span class="meta meta_attribute-with-value meta_attribute-with-value_id meta_attribute-with-value_id_html"><span class="entity entity_other entity_other_attribute-name entity_other_attribute-name_id entity_other_attribute-name_id_html">id</span><span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_html">=</span><span class="string string_quoted string_quoted_double string_quoted_double_html"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_html">"</span><span class="meta meta_toc-list meta_toc-list_id meta_toc-list_id_html">pkykGlobal_password</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_html">"</span></span></span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>Please enter your password.<span class="meta meta_tag meta_tag_inline meta_tag_inline_any meta_tag_inline_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_inline entity_name_tag_inline_any entity_name_tag_inline_any_html">li</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span>
<span class="meta meta_tag meta_tag_block meta_tag_block_any meta_tag_block_any_html"><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_begin punctuation_definition_tag_begin_html">&lt;/</span><span class="entity entity_name entity_name_tag entity_name_tag_block entity_name_tag_block_any entity_name_tag_block_any_html">ul</span><span class="punctuation punctuation_definition punctuation_definition_tag punctuation_definition_tag_end punctuation_definition_tag_end_html">&gt;</span></span></span></pre>
<p>As each input error is corrected by the user the in-line and list errors are removed.</p>
<h2>Example configuration</h2>
<p>The code block below is an example app.yml file entry to configure the interactions of sfPokaYoke</p>
<pre class="textmate-source sunburst"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Example app.yml config for sfPokaYoke
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">pokayoke<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Turn PokaYoke on and off
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">on<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Turn on the debuging this will cause alerts at each validation action
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">debug<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Event hooks - validation called on both field blur and form submit
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">validate_onblur<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">validateon_submit<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true
</span></span>
<span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Define which events should display the inline and global form errors
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">display_inline_onblur<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">display_inline_onsubmit<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">display_global_onblur<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">display_global_onsubmit<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false
</span></span>
<span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Inline error id="error_for(_name)" and class="form_error"
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">inline_id_prefix<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">error_for_
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">inline_class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">form_error
</span></span>
<span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> &amp;lt;li class="form_error"&amp;gt;&amp;lt;/li&amp;gt; the global error lost class
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">global_class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">form_error
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The text used to introduce the global errors list
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">global_title<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_quoted string_quoted_single string_quoted_single_yaml"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_yaml">'</span>The following form information has been completed but it contains errors:<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_yaml">'</span></span>
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">global_titleclass<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">pkyk_global_title
</span></span>
<span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Add an onClick event to the items in the global list - click to focus the field with the error
</span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span><span class="meta meta_even-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">global_onclick_focus<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true;</span></span></span></pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=sfPokaYokePlugin+symfony+Client+Side+Validation+-+http://tr.im/Bx3R&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation&amp;summary=The%20sfPokaYokePlugin%20%28pronounced%20with%20the%20%27e%27%20on%20the%20end%20e.g.%20poka-yoki%29.%20%20Simply%20put%20it%20is%20the%20use%20of%20simple%20mechanisms%20that%20stop%20mistakes%20being%20made.%20%20%20sfPokaYoke%20provides%20client-side%20form%20validation%20based%20on%20existing%20action.yml%20validation%20files.%20%20This%20validator%20will%20provide%20fully%20configurable%20inl&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;t=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/&amp;title=sfPokaYokePlugin+symfony+Client+Side+Validation&amp;description=The%20sfPokaYokePlugin%20%28pronounced%20with%20the%20%27e%27%20on%20the%20end%20e.g.%20poka-yoki%29.%20%20Simply%20put%20it%20is%20the%20use%20of%20simple%20mechanisms%20that%20stop%20mistakes%20being%20made.%20%20%20sfPokaYoke%20provides%20client-side%20form%20validation%20based%20on%20existing%20action.yml%20validation%20files.%20%20This%20validator%20will%20provide%20fully%20configurable%20inl" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/vYQJ1NmfoyU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/01/sfpokayokeplugin-symfony-client-side-validation/</feedburner:origLink></item>
		<item>
		<title>Hello world!</title>
		<link>http://feedproxy.google.com/~r/designdisclosure/~3/Wvf8kHvvYbQ/</link>
		<comments>http://www.designdisclosure.com/2009/01/hello-world/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 04:07:07 +0000</pubDate>
		<dc:creator>Alistair Stead</dc:creator>
				<category><![CDATA[None]]></category>

		<guid isPermaLink="false">http://www.blog.co.uk/?p=1</guid>
		<description><![CDATA[Welcome to yet another wordpress blog. I have spent the last few months trying to complete my symflex cms project but have just not had the time to complete it. So rather than wait any longer and continue to delay my foray into the world of blog writing I have quickly uploaded wordpress and following [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to yet another wordpress blog. I have spent the last few months trying to complete my <a title="symflex cms" href="http://www.symflex.co.uk">symflex</a> cms project but have just not had the time to complete it. So rather than wait any longer and continue to delay my foray into the world of blog writing I have quickly uploaded wordpress and following the 5 minute install guide it is completely up and running.So here we are, yet another blog, yet another developer with something to say? Well I hope that a some point I write something that will be of use to someone. Here is a sneak peak at what I hope to write about over the next few posts.</p>
<ul>
<li> PokaYoke &#8211; one of my contributions to the <a title="symfony project" href="http://www.symfony-project.com">symfony</a> framework. Client side validation component that integrates with the symfony framework or that can equally well be used with any project that requires simple and very configurable clientside validation.</li>
<li>Eclipse PDT &#8211; setting up the ideal combination of eclipse plugins for web development</li>
<li>Parallels Virtual Appliance &#8211; setting up a Fedora based virtual machine to use as your development machine.</li>
</ul>
<p>So there you have it. Welcome to my blog and feel free to pass judgment</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-enjoy">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Hello+world%21+-+http://tr.im/BKM2&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.designdisclosure.com/2009/01/hello-world/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.designdisclosure.com/2009/01/hello-world/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21&amp;summary=Welcome%20to%20yet%20another%20wordpress%20blog.%20I%20have%20spent%20the%20last%20few%20months%20trying%20to%20complete%20my%20symflex%20cms%20project%20but%20have%20just%20not%20had%20the%20time%20to%20complete%20it.%20So%20rather%20than%20wait%20any%20longer%20and%20continue%20to%20delay%20my%20foray%20into%20the%20world%20of%20blog%20writing%20I%20have%20quickly%20uploaded%20wordpress%20and%20followin&amp;source=Design Disclosure - Portfolio &amp; Personal Blog of Alistair Stead" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-googlebookmarks">
			<a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21" rel="nofollow" class="external" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.designdisclosure.com/2009/01/hello-world/&amp;t=Hello+world%21" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.designdisclosure.com/2009/01/hello-world/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-dzone">
			<a href="http://www.dzone.com/links/add.html?url=http://www.designdisclosure.com/2009/01/hello-world/&amp;title=Hello+world%21&amp;description=Welcome%20to%20yet%20another%20wordpress%20blog.%20I%20have%20spent%20the%20last%20few%20months%20trying%20to%20complete%20my%20symflex%20cms%20project%20but%20have%20just%20not%20had%20the%20time%20to%20complete%20it.%20So%20rather%20than%20wait%20any%20longer%20and%20continue%20to%20delay%20my%20foray%20into%20the%20world%20of%20blog%20writing%20I%20have%20quickly%20uploaded%20wordpress%20and%20followin" rel="nofollow" class="external" title="Add this to DZone">Add this to DZone</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

<h3  class="related_post_title">Related Articles</h3><ul class="related_post"><li>No Related Post</li></ul><img src="http://feeds.feedburner.com/~r/designdisclosure/~4/Wvf8kHvvYbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.designdisclosure.com/2009/01/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.designdisclosure.com/2009/01/hello-world/</feedburner:origLink></item>
	</channel>
</rss>
