2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-09-17 08:45:02 +00:00
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
#include "dp_sfwk.hrc"
|
|
|
|
#include "dp_backend.h"
|
|
|
|
#include "dp_ucb.h"
|
|
|
|
#include "dp_parceldesc.hxx"
|
2014-06-04 10:55:43 +02:00
|
|
|
#include <rtl/uri.hxx>
|
|
|
|
#include <ucbhelper/content.hxx>
|
|
|
|
#include <cppuhelper/exc_hlp.hxx>
|
|
|
|
#include <comphelper/servicedecl.hxx>
|
|
|
|
#include <svl/inettype.hxx>
|
2004-07-23 13:20:14 +00:00
|
|
|
#include <com/sun/star/container/XNameContainer.hpp>
|
2013-02-27 15:16:02 +02:00
|
|
|
#include <com/sun/star/script/provider/theMasterScriptProviderFactory.hpp>
|
2012-10-03 13:30:43 +02:00
|
|
|
#include <com/sun/star/xml/sax/Parser.hpp>
|
2004-07-23 13:20:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
using namespace ::dp_misc;
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::ucb;
|
2004-10-22 13:43:20 +00:00
|
|
|
using namespace ::com::sun::star::script;
|
2004-07-23 13:20:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace dp_registry
|
|
|
|
{
|
|
|
|
namespace backend
|
|
|
|
{
|
|
|
|
namespace sfwk
|
|
|
|
{
|
|
|
|
|
2014-02-25 18:19:04 +01:00
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
|
|
|
|
{
|
2004-11-09 13:13:06 +00:00
|
|
|
class PackageImpl : public ::dp_registry::backend::Package
|
|
|
|
{
|
2008-05-20 13:37:24 +00:00
|
|
|
BackendImpl * getMyBackend() const;
|
2004-11-09 13:13:06 +00:00
|
|
|
|
|
|
|
Reference< container::XNameContainer > m_xNameCntrPkgHandler;
|
|
|
|
OUString m_descr;
|
|
|
|
|
|
|
|
void initPackageHandler();
|
|
|
|
|
|
|
|
// Package
|
|
|
|
virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
|
|
|
|
::osl::ResettableMutexGuard & guard,
|
|
|
|
::rtl::Reference<AbortChannel> const & abortChannel,
|
2014-03-26 16:37:00 +01:00
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv ) SAL_OVERRIDE;
|
2004-11-09 13:13:06 +00:00
|
|
|
virtual void processPackage_(
|
|
|
|
::osl::ResettableMutexGuard & guard,
|
|
|
|
bool registerPackage,
|
2010-04-21 16:04:34 +02:00
|
|
|
bool startup,
|
2004-11-09 13:13:06 +00:00
|
|
|
::rtl::Reference<AbortChannel> const & abortChannel,
|
2014-03-26 16:37:00 +01:00
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv ) SAL_OVERRIDE;
|
2004-11-09 13:13:06 +00:00
|
|
|
|
|
|
|
public:
|
2010-05-04 12:37:01 +02:00
|
|
|
PackageImpl(
|
|
|
|
::rtl::Reference<BackendImpl> const & myBackend,
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString const & url, OUString const & libType, bool bRemoved,
|
|
|
|
OUString const & identifier);
|
2004-11-09 13:13:06 +00:00
|
|
|
// XPackage
|
2014-05-27 13:12:02 +01:00
|
|
|
virtual OUString SAL_CALL getDescription()
|
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
virtual OUString SAL_CALL getLicenseText()
|
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
RuntimeException, std::exception) SAL_OVERRIDE;
|
2004-11-09 13:13:06 +00:00
|
|
|
};
|
|
|
|
friend class PackageImpl;
|
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
// PackageRegistryBackend
|
|
|
|
virtual Reference<deployment::XPackage> bindPackage_(
|
|
|
|
OUString const & url, OUString const & mediaType,
|
2014-09-12 11:40:37 +02:00
|
|
|
bool bRemoved, OUString const & identifier,
|
2014-03-26 16:37:00 +01:00
|
|
|
Reference<XCommandEnvironment> const & xCmdEnv ) SAL_OVERRIDE;
|
2004-07-23 13:20:14 +00:00
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
const Reference<deployment::XPackageTypeInfo> m_xTypeInfo;
|
|
|
|
|
2010-09-29 09:11:20 +02:00
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
public:
|
2004-08-12 11:12:08 +00:00
|
|
|
BackendImpl(
|
|
|
|
Sequence<Any> const & args,
|
2006-03-06 09:23:16 +00:00
|
|
|
Reference<XComponentContext> const & xComponentContext );
|
2004-08-12 11:12:08 +00:00
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
// XPackageRegistry
|
|
|
|
virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL
|
2014-03-26 16:37:00 +01:00
|
|
|
getSupportedPackageTypes() throw (RuntimeException, std::exception) SAL_OVERRIDE;
|
2010-09-29 09:11:20 +02:00
|
|
|
virtual void SAL_CALL packageRemoved(OUString const & url, OUString const & mediaType)
|
|
|
|
throw (deployment::DeploymentException,
|
2014-03-26 16:37:00 +01:00
|
|
|
uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2004-07-23 13:20:14 +00:00
|
|
|
};
|
|
|
|
|
2008-05-20 13:37:24 +00:00
|
|
|
BackendImpl * BackendImpl::PackageImpl::getMyBackend() const
|
|
|
|
{
|
|
|
|
BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
|
|
|
|
if (NULL == pBackend)
|
|
|
|
{
|
|
|
|
//May throw a DisposedException
|
|
|
|
check();
|
|
|
|
//We should never get here...
|
2012-12-30 11:10:48 +01:00
|
|
|
throw RuntimeException("Failed to get the BackendImpl",
|
2008-05-20 13:37:24 +00:00
|
|
|
static_cast<OWeakObject*>(const_cast<PackageImpl *>(this)));
|
|
|
|
}
|
|
|
|
return pBackend;
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-05-27 13:12:02 +01:00
|
|
|
OUString BackendImpl::PackageImpl::getDescription()
|
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
RuntimeException, std::exception)
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2011-12-20 19:01:12 -02:00
|
|
|
if (m_descr.isEmpty())
|
2004-11-09 13:13:06 +00:00
|
|
|
return Package::getDescription();
|
|
|
|
else
|
|
|
|
return m_descr;
|
|
|
|
}
|
2004-07-23 13:20:14 +00:00
|
|
|
|
2014-05-27 13:12:02 +01:00
|
|
|
OUString BackendImpl::PackageImpl::getLicenseText()
|
|
|
|
throw (deployment::ExtensionRemovedException,
|
|
|
|
RuntimeException, std::exception)
|
2010-09-28 10:03:56 +02:00
|
|
|
{
|
|
|
|
return Package::getDescription();
|
|
|
|
}
|
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
BackendImpl::PackageImpl::PackageImpl(
|
2004-07-23 13:20:14 +00:00
|
|
|
::rtl::Reference<BackendImpl> const & myBackend,
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString const & url, OUString const & libType, bool bRemoved,
|
|
|
|
OUString const & identifier)
|
2004-11-09 13:13:06 +00:00
|
|
|
: Package( myBackend.get(), url, OUString(), OUString(),
|
2010-03-22 12:35:33 +01:00
|
|
|
myBackend->m_xTypeInfo, bRemoved, identifier),
|
2004-11-09 13:13:06 +00:00
|
|
|
m_descr(libType)
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2004-11-09 13:13:06 +00:00
|
|
|
initPackageHandler();
|
|
|
|
|
|
|
|
sal_Int32 segmEnd = url.getLength();
|
2013-12-10 09:06:31 +02:00
|
|
|
if ( url.endsWith("/") )
|
2004-11-09 13:13:06 +00:00
|
|
|
--segmEnd;
|
|
|
|
sal_Int32 segmStart = (url.lastIndexOf( '/', segmEnd ) + 1);
|
|
|
|
if (segmStart < 0)
|
|
|
|
segmStart = 0;
|
|
|
|
// name and display name default the same:
|
|
|
|
m_displayName = ::rtl::Uri::decode(
|
|
|
|
url.copy( segmStart, segmEnd - segmStart ),
|
|
|
|
rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 );
|
|
|
|
m_name = m_displayName;
|
2004-07-23 13:20:14 +00:00
|
|
|
|
2012-12-30 11:10:48 +01:00
|
|
|
dp_misc::TRACE("PakageImpl displayName is " + m_displayName);
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-08-12 11:12:08 +00:00
|
|
|
BackendImpl::BackendImpl(
|
|
|
|
Sequence<Any> const & args,
|
2006-03-06 09:23:16 +00:00
|
|
|
Reference<XComponentContext> const & xComponentContext )
|
|
|
|
: PackageRegistryBackend( args, xComponentContext ),
|
2004-11-09 13:13:06 +00:00
|
|
|
m_xTypeInfo( new Package::TypeInfo(
|
2012-12-30 11:10:48 +01:00
|
|
|
"application/vnd.sun.star.framework-script",
|
2004-11-09 13:13:06 +00:00
|
|
|
OUString() /* no file filter */,
|
2012-12-30 11:10:48 +01:00
|
|
|
"Scripting Framework Script Library",
|
2010-11-11 14:30:42 +01:00
|
|
|
RID_IMG_SCRIPTLIB ) )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
|
|
|
if (! transientMode())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-29 09:11:20 +02:00
|
|
|
|
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
// XPackageRegistry
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
Sequence< Reference<deployment::XPackageTypeInfo> >
|
2014-02-25 21:31:58 +01:00
|
|
|
BackendImpl::getSupportedPackageTypes() throw (RuntimeException, std::exception)
|
2004-11-09 13:13:06 +00:00
|
|
|
{
|
|
|
|
return Sequence< Reference<deployment::XPackageTypeInfo> >(&m_xTypeInfo, 1);
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
|
2010-09-29 09:11:20 +02:00
|
|
|
void BackendImpl::packageRemoved(OUString const & /*url*/, OUString const & /*mediaType*/)
|
|
|
|
throw (deployment::DeploymentException,
|
2014-02-25 21:31:58 +01:00
|
|
|
uno::RuntimeException, std::exception)
|
2010-09-29 09:11:20 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
// PackageRegistryBackend
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
Reference<deployment::XPackage> BackendImpl::bindPackage_(
|
2014-09-12 11:40:37 +02:00
|
|
|
OUString const & url, OUString const & mediaType_, bool bRemoved,
|
2010-03-22 12:35:33 +01:00
|
|
|
OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
|
|
|
OUString mediaType( mediaType_ );
|
2011-12-20 19:01:12 -02:00
|
|
|
if (mediaType.isEmpty())
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
|
|
|
// detect media-type:
|
2007-06-05 14:07:52 +00:00
|
|
|
::ucbhelper::Content ucbContent;
|
2004-07-23 13:20:14 +00:00
|
|
|
if (create_ucb_content( &ucbContent, url, xCmdEnv ) &&
|
|
|
|
ucbContent.isFolder())
|
|
|
|
{
|
2005-02-11 15:56:33 +00:00
|
|
|
// probe for parcel-descriptor.xml:
|
2004-07-23 13:20:14 +00:00
|
|
|
if (create_ucb_content(
|
2012-12-30 11:10:48 +01:00
|
|
|
0, makeURL( url, "parcel-descriptor.xml" ),
|
2004-07-23 13:20:14 +00:00
|
|
|
xCmdEnv, false /* no throw */ ))
|
2005-02-11 15:56:33 +00:00
|
|
|
{
|
2013-11-04 12:26:31 +02:00
|
|
|
mediaType = "application/vnd.sun.star.framework-script";
|
2005-02-11 15:56:33 +00:00
|
|
|
}
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
2011-12-20 19:01:12 -02:00
|
|
|
if (mediaType.isEmpty())
|
2004-07-23 13:20:14 +00:00
|
|
|
throw lang::IllegalArgumentException(
|
2004-11-09 13:13:06 +00:00
|
|
|
StrCannotDetectMediaType::get() + url,
|
2004-07-23 13:20:14 +00:00
|
|
|
static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
|
|
|
|
}
|
|
|
|
|
2012-11-27 07:00:28 -06:00
|
|
|
OUString type, subType;
|
2004-07-23 13:20:14 +00:00
|
|
|
INetContentTypeParameterList params;
|
|
|
|
if (INetContentTypes::parse( mediaType, type, subType, ¶ms ))
|
|
|
|
{
|
2013-03-19 11:32:06 +01:00
|
|
|
if (type.equalsIgnoreAsciiCase("application"))
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2013-03-19 11:32:06 +01:00
|
|
|
if (subType.equalsIgnoreAsciiCase("vnd.sun.star.framework-script"))
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2013-11-04 12:26:31 +02:00
|
|
|
OUString lang = "Script";
|
2004-11-09 13:13:06 +00:00
|
|
|
OUString sParcelDescURL = makeURL(
|
2012-12-30 11:10:48 +01:00
|
|
|
url, "parcel-descriptor.xml" );
|
2005-02-11 15:56:33 +00:00
|
|
|
|
2007-06-05 14:07:52 +00:00
|
|
|
::ucbhelper::Content ucb_content;
|
2005-02-11 15:56:33 +00:00
|
|
|
|
|
|
|
if (create_ucb_content( &ucb_content, sParcelDescURL,
|
|
|
|
xCmdEnv, false /* no throw */ ))
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2005-02-11 15:56:33 +00:00
|
|
|
ParcelDescDocHandler* pHandler =
|
|
|
|
new ParcelDescDocHandler();
|
|
|
|
Reference< xml::sax::XDocumentHandler >
|
|
|
|
xDocHandler = pHandler;
|
|
|
|
|
|
|
|
Reference<XComponentContext>
|
|
|
|
xContext( getComponentContext() );
|
|
|
|
|
2012-10-03 13:30:43 +02:00
|
|
|
Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
|
2005-02-11 15:56:33 +00:00
|
|
|
|
|
|
|
xParser->setDocumentHandler( xDocHandler );
|
|
|
|
xml::sax::InputSource source;
|
|
|
|
source.aInputStream = ucb_content.openStream();
|
|
|
|
source.sSystemId = ucb_content.getURL();
|
|
|
|
xParser->parseStream( source );
|
|
|
|
|
|
|
|
if ( pHandler->isParsed() )
|
|
|
|
{
|
|
|
|
lang = pHandler->getParcelLanguage();
|
|
|
|
}
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
2005-02-11 15:56:33 +00:00
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
OUString sfwkLibType = getResourceString( RID_STR_SFWK_LIB );
|
|
|
|
// replace %MACRONAME placeholder with language name
|
2012-12-30 11:10:48 +01:00
|
|
|
OUString MACRONAME( "%MACROLANG" );
|
2004-07-23 13:20:14 +00:00
|
|
|
sal_Int32 startOfReplace = sfwkLibType.indexOf( MACRONAME );
|
|
|
|
sal_Int32 charsToReplace = MACRONAME.getLength();
|
|
|
|
sfwkLibType = sfwkLibType.replaceAt( startOfReplace, charsToReplace, lang );
|
2009-01-22 17:12:19 +00:00
|
|
|
dp_misc::TRACE("******************************\n");
|
2012-12-30 11:10:48 +01:00
|
|
|
dp_misc::TRACE(" BackEnd detected lang = " + lang + "\n");
|
|
|
|
dp_misc::TRACE(" for url " + sParcelDescURL + "\n");
|
2009-01-22 17:12:19 +00:00
|
|
|
dp_misc::TRACE("******************************\n");
|
2010-03-22 12:35:33 +01:00
|
|
|
return new PackageImpl( this, url, sfwkLibType, bRemoved, identifier);
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw lang::IllegalArgumentException(
|
2004-11-09 13:13:06 +00:00
|
|
|
StrUnsupportedMediaType::get() + mediaType,
|
2004-07-23 13:20:14 +00:00
|
|
|
static_cast<OWeakObject *>(this),
|
|
|
|
static_cast<sal_Int16>(-1) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
void BackendImpl::PackageImpl:: initPackageHandler()
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2004-11-09 13:13:06 +00:00
|
|
|
if (m_xNameCntrPkgHandler.is())
|
|
|
|
return;
|
|
|
|
|
2004-07-23 13:20:14 +00:00
|
|
|
BackendImpl * that = getMyBackend();
|
|
|
|
Any aContext;
|
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
if ( that->m_eContext == CONTEXT_USER )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2012-12-30 11:10:48 +01:00
|
|
|
aContext <<= OUString("user");
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
2004-11-09 13:13:06 +00:00
|
|
|
else if ( that->m_eContext == CONTEXT_SHARED )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2012-12-30 11:10:48 +01:00
|
|
|
aContext <<= OUString("share");
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
2010-05-04 12:37:01 +02:00
|
|
|
else if ( that->m_eContext == CONTEXT_BUNDLED )
|
|
|
|
{
|
2012-12-30 11:10:48 +01:00
|
|
|
aContext <<= OUString("bundled");
|
2010-05-04 12:37:01 +02:00
|
|
|
}
|
2004-07-23 13:20:14 +00:00
|
|
|
else
|
|
|
|
{
|
2014-01-28 20:02:28 +01:00
|
|
|
OSL_ASSERT( false );
|
2004-07-23 13:20:14 +00:00
|
|
|
// NOT supported at the momemtn // TODO
|
|
|
|
}
|
|
|
|
|
2013-02-27 15:16:02 +02:00
|
|
|
Reference< provider::XScriptProviderFactory > xFac =
|
|
|
|
provider::theMasterScriptProviderFactory::get( that->getComponentContext() );
|
2004-07-23 13:20:14 +00:00
|
|
|
|
2013-02-27 15:16:02 +02:00
|
|
|
Reference< container::XNameContainer > xName( xFac->createScriptProvider( aContext ), UNO_QUERY );
|
|
|
|
if ( xName.is() )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2013-02-27 15:16:02 +02:00
|
|
|
m_xNameCntrPkgHandler.set( xName );
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
// TODO what happens if above fails??
|
|
|
|
}
|
|
|
|
|
|
|
|
// Package
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
beans::Optional< beans::Ambiguous<sal_Bool> >
|
|
|
|
BackendImpl::PackageImpl::isRegistered_(
|
2006-10-12 13:12:24 +00:00
|
|
|
::osl::ResettableMutexGuard &,
|
|
|
|
::rtl::Reference<AbortChannel> const &,
|
|
|
|
Reference<XCommandEnvironment> const & )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
2004-08-12 11:12:08 +00:00
|
|
|
return beans::Optional< beans::Ambiguous<sal_Bool> >(
|
|
|
|
true /* IsPresent */,
|
|
|
|
beans::Ambiguous<sal_Bool>(
|
|
|
|
m_xNameCntrPkgHandler.is() && m_xNameCntrPkgHandler->hasByName(
|
|
|
|
m_url ),
|
|
|
|
false /* IsAmbiguous */ ) );
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2004-11-09 13:13:06 +00:00
|
|
|
void BackendImpl::PackageImpl::processPackage_(
|
2006-10-12 13:12:24 +00:00
|
|
|
::osl::ResettableMutexGuard &,
|
|
|
|
bool doRegisterPackage,
|
2010-04-21 16:04:34 +02:00
|
|
|
bool /* startup */,
|
2006-10-12 13:12:24 +00:00
|
|
|
::rtl::Reference<AbortChannel> const &,
|
|
|
|
Reference<XCommandEnvironment> const & )
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
|
|
|
if ( !m_xNameCntrPkgHandler.is() )
|
|
|
|
{
|
2009-01-22 17:12:19 +00:00
|
|
|
dp_misc::TRACE("no package handler!!!!\n");
|
2014-05-23 12:03:21 +02:00
|
|
|
throw RuntimeException( "No package Handler " );
|
2004-07-23 13:20:14 +00:00
|
|
|
}
|
|
|
|
|
2006-10-12 13:12:24 +00:00
|
|
|
if (doRegisterPackage)
|
2004-07-23 13:20:14 +00:00
|
|
|
{
|
|
|
|
// will throw if it fails
|
|
|
|
m_xNameCntrPkgHandler->insertByName( m_url, makeAny( Reference< XPackage >(this) ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
else // revokePackage()
|
|
|
|
{
|
|
|
|
m_xNameCntrPkgHandler->removeByName( m_url );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-03-06 09:23:16 +00:00
|
|
|
namespace sdecl = comphelper::service_decl;
|
2006-03-22 10:09:45 +00:00
|
|
|
sdecl::class_<BackendImpl, sdecl::with_args<true> > serviceBI;
|
2006-03-06 09:23:16 +00:00
|
|
|
extern sdecl::ServiceDecl const serviceDecl(
|
2006-03-22 10:09:45 +00:00
|
|
|
serviceBI,
|
2006-03-06 09:23:16 +00:00
|
|
|
"com.sun.star.comp.deployment.sfwk.PackageRegistryBackend",
|
|
|
|
BACKEND_SERVICE_NAME );
|
|
|
|
|
2004-08-12 11:12:08 +00:00
|
|
|
} // namespace sfwk
|
2004-07-23 13:20:14 +00:00
|
|
|
} // namespace backend
|
|
|
|
} // namespace dp_registry
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|