Processing Extensions

From Apache OpenOffice Wiki
Jump to: navigation, search



(As of OpenOffice.org 3.3)

Checking for modification during start-up

Every time Apache OpenOffice is started it needs to check if extensions were removed from or added to the shared or bundled repository. If this is the case, then the registration data of the repository must be updated accordingly and Apache OpenOffice is restarted.

Because Apache OpenOffice checks for added or removed extensions at start-up, this must be very quick. To achieve this, Apache OpenOffice compares the modification time of extension folders of the repositories with the time of the most recently performed check. This time is “saved” in the file lastsynchronized in the registration data folder of the repositories. In fact, the modification time of the file is used rather then a value is written into the file. If the modification time of the extension folder is more recent, then the extension manager will check if extensions were added or removed and update its database accordingly. This is of course an implementation detail and may change at any time.

Restarting Apache OpenOffice

The restart is necessary to avoid that users use removed shared extensions. Removing a shared extensions does not entail the immediate removal of the the extension files. This is necessary to allow live deployment. For details see Adding a shared extension and Removing a shared extension. The extension manager updates its databases during start-up of Apache OpenOffice an removes entries of removed extension, so that they cannot be used anymore. However, until this has happened services from the removed extension may have been started and menus added to the menu bar.

Even if the extensions are completely removed from the disk, as is the case with removed bundled extensions, remnants can still be visible for the user. This applies particularly for configuration data. The extension manager processes them and creates additional data (registration data), that is configuration data containing expanded URLs. Apache OpenOffice only uses the registration data, which is stored in the user data. Removing the bundled extension, which is done by the installer, does not remove the registration data. This is only done during the start-up when the extension manager runs. But by this time, the configuration manager has already loaded the registration data of the removed extension. Live removal of menu entries does not work yet. Therefore artifacts of removed extensions may still be seen when Apache OpenOffice is run the first after removing the extension.

There are also extensions which do not work well right after they are installed. In other words, they do not support live deployment. This is typically caused by issues in Apache OpenOffice and/or the extension. After restarting Apache OpenOffice, the extensions perform as expected.

Although live deployment issues can be fixed, there is still the problem of removed shared extensions. This could only be solved if one would not allow live deployment of shared extensions.

Adding

Adding a user extension

A user extension is extracted into a folder with a unique name which in turn is contained in the extensions folder. The additional folder with the unique name is necessary to make live deployment possible. When removing an extension, it is only marked as “unusable” and the extension is not deleted, because it may still be in use. If now the same extension is installed again in the same process, then it will be extracted to another folder with a unique name. This prevents a name clash with the folder name of the previously “removed” extension. The user can now repeat to remove and install the extension in the same process. This results in having the same extension multiple times in the extensions folder of the repository, but everyone is contained in a folder with a unique name. The folders of the “removed” extensions, as well as the folders which contain them, are only removed after running the extension manager after restarting Apache OpenOffice.

The extension database of repository is updated and the new active extension is determined.

Adding a shared extension

For the user who adds a shared extension, the extension is processed the same way as a user extension.

For all other users, the extension manager processes the extension the next time they start Apache OpenOffice. The extension database of repository is updated and the new active extension is determined.

Adding a bundled extension

A bundled extension is installed by the installation program of Apache OpenOffice. The folder of the extension, including all files contained therein, is copied into the extensions folder of the bundled repository. Only when a user starts Apache OpenOffice, then the extension manager processes the extension. The extension database of repository is updated and the new active extension is determined.

Removing

Removing a user extension

The entry in the extension database of the repository referring to this extension will be deleted and the active extension will be determined. The extension will be deleted when the user runs the extension manager after restarting Apache OpenOffice.

Removing a shared extension

The extension will be revoked if it was registered. To prevent other users from using the extension it is marked to be deleted. This is done by creating a tag file, the "extension removed file", next to the folder with the unique name. This way, the information that the extension was deleted can be accessed by all users. If this file does not exist and there is no entry in the extensions database, then it is assumed that the extension was added. The file will be deleted when the extension is deleted. The file also contains the name of the user who removed the extension. If the same user runs the extension manager after restarting Apache OpenOffice, then the extension, the unique folder, temp file and the "extensions removed file are deleted. Why it must be the same user shows the following scenario:

A user starts Apache OpenOffice and uses the extension. The extension will then be removed and Apache OpenOffice keeps running. Now a second user, who also has write access to the extensions folder, starts Apache OpenOffice. When the extension manager starts it would properly delete extensions which were previously removed. However in this case this would affect the office of the first user which still uses that extension. The same user cannot start another instance, because this is prevented by the lock file.

For all other users, the extension manager processes the extension the next time they start Apache OpenOffice. This includes the detection of the removed extensions. An extension is regarded as removed if:

  • The unique folder, tmp file, extension folder do not exist anymore.
  • There is a "extension removed file"
  • The extension exists but has a different identifier or version than the one which was previously at the same location. This may happen when the extension was updated, or a previous office update removed the extension and another with the same name was added in the latest office update.

The extension could also have the same file name. The entry in the extension database of the repository referring to this extension will be deleted and the active extension will be determined.

Removing a bundled extension

A bundled extension can only be removed by the set-up. The folder of the extension, including all files contained in it, is deleted from the extension folder of the bundled repository.

If a user starts Apache OpenOffice, then the extension manager processes the removed extension. This includes the detection of the removed extensions. An extension is regarded as removed if:

  • The extension folder do not exist anymore.
  • The extension exists but has a different identifier or version than the one which was previously at the same location.

The entry in the extension database of the repository referring to this extension will be deleted and the active extension will be determined.

Updating

An update consists of first removing the extension and then adding the new extension. That is, this is already covered by these two scenarios.

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