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

<channel>
	<title>The UcompOS Rich Experience Framework</title>
	<atom:link href="http://blog.ucompass.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.ucompass.com</link>
	<description>Introducing developers to a new paradigm in the development of rich internet applications and its supporting tools</description>
	<lastBuildDate>Tue, 18 May 2010 12:15:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>UcompOS Rich Experience Framework is Now in Beta</title>
		<link>http://blog.ucompass.com/?p=503</link>
		<comments>http://blog.ucompass.com/?p=503#comments</comments>
		<pubDate>Tue, 18 May 2010 12:15:47 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOS Project Site]]></category>
		<category><![CDATA[UcompOS SDK]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=503</guid>
		<description><![CDATA[Over the last 6 weeks, we have been diligently working to move the UcompOS RXF project from Alpha to Beta and as of this morning, that effort has come to completion.
There are numerous enhancements and bug fixes that are introduced into the Beta release.  Also, we are compiling the project against the Adobe Flex [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last 6 weeks, we have been diligently working to move the UcompOS RXF project from Alpha to Beta and as of this morning, that effort has come to completion.</p>
<p>There are numerous enhancements and bug fixes that are introduced into the Beta release.  Also, we are compiling the project against the Adobe Flex 4.1 SDK nightly builds.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=503</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some UcompOSStyleProxy Basics</title>
		<link>http://blog.ucompass.com/?p=488</link>
		<comments>http://blog.ucompass.com/?p=488#comments</comments>
		<pubDate>Mon, 26 Apr 2010 19:38:04 +0000</pubDate>
		<dc:creator>Tom Petz</dc:creator>
				<category><![CDATA[UcompOS HTML Applications]]></category>
		<category><![CDATA[UcompOSStyleProxy]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=488</guid>
		<description><![CDATA[If you are a regular reader of this blog, you know that a lot of blogs have been dedicated to talking about the UcompOS Proxy components.  However, one component that hasn&#8217;t received a lot of attention so far is the UcompOSStyleProxy.
The UcompOSStyleProxy provides a means to manage the style properties of the UcompOS Main Container.  [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a regular reader of this blog, you know that a lot of blogs have been dedicated to talking about the UcompOS Proxy components.  However, one component that hasn&#8217;t received a lot of attention so far is the <strong>UcompOSStyleProxy</strong>.</p>
<p>The UcompOSStyleProxy provides a means to manage the style properties of the UcompOS Main Container.  For instance, you can use the UcompOSStyleProxy to override the default background image on the UcompOS Main Container or set fade in\out duration effects on UcompOSWindowProxy instances.</p>
<p>To demonstrate the two behaviors above, let&#8217;s take a look at a simple UcompOSStyleProxy code example.  First, in my UcompOS instance, I have created a simple HTML application called styler.html that is loaded as a background application by my dockManifest.xml file.  The code in my styler.html application is fairly simple and easy to follow as evidenced by the following sample code:</p>
<p>&lt;HTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;SCRIPT TYPE=&#8221;text/javascript&#8221; SRC=&#8221;/UcompOSSDK.js&#8221;&gt;&lt;/SCRIPT&gt;<br />
&lt;SCRIPT TYPE=&#8221;text/javascript&#8221;&gt;</p>
<p>//instantiate the UCompOSSDK<br />
function start()<br />
{</p>
<p>//instantiate a UcompOSStyleProxy instance that we can apply styles to<br />
var styler = new UcompOSStyleProxy();</p>
<p>//set the default background image to Picture1.jpg at the correct file path on the server<br />
styler.setBackgroundImage(&#8220;/applications/Picture1.jpg&#8221;);</p>
<p>//now, set the UcompOSWindowProxy instances to fade in\out 3 seconds<br />
styler.setWindowFadeInDuration(3000);<br />
styler.setWindowFadeOutDuration(3000);</p>
<p>}</p>
<p>&lt;/SCRIPT&gt;<br />
&lt;/HEAD&gt;<br />
&lt;/HTML&gt;</p>
<p>Hopefully, this example is simple enough to follow along with fairly easily; the mechanics involved are designed to be as straightforward as possible.  However, one could easily envision scenarios where a user&#8217;s preferences are saved in a database and loaded at run-time by turning styler.html into a scripted application using PHP, PERL, or the language of your choice.  Or, perhaps you may look at setting and <a href="http://blog.ucompass.com/?p=460">instantiating style properties at startup</a> using your dockManifest. The choice is up to you!</p>
<p>Note also that it is also possible, for example, to change the color of text on the menu bar by using some code like (using our example above):</p>
<p>styler.setStyle(&#8220;.MenuBar&#8221;,&#8221;color&#8221;,0&#215;0000FF);</p>
<p>You will want to keep in mind, though, that it is likely that the UcompOSStyleProxy class will continue to evolve in such a way that setting styles in this manner may not work in the future.  Therefore, this practice is not recommended at this time.  However, you will want to stay tuned to the updates that are made to this class as the UcompOS SDK continues to mature over the coming months.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=488</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An MXML Image Component That Loads Images With No Associated Policy Files</title>
		<link>http://blog.ucompass.com/?p=483</link>
		<comments>http://blog.ucompass.com/?p=483#comments</comments>
		<pubDate>Mon, 05 Apr 2010 13:01:14 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=483</guid>
		<description><![CDATA[In a major UcompOS project I am working on, I am finding the need more and more to load images from various different servers where the destination servers often have no crossdomain.xml policy file.
I don&#8217;t want to use a back-end proxy to deal with this as that would be chewing up my back-end resources and [...]]]></description>
			<content:encoded><![CDATA[<p>In a major UcompOS project I am working on, I am finding the need more and more to load images from various different servers where the destination servers often have no crossdomain.xml policy file.</p>
<p>I don&#8217;t want to use a back-end proxy to deal with this as that would be chewing up my back-end resources and bandwidth which goes against my grain especially when targeting a product for wide deployment.</p>
<p>I will post the code of the component below which should be very self-explanatory:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;?</span>xml version<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;1.0&quot;</span> encoding<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;utf-8&quot;</span><span style="color: #006600; font-weight: bold;">?&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;</span>mx<span style="color: #006600; font-weight: bold;">:</span>Image xmlns<span style="color: #006600; font-weight: bold;">:</span>fx<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span> 
		  xmlns<span style="color: #006600; font-weight: bold;">:</span>s<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span> 
		  xmlns<span style="color: #006600; font-weight: bold;">:</span>mx<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span> 
		  securityError<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;securityErrorHandler(event)&quot;</span> 
		  trustContent<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;true&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>fx<span style="color: #006600; font-weight: bold;">:</span>Script<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;!</span><span style="color: #006600; font-weight:bold;">&#91;</span>CDATA<span style="color: #006600; font-weight:bold;">&#91;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">var</span> _legal<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">true</span><span style="color: #006600; font-weight: bold;">;</span> 
			<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">var</span> _url<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> <span style="color: #990099; font-weight: bold;">get</span> legal<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span>
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				return _legal<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> securityErrorHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SecurityErrorEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				this.<span style="color: #9900cc;">removeEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>SecurityErrorEvent.<span style="color: #9900cc;">SECURITY_ERROR</span>,securityErrorHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				_legal <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">false</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> sprite<span style="color: #006600; font-weight: bold;">:</span>Sprite <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> Sprite<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> loader<span style="color: #006600; font-weight: bold;">:</span>Loader <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> Loader<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				loader.<span style="color: #9900cc;">contentLoaderInfo</span>.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>Event.<span style="color: #9900cc;">COMPLETE</span>,load_handler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				sprite.<span style="color: #9900cc;">addChild</span><span style="color: #006600; font-weight:bold;">&#40;</span>loader<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> loaderContext<span style="color: #006600; font-weight: bold;">:</span>LoaderContext <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> LoaderContext<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				loaderContext.<span style="color: #9900cc;">checkPolicyFile</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">false</span><span style="color: #006600; font-weight: bold;">;</span>
				loader.<span style="color: #9900cc;">load</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #0000ff; font-weight: bold;">new</span> URLRequest<span style="color: #006600; font-weight:bold;">&#40;</span>url<span style="color: #006600; font-weight:bold;">&#41;</span>,loaderContext<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> load_handler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>Event<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> loaderInfo<span style="color: #006600; font-weight: bold;">:</span>LoaderInfo <span style="color: #006600; font-weight: bold;">=</span> event.<span style="color: #9900cc;">target</span> <span style="color: #330066;">as</span> LoaderInfo<span style="color: #006600; font-weight: bold;">;</span>
				loaderInfo.<span style="color: #9900cc;">removeEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>Event.<span style="color: #9900cc;">COMPLETE</span>,load_handler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> bitmapData<span style="color: #006600; font-weight: bold;">:</span>BitmapData <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> BitmapData<span style="color: #006600; font-weight:bold;">&#40;</span>loaderInfo.<span style="color: #9900cc;">width</span>,loaderInfo.<span style="color: #9900cc;">height</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> matrix<span style="color: #006600; font-weight: bold;">:</span>Matrix <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> Matrix<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				bitmapData.<span style="color: #9900cc;">draw</span><span style="color: #006600; font-weight:bold;">&#40;</span>loaderInfo.<span style="color: #9900cc;">content</span>,matrix<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #0000ff; font-weight: bold;">var</span> bitmap<span style="color: #006600; font-weight: bold;">:</span>Bitmap <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> Bitmap<span style="color: #006600; font-weight:bold;">&#40;</span>bitmapData<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				source <span style="color: #006600; font-weight: bold;">=</span> bitmap<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> <span style="color: #990099; font-weight: bold;">get</span> url<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span>
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				return _url<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
			<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> <span style="color: #990099; font-weight: bold;">set</span> url<span style="color: #006600; font-weight:bold;">&#40;</span>value<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				loaderContext <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> LoaderContext<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #0000ff; font-weight: bold;">false</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
				_url <span style="color: #006600; font-weight: bold;">=</span> value<span style="color: #006600; font-weight: bold;">;</span>
				source <span style="color: #006600; font-weight: bold;">=</span> value<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
		<span style="color: #006600; font-weight:bold;">&#93;</span><span style="color: #006600; font-weight:bold;">&#93;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;/</span>fx<span style="color: #006600; font-weight: bold;">:</span>Script<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>mx<span style="color: #006600; font-weight: bold;">:</span>Image<span style="color: #006600; font-weight: bold;">&gt;</span></pre></div></div>

<p>Some things to point out about the component in no particular order:</p>
<ul>
<li/> You set a value of a URL to the image to the <i>url</i> property instead of the <i>source</i> property
<li/> A Boolean named <i>legal</i> has a <i>false</i> value if the content of the image was loaded using an assisting Sprite and Loader instance
<li/> The <i>source</i> property on an Image control is of a wildcard (*) type &#8211; if the value of <i>legal</i> is <i>true</i>, then <i>source</i> is a <i>String</i> and will have the same value as <i>url</i>.  If the value of <i>legal</i> is <i>false</i>, then <i>source</i> will be an Object of type <i>Bitmap</i>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=483</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Garbage Collection in the UcompOS RXF</title>
		<link>http://blog.ucompass.com/?p=477</link>
		<comments>http://blog.ucompass.com/?p=477#comments</comments>
		<pubDate>Mon, 29 Mar 2010 13:12:47 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[AbstractProxyComponent]]></category>
		<category><![CDATA[Event Architecture]]></category>
		<category><![CDATA[UcompOS Architecture]]></category>
		<category><![CDATA[UcompOSArtifactProxy]]></category>
		<category><![CDATA[UcompOSBrowserWindowProxy]]></category>
		<category><![CDATA[UcompOSDialogueProxy]]></category>
		<category><![CDATA[UcompOSWindowProxy]]></category>
		<category><![CDATA[Garbage Collection]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=477</guid>
		<description><![CDATA[ In large and sophisticated Flash-based applications, such as the Rich Portal Applications you develop with the UcompOS Rich Experience Framework, Garbage Collection becomes an increasingly important consideration.
Garbage Collection is a computer science concept that deals with memory management and re-allocating memory occupied by objects that are no longer needed or in use by the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.ucompass.com/wp-content/uploads/2010/03/OscarTheGrouch.png"><img class="alignleft size-full wp-image-478" title="OscarTheGrouch" src="http://blog.ucompass.com/wp-content/uploads/2010/03/OscarTheGrouch.png" alt="OscarTheGrouch" width="200" height="218" /></a> In large and sophisticated Flash-based applications, such as the Rich Portal Applications you develop with the UcompOS Rich Experience Framework, <a href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29" target="new">Garbage Collection</a> becomes an increasingly important consideration.</p>
<p>Garbage Collection is a computer science concept that deals with memory management and re-allocating memory occupied by objects that are no longer needed or in use by the computer program.</p>
<p>Garbage Collection in a large-scale event-driven Flash architecture is a crucial consideration and unfortunately, can also be a tedious proposition to properly implement.</p>
<p>One of the more important considerations in aiding with Garbage Collection in Flash-based application is <strong>proper management of event listeners</strong>.</p>
<p>In a best-practice implementation, any call to <em>addEventListener()</em> would be followed up with a call to <em>removeEventListener()</em> once the event listener was no longer needed.  Event listeners perpetuate the objects they are associated with so even once a particular object is destroyed, that doesn&#8217;t necessarily mean any event listeners associated with it will be destroyed too.</p>
<p>Failure to remove event listeners once they are no longer needed in a large-scale implementation can cause memory leaks and performance can break down over time.</p>
<p>In all your Flash applications, you should employ this strategy when and where possible.</p>
<p>In a typical large-scale UcompOS RXF implementation, Flash-based applications and sub-applications are continuously being loaded and unloaded into the UcompOS Portal.</p>
<p>The concept of Proxy Components in the UcompOS RXF involves event listeners being attached to a Proxy Component in one entity that represents an object in another UcompOS entity and then listening for dispatched events.</p>
<p>Therefore, the concept of garbage collection takes on especially critical importance in the UcompOS RXF because if UcompOS applications are being loaded and unloaded constantly and the event listeners that are attached to them are not being properly removed, performance would become an issue in a large-scale implementation.</p>
<p>The UcompOS Portal has been designed such that when SWF content that has been loaded into the UcompOS Portal is unloaded, a garbage collection routine is implemented to try to optimize system performance. (The three ways SWF content is loaded into the UcompOS Portal is in UcompOS Window instances, UcompOS Artifact instances, or into the UcompOS run-time.)</p>
<p>As of the UcompOS RXF Public Alpha release 0.4.6, some additional enhancements to the garbage collection process have been implemented that I will discuss here.</p>
<p>Understanding the UcompOS RXF garbage collection architecture can help you build more scalable Rich Portal Applications.</p>
<p>The recent enhancements come in the realm of Proxy Components.</p>
<p>By strict convention, all Proxy Components must extend the SDK class <em>AbstractProxyComponent</em>.  As of UcompOS RXF 0.4.6, <em>AbstractProxyComponent</em> now extends a new SDK class called <em>SDKEventDispatcher</em> which extends <em>EventDispatcher</em>.</p>
<p>(Also, as a side-note, the <em>AbstractProxyComponent</em> class now implements <em>IEventDispatcher</em> in addition to <em>IProxyComponent</em> so you can refer to your Proxy Components as <em>IEventDispatcher</em> or <em>IProxyComponent</em> instances interchangably.)</p>
<p><em>SDKEventDispatcher</em> simply overrides <em>addEventListener()</em> and offers a <em>protected</em> property _<em>listeners</em> of type <em>Array</em>.</p>
<p>I chose to create this separate class versus simply overriding <em>addEventListener()</em> in <em>AbstractProxyComponent</em> so that in the event the new clean-up process employed can be useful outside the scope of a Proxy Component, one could simply extend <em>SDKEventDispatcher</em> versus <em>EventDispatcher</em>.</p>
<p>Here is the over-ridden <em>addEventListener()</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">override <span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> addEventListener<span style="color: #006600; font-weight:bold;">&#40;</span>type<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span>, listener<span style="color: #006600; font-weight: bold;">:</span><span style="color: #0000ff; font-weight: bold;">Function</span>, useCapture<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">false</span>, priority<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">int</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">0</span>, useWeakReference<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">false</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
<span style="color: #006600; font-weight:bold;">&#123;</span>
	_listeners.<span style="color: #9900cc;">push</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#123;</span>type<span style="color: #006600; font-weight: bold;">:</span>type,listener<span style="color: #006600; font-weight: bold;">:</span>listener<span style="color: #006600; font-weight:bold;">&#125;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	super.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>type,listener,useCapture,priority,<span style="color: #0000ff; font-weight: bold;">true</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Notice that I am always assigning a true value to the <em>useWeakReference</em> parameter in the super call to <em>addEventListener()</em>.  This is because in the context of attaching event listeners to Proxy Components, you always would want them to be weak references to aid in garbage collection.</p>
<p>In <em>AbstractProxyComponent</em>, there is a new <em>protected</em> method, <em>cleanup()</em> which is as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">protected <span style="color: #0000ff; font-weight: bold;">function</span> cleanup<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
<span style="color: #006600; font-weight:bold;">&#123;</span>
	<span style="color: #990099; font-weight: bold;">while</span><span style="color: #006600; font-weight:bold;">&#40;</span>_listeners.<span style="color: #9900cc;">length</span><span style="color: #006600; font-weight:bold;">&#41;</span>
	<span style="color: #006600; font-weight:bold;">&#123;</span>
		<span style="color: #0000ff; font-weight: bold;">var</span> object<span style="color: #006600; font-weight: bold;">:</span>Object <span style="color: #006600; font-weight: bold;">=</span> _listeners.<span style="color: #9900cc;">pop</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		removeEventListener<span style="color: #006600; font-weight:bold;">&#40;</span>object.<span style="color: #9900cc;">type</span>,object.<span style="color: #9900cc;">listener</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #006600; font-weight:bold;">&#125;</span>
	_sdkModel.<span style="color: #9900cc;">removeProxyComponent</span><span style="color: #006600; font-weight:bold;">&#40;</span>this.<span style="color: #9900cc;">uuid</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #0000ff; font-weight: bold;">var</span> commandObject<span style="color: #006600; font-weight: bold;">:</span>CommandObject <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> CommandObject<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;SDK.cleanup&quot;</span>,<span style="color: #006600; font-weight:bold;">&#123;</span>uuid<span style="color: #006600; font-weight: bold;">:</span>this.<span style="color: #9900cc;">uuid</span><span style="color: #006600; font-weight:bold;">&#125;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #0000ff; font-weight: bold;">var</span> dataPackage<span style="color: #006600; font-weight: bold;">:</span>DataPackage <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> DataPackage<span style="color: #006600; font-weight:bold;">&#40;</span>Utilities.<span style="color: #9900cc;">createUID</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>,_sdkModel.<span style="color: #9900cc;">connectionId</span>,this.<span style="color: #9900cc;">destination</span>,commandObject<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
	_sdkClient.<span style="color: #330066;">send</span><span style="color: #006600; font-weight:bold;">&#40;</span>dataPackage<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>What the <em>cleanup()</em> method does is it automatically removes any event listeners that have been attached to the Proxy Component.</p>
<p>It also sends a message to the end-point of the Proxy Component targeting its <em>SDK.cleanup</em> public API method that is built into the UcompOS SDK and therefore exposed by any UcompOS entity.  This aids in UcompOS RXF garbage collection-related activities.</p>
<p>Calls to <em>cleanup()</em> do not occur automatically.</p>
<p>When you would call <em>cleanup()</em> in a Proxy Component would be an implementation specific consideration.</p>
<p>For instance, with these new capabilities, I have updated some of the UcompOS Portal Proxy Components that are built into the UcompOS SDK.</p>
<p>Consider the updated constructor of the <em>UcompOSWindowProxy</em> class:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> UcompOSWindowProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
<span style="color: #006600; font-weight:bold;">&#123;</span>
	super<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #ff6600;">// set the destination property to the UcompOS Portal</span>
	super._destination <span style="color: #006600; font-weight: bold;">=</span> _sdkModel.<span style="color: #9900cc;">root</span><span style="color: #006600; font-weight: bold;">;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>strong<span style="color: #006600; font-weight: bold;">&gt;</span>addEventListener<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #330066;">CLOSE</span>,cleanup<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;&lt;/</span>strong<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>The call to <em>addEventListener(CLOSE,cleanup)</em> is the new addition to the constructor.</p>
<p>What it does is it causes the inherited <em>cleanup()</em> method to always be called when the UcompOS Window instance on the UcompOS Portal that is represented by the <em>UcompOSWindowProxy</em> instance is closed.</p>
<p>Therefore, any event listeners you have attached to the <em>UcompOSWindowProxy</em> instance are automatically removed whenever the window is closed.</p>
<p>In 100% of the possible use cases for the <em>UcompOSWindowProxy</em>, this is the desired behavior.</p>
<p>The net result of this is you don&#8217;t have to worry about making your own calls to <em>removeEventListener()</em> for your particular <em>UcompOSWindowProxy</em> instances.</p>
<p>The same sort of behavior has been engineered into some of the other Proxy Components built into the UcompOS SDK including <em>UcompOSAlertProxy</em>, <em>UcompOSDialogueProxy</em>, <em>UcompOSArtifactProxy</em>, and <em>UcompOSBrowserWindowProxy</em>.</p>
<p>Consider this strategy when you are building your own Proxy Components and remember to always use <em>removeEventListener()</em> in all your other Flash applications whether you are deploying them in the UcompOS Portal or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=477</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-Updating the UcompOS Portal</title>
		<link>http://blog.ucompass.com/?p=472</link>
		<comments>http://blog.ucompass.com/?p=472#comments</comments>
		<pubDate>Wed, 24 Mar 2010 12:18:05 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOS Portal]]></category>
		<category><![CDATA[Auto-Updates]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=472</guid>
		<description><![CDATA[As you know, at the Downloads portion of the UcompOS Project site, you can download the UcompOS Developers Package which contains the UcompOS Portal run-time, as well as the UcompOS SDK for JavaScript, Flash/Flex, and AIR 2.0.
This enables you to host a full UcompOS implementation on your local workstation for testing and development, or to [...]]]></description>
			<content:encoded><![CDATA[<p>As you know, at the <a href="http://blog.ucompass.com/?page_id=38" target="_blank">Downloads</a> portion of the UcompOS Project site, you can download the UcompOS Developers Package which contains the UcompOS Portal run-time, as well as the UcompOS SDK for JavaScript, Flash/Flex, and AIR 2.0.</p>
<p>This enables you to host a full UcompOS implementation on your local workstation for testing and development, or to host a public UcompOS implementation from your own webservers.</p>
<p>With the UcompOS project being updated frequently, the physical process of updating the UcompOS RXF and its associated components can be tedious.</p>
<p>There are ways you can automate the process, but it requires some simple scripting that can be accomplished in a variety of languages.</p>
<p>There are some static URLs to know about first of all.</p>
<p>The latest release of the UcompOS Developers package is always found at a URL of <strong>http://ucompos.ucompass.com/UcompOS.zip</strong>.  That zip package expands into a folder named bin-release and within that folder are the contents of the UcompOS Portal.  Also inside that folder is a file <em>UcompOSSDK.zip</em> which expands into an <em>sdk</em> folder, inside of which are an <em>html</em>, <em>air</em>, and <em>flashOrFlex</em> folder with each of the three respective SDKs for those different platforms.</p>
<p>In my current large scale UcompOS implementation, what I am doing is setting it up so that I have one and only one copy of the different SDK files  &#8211; <em>UcompOSSDK.swc</em> (Flash/Flex), <em>UcompOSSDKAIR.swc</em> (AIR), and <em>UcompOSSDK.js</em> and <em>UcompOSSDK.swf</em> (JavaScript).</p>
<p>I then establish relative symlinks to the various locations on my local file system where those files need to be placed &#8211; libs folders in Flex projects and root webserver paths for JavaScript applications.  For Flash applications I simply embed the <em>UcompOSSDK.swc</em> file from the singular location where the file exists on my workstation.</p>
<p>As far as updating the UcompOS Portal, the developers package bin-release folder contains a simple XML file named <em>release.xml</em>.</p>
<p>This is what the current one looks like as of this morning:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;release<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.4.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;packaged<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tue Mar 23 08:47:44 2010<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/packaged<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portal<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sdk<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0.4.5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;packaged<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tue Mar 23 02:02:53 2010<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/packaged<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sdk<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/release<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Also, a file exists at the URL <strong>http://ucompos.ucompass.com/release.xml</strong> of the same format which you can test against to determine if you are running the same version of the UcompOS Portal or if there is an update available.</p>
<p>Note there IS an <a href="http://blog.ucompass.com/?page_id=120" target="new">SVN Repository</a> for the UcompOS Project but at this time it is just meant as a means to distribute the UcompOS SDK source code.  Eventually, I plan to make all of the UcompOS RXF project open source and there will be a model for accessing the full source code of all the associated UcompOS technologies and you&#8217;d be able to structure your updates according to check-outs from SVN.  (My timeline for this by the way is to coincide the open-sourcing of the UcompOS Portal with the production 1.0 release of the UcompOS RXF which I am trying to coincide with Adobe MAX 2010 in October).</p>
<p>In the meantime, there are still a number of simple ways you can go about coordinating an auto-update.</p>
<p>Below is a very simple PERL script I wrote that auto-updates the UcompOS Portal in my Educator 2 project:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/local/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">Simple</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">LibXML</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$myVersion</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!-</span>e <span style="color: #ff0000;">&quot;../../frontend/release.xml&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #0000ff;">$myVersion</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;../../frontend/release.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@line</span> <span style="color: #339933;">=</span> <span style="color: #009999;">&lt;FILE&gt;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$myReleaseInfo</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">@line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$myVersion</span> <span style="color: #339933;">=</span> getVersion<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$myReleaseInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$latestVersion</span> <span style="color: #339933;">=</span> getVersion<span style="color: #009900;">&#40;</span>get<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;http://ucompos.ucompass.com/release.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$myVersion</span> <span style="color: #b1b100;">ne</span> <span style="color: #0000ff;">$latestVersion</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	update<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> getTextNode <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$thisNode</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@thisChild</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$thisNode</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">getChildNodes</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$textNode</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">eval</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #0000ff;">$textNode</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$thisChild</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">getNodeValue</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #0000ff;">$textNode</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">eval</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #0000ff;">$textNode</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$thisChild</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">nodeValue</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066;">return</span> <span style="color: #0000ff;">$textNode</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> getVersion
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$releaseInfo</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$_</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$xml</span> <span style="color: #339933;">=</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">LibXML</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">parse_string</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$releaseInfo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$xp</span> <span style="color: #339933;">=</span> XML<span style="color: #339933;">::</span><span style="color: #006600;">LibXML</span><span style="color: #339933;">::</span><span style="color: #006600;">XPathContext</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@nodeSet</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$xp</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">findnodes</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'//portal/version'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$version</span> <span style="color: #339933;">=</span> getTextNode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$nodeSet</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">return</span> <span style="color: #0000ff;">$version</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> update
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000066;">chdir</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'cache'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$content</span> <span style="color: #339933;">=</span> get<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;http://ucompos.ucompass.com/UcompOS.zip&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;&gt;UcompOS.zip&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">print</span> FILE <span style="color: #0000ff;">$content</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FILE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;unzip -qq 'UcompOS.zip'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;UcompOS.zip&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;rsync -a --delete --exclude=<span style="color: #000099; font-weight: bold;">\&quot;</span>LocalLib.js<span style="color: #000099; font-weight: bold;">\&quot;</span> --exclude=<span style="color: #000099; font-weight: bold;">\&quot;</span>styles.css<span style="color: #000099; font-weight: bold;">\&quot;</span> bin-release ../../../frontend&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">system</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>rm -rf bin-release&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In my example above, I basically have my UcompOS Portal code housed in a <em>bin-release</em> folder.  I check the latest release version and see if it matches my local version, and if it doesn&#8217;t, I retrieve the latest package, unzip it, and overwrite my existing copy with rsync excluding the <em>LocalLib.js</em> and <em>styles.css</em> files &#8211; which are the only files in the UcompOS Developers package you would typically need to update with your own implementation specific information.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=472</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Application Manifests Inside the Dock Manifest</title>
		<link>http://blog.ucompass.com/?p=466</link>
		<comments>http://blog.ucompass.com/?p=466#comments</comments>
		<pubDate>Wed, 24 Mar 2010 11:59:13 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[Application Manifests]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=466</guid>
		<description><![CDATA[As of UcompOS RXF build 0.4.3, you can now embed Application Manifests inside of your Dock Manifest.
The  element of a Dock Manifest houses child  elements, each of which point to the unique URL of a UcompOS Application Manifest file as shown in the following example:

&#60;applications&#62;
     &#60;application&#62;http://applications.ucompass.com/myApplication.xml&#60;/applications&#62;
&#60;/applications&#62;

Now, you can embed [...]]]></description>
			<content:encoded><![CDATA[<p>As of UcompOS RXF build 0.4.3, you can now embed Application Manifests inside of your Dock Manifest.</p>
<p>The <applications/> element of a Dock Manifest houses child <application/> elements, each of which point to the unique URL of a UcompOS Application Manifest file as shown in the following example:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://applications.ucompass.com/myApplication.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now, you can embed a <manifest/> element inside of an <application/> element in the dock manifest and include the full application manifest inside the <manifest/> element as shown in the following simple example:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifestURL<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://applications.ucompass.com/myApplication.xml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/manifestURL<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;base<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://applications.ucompass.com/mySource.swf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/base<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
             <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;manifest<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Notice you also need to articulate a unique URL for the manifest file in a <manifestURL/> element &#8211; even if there is nothing at the indicated URL.</p>
<p>Also, the <em>UcompOSGlobalManagerProxy</em>&#8217;s <em>launchApplication()</em> method now accepts an optional third manifest parameter of type <em>XML</em> that can be a dynamically generated application manifest.</p>
<p>Therefore, the possibility to generate UcompOS applications on the fly exists.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=466</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instantiating UcompOS Global (Continuum) Variables at Startup</title>
		<link>http://blog.ucompass.com/?p=460</link>
		<comments>http://blog.ucompass.com/?p=460#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:28:50 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOS Portal]]></category>
		<category><![CDATA[UcompOSGlobalManagerProxy]]></category>
		<category><![CDATA[Shared Objects]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=460</guid>
		<description><![CDATA[In my post about UcompOS Shared Objects, I described how the UcompOS Portal furnishes a Shared Object Implementation that can be written to and read by any UcompOS entity in the UcompOS Continuum.
In a large-scale UcompOS Rich Portal Application, you very likely may find a need to share complex data across multiple UcompOS entities.
One effective [...]]]></description>
			<content:encoded><![CDATA[<p>In my post about <a href="http://blog.ucompass.com/?p=342" target="_blank">UcompOS Shared Objects</a>, I described how the UcompOS Portal furnishes a <strong>Shared Object Implementation</strong> that can be written to and read by any UcompOS entity in the UcompOS Continuum.</p>
<p>In a large-scale UcompOS Rich Portal Application, you very likely may find a need to share complex data across multiple UcompOS entities.</p>
<p>One effective approach to this challenge is to use the <em>UcompOSGlobalManagerProxy</em> class&#8217;s <em>setSharedObject()</em>, <em>getSharedObject()</em>, and <em>getSharedObjects() </em>methods.</p>
<p>These methods get/set shared objects on the UcompOS Portal at run-time.</p>
<p>But what if you want to populate the UcompOS Portal&#8217;s shared Object at start-up even before any UcompOS applications are launched?</p>
<p>As of the version 0.4.1 Milestone release of UcompOS RXF, there is a way to do this.</p>
<p>The key is a new &lt;globalVariables/&gt; element that can be added as a child element to the root &lt;applications/&gt; element in a dock manifest and as a child element to the root &lt;application/&gt; element in a UcompOS application manifest.</p>
<p>Below is a simple example of this in action in the dock manifest of my Educator 2 software application being built entirely on top of the UcompOS RXF:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globalVariables<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>_DOMAIN_<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>applications.ucompass.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>_PROTOCOL_<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>_GATEWAY_<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://pilotfish2.ucompass.com/apps/gateway<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/globalVariable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/globalVariables<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;application</span> <span style="color: #000066;">background</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		_PROTOCOL_://_DOMAIN_/Educator2PortalFoundation/manifest.xml
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/applications<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Each global variable is wrapped in a &lt;globalVariable/&gt; element with child &lt;key/&gt; and &lt;value/&gt; elements.</p>
<p>All global variables in the dock manifest will automatically be added to the UcompOS Portal&#8217;s Shared Object implementation and will immediately be available to all UcompOS entities.</p>
<p><strong>String Substitutions in Manifest Files</strong></p>
<p>In the above example, notice I am instantiating global variable named _PROTOCOL and _DOMAIN_.  And then notice that those strings appear in my &lt;application/&gt; element.</p>
<p>A string substitution will automatically take place here such that the &lt;application/&gt; value will be http://applications.ucompass.com/Educator2PortalFoundation/manifest.xml after the substitution.</p>
<p>As mentioned earlier, the &lt;globalVariables&gt; element is supported in both application manifests and dock manifests so you can also establish global variables in this fashion when launching a UcompOS application.</p>
<p><strong>Typing Shared Objects</strong></p>
<p>The &lt;value/&gt; element supports an optional type attribute such that you can articulate the data type of a Shared Object.</p>
<p>The best way to show how this is accomplished is with examples:</p>
<p><u>Array</u></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>globalVariable<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>groceryList<span style="color: #006600; font-weight: bold;">&lt;/</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>value type<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Array&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>Bananas<span style="color: #006600; font-weight: bold;">&lt;/</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>Cereal<span style="color: #006600; font-weight: bold;">&lt;/</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>Diapers<span style="color: #006600; font-weight: bold;">&lt;/</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;/</span>value<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>globalVariable<span style="color: #006600; font-weight: bold;">&gt;</span></pre></div></div>

<p><u>Object</u></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>globalVariable<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>contacts<span style="color: #006600; font-weight: bold;">&lt;/</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;</span>value type<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Object&quot;</span><span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
			<span style="color: #006600; font-weight: bold;">&lt;</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>Joe<span style="color: #006600; font-weight: bold;">&lt;/</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>
			<span style="color: #006600; font-weight: bold;">&lt;</span>value<span style="color: #006600; font-weight: bold;">&gt;</span><span style="color: #800000;">555</span>-<span style="color: #800000;">1212</span><span style="color: #006600; font-weight: bold;">&lt;/</span>value<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;/</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
			<span style="color: #006600; font-weight: bold;">&lt;</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>Bob<span style="color: #006600; font-weight: bold;">&lt;/</span>key<span style="color: #006600; font-weight: bold;">&gt;</span>
			<span style="color: #006600; font-weight: bold;">&lt;</span>value<span style="color: #006600; font-weight: bold;">&gt;</span><span style="color: #800000;">555</span>-<span style="color: #800000;">2121</span><span style="color: #006600; font-weight: bold;">&lt;/</span>value<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;/</span>item<span style="color: #006600; font-weight: bold;">&gt;</span>
	<span style="color: #006600; font-weight: bold;">&lt;/</span>value<span style="color: #006600; font-weight: bold;">&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>globalVariable<span style="color: #006600; font-weight: bold;">&gt;</span></pre></div></div>

<p>The type attribute can also be of type <em>uint</em>, <em>int</em>, <em>Boolean</em>, <em>Number</em> and <em>String</em>.  The default data type is <em>String</em>.  Also, the &lt;item/&gt; element supports the type attribute for Arrays and Objects.</p>
<p>Also, nesting of complex data structures is supported, so you can implement an Array of Arrays, or an Array of Objects, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=460</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing 3 New UcompOS Portal Proxy Components</title>
		<link>http://blog.ucompass.com/?p=457</link>
		<comments>http://blog.ucompass.com/?p=457#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:46:42 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOSAlertProxy]]></category>
		<category><![CDATA[UcompOSDialogueProxy]]></category>
		<category><![CDATA[UcompOSKeyboardProxy]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=457</guid>
		<description><![CDATA[The UcompOS SDK in the latest milestone release of the UcompOS Rich Experience Framework, Public Alpha 0.3.1, contains 3 new UcompOS Portal Proxy Components that open up a host of new capabilities.
In this article, I&#8217;ll briefly introduce each of these 3 new components and show some examples of how they can be used and I [...]]]></description>
			<content:encoded><![CDATA[<p>The UcompOS SDK in the latest milestone release of the UcompOS Rich Experience Framework, Public Alpha 0.3.1, contains 3 new UcompOS Portal Proxy Components that open up a host of new capabilities.</p>
<p>In this article, I&#8217;ll briefly introduce each of these 3 new components and show some examples of how they can be used and I plan to build some new tutorial content in the near future to cover these 3 new components.</p>
<p><span style="text-decoration: underline;"><strong>UcompOSKeyboardProxy</strong></span></p>
<p>Within the scope of an individual UcompOS application or sub-application, you can certainly implement your own logic to handle keyboard events.</p>
<p>However, suppose you want to capture keyboard events that occur in the scope of the UcompOS Portal and pass them to  other UcompOS entities such as those that may be running as AIR applications on the desktop, in separate UcompOSBrowserWindowProxy instances, or in sandboxed SWF implementations.</p>
<p>You can now use the new <em>UcompOSKeyboardProxy</em> class to do this.</p>
<p>The class is a Singleton with a single property named <em>listen</em>.</p>
<p>When you set the <em>listen</em> property to <em>true</em>, any keyboard events that occur in the scope of the UcompOS Portal will be dispatched by the <em>UcompOSKeyboardProxy</em> Singleton.</p>
<p>Let&#8217;s look at a simple code-based example of this:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSKeyboardProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> KeyboardExample extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> KeyboardExample<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			UcompOSKeyboardProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">listen</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">true</span><span style="color: #006600; font-weight: bold;">;</span>
			UcompOSKeyboardProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSKeyboardProxy.<span style="color: #9900cc;">KEY_DOWN</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			UcompOSKeyboardProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSKeyboardProxy.<span style="color: #9900cc;">KEY_UP</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Type of event: &quot;</span>+event.<span style="color: #9900cc;">type</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Character code: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">charCode</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Alt key pressed: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">altKey</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Shift key pressed: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">shiftKey</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Control key pressed: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">ctrlKey</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Key code: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">keyCode</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>As you can see, the properties in the event dispatched by the <em>UcompOSKeyboardProxy</em> Singleton are very similar to those of the Flash <em>KeyboardEvent</em> class.</p>
<p><span style="text-decoration: underline;"><strong>UcompOSAlertProxy</strong></span></p>
<p>The Flex <em>Alert</em> class is a modal dialogue.  It prevents the user from doing anything until they click a button control on the <em>Alert</em> dialogue.</p>
<p>The <em>UcompOSAlertProxy</em> class lets you throw a Flex <em>Alert</em> onto the UcompOS Portal.</p>
<p>When the user clicks a button on the <em>Alert</em> class, instances of <em>UcompOSAlertProxy</em> dispatch an <em>SDKEvent</em> instance.</p>
<p>The <em>UcompOSAlertProxy</em> class has two methods:<em> confirm() </em>and <em>simpleAlert()</em>.</p>
<p><em>confirm() </em>throws a confirmation style dialogue onto the UcompOS Portal.</p>
<p>Below is the signature of the <em>confirm()</em> method:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> confirm<span style="color: #006600; font-weight:bold;">&#40;</span>title<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span>,message<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span>,okLabel<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">null</span>,cancelLabel<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">null</span>,defaultButton<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span>OK<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void</pre></div></div>

<p>As you can see, you can customize the alert title, the message of the Alert body, and the labels used on the &#8220;OK&#8221; and &#8220;Cancel&#8221; buttons.  You can also indicate which button should be the default button.</p>
<p>Let&#8217;s look at a code-based example:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSAlertProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> AlertExample extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> AlertExample<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> a<span style="color: #006600; font-weight: bold;">:</span>UcompOSAlertProxy <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> UcompOSAlertProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			a.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSAlertProxy.<span style="color: #9900cc;">ALERT_SUBMIT</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			a.<span style="color: #9900cc;">confirm</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Confirm&quot;</span>,<span style="color: #cc0000;">&quot;Are you sure you want to delete this file?&quot;</span>,<span style="color: #cc0000;">&quot;Yes!&quot;</span>,<span style="color: #cc0000;">&quot;Hell No!&quot;</span>,UcompOSAlertProxy.<span style="color: #9900cc;">CANCEL</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			switch<span style="color: #006600; font-weight:bold;">&#40;</span>event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">detail</span><span style="color: #006600; font-weight:bold;">&#41;</span>
			<span style="color: #006600; font-weight:bold;">&#123;</span>
				<span style="color: #990099; font-weight: bold;">case</span> UcompOSAlertProxy.<span style="color: #9900cc;">OK</span><span style="color: #006600; font-weight: bold;">:</span>
					trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;The file will be deleted&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
					break<span style="color: #006600; font-weight: bold;">;</span>
				<span style="color: #990099; font-weight: bold;">case</span> UcompOSAlertProxy.<span style="color: #9900cc;">CANCEL</span><span style="color: #006600; font-weight: bold;">:</span>
					trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;The file will NOT be deleted&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
					break<span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #006600; font-weight:bold;">&#125;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>	
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Notice in the example above, the <em>SDKEvent</em>&#8217;s <em>data</em> Object will have a <em>detail</em> property that will be a value of <em>UcompOSAlertProxy.OK</em> or <em>UcompOSAlertProxy.SUBMIT</em>.  This is parallel to the implementation of the <em>Alert</em> in Flex.</p>
<p>The <em>simpleAlert() </em>method simply throws an <em>Alert</em> with a single button of type <em>UcompOSAlertProxy.OK</em>.</p>
<p><span style="text-decoration: underline;"><strong>UcompOSDialogueProxy</strong></span></p>
<p>In some instances, you&#8217;ll want to set up a modal user interaction dialogue when you want to capture some sort of input from the user.</p>
<p>To address this need, I created the <em>UcompOSDialogueProxy</em> class.</p>
<p>The <em>UcompOSDialogueProxy</em> is used to throw up a few different types of modal user interaction dialogues.</p>
<p>For instance, suppose you have a File Management application and you want to give the user the ability to choose a &#8220;Save As&#8221; option.</p>
<p>You don&#8217;t want the user to be able to do anything else until they either input a file name and press submit, or, cancel the operation.</p>
<p>This would be a perfect place to use the new <em>UcompOSDialogueProxy</em> class.</p>
<p>There are initially 4 different types of dialogues I have set up: <em>TextInput</em> for single line text input; <em>TextArea</em> for multiple line text input; <em>RadioButtons</em> for survey-type interaction; and <em>SWFLoader</em> which enables you to throw your own content into the dialogue and this content can be a UcompOS entity.</p>
<p>Below is the signature of the <em>add()</em> method of <em>UcompOSDialogueProxy</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> add<span style="color: #006600; font-weight:bold;">&#40;</span>controlType<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span>TEXT_INPUT,title<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;UcompOS Dialogue&quot;</span>,label<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;&quot;</span>,width<span style="color: #006600; font-weight: bold;">:</span>uint<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">400</span>,height<span style="color: #006600; font-weight: bold;">:</span>uint<span style="color: #006600; font-weight: bold;">=</span><span style="color: #800000;">0</span>,showCloseButton<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">false</span>,cancelLabel<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span>CANCEL,submitLabel<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span><span style="color: #006600; font-weight: bold;">=</span>SUBMIT,cancelEnabled<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">true</span>,submitEnabled<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">Boolean</span><span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">true</span>,initData<span style="color: #006600; font-weight: bold;">:</span>Object<span style="color: #006600; font-weight: bold;">=</span><span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void</pre></div></div>

<p>Notice the default <em>height</em> is <em>0</em>.  What happens is when the <em>width</em> or <em>height</em> is <em>0</em>, the size of the Dialogue automatically conforms to the content that is placed inside of it.  Otherwise, the <em>width</em>/<em>height</em> is explicitly set.</p>
<p>The <em>initData</em> Object parameter has special meaning.</p>
<p>It is passed to the RadioButtons and SWFLoader types of Dialogues and examples of how <em>initData</em> is constructed in those two scenarios is depicted in the examples below.</p>
<p>Let&#8217;s look at a code-based example that shows how to use each of the 4 different types of dialogues:</p>
<p><span style="text-decoration: underline;"><strong>TextInput Dialogue Example</strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSDialogueProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> TextInputDialogue extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> TextInputDialogue<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> UcompOSDialogueProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">add</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">TEXT_INPUT</span>,<span style="color: #cc0000;">&quot;Sample Dialogue&quot;</span>,<span style="color: #cc0000;">&quot;What is your name?&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">DIALOGUE_SUBMIT</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> event.<span style="color: #9900cc;">target</span> <span style="color: #330066;">as</span> UcompOSDialogueProxy<span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Your name is &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">data</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #330066;">close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Notice in the above example, in the <em>eventHandler()</em> method, the <em>UcompOSDialogueProxy</em>&#8217;s <em>close()</em> method is called.  The dialogue does not disappear by itself upon a submission.  You have to explicitly remove it with the <em>close()</em> method such that you have much better control over when the dialogue is closed based on the specifics of the user&#8217;s input.</p>
<p><span style="text-decoration: underline;"><strong>TextArea Dialogue Example</strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSDialogueProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> TextAreaDialogue extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> TextAreaDialogue<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> UcompOSDialogueProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">add</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">TEXT_AREA</span>,<span style="color: #cc0000;">&quot;Sample Dialogue&quot;</span>,<span style="color: #cc0000;">&quot;Please tell us why you like the UcompOS in 1,000 words or less:&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">DIALOGUE_SUBMIT</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> event.<span style="color: #9900cc;">target</span> <span style="color: #330066;">as</span> UcompOSDialogueProxy<span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span>event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">data</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #330066;">close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>The <em>TextArea</em> example is almost identical to the <em>TextInput</em> example.</p>
<p><span style="text-decoration: underline;"><strong>RadioButtons Dialogue Example</strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSDialogueProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> RadioButtonsDialogue extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> RadioButtonsDialogue<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> UcompOSDialogueProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> choices<span style="color: #006600; font-weight: bold;">:</span><span style="color: #330066;">Array</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #006600; font-weight:bold;">&#91;</span><span style="color: #cc0000;">&quot;ActionScript 3&quot;</span>,<span style="color: #cc0000;">&quot;JavaScript&quot;</span>,<span style="color: #cc0000;">&quot;PERL&quot;</span>,<span style="color: #cc0000;">&quot;C++&quot;</span><span style="color: #006600; font-weight:bold;">&#93;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">add</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">RADIO_BUTTONS</span>,<span style="color: #cc0000;">&quot;Sample Dialogue&quot;</span>,<span style="color: #cc0000;">&quot;What is your favorite programming language?&quot;</span>,<span style="color: #800000;">0</span>,<span style="color: #800000;">0</span>,<span style="color: #0000ff; font-weight: bold;">false</span>,UcompOSDialogueProxy.<span style="color: #9900cc;">CANCEL</span>,UcompOSDialogueProxy.<span style="color: #9900cc;">SUBMIT</span>,<span style="color: #0000ff; font-weight: bold;">true</span>,<span style="color: #0000ff; font-weight: bold;">true</span>,<span style="color: #006600; font-weight:bold;">&#123;</span>choices<span style="color: #006600; font-weight: bold;">:</span>choices<span style="color: #006600; font-weight:bold;">&#125;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">DIALOGUE_SUBMIT</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> event.<span style="color: #9900cc;">target</span> <span style="color: #330066;">as</span> UcompOSDialogueProxy<span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;Your favorite programming language is: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">data</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #330066;">close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Notice in the example above, we are building an <em>Array</em> of choices to give to the user where a Radio Button will be associated with each choice.  The Array is passed as a property named <em>choices</em> in the <em>initData</em> parameter passed to the <em>UcompOSDialogueProxy</em>&#8217;s <em>add()</em> method.</p>
<p><span style="text-decoration: underline;"><strong>SWFLoader Dialogue Example</strong></span></p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import flash.<span style="color: #9900cc;">display</span>.<span style="color: #9900cc;">Sprite</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSDialogueProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> SWFLoaderDialogue extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> SWFLoaderDialogue<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> UcompOSDialogueProxy<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> source<span style="color: #006600; font-weight: bold;">:</span><span style="color: #990099; font-weight: bold;">String</span> <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #cc0000;">&quot;http://applications.ucompass.com/MyCustomDialogue.swf&quot;</span><span style="color: #006600; font-weight: bold;">:</span>
			d.<span style="color: #9900cc;">add</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">SWF_LOADER</span>,<span style="color: #cc0000;">&quot;Sample Dialogue&quot;</span>,<span style="color: #cc0000;">&quot;&quot;</span>,<span style="color: #800000;">0</span>,<span style="color: #800000;">0</span>,<span style="color: #0000ff; font-weight: bold;">false</span>,UcompOSDialogueProxy.<span style="color: #9900cc;">CANCEL</span>,UcompOSDialogueProxy.<span style="color: #9900cc;">SUBMIT</span>,<span style="color: #0000ff; font-weight: bold;">true</span>,<span style="color: #0000ff; font-weight: bold;">true</span>,<span style="color: #006600; font-weight:bold;">&#123;</span>source<span style="color: #006600; font-weight: bold;">:</span>source<span style="color: #006600; font-weight:bold;">&#125;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSDialogueProxy.<span style="color: #9900cc;">DIALOGUE_SUBMIT</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> d<span style="color: #006600; font-weight: bold;">:</span>UcompOSDialogueProxy <span style="color: #006600; font-weight: bold;">=</span> event.<span style="color: #9900cc;">target</span> <span style="color: #330066;">as</span> UcompOSDialogueProxy<span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;The Connection Id of your SWF content is: &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">data</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			d.<span style="color: #330066;">close</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>In this case, we are passing the URL of a SWF to the dialogue.  When the user presses the Submit button for the dialogue, the connection id of the SWF content is returned in the <em>SDKEvent</em> dispatched by the <em>UcompOSDialogueProxy</em> instance.</p>
<p>From here, UcompOS SDK transactions could be used to communicate directly with the SWF content and retrieve special information from it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=457</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In-Depth Coverage of the UcompOS Menu Bar</title>
		<link>http://blog.ucompass.com/?p=440</link>
		<comments>http://blog.ucompass.com/?p=440#comments</comments>
		<pubDate>Fri, 05 Mar 2010 13:25:14 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOSMenuBarProxy]]></category>
		<category><![CDATA[Menu Bar]]></category>
		<category><![CDATA[Shortcut Keys]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=440</guid>
		<description><![CDATA[The menu bar feature on the UcompOS Portal can be customized in a number of different ways.  This article will discuss the basics of the UcompOS menu bar, and also provide a look at some of the features that have been recently added to the menu bar including support for keyboard shortcuts.
Attaching a Menu Bar [...]]]></description>
			<content:encoded><![CDATA[<p>The menu bar feature on the UcompOS Portal can be customized in a number of different ways.  This article will discuss the basics of the UcompOS menu bar, and also provide a look at some of the features that have been recently added to the menu bar including support for keyboard shortcuts.</p>
<p><span style="text-decoration: underline;"><strong>Attaching a Menu Bar to a UcompOS Application</strong></span></p>
<p>The common paradigm of using the menu bar is to have a custom menu bar implementation appear while a particular UcompOS application is in focus.</p>
<p>There are two ways to go about doing this.</p>
<p>The first is to attach an XML model for the menu bar to the particular UcompOS application&#8217;s manifest file.</p>
<p>Below is an example of a simple menu bar model that would be placed in the UcompOS application manifest file as a child of the root application element.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;File&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Open&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Close&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Quit&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Edit&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Copy&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Paste&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>You can also add a custom menu bar implementation to a UcompOS application at run-time.</p>
<p>This is accomplished using the <em>UcompOSMenuBarProxy</em> class that is built into the UcompOS SDK.</p>
<p><em>UcompOSMenuBarProxy</em> is a Singleton, meaning it is instantiated via a <em>static</em> method.</p>
<p>It offers a <em>setMenuBar() </em>method that accepts a parameter <em>model</em> of type <em>XML</em> (<em>String</em> in the JavaScript SDK).</p>
<p>Below is a simple example of the <em>UcompOSMenuBarProxy</em>&#8217;s setMenuBar() method at work:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">var</span> menuBarModel<span style="color: #006600; font-weight: bold;">:</span>XML <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> XML<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;&lt;menu&gt;&lt;menuitem label='File'&gt;&lt;menuitem label='Open' data='open'/&gt;&lt;menuitem label='Close' data='close'/&gt;&lt;/menuitem&gt;&lt;/menu&gt;&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
UcompOSMenuBarProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">setMenuBar</span><span style="color: #006600; font-weight:bold;">&#40;</span>menuBarModel<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span></pre></div></div>

<p>If you have done any coding in Flex and added your own XML <em>dataProvider</em> to a Flex <em>MenuBar</em> implementation, the above example should look familiar.  The XML data model we are using is based on the model that is used inside of Flex.</p>
<p><span style="text-decoration: underline;"><strong>The Base UcompOS Menu Item<br />
</strong></span></p>
<p>By default, UcompOS Portal implementations will have a base menu bar item that is perpetually viewable throughout the user&#8217;s session.  This is analogous to the Mac OS X Operating System&#8217;s menu bar implementation that has a base menu bar item on the left of the menu bar represented by Apple&#8217;s trademark logo.</p>
<p><a href="http://blog.ucompass.com/wp-content/uploads/2010/03/BaseMenuBar.png"><img class="alignnone size-full wp-image-441" title="BaseMenuBar" src="http://blog.ucompass.com/wp-content/uploads/2010/03/BaseMenuBar.png" alt="BaseMenuBar" width="214" height="140" /></a></p>
<p>The base menu bar option is shown above.</p>
<p><span style="text-decoration: underline;"><strong>Overriding the Base Menu Item</strong></span></p>
<p>You can replace the built-in UcompOS menu bar item with your own custom implementation in one of two ways.</p>
<p>One such way is by adding a <em>baseMenu</em> element to one of your UcompOS application&#8217;s  manifest files.</p>
<p>Below is an example of this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;baseMenu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Company X&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;About Our Company&quot;</span> <span style="color: #000066;">data</span>=<span style="color: #ff0000;">&quot;about&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/baseMenu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This would replace the base UcompOS menu bar item with an option labeled &#8220;Company X&#8221; that has an &#8220;About Our Company&#8221; sub option.</p>
<p>Below is an example of the custom base menu bar for the Educator 2 software I am building on top of the UcompOS RXF:</p>
<p><a href="http://blog.ucompass.com/wp-content/uploads/2010/03/Educator2MenuBar.png"><img class="alignnone size-full wp-image-452" title="Educator2MenuBar" src="http://blog.ucompass.com/wp-content/uploads/2010/03/Educator2MenuBar.png" alt="Educator2MenuBar" width="213" height="99" /></a></p>
<p>The other way would be to use the <em>UcompOSMenuBarProxy</em> class and to override the base menu item at run-time.</p>
<p>The second parameter of the <em>UcompOSMenuBarProxy</em>&#8217;s <em>setMenuBar()</em> method is an optional <em>Boolean</em> property named <em>baseMenu</em> that defaults to <em>false</em>.</p>
<p>When you pass in a <em>true</em> value for this parameter, the menu bar model you pass to<em> setMenuBar()</em> will become the base menu item.</p>
<p>There can only be one base menu item at a time throughout your entire UcompOS implementation.  If UcompOS Application A sets the base menu item, then UcompOS Application B sets the base menu item later, it will override the base menu item set by UcompOS Application A.</p>
<p>It is planned at some point that the UcompOS Dock Manifest will indicate which UcompOS Applications have the privilege of setting the base menu item which could be an important consideration in large collaborative development environments.</p>
<p><span style="text-decoration: underline;"><strong>Sharing a Menu Bar Across Multiple UcompOS Applications</strong></span></p>
<p>In some implementations, you may want one menu bar implementation to be used across multiple applications.</p>
<p>To do this, you would declare one of your applications as the <strong>default</strong> application.  This is accomplished in one of two ways: in the Dock Manifest by passing a <em>default=&#8221;true&#8221;</em> attribute to an <em>&lt;application/&gt;</em> element, or at run time with the <em>UcompOSGlobalManagerProxy</em>&#8217;s <em>isDefaultApplication</em> property.</p>
<p>When a default application is set on the UcompOS Portal, then any UcompOS Applications that have the following menu bar models:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>will use the Menu Bar implementation that is assigned to the application that has been declared as the default application.</p>
<p>As a note of caution, only one application can be declared as the default at a time on the UcompOS Portal.  If you try to declare an application as the default while another application has already been defined as the default, a run-time error will occur.  This is by design, and you must set the <em>isDefaultApplication</em> property of the <em>UcompOSGlobalManagerProxy</em> to <em>false</em> before you can set it to <em>true</em> for another application.</p>
<p>As is the case with setting base menu items, I am considering setting it up at the Dock Manifest level such that it is articulated ahead of time which applications can declare themselves as the default.</p>
<p><span style="text-decoration: underline;"><strong>Menu Bar Icons</strong></span></p>
<p>The model for the UcompOS menu bar supports the <em>icon</em> attribute for <em>menuitem</em> elements.  The value of the <em>icon</em> attribute should be the full URL to an image of type GIF, JPG, or PNG.</p>
<p>You can use any sized icon but it is recommended you use an icon sized at  18&#215;18.</p>
<p>Below is an example of a menu bar implementation with icons:</p>
<p><a href="http://blog.ucompass.com/wp-content/uploads/2010/03/MenuBarIcons.png"><img class="alignnone size-full wp-image-453" title="MenuBarIcons" src="http://blog.ucompass.com/wp-content/uploads/2010/03/MenuBarIcons.png" alt="MenuBarIcons" width="421" height="185" /></a></p>
<p><span style="text-decoration: underline;"><strong>Menu Bar Separators</strong></span></p>
<p>In the image above, notice there is a separator between the &#8220;Delete&#8221; and &#8220;Close&#8221; options.</p>
<p>This is accomplished with the following menuitem element:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;separator&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p><strong><span style="text-decoration: underline;">Window-Specific Menu Bars</span></strong></p>
<p>In some UcompOS applications, you may spawn many different UcompOS windows and load a variety of different sub-applications into each window instance.</p>
<p>Each window instance may need their own unique menu bar implementation.</p>
<p>The <em>UcompOSWindowProxy</em> class offers a <em>setMenuBar()</em> method that allows you to attach a custom menu bar implementation to individual UcompOS Window instances.</p>
<p>The menu bar will come into view whenever the window it is attached to comes into focus.  When the window closes, the menu bar will return to the existing menu bar implementation attached to the UcompOS application in focus.</p>
<p><span style="text-decoration: underline;"><strong>Menu Bar Events</strong></span></p>
<p>Obviously, if you go through the trouble of implementing a custom menu bar, you want to know when the user has selected an option on the menu bar.</p>
<p>When an item is selected on the menu bar, an event of type <em>UcompOSMenuBarProxy.ITEM_CLICK</em> is dispatched to any listening <em>UcompOSMenuBarProxy</em> instances.</p>
<p>A strict protocol that must be recognized is that only <em>menuitem</em> elements that have a <em>data</em> property will dispatch a <em>UcompOSMenuBarProxy.ITEM_CLICK </em>event.</p>
<p>Let&#8217;s look at a very simple code-based example:</p>

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;">package
<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">proxycomponents</span>.<span style="color: #9900cc;">UcompOSMenuBarProxy</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">events</span>.<span style="color: #9900cc;">SDKEvent</span><span style="color: #006600; font-weight: bold;">;</span>
	import com.<span style="color: #9900cc;">ucompass</span>.<span style="color: #9900cc;">ucompos</span>.<span style="color: #9900cc;">sdk</span>.<span style="color: #9900cc;">SDKClient</span><span style="color: #006600; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">class</span> MenuBarExample extends Sprite
	<span style="color: #006600; font-weight:bold;">&#123;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">public</span> <span style="color: #0000ff; font-weight: bold;">function</span> MenuBarExample<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			<span style="color: #0000ff; font-weight: bold;">var</span> menuBarModel<span style="color: #006600; font-weight: bold;">:</span>XML <span style="color: #006600; font-weight: bold;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> XML<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;&lt;menu&gt;&lt;menuitem label='File'&gt;&lt;menuitem label='Select Me' data='testData'/&gt;&lt;/menuitem&gt;&lt;/menu&gt;&quot;</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			SDKClient.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span>this<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			UcompOSMenuBarProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">setMenuBar</span><span style="color: #006600; font-weight:bold;">&#40;</span>menuBarModel<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			UcompOSMenuBarProxy.<span style="color: #9900cc;">getInstance</span><span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #006600; font-weight:bold;">&#41;</span>.<span style="color: #9900cc;">addEventListener</span><span style="color: #006600; font-weight:bold;">&#40;</span>UcompOSMenuBarProxy.<span style="color: #9900cc;">ITEM_CLICK</span>,eventHandler<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">private</span> <span style="color: #0000ff; font-weight: bold;">function</span> eventHandler<span style="color: #006600; font-weight:bold;">&#40;</span>event<span style="color: #006600; font-weight: bold;">:</span>SDKEvent<span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">:</span>void
		<span style="color: #006600; font-weight:bold;">&#123;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;The user said &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">label</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
			trace<span style="color: #006600; font-weight:bold;">&#40;</span><span style="color: #cc0000;">&quot;The associaed data is &quot;</span>+event.<span style="color: #9900cc;">data</span>.<span style="color: #9900cc;">data</span><span style="color: #006600; font-weight:bold;">&#41;</span><span style="color: #006600; font-weight: bold;">;</span>
		<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
	<span style="color: #006600; font-weight:bold;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #006600; font-weight:bold;">&#125;</span></pre></div></div>

<p><em>UcompOSMenuBarProxy.ITEM_CLICK</em> events are only dispatched to UcompOS entities in the scope of the UcompOS application in focus when the menu item was selected.  So if UcompOS Application B has implemented a custom menu bar, and UcompOS Application A is in focus, no menu events will be dispatched to UcompOS Application B.</p>
<p><span style="text-decoration: underline;"><strong>Keyboard Shortcut Commands<br />
</strong></span></p>
<p>In applications where you load a lot of functionality onto the menu bar, keyboard shortcut commands can be a very convenient feature for your users, and, perhaps as importantly, they can help your applications address important accessibility standards crucial for many public-use applications.</p>
<p>To add a keyboard shortcut command to a menu item, you use the <em>shortcutKey</em> attribute to the <em>menuitem</em> element in a menu bar model.</p>
<p>For instance:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;File&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;menuitem</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Print&quot;</span> <span style="color: #000066;">data</span>=<span style="color: #ff0000;">&quot;print&quot;</span> <span style="color: #000066;">shortcutKey</span>=<span style="color: #ff0000;">&quot;ALT-P&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menuitem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/menu<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>In the above example, when the user presses the ALT key and the P key simultaneously, the action that will take place will be exactly the same as if the user would have chosen the Print option with the mouse.</p>
<p>Below is an example of a similar implementation from Educator 2:</p>
<p><a href="http://blog.ucompass.com/wp-content/uploads/2010/03/PrintOption.png"><img class="alignnone size-full wp-image-454" title="PrintOption" src="http://blog.ucompass.com/wp-content/uploads/2010/03/PrintOption.png" alt="PrintOption" width="243" height="156" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=440</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Major UcompOS Updates Coming</title>
		<link>http://blog.ucompass.com/?p=437</link>
		<comments>http://blog.ucompass.com/?p=437#comments</comments>
		<pubDate>Thu, 04 Mar 2010 14:33:58 +0000</pubDate>
		<dc:creator>Edward Mansouri</dc:creator>
				<category><![CDATA[UcompOS Project Site]]></category>

		<guid isPermaLink="false">http://blog.ucompass.com/?p=437</guid>
		<description><![CDATA[It has been a while since I&#8217;ve posted, but that doesn&#8217;t mean I don&#8217;t have some great things in store.
I am in the process of finishing up a number of enhancements, including a number of bug fixes as well as some new UcompOS Portal Proxy Components.
I plan to get caught up on documentation this weekend, [...]]]></description>
			<content:encoded><![CDATA[<p>It has been a while since I&#8217;ve posted, but that doesn&#8217;t mean I don&#8217;t have some great things in store.</p>
<p>I am in the process of finishing up a number of enhancements, including a number of bug fixes as well as some new UcompOS Portal Proxy Components.</p>
<p>I plan to get caught up on documentation this weekend, and to put forward some new tutorials and roll out Milestone Public Alpha Release 0.4 this Monday.</p>
<p>There will probably be one more Milestone Public Alpha Release after this next one before we officially move the project to its Public Beta sometime in May.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ucompass.com/?feed=rss2&amp;p=437</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
