summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/registry/package
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2006-03-06 09:22:49 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2006-03-06 09:22:49 +0000
commitdd56253b2c46595e8a4548b3b0f9d430b3505ffa (patch)
tree2aaa189e121fb44a69926d9362479932bfefe47d /desktop/source/deployment/registry/package
parent00dccc9c68a59e6039dc7312f38c0887dae80a01 (diff)
INTEGRATION: CWS dbo510 (1.7.40); FILE MERGED
2006/02/15 10:40:37 dbo 1.7.40.2: #i59034# using containerToSequence() 2005/11/01 22:16:00 dbo 1.7.40.1: adopted to ServiceDecl Issue number: Submitted by: Reviewed by:
Diffstat (limited to 'desktop/source/deployment/registry/package')
-rw-r--r--desktop/source/deployment/registry/package/dp_package.cxx51
1 files changed, 39 insertions, 12 deletions
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 0e140375da..a5ddfa190f 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: dp_package.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 17:30:56 $
+ * last change: $Author: rt $ $Date: 2006-03-06 10:22:49 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -39,10 +39,14 @@
#include "dp_interact.h"
#include "rtl/uri.hxx"
#include "cppuhelper/exc_hlp.hxx"
+#include "cppuhelper/implbase1.hxx"
#include "ucbhelper/content.hxx"
#include "svtools/inettype.hxx"
#include "comphelper/anytostring.hxx"
+#include "comphelper/makesequence.hxx"
+#include "comphelper/sequence.hxx"
#include "com/sun/star/lang/WrappedTargetException.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/beans/UnknownPropertyException.hpp"
#include "com/sun/star/io/XOutputStream.hpp"
#include "com/sun/star/io/XInputStream.hpp"
@@ -71,8 +75,11 @@ namespace backend {
namespace bundle {
namespace {
+typedef cppu::ImplInheritanceHelper1<PackageRegistryBackend,
+ lang::XServiceInfo> ImplBaseT;
+
//==============================================================================
-class BackendImpl : public PackageRegistryBackend
+class BackendImpl : public ImplBaseT
{
class PackageImpl : public ::dp_registry::backend::Package
{
@@ -165,9 +172,15 @@ public:
BackendImpl(
Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext,
- OUString const & implName,
Reference<deployment::XPackageRegistry> const & xRootRegistry );
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() throw (RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( OUString const& name )
+ throw (RuntimeException);
+ virtual Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (RuntimeException);
+
// XPackageRegistry
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
getSupportedPackageTypes() throw (RuntimeException);
@@ -177,9 +190,8 @@ public:
BackendImpl::BackendImpl(
Sequence<Any> const & args,
Reference<XComponentContext> const & xComponentContext,
- OUString const & implName,
Reference<deployment::XPackageRegistry> const & xRootRegistry )
- : PackageRegistryBackend( args, xComponentContext, implName ),
+ : ImplBaseT( args, xComponentContext ),
m_xRootRegistry( xRootRegistry ),
m_xBundleTypeInfo( new Package::TypeInfo(
OUSTR("application/vnd.sun.star.package-bundle"),
@@ -207,6 +219,25 @@ void BackendImpl::disposing()
PackageRegistryBackend::disposing();
}
+// XServiceInfo
+OUString BackendImpl::getImplementationName() throw (RuntimeException)
+{
+ return OUSTR("com.sun.star.comp.deployment.bundle.PackageRegistryBackend");
+}
+
+sal_Bool BackendImpl::supportsService( OUString const& name )
+ throw (RuntimeException)
+{
+ return getSupportedServiceNames()[0].equals(name);
+}
+
+Sequence<OUString> BackendImpl::getSupportedServiceNames()
+ throw (RuntimeException)
+{
+ return comphelper::makeSequence(
+ OUString::createFromAscii(BACKEND_SERVICE_NAME) );
+}
+
// XPackageRegistry
//______________________________________________________________________________
Sequence< Reference<deployment::XPackageTypeInfo> >
@@ -618,8 +649,7 @@ void BackendImpl::PackageImpl::exportTo(
xContext->getServiceManager()->createInstanceWithContext(
OUSTR("com.sun.star.io.Pipe"), xContext ), UNO_QUERY_THROW );
xManifestWriter->writeManifestSequence(
- xPipe, Sequence< Sequence<beans::PropertyValue> >(
- &manifest[ 0 ], manifest.size() ) );
+ xPipe, comphelper::containerToSequence(manifest) );
// write buffered pipe data to content:
::ucb::Content manifestContent(
@@ -1040,10 +1070,7 @@ Reference<deployment::XPackageRegistry> create(
args[ 1 ] <<= cachePath;
args[ 2 ] <<= readOnly;
}
- return new BackendImpl(
- args, xComponentContext,
- OUSTR("com.sun.star.comp.deployment.bundle.PackageRegistryBackend"),
- xRootRegistry );
+ return new BackendImpl( args, xComponentContext, xRootRegistry );
}
} // namespace bundle