The Active Extension

From Apache OpenOffice Wiki
< Documentation‎ | DevGuide
Revision as of 16:05, 24 December 2020 by DiGro (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



(As of OpenOffice.org 3.3)

If the same extension is installed in the user and shared repository, then it is expected that only the one in the user repository is used. In other words it "hides" the one in the shared repository. This, however, was never the case (until now). It only worked if both extensions contained exactly the same items, such as services, configuration items, etc. However, two different versions of an extension often have different contents. For example, they may have different menu entries. Then the entries from both extensions would be displayed.

In case of having the same contents, one could rely on the underlying facilities, such as configuration manager, service manager, type description provider, to prefer the respective contents of the user extension over those of the shared extension. However, these facilities have no notion of an extension. For example, if the user and shared extension (having the same extension identifier) contain a service Foo, then the service manager will provide the service Foo of the user extension. If the shared extension also contained the service Bar, which is not in the user extension, then the service manager must not offer this service. To do this, the service manager would need the information, which extension contains the service. Similar all other facilities which process extension contents, like the configuration manager, need the association between a particular item and the respective extension.

The active extension solves this "hiding problem". It makes sure that an extension in a repository with a higher priority completely hides the same extension in a repository with a lower priority. This is done without extending all those facilities in a way so that they can deal with extensions. Instead, the extension manager determines which extension may be used an which not. And this is how it works exactly:

There is a fixed hierarchy of repositories:

  1. user (highest priority)
  2. shared
  3. bundled (lowest priority)

This means that there can be three extensions with the same identifier. But only the one in the repository with the highest priority can be the active extension, unless it is disabled. Only disabling of user extensions is supported.

Only the active extension can be used in Apache OpenOffice. For example, if one extension is in all repositories, then only the services from the active extension will be used. In the following explanation we assume that extensions have the same identifier, when speaking of extensions in different repositories, unless otherwise noted.

A user extension hides the shared extension, which in turn hides the bundled extension. If there is a user extension then it is always the active extension independent of its version and if there are extensions in the shared or bundled repository.

A shared extension can only be an active extension if there is no or a disabled user extension. Again, the version of the shared extension and the fact that there may be a bundled extension do not matter. A bundled extension can only be an active extension if there are no shared or user extension. There may be, however, a disabled user extension.

An extension becomes active if it is registered (registerPackage) after having revoked (revokePackage) those extensions with the same identifier in other repositories. This means that of all the extensions with the same identifier in the different repositories, there is at most one registered at a time. For example:

  1. user extension: registered
  2. shared extension: revoked
  3. bundled extension: revoked

or

  1. no user extension
  2. shared extension: registered
  3. bundled extension: revoked

or

  1. no user extension
  2. no shared extension
  3. bundled extension: registered


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages