Copyright © 2007. All rights reserved.
This document covers the packaging and distribution system used by Joost Widgets.
Any and all use of the Joost API is subject to the Joost API Terms of Use
The API may change and although we will try and keep these changes to a minimum, some API calls may be deprecated in the future.
Joost Widgets can be built using any number of different logical files, containing XML (largely XHTML and SVG), Javascript, CSS, images, and other such resources. Naturally, while this is a common and well-understood development model very similar to Web application programming, it is inconvenient to distribute multiple files at once.
The solution to that is a simple packaging approach, the Joost Open Distribution Archive (JODA). It is basically a simple Zip archive with a manifest; in other words an approach comparable to that taken by JAR archives, Opera Widgets, or Firefox Extensions.
The intent is for this format to evolve into using digital signing in a way that may not be backwards compatible with the current format, despite the fact that the basic elements described here will naturally persist.
As of Joost version 1.0.3 we support config.xml as
well as install.xml, and supports files with the suffix .zip as well as .joda files. More details are below.
The format of the file packaging is Zip archiving [ZIP]. The version supported in the Joost platform is the same as that supported in recent versions of Gecko. In general all the usual Zip archivers should produce packages compatible with Gecko.
Joost supports two layouts for the content of the archive: either the archive is the
root of the widget tree in which case the install.xml or config.xml must be placed there,
or the archive contains a single directory which is then the root and contains
install.xml or config.xml.
Note that the Joost platform will currently use the first install.xml that it finds
as it unpacks the Zip, and consider the path to it inside the archive to be the root.
It is therefore recommended to only have only one install.xml or config.xml in the
entire archive. This behaviour however is subject to change and should not be relied
upon.
The rest of the resources can be placed anywhere inside the root (i.e. at the same level or
deeper than where the install.xml or config.xml file is) and have any name.
install.xml)
The required manifest file install.xml is a very simple and straightforward
XML document. An typical example is presented below:
<widget-manifest xmlns='http://joost.com/ns/widget-manifest#'> <id>http://widgetarians.org/ids/widgets/dahut/</id> <name>The Dahut Widget</name> <website>http://widgetarians.org/widgets/dahut/</website> <main-file>content/dahut.xml</main-file> <icon>content/dahut.png</icon> </widget-manifest>
Going through the example shows just how simple a format it is. First and foremost,
all the elements present above are required except for icon, which is optional (but then you won't have an icon visible for your widget). All the elements must be in the
http://joost.com/ns/widget-manifest# namespace. Their exact order
does not matter.
Elements in other namespaces can be added anywhere, but elements in the same namespace not listed in this section are forbidden. Likewise, attributes in a namespace are allowed on all of these elements, but attributes in the null namespace are forbidden. Furthermore, while elements in foreign namespaces can be added as children of any manifest element, they are forbidden from having textual content.
Let us look at these elements in further detail:
content subdirectory,
but there is no requirement to do so.
content subdirectory, but there is no requirement to do so.
config.xml)
As of Joost version 1.0.3 we support config.xml as well as
install.xml. The basic elements within the file are mostly the same as
in install.xml, but config.xml is slightly
more flexible and has a default for the main-file element.
This means you can have very small config files, for example:
<widget-manifest> <id>http://widgetarians.org/ids/widgets/dahut/</id> <name>The Dahut Widget</name> <website>http://widgetarians.org/widgets/dahut/</website> <main-file>content/dahut.html</main-file> <icon>content/dahut.png</icon> <height>500</height> <width>400</width> </widget-manifest>
These elements must be in the
http://joost.com/ns/widget-manifest# namespace. Their exact order
does not matter.
In further detail:
install.xml but there's no need for the namespace to be declared.
install.xml
install.xml
install.xml
install.xml
jwl:window. Without it, Joost first looks for jwl:window attributes and then uses sensible defaults.
jwl:window. Without it, Joost first looks for jwl:window attributes and then uses sensible defaults.