ooodev.adapter.deployment.package_partial module

class ooodev.adapter.deployment.package_partial.PackagePartial(component, interface=com.sun.star.deployment.XPackage)[source]

Bases: ModifyBroadcasterPartial, ComponentPartial

Partial class for XPackage.

Parameters:
  • component (XPackage) –

  • interface (UnoInterface | None) –

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

Constructor

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

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

Return type:

None

check_dependencies(cmd_env)[source]

checks if the dependencies for this package are still satisfied

After updating the OpenOffice.org, some dependencies for packages might no longer be satisfied.

since

OOo 3.2

Raises:
  • DeploymentExceptionDeploymentException

  • ExtensionRemovedExceptionExtensionRemovedException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

Return type:

bool

Parameters:

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

check_prerequisites(abort_channel, cmd_env, alreadyInstalled)[source]

Checks if the package can be installed.

Only if the return value is TRUE the package is allowed to be installed. In case of FALSE or in case of an exception, the package must be removed completely. After return of this function no code from the extension may be used anymore, so that the extension can be safely removed from the hard disk.

Raises:
  • DeploymentExceptionDeploymentException

  • ExtensionRemovedExceptionExtensionRemovedException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

Return type:

int

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

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

  • alreadyInstalled (bool) –

create_abort_channel()[source]

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

Return type:

XAbortChannel

export_to(dest_folder_url, newTitle, name_clash_action, cmd_env)[source]

Exports package to given destination URL.

Raises:
  • ExtensionRemovedExceptionExtensionRemovedException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.ucb.ContentCreationExceptionContentCreationException

Return type:

None

Parameters:
  • dest_folder_url (str) –

  • newTitle (str) –

  • name_clash_action (int) –

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

get_bundle(abort_channel, cmd_env)[source]

Gets packages of the bundle.

If isRemoved() Returns TRUE then getBundle may return an empty sequence in case the object is not registered.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

Tuple[XPackage, ...]

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

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

get_description()[source]

Returns a description string to describe the package.

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

str

get_display_name()[source]

Returns the display name of the package, e.g.

for graphical user interfaces (GUI).

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

str

get_icon(high_contrast)[source]

Returns an icon for a package.

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

XGraphic

Parameters:

high_contrast (bool) –

get_identifier()[source]

Returns the unique extension identifier.

Return type:

Any

get_license_text()[source]

Returns a string containing the license text.

Raises:
  • DeploymentExceptionDeploymentException

  • ExtensionRemovedExceptionExtensionRemovedException

Return type:

str

get_name()[source]

Returns the file name of the package.

Return type:

str

get_package_type()[source]

Returns the XPackageTypeInfo, e.g.

media-type etc.

Return type:

XPackageTypeInfo

get_publisher_info()[source]

Returns the publisher info for the package, the strings might be empty, if there is no publisher

com.sun.star.beans.StringPair.First represents the publisher name and com.sun.star.beans.StringPair.Second represents the URL to the publisher.

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

StringPair

get_registration_data_url()[source]

return a URL to a directory which contains the registration data.

This data may be created when calling XPackage.registerPackage(). If this is the case is indicated by com.sun.star.beans.Optional.IsPresent of the return value. If registration data are created during registration, but the package is currently not registered, for example after calling XPackage.revokePackage(), then com.sun.star.beans.Optional.IsPresent is TRUE and the com.sun.star.beans.Optional.Value may be an empty string.

Raises:
  • DeploymentExceptionDeploymentException

  • ExtensionRemovedExceptionExtensionRemovedException

Return type:

Any

get_repository_name()[source]

Returns the name of the repository where this object comes from.

Return type:

str

get_update_information_ur_ls()[source]

Returns a sequence of update information URLs.

The sequence may be empty in case no update information is available. If the sequence contains more than one URL, the extra URLs must mirror the information available at the first URL.

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

Tuple[str, ...]

get_url()[source]

Returns the location of the package.

Return type:

str

get_version()[source]

Returns the textual version representation of the package.

A textual version representation is a finite string following the BNFversion .= [element (. element)*]element .= (0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)+

Raises:

ExtensionRemovedExceptionExtensionRemovedException

Return type:

str

is_bundle()[source]

Reflects whether this package is a bundle of one or more packages, e.g.

a zip (legacy) package file or a document hosting script packages.

Return type:

bool

is_registered(abort_channel, cmd_env)[source]

Determines whether the package is currently registered, i.e.

whether it is active.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

Return type:

Any

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

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

is_removed()[source]

Indicates if this object represents a removed extension or extension item.

This is the case when it was created by providing True for the removed parameter in the function XPackageRegistry.bindPackage().

Return type:

bool

register_package(startup, abort_channel, cmd_env)[source]

Registers this XPackage.

NEVER call this directly. This is done by the extension manager if necessary.

Raises:
  • DeploymentExceptionDeploymentException

  • ExtensionRemovedExceptionExtensionRemovedException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • startup (bool) –

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

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

revoke_package(startup, abort_channel, cmd_env)[source]

revokes this XPackage.

NEVER call this directly. This is done by the extension manager if necessary.

Raises:
  • DeploymentExceptionDeploymentException

  • com.sun.star.ucb.CommandFailedExceptionCommandFailedException

  • com.sun.star.ucb.CommandAbortedExceptionCommandAbortedException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

Return type:

None

Parameters:
  • startup (bool) –

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

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