Core Installers

When package is installed, every available Installer Service is given an opportunity to process the package. This section describes the operations performed by each of the core installers. In the descriptions, the term "target package" refers to the package that is being installed.

Class Installer

Namespace http://www.xoe.org/installer/class

The class installer creates a dedicated classloader for the target package loads all included class files. The target package's dependencies are processed and classloader links created to any package that matches one or more of the dependencies. This allows the target package to refer by name to any class included in a package it depends on.

In addition, the Class Installer will check the currently installed packages to see if they have a dependency that is matched by the target package. If so, it will create a classloader link between that package and the target package.

Resource Installer

Namespace http://xoe.org/installer/resource

The resource installer copies any resource files (those included in the resources/ subdirectory of the package archive) into the package's Stash directory (typically stash:/installed-packages/<package-name>/.)

The resource installer will also process the file shortcuts.xml if it finds it in the package's resources. The shortcuts file has the following structure:


      <shortcuts>
      <lnk file="some-package-resource.file" shortcut="ShortcutName"/>
      ...
      </shortcuts>
   

Each <lnk /> element requests a shortcut to be made to the specified package resource file. The shortcut will have the specified name plus the extension '.lnk'. It will be created inside the Stash application directory (currently stash:/home/default/apps). The 'shortcut' attribute may specify subdirectories relative to the application directory. If those directories don't exist they will be created.

When the package is uninstalled all resources and shortcuts will be removed.

Binding Installer

Namespace http://www.xoe.org/installer/binding

Tag bindings map a (namespace qualified) XML tag name to a java class. The class should be a subclass of org.xoe.core.dom.XElement. When XML files are parsed into DOM trees by XOE, the specified class will be instantiated to represent any elements with the matching name and namespace. The installer looks for a file named bindings.xml in the target package's resources. The file has the following structure:

	       
      <bindings>
      <space xmlns="http://www.w3.org/1999/xhtml">
      
      <default class="org.xoe.display.dom.Unknown"/>
      <bind tag="body" class="org.xoe.display.dom.xhtml.Emphasis"/>
      <bind tag="head" class="org.xoe.display.dom.Ignore"/>
      ...
      </space>
      </bindings>
   

The default tag specifies a class to be used for any tag that is not specifically mentioned in a bind tag. Each bind tag maps a tag to a class. The class must be defined in the same package. The namespace of the bind/default tag is the one used to qualify the tag name that is specified. The most convenient way to specify the namespace is on the parent space tag (thus applying it to all children). Tag bindings are automatically unregistered when the package is uninstalled. If multiple packages register bindings for the same fully qualified tag name, the most recent one takes precedence. If that package is uninstalled, the most recent one prior to that takes effect.

Mimetype Installer

Namespace http://www.xoe.org/installer/mimetype/mappings

The Mimetype Installer allows a package to map filename suffixes to the mimetypes they represent. The mapping is added to the system during the lifetime of the package and removed when the package is uninstalled. If multiple packages map the same suffix to different mimetypes the most recent mapping is used (if the most recent mapping is uninstalled the next most recent mapping is used).

Packages specify mimetype mappings by including a file called mimetypes.xml in the resources/ directory. This file has the following structure:


	 <mimetype-mappings>
	 <mapping suffix="gif" mimetype="image/gif" />
	 <mapping suffix="jpg" mimetype="image/jpeg" />
	 <mapping suffix="jpeg" mimetype="image/jpeg" />
	 </mimetype-mappings>
      

Native Installer

Namespace http://www.xoe.org/installer/native

The native installer is used to load native libraries. These libraries are loaded into the class loader of the containing package and any package that directly depends on it. Native libraries are identified by their filename suffix. On Linux devices native libraries must have the form *.so[.X][.X]... where X is an integer. The following are valid names for Linux libraries:

On other platforms the naming convention may be different.

Service Installer

Namespace http://www.xoe.org/installer/service

The Service Installer is used to initialize, configure, and register services at package-installation time. Package maintainers provide a list of Service classes and optional XML configuration files in a services.xml file in the package resources. The class providing the service definition may be located in the package registering it or in any depended-upon package. The optional configuration file must be locating in the registering package. services.xml has the following structure:


	 <services>
	 <service class='org.xoe.input.virtual.VirtualKeyboard' config='layouts.xml'/>
	 </services>