ooodev.adapter.deployment.extension_manager_partial module

class ooodev.adapter.deployment.extension_manager_partial.ExtensionManagerPartial(component, interface=com.sun.star.deployment.XExtensionManager)[source]

Bases: ModifyBroadcasterPartial, ComponentPartial

Partial class for XExtensionManager.

Parameters:
  • component (XExtensionManager) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.deployment.XExtensionManager)[source]

Constructor

Parameters:
  • component (XExtensionManager) – UNO Component that implements com.sun.star.deployment.XExtensionManager interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XExtensionManager.

Return type:

None

add_extension(url, repository, abort_channel, cmd_env, *properties)[source]

adds an extension.

The properties argument is currently only used to suppress the license information for shared extensions.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

XPackage

Parameters:
  • url (str) –

  • repository (str) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

  • properties (com.sun.star.beans.NamedValue) –

check_prerequisites_and_enable(extension, abort_channel, cmd_env)[source]

check if all prerequisites for the extension are fulfilled and activates it, if possible.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

int

Parameters:
  • extension (com.sun.star.deployment.XPackage) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

create_abort_channel()[source]

creates a command channel to be used to asynchronously abort a command.

Return type:

XAbortChannel

disable_extension(extension, abort_channel, cmd_env)[source]

disable an extension.

If the extension is not from the user repository then an IllegalArgumentException is thrown.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • extension (com.sun.star.deployment.XPackage) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

enable_extension(extension, abort_channel, cmd_env)[source]

enable an extension.

If the extension is not from the user repository then an IllegalArgumentException is thrown.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • extension (com.sun.star.deployment.XPackage) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_all_extensions(abort_channel, cmd_env)[source]

returns a sequence containing all installed extensions.

The members of the returned sequence correspond to an extension with a particular extension identifier. The members are also sequences which contain as many elements as there are repositories. Those are ordered according to the priority of the repository. That is, the first member is the extension from the user repository, the second is from the shared repository and the last is from the bundled repository.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

Tuple[Tuple[XPackage, ...], ...]

Parameters:
  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_deployed_extension(repository, identifier, file_name, cmd_env)[source]

gets an installed extensions.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

XPackage

Parameters:
  • repository (str) –

  • identifier (str) –

  • file_name (str) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_deployed_extensions(repository, abort_channel, cmd_env)[source]

gets all currently installed extensions, including disabled user extensions.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

Tuple[XPackage, ...]

Parameters:
  • repository (str) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_extensions_with_same_identifier(identifier, file_name, cmd_env)[source]

gets all extensions with the same identifier from all repositories.

The extension at the first position in the returned sequence represents the extension from the user repository. The next element is from the shared and the last one is from the bundled repository. If one repository does not contain this extension, then the respective element is a null reference.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

Tuple[XPackage, ...]

Parameters:
  • identifier (str) –

  • file_name (str) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_extensions_with_unaccepted_licenses(repository, cmd_env)[source]

returns all extensions which are currently not in use because the user did not accept the license.

The function will not return any object for the user repository, because a user extension will not be kept in the user repository if its license is declined. Only extensions which are registered at start-up of OOo, that is, shared and bundled extensions, can be returned.

Extensions which allow the license to be suppressed, that is, it does not need to be displayed, and which are installed with the corresponding option, are also not returned.

Extensions returned by these functions are not returned by XExtensionManager.getDeployedExtension() XExtensionManager.getDeployedExtensions() XExtensionManager.getAllExtensions() XExtensionManager.getExtensionsWithSameIdentifier()

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

Tuple[XPackage, ...]

Parameters:
  • repository (str) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

get_supported_package_types()[source]

gets the supported XPackageTypeInfos.

Return type:

Tuple[XPackageTypeInfo, ...]

is_read_only_repository(repository)[source]

determines if the current user has write access to the extensions folder of the repository.

Return type:

bool

Parameters:

repository (str) –

reinstall_deployed_extensions(force, repository, abort_channel, cmd_env)[source]

Expert feature: erases the underlying registry cache and reinstalls all previously added extensions.

Please keep in mind that all registration status get lost.

Please use this in case of suspected cache inconsistencies only.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • force (bool) –

  • repository (str) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

remove_extension(identifier, file_name, repository, abort_channel, cmd_env)[source]

removes an extension.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • identifier (str) –

  • file_name (str) –

  • repository (str) –

  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –

synchronize(abort_channel, cmd_env)[source]

synchronizes the extension database with the contents of the extensions folder of shared and bundled extensions.

Added extensions will be added to the database and removed extensions will be removed from the database. The active extensions are determined. That is, shared or bundled extensions are not necessarily registered (XPackage.registerPackage()).

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

bool

Parameters:
  • abort_channel (com.sun.star.task.XAbortChannel) –

  • cmd_env (com.sun.star.ucb.XCommandEnvironment) –