Update Service

From Apache OpenOffice Wiki
Jump to: navigation, search

Introduction

The Update Service for AOO/OOo is a service which provides via HTTP or HTTPS an Update Feed (or an Update Document) for installed AOO/OOo instances. This allows a requesting AOO/OOo instance to check if a new AOO version is available and to provide the result of this check to the user.

Currently, the Update Service is implemented via static HTTP/HTTPS resources. No dynamic component is involved which processes the information given in the HTTP/HTTPS request of the AOO/OOo instance in order to generate a response.

Available Update Feeds

For the following AOO/OOo versions an Update Feed is made available. The table contains the UpdateURL which an AOO/OOo instance of the specified version is requesting via HTTP/HTTPS and the resource in our svn repository which serves the HTTP/HTTPS resource behind the UpdateURL.

AOO/OOo version UpdateURL Resource in svn repository
OOo 3.2 https://www.openoffice.org/projects/update34/ProductUpdateService/check.Update ooo-site/update34
OOo 3.2.1 https://www.openoffice.org/projects/update35/ProductUpdateService/check.Update ooo-site/update35
OOo 3.3 https://www.openoffice.org/projects/update36/ProductUpdateService/check.Update ooo-site/update36
AOO 3.4.0 https://www.openoffice.org/projects/update38/ProductUpdateService/check.Update ooo-site/update38
AOO 3.4.1 https://www.openoffice.org/projects/update/aoo341/check.Update ooo-site/update/aoo341
AOO 4.0.0 https://ooo-updates.apache.org/aoo40/check.Update updates-site/aoo40
AOO 4.0.1 https://ooo-updates.apache.org/aoo401/check.Update updates-site/aoo401
AOO 4.1.0 https://ooo-updates.apache.org/aoo410/check.Update updates-site/aoo410
AOO 4.1.1 https://ooo-updates.apache.org/aoo411/check.Update updates-site/aoo411
AOO 4.1.2 https://ooo-updates.apache.org/aoo412/check.Update updates-site/aoo412
AOO 4.1.3 https://ooo-updates.apache.org/aoo413/check.Update updates-site/aoo413
AOO 4.1.4 https://ooo-updates.apache.org/aoo414/check.Update updates-site/aoo414
AOO 4.1.5

currently empty

https://ooo-updates.apache.org/aoo415/check.Update updates-site/aoo415

The Update Feeds for versions 3.2 to 3.4.1 are part of the user website content. Thus, a changed Update Feed needs to be published - as it is needed for changed usual user website content. The Update Feeds for versions 4.0.0 to 4.1.5 only need to be changed as its publication is done automatically by certain services provided by ASF Infra.

Update Feeds can be generated by using the bash script and corresponding meta data which is available at genUpdateFeed.

Update Notification Protocol

Introduction

Since version 2.0.3 OpenOffice.org users of builds providing an UpdateURL can manually check for available updates by invoking "Help -> Check for Updates .." . Starting with version 2.0.4 OpenOffice.org can perform this check automatically in a user configurable interval.

This is an attempt to define a second version of the update notification protocol, which is better extendable, can also be used for extensions and no longer uses http post requests.

Documentation note.png Note: Even though this document is a draft, it seems to be the actually implemented version as of OpenOffice.org 3.3. See http://s.apache.org/e2u for more information.

Request

The update notification request is a http get request to an URL, which may contain the operating system and processor type the OpenOffice instance is compiled for either as part of the URL or as URL parameter.

Examples

UpdateURL=http://update.services.openoffice.org/ProductUpdateService/check.Update2?_OS=Solaris&_ARCH=SPARC
UpdateURL=http://www.example.org/MyProduct/MyOS/MyArch

User-Agent field

To reduce the amount of transfered data when asking for OpenOffice.org updates, the user agent field contains all information required to identify a specific build:

User-Agent: OpenOffice.org/2.2 (680m212 (Build:9263); Solaris; SPARC; BundledLanguages=en-US_fr)

Accept-Language field

To be able to return language specific feeds, OpenOffice.org sets the Accept-Language http request header field to the UI language currently in use:

Accept-Language: en-GB

Update documents and feeds

The simplest possible reply is of the following form:

<?xml version="1.0" encoding="utf-8"?>
<inst:description xmlns:inst="http://installation.openoffice.org/description">
  <inst:id>OpenOffice.org_2_en-US_fr</inst:id>
  <inst:version>2.2.0-5</inst:version>
  <inst:buildid>9095</inst:buildid>
  <inst:os>Solaris</inst:os>
  <inst:arch>SPARC</inst:arch>
  <inst:update type="text/html" src="http://update.services.openoffice.org/ooo/snapshot.html" />
</inst:description>

As the type attribute of the update tag is "text/html", OOo will pass the URL specified in the src attribute to a browser. If you specify a different type, e.g.

  <inst:update type="application/octet-stream" src="http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=solarissparcwjre&lang=en-US&version=2.4" />

OOo will download the referenced file itself.


The other supported reply format, which also allows to include several components or several versions of a single component, is to embed the update document in an atom feed.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang”en-US”>
 
  <title>OpenOffice.org Update Feed</title>
  <link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
  <updated>2006-11-06T18:30:02Z</updated>
  <author>
    <name>The OpenOffice.org Project</name>
    <uri>http://openoffice.org</uri>
    <email>updatefeed@openoffice.org</email>
  </author>
  <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566e9d</id>
  <entry>
    <title>OpenOffice.org 2.2 available</title>
    <link rel="alternate" type="text/html"
        href="http://update.services.openoffice.org/ooo/snapshot.html"/>
    <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566e9e</id>
    <updated>2006-11-06T18:30:02Z</updated>
    <summary>Click here to go to the download page.</summary>
    <category term="OpenOffice.org_2_en-US_fr" label="OpenOffice.org 2.2 US english/french" />
    <content type="application/xml">
      <inst:description xmlns:inst="http://installation.openoffice.org/description">
        <inst:id>OpenOffice.org_2_en-US_fr</inst:id>
        <inst:version>2.2.0-5</inst:version>
        <inst:buildid>9095</inst:buildid>
        <inst:os>Solaris</inst:os>
        <inst:arch>SPARC</inst:arch>
        <inst:update type="text/html" src="http://update.services.openoffice.org/ooo/snapshot.html" />
      </inst:description>
    </content>
  </entry>
</feed>

description.xml OpenOffice.org 3.x update information example

The following content of a description.xml directly references update information for a German Windows OpenOffice.org 3.3.0:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
<title>Product Update Feed</title>
<link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
<updated>2011-01-01T08:00:02Z</updated>
<author>
        <name>The OpenOffice Project</name>
        <uri>http://openoffice.org</uri>
        <email>updatefeed@openoffice.org</email>
</author>
<id>urn:uuid:76676544</id>
<entry>
        <title>Update available</title>
        <link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
        <id>urn:uuid:76676544</id>
        <!-- IMPORTANT: category MUST be equal with UpdateID in version.ini -->
        <category term="OpenOffice.org_3_de" label="OpenOffice.org update"/>
        <updated>2011-01-01T08:00:02Z</updated>
        <summary>Text below download information (should be localized)</summary>
        <content type="application/xml">
                <inst:description xmlns:inst="http://installation.openoffice.org/description">
                        <inst:id>OpenOffice.org_3_de</inst:id>
                        <inst:version>'new version information'</inst:version>
                        <!-- buildid must be higher as installed version -->
                        <inst:buildid>9580</inst:buildid>
                        <inst:os>Windows</inst:os>
                        <inst:arch>x86</inst:arch>
                        <!-- app/octet-stream generates direct download as background-process -->
                        <!--<inst:update type="application/octet-stream" src="http://download.services.openoffice.org/files/localized/de/3.3.0/OOo_3.3.0_Win_x86_install-wJRE_de.exe"/>-->
                        <!-- text/html opens src-link in default browser -->
                        <inst:update type="text/html" src="http://download.openoffice.org"/>
                </inst:description>
        </content>
</entry>
</feed>

Note: to allow proper filtering, the term tag of the <category> node of the <atom:entry> element must contain the <inst:id> string of the component to be updated.


Extension developers might prefer to link to the update description file instead of embedding it:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang”en-US”>
 
  <title>My Extention Update Feed</title>
  <link rel="alternate" type="text/html" href="http://update.services.openoffice.org/ooo/snapshot.html"/>
  <updated>2006-11-06T18:30:02Z</updated>
  <author>
    <name>Extension Developer</name>
    <uri>http://example.org</uri>
    <email>update@example.org</email>
  </author>
  <id>urn:uuid:a4ccd383-1dd1-11b2-a95c-0003ba566e9d</id>
  <entry>
    <title>Version 2 available</title>
    <link rel="alternate" type="text/html"
        href="http://example.org/myextension/latest.html"/>
    <id>MyExtension+version</id>
    <updated>2006-11-06T18:30:02Z</updated>
    <category term="MyExtension" label="My Extension" />
    <content type="application/xml" src="http://example.org/myextension/latest/myextension.update.xml" />
  </entry>
</feed>

Note: to allow proper filtering, the term tag of the <category> node of the <atom:entry> element must contain the <identifier> value of the extension to be updated.

A glance on the code for the Apache OpenOffice 3.4 release

The following describes some deeper insight of the "Check for Updates..." code in the office. It should help us to re-activate a corresponding web service when Apache OpenOffice 3.4 has been released. (Do we need a real web service? Something to be discussed.)

The information given here is based on the work of Regina (regina at apache dot org), Ariel (arielch at apache dot org) and Kay (kschenk at apache dot org) found in the corresponding mailing list thread on ooo-dev - see http://s.apache.org/e2u. Having this information gave me (orw at apache dot org) the right pointers for deeper investigations.

summary information about request to <UpdateURL>

The <UpdateURL>, found in file <version.ini> resp. <versionrc> of the office installation is typically an HTTP URL. The office sends a GET request to this URL. Two header fields are included in this request which are already mentioned above. These are "Accept-Language" and "User-Agent".

  • "Accept-Language" contains the language of current locale - found in configuration item "org.openoffice.Setup/L10N", attribute "ooLocale"
  • "User-Agent" contains needed information to identify the installed office version - see above. The information matches the following pattern which is found in file <version.ini> resp. <versionrc>:
<PRODUCT> (${buildid}; ${_OS}; ${_ARCH}; BundledLanguages=${AllLanguages}) 

On platforms other than Windows the <UpdateURL> contains (at least since OOo 3.3) a query part. It is ?pkgfmt=<pkgformat> which especially for Linux platforms identifies the package format of the office installation.

It reveals that this information can be used to create the corresponding information for the request response.

information about processing the request response

The response is expected to be a corresponding XML snippet. As shown in the above examples, two types of XML snippets as responses are possible: a feed response and a simple response. The distinction between the two is made by its first element. If it is <feed> it is treated as a feed response, otherwise as a simple response.

simple response

The simple response is an XML snippet which is expected to have the format as the XML snippet in file update.xml, found in our source repository.

The following conditions must hold to perform further evaluation of the response:

  1. value of <inst:os> matches the one of the installed office - ${_ARCH}.
  2. value of <inst:arch> matches the one of the installed office - ${_OS}.
  3. value of <inst:buildid> is greater than the one of the installed office - ${buildid}.

If these conditions hold, the following information is retrieved:

  1. values of attributes <src> and <type> of <inst:update>
    • if value of <type> equals "text/html", the value of <src> is taken as an website from which the new version can be downloaded manually. Otherwise (also in case that attribute <type> is missing) the value of <src> is interpreted as a download link to the new version.
    • all <inst:update> elements are evaluated. The information of the first one is used - provide download of version or provide link to download website. The purpose of the other is not known.
  2. value of <inst:version> - will be shown in the corresponding dialog.
  3. value of <inst:buildid> - currently its purpose is not known.

If the first information - download website or download link - can be found in the XML snippet, the corresponding dialog will state that a new version is available. The user can then download it manually or can trigger an automatic download.

If no download website/link is found, the dialog will state that the installed office is up to date.

feed response

The feed response is expected to conform to atom feed - as stated above in the example area. Each content of the <content> element of an atom entry (<entry> element) whose <category> element has an attribute <term> whose value matches the <UpdateId> value found in file <version.ini> resp. <versionrc> of the installed office is treated as simple response.

The first of these simple responses from which a download website or a download link could be retrieved that matches the above given conditions is taken - the following ones are not processed. It will be shown to the user that a new version is available, and the user can trigger the download manually or automatically. One further information is taken from this atom entry - the content of the <summary> element. It is shown in the corresponding dialog.

If no download website/link is found, the dialog will state that the installed office is up to date.

Personal tools