At the moment, there are two demonstration pages:
-
XPath API to Jade schematics
This demonstrates the Jade schematic editor, modified to run as an applet and take two APIs: setAttribute and setValue. Both of these
APIs use XPath to address into the schematic structure.
-
XML-RPC support applet
This demstrates ClientControllerApplet, which can provide limited bidirectional XML-RPC support to any applet which choses to talk
to it. In this demonstration, Jade uses the ClientControllerApplet to call out with changes the user makes on the schematic, and the response
XML-RPC can be used by the server also to alter the schematic.
Note: Since this demonstration is not linked up to an XML-RPC server, the ClientControllerApplet is operating in debug(no server) mode.
So, the server XML-RPC response will be picked up from the page (when a javascript link is clicked), and the ClientControllerApplet will
simply report to the page whenever the Jade applet tries to make an XML-RPC.
-
Tutor interaction layout prototype
This is an early prototype of a layout for the tutor (with html interaction area). This version is run by JavaScript, has a text-only
API, and is just for visualisation of whether it's a good layout. A Java-enabled version (to link into the XML-RPC support) will follow
shortly
XML format of the Jade data structures
There is no strict schema definition yet, but the structure is made to appear as if it is similar to this example:
<instance module="primitives:nfet-scaled" name="$12">
<property name="$NAME" value="$12" />
<property name="SW" value="2" />
<terminal name="G">
<property name="i" value="NaN" />
<property name="v" value="NaN" />
</terminal>
</instance>
<wire name="wire1">
<property name="i" value="NaN" />
<property name="v" value="NaN" />
</wire>
Note: Wires should only be accessed if they have a name.
Note: setValue on a property will have the same effect as setValue on that property's "value" attribute
Note: The name attributes of properties, terminals and instances cannot be altered. To rename an instance, alter the value attribute of its name property instead.
Note: The module attribute on the instance is not accessible yet.
XML-RPC Support
XML-RPC support is provided by an applet called ClientControllerApplet.
This applet is capable of sending XML-RPCs to a server. The server is specified by the URI and PORT parameters passed to the applet (by the param tags in the HTML).
ClientControllerApplet expects the return data from the server to be a list of strings, each of which would contain the XML of an XML-RPC call.
CientControllerApplet interprets these XML-RPC calls as XML-RPCs the server is making to applets on the same web page, and it will call the public functions
of those applets accordingly. Note: the applets need to have the same "codebase" attribute in the HTML, or ClientControllerApplet won't be able to see them.
Essentially, this allows the applets to receive XML-RPC calls from the server (which they otherwise couldn't do because untrusted applets cannot listen on ports).
The format of the method name is appletName.methodName -- so for example this would be the XML for the server making an XML-RPC to the
setValue function on an applet called "jade":
<?xml version="1.0"?>
<methodCall>
<methodName>jade.setValue</methodName>
<params>
<param>
<value></value>
</param>
<param>
<value>/instance[@name="$12]/terminal[@name="g"]/property[@name="i"]</value>
</param>
<param>
<value>2</value>
</param>
</params>
</methodCall>
Debug
A function on this applet called "testResponseCall" can be used to test XML server responses without connecting to a server.
If the applet has the NO_SERVER parameter set to TRUE, it will not attempt to send XML-RPCs to the server, but instead will attempt to call a JavaScript
function printXmlRpcOutput on the page.
JavaDoc
JavaDoc is here