1. mst
  2. ooo340

Commits

s...@openoffice.org  committed 5c8ec51 Merge

sb135: merged in CWS sb131

  • Participants
  • Parent commits 7ee0fc0, 18d578d
  • Branches default

Comments (0)

Files changed (103)

File UnoControls/prj/build.lst

View file
-us	UnoControls	:	cppuhelper offuh tools NULL
+us	UnoControls	: LIBXSLT:libxslt cppuhelper offuh tools NULL
 us	UnoControls								usr1	-	all	us_mkout NULL
 us	UnoControls\source\base					nmake	-	all	us_base NULL
 us	UnoControls\source\controls				nmake	-	all	us_ctrls NULL

File accessibility/prj/build.lst

View file
-ac  accessibility	:    l10n tools jurt offuh unoil vcl javaunohelper jvmaccess cppu sal toolkit svtools NULL
+ac  accessibility	:    l10n tools jurt offuh unoil vcl javaunohelper jvmaccess cppu sal toolkit svtools LIBXSLT:libxslt NULL
 ac	accessibility                                         	usr1	-	all	ac_mkout NULL
 ac	accessibility\inc                                      	nmake	-	all	ac_inc NULL
 ac	accessibility\bridge\org\openoffice\java\accessibility	nmake	-	w	ac_ooja ac_inc NULL

File animations/prj/build.lst

View file
-animations	animations	:	cppuhelper comphelper offuh NULL
+animations	animations	:	cppuhelper comphelper offuh LIBXSLT:libxslt NULL
 animations	animations						usr1	-	all	animations_mkout NULL
 animations	animations\source\animcore		nmake	-	all	animations_animcore NULL

File avmedia/prj/build.lst

View file
-av	avmedia	:    l10n tools sfx2 NULL
+av	avmedia	:    l10n tools sfx2 LIBXSLT:libxslt NULL
 av	avmedia                 	usr1	-	all	av_mkout												NULL
 av	avmedia\prj					get		-	all	av_prj													NULL
 av	avmedia\inc					get		-	all	av_inv													NULL

File basctl/prj/build.lst

View file
-bc	basctl	: l10n svx NULL
+bc	basctl	: LIBXSLT:libxslt l10n svx NULL
 bc	basctl									usr1	-	all	bc_mkout NULL
 bc	basctl\inc								nmake	-	all	bc_inc NULL
 bc	basctl\source\inc						get		-	all	bc_sinc NULL

File basic/prj/build.lst

View file
-sb	basic	:    l10n offuh oovbaapi svtools xmlscript framework salhelper NULL
+sb	basic	:    l10n offuh oovbaapi svtools xmlscript framework salhelper LIBXSLT:libxslt NULL
 sb	basic									usr1	-	all	sb_mkout NULL
 sb	basic\inc								nmake	-	all	sb_inc NULL
 sb	basic\source\app						nmake	-	all	sb_app sb_class sb_inc NULL

File binfilter/prj/build.lst

View file
-bf      binfilter : basic vcl xmlscript connectivity framework svtools offuh NULL
+bf      binfilter : basic vcl xmlscript connectivity framework svtools offuh LIBXSLT:libxslt NULL
 bf	binfilter											usr1	-	all	bf_mkout NULL
 bf	binfilter\bf_svtools\source\inc						get		-	all	bf_svt_sinc NULL
 bf  binfilter\bf_svtools\source\config					nmake	-	all bf_svt_config NULL

File canvas/prj/build.lst

View file
-cv	canvas	:	javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl AGG:agg basegfx CAIRO:cairo NULL
+cv	canvas	:	javaunohelper comphelper cppuhelper offuh unoil tools svtools vcl AGG:agg basegfx CAIRO:cairo LIBXSLT:libxslt NULL
 cv	canvas											 usr1	-	all	cv_mkout NULL
 cv	canvas\inc										 nmake	-	all	cv_inc NULL
 cv	canvas\source\tools								 nmake	-	all cv_tools cv_inc NULL

File chart2/prj/build.lst

View file
-ch	chart2	:    l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 NULL
+ch	chart2	:    l10n comphelper cppu cppuhelper sal svtools svx tools vcl toolkit unotools sfx2 LIBXSLT:libxslt NULL
 ch	chart2										usr1	-	all	ch_mkout NULL
 ch	chart2\inc									nmake	-	all	ch_inc NULL
 ch	chart2\source\inc							get		-	all	ch_source_inc NULL

File comphelper/prj/build.lst

View file
-ph	comphelper	:	cppuhelper ucbhelper offuh vos salhelper NULL
+ph	comphelper	:	cppuhelper ucbhelper offuh vos salhelper LIBXSLT:libxslt NULL
 ph	comphelper								usr1	-	all	ph_mkout NULL
 ph	comphelper\inc							nmake	-	all	ph_inc NULL
 ph	comphelper\source\container				nmake	-	all	ph_container ph_inc NULL

File configmgr/prj/build.lst

View file
-cg configmgr : BOOST:boost comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL
+cg configmgr : BOOST:boost LIBXSLT:libxslt comphelper cppu cppuhelper offuh sal salhelper stlport xmlreader NULL
 cg configmgr\inc nmake - all cg_inc NULL
 cg configmgr\source nmake - all cg_source cg_inc NULL
 cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL

File connectivity/prj/build.lst

View file
-cn  connectivity    :    shell  l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss NULL
+cn  connectivity    :    shell  l10n comphelper MOZ:moz SO:moz_prebuilt svl UNIXODBC:unixODBC unoil javaunohelper HSQLDB:hsqldb qadevOOo officecfg NSS:nss LIBXSLT:libxslt NULL
 cn  connectivity                                    usr1    -   all cn_mkout NULL
 cn  connectivity\inc                                nmake   -   all cn_inc NULL
 cn  connectivity\com\sun\star\sdbcx\comp\hsqldb     nmake   -   all cn_jhsqldbdb cn_hsqldb cn_inc NULL

File cppuhelper/prj/build.lst

View file
-ch	cppuhelper	:	BOOST:boost codemaker cppu offuh NULL
+ch	cppuhelper	:	BOOST:boost LIBXSLT:libxslt codemaker cppu offuh NULL
 ch	cppuhelper								usr1	-	all	ch_mkout NULL
 ch	cppuhelper\inc							nmake	-	all	ch_include NULL
 ch	cppuhelper\source						nmake	-	all	ch_source ch_unotypes ch_include NULL

File dbaccess/prj/build.lst

View file
-ba      dbaccess        :       l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript NULL
+ba      dbaccess        :       l10n BOOST:boost connectivity svx stoc qadevOOo xmlscript LIBXSLT:libxslt NULL
 ba	dbaccess								usr1	-	all	ba_mkout NULL
 ba	dbaccess\inc							nmake	-	all	ba_inc NULL
 ba	dbaccess\source\ui\inc					nmake	-	all	ba_uiinc ba_inc NULL

File desktop/prj/build.lst

View file
-dt      desktop :    l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh NULL
+dt      desktop :    l10n sfx2 stoc BERKELEYDB:berkeleydb sysui SO:sysui_so BOOST:boost svx xmlhelp sal unoil officecfg offuh filter LIBXSLT:libxslt NULL
 dt	desktop									usr1	-	all	dt_mkout NULL
 dt	desktop\inc								nmake	-	all	dt_inc NULL
 dt	desktop\prj								get		-	all	dt_prj NULL
 dt  desktop\source\registration\com\sun\star\servicetag             nmake   -  all sn_svctag NULL
 dt  desktop\source\registration\com\sun\star\registration           nmake   -  all sn_regjob sn_svctag NULL
 dt desktop\qa\deployment_misc nmake - all sn_qa_deployment_misc dt_dp_misc dt_inc NULL
+dt desktop\test\deployment\active nmake - all dt_test_deployment_active NULL
+dt desktop\test\deployment\boxt nmake - all dt_test_deployment_boxt NULL
+dt desktop\test\deployment\passive nmake - all dt_test_deployment_passive NULL

File desktop/source/deployment/registry/component/dp_component.cxx

View file
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
 using ::rtl::OUString;
+namespace css = com::sun::star;
 
 namespace dp_registry {
 namespace backend {
         BackendImpl * getMyBackend() const;
 
         const OUString m_loader;
-        ComponentBackendDb::Data m_registeredComponentsDb;
-        
+
         enum reg {
             REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED
         } m_registered;
         
-        Reference<loader::XImplementationLoader> getComponentInfo(
-            t_stringlist * pImplNames, t_stringpairvec * pSingletons,
+        void getComponentInfo(
+            ComponentBackendDb::Data * data,
+            std::vector< css::uno::Reference< css::uno::XInterface > > *
+                factories,
             Reference<XComponentContext> const & xContext );
         
         virtual void SAL_CALL disposing();
             OUString const & identifier);
     };
     friend class ComponentPackageImpl;
-    
+
+    class ComponentsPackageImpl : public ::dp_registry::backend::Package
+    {
+        BackendImpl * getMyBackend() const;
+
+        // Package
+        virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_(
+            ::osl::ResettableMutexGuard & guard,
+            ::rtl::Reference<AbortChannel> const & abortChannel,
+            Reference<XCommandEnvironment> const & xCmdEnv );
+        virtual void processPackage_(
+            ::osl::ResettableMutexGuard & guard,
+            bool registerPackage,
+            bool startup,
+            ::rtl::Reference<AbortChannel> const & abortChannel,
+            Reference<XCommandEnvironment> const & xCmdEnv );
+    public:
+        ComponentsPackageImpl(
+            ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+            OUString const & url, OUString const & name,
+            Reference<deployment::XPackageTypeInfo> const & xPackageType,
+            bool bRemoved, OUString const & identifier);
+    };
+    friend class ComponentsPackageImpl;
+
     class TypelibraryPackageImpl : public ::dp_registry::backend::Package
     {
         BackendImpl * getMyBackend() const;
     
     t_stringlist m_jar_typelibs;
     t_stringlist m_rdb_typelibs;
-    t_stringlist & getTypelibs( bool jar ) {
-        return jar ? m_jar_typelibs : m_rdb_typelibs;
+    t_stringlist m_components;
+
+    enum RcItem { RCITEM_JAR_TYPELIB, RCITEM_RDB_TYPELIB, RCITEM_COMPONENTS };
+
+    t_stringlist & getRcItemList( RcItem kind ) {
+        switch (kind)
+        {
+        case RCITEM_JAR_TYPELIB:
+            return m_jar_typelibs;
+        case RCITEM_RDB_TYPELIB:
+            return m_rdb_typelibs;
+        default: // case RCITEM_COMPONENTS
+            return m_components;
+        }
     }
     
     bool m_unorc_inited;
     const Reference<deployment::XPackageTypeInfo> m_xDynComponentTypeInfo;
     const Reference<deployment::XPackageTypeInfo> m_xJavaComponentTypeInfo;
     const Reference<deployment::XPackageTypeInfo> m_xPythonComponentTypeInfo;
+    const Reference<deployment::XPackageTypeInfo> m_xComponentsTypeInfo;
     const Reference<deployment::XPackageTypeInfo> m_xRDBTypelibTypeInfo;
     const Reference<deployment::XPackageTypeInfo> m_xJavaTypelibTypeInfo;
     Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos;
         OUString const & id, Reference<XInterface> const & xObject );
     void releaseObject( OUString const & id );
     
-    bool addToUnoRc( bool jarFile, OUString const & url,
+    bool addToUnoRc( RcItem kind, OUString const & url,
                      Reference<XCommandEnvironment> const & xCmdEnv );
-    bool removeFromUnoRc( bool jarFile, OUString const & url,
+    bool removeFromUnoRc( RcItem kind, OUString const & url,
                           Reference<XCommandEnvironment> const & xCmdEnv );
-    bool hasInUnoRc( bool jarFile, OUString const & url );
+    bool hasInUnoRc( RcItem kind, OUString const & url );
 
-    
-    
+    css::uno::Reference< css::registry::XRegistryKey > openRegistryKey(
+        css::uno::Reference< css::registry::XRegistryKey > const & base,
+        rtl::OUString const & path);
+
+    void extractComponentData(
+        css::uno::Reference< css::uno::XComponentContext > const & context,
+        css::uno::Reference< css::registry::XRegistryKey > const & registry,
+        ComponentBackendDb::Data * data,
+        std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
+        css::uno::Reference< css::loader::XImplementationLoader > const *
+            componentLoader,
+        rtl::OUString const * componentUrl);
+
+    void componentLiveInsertion(
+        ComponentBackendDb::Data const & data,
+        std::vector< css::uno::Reference< css::uno::XInterface > > const &
+            factories);
+
+    void componentLiveRemoval(ComponentBackendDb::Data const & data);
+
 public:
     BackendImpl( Sequence<Any> const & args,
                  Reference<XComponentContext> const & xComponentContext );
                xPackageType, bRemoved, identifier),
       m_loader( loader ),
       m_registered( REG_UNINIT )
-{
-    if (bRemoved)
-    {
-        m_registeredComponentsDb = getMyBackend()->readDataFromDb(url);
-    }
-}
-
+{}
 
 const Reference<registry::XSimpleRegistry>
 BackendImpl::ComponentPackageImpl::getRDB() const
                                           RID_STR_PYTHON_COMPONENT),
                                       RID_IMG_COMPONENT,
                                       RID_IMG_COMPONENT_HC ) ),
+      m_xComponentsTypeInfo( new Package::TypeInfo(
+                                 OUSTR("application/"
+                                       "vnd.sun.star.uno-components"),
+                                 OUSTR("*.components"),
+                                 getResourceString(RID_STR_COMPONENTS),
+                                 RID_IMG_COMPONENT,
+                                 RID_IMG_COMPONENT_HC ) ),
       m_xRDBTypelibTypeInfo( new Package::TypeInfo(
                                  OUSTR("application/"
                                        "vnd.sun.star.uno-typelibrary;"
                                   getResourceString(RID_STR_JAVA_TYPELIB),
                                   RID_IMG_JAVA_TYPELIB,
                                   RID_IMG_JAVA_TYPELIB_HC ) ),
-      m_typeInfos( 5 )
+      m_typeInfos( 6 )
 {
     m_typeInfos[ 0 ] = m_xDynComponentTypeInfo;
     m_typeInfos[ 1 ] = m_xJavaComponentTypeInfo;
     m_typeInfos[ 2 ] = m_xPythonComponentTypeInfo;
-    m_typeInfos[ 3 ] = m_xRDBTypelibTypeInfo;
-    m_typeInfos[ 4 ] = m_xJavaTypelibTypeInfo;
+    m_typeInfos[ 3 ] = m_xComponentsTypeInfo;
+    m_typeInfos[ 4 ] = m_xRDBTypelibTypeInfo;
+    m_typeInfos[ 5 ] = m_xJavaTypelibTypeInfo;
     
     const Reference<XCommandEnvironment> xCmdEnv;
     
                 }
             }
             else if (subType.EqualsIgnoreCaseAscii(
+                         "vnd.sun.star.uno-components"))
+            {
+                INetContentTypeParameter const * param = params.find(
+                    ByteString("platform") );
+                if (param == 0 || platform_fits( param->m_sValue )) {
+                    return new BackendImpl::ComponentsPackageImpl(
+                        this, url, name, m_xComponentsTypeInfo, bRemoved,
+                        identifier);
+                }
+            }
+            else if (subType.EqualsIgnoreCaseAscii(
                          "vnd.sun.star.uno-typelibrary"))
             {
                 INetContentTypeParameter const * param = params.find(
                 while (index >= 0);
             }
             if (readLine( &line, OUSTR("UNO_SERVICES="), ucb_content,
-                          RTL_TEXTENCODING_UTF8 )) {
-                sal_Int32 start = sizeof ("UNO_SERVICES=?$ORIGIN/") - 1;
-                sal_Int32 sep = line.indexOf( ' ', start );
-                OSL_ASSERT( sep > 0 );
-                m_commonRDB_RO = line.copy( start, sep - start );
+                          RTL_TEXTENCODING_UTF8 ))
+            {
+                // The UNO_SERVICES line always has the BNF form
+                //  "UNO_SERVICES="
+                //  ("?$ORIGIN/" <common-rdb>)?                        -- first
+                //  "${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}"?       -- second
+                //  ("?" ("BUNDLED_EXTENSIONS" |                       -- third
+                //   "UNO_SHARED_PACKAGES_CACHE" | "UNO_USER_PACKAGES_CACHE")
+                //   ...)*
+                // so can unambiguously be split into its thre parts:
+                int state = 1;
+                for (sal_Int32 i = RTL_CONSTASCII_LENGTH("UNO_SERVICES=");
+                     i >= 0;)
+                {
+                    rtl::OUString token(line.getToken(0, ' ', i));
+                    if (token.getLength() != 0)
+                    {
+                        if (state == 1 &&
+                            token.matchAsciiL(
+                                RTL_CONSTASCII_STRINGPARAM("?$ORIGIN/")))
+                        {
+                            m_commonRDB_RO = token.copy(
+                                RTL_CONSTASCII_LENGTH("?$ORIGIN/"));
+                            state = 2;
+                        }
+                        else if (state <= 2 &&
+                                 token.equalsAsciiL(
+                                     RTL_CONSTASCII_STRINGPARAM(
+                                         "${$ORIGIN/${_OS}_${_ARCH}rc:"
+                                         "UNO_SERVICES}")))
+                        {
+                            state = 3;
+                        }
+                        else
+                        {
+                            if (token[0] == '?')
+                            {
+                                token = token.copy(1);
+                            }
+                            m_components.push_back(token);
+                            state = 3;
+                        }
+                    }
+                }
             }
             
             // native rc:
     OUString sCommonRDB(m_commonRDB.getLength() > 0 ? m_commonRDB : m_commonRDB_RO);
     OUString sNativeRDB(m_nativeRDB.getLength() > 0 ? m_nativeRDB : m_nativeRDB_RO);
 
-    if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0)
+    if (sCommonRDB.getLength() > 0 || sNativeRDB.getLength() > 0 ||
+        !m_components.empty())
     {
-        buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=?$ORIGIN/") );
-        buf.append( ::rtl::OUStringToOString(
-                        sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+        buf.append( RTL_CONSTASCII_STRINGPARAM("UNO_SERVICES=") );
+        bool space = false;
+        if (sCommonRDB.getLength() > 0)
+        {
+            buf.append( RTL_CONSTASCII_STRINGPARAM("?$ORIGIN/") );
+            buf.append( ::rtl::OUStringToOString(
+                            sCommonRDB, RTL_TEXTENCODING_ASCII_US ) );
+            space = true;
+        }
         if (sNativeRDB.getLength() > 0)
         {
+            if (space)
+            {
+                buf.append(' ');
+            }
             buf.append( RTL_CONSTASCII_STRINGPARAM(
-                            " ${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
-            buf.append(LF);
+                            "${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") );
+            space = true;
             
             // write native rc:
             ::rtl::OStringBuffer buf2;
                 xCmdEnv );
             ucb_content.writeStream( xData, true /* replace existing */ );
         }
+        for (t_stringlist::iterator i(m_components.begin());
+             i != m_components.end(); ++i)
+        {
+            if (space)
+            {
+                buf.append(' ');
+            }
+            buf.append('?');
+            buf.append(rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8));
+            space = true;
+        }
+        buf.append(LF);
     }
     
     // write unorc:
 }
 
 //______________________________________________________________________________
-bool BackendImpl::addToUnoRc( bool jarFile, OUString const & url_,
+bool BackendImpl::addToUnoRc( RcItem kind, OUString const & url_,
                               Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
     const ::osl::MutexGuard guard( getMutex() );
     unorc_verify_init( xCmdEnv );
-    t_stringlist & rSet = getTypelibs(jarFile);
+    t_stringlist & rSet = getRcItemList(kind);
     if (::std::find( rSet.begin(), rSet.end(), rcterm ) == rSet.end()) {
         rSet.push_front( rcterm ); // prepend to list, thus overriding
         // write immediately:
 
 //______________________________________________________________________________
 bool BackendImpl::removeFromUnoRc(
-    bool jarFile, OUString const & url_,
+    RcItem kind, OUString const & url_,
     Reference<XCommandEnvironment> const & xCmdEnv )
 {
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
     const ::osl::MutexGuard guard( getMutex() );
     unorc_verify_init( xCmdEnv );
-    getTypelibs(jarFile).remove( rcterm );
+    getRcItemList(kind).remove( rcterm );
     // write immediately:
     m_unorc_modified = true;
     unorc_flush( xCmdEnv );
 
 //______________________________________________________________________________
 bool BackendImpl::hasInUnoRc(
-    bool jarFile, OUString const & url_ )
+    RcItem kind, OUString const & url_ )
 {   
     const OUString rcterm( dp_misc::makeRcTerm(url_) );
     const ::osl::MutexGuard guard( getMutex() );
-    t_stringlist const & rSet = getTypelibs(jarFile);
+    t_stringlist const & rSet = getRcItemList(kind);
     return ::std::find( rSet.begin(), rSet.end(), rcterm ) != rSet.end();
 }
 
+css::uno::Reference< css::registry::XRegistryKey > BackendImpl::openRegistryKey(
+    css::uno::Reference< css::registry::XRegistryKey > const & base,
+    rtl::OUString const & path)
+{
+    OSL_ASSERT(base.is());
+    css::uno::Reference< css::registry::XRegistryKey > key(base->openKey(path));
+    if (!key.is()) {
+        throw css::deployment::DeploymentException(
+            (rtl::OUString(
+                RTL_CONSTASCII_USTRINGPARAM("missing registry entry ")) +
+             path + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" under ")) +
+             base->getKeyName()),
+            static_cast< OWeakObject * >(this), Any());
+    }
+    return key;
+}
+
+void BackendImpl::extractComponentData(
+    css::uno::Reference< css::uno::XComponentContext > const & context,
+    css::uno::Reference< css::registry::XRegistryKey > const & registry,
+    ComponentBackendDb::Data * data,
+    std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
+    css::uno::Reference< css::loader::XImplementationLoader > const *
+        componentLoader,
+    rtl::OUString const * componentUrl)
+{
+    OSL_ASSERT(context.is() && registry.is() && data != 0 && factories != 0);
+    rtl::OUString registryName(registry->getKeyName());
+    sal_Int32 prefix = registryName.getLength();
+    if (!registryName.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) {
+        prefix += RTL_CONSTASCII_LENGTH("/");
+    }
+    css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
+        keys(registry->openKeys());
+    css::uno::Reference< css::lang::XMultiComponentFactory > smgr(
+        context->getServiceManager(), css::uno::UNO_QUERY_THROW);
+    for (sal_Int32 i = 0; i < keys.getLength(); ++i) {
+        rtl::OUString name(keys[i]->getKeyName().copy(prefix));
+        data->implementationNames.push_back(name);
+        css::uno::Reference< css::registry::XRegistryKey > singletons(
+            keys[i]->openKey(
+                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UNO/SINGLETONS"))));
+        if (singletons.is()) {
+            sal_Int32 prefix2 = keys[i]->getKeyName().getLength() +
+                RTL_CONSTASCII_LENGTH("/UNO/SINGLETONS/");
+            css::uno::Sequence<
+                css::uno::Reference< css::registry::XRegistryKey > >
+                singletonKeys(singletons->openKeys());
+            for (sal_Int32 j = 0; j < singletonKeys.getLength(); ++j) {
+                data->singletons.push_back(
+                    std::pair< rtl::OUString, rtl::OUString >(
+                        singletonKeys[j]->getKeyName().copy(prefix2), name));
+            }
+        }
+        css::uno::Reference< css::loader::XImplementationLoader > loader;
+        if (componentLoader == 0) {
+            rtl::OUString activator(
+                openRegistryKey(
+                    keys[i],
+                    rtl::OUString(
+                        RTL_CONSTASCII_USTRINGPARAM("UNO/ACTIVATOR")))->
+                getAsciiValue());
+            loader.set(
+                smgr->createInstanceWithContext(activator, context),
+                css::uno::UNO_QUERY);
+            if (!loader.is()) {
+                throw css::deployment::DeploymentException(
+                    (rtl::OUString(
+                        RTL_CONSTASCII_USTRINGPARAM(
+                            "cannot instantiate loader ")) +
+                     activator),
+                    static_cast< OWeakObject * >(this), Any());
+            }
+        } else {
+            OSL_ASSERT(componentLoader->is());
+            loader = *componentLoader;
+        }
+        factories->push_back(
+            loader->activate(
+                name, rtl::OUString(),
+                (componentUrl == 0
+                 ? (openRegistryKey(
+                        keys[i],
+                        rtl::OUString(
+                            RTL_CONSTASCII_USTRINGPARAM("UNO/LOCATION")))->
+                    getAsciiValue())
+                 : *componentUrl),
+                keys[i]));
+    }
+}
+
+void BackendImpl::componentLiveInsertion(
+    ComponentBackendDb::Data const & data,
+    std::vector< css::uno::Reference< css::uno::XInterface > > const &
+        factories)
+{
+    css::uno::Reference< css::container::XSet > set(
+        getComponentContext()->getServiceManager(), css::uno::UNO_QUERY_THROW);
+    std::vector< css::uno::Reference< css::uno::XInterface > >::const_iterator
+        factory(factories.begin());
+    for (t_stringlist::const_iterator i(data.implementationNames.begin());
+         i != data.implementationNames.end(); ++i)
+    {
+        try {
+            set->insert(css::uno::Any(*factory++));
+        } catch (container::ElementExistException &) {
+            OSL_TRACE(
+                "implementation %s already registered",
+                rtl::OUStringToOString(*i, RTL_TEXTENCODING_UTF8).getStr());
+        }
+    }
+    if (!data.singletons.empty()) {
+        css::uno::Reference< css::container::XNameContainer >
+            rootContext(
+                getComponentContext()->getValueByName(
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_root"))),
+                css::uno::UNO_QUERY);
+        if (rootContext.is()) {
+            for (t_stringpairvec::const_iterator i(data.singletons.begin());
+                 i != data.singletons.end(); ++i)
+            {
+                rtl::OUString name(
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/")) +
+                    i->first);
+                try {
+                    rootContext->removeByName(
+                        name +
+                        rtl::OUString(
+                            RTL_CONSTASCII_USTRINGPARAM("/arguments")));
+                } catch (container::NoSuchElementException &) {}
+                try {
+                    rootContext->insertByName(
+                        (name +
+                         rtl::OUString(
+                             RTL_CONSTASCII_USTRINGPARAM("/service"))),
+                        css::uno::Any(i->second));
+                } catch (container::ElementExistException &) {
+                    rootContext->replaceByName(
+                        (name +
+                         rtl::OUString(
+                             RTL_CONSTASCII_USTRINGPARAM("/service"))),
+                        css::uno::Any(i->second));
+                }
+                try {
+                    rootContext->insertByName(name, css::uno::Any());
+                } catch (container::ElementExistException &) {
+                    OSL_TRACE(
+                        "singleton %s already registered",
+                        rtl::OUStringToOString(
+                            i->first, RTL_TEXTENCODING_UTF8).getStr());
+                    rootContext->replaceByName(name, css::uno::Any());
+                }
+            }
+        }
+    }
+}
+
+void BackendImpl::componentLiveRemoval(ComponentBackendDb::Data const & data) {
+    css::uno::Reference< css::container::XSet > set(
+        getComponentContext()->getServiceManager(), css::uno::UNO_QUERY_THROW);
+    for (t_stringlist::const_iterator i(data.implementationNames.begin());
+         i != data.implementationNames.end(); ++i)
+    {
+        try {
+            set->remove(css::uno::Any(*i));
+        } catch (css::container::NoSuchElementException &) {
+            // ignore if factory has not been live deployed
+        }
+    }
+    if (!data.singletons.empty()) {
+        css::uno::Reference< css::container::XNameContainer > rootContext(
+            getComponentContext()->getValueByName(
+                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_root"))),
+            css::uno::UNO_QUERY);
+        if (rootContext.is()) {
+            for (t_stringpairvec::const_iterator i(data.singletons.begin());
+                 i != data.singletons.end(); ++i)
+            {
+                rtl::OUString name(
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/")) +
+                    i->first);
+                try {
+                    rootContext->removeByName(
+                        name +
+                        rtl::OUString(
+                            RTL_CONSTASCII_USTRINGPARAM("/arguments")));
+                    rootContext->removeByName(
+                        name +
+                        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/service")));
+                    rootContext->removeByName(name);
+                } catch (container::NoSuchElementException &) {}
+            }
+        }
+    }
+}
+
 //______________________________________________________________________________
 void BackendImpl::releaseObject( OUString const & id )
 {
     const ::osl::MutexGuard guard( getMutex() );
-    if ( m_backendObjects.erase( id ) != 1 )
-    {
-        OSL_ASSERT( false );
-    }
+    m_backendObjects.erase( id );
 }
 
 //______________________________________________________________________________
 }
 
 //------------------------------------------------------------------------------
-Reference<loader::XImplementationLoader>
-BackendImpl::ComponentPackageImpl::getComponentInfo(
-    t_stringlist * pImplNames, t_stringpairvec * pSingletons,
+void BackendImpl::ComponentPackageImpl::getComponentInfo(
+    ComponentBackendDb::Data * data,
+    std::vector< css::uno::Reference< css::uno::XInterface > > * factories,
     Reference<XComponentContext> const & xContext )
 {
     const Reference<loader::XImplementationLoader> xLoader(
         xContext->getServiceManager()->createInstanceWithContext(
             m_loader, xContext ), UNO_QUERY );
     if (! xLoader.is())
-        return Reference<loader::XImplementationLoader>();
+    {
+        throw css::deployment::DeploymentException(
+            (rtl::OUString(
+                RTL_CONSTASCII_USTRINGPARAM("cannot instantiate loader ")) +
+             m_loader),
+            static_cast< OWeakObject * >(this), Any());
+    }
     
     // HACK: highly dependent on stoc/source/servicemanager
     //       and stoc/source/implreg implementation which rely on the same
     //       services.rdb format!
-    
+    //       .../UNO/LOCATION and .../UNO/ACTIVATOR appear not to be written by
+    //       writeRegistryInfo, however, but are knwon, fixed values here, so
+    //       can be passed into extractComponentData
+    rtl::OUString url(getURL());
     const Reference<registry::XSimpleRegistry> xMemReg(
         xContext->getServiceManager()->createInstanceWithContext(
             OUSTR("com.sun.star.registry.SimpleRegistry"), xContext ),
         UNO_QUERY_THROW );
     xMemReg->open( OUString() /* in mem */, false, true );
-    xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), getURL() );
-    
-    const Sequence< Reference<registry::XRegistryKey> > keys(
-        xMemReg->getRootKey()->openKeys() );
-    for ( sal_Int32 pos = keys.getLength(); pos--; )
-    {
-        Reference<registry::XRegistryKey> const & xImplKey = keys[ pos ];
-        const OUString implName(
-            xImplKey->getKeyName().copy( 1 /*leading slash*/ ) );
-        
-        // check for singletons:
-        const Reference<registry::XRegistryKey> xSingletonKey(
-            xImplKey->openKey( OUSTR("UNO/SINGLETONS") ) );
-        if (xSingletonKey.is() && xSingletonKey->isValid())
-        {
-            const Sequence< Reference<registry::XRegistryKey> > singletonKeys(
-                xSingletonKey->openKeys() );
-            for ( sal_Int32 i = singletonKeys.getLength(); i--; )
-            {
-                Reference<registry::XRegistryKey> const & xSingleton =
-                    singletonKeys[ i ];
-                pSingletons->push_back(
-                    ::std::pair<OUString, OUString>(
-                        xSingleton->getKeyName().copy(
-                            implName.getLength() +
-                            sizeof ("//UNO/SINGLETONS/") - 1 ),
-                        xSingleton->getStringValue() ) );
-            }
-        }
-        else
-        {
-        	pImplNames->push_back( implName );
-        }
-    }
-    
-    return xLoader;
+    xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), url );
+    getMyBackend()->extractComponentData(
+        xContext, xMemReg->getRootKey(), data, factories, &xLoader, &url);
 }
 
 // Package
     ::rtl::Reference<AbortChannel> const & abortChannel,
     Reference<XCommandEnvironment> const & xCmdEnv )
 {
-    BackendImpl * that = getMyBackend();  
-    
- 
-    const bool java = m_loader.equalsAsciiL(
-        RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") );
-    const OUString url( getURL() );
-    bool isJavaTypelib;
-    if (m_bRemoved)
-        isJavaTypelib = m_registeredComponentsDb.javaTypeLibrary;
-    else
-        isJavaTypelib = java &&
-            !jarManifestHeaderPresent( url, OUSTR("UNO-Type-Path"), xCmdEnv );
-
-    ComponentBackendDb::Data data;
-    data.javaTypeLibrary = isJavaTypelib;
-    if (doRegisterPackage)
-    {        
-        Reference <uno::XComponentContext> context(that->getComponentContext());
-        if (! startup)
-        {
-            context.set(
-                that->getObject( url ), UNO_QUERY );
-            
-            if (! context.is()) {
+    BackendImpl * that = getMyBackend();
+    rtl::OUString url(getURL());
+    if (doRegisterPackage) {
+        ComponentBackendDb::Data data;
+        css::uno::Reference< css::uno::XComponentContext > context;
+        if (startup) {
+            context = that->getComponentContext();
+        } else {
+            context.set(that->getObject(url), css::uno::UNO_QUERY);
+            if (!context.is()) {
                 context.set(
-                    that->insertObject( url, raise_uno_process(
-                                            that->getComponentContext(),
-                                            abortChannel ) ),
-                    UNO_QUERY_THROW );
+                    that->insertObject(
+                        url,
+                        raise_uno_process(
+                            that->getComponentContext(), abortChannel)),
+                    css::uno::UNO_QUERY_THROW);
             }
         }
-        
-        const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
-        const Reference<registry::XImplementationRegistration> xImplReg(
+        css::uno::Reference< css::registry::XImplementationRegistration>(
             context->getServiceManager()->createInstanceWithContext(
-                OUSTR("com.sun.star.registry.ImplementationRegistration"),
-                context ), UNO_QUERY_THROW );
-
-        xImplReg->registerImplementation( m_loader, url, xServicesRDB );
-        //only write to unorc if registration was successful.
-        //It may fail if there is no suitable java.
-        if (isJavaTypelib)
+                rtl::OUString(
+                    RTL_CONSTASCII_USTRINGPARAM(
+                        "com.sun.star.registry.ImplementationRegistration")),
+                context),
+            css::uno::UNO_QUERY_THROW)->registerImplementation(
+                m_loader, url, getRDB());
+        // Only write to unorc after successful registration; it may fail if
+        // there is no suitable java
+        if (m_loader.equalsAsciiL(
+                RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2")) &&
+            !jarManifestHeaderPresent(url, OUSTR("UNO-Type-Path"), xCmdEnv))
         {
-            that->addToUnoRc( java, url, xCmdEnv );
+            that->addToUnoRc(RCITEM_JAR_TYPELIB, url, xCmdEnv);
             data.javaTypeLibrary = true;
         }
-
-        t_stringlist implNames;
-        t_stringpairvec singletons;
-         const Reference<loader::XImplementationLoader> xLoader(
-            getComponentInfo( &implNames, &singletons, context ) );
-        data.implementationNames = implNames;
-        data.singletons = singletons;
-
-        if (!startup)
-        {
-            // factories live insertion:
-            const Reference<container::XSet> xSet(
-                that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
-            for ( t_stringlist::const_iterator iPos( implNames.begin() );
-                  iPos != implNames.end(); ++iPos )
-            {
-                checkAborted( abortChannel );    
-                OUString const & implName = *iPos;
-                // activate factory:
-                const Reference<XInterface> xFactory(
-                    xLoader->activate(
-                        implName, OUString(), url,
-                        xServicesRDB->getRootKey()->openKey(
-                            OUSTR("/IMPLEMENTATIONS/") + implName ) ) );
-                try {
-                    xSet->insert( Any(xFactory) );
-                } // ignore if factory has already been inserted:
-                catch (container::ElementExistException &) {
-                    OSL_ENSURE( 0, "### factory already registered?" );
-                }
-            }
-        
-            if (! singletons.empty())
-            {
-                // singletons live insertion:
-                const Reference<container::XNameContainer> xRootContext(
-                    that->getComponentContext()->getValueByName(
-                        OUSTR("_root") ), UNO_QUERY );
-                if (xRootContext.is())
-                {
-                    for ( t_stringpairvec::const_iterator iPos(
-                              singletons.begin() );
-                          iPos != singletons.end(); ++iPos )
-                    {
-                        ::std::pair<OUString, OUString> const & sp = *iPos;
-                        const OUString name( OUSTR("/singletons/") + sp.first );
-                        // assure no arguments:
-                        try {
-                            xRootContext->removeByName( name + OUSTR("/arguments"));
-                        } catch (container::NoSuchElementException &) {}
-                        // used service:
-                        try {
-                            xRootContext->insertByName(
-                                name + OUSTR("/service"), Any(sp.second) );
-                        } catch (container::ElementExistException &) {
-                            xRootContext->replaceByName(
-                                name + OUSTR("/service"), Any(sp.second) );
-                        }
-                        // singleton entry:
-                        try {
-                            xRootContext->insertByName( name, Any() );
-                        } catch (container::ElementExistException & exc) {
-                            (void) exc; // avoid warnings
-                            OSL_ENSURE(
-                                0, OUStringToOString(
-                                    exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
-                            xRootContext->replaceByName( name, Any() );
-                        }
-                    }
-                }
-            }
+        std::vector< css::uno::Reference< css::uno::XInterface > > factories;
+        getComponentInfo(&data, &factories, context);
+        if (!startup) {
+            that->componentLiveInsertion(data, factories);
         }
-        
         m_registered = REG_REGISTERED;
-        getMyBackend()->addDataToDb(url, data);
-    }
-    else // revokePackage()
-    {
-        // set to VOID during revocation process:
+        that->addDataToDb(url, data);
+    } else { // revoke
         m_registered = REG_VOID;
-
-        //get the remote context. If it does not exist then use the local one
-        Reference<XComponentContext> xContext(
-            that->getObject( url ), UNO_QUERY );
-        bool bRemoteContext = false;
-        if (!xContext.is())
-            xContext = that->getComponentContext();
-        else
-            bRemoteContext = true;
-        
-        t_stringlist implNames;
-        t_stringpairvec singletons;
-        if (m_bRemoved)
-        {
-            implNames = m_registeredComponentsDb.implementationNames;
-            singletons = m_registeredComponentsDb.singletons;
+        ComponentBackendDb::Data data(that->readDataFromDb(url));
+        css::uno::Reference< css::uno::XComponentContext > context(
+            that->getObject(url), css::uno::UNO_QUERY);
+        bool remoteContext = context.is();
+        if (!remoteContext) {
+            context = that->getComponentContext();
         }
-        else
-        {
-            getComponentInfo( &implNames, &singletons, xContext );
+        if (!startup) {
+            that->componentLiveRemoval(data);
         }
-
-        if (!startup)
-        {
-            // factories live removal:
-            const Reference<container::XSet> xSet(
-                that->getComponentContext()->getServiceManager(), UNO_QUERY_THROW );
-            for ( t_stringlist::const_iterator iPos( implNames.begin() );
-                  iPos != implNames.end(); ++iPos )
-            {
-                OUString const & implName = *iPos;
-                try {
-                    xSet->remove( Any(implName) );
-                } // ignore if factory has not been live deployed:
-                catch (container::NoSuchElementException &) {
-                }
-            }
-        
-            if (! singletons.empty())
-            {
-                // singletons live removal:
-                const Reference<container::XNameContainer> xRootContext(
-                    that->getComponentContext()->getValueByName(
-                        OUSTR("_root") ), UNO_QUERY );
-                if (xRootContext.is())
-                {
-                    for ( t_stringpairvec::const_iterator iPos(
-                              singletons.begin() );
-                          iPos != singletons.end(); ++iPos )
-                    {
-                        ::std::pair<OUString, OUString> const & sp = *iPos;
-                        const OUString name( OUSTR("/singletons/") + sp.first );
-                        // arguments:
-                        try {
-                            xRootContext->removeByName( name + OUSTR("/arguments"));
-                        }
-                        catch (container::NoSuchElementException &) {}
-                        // used service:
-                        try {
-                            xRootContext->removeByName( name + OUSTR("/service") );
-                        }
-                        catch (container::NoSuchElementException &) {}
-                        // singleton entry:
-                        try {
-                            xRootContext->removeByName( name );
-                        }
-                        catch (container::NoSuchElementException & exc) {
-                            (void) exc; // avoid warnings
-                            OSL_ENSURE(
-                                0, OUStringToOString(
-                                    exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
-                        }
-                    }
-                }
-            }
+        css::uno::Reference< css::registry::XImplementationRegistration >(
+            context->getServiceManager()->createInstanceWithContext(
+                rtl::OUString(
+                    RTL_CONSTASCII_USTRINGPARAM(
+                        "com.sun.star.registry.ImplementationRegistration")),
+                context),
+            css::uno::UNO_QUERY_THROW)->revokeImplementation(url, getRDB());
+        if (data.javaTypeLibrary) {
+            that->removeFromUnoRc(RCITEM_JAR_TYPELIB, url, xCmdEnv);
         }
-        
-        const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() );
-        const Reference<registry::XImplementationRegistration> xImplReg(
-            xContext->getServiceManager()->createInstanceWithContext(
-                OUSTR("com.sun.star.registry.ImplementationRegistration"),
-                xContext ), UNO_QUERY_THROW );
-        xImplReg->revokeImplementation( url, xServicesRDB );
-        
-        if (isJavaTypelib)
-            that->removeFromUnoRc( java, url, xCmdEnv );
-        
-        if (bRemoteContext)
-            that->releaseObject( url );
-        
+        if (remoteContext) {
+            that->releaseObject(url);
+        }
         m_registered = REG_NOT_REGISTERED;
-        getMyBackend()->deleteDataFromDb(url);
+        that->deleteDataFromDb(url);
     }
 }
 
     return beans::Optional< beans::Ambiguous<sal_Bool> >(
         true /* IsPresent */,
         beans::Ambiguous<sal_Bool>(
-            that->hasInUnoRc( m_jarFile, getURL() ),
+            that->hasInUnoRc(
+                m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB, getURL() ),
             false /* IsAmbiguous */ ) );
 }
 
             }
         }
         
-        that->addToUnoRc( m_jarFile, url, xCmdEnv );
+        that->addToUnoRc( m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB,
+                          url, xCmdEnv );
     }
     else // revokePackage()
     {   
-        that->removeFromUnoRc( m_jarFile, url, xCmdEnv );
+        that->removeFromUnoRc(
+            m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB, url, xCmdEnv );
         
         // revoking types at runtime, possible, sensible?
         if (!m_xTDprov.is())
     }
 }
 
+BackendImpl * BackendImpl::ComponentsPackageImpl::getMyBackend() const
+{
+    BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get());
+    if (NULL == pBackend)
+    {
+        //Throws a DisposedException
+        check();
+        //We should never get here...
+        throw RuntimeException(
+            OUSTR("Failed to get the BackendImpl"),
+            static_cast<OWeakObject*>(const_cast<ComponentsPackageImpl *>(this)));
+    }
+    return pBackend;
+}
+
+beans::Optional< beans::Ambiguous<sal_Bool> >
+BackendImpl::ComponentsPackageImpl::isRegistered_(
+    ::osl::ResettableMutexGuard &,
+    ::rtl::Reference<AbortChannel> const &,
+    Reference<XCommandEnvironment> const & )
+{
+    return beans::Optional< beans::Ambiguous<sal_Bool> >(
+        true,
+        beans::Ambiguous<sal_Bool>(
+            getMyBackend()->hasInUnoRc(RCITEM_COMPONENTS, getURL()), false));
+}
+
+void BackendImpl::ComponentsPackageImpl::processPackage_(
+    ::osl::ResettableMutexGuard &,
+    bool doRegisterPackage,
+    bool startup,
+    ::rtl::Reference<AbortChannel> const & abortChannel,
+    Reference<XCommandEnvironment> const & xCmdEnv )
+{
+    BackendImpl * that = getMyBackend();
+    rtl::OUString url(getURL());
+    if (doRegisterPackage) {
+        ComponentBackendDb::Data data;
+        data.javaTypeLibrary = false;
+        std::vector< css::uno::Reference< css::uno::XInterface > > factories;
+        css::uno::Reference< css::uno::XComponentContext > context(
+            that->getObject(url), css::uno::UNO_QUERY);
+        if (!context.is()) {
+            context.set(
+                that->insertObject(
+                    url,
+                    raise_uno_process(
+                        that->getComponentContext(), abortChannel)),
+                css::uno::UNO_QUERY_THROW);
+        }
+        css::uno::Reference< css::registry::XSimpleRegistry > registry(
+            css::uno::Reference< css::lang::XMultiComponentFactory >(
+                that->getComponentContext()->getServiceManager(),
+                css::uno::UNO_SET_THROW)->createInstanceWithContext(
+                    rtl::OUString(
+                        RTL_CONSTASCII_USTRINGPARAM(
+                            "com.sun.star.registry.SimpleRegistry")),
+                    that->getComponentContext()),
+            css::uno::UNO_QUERY_THROW);
+        registry->open(expandUnoRcUrl(url), true, false);
+        getMyBackend()->extractComponentData(
+            context,
+            that->openRegistryKey(
+                registry->getRootKey(),
+                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IMPLEMENTATIONS"))),
+            &data, &factories, 0, 0);
+        registry->close();
+        if (!startup) {
+            that->componentLiveInsertion(data, factories);
+        }
+        that->addDataToDb(url, data);
+        that->addToUnoRc(RCITEM_COMPONENTS, url, xCmdEnv);
+    } else { // revoke
+        that->removeFromUnoRc(RCITEM_COMPONENTS, url, xCmdEnv);
+        if (!startup) {
+            that->componentLiveRemoval(that->readDataFromDb(url));
+        }
+        that->releaseObject(url);
+        that->deleteDataFromDb(url);
+    }
+}
+
+BackendImpl::ComponentsPackageImpl::ComponentsPackageImpl(
+    ::rtl::Reference<PackageRegistryBackend> const & myBackend,
+    OUString const & url, OUString const & name,
+    Reference<deployment::XPackageTypeInfo> const & xPackageType,
+    bool bRemoved, OUString const & identifier)
+    : Package( myBackend, url, name, name /* display-name */,
+               xPackageType, bRemoved, identifier)
+{}
+
 } // anon namespace
 
 namespace sdecl = comphelper::service_decl;

File desktop/source/deployment/registry/component/dp_component.hrc

View file
 #define RID_STR_DYN_COMPONENT                (RID_DEPLOYMENT_COMPONENT_START+10)
 #define RID_STR_JAVA_COMPONENT               (RID_DEPLOYMENT_COMPONENT_START+11)
 #define RID_STR_PYTHON_COMPONENT             (RID_DEPLOYMENT_COMPONENT_START+12)
+#define RID_STR_COMPONENTS                   (RID_DEPLOYMENT_COMPONENT_START+13)
 #define RID_STR_RDB_TYPELIB                  (RID_DEPLOYMENT_COMPONENT_START+20)
 #define RID_STR_JAVA_TYPELIB                 (RID_DEPLOYMENT_COMPONENT_START+21)
 

File desktop/source/deployment/registry/component/dp_component.src

View file
     Text [ en-US ] = "UNO Python Component";
 };
 
+String RID_STR_COMPONENTS
+{
+    Text [ en-US ] = "UNO Components";
+};
+
 String RID_STR_RDB_TYPELIB
 {
     Text [ en-US ] = "UNO RDB Type Library";

File desktop/source/deployment/registry/inc/dp_backend.h

View file
 
     ::rtl::OUString m_context;
     // currently only for library containers:
-    enum context {
+    enum {
         CONTEXT_UNKNOWN,
         CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP,
         CONTEXT_DOCUMENT

File desktop/test/deployment/active/Addons.xcu

View file
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<o:component-data xmlns:o="http://openoffice.org/2001/registry"
+    o:package="org.openoffice.Office" o:name="Addons">
+  <node o:name="AddonUI">
+    <node o:name="OfficeMenuBar">
+      <node o:name="org.openoffice.test.desktop.deployment.active"
+          o:op="replace">
+        <prop o:name="Title" xml:lang="en-US">
+          <value>active</value>
+        </prop>
+        <node o:name="Submenu">
+          <node o:name="1" o:op="replace">
+            <prop o:name="URL">
+              <value>vnd.org.openoffice.test.desktop.deployment.active_native:</value>
+            </prop>
+            <prop o:name="Title" xml:lang="en-US">
+              <value>native</value>
+            </prop>
+          </node>
+          <node o:name="2" o:op="replace">
+            <prop o:name="URL">
+              <value>vnd.org.openoffice.test.desktop.deployment.active_java:</value>
+            </prop>
+            <prop o:name="Title" xml:lang="en-US">
+              <value>java</value>
+            </prop>
+          </node>
+          <node o:name="3" o:op="replace">
+            <prop o:name="URL">
+              <value>vnd.org.openoffice.test.desktop.deployment.active_python:</value>
+            </prop>
+            <prop o:name="Title" xml:lang="en-US">
+              <value>python</value>
+            </prop>
+          </node>
+        </node>
+      </node>
+    </node>
+  </node>
+</o:component-data>

File desktop/test/deployment/active/Dispatch.java

View file
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package com.sun.star.comp.test.deployment.active_java;
+
+import com.sun.star.awt.MessageBoxButtons;
+import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.XMessageBox;
+import com.sun.star.awt.XMessageBoxFactory;
+import com.sun.star.awt.XWindowPeer;
+import com.sun.star.beans.PropertyValue;
+import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.XDesktop;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XStatusListener;
+import com.sun.star.lang.WrappedTargetRuntimeException;
+import com.sun.star.lang.XComponent;
+import com.sun.star.lang.XMultiComponentFactory;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lib.uno.helper.WeakBase;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.URL;
+
+public final class Dispatch extends WeakBase implements XServiceInfo, XDispatch
+{
+    public Dispatch(XComponentContext context) {
+        this.context = context;
+    }
+
+    public String getImplementationName() { return implementationName; }
+
+    public boolean supportsService(String ServiceName) {
+        return false; //TODO
+    }
+
+    public String[] getSupportedServiceNames() {
+        return serviceNames;
+    }
+
+    public void dispatch(URL URL, PropertyValue[] Arguments) {
+        try {
+            XMultiComponentFactory smgr = UnoRuntime.queryInterface(
+                XMultiComponentFactory.class, context.getServiceManager());
+            XMessageBox box = UnoRuntime.queryInterface(
+                XMessageBoxFactory.class,
+                smgr.createInstanceWithContext(
+                    "com.sun.star.awt.Toolkit", context)).
+                createMessageBox(
+                    UnoRuntime.queryInterface(
+                        XWindowPeer.class,
+                        (UnoRuntime.queryInterface(
+                            XDesktop.class,
+                            smgr.createInstanceWithContext(
+                                "com.sun.star.frame.Desktop", context)).
+                         getCurrentFrame().getComponentWindow())),
+                    new Rectangle(), "infobox", MessageBoxButtons.BUTTONS_OK,
+                    "active", "java");
+            box.execute();
+            UnoRuntime.queryInterface(XComponent.class, box).dispose();
+        } catch (com.sun.star.uno.RuntimeException e) {
+            throw e;
+        } catch (com.sun.star.uno.Exception e) {
+            throw new WrappedTargetRuntimeException(
+                "wrapped: " + e.getMessage(), this, e);
+        }
+    }
+
+    public void addStatusListener(XStatusListener Control, URL URL) {}
+
+    public void removeStatusListener(XStatusListener Control, URL URL) {}
+
+    private final XComponentContext context;
+
+    static final String implementationName =
+        "com.sun.star.comp.test.deployment.active_java_singleton";
+
+    static final String[] serviceNames = new String[0];
+}

File desktop/test/deployment/active/MANIFEST.MF

View file
+Sealed: true
+RegistrationClassName: com.sun.star.comp.test.deployment.active_java.Services
+UNO-Type-Path: 

File desktop/test/deployment/active/ProtocolHandler.xcu

View file
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<o:component-data xmlns:o="http://openoffice.org/2001/registry"
+    o:package="org.openoffice.Office" o:name="ProtocolHandler">
+  <node o:name="HandlerSet">
+    <node o:name="com.sun.star.test.deployment.active_native" o:op="replace">
+      <prop o:name="Protocols">
+        <value>vnd.org.openoffice.test.desktop.deployment.active_native:*</value>
+      </prop>
+    </node>
+    <node o:name="com.sun.star.test.deployment.active_java" o:op="replace">
+      <prop o:name="Protocols">
+        <value>vnd.org.openoffice.test.desktop.deployment.active_java:*</value>
+      </prop>
+    </node>
+    <node o:name="com.sun.star.test.deployment.active_python" o:op="replace">
+      <prop o:name="Protocols">
+        <value>vnd.org.openoffice.test.desktop.deployment.active_python:*</value>
+      </prop>
+    </node>
+  </node>
+</o:component-data>

File desktop/test/deployment/active/Provider.java

View file
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package com.sun.star.comp.test.deployment.active_java;
+
+import com.sun.star.frame.DispatchDescriptor;
+import com.sun.star.frame.XDispatch;
+import com.sun.star.frame.XDispatchProvider;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.lib.uno.helper.WeakBase;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+import com.sun.star.util.URL;
+
+public final class Provider extends WeakBase
+    implements XServiceInfo, XDispatchProvider
+{
+    public Provider(XComponentContext context) {
+        this.context = context;
+    }
+
+    public String getImplementationName() { return implementationName; }
+
+    public boolean supportsService(String ServiceName) {
+        return ServiceName.equals(getSupportedServiceNames()[0]); //TODO
+    }
+
+    public String[] getSupportedServiceNames() {
+        return serviceNames;
+    }
+
+    public XDispatch queryDispatch(
+        URL URL, String TargetFrameName, int SearchFlags)
+    {
+        return UnoRuntime.queryInterface(
+            XDispatch.class,
+            context.getValueByName(
+                "/singletons/" +
+                "com.sun.star.test.deployment.active_java_singleton"));
+    }
+
+    public XDispatch[] queryDispatches(DispatchDescriptor[] Requests) {
+        XDispatch[] s = new XDispatch[Requests.length];
+        for (int i = 0; i < s.length; ++i) {
+            s[i] = queryDispatch(
+                Requests[i].FeatureURL, Requests[i].FrameName,
+                Requests[i].SearchFlags);
+        }
+        return s;
+    }
+
+    private final XComponentContext context;
+
+    static final String implementationName =
+        "com.sun.star.comp.test.deployment.active_java";
+
+    static final String[] serviceNames = new String[] {
+        "com.sun.star.test.deployment.active_java" };
+}

File desktop/test/deployment/active/Services.java

View file
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package com.sun.star.comp.test.deployment.active_java;
+
+import com.sun.star.lang.XSingleComponentFactory;
+import com.sun.star.lib.uno.helper.Factory;
+import com.sun.star.registry.InvalidRegistryException;
+import com.sun.star.registry.XRegistryKey;
+
+public final class Services {
+    private Services() {}
+
+    public static XSingleComponentFactory __getComponentFactory(
+        String implementation)
+    {
+        if (implementation.equals(Dispatch.implementationName)) {
+            return Factory.createComponentFactory(
+                Dispatch.class, Dispatch.implementationName,
+                Dispatch.serviceNames);
+        } else if (implementation.equals(Provider.implementationName)) {
+            return Factory.createComponentFactory(
+                Provider.class, Provider.implementationName,
+                Provider.serviceNames);
+        } else {
+            return null;
+        }
+    }
+
+    public static boolean __writeRegistryServiceInfo(XRegistryKey key) {
+        if (!(Factory.writeRegistryServiceInfo(
+                  Dispatch.implementationName, Dispatch.serviceNames, key) &&
+              Factory.writeRegistryServiceInfo(
+                  Provider.implementationName, Provider.serviceNames, key)))
+        {
+            return false;
+        }
+        try {
+            key.
+                createKey(
+                    "/" + Dispatch.implementationName +
+                    "/UNO/SINGLETONS/" +
+                    "com.sun.star.test.deployment.active_java_singleton").
+                setStringValue(Dispatch.implementationName);
+        } catch (InvalidRegistryException e) {
+            return false;
+        }
+        return true;
+    }
+}

File desktop/test/deployment/active/active_native.cxx

View file
+/*************************************************************************
+*
+* 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.
+*
+************************************************************************/
+
+#include "precompiled_desktop.hxx"
+#include "sal/config.h"
+
+#include "boost/noncopyable.hpp"
+#include "com/sun/star/awt/MessageBoxButtons.hpp"
+#include "com/sun/star/awt/Rectangle.hpp"
+#include "com/sun/star/awt/XMessageBox.hpp"
+#include "com/sun/star/awt/XMessageBoxFactory.hpp"
+#include "com/sun/star/awt/XWindowPeer.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/frame/DispatchDescriptor.hpp"
+#include "com/sun/star/frame/XDesktop.hpp"
+#include "com/sun/star/frame/XDispatch.hpp"
+#include "com/sun/star/frame/XDispatchProvider.hpp"
+#include "com/sun/star/frame/XFrame.hpp"
+#include "com/sun/star/frame/XStatusListener.hpp"
+#include "com/sun/star/lang/XComponent.hpp"
+#include "com/sun/star/lang/XMultiComponentFactory.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/registry/XRegistryKey.hpp"
+#include "com/sun/star/uno/DeploymentException.hpp"
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
+#include "com/sun/star/uno/XComponentContext.hpp"
+#include "com/sun/star/uno/XInterface.hpp"
+#include "com/sun/star/util/URL.hpp"
+#include "cppuhelper/factory.hxx"
+#include "cppuhelper/implbase2.hxx"
+#include "cppuhelper/implementationentry.hxx"
+#include "cppuhelper/weak.hxx"
+#include "osl/diagnose.h"
+#include "rtl/textenc.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "uno/lbnames.h"
+
+namespace {
+
+namespace css = com::sun::star;
+
+class Provider:
+    public cppu::WeakImplHelper2<
+        css::lang::XServiceInfo, css::frame::XDispatchProvider >,
+    private boost::noncopyable
+{
+public:
+    static css::uno::Reference< css::uno::XInterface > SAL_CALL static_create(
+        css::uno::Reference< css::uno::XComponentContext > const & xContext)
+        SAL_THROW((css::uno::Exception))
+    { return static_cast< cppu::OWeakObject * >(new Provider(xContext)); }
+
+    static rtl::OUString SAL_CALL static_getImplementationName();
+
+    static css::uno::Sequence< rtl::OUString > SAL_CALL
+    static_getSupportedServiceNames();
+
+private:
+    Provider(
+        css::uno::Reference< css::uno::XComponentContext > const & context):
+        context_(context) { OSL_ASSERT(context.is()); }
+
+    virtual ~Provider() {}
+
+    virtual rtl::OUString SAL_CALL getImplementationName()
+        throw (css::uno::RuntimeException)
+    { return static_getImplementationName(); }
+
+    virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
+        throw (css::uno::RuntimeException)
+    { return ServiceName == getSupportedServiceNames()[0]; } //TODO
+
+    virtual css::uno::Sequence< rtl::OUString > SAL_CALL
+    getSupportedServiceNames() throw (css::uno::RuntimeException)
+    { return static_getSupportedServiceNames(); }
+
+    virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(
+        css::util::URL const &, rtl::OUString const &, sal_Int32)
+        throw (css::uno::RuntimeException);
+
+    virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > >
+    SAL_CALL queryDispatches(
+        css::uno::Sequence< css::frame::DispatchDescriptor > const & Requests)
+        throw (css::uno::RuntimeException);
+
+    css::uno::Reference< css::uno::XComponentContext > context_;
+};
+
+rtl::OUString Provider::static_getImplementationName() {
+    return rtl::OUString(
+        RTL_CONSTASCII_USTRINGPARAM(
+            "com.sun.star.comp.test.deployment.active_native"));
+}
+
+css::uno::Sequence< rtl::OUString > Provider::static_getSupportedServiceNames()
+{