Difference between revisions of "Documentation/DevGuide/Extensions/Extension Layers"

From Apache OpenOffice Wiki
Jump to: navigation, search
Line 23: Line 23:
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Extensions]]
+
[[Category: Documentation/Developers Guide/Extensions]]

Revision as of 13:21, 4 June 2008




The Extension Manager uses two extension layers, the user and the shared layer. Extensions installed in the shared layer can be used by all users whereas those in the user layer can only be used by the user who installed them. An extension can be installed in either layer or both. In the latter case it is necessary to determine what extension is actually used when a client needs to make use of an extension because a client cannot choose the layer.

The idea of layers is that extensions in the top layer obscure the same extensions in the layer below. In other words, the extension in the highest layer will be given preference. Because the user layer is the top layer, a shared extension is only used unless there does not exist the same extension in the user layer.

This, however, is only a simplified model. An extension is never used as a whole. Instead clients access the particular contents, such as components, configuration data, etc. And it is also these contents which obscure the same content in a lower layer. For example, an extension contains a UNO service, which is installed in both layers. When the client instantiates it then the one from the top layer is used.

The version of an extension has no influence on the “selection process”. Even if the shared layer holds a newer version of the extension as the one in the user layer, it will not be used. However, there is a situation where contents of the shared extension are still used. Assuming there are version 1 and version 2 of an extension. Then the different versions may have different content. For example, version 1 may contain a service foo which is not contained in version 2. If now version 1 is installed in the shared layer and version 2 in the user layer then a client can instantiate foo from the shared layer. This is only possible because there is no service foo in the extension of the user layer.

Unprocessed Content

This is content which, as the title indicates, is not processed at all. When installing the extension it is just copied to the install location. One should never try to access this content directly. Instead one should create a configuration entry as part of the same extension which contains the location of the content. When accessing the configuration item then the proper layer is used and one will obtain the correct location of the data.

There may be, however, difficult scenarios. For example, let us extend the previous example where the version 1 of an extension contains the service foo, which is not contained in version 2. Version 1 be installed in the shared layer and version 2 in the user layer. foo uses a piece of data which is also contained in the extension. To find the data foo could use the PackageInformationProvider. That service will, however, return the location of the extension of the user layer in this case. But the data may or may not exist in version 2 or it may be incompatible with the one from version 1 of the extension. Because foo is part of version 1 it may not work with the data from version 2. Another option would be a configuration entry pointing to the file. But if the node name is the same in both versions of the extension, then again, one would obtain the data of the user extension. Obviously, the node name must be different, so that foo gets the data from the extension which it is part of.

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