Auto-Updating the UcompOS Portal

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 host a public UcompOS implementation from your own webservers.

With the UcompOS project being updated frequently, the physical process of updating the UcompOS RPF and its associated components can be tedious.

There are ways you can automate the process, but it requires some simple scripting that can be accomplished in a variety of languages.

There are some static URLs to know about first of all.

The latest release of the UcompOS Developers package is always found at a URL of  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 which expands into an sdk folder, inside of which are an html, air, and flashOrFlex folder with each of the three respective SDKs for those different platforms.

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  – UcompOSSDK.swc (Flash/Flex), UcompOSSDKAIR.swc (AIR), and UcompOSSDK.js and UcompOSSDK.swf (JavaScript).

I then establish relative symlinks to the various locations on my local file system where those files need to be placed – libs folders in Flex projects and root webserver paths for JavaScript applications.  For Flash applications I simply embed the UcompOSSDK.swc file from the singular location where the file exists on my workstation.

As far as updating the UcompOS Portal, the developers package bin-release folder contains a simple XML file named release.xml.

This is what the current one looks like as of this morning:

          <packaged>Tue Mar 23 08:47:44 2010</packaged>
          <packaged>Tue Mar 23 02:02:53 2010</packaged>

Also, a file exists at the URL 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.

Note there IS an SVN Repository 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 RPF project open source and there will be a model for accessing the full source code of all the associated UcompOS technologies and you’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 RPF which I am trying to coincide with Adobe MAX 2010 in October).

In the meantime, there are still a number of simple ways you can go about coordinating an auto-update.

Below is a very simple PERL script I wrote that auto-updates the UcompOS Portal in my Educator 2 project:

use strict;
use LWP::Simple;
use XML::LibXML;
my $myVersion;
if(!-e "../../frontend/release.xml")
	$myVersion = 0;
	my @line = <FILE>;
	my $myReleaseInfo = join("",@line);
	$myVersion = getVersion($myReleaseInfo);
my $latestVersion = getVersion(get(""));
if($myVersion ne $latestVersion)
sub getTextNode {
	my $thisNode = $_[0];
	my @thisChild = $thisNode->getChildNodes;
	my $textNode;
	eval {
		$textNode = $thisChild[0]->getNodeValue;
	if(!$textNode) {
		eval {
		$textNode = $thisChild[0]->nodeValue;
	return $textNode;
sub getVersion
	my $releaseInfo = $_[0];
	my $xml = XML::LibXML->new;
	my $string = $xml->parse_string($releaseInfo);
	my $xp = XML::LibXML::XPathContext->new($string);
	my @nodeSet = $xp->findnodes('//portal/version');
	my $version = getTextNode($nodeSet[0]);
	return $version;
sub update
	my $content = get("");
	print FILE $content;
	system("unzip -qq ''");
	system("rsync -a --delete --exclude=\"LocalLib.js\" --exclude=\"styles.css\" bin-release ../../../frontend");
	system("\\rm -rf bin-release");

In my example above, I basically have my UcompOS Portal code housed in a bin-release folder. I check the latest release version and see if it matches my local version, and if it doesn’t, I retrieve the latest package, unzip it, and overwrite my existing copy with rsync excluding the LocalLib.js and styles.css files – which are the only files in the UcompOS Developers package you would typically need to update with your own implementation specific information.