Home · All Classes · Grouped Classes · Annotated · Functions

PackageManager - Browser Integration

This document describes why and how to integrate a browser with PackageManager and how to make Qtopia packages available via a web-page.

Use Case

The basic sequence for a user wanting to install a package is:

  1. Invoke the PackageManager.
  2. Use PackageManager to connect to a web server and display the list of packages offered.
  3. The user selects the required package and installs it

While this approach is functional, there is little the content provider can do to advertise and differentiate their packages. The browser integration enables the user to visit any web site and install packages from there.

The process is now becomes:

  1. A web page offers a list of links to Qtopia package file descriptors which are text files containing information about a package as well as an exact URL indicating the download location.
  2. The user clicks the required link and the descriptor is downloaded and passed to the PackageManager.
  3. The user reads the package requirements.
  4. The user clicks the install button and the package is downloaded and installed.

This package behaves like any other package, that is, it can be un-installed and is subject to SXE security.

Web-Browser Modification

Upon downloading a descriptor file of mime type, application/qtopia-package, the browser needs to:

  1. Create an instance of QDSServices with the requestDataType, application/qtopia-package and attribute, install. (The responseDataType should be "*").
  2. The QDSServices object should contain a QDSServiceInfo object corresponding to PackageManager, use that to create a QDSAction object.
  3. Create a QDSData object with the downloaded qpd file and application/qtopia-package mime type.
  4. Invoke the exec() function of the QDSAction object with the QDSData object as a parameter. Via the services framework, this will invoke PackageManager to begin the installation process and prompt the user to confirm installation.

There are two ways to add this functionality to a web browser:

  1. Integrate it into the web browser code (this may not always be possible due to licensing issues or if the web browser application is in binary format).
  2. Create an application invoked by the browser on recognition of a particular mime type. Contemporary browsers such as Firefox or Opera can be configured in this way. After the Qtopia package descriptor file is downloaded it is passed as a parameter to this application, which implements the above functionality of finding and invoking the PackageManager service.

How to Make a Qtopia Package Available via a Web Page

To make a Qtopia packages available via a web page:

Qtopia Package Descriptor and Web Page

For every package offered for download a Qtopia package descriptor file must be provided. These files contain meta-data about the package which includes a URL indicating the package download location. The mkPackages script is used to generate descriptor file, further details can be found here.

The link on the web page points to the descriptor file and is processed by the PackageManager which extracts the URL and, upon confirmation by the user, downloads and installs the package.

Web Server Configuration

For the browser to detect the Qtopia package descriptor the web server must set the appropriate mime type (application/qtopia-package) in the HTTP header for that file. This means that on the web server a new mime type mapping must be configured for the extension of the Qtopia package descriptor, which is *.qpd.

The following table describes the mime type mapping for two common browsers:

BrowserMapping Instructions
Apache 2Edit the mime.types file, usually found under /etc/apache2 Append a line containing:
    application/qtopia-package qpd
IIS
  • Add mime entries to the following registry location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters\MimeMap by opening the MimeMap key and choosing Edit Value or Add Value.
  • The mime information must be placed in the Value Name box.
  • The data type for the entry must be set to REG_SZ and the string field is left blank.


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3