Deprecated: Assigning the return value of new by reference is deprecated in /customers/7/b/4/mashupstation.com/httpd.www/Wikka/libs/Wakka.class.php on line 130 Deprecated: Assigning the return value of new by reference is deprecated in /customers/7/b/4/mashupstation.com/httpd.www/Wikka/libs/Wakka.class.php on line 261 Deprecated: Function set_magic_quotes_runtime() is deprecated in /customers/7/b/4/mashupstation.com/httpd.www/Wikka/wikka.php on line 90 Deprecated: Function ereg() is deprecated in /customers/7/b/4/mashupstation.com/httpd.www/Wikka/libs/Wakka.class.php on line 441 mashupstation.com: JDA Emulator

mashupstation.com : JdaEmulator

HomePage :: FAQ :: Examples :: Manage files :: Forum :: Links :: Recently Commented :: Login

JDA Emulator

Now the MAYA Design Inc. has released the 0.95 beta version of JDA, this emulator will probably be of more historical interest :). However, I'll use this space to add tips and examples for JDA.

JDA is basically a javascipt microkernel along the same lines as Spring or Hivemind for Java. The wiring of the js components are done in the HTML page, inside div's (or whatever) with special attributes, that's all! So you don't need any <really-easy-to-read> XML anymore. Yay!.

From the foundry page;
What JDA is

* HTML-based black box composition specification
* Javascript black box packaging specification
* An asynchronous message-passing microkernel written in Javascript
* An attempt to promote evolutionary design and to bring about seamless interoperability to the Web
* An attempt to once again give rise to the spirit of tinkerers on the Web!


2007-02-02


Now the Fourth example is up, with fisheye-menu, resizing, moving and some more! :)

2007-01-30


OK. Now the third example is up, which shows a bit more functionality using infotron wiring. I start with the simple button component, which starts the posting of the form infotron. That infotron goes over each input element in turn (yes, it's just a demo) and post a [name]=value array to its output terminal. In the page, the element looks like this;
<div id="dappitchooserform"
		impl="~6B5EAB0E6AD4483e84D3D5EF14C80005"
		script="Form.0.1.js"
		connections=" 'result' : [['converturl', 'input']]">
		<form id="dappform" onsubmit="return false;" border="1">
			<table>
				<tr><td>Dapp Search:</td><td><input type="text" name="query"></input></td></tr>
				<tr><td>Format:</td><td><input type="text" value="json" name="outputFormat"></input></td></tr>			
			</table>
		</form>
	</div>

And it would obviously have been easy to add more input elements. Also, the name of the value in the ouput array is the 'name' attribute.

Then, the output of the form infotron is wired to the input terminal of the Ajax proxy wrapper, which builds a target url based on the base url of the enclosed <a href> element, and (if defined) a series of foo=17&bar=4711 from the provided input message.

Then, the result of the ajax call (the post to the output terminal of the ajax infotron) is wired to two different infotrons, which provides two views on the returned data. The first infotron is just a textarea, and the other builds a dynamic ul-li tree structure.

The wiring from the proxy looks like this;
<div id="dappitproxy"
		impl="~6B5EAB0E6AD4483e84D3D5EF14C80004"
		script="StationProxy.0.1.js"
		is_proxy = "true"
		connections=" 'result' : [['presenter', 'input'], ['treechooser', 'input']]">
		<a impl="http://www.dappit.com/websiteServices/dapp-search.php?query=health&outputFormat=json" rel="rpc" href="http://www.dappit.com/websiteServices/dapp-search.php?query=health&outputFormat=json"></a>
</div>


I hope this shows clearer, the strength of JDA when prototyping application and quickly see another view of incoming data.

Also, as you ight have guessed what I really built is a small search interface for looking up dapp scraper from dappit.com. For some rason,you can't run it twice, and I only parse json at the moment.

2007-01-29


OK. People are clamoring for more specifics. I'll try to rant down quickly the basics, and try not to go overboard too quickly;

1) A Blueprint is a .js file which registers itself with the microkernel. It defines input and output terminals for any infotron based on it, as well as handler functions for the input terminals. It can look like this;
BLUEPRINT("~6B5EAB0E6AD4483e84D3D5EF14C80005",
	[
		["start", "parseForm", 10]
	],
	[
		"result"
	],
	function(Class)
	{
		Class.prototype._onInit = function(props)
		{
			__star.debug("Mashup Station Form Infotron 0.1 _onInit called");
		};

		Class.prototype._onStartUp = function(msg)
		{
			
		}
	
		Class.prototype.parseForm = function(msg)
		{
			__star.debug("Form parseForm called");
			var elements = this.dom_node.getElementsByTagName('input')
			var outarr = new Array();
			for (var e in elements)
			{
				var el = elements[e].value;
				if (el)
				{
					var name = elements[e].name;
					outarr[name] = el;
					__star.debug("Form adding input element "+name+" -> "+el);
				}
			}
			this.postMessage("result", outarr);
		}

		return Class;
	}, "Mashup Station Form Infotron 0.1");

2) When declaring an infotron, it is defined as an "instance" of a blueprint, and inside the web page it can look like this;
	<div id="dappitchooserform"
		impl="~6B5EAB0E6AD4483e84D3D5EF14C80005"
		script="Form.0.1.js"
		connections=" 'result' : [['converturl', 'input']]">
		<form id="dappform" onsubmit="return false;" border="1">
			<table>
				<tr><td>Dapp Search:</td><td><input type="text" name="query"></input></td></tr>
				<tr><td>Format:</td><td><input type="text" value="json" name="outputFormat"></input></td></tr>			
			</table>
		</form>
	</div>


2007-01-26


We have a second demo which demonstrates wiring together three elements, one which is an Ajax cross-domain proxy. Simple but more interresting than the first example. Alos with some explanations! Incredible! :)

2007-01-24


Finally the 0.1 version is finished! You can grab the very untidy but commented js source Here, or check out the humble but working testpage that wires together two infotrons, with the second one coming straight out ot the Maya examples.


There are 1507 comments on this page. [Display comments]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.2002 seconds