summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-03-22 12:35:33 +0100
committerJoachim Lingner <jl@openoffice.org>2010-03-22 12:35:33 +0100
commit15fc598b58ea019ce0eede756b062d3821503ba4 (patch)
tree967c7de3d90205360d1599ae94a73c8025359591
parent1ba274302f3404e4ecd8a65108fbf6dd530da780 (diff)
jl152 import 263440 from native0jl: #i77196# removing of bundled/shared extension (except python, script) works now
-rw-r--r--offapi/com/sun/star/deployment/ExtensionRemovedException.idl53
-rw-r--r--offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl64
-rw-r--r--offapi/com/sun/star/deployment/XPackage.idl40
-rw-r--r--offapi/com/sun/star/deployment/XPackageRegistry.idl52
-rw-r--r--offapi/com/sun/star/deployment/XPackageTypeInfo.idl8
-rw-r--r--offapi/com/sun/star/deployment/makefile.mk42
6 files changed, 216 insertions, 43 deletions
diff --git a/offapi/com/sun/star/deployment/ExtensionRemovedException.idl b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl
new file mode 100644
index 000000000000..1534ff48420f
--- /dev/null
+++ b/offapi/com/sun/star/deployment/ExtensionRemovedException.idl
@@ -0,0 +1,53 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VersionException.idl,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_COM_SUN_STAR_DEPLOYMENT_EXTENSIONREMOVEDEXCEPTION_IDL
+#define INCLUDED_COM_SUN_STAR_DEPLOYMENT_EXTENSIONREMOVEDEXCEPTION_IDL
+
+#include "com/sun/star/uno/Exception.idl"
+
+module com { module sun { module star { module deployment {
+
+interface XPackage;
+
+/**
+ indicates that a function call with the given arguments is not supported
+ because the extension was removed. <member>XPackage::isRemoved</member> will
+ return true on that object.
+
+
+*/
+exception ExtensionRemovedException: com::sun::star::uno::Exception {
+
+};
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl
new file mode 100644
index 000000000000..98d672dd7cc2
--- /dev/null
+++ b/offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: VersionException.idl,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_COM_SUN_STAR_DEPLOYMENT_INVALIDREMOVEDPARAMETEREXCEPTION_IDL
+#define INCLUDED_COM_SUN_STAR_DEPLOYMENT_INVALIDREMOVEDPARAMETEREXCEPTION_IDL
+
+#include "com/sun/star/uno/Exception.idl"
+
+module com { module sun { module star { module deployment {
+
+interface XPackage;
+
+/**
+ indicates that <member>XPackageRegistry::bindPackage</member> was previously
+ called with a different value for the <code>removed</code> parameter and that
+ the <type>XPackage</type> object created by that call still exist.
+
+*/
+exception InvalidRemovedParameterException: com::sun::star::uno::Exception {
+ /** the value of the <code>removed</code> parameter which was used in
+ <member>XPackageRegistry::bindPackage</member> to create the currently
+ existing <type>XPackage</type> object.
+ */
+ boolean PreviousValue;
+ /**
+ the <type>XPackage</type> that was already bound to the provided
+ <code>url</code> paramter during
+ <member>XPackageRegistry::bindPackage</member>.
+
+ <p>Must not be <NULL/>.</p>
+ */
+ XPackage Extension;
+};
+
+}; }; }; };
+
+#endif
diff --git a/offapi/com/sun/star/deployment/XPackage.idl b/offapi/com/sun/star/deployment/XPackage.idl
index 89bd48b7a9ce..06adc5ae6194 100644
--- a/offapi/com/sun/star/deployment/XPackage.idl
+++ b/offapi/com/sun/star/deployment/XPackage.idl
@@ -33,6 +33,7 @@
#include <com/sun/star/beans/StringPair.idl>
#include <com/sun/star/deployment/DeploymentException.idl>
#include <com/sun/star/deployment/XPackageTypeInfo.idl>
+#include <com/sun/star/deployment/ExtensionRemovedException.idl>
#include <com/sun/star/graphic/XGraphic.idl>
#include <com/sun/star/lang/XComponent.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
@@ -96,6 +97,7 @@ interface XPackage
[in] boolean installed,
[in] string aContextName)
raises (DeploymentException,
+ ExtensionRemovedException,
com::sun::star::ucb::CommandFailedException,
com::sun::star::ucb::CommandAbortedException);
@@ -116,6 +118,7 @@ interface XPackage
boolean checkDependencies(
[in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
raises (DeploymentException,
+ ExtensionRemovedException,
com::sun::star::ucb::CommandFailedException);
@@ -152,6 +155,7 @@ interface XPackage
[in] com::sun::star::task::XAbortChannel xAbortChannel,
[in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
raises (DeploymentException,
+ ExtensionRemovedException,
com::sun::star::ucb::CommandFailedException,
com::sun::star::ucb::CommandAbortedException,
com::sun::star::lang::IllegalArgumentException);
@@ -182,6 +186,9 @@ interface XPackage
/** Gets packages of the bundle.
+ If <member>isRemoved</member> returns true then getBundle may return an
+ empty sequence in case the object is not registered.
+
@param xAbortChannel
abort channel to asynchronously abort the registration process,
or null
@@ -225,7 +232,8 @@ interface XPackage
@return
the textual version representation
*/
- string getVersion();
+ string getVersion()
+ raises (ExtensionRemovedException);
/** returns the location of the package.
@@ -240,14 +248,16 @@ interface XPackage
@return
display name of the package
*/
- string getDisplayName();
+ string getDisplayName()
+ raises (ExtensionRemovedException);
/** returns a description string to describe the package.
@return
description
*/
- string getDescription();
+ string getDescription()
+ raises (ExtensionRemovedException);
/** returns a sequence of update information URLs.
@@ -258,8 +268,8 @@ interface XPackage
@return
update information URLs
*/
- sequence<string> getUpdateInformationURLs();
-
+ sequence<string> getUpdateInformationURLs()
+ raises (ExtensionRemovedException);
/** returns the publisher info for a package, the strings
might be empty, if there are no publisher
@@ -269,8 +279,8 @@ interface XPackage
represents the URL to the publisher.
*/
- ::com::sun::star::beans::StringPair getPublisherInfo();
-
+ ::com::sun::star::beans::StringPair getPublisherInfo()
+ raises (ExtensionRemovedException);
/** returns the <type>XPackageTypeInfo</type>, e.g. media-type etc.
@return
@@ -293,8 +303,10 @@ interface XPackage
[in] string newTitle,
[in] long nameClashAction,
[in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
- raises (com::sun::star::ucb::CommandFailedException,
- com::sun::star::ucb::CommandAbortedException);
+ raises (
+ ExtensionRemovedException,
+ com::sun::star::ucb::CommandFailedException,
+ com::sun::star::ucb::CommandAbortedException);
/** returns an icon for a package.
@@ -305,11 +317,19 @@ interface XPackage
database application window, or <NULL/> if the default icon
should be used.
*/
- com::sun::star::graphic::XGraphic getIcon( [in] boolean highContrast );
+ com::sun::star::graphic::XGraphic getIcon( [in] boolean highContrast )
+ raises (ExtensionRemovedException);
/** returns the name of the repository where this object comes from.
*/
string getRepositoryName();
+
+ /** indicates if this object represents a removed extension or extension
+ item. This is the case when it was created by providing
+ <code>true</code> for the <code>removed</code> parameter in the function
+ <member>XPackageRegistry::bindPackage</member>.
+ */
+ boolean isRemoved();
};
}; }; }; };
diff --git a/offapi/com/sun/star/deployment/XPackageRegistry.idl b/offapi/com/sun/star/deployment/XPackageRegistry.idl
index 7f0b8c5c42d4..a54a155a08f4 100644
--- a/offapi/com/sun/star/deployment/XPackageRegistry.idl
+++ b/offapi/com/sun/star/deployment/XPackageRegistry.idl
@@ -30,6 +30,7 @@
#include <com/sun/star/deployment/XPackage.idl>
#include <com/sun/star/deployment/XPackageTypeInfo.idl>
+#include <com/sun/star/deployment/InvalidRemovedParameterException.idl>
#include <com/sun/star/beans/StringPair.idl>
@@ -46,19 +47,48 @@ interface XPackageRegistry
thus the process of binding must not be an expensive operation, because
it is not abortable.
+ Calling the function several time with the same parameters must result
+ in returning the same object.
+
+ The file or folder at the location where url points to may not exist or
+ it was replaced. This can happen, for example, when a bundled extension
+ was removed by the setup and a user later starts OOo. Then the user data
+ may still contain all registration data of that extension, but the
+ actual extension files do not exist anymore. The registration data must
+ then be cleaned of all the remains of that extension. To to that one
+ creates an <type>XPackage</type> object on behalf of that extension and
+ calls <member>XPackage::revokePakage</member>. The parameter
+ <code>removed</code> indicates this case. The returned object may not
+ rely on the file or folder to which refers <code>url</url>. Instead it
+ must use previously saved data to successfully carry out the revocation
+ of this object (<member>XPackage::revokePackage</member>).
+
+ The implementation must ensure that there is only one instance of
+ <type>XPackage</type> for the same <code>url</code> at any
+ time. Therefore calling <member>bindPackage</member> again with the same
+ <code>url</code> but different <code>mediaType<code> (the exeption is,
+ if previsously an empty string was proveded to cause the determination
+ of the media type) or <code>removed</code> parameters will cause an
+ exception. An <type
+ scope="com::sun::star::lang">IllegalArgumentException</type> will be
+ thrown in case of a different <code>mediaType</code> parameter and a
+ <type>InvalidRemovedParameterException</type> is thrown if the
+ <code>removed</code> parameter is different.
+
+ The <code>identifier</code> parameter must be provided when
+ <code>removed</code> = true. If not, then an <type
+ scope="com::sun::star::lang">IllegalArgumentException</type> will be
+ thrown.
+
@param url
package URL, must be UCB conform
@param mediaType
media type of package, empty string if to be detected
- @param noFileAccess
- true - the implementation may not try to access the files referenced
- by the parameter url. This is useful when the files are already
- removed, but the respective XPackage object haven not been
- revoked yet. Then the caller can obtain an XPackage object for the
- removed extension and call XPackage.revokePackage.
- The implementation can throw an
- <type>com.sun.star.lang.IllegalArgumentException</type> if it does
- not support this.
+ @param removed
+
+ @param identifier
+ the identifier of the extension
+
@param xCmdEnv
command environment for error and progress handling
@return
@@ -67,9 +97,11 @@ interface XPackageRegistry
XPackage bindPackage(
[in] string url,
[in] string mediaType,
- [in] boolean noFileAccess,
+ [in] boolean removed,
+ [in] string identifier,
[in] com::sun::star::ucb::XCommandEnvironment xCmdEnv )
raises (DeploymentException,
+ InvalidRemovedParameterException,
com::sun::star::ucb::CommandFailedException,
com::sun::star::lang::IllegalArgumentException);
diff --git a/offapi/com/sun/star/deployment/XPackageTypeInfo.idl b/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
index 2f53d003c315..7252f73d200b 100644
--- a/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
+++ b/offapi/com/sun/star/deployment/XPackageTypeInfo.idl
@@ -29,7 +29,7 @@
#define INCLUDED_com_sun_star_deployment_XPackageTypeInfo_idl
#include <com/sun/star/uno/XInterface.idl>
-
+#include <com/sun/star/deployment/ExtensionRemovedException.idl>
module com { module sun { module star { module deployment {
@@ -52,7 +52,8 @@ interface XPackageTypeInfo
@return
description
*/
- string getDescription();
+ string getDescription()
+ raises (ExtensionRemovedException);
/** returns a short description string to describe a package type
(one line only).
@@ -60,7 +61,8 @@ interface XPackageTypeInfo
@return
description
*/
- string getShortDescription();
+ string getShortDescription()
+ raises (ExtensionRemovedException);
/** returns a file filter string for the file picker user interface.
Both, the short description string and file filter string
diff --git a/offapi/com/sun/star/deployment/makefile.mk b/offapi/com/sun/star/deployment/makefile.mk
index 40e87297710e..1931bc6e4fe3 100644
--- a/offapi/com/sun/star/deployment/makefile.mk
+++ b/offapi/com/sun/star/deployment/makefile.mk
@@ -35,27 +35,29 @@ PACKAGE = com$/sun$/star$/deployment
.INCLUDE : $(PRJ)$/util$/makefile.pmk
IDLFILES = \
- DeploymentException.idl \
- XPackageTypeInfo.idl \
- XPackage.idl \
- XPackageRegistry.idl \
- PackageRegistryBackend.idl \
- XPackageManager.idl \
- XPackageManagerFactory.idl \
- XExtensionManager.idl \
- ExtensionManager.idl \
- thePackageManagerFactory.idl \
- DependencyException.idl \
- LicenseException.idl \
- VersionException.idl \
- InstallException.idl \
- UpdateInformationEntry.idl \
- XUpdateInformationProvider.idl \
- UpdateInformationProvider.idl \
- XPackageInformationProvider.idl \
- PackageInformationProvider.idl \
+ DeploymentException.idl \
+ XPackageTypeInfo.idl \
+ XPackage.idl \
+ XPackageRegistry.idl \
+ PackageRegistryBackend.idl \
+ XPackageManager.idl \
+ XPackageManagerFactory.idl \
+ XExtensionManager.idl \
+ ExtensionManager.idl \
+ thePackageManagerFactory.idl \
+ DependencyException.idl \
+ LicenseException.idl \
+ VersionException.idl \
+ InstallException.idl \
+ UpdateInformationEntry.idl \
+ XUpdateInformationProvider.idl \
+ UpdateInformationProvider.idl \
+ XPackageInformationProvider.idl \
+ PackageInformationProvider.idl \
LicenseIndividualAgreementException.idl \
- PlatformException.idl
+ PlatformException.idl \
+ InvalidRemovedParameterException.idl \
+ ExtensionRemovedException.idl
.INCLUDE : target.mk
.INCLUDE : $(PRJ)$/util$/target.pmk