Connecting to a Data Source

From Apache OpenOffice Wiki
Jump to: navigation, search

The first step to access the configuration database is to connect to a configuration data source.

To obtain a provider instance ask the global for a Typically the first lines of code to get access to configuration data look similar to the following:

  // get my global service manager 
  XMultiServiceFactory xServiceManager = (XMultiServiceFactory)UnoRuntime.queryInterface(
  XMultiServiceFactory.class, this.getRemoteServiceManager(
  final String sProviderService = "";
  // create the provider and remember it as a XMultiServiceFactory
  XMultiServiceFactory xProvider = (XMultiServiceFactory)

This code creates a default The most important interface a implements is that is used to create further configuration objects.

The always operates in the user mode, accessing data on behalf of the current user and directing updates to the user's personal layer.

The backend data store has several shared layers. One of these layers is used to store shared default data. The files for this layer are located in the share directory of the Apache OpenOffice installation. Additionally, there are special layers that are used by the Extension Manager for deploying configuration data associated with extensions. For details, see Extensions.

Arguments can be provided that determine the default behavior of views created through this The following parameter may be used for this purpose:

Parameter Name Type Default Comments
Locale string The user's locale. This parameter was called "locale" in a former version. The old name is still supported for compatibility.

Documentation caution.png The default configuration provider obtained when no arguments are given will always be the same object. Be careful not to call dispose() on this shared

If you provide any arguments, then a new instance is created. You must then call dispose() on this

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