diff options
author | Joachim Lingner <jl@openoffice.org> | 2010-05-18 15:50:04 +0200 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2010-05-18 15:50:04 +0200 |
commit | e6d9970ba08599dfaf13998b9cc0908554f00176 (patch) | |
tree | 8b17f68f2cf2eed03d893658556b3a70613aadf5 | |
parent | eef1fd8ab2966ee3b2934d9050b0a14c4478e1f6 (diff) |
jl152 #i77196# adapted migration code to use new extension manager, removed old unused migration code, adapted ooo improvement dialog to appear after third start, taking into account the restarting after extension installation
-rw-r--r-- | desktop/prj/build.lst | 3 | ||||
-rw-r--r-- | desktop/source/deployment/dp_services.cxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/makefile.mk | 1 | ||||
-rw-r--r-- | desktop/source/deployment/migration/dp_migration.cxx | 251 | ||||
-rw-r--r-- | desktop/source/deployment/migration/makefile.mk | 41 | ||||
-rw-r--r-- | desktop/source/migration/services/cexports.cxx | 12 | ||||
-rwxr-xr-x | desktop/source/migration/services/extensionmigration.cxx | 540 | ||||
-rwxr-xr-x | desktop/source/migration/services/extensionmigration.hxx | 130 | ||||
-rw-r--r-- | desktop/source/migration/services/makefile.mk | 2 | ||||
-rwxr-xr-x | desktop/source/migration/services/oo3extensionmigration.cxx | 33 | ||||
-rwxr-xr-x | desktop/source/migration/services/oo3extensionmigration.hxx | 8 | ||||
-rwxr-xr-x | officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs | 2 |
12 files changed, 28 insertions, 1001 deletions
diff --git a/desktop/prj/build.lst b/desktop/prj/build.lst index 6f611926a0df..8029b6ecc9f7 100644 --- a/desktop/prj/build.lst +++ b/desktop/prj/build.lst @@ -21,10 +21,9 @@ dt desktop\os2\source\applauncher nmake - p dt_applauncher dt_inc NULL dt desktop\unx\source\officeloader nmake - u dt_officeloader_unx dt_inc NULL dt desktop\source\pagein nmake - u dt_pagein dt_inc NULL dt desktop\source\pkgchk\unopkg nmake - all dt_unopkg dt_dp_misc dt_app dt_inc dt_guiloader.w NULL -dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_migration dt_dp_unopkg dt_inc dt_dp_misc NULL +dt desktop\source\deployment nmake - all dt_deployment dt_dp_manager dt_dp_registry dt_dp_registry_package dt_dp_registry_executable dt_dp_registry_help dt_dp_registry_script dt_dp_registry_sfwk dt_dp_registry_component dt_dp_registry_configuration dt_dp_unopkg dt_inc dt_dp_misc NULL dt desktop\source\deployment\misc nmake - all dt_dp_misc dt_inc NULL dt desktop\source\deployment\unopkg nmake - all dt_dp_unopkg dt_inc NULL -dt desktop\source\deployment\migration nmake - all dt_dp_migration dt_inc NULL dt desktop\source\deployment\gui nmake - all dt_dp_gui dt_dp_misc dt_inc NULL dt desktop\source\deployment\manager nmake - all dt_dp_manager dt_inc NULL dt desktop\source\deployment\registry nmake - all dt_dp_registry dt_inc NULL diff --git a/desktop/source/deployment/dp_services.cxx b/desktop/source/deployment/dp_services.cxx index 05b9a2a1971a..f7ebf66355ba 100644 --- a/desktop/source/deployment/dp_services.cxx +++ b/desktop/source/deployment/dp_services.cxx @@ -77,10 +77,6 @@ namespace dp_log { extern sdecl::ServiceDecl const serviceDecl; } -namespace dp_migration { -extern sdecl::ServiceDecl const serviceDecl; -} - namespace dp_info { extern sdecl::ServiceDecl const serviceDecl; bool singleton_entries( uno::Reference<registry::XRegistryKey> const& ); @@ -110,7 +106,6 @@ sal_Bool SAL_CALL component_writeInfo( dp_registry::backend::executable::serviceDecl, dp_manager::factory::serviceDecl, dp_log::serviceDecl, - dp_migration::serviceDecl, dp_info::serviceDecl, dp_manager::serviceDecl) && dp_manager::factory::singleton_entries( pRegistryKey ) && @@ -133,7 +128,6 @@ void * SAL_CALL component_getFactory( dp_registry::backend::executable::serviceDecl, dp_manager::factory::serviceDecl, dp_log::serviceDecl, - dp_migration::serviceDecl, dp_info::serviceDecl, dp_manager::serviceDecl); } diff --git a/desktop/source/deployment/makefile.mk b/desktop/source/deployment/makefile.mk index 173ff35bec1d..6d83a5c1004b 100644 --- a/desktop/source/deployment/makefile.mk +++ b/desktop/source/deployment/makefile.mk @@ -53,7 +53,6 @@ SHL1VERSIONMAP = $(SOLARENV)/src/component.map SHL1LIBS = \ $(SLB)$/deployment_manager.lib \ - $(SLB)$/deployment_migration.lib \ $(SLB)$/deployment_registry.lib \ $(SLB)$/deployment_registry_executable.lib \ $(SLB)$/deployment_registry_component.lib \ diff --git a/desktop/source/deployment/migration/dp_migration.cxx b/desktop/source/deployment/migration/dp_migration.cxx deleted file mode 100644 index c2d0b0dc6bb8..000000000000 --- a/desktop/source/deployment/migration/dp_migration.cxx +++ /dev/null @@ -1,251 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" - -#include "dp_misc.h" -#include "dp_ucb.h" -#include "cppuhelper/implbase1.hxx" -#include "cppuhelper/implbase2.hxx" -#include "cppuhelper/exc_hlp.hxx" -#include "ucbhelper/content.hxx" -#include "comphelper/anytostring.hxx" -#include "comphelper/servicedecl.hxx" -#include "com/sun/star/lang/WrappedTargetException.hpp" -#include "com/sun/star/task/XJob.hpp" -#include "com/sun/star/task/XInteractionAbort.hpp" -#include "com/sun/star/task/XInteractionApprove.hpp" -#include "com/sun/star/sdbc/XResultSet.hpp" -#include "com/sun/star/sdbc/XRow.hpp" -#include "com/sun/star/ucb/XContentAccess.hpp" -#include "com/sun/star/deployment/thePackageManagerFactory.hpp" - - -using namespace ::com::sun::star; -using namespace ::com::sun::star::ucb; -using namespace ::com::sun::star::uno; -using namespace ::dp_misc; -using ::rtl::OUString; - -namespace dp_migration { - -class MigrationImpl : public ::cppu::WeakImplHelper1<task::XJob> -{ - struct CommandEnvironmentImpl - : public ::cppu::WeakImplHelper2< XCommandEnvironment, - task::XInteractionHandler > - { - // XCommandEnvironment - virtual Reference<task::XInteractionHandler> SAL_CALL - getInteractionHandler() throw (RuntimeException); - virtual Reference<XProgressHandler> SAL_CALL getProgressHandler() - throw (RuntimeException); - // XInteractionHandler - virtual void SAL_CALL handle( - Reference<task::XInteractionRequest> const & xRequest ) - throw (RuntimeException); - }; - - const Reference<XComponentContext> m_xContext; - OUString m_userData; - -protected: - virtual ~MigrationImpl(); -public: - MigrationImpl( Sequence<Any> const & args, - Reference<XComponentContext> const & xComponentContext ); - - // XJob - virtual Any SAL_CALL execute( Sequence<beans::NamedValue> const & args ) - throw (lang::IllegalArgumentException, Exception, RuntimeException); -}; - -MigrationImpl::~MigrationImpl() -{ -} - -MigrationImpl::MigrationImpl( - Sequence<Any> const & args, Reference<XComponentContext> const & xContext ) - : m_xContext(xContext) -{ - for ( sal_Int32 pos = args.getLength(); pos--; ) - { - const beans::NamedValue nv(args[pos].get<beans::NamedValue>()); - if (nv.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UserData") )) - m_userData = nv.Value.get<OUString>(); - } - if (m_userData.getLength() == 0) - throw lang::IllegalArgumentException( OUSTR("missing UserData!"), 0, - static_cast<sal_Int16>(-1) ); -} - -// XJob -Any MigrationImpl::execute( Sequence<beans::NamedValue> const & ) - throw (lang::IllegalArgumentException, Exception, RuntimeException) -{ - const Reference<deployment::XPackageManager> xManager( - deployment::thePackageManagerFactory::get( - m_xContext )->getPackageManager( OUSTR("user") ) ); - ::ucbhelper::Content packagesDir; - if (create_ucb_content( &packagesDir, - makeURL( m_userData, OUSTR("user/uno_packages") ), - Reference<XCommandEnvironment>(), - false /* no throw */ )) - { - const Reference<XCommandEnvironment> xCmdEnv( - new CommandEnvironmentImpl ); - OUString const & strTitle = StrTitle::get(); - const Reference<sdbc::XResultSet> xResultSet( - packagesDir.createCursor( Sequence<OUString>( &strTitle, 1 ), - ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); - while (xResultSet->next()) - { - Reference<sdbc::XRow> xRow( xResultSet, UNO_QUERY_THROW ); - const OUString title( xRow->getString( 1 /* Title */ ) ); - // exclude stampIt, not migratable to OOo 2.0: - if (title.matchIgnoreAsciiCaseAsciiL( - RTL_CONSTASCII_STRINGPARAM("SSICONCT.") )) - continue; - const OUString sourceURL( Reference<XContentAccess>( - xResultSet, UNO_QUERY_THROW ) - ->queryContentIdentifierString() ); - try { - xManager->addPackage( - sourceURL, uno::Sequence<beans::NamedValue>(),OUString() /* detect media-type */, - Reference<task::XAbortChannel>(), xCmdEnv ); - } - catch (RuntimeException &) { - throw; - } - catch (Exception &) { - OSL_ENSURE( 0, ::rtl::OUStringToOString( - ::comphelper::anyToString( - ::cppu::getCaughtException() ), - RTL_TEXTENCODING_UTF8 ).getStr() ); - } - } - } - return Any(); -} - -// XCommandEnvironment -Reference<task::XInteractionHandler> -MigrationImpl::CommandEnvironmentImpl::getInteractionHandler() - throw (RuntimeException) -{ - return this; -} - -Reference<XProgressHandler> -MigrationImpl::CommandEnvironmentImpl::getProgressHandler() - throw (RuntimeException) -{ - return Reference<XProgressHandler>(); -} - -// XInteractionHandler -void MigrationImpl::CommandEnvironmentImpl::handle( - Reference<task::XInteractionRequest> const & xRequest ) - throw (RuntimeException) -{ - Any request( xRequest->getRequest() ); - OSL_ASSERT( request.getValueTypeClass() == TypeClass_EXCEPTION ); -#if OSL_DEBUG_LEVEL > 1 - OSL_TRACE( "[dp_migration.cxx] incoming request:\n%s\n", - ::rtl::OUStringToOString( ::comphelper::anyToString(request), - RTL_TEXTENCODING_UTF8 ).getStr() ); -#endif - - // selections: - bool approve = false; - bool abort = false; - - lang::WrappedTargetException wtExc; - if (request >>= wtExc) { - OSL_ENSURE( 0, ::rtl::OUStringToOString( - ::comphelper::anyToString(wtExc.TargetException), - RTL_TEXTENCODING_UTF8 ).getStr() ); - - // ignore intermediate errors of legacy packages, i.e. - // former pkgchk behaviour: - const Reference<deployment::XPackage> xPackage( - wtExc.Context, UNO_QUERY ); - OSL_ASSERT( xPackage.is() ); - if (xPackage.is()) { - const Reference<deployment::XPackageTypeInfo> xPackageType( - xPackage->getPackageType() ); - OSL_ASSERT( xPackageType.is() ); - if (xPackageType.is()) { - approve = (xPackage->isBundle() && - xPackageType->getMediaType().matchAsciiL( - RTL_CONSTASCII_STRINGPARAM( - "application/" - "vnd.sun.star.legacy-package-bundle") )); - } - } - abort = !approve; - } - else - return; // unknown request => no selection at all - - // select: - const Sequence< Reference<task::XInteractionContinuation> > conts( - xRequest->getContinuations() ); - for ( sal_Int32 pos = 0; pos < conts.getLength(); ++pos ) - { - if (approve) { - const Reference<task::XInteractionApprove> xInteractionApprove( - conts[ pos ], UNO_QUERY ); - if (xInteractionApprove.is()) { - xInteractionApprove->select(); - // don't query again for ongoing continuations: - approve = false; - } - } - else if (abort) { - const Reference<task::XInteractionAbort> xInteractionAbort( - conts[ pos ], UNO_QUERY ); - if (xInteractionAbort.is()) { - xInteractionAbort->select(); - // don't query again for ongoing continuations: - abort = false; - } - } - } -} - -namespace sdecl = comphelper::service_decl; -sdecl::class_<MigrationImpl, sdecl::with_args<true> > serviceMI; -extern sdecl::ServiceDecl const serviceDecl( - serviceMI, - // a private one (config entry): - "com.sun.star.comp.deployment.migration.Migration_2_0", - "com.sun.star.comp.deployment.migration.Migration_2_0" ); - -} // namespace dp_migration - diff --git a/desktop/source/deployment/migration/makefile.mk b/desktop/source/deployment/migration/makefile.mk deleted file mode 100644 index a37b7e5bebf8..000000000000 --- a/desktop/source/deployment/migration/makefile.mk +++ /dev/null @@ -1,41 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# 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. -# -#************************************************************************* - -PRJ = ..$/..$/.. - -PRJNAME = desktop -TARGET = deployment_migration -ENABLE_EXCEPTIONS = TRUE - -.INCLUDE : settings.mk - -SLOFILES = \ - $(SLO)$/dp_migration.obj - -.INCLUDE : ..$/target.pmk -.INCLUDE : target.mk - diff --git a/desktop/source/migration/services/cexports.cxx b/desktop/source/migration/services/cexports.cxx index c1971e9d4d00..cf9a9ab30b0c 100644 --- a/desktop/source/migration/services/cexports.cxx +++ b/desktop/source/migration/services/cexports.cxx @@ -31,7 +31,7 @@ #include "cppuhelper/implementationentry.hxx" #include "basicmigration.hxx" #include "wordbookmigration.hxx" -#include "extensionmigration.hxx" +//#include "extensionmigration.hxx" extern "C" { @@ -48,11 +48,11 @@ extern "C" migration::WordbookMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory, 0, 0 }, - { - migration::ExtensionMigration_create, migration::ExtensionMigration_getImplementationName, - migration::ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 - }, +// { +// migration::ExtensionMigration_create, migration::ExtensionMigration_getImplementationName, +// migration::ExtensionMigration_getSupportedServiceNames, ::cppu::createSingleComponentFactory, +// 0, 0 +// }, { 0, 0, 0, 0, 0, 0 } }; diff --git a/desktop/source/migration/services/extensionmigration.cxx b/desktop/source/migration/services/extensionmigration.cxx deleted file mode 100755 index 66f32744a782..000000000000 --- a/desktop/source/migration/services/extensionmigration.cxx +++ /dev/null @@ -1,540 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_desktop.hxx" -#include "extensionmigration.hxx" -#include <tools/urlobj.hxx> -#include <unotools/bootstrap.hxx> -#include <unotools/ucbstreamhelper.hxx> -#include <ucbhelper/content.hxx> -#include <com/sun/star/ucb/XCommandInfo.hpp> -#include <com/sun/star/ucb/TransferInfo.hpp> -#include <com/sun/star/ucb/NameClash.hpp> -#include "comphelper/processfactory.hxx" -#include "com/sun/star/deployment/XPackageManagerFactory.hpp" -#include "com/sun/star/ucb/XCommandEnvironment.hpp" -#include "com/sun/star/xml/sax/XParser.hpp" -#include "rtl/instance.hxx" -#include "osl/file.hxx" -#include "osl/thread.h" - -#include "xmlscript/xmllib_imexp.hxx" -#include "../../deployment/inc/dp_ucb.h" - -#ifdef SYSTEM_DB -#include <db.h> -#else -#include <berkeleydb/db.h> -#endif - -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; - -namespace { - - struct LibDescriptor : - public rtl::StaticWithInit<const ::xmlscript::LibDescriptorArray, LibDescriptor> { - const ::xmlscript::LibDescriptorArray operator () () { - - - return ::xmlscript::LibDescriptorArray(); - } -}; -} -//......................................................................... -namespace migration -{ -//......................................................................... - - - static ::rtl::OUString sExtensionSubDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/uno_packages/" ) ); - static ::rtl::OUString sSubDirName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cache" ) ); - static ::rtl::OUString sConfigDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data" ) ); - static ::rtl::OUString sOrgDir = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) ); - static ::rtl::OUString sExcludeDir1 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org" ) ); - static ::rtl::OUString sExcludeDir2 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/registry/data/org/openoffice" ) ); - - static ::rtl::OUString sBasicType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.basic-library")); - static ::rtl::OUString sDialogType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.dialog-library")); - - static ::rtl::OUString sConfigurationDataType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-data")); - static ::rtl::OUString sConfigurationSchemaType = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.star.configuration-schema")); - - // ============================================================================= - // component operations - // ============================================================================= - - ::rtl::OUString ExtensionMigration_getImplementationName() - { - static ::rtl::OUString* pImplName = 0; - if ( !pImplName ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !pImplName ) - { - static ::rtl::OUString aImplName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.desktop.migration.Extensions" ) ); - pImplName = &aImplName; - } - } - return *pImplName; - } - - // ----------------------------------------------------------------------------- - - Sequence< ::rtl::OUString > ExtensionMigration_getSupportedServiceNames() - { - static Sequence< ::rtl::OUString >* pNames = 0; - if ( !pNames ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !pNames ) - { - static Sequence< ::rtl::OUString > aNames(1); - aNames.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.migration.Extensions" ) ); - pNames = &aNames; - } - } - return *pNames; - } - - // ============================================================================= - // ExtensionMigration - // ============================================================================= - - ExtensionMigration::ExtensionMigration(Reference< XComponentContext > const & ctx) : - m_ctx(ctx) - { - } - - // ----------------------------------------------------------------------------- - - ExtensionMigration::~ExtensionMigration() - { - } - - ::osl::FileBase::RC ExtensionMigration::checkAndCreateDirectory( INetURLObject& rDirURL ) - { - ::osl::FileBase::RC aResult = ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - if ( aResult == ::osl::FileBase::E_NOENT ) - { - INetURLObject aBaseURL( rDirURL ); - aBaseURL.removeSegment(); - checkAndCreateDirectory( aBaseURL ); - return ::osl::Directory::create( rDirURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - } - else - { - return aResult; - } - } - - void ExtensionMigration::prepareBasicLibs() - { - prepareBasicLibs(m_sSourceDir + ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("/user/basic/script.xlc")), m_scriptElements); - prepareBasicLibs(m_sSourceDir + ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("/user/basic/dialog.xlc")), m_dialogElements); - } - - void ExtensionMigration::prepareBasicLibs(const ::rtl::OUString & sURL, - ::xmlscript::LibDescriptorArray & out_elements) - { - - ::ucbhelper::Content ucb_content; - if (dp_misc::create_ucb_content( &ucb_content, sURL, - uno::Reference< ucb::XCommandEnvironment>(), false /* no throw */ )) - { - uno::Reference<xml::sax::XParser> xParser( - m_ctx->getServiceManager()->createInstanceWithContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")), - m_ctx ), UNO_QUERY_THROW ); - - xParser->setDocumentHandler( ::xmlscript::importLibraryContainer( &out_elements ) ); - xml::sax::InputSource source; - source.aInputStream = ucb_content.openStream(); - source.sSystemId = ucb_content.getURL(); - xParser->parseStream( source ); - } - //else - //The file need not exists - } - /* Checks if basic package is enabled in StarOffice 8. This is the case when the dialog.xlc or - the script.xlc in the user installation contains an entry for this package. - The passed package MUST be a basic package. - */ - bool ExtensionMigration::isBasicPackageEnabled( const uno::Reference< deployment::XPackage > & xPkg) - { - ::rtl::OUString sScriptURL = xPkg->getURL(); - if ( sScriptURL[ sScriptURL.getLength()-1 ] != '/' ) - sScriptURL += ::rtl::OUString::createFromAscii("/"); - sScriptURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("script.xlb") ); - - bool bEntryFound = false; - for ( sal_Int32 nPos = m_scriptElements.mnLibCount; nPos--; ) - { - ::xmlscript::LibDescriptor const & descr = - m_scriptElements.mpLibs[ nPos ]; - - if (descr.aStorageURL.equals(sScriptURL)) - { - bEntryFound = true; - break; - } - } - - ::rtl::OUString sDialogURL = xPkg->getURL(); - if ( sDialogURL[ sDialogURL.getLength()-1 ] != '/' ) - sDialogURL += ::rtl::OUString::createFromAscii("/"); - sScriptURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("dialog.xlb") ); - - if (!bEntryFound) - { - for ( sal_Int32 nPos = m_dialogElements.mnLibCount; nPos--; ) - { - ::xmlscript::LibDescriptor const & descr = - m_dialogElements.mpLibs[ nPos ]; - - if (descr.aStorageURL.equals(sDialogURL)) - { - bEntryFound = true; - break; - } - } - } - return bEntryFound; - } - /* This function only registers basic and dialog packages. - */ - void ExtensionMigration::registerBasicPackage( const uno::Reference< deployment::XPackage > & xPkg) - { - const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType(); - if ( (sMediaType.equals(sBasicType) || sMediaType.equals(sDialogType)) - && isBasicPackageEnabled(xPkg)) - { - xPkg->registerPackage(false, uno::Reference< task::XAbortChannel >(), - uno::Reference< ucb::XCommandEnvironment> ()); - } - } - - bool ExtensionMigration::processExtensions( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ) - { - if (!copy(sSourceDir, sTargetDir)) - return false; - - // Find all basic and script packages and reregister them - uno::Reference< deployment::XPackageManagerFactory > xPMF; - if (! ( m_ctx->getValueByName( ::rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.deployment.thePackageManagerFactory"))) - >>= xPMF)) - throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ExtensionsMigration: could not get thePackageManagerFactory")), 0); - - const uno::Reference< deployment::XPackageManager > xPackageMgr = - xPMF->getPackageManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user"))); - - if (!xPackageMgr.is()) - throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ExtensionsMigration: could not get XPackageManager")), 0); - - const uno::Sequence< uno::Reference< deployment::XPackage > > allPackages = - xPackageMgr->getDeployedPackages( - uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - - for (int i = 0; i < allPackages.getLength(); i ++) - { - const uno::Reference< deployment::XPackage > aPackage = allPackages[i]; - if ( aPackage->isBundle() ) - { - const uno::Sequence< uno::Reference < deployment::XPackage > > seqPkg = - aPackage->getBundle( - uno::Reference< task::XAbortChannel >(), - uno::Reference< ucb::XCommandEnvironment> ()); - - for ( int k = 0; k < seqPkg.getLength(); k++ ) - registerBasicPackage(seqPkg[k]); - - for (int l = 0; l < seqPkg.getLength(); l++) - { - const ::rtl::OUString sMediaType = seqPkg[l]->getPackageType()->getMediaType(); - beans::Optional<beans::Ambiguous<sal_Bool> > opt = - seqPkg[l]->isRegistered(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - bool bRegistered = opt.IsPresent && opt.Value.IsAmbiguous == sal_False && opt.Value.Value == sal_True ? true : false; - - if ( bRegistered && !sMediaType.equals(sBasicType) && !sMediaType.equals(sDialogType) ) - { - seqPkg[l]->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - seqPkg[l]->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - } - } - } - else - { - registerBasicPackage(aPackage); - { - aPackage->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - aPackage->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - } - } - } - - - return true; - - } - -bool ExtensionMigration::isCompatibleBerkleyDb(const ::rtl::OUString& sSourceDir) -{ - try - { - ::rtl::OUString sDb(sSourceDir + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "/uno_packages.db"))); - //check if the db exist at all. If not then the call to db_create would create - //the file. - ::osl::File f(sDb); - if (::osl::File::E_None != f.open(OpenFlag_Read)) - { - f.close(); - return false; - } - f.close(); - - //create a system path - ::rtl::OUString sSysPath; - if (::osl::File::getSystemPathFromFileURL(sDb, sSysPath ) != ::osl::File::E_None) - return false; - - ::rtl::OString cstr_sysPath( - ::rtl::OUStringToOString( sSysPath, osl_getThreadTextEncoding() ) ); - char const * pcstr_sysPath = cstr_sysPath.getStr(); - - //Open the db. If it works then we assume that the file was written with a - //compatible version of Berkeley Db - DB* pDB = NULL; - //using DB_RDONLY will return an "Invalid argument" error. - //DB_CREATE: only creates the file if it does not exist. - //An existing db is not modified. - if (0 != db_create(& pDB, 0, DB_CREATE)) - return false; - - if (0 != pDB->open(pDB, 0, pcstr_sysPath , 0, DB_HASH, DB_RDONLY, 0664 /* fs mode */)) - return false; - - pDB->close(pDB, 0); - } - catch (uno::Exception& ) - { - return false; - } - - return true; -} - -bool ExtensionMigration::copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ) -{ - bool bRet = false; - if (! isCompatibleBerkleyDb(sSourceDir)) - return false; - - INetURLObject aSourceObj( sSourceDir ); - INetURLObject aDestObj( sTargetDir ); - String aName = aDestObj.getName(); - aDestObj.removeSegment(); - aDestObj.setFinalSlash(); - - try - { - ::ucbhelper::Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); - uno::Reference< ucb::XCommandInfo > xInfo = aDestPath.getCommands(); - ::rtl::OUString aTransferName = ::rtl::OUString::createFromAscii( "transfer" ); - if ( xInfo->hasCommandByName( aTransferName ) ) - { - aDestPath.executeCommand( aTransferName, uno::makeAny( - ucb::TransferInfo( sal_False, aSourceObj.GetMainURL( INetURLObject::NO_DECODE ), aName, ucb::NameClash::OVERWRITE ) ) ); - bRet = true; - } - } - catch( uno::Exception& ) - { - } - - return bRet; -} - - - // ----------------------------------------------------------------------------- - // XServiceInfo - // ----------------------------------------------------------------------------- - - ::rtl::OUString ExtensionMigration::getImplementationName() throw (RuntimeException) - { - return ExtensionMigration_getImplementationName(); - } - - // ----------------------------------------------------------------------------- - - sal_Bool ExtensionMigration::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) - { - Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); - const ::rtl::OUString* pNames = aNames.getConstArray(); - const ::rtl::OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; - } - - // ----------------------------------------------------------------------------- - - Sequence< ::rtl::OUString > ExtensionMigration::getSupportedServiceNames() throw (RuntimeException) - { - return ExtensionMigration_getSupportedServiceNames(); - } - - // ----------------------------------------------------------------------------- - // XInitialization - // ----------------------------------------------------------------------------- - - void ExtensionMigration::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - - const Any* pIter = aArguments.getConstArray(); - const Any* pEnd = pIter + aArguments.getLength(); - for ( ; pIter != pEnd ; ++pIter ) - { - beans::NamedValue aValue; - *pIter >>= aValue; - if ( aValue.Name.equalsAscii( "UserData" ) ) - { - if ( !(aValue.Value >>= m_sSourceDir) ) - { - OSL_ENSURE( false, "ExtensionMigration::initialize: argument UserData has wrong type!" ); - } - break; - } - } - prepareBasicLibs(); - } - - TStringVectorPtr getContent( const ::rtl::OUString& rBaseURL ) - { - TStringVectorPtr aResult( new TStringVector ); - ::osl::Directory aDir( rBaseURL); - if ( aDir.open() == ::osl::FileBase::E_None ) - { - // iterate over directory content - TStringVector aSubDirs; - ::osl::DirectoryItem aItem; - while ( aDir.getNextItem( aItem ) == ::osl::FileBase::E_None ) - { - ::osl::FileStatus aFileStatus( FileStatusMask_Type | FileStatusMask_FileURL ); - if ( aItem.getFileStatus( aFileStatus ) == ::osl::FileBase::E_None ) - aResult->push_back( aFileStatus.getFileURL() ); - } - } - - return aResult; - } - - // ----------------------------------------------------------------------------- - // XJob - // ----------------------------------------------------------------------------- - -void ExtensionMigration::copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ) -{ - ::rtl::OUString sEx1( m_sSourceDir ); - sEx1 += sExcludeDir1; - ::rtl::OUString sEx2( m_sSourceDir ); - sEx2 += sExcludeDir2; - - TStringVectorPtr aList = getContent( sSourceDir ); - TStringVector::const_iterator aI = aList->begin(); - while ( aI != aList->end() ) - { - ::rtl::OUString sSourceLocalName = aI->copy( sSourceDir.getLength() ); - ::rtl::OUString aTemp = aI->copy( m_sSourceDir.getLength() ); - if ( aTemp != sExcludeDir1 && aTemp != sExcludeDir2 ) - { - ::rtl::OUString sTargetName = sTargetDir + sSourceLocalName; - copy( (*aI), sTargetName ); - } - ++aI; - } -} - - Any ExtensionMigration::execute( const Sequence< beans::NamedValue >& ) - throw (lang::IllegalArgumentException, Exception, RuntimeException) - { - ::osl::MutexGuard aGuard( m_aMutex ); - - ::utl::Bootstrap::PathStatus aStatus = ::utl::Bootstrap::locateUserInstallation( m_sTargetDir ); - if ( aStatus == ::utl::Bootstrap::PATH_EXISTS ) - { - // copy all extensions - ::rtl::OUString sTargetDir(m_sTargetDir), sSourceDir( m_sSourceDir ); - sTargetDir += sExtensionSubDir; - sSourceDir += sExtensionSubDir; - sSourceDir += sSubDirName; - sTargetDir += sSubDirName; - processExtensions( sSourceDir, sTargetDir ); - - // copy all user config settings in user/registry/data (except user/registry/data/org) - sSourceDir = m_sSourceDir; - sSourceDir += sConfigDir; - sTargetDir = m_sTargetDir; - sTargetDir += sConfigDir; - copyConfig( sSourceDir, sTargetDir ); - - // copy all user config settings in user/registry/data/org (except user/registry/data/org/openoffice) - sSourceDir = m_sSourceDir; - sSourceDir += sOrgDir; - sTargetDir = m_sTargetDir; - sTargetDir += sOrgDir; - copyConfig( sSourceDir, sTargetDir ); - } - - return Any(); - } - - // ============================================================================= - // component operations - // ============================================================================= - - Reference< XInterface > SAL_CALL ExtensionMigration_create( - Reference< XComponentContext > const & ctx ) - SAL_THROW( () ) - { - return static_cast< lang::XTypeProvider * >( new ExtensionMigration( - ctx) ); - } - - // ----------------------------------------------------------------------------- - -//......................................................................... -} // namespace migration -//......................................................................... diff --git a/desktop/source/migration/services/extensionmigration.hxx b/desktop/source/migration/services/extensionmigration.hxx deleted file mode 100755 index 70f6a4c44c9b..000000000000 --- a/desktop/source/migration/services/extensionmigration.hxx +++ /dev/null @@ -1,130 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * 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 _DESKTOP_EXTENSIONMIGRATION_HXX_ -#define _DESKTOP_EXTENSIONMIGRATION_HXX_ - -#include "misc.hxx" -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/task/XJob.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <cppuhelper/implbase3.hxx> -#include <osl/mutex.hxx> -#include <osl/file.hxx> -#include "xmlscript/xmllib_imexp.hxx" - -namespace com { namespace sun { namespace star { - namespace uno { - class XComponentContext; - } - namespace deployment { - class XPackage; - } -}}} - - - -class INetURLObject; - - -//......................................................................... -namespace migration -{ -//......................................................................... - - ::rtl::OUString SAL_CALL ExtensionMigration_getImplementationName(); - ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL ExtensionMigration_getSupportedServiceNames(); - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ExtensionMigration_create( - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext ) - SAL_THROW( (::com::sun::star::uno::Exception) ); - - - // ============================================================================= - // class ExtensionMigration - // ============================================================================= - - typedef ::cppu::WeakImplHelper3< - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::lang::XInitialization, - ::com::sun::star::task::XJob > ExtensionMigration_BASE; - - class ExtensionMigration : public ExtensionMigration_BASE - { - private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx; - ::osl::Mutex m_aMutex; - ::rtl::OUString m_sSourceDir; - ::rtl::OUString m_sTargetDir; - - ::xmlscript::LibDescriptorArray m_scriptElements; - ::xmlscript::LibDescriptorArray m_dialogElements; - - ::osl::FileBase::RC checkAndCreateDirectory( INetURLObject& rDirURL ); - void copyConfig( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ); - bool isCompatibleBerkleyDb(const ::rtl::OUString& sSourceDir); - bool copy( const ::rtl::OUString& sSourceDir, const ::rtl::OUString& sTargetDir ); - bool processExtensions( const ::rtl::OUString& sSourceDir, - const ::rtl::OUString& sTargetDir ); - /* fills m_scriptElements and m_dialogElements - */ - void prepareBasicLibs(); - void prepareBasicLibs(const ::rtl::OUString & sURL, - ::xmlscript::LibDescriptorArray & out_elements); - bool isBasicPackageEnabled( const ::com::sun::star::uno::Reference< - ::com::sun::star::deployment::XPackage > & xPkg); - void registerBasicPackage( - const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg); - - public: - ExtensionMigration(::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext > const & ctx); - virtual ~ExtensionMigration(); - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() - throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) - throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() - throw (::com::sun::star::uno::RuntimeException); - - // XInitialization - virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) - throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); - - // XJob - virtual ::com::sun::star::uno::Any SAL_CALL execute( - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Arguments ) - throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::Exception, - ::com::sun::star::uno::RuntimeException); - }; - -//......................................................................... -} // namespace migration -//......................................................................... - -#endif // _DESKTOP_AUTOCORRMIGRATION_HXX_ diff --git a/desktop/source/migration/services/makefile.mk b/desktop/source/migration/services/makefile.mk index 55ecff6bc06f..2f3eb9308ebd 100644 --- a/desktop/source/migration/services/makefile.mk +++ b/desktop/source/migration/services/makefile.mk @@ -51,7 +51,6 @@ SLOFILES= \ $(SLO)$/cexports.obj \ $(SLO)$/basicmigration.obj \ $(SLO)$/wordbookmigration.obj \ - $(SLO)$/extensionmigration.obj \ $(SLO)$/autocorrmigration.obj \ $(SLO)$/oo3extensionmigration.obj \ $(SLO)$/cexportsoo3.obj @@ -61,7 +60,6 @@ SHL1OBJS= \ $(SLO)$/cexports.obj \ $(SLO)$/basicmigration.obj \ $(SLO)$/wordbookmigration.obj \ - $(SLO)$/extensionmigration.obj \ $(SLO)$/autocorrmigration.obj SHL1TARGET=$(TARGET) diff --git a/desktop/source/migration/services/oo3extensionmigration.cxx b/desktop/source/migration/services/oo3extensionmigration.cxx index 2d17a654b29b..37608a7b1276 100755 --- a/desktop/source/migration/services/oo3extensionmigration.cxx +++ b/desktop/source/migration/services/oo3extensionmigration.cxx @@ -43,8 +43,6 @@ #include <comphelper/processfactory.hxx> #include <ucbhelper/content.hxx> -#include <com/sun/star/deployment/thePackageManagerFactory.hpp> -#include <com/sun/star/deployment/XPackageManagerFactory.hpp> #include <com/sun/star/task/XInteractionApprove.hpp> #include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/ucb/XCommandInfo.hpp> @@ -53,6 +51,7 @@ #include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/xml/xpath/XXPathAPI.hpp> #include <com/sun/star/beans/NamedValue.hpp> +#include <com/sun/star/deployment/ExtensionManager.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -140,15 +139,15 @@ OO3ExtensionMigration::~OO3ExtensionMigration() } } -void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg) -{ - const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType(); - if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) ) - { - xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - xPkg->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); - } -} +//void OO3ExtensionMigration::registerConfigurationPackage( const uno::Reference< deployment::XPackage > & xPkg) +//{ +// const ::rtl::OUString sMediaType = xPkg->getPackageType()->getMediaType(); +// if ( (sMediaType.equals(sConfigurationDataType) || sMediaType.equals(sConfigurationSchemaType) ) ) +// { +// xPkg->revokePackage(uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); +// xPkg->registerPackage(false, uno::Reference< task::XAbortChannel >(), uno::Reference< ucb::XCommandEnvironment> ()); +// } +//} void OO3ExtensionMigration::scanUserExtensions( const ::rtl::OUString& sSourceDir, TStringVector& aMigrateExtensions ) { @@ -343,18 +342,17 @@ bool OO3ExtensionMigration::scanDescriptionXml( const ::rtl::OUString& sDescript bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir ) { - if ( !m_xPackageManager.is() ) + if ( !m_xExtensionManager.is() ) { try { - m_xPackageManager = deployment::thePackageManagerFactory::get( m_ctx )->getPackageManager( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "user" )) ); + m_xExtensionManager = deployment::ExtensionManager::get( m_ctx ); } catch ( ucb::CommandFailedException & ){} catch ( uno::RuntimeException & ) {} } - if ( m_xPackageManager.is() ) + if ( m_xExtensionManager.is() ) { try { @@ -364,8 +362,9 @@ bool OO3ExtensionMigration::migrateExtension( const ::rtl::OUString& sSourceDir static_cast< cppu::OWeakObject* >( pCmdEnv ), uno::UNO_QUERY ); uno::Reference< task::XAbortChannel > xAbortChannel; uno::Reference< deployment::XPackage > xPackage = - m_xPackageManager->addPackage( - sSourceDir, uno::Sequence<beans::NamedValue>(),::rtl::OUString(), xAbortChannel, xCmdEnv ); + m_xExtensionManager->addExtension( + sSourceDir, uno::Sequence<beans::NamedValue>(), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")), xAbortChannel, xCmdEnv ); if ( xPackage.is() ) return true; diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx b/desktop/source/migration/services/oo3extensionmigration.hxx index a001f41d92c5..7890eb86a75c 100755 --- a/desktop/source/migration/services/oo3extensionmigration.hxx +++ b/desktop/source/migration/services/oo3extensionmigration.hxx @@ -37,7 +37,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/xml/dom/XDocumentBuilder.hpp> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> -#include <com/sun/star/deployment/XPackageManager.hpp> +#include <com/sun/star/deployment/XExtensionManager.hpp> #include <osl/mutex.hxx> #include <osl/file.hxx> @@ -83,7 +83,7 @@ namespace migration ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_ctx; ::com::sun::star::uno::Reference< ::com::sun::star::xml::dom::XDocumentBuilder > m_xDocBuilder; ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > m_xSimpleFileAccess; - ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackageManager > m_xPackageManager; + ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XExtensionManager > m_xExtensionManager; ::osl::Mutex m_aMutex; ::rtl::OUString m_sSourceDir; ::rtl::OUString m_sTargetDir; @@ -105,8 +105,8 @@ namespace migration bool migrateExtension( const ::rtl::OUString& sSourceDir ); /* fills m_scriptElements and m_dialogElements */ - void registerConfigurationPackage( - const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg); + //void registerConfigurationPackage( + // const ::com::sun::star::uno::Reference< ::com::sun::star::deployment::XPackage > & xPkg); public: OO3ExtensionMigration(::com::sun::star::uno::Reference< diff --git a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs index 7ff91464727d..7b0b221f15a9 100755 --- a/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/OOoImprovement/Settings.xcs @@ -15,7 +15,7 @@ OpenOffice.org Improvement Program. If this is zero the user will get asked. </desc> </info> - <value>1</value> + <value>2</value> </prop> <prop oor:name="InvitationAccepted" oor:type="xs:boolean"> <info> |