ScriptX Web Module Documentation
Index:
Introduction,
Building,
Running,
This is the documentation for the ScriptX Web module.
The Web module is a toolkit for integrating ScriptX with World Wide Web
browsers, generating HTML, and implementing interactive services and
distributed multimedia authoring tools.
There are several components of the web module, that work together:
- Classes for automatically generating HTML.
- Lego-like
WebElement
building blocks, for representing hypertext markup structures as ScriptX
objects, that know how to print themselves as HTML.
- Nested structures are represented by
WebGroup
objects, that inherit from
Array,
and can contain strings and other recursively nested elements.
WebGroup subclasses represent HTML structures like
WebPage,
WebHeading,
WebLink,
WebBulletedList,
and
WebParagraph.
- Dynamic
WebMacro,
expands into other elements by calling your function.
Defered evaluation, parameterized by key/value pairs of submitted form.
Very powerful!
- Easy to write new elements and subclass existing ones to make
very interesting high level HTML widgets, like
WebXeroxMapImage
for embeding images of the Earth remotely generated at
Xerox PARC,
WebSelectProp,
for selecting between one of several property values in an interactive dialog,
or
WebObjectAccessor,
for getting and setting the value of a ScriptX variable via a Web form.
The last is especially neat, since it allows you to embed any number of accessors in
a form all pointing to the same externalized target, and the form submission is
handled automatically by the Generic dialog. Totally automatic and stateless!
- Gif exporter, supporting invisibleColor transparency and interlacing.
ScriptX presentations can be dynamically rendered and exported as
GIF images, which can be woven togther with image maps or interactive
services that map user input back to the actual objects in the picture.
- Image map generation utilities, for writing out image maps of
arbitrarily shaped ScriptX objects.
- Web Browser Remote Control Interface. This is an interface to SpyGlass's
cross platform remote control API, that is now supported by NetScape, on both
the Mac via AppleEvents, and Windows via DDE. It allows ScriptX to
interoperate with Web Browsers in many interesting and useful ways.
- "OpenURL" request from ScriptX to Web Browser, so ScriptX can tell
Web Browser to follow links. Useful for bringing up remote web pages,
downloading remote ScriptX title containers, as well as locally displaying
dynamically generated html and gif files.
- Automatic "Helper Application" registration. ScriptX can automatically
register as a helper application for ".sxt" title container files, so it's
not necessary for the user to configure the browser manually, in order to
use ScriptX as a helper application. So whenever the browser opens a URL
of mime type "application/scriptx-title", it will load the title container
into ScriptX automatically. Either the user can click on a link to a title
container, or ScriptX can send the "OpenURL" request to the browser with
the URL of a title container, to download and run it automatically.
- "EchoURL" notification from Web Browser to ScriptX, so ScriptX can
watch the source and destination of every link the browser follows.
Useful for maintaining hot lists, drawing maps, and in combination with
"OpenURL" for managing navigation history.
- Protocol registration, so when the browser opens a URL beginning with
"scriptx:", an "OpenURL" notification is sent from the browser to ScriptX,
which can respond interactivly by dynamically generating html and/or gif.
This is the key to implementing local interactive web services with ScriptX,
using NetScape as an external browser for ScriptX, and implementing
tightly integrated Web authoring tools with ScriptX!
- Web Server, Service, and Dialog classes, for managing OpenURL notifications,
responding to service requests, and handling interactive dialogs.
This is a step on the direction of a high level cross platform native toolkit
interface, as well as a non-intrusive distributed authoring tool framework.
Decouple the native toolkit from ScriptX by using an external Web Browser
via the remote control interface, which will only get richer
and more powerful as OLE and Open Doc support is implemented.
This radically cross platform approach to a native toolkit interface will
also leverage the creation of Web authoring tools in ScriptX.
- The WebServer manages lists of named WebService and WebDialog objects.
- A WebService represents a URL you can open by name,
such as "scriptx:help".
It's defined by a function that returns a string of HTML,
usually by telling a WebPage or WebMacro to print as HTML.
Services are like home pages or entry points for dialogs.
- A WebDialog represents an ongoing conversation with state,
encoded in the URL as key/value pairs, like
"scriptx:dialog=ClassBrowser&class=Collection".
It's defined by a function parameterized by a KeyedLinkedList,
the key value pairs, parsed courtesy of the WebServer.
- All of the HTML printing functions are parameterized by "props",
a KeyedLinkedList of properties, that they pass recursively. So
nested macros and HTML widgets have access to the properties that
the WebDialog was invoked with, and can parameterize themselves
off of those properties.
- An object reference may be externalized to a magic cookie, that can
be embeded in a WebPage, that's later sent back to ScriptX as a link
or a form property, and can then be internalized to return the
original object. This mechanism, in conjunction with hidden form
fields used to store invisible state information, can be used to
encode the state of an ongoing dialog in the web page itself,
including references to arbitrary ScriptX objects, so the WebDialog
objects in ScriptX can be stateless templates, to support multiple
independent views, etc. (Believe me, it's a good thing.)
- Includes a bunch of example services, like a class browser, object browser,
file system browser, arpanet browser, scrolling image browser, scriptx command
input, window snapshot service, etc.
- To make it possible for normal people to write web pages without knowing
HTML, there is a parser for a simple syntax called "Norml",
Network ORiented Markup Languge,
that lets you write paragraphs, links, headings, and outlines in a very simple
format, as well as embed arbitrary html commands without restrictions.
The Norml parser translates Norml text into nested WebElement objects
described above, that may be programatically manipulated and composed
into higher level HTML structures, and printed out as HTML.
There is a service called "scriptx:norml"
that has a text input form for type Norml text,
and a button that compiles it and displays it as formatted HTML.
- The DreamScape demo includes a dynamically loaded part that provides
services to inspect rooms, parts, and their images, with image maps you can
click on to inspect the illustrated objects.