Example - Software Update

Introduction

This example demonstrates how to install additional components to the Eclipse platform. It is contained in plug-in org.eclipse.update.examples .
 

Running the example

To run the example, you'll need to have an HTTP server available (eg. Apache server). Copy the entire install directory from the example plug-in org.eclipse.update.examples into the HTTP server document tree (eg. htdocs directory for Apache server). Make sure the server is running.

Start the Eclipse workbench. Select Help, then Software Updates, then Add...
On the location page enter the URL of your server (eg. http://my.server/ ... fill in your actual server URL here). The URL needs to  reflect any additional server path elements leading to the install directory you copied. For example, if you copied the install directory into htdocs/examples (so the path is htdocs/examples/install), you would enter the URL as http://my.server/examples.
Press Add and Next>. You should be presented with a list containing installable components. The provided example contains a single component called Update Example. Select it and complete the installation.You'll need to restart the workbench to activate the changes.

Once restarted, you can see the new example function by adding it to your perspectives. Select Perspective, Customize... and then expand Other. Select Sample Action Set (this is an action set implemented by this example plug-in that you just downloaded and installed). A new menu labeled Sample Menu should appear in the workbench with a new action. Clicking the menu action displays an information box (to verify the installation actually worked).
 

Details

The example illustrates the structure required on an HTTP server for downloading Eclipse components. The example consists of a simple plugin that adds a menu and an action to the workbench. The plug-in has been packaged as a component jar using the Plug-in Development tools in the Eclipse workbench (PDE). Note, that the base plug-in directory for org.eclipse.update.examples does not contain the plugin.xml file. Consequently the base plugin does not contribute anything to the workbench. The base plugin contains an install directory that is used in the previous steps.

The install directory that you copied to the HTTP server is the output of building a component jar using the PDE Component Project setup (with one extra "server-side" file added). It contains the following:

install/
    components/
        install.index
        org.eclipse.update.examples.component_1.0.0/
            install.xml
            install.properties
            install_en.properties
            orq.eclipse.update.examples.component_1.0.0.jar

The above directory structure is required to exist on the server. There is a common install root. There is also a common components subdirectory. It contains a subdirectory for each component available for download (in the example case just one, org.eclipse.update.examples.component_1.0.0). The file install.index was manually created (not generated by PDE). It is a simple directory index of component directories (one line per directory). This allows the update client to discover which component directories actually exist on the server.

The actual component as created by PDE is contained in the orq.eclipse.update.examples.component_1.0.0.jar. Its install.xml file that describes the component is also exposed to allow the update support to find out about the component without the need to actually download the jar. The install[_locale].properties files contain separated strings.

Please refer to PDE documentation for additional details of creating component jars. Select Help, then Help Contents and PDE ISV Guide (from the drop box). Please refer to the Eclipse platform documentation for additional details of the installation conventions. Select Help, then Help Contents and Platform Plug-In Developer Guide (from the drop box). The installation information is contained in section Reference, Other Reference Articles, Platform Installation and Update.
 

Copyright IBM Corp. 2000, 2001.  All Rights Reserved.