![]() |
Product implementation | Table of contents | Indexes | XML and XSL from servers to cell-phones | ![]() |
|||
| Fabula | Fabula |
| bi-lingual, multi-media, children’s storybook software based on XML and Mozilla |
Campbell, Eoin ![]() |
| Eoin Campbell |
| Technical Director |
Dublin ![]() Ireland ![]() XML Workshop Ltd. ![]() | XML Workshop Ltd.,
10 Greenmount Industrial Estate, Harold’s Cross Dublin 12 Ireland Phone: +353 1 4547811 Fax: +353 1 4731626 email: ecampbell@xmlw.ie web site: www.xmlw.ie |
| Biography |
| Eoin Campbell – Eoin Campbell founded XML Workshop in 1998, following a number of years as an independent consultant. He has spoken at the following industry conferences: SGML '98. |
| King, Brian |
| Brian King |
| Software Engineer |
Dublin ![]() Ireland ![]() XML Workshop Ltd. ![]() | XML Workshop Ltd.,
10 Greenmount Industrial Estate, Harold’s Cross Dublin 12 Ireland Phone: +353 1 4547811 Fax: +353 1 4731626 email: bking@xmlw.ie web site: www.xmlw.ie |
| Biography |
| Brian King – Brian King joined XML Workshop Ltd. in early 1999, and has worked on the Fabula project for 1 year. |
| Abstract |
The Fabula project |
| Core partners |
| Evaluation partners |
education ![]() | History |
| The technical workshop discussed the overall architecture and goals of the software, and identified the main features required. |
| Between October and March of 1999, the main work concentrated on building a prototype of the Fabula Reader (for viewing stories) using Macromedia Director, developing the Fabula website ( http://www.fabula-eu.org ), and writing the various reports required by the project sponsors. |
| From April until December 1999, development of the software based on Mozilla was carried out in Brighton (Reader) and Dublin (Maker). |
| In January 2000, prototype software, in each of the 9 project languages (Reader) and the 4 major languages (Maker), was released to the evaluation partners for testing in schools. |
| development | Implementation |
Java ![]() | Java |
C++ ![]() | C/C++ |
| Internet Browser | Browser software |
| Mozilla | Mozilla overview |
| XPFE | The User Interface component of Mozilla is called theXPFE . Originally, Netscape maintained multiple parallel development streams to implement Navigator on the major different platforms of Windows, Macintosh and Unix. After the software was released, an ambitious project to develop a cross-platform UI architecture began, in order to avoid this duplication of effort. This resulted in theXUL pronounced 'zool', which is a mechanism for defining standard UI components such as menus, dialog boxes, trees, lists, etc. using a mixture of well-formed XML, based on RDF ideas. A particular set of user interface objects is called a ‘chrome’ in Mozilla terminology, and it is intended to soon be possible to maintain many different chromes for the browser, and switch dynamically between them. |
XUL ![]() | Overall, the XPFE project has been extremely successful, and it is possible to develop complete cross-platform applications without the need for any OS- or Window System-specific knowledge or programming. This seems to fulfil much of the original promise of Java, without the performance hit. |
| features | Fabula software |
| The Fabula project consists of an authoring application, a viewing application, and stories written in the Fabula Markup Language. |
XML ![]() | Story content |
| This section explains the details of the Fabula Markup Language as it is currently used in stories. |
| This code example illustrates that the elements give the story a particular meaning. The <lang1> and <lang2> elements represent the two language panels. Within each one is contained an image. Each language panel contains an optional sound element, ‘audio’. |
| Style | Layout |
XSL ![]() | Style sheets are mechanisms for organising the layout and appearance of XML documents. TheXSL is currently not widely implemented and is not available yet in the Mozilla project. It was therefore deemed unsuitable for the Fabula story layout. |
CSS, Cascading Style Sheets ![]() | TheCSS was chosen for the Fabula project. Mozilla has committed to full support for CSS Level 1 and some support for CSS 2. The benefits of using CSS are: |
|
| Some of the main properties include: |
|
| The styles are attached to the story using the External Style Sheet Declaration, as illustrated with the following syntax: |
<?xml-stylesheet type="text/css" href ="story.css"?> |
XLink ![]() | Linking |
XLink ![]() | Linking is one of the key concepts in a Fabula story. It is used for playing sounds, activating the wordgame and for connecting words. TheXLink , provides a more flexible linking mechanism that standard HTML hyperlinks. |
| HTML contains a link element called the Anchor tag (<A>). This can have two forms, either a marker in text to indicate a location that can be pointed to, or a pointer which points to a location, usually a filename, but also a location within a file. |
HTML Marker: <A NAME="section3"> HTML Pointer: <A HREF="#section3"> |
| HTML offers only a simple, one-way link. A can point to B. B has no inherent knowledge of where A is, or even if there are a number of other pointers C, D, and E, which also point to B. In the Fabula context, a more powerful linking mechanism is required, which supports two-way and multi-point links. XLink is a draft proposal of the W3C that addresses the needs complex definition of relationships between objects. |
| XLink is the appropriate linking mechanism in Fabula because: |
|
| The above mark-up can be described as follows: |
| The <game> element, when used in the story, sets the word game in an active state. This is represented in the story layout as a graphic that appears in both of the language panels. It highlights the participating words in the corresponding panel. The <marker> element contains the word or words that are participating in the wordgame. Each marker has a unique identifier, to make it easy to specify pointers to that piece of text. |
| The actual links, or definitions of relationships between pieces of text, are not defined within the text, but stored separately, in the <linkgroup> section of the page. The separation of the links from the locations is considered good practice in XLink, and offers a number of advantages, including simplicity of the text. Within the <linkgroup> element, the definition of each of the individual links on the page takes place. For Fabula, we consider only the case of in-page links: intra-page links will not be supported. |
| The <linkset> element contains the definition of a single link. |
| In this example, each link is a simple bi-directional link between two and only two marked locations. However, more complex links can be defined. Whether these will be supported in Fabula will depend on the level of implementation reached in both the Maker and Reader. Each <pointer> element defines one endpoint of a link. |
| The software is only using simple XLinks, and not currently harnessing the more powerful extended links. |
XUL ![]() | User interface |
| We chose to adopt the method used in-house in Mozilla to define and create our user-interface (UI). This is the Extensible User-Interface Language (XUL). This technology is an XML application, and is still evolving. It will enable ease of creation and customisability for the Fabula interface. The code does not need to be compiled with the rest of the code base. It harnesses the power of the existing ‘Gecko’ layout engine, which is used for displaying XML and HTML content. |
| XUL (pronounced ‘zuul’) is a mark-up language to define the various widgets and elements that make up a user interface. In effect, interface descriptions are stored as individual files. The descriptions may be in a single file or spread over multiple files. |
| “Somewhere accessible, stored in an application specific form, are hunks of UI description---streams of XML---corresponding to hunks of UI machinery. The app might store these descriptions as individual files; as resources; as database entries; or even remotely to be accessed through URLs.” |
| Grouped together, the user interface elements, resources and files are collectively known as the "chrome". |
| Benefits |
| Here are the most common features of the XUL interface, with examples. It is worth noting that XUL files can have style sheets applied to them, to define such things as size, colour and behaviour of the various items. |
Menu items |
| The interface elements are descriptive, similar to the story elements contained in the storybook XML document. A “menu” contains a set of “menuitem” elements, which are wrapped in a “menupopup” element. This will appear as a standard drop down menu within the application. |
|
| The behaviour of the menu item is defined by a call to a JavaScript function contained in an externally linked file. This can in turn behave a number of ways, such as activating a portion of the C++ code that carries out a particular task, or manipulating the story using the Document Object Model. Each “menuitem” behaves a certain way, and is determined by the "onaction" event. This is set in the “broadcaster” element, which is linked to the “observes” attribute. |
<broadcaster id="Maker:Sound" value="&makerinsertSoundCmd.label;" oncommand="insertSound()"/> |
|
Toolbars |
| The flexibility of XUL enables a break from traditional designs of user interfaces. The Fabula Reader contains two vertical toolbars, while the Maker has one vertical toolbar, located on the left side of the content area. It consists of a number of buttons that carry out some of the most common tasks of the software. |
|
Dialog boxes |
| Dialog boxes will be an integral part of the Fabula interface, as with many applications. The purpose of a dialogue will be to present the author of the story with options when carrying out a particular task. |
| Each dialog is laid out as a separate XUL file, and styled via CSS. |
|
JavaScript — module interaction |
| JavaScript is a Netscape developed scripting language and a scaled back object-oriented language. It is similar in syntax and structure to C/C++ and Java, though apart from these similarities, they are unrelated languages. It is a superset of the ECMA-262 Revision 3 (ECMAScript). |
| If we consider each element of the Fabula software; the story, the user-interface, the C++ code base as a distinct module, then the main tool of interaction between the modules is JavaScript. |
| It is used by the XML story within the Reader to carry out such functions as playing a sound or activating a wordgame. |
| It is used by the XUL user-interface to carry out simple document operations like changing the style properties or adding a new element via the DOM API. |
| It is used as the primary interface into the C++ code to carry out complex operations such as saving the story to disk, or inserting an image. |
|
| This function, when called, returns the user to the cover page of the story. It uses the DOM method – getElementsByTagName – to get a handle on the cover element in the story, and it turns off it’s hidden attribute, thus making it visible. |
| translation | Localisation / internationalisation |
| There are three types of files that need to be localized in Fabula: |
| The DTD files each contain a list of entities that need to be localized. This is an example: |
<!ENTITY windowTitle.label "Insertar sonidos"> |
| Property files are used for storing strings that are used in JavaScript and C++. Each string has a name which is associated a string through the ‘=’ operator. |
SelectSoundFile=Select Sound File |
| This is in turn accessed through an API call, specific to the module you are working in. This is how it would be done, in JavaScript, for the Maker: |
var select = editorShell. GetString("SelectSoundFile");
|
| The chrome registry is a file that contains the paths relating to the location of the various chrome modules. This is currently being re-architectured, and there will soon be in place a mechanism for switching between ‘skins’ (chrome packages) dynamically. |
| We are able to leverage tools that have been developed by third party groups to automate as much as possible this process. One of these tools is the ‘MozillaTranslator’. This enables you to extract the strings from the DTD and Property files into a single glossary. This means that a single file can be sent off to your localisation agent for translation. On return of the localised strings, they can be imported into new locale files. |
| Alpha | Status |
| Alpha prototypes of the Fabula Reader and Maker are available. There is currently an evaluation taking place in schools in participating countries, and the next ‘beta’ release will take into account findings from this evaluation. |
| The software is due for full release in June. It will be available on CD, or via download from the Fabula website. A sample storybook - ‘A Lovely Bunch of Coconuts’ by Dennis Reader - will be published in all five of the minority languages, with a combined print run of approximately 15,000. |
| Acknowledgements |
| A useful introduction to the Mozilla project and the source code is available in the following book: |
| Netscape Mozilla Source Code Guide by William R. Stanek |
| Netscape Press; ISBN: 0764545884 |
| Bibliography |
|
![]() |
Product implementation | Table of contents | Indexes | XML and XSL from servers to cell-phones | ![]() | |||