Why the MPL license?
The SDK may be obtained in two different versions, the "regular" version, and the "open source" version.
The "regular" version license contains some language about "internal" use of the compiler. I did not see an explicit reference to the legality of the distribution of any executables that one might build with the compiler(s). The open source version uses a straight forward MPL license scheme, and since I did not need any of the "special runtime" components (included only in the "regular" version), I went with the license that I understood best.
One thing that will derail many users of the MPL
"open source" version of the SDK is the use of run
scripts for the compiler on a *nix platform.
For example, to compile the code at right,
one would execute a command line such as :
../../../bin/... dawgs.xml
If the SDK has been installed on a *nix system, then
the command will result in an error unless the scripts
in the "../../../bin" directory have been stripped of
their (windows world) carriage returns.
The solution is to use the dos2unix utility on the offending
scripts to strip out the superfluous carriage return
characters:
dos2unix ../../../bin/*xmlc
Posted: May 2, 2009 - contribution by ron scheckelhoff -- rscheckelhoff- at- dot-com
I remember the days, back when I used DOS "Turbo Pascal 4" to work on code projects, and I bought a
development library called "Topaz for Pascal". Geeez, I thought, I have such a high level tool here,
and I can type only a few lines of code to get great results.
Things have changed. Pascal is Passe' .
The little company that purchased Turbo
Pascal, Delphi, and C++ Builder
from Borland is based in San Francisco, I think (Embarcadero Technologies).
Pascal was never much "higher level" than the C language, except that it was more structured.
With a truly high level language, things seem to happen by magic. The coder types in a few lines of text,
indicating what he wants to do, and the components of the front-end tools and toolchain fill in
all of the detail that needs to be supplied, making all the right guesses as to what the coder's
design requires. It's a programming language with mind reading capability.
When I first downloaded the reviewed product (one that amounts to a third party framework for Rich Internet Applications - supplier information is included in footnote1), I had in mind to create a few simple enhancements for a personal family website. After using the environment for a short while, it vaguely put me in mind of the aforementioned "programming language with mind reading capability"
The aforementioned frameworks product comes as an SDK and supplies a considerable treasure of components that may be used to hasten the pace of GUI development. Some of these components bear component names that would likely be recognized as a traditional part of any serious GUI development kit.
For example, there is an image component, a progress bar component, and an AJAX-like component for retrieving data from a network connection.
So far, so good, and the controls work in admirable fashion. What makes the controls in the SDK2 environment take on a "mind reading" like quality is the implicit effects the controls have on each other, based upon the circumstance in which they are used, These things figure out for themselves (almost) what types of interactions are most appropriate, and then they just go and do it.
For instance, my personal family site has a photo-viewer that can be used to show-off pictures of my two humane-shelter rescue dogs. It contains a control for the images, and a progress bar. I simply supply the url of the image(s) on the site as an argument to the image object's load method, and supply the image object reference to the progress bar. The progress bar figures out that it is dealing with an image, figures out (correctly) that I want to display the download progress relative to the url that the image load method was called with, and displays the progress bar perfectly without any explicit description about how the situation should be handled.
Of course, this happens because a set of default behaviours is embedded in most of the controls, instructing
them what to do based upon the particulars of the circumstance, and is something that is readily coded into
controls in any language that supports inheritance and polymorphic behaviors.
The difference is, these controls actually do it. I have not had experience with many other control sets that
exhited such convenient default "mind reading" behaviours.
A snapshot of the dawg viewer:
My personal opinion is that because the product is young, it may take a while before it becomes ubiquitous in the business world for business applications. I don't really know how well it is currently being embraced in the business community to which it is targeted, but the company that produces the SDK has made the barriers to entry very low at this point, and I think that many businesses should be willing to give it a try.
So, what is a so-called RIA (Rich Internet Application)? In a way, the term is a full circle return to the programming paradim that predates the internet, where the displayed content was not based on HTML pages retrieved from remote servers. Instead, the display was rendered directly by making traditional calls on libraries linked to the native graphics sub-system of the client machine, without (necessarily) any interpretation of HTML code and the subsequent display of constructs constrained by HTML and it's interpreter.
What's the big deal with that? HTML was designed initially to put a pretty face on the notes and papers
that academics
liked to pass around (via primative web servers) in the early days, when there was not much more than
government and university activity
on the net. It was good for putting that bold title on top, maybe use an ordered list here or there, and
generally provide a nicer looking document than plain text email.
Only recently (with AJAX) has the ability come to standard HTML w/javascript pages to transfer less than a
full page at a time (an extremely wasteful practice).
An immense amount of tediously applied effort has been directed to the creation of various technologies and methods
to make the HTML rendering scheme do something it wasn't designed to do: look like and act like a native
mode GUI interface.
More direct use of the native graphics sub-system is usually quicker, and always more versatile than rendering
graphics through an HTML interpreter. In the case of the SDK, the native mode "engine" that allows for the display
of non-HTML based content is a media player, either the stand-alone version or the version that can now be found,
almost ubiquitously, as a plugin for the various
internet browsers running on computers throughout the world.
Via the browser, a rich internet application mixes native content with HTML based content to provide the
best of both worlds, using an AJAX like functionality to retrieve most of the internet based content, and
utilizing traditional data handling techniques to manipulate and display other types of content.
As a bonus, the player displays content consistently, regardless of which browser it is embedded within,
thus erasing a headache that has been with web coders since Microsoft discovered the internet - that of
incompatibilities in the way various browsers display HTML content and apply style sheets.
Some of the simple "Dawg-photo-viewer" code shown as an example ...
http://www.fourcalorieservers.com/smallprojects/dawg-photo-viewer-1.0.4.tar.gz (source code project)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.....com/2006/mxml">
<!--- Copyright Datazygte, Inc. 2009, Contributor: Ron Scheckelhoff
The user is granted a limited, non exclusive right to use the program.
To the extent of any applicable laws, this program is supplied without
any warranty, implied or otherwise. The program is supplied "as is".
In no event shall the copyright holders, authors, or contributors be
held liable for any damages whatsoever, direct or indirect, however
caused, and on any theory of liability or tort law.
The program is licensed under the MPL-1.1 OS license.
the detail of that license may be found at:
http://www.opensource.org/licenses/mozilla1.1.php
-->
<mx:Script>
<![CDATA[
import mx.graphics.*;
import mx.core.BitmapAsset;
import mx.events.*;
import mx.controls.*
// ---------- code version 1.0.3 ------------
// ------------ embed the eula --------------
[Embed(source="../assets/dawgeula2.png")]
[Bindable]
public var imageClass:Class;
// ----------- when changing nodes ----------
private function onChange(event:Event):void
{
if (event.currentTarget.selectedItem.@data)
{
textarea_1.text = event.currentTarget.selectedItem.@data;
image_1.load(textarea_1.text);
}
}
// ----------- when opening nodes --------------
private function onOpenItem(event:TreeEvent):void
{
textarea_1.text = event.item.@label;
}
// ----------- when EULA button clicked --------
private function onButtonClick(event:Event):void
{
<!--- button click -->
var imageObject:BitmapAsset = new imageClass() as BitmapAsset;
image_1.source=imageObject;
Alert.show("Click to accept EULA", "This program requires that the user accept the EULA", Alert.OK, this);
}
]]>
</mx:Script>
<mx:Style>
.normalStyle
{
background-color: #94aab5;
}
</mx:Style>
<mx:XMLList id="dawgiedata">
<node label="Family Photos">
<node label="The Dawgs">
<!--- It would be very easy to pull the XMLList data from a file or database ... -->
<node label="Starsky at Lagoon" data="http://www.scheckelhoffs.org/images/dawg-jordan-lake-12-05-20080004.png" />
<node label="Feeling Kingly" data="http://www.scheckelhoffs.org/images/feelingkingly.png"/>
<node label="Dog Discrimination" data="http://www.scheckelhoffs.org/images/beachbums.png"/>
<node label="Water Shortage" data="http://www.scheckelhoffs.org/images/watershortage.png"/>
<node label="Waiting all Day" data="http://www.scheckelhoffs.org/images/waitinallday.png"/>
<node label="Smelling Rain" data="http://www.scheckelhoffs.org/images/smellingrain.png"/>
<node label="Look into My Eyes" data="http://www.scheckelhoffs.org/images/starsky_03032009.png"/>
<node label="Chewed right Off" data="http://www.scheckelhoffs.org/images/dawg-eats-turn-signal-stalk.png"/>
<node label="Dunno, I Didn't See" data="http://www.scheckelhoffs.org/images/whatwasthat12252008.png"/gt;
<node label="Tornado" data="http://www.scheckelhoffs.org/images/itsatornado12252008.png"/gt;
<node label="Whooped" data="http://www.scheckelhoffs.org/images/dawg-ron-0011.png"/>
</node>
</node>
</mx:XMLList>
<mx:HDividedBox>
<mx:Panel id="panel_1" title="Photo Selector">
<mx:Label
width="100%"
text="Dawgs are King"/>
<mx:Tree id="tree_1" dataProvider="{dawgiedata}" labelField="@label" width="100%" height="100%" itemOpen="onOpenItem(event);"
change="onChange(event);"/>
</mx:Panel>
<mx:Panel id="panel_2"
width="710" height="530" fontSize="12" styleName="normalStyle"
title="Scheckelhoffs.org Photo Viewer aka [Dawg Picture Viewer] Version 1.0.3"">
<mx:TextArea id="textarea_1" width="100%" height="1" text="Loading Dawgs ... "/>
<mx:ProgressBar id="prog_1" width="100%" source="image_1" />
<mx:HBox>
<mx:Image source="@Embed('../assets/dawgeula2.png')"
id="image_1" width="100%" height="95%" scaleContent="false" showEffect="Wipe" />
</mx:HBox>
</mx:Panel>
</mx:HDividedBox>
<mx:HBox horizontalAlign="center">
<mx:Label text="Hint: Click small triangle control to open folders" width="100%" />
<mx:Button label=" EULA " id="button_1" buttonDown="onButtonClick(event);" width="100%"/>
</mx:HBox>
</mx:Application>
The foregoing code comprises approximately 65 lines of script. Try putting a similar look and feel on
any web browser application with any other back-end methodology, or in javascript for that matter, in under
65 lines of code and you might find it to be tough going. The result would be unlikely to mimic a native mode GUI
in responsivness. To be fair, the xml is compiled (in an intermediate step) by the SDK compilers into more verbose
code, but projects
cost money by the line. The coder does less work (fewer lines) and costs less money.
The creators of this SDK product have the real deal going on with this technology.
The slightly improved version 1.0.5, below, uses the HTTPService object to retrieve the tree list ...
Dynamic Tree Fill
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.......com/2006/mxml" creationComplete="onComplete(event);">
<!--- Copyright Datazygte, Inc. 2009, Contributor: Ron Scheckelhoff
The user is granted a limited, non exclusive right to use the program.
To the extent of any applicable laws, this program is supplied without
any warranty, implied or otherwise. The program is supplied "as is".
In no event shall the copyright holders, authors, or contributors be
held liable for any damages whatsoever, direct or indirect, however
caused, and on any theory of liability or tort law.
The program is licensed under the MPL-1.1 OS license, and the details
relating to the use of that license may be found at:
http://www.opensource.org/licenses/mozilla1.1.php
-->
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.messaging.messages.*;
import mx.rpc.events.ResultEvent;
import mx.collections.XMLListCollection;
import mx.graphics.*;
import mx.core.BitmapAsset;
import mx.events.*;
import mx.controls.*
[Embed(source="../assets/dawgeula4.png")]
[Bindable]
public var imageClass:Class;
[Bindable]
private var xmllistcolRemoteTreeData:XMLListCollection;
//
// when changing nodes
//
private function onChange(event:Event):void
{
if (event.currentTarget.selectedItem.@data)
{
textarea_1.text = event.currentTarget.selectedItem.@data;
// Special effects trigger on visible flag? - not sure if needed
image_1.visible=false;
image_1.visible=true;
image_1.load(textarea_1.text);
}
}
//
// App inst completion event handler
//
private function onComplete(event:Event): void
{
// Send out for the tree list
httpservice_1.send();
}
//
// when opening folders
//
private function onOpenItem(event:TreeEvent):void
{
textarea_1.text = event.item.@label;
}
//
// Button click
//
private function onButtonClick(event:Event):void
{
var imageObject:BitmapAsset = new imageClass() as BitmapAsset;
image_1.source=imageObject;
Alert.show(" Click to accept EULA",
" This program requires that the user accept the EULA", Alert.OK, this);
tree_1.invalidateList();
}
//
// Return data (success) handler
//
private function onReturnData(event:ResultEvent): void
{
xmllistcolRemoteTreeData = new XMLListCollection(XMLList(event.result.node));
tree_1.invalidateList();
}
// Return data (failure) handler
private function onHTTPError(event:FaultEvent): void
{
Alert.show("Error ",
"Error: Could not populate movie list.", Alert.OK, this);
}
]]>
</mx:Script>
<mx:Style>
.normalStyle
{
background-color: #94aab5;
}
</mx:Style>
<!--- Set up HTTPService with data return and failure callbacks -->
<mx:HTTPService id="httpservice_1" url="http://www.scheckelhoffs.org/moviedawgstreeview.xml" method="GET"
resultFormat="e4x" result="onReturnData(event);" fault="onHTTPError(event);" />
<mx:HDividedBox height="100%">
<mx:Panel id="panel_1"
width="250"
height="530"
fontSize="12"
title="Photo Selector">
<mx:Label
width="100%"
text=" *Dawgs are King, Cats lowly*"/>
<mx:Tree id="tree_1"
dataProvider="{xmllistcolRemoteTreeData}" labelField="@label" width="100%"
height="100%" itemOpen="onOpenItem(event);"
change="onChange(event);"/>
</mx:Panel>
<mx:Panel id="panel_2"
width="710" height="530" fontSize="12" styleName="normalStyle"
title="Scheckelhoffs.org Photo Viewer aka [Dawg-Picture-Viewer] Version 1.0.5">
<mx:TextArea id="textarea_1" width="100%" height="1" text=""/>
<mx:ProgressBar id="prog_1" height="5" width="100%" source="image_1" styleName="normalStyle" />
<mx:HBox horizontalAlign="center">
<mx:Image source="@Embed('../assets/dawgeula4.png')"
id="image_1" width="100%" height="100%" scaleContent="false" showEffect="Dissolve" />
</mx:HBox>
</mx:Panel>
</mx:HDividedBox>
<mx:HBox horizontalAlign="center">
<mx:Label text="Hint: Click small triangle control to open folders" width="100%" />
<mx:Button label=" EULA " id="button_1" buttonDown="onButtonClick(event);" width="100%"/>
</mx:HBox>
</mx:Application>
Source code for version 1.0.5 may be found at:
www.fourcalorieservers.com/smallprojects/dawg-photo-viewer-1.0.5.tar.gz
Source code for version 1.0.6 may be found at:
www.fourcalorieservers.com/smallprojects/dawg-photo-viewer-1.0.6.tar.gz
Source code for version 1.0.8 may be found at:
www.fourcalorieservers.com/smallprojects/dawg-photo-viewer-1.0.8.tar.gz
Source code for version 1.0.9 may be found at:
www.fourcalorieservers.com/smallprojects/dawg-photo-viewer-1.0.9.tar.gz
CHANGES.TXT version file
In the source code tarball, one will find the xml directory, which contains the xml data file for the remote loading of the treeview. In addition, there is a crossdomain.xml file which may be used to test a project that draws from two domains. An example is when you are using the stand alone player to debug a file locally, but your remote xml data is on another internet web server. The player will not complain much about the cross-domain attempt, but your data will not load (security measure). If there is a problem with HTTPService operation, it is most likely related to security. (My three hours discovering this is donated to you).
Note, the crossdomain.xml file must be in the root directory of the html document structure on your server. You may note that, in the source code, I have pointed to the remote treeview-loading xml to be in the root directory as well. Also note that the crossdomain.xml file is wide open (* = allow all). This may need to be
modified for individual user requirements.
Note the little intro riff in the sound clip is my own. I snatched my daughters guitar for a few minutes to do it (had to brush
the dust off of it. :-)
To listen to instructions for the viewer, if you have firefox, click:
.
1The SDK and the product that is the subject of this review is the Flex product of Adobe Systems. Adobe is not affiliated with this site or it's owners in any way whatsoever. More info at:
http://www.adobe.com
2 Flash, Flex, AIR, and mxml are all trademarks or terms otherwise related to Adobe Systems, and are not associated
with this site in any way.
Contact: (For this site, Fourcalorieservers.com) - Ron Scheckelhoff -- Email suggestions to: rscheckelhoff@fourcalorieservers.com
( )