CREATING YOUR OWN MODULES
One of the main goals during the development of !scribble was to keep the system easily extendible. The author tried to keep the architecture as simple and consistent as possible. Every interested user should be able to create his own modules. The system allows the user to concentrate on the functionality of his script and without having to think about module management and inter-module communication. All these tasks were already addressed in the modules’ ancestor script.
A working module has to contain at least four handlers: Director’s usual constructor
setup(), to define the module’s properties,
getBehaviorDescription(), which returns a description of the module’s functionality and a handler with a freely definable name to compute the module’s output.
These lines containing the new-handler and the property-declaration can be reused without any further modifications:
property ancestor property pPparameters on new me setup(me) ancestor = script("PS-module-superclass").new(me) return me end
The setup handler contains a property list defining the module’s properties. It is recommended to choose short and widely understandable names and to ignore software industry’s dogmas like Hungarian notation.
on setup me pPparameters = [#Factor_A : 1, #Factor_B : 1] end
getBehaviorDescription() returns a string describing the use of the module.
The string is formatted as HTML, line-breaks can be added via <br>, and to illustrate a module’s function it is possible to link to a tutorial file via the <a> tag. The file has to be stored in the example folder next to the application.
on getBehaviorDescription me return "Multiplies Factor_A with Factor_B and returns the product. If Factor_A is 3 and Factor_B is 5, 15 would be returned.<br>Product = Factor_A \* Factor_B<br> <a href='multiplication'>see example</a>" end
A user-defined handler is used to compute the result.
getCurrentparameters() provided by the ancestor script computes all needed values for calculating the final result and returns them in a property list.
on Product me tPparameters = me.getCurrentparameters() return tPparameters.Factor_A * tPparameters.Factor_B end
If additional properties are needed to calculate the final value, but the developer doesn’t want them to show up in the panels, these have to be declared in the normal way and not within the setup handler. If a handler, for instance a procedure for calculating constants, should not be accessible from the GUI, its name has to start with an underscore.
THE SETTINGS FILES
The settings are stored in XML-files. The decision to use XML was based on: human-readable format, broad availability of parsers, structured storage of information and easy up- and downloading via HTTP.
The saved information consists of all used modules and objects, their current static values, the sources of their dynamic values, the filenames of the visual objects and the panels’ positions.
!scribble generates an own folder for each settings file and stores the file itself and all external objects there.
Andrew White’s XML-parser is used for !scribble’s internal XML-parsing.
The source can be obtained for free at http://www.cathode.co.uk/ucon99/.
!scribble’s website and collaborative features are based on a combination of some PHP and vanillaSite.
PHP is responsible for the storage of modules and objects on the server. The functionality is basically uploading files, reporting the content of folders and some HTTP-redirecting.
VanillaSite, a Wiki-Clone developed by Christian Langreiter offers many features suitable for managing interconnected content. On http://www.rinner.st/diploma/ vanillaSite is used to create, edit and display the content and its interconnections. It also proofed helpful for managing the bibliography, the link-collection and outlining.
Both products PHP and vanillaSite are freely available.
More information and downloads can be found at http://www.php.net/ and http://www.langreiter.com/vanilla/.