At the moment, there are the following 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 applet and layout
This is still being developed, but is an interaction area where the more conversational parts of the student-tutor interaction take place.
It should work in Mozilla and Internet Explorer. It will not work in Opera (seeming lack of support for JSObject setMember)
-
Collected client demo
A demo showing Jade, the Interaction Area, and the Server Client Translation Applet linked together, along with a
Dummy XMLRPC Server (since there is no server attached, this applet just makes pre-coded dumb responses). Should work in
Mozilla 1.2.1, Opera 7.20, Internet Explorer 6. Will not work in Opera 7.11 or Konqueror.
-
Collected client demo (without Jade)
This demo doesn't have Jade on the page (so it's a lot smaller download, but a bit less impressive).
Low-level APIs into modified Jade
These functions have been implemented:
- setValue(String module, String xpath, String value)
Sets the value of an element in the schematic. Module is unused (and should be
empty) - it is reserved for future cases where we might have multiple schematics
displayed in a single Jade applet instance. Note, this can't set a value of an
element that does not exist (including as-yet unset attributes)
- setAttribute(String module, String xpath, String name, String value)
Sets an attribute on the elements resolved by the xpath. Can be used to set
new or existing attributes. Name elements often cannot be set because Jade
does not support renaming things on the fly.
- setValue(String xpath, String value)
As above, but withoud the module argument.
- setAttribute(String xpath, String name, String value)
As above, but withoud the module argument.
JavaDoc for all the rest...
JavaDoc for the other client-side components are here
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
Low-level API for HTML Interaction Area
See this class's
JavaDoc.