Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: deployment ::

deprecated unpublished interface XPackageManager
Base Interfaces
XPackageManager
┣ ::com::sun::star::lang::XComponent
┗ ::com::sun::star::util::XModifyBroadcaster

::com::sun::star::lang::XComponent
Description
interface to notify disposing
::com::sun::star::util::XModifyBroadcaster
Description
interface to notify changes of the set of deployed packages of this manager
Usage Restrictions
deprecated
not published
Deprecation Info
Use XExtensionManager.
Description
The XPackageManager interface is used to add or remove packages to a specific repository. This interface represents a particular repository. Packages are deployable files, e.g. scripts or UNO components.

Adding an UNO package means that a copy of the package is stored in the repository.

Removing an UNO package means that the previously added package is removed from the repository.

All interface methods do neither register nor revoke an extension. This happens exclusively by XExtensionManager.

Objects of this interface are created using the XPackageManagerFactory service resp. the singleton /singletons/com.sun.star.deployment.thePackageManagerFactory .

Since
OOo 2.0
See also
thePackageManagerFactory

Methods' Summary
getContext returns the underlying deployment context, that is, the name of the repository..  
getSupportedPackageTypes gets the supported XPackageTypeInfos.  
createAbortChannel creates a command channel to be used to asynchronously abort a command.  
addPackage adds an UNO package. The properties argument is currently only used to suppress the license information for shared extensions.  
importExtension adds an extension. This copies the extension. If it was from the same repository, which is represented by this XPackageManager insterface, then nothing happens.  
removePackage removes an UNO package.  
getDeployedPackage gets a deployed package.  
getDeployedPackages gets all currently deployed packages.  
reinstallDeployedPackages Expert feature: erases the underlying registry cache and reinstalls all previously added packages. Please keep in mind that all registration status get lost.  
isReadOnly indicates that this implementation cannot be used for tasks which require write access to the location where the extensions are installed.  
synchronize synchronizes the extension database with the contents of the extensions folder. Added extensions will be added to the database and removed extensions will be removed from the database.  
getExtensionsWithUnacceptedLicenses 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.  
checkPrerequisites checks if the extension can be used. The extension must be managed by this package manager, that is, it must be recorded in its database. The package manager calls XPackage::checkPrerequisites and updates its data base with the result. The result, which is from Prerequisites will be returned.  
Methods' Details
getContext
string
getContext();

Description
returns the underlying deployment context, that is, the name of the repository..
Returns
underlying deployment context
getSupportedPackageTypes
sequence< XPackageTypeInfo >
getSupportedPackageTypes();

Description
gets the supported XPackageTypeInfos.
Returns
supported XPackageTypeInfos.
createAbortChannel
::com::sun::star::task::XAbortChannel
createAbortChannel();

Description
creates a command channel to be used to asynchronously abort a command.
Returns
abort channel
addPackage
XPackage
addPackage( [in] string  url,
[in] sequence< ::com::sun::star::beans::NamedValue >  properties,
[in] string  mediaType,
[in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
adds an UNO package. The properties argument is currently only used to suppress the license information for shared extensions.
Parameter url
package URL, must be UCB conform
Parameter properties
additional properties, for example, that the license is to be suppressed (if supported by the extension)
Parameter mediaType
media-type of package, empty string if to be detected
Parameter xAbortChannel
abort channel to asynchronously abort the adding process, or null
Parameter xCmdEnv
command environment for error and progress handling
Returns
XPackage handle
importExtension
XPackage
importExtension( [in] XPackage  extension,
[in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
adds an extension. This copies the extension. If it was from the same repository, which is represented by this XPackageManager insterface, then nothing happens.
Parameter extension
Parameter xAbortChannel
abort channel to asynchronously abort the adding process, or null
Parameter xCmdEnv
command environment for error and progress handling
Returns
XPackage handle
removePackage
void
removePackage( [in] string  identifier,
[in] string  fileName,
[in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
removes an UNO package.
Parameter identifier
package identifier
Parameter fileName
package file name
Parameter xAbortChannel
abort channel to asynchronously abort the removing process, or null
Parameter xCmdEnv
command environment for error and progress handling
getDeployedPackage
XPackage
getDeployedPackage( [in] string  identifier,
[in] string  fileName,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::lang::IllegalArgumentException );

Description
gets a deployed package.
Parameter identifier
package identifier
Parameter fileName
package file name
Parameter xCmdEnv
command environment for error and progress handling
Returns
XPackage handle
getDeployedPackages
sequence< XPackage >
getDeployedPackages( [in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
gets all currently deployed packages.
Parameter xAbortChannel
abort channel to asynchronously abort the removing process, or null
Parameter xCmdEnv
command environment for error and progress handling
Returns
all currently deployed packages
reinstallDeployedPackages
void
reinstallDeployedPackages( [in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
Expert feature: erases the underlying registry cache and reinstalls all previously added packages. Please keep in mind that all registration status get lost.

Please use this in case of suspected cache inconsistencies only.

Parameter xAbortChannel
abort channel to asynchronously abort the adding process
Parameter xCmdEnv
command environment for error and progress handling
isReadOnly
boolean
isReadOnly();

Description
indicates that this implementation cannot be used for tasks which require write access to the location where the extensions are installed.

Normally one would call a method and handle the exception if writing failed. However, a GUI interface may need to know beforehand if writing is allowed. For example, the Extension Manager dialog needs to enable / disable the Add button depending if the user has write permission. Only the XPackageManager implementation knows the location of the installed extensions. Therefore it is not possible to check "externally" for write permission.

synchronize
boolean
synchronize( [in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException );

Description
synchronizes the extension database with the contents of the extensions folder. Added extensions will be added to the database and removed extensions will be removed from the database.
Parameter xAddedExtension
new extensions which may need to be registered.
Parameter removed
extensions which must be revoked
Returns
If true - then at least one extension was removed or added. Otherwise nothing was chaned.
getExtensionsWithUnacceptedLicenses
sequence< XPackage >
getExtensionsWithUnacceptedLicenses( [in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException );

Description
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.
checkPrerequisites
long
checkPrerequisites( [in] XPackage  extension,
[in] ::com::sun::star::task::XAbortChannel  xAbortChannel,
[in] ::com::sun::star::ucb::XCommandEnvironment  xCmdEnv )
raises( DeploymentException,
::com::sun::star::ucb::CommandFailedException,
::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::lang::IllegalArgumentException );

Description
checks if the extension can be used. The extension must be managed by this package manager, that is, it must be recorded in its database. The package manager calls XPackage::checkPrerequisites and updates its data base with the result. The result, which is from Prerequisites will be returned.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.