Tag: cws_src680_dba24b
User: fs      
Date: 2007-08-29 11:59:55+0000
Modified:
   dba/dbaccess/source/ui/misc/dbumiscres.src
   dba/dbaccess/source/ui/misc/dsntypes.cxx
   dba/dbaccess/source/ui/misc/dbumiscres.hrc
   dba/dbaccess/source/ui/misc/dsmeta.cxx

Log:
 during #i80930#: DST_EMBEDDED -> DST_EMBEDDED_HSQLDB. The approach to read the 
concrete type of the embedded DB from the configuration does not work, there 
are enough places where we silently assume 'embedded == embedded HSQLDB'

File Changes:

Directory: /dba/dbaccess/source/ui/misc/
========================================

File [changed]: dbumiscres.src
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dbumiscres.src?r1=1.75&r2=1.75.26.1
Delta lines:  +12 -12
---------------------
--- dbumiscres.src      2007-07-06 08:36:39+0000        1.75
+++ dbumiscres.src      2007-08-29 11:59:51+0000        1.75.26.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbumiscres.src,v $
  *
- *  $Revision: 1.75 $
+ *  $Revision: 1.75.26.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/06 08:36:39 $
+ *  last change: $Author: fs $ $Date: 2007/08/29 11:59:51 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -91,10 +91,6 @@
        {
                Text  ="sdbc:address:mozilla:";
        };
-       String STR_THUNDERBIRD
-       {
-               Text  ="sdbc:address:thunderbird:";
-       };
        String STR_LDAP
        {
                Text  ="sdbc:address:ldap:";
@@ -123,11 +119,14 @@
        {
                Text  ="sdbc:address:kab";
        };
-       String STR_EMBEDDED
+       String STR_EMBEDDED_HSQLDB
        {
-               Text = "sdbc:embedded:";
+               Text = "sdbc:embedded:hsqldb";
+       };
+       String STR_THUNDERBIRD
+       {
+               Text  ="sdbc:address:thunderbird:";
        };
-       
 };
 Resource RSC_DATASOURCE_TYPE_UINAMES
 {
@@ -208,9 +207,9 @@
        {
                Text[ en-US ] = "KDE Address Book";
        };
-       String STR_EMBEDDED
+       String STR_EMBEDDED_HSQLDB
        {
-               Text[ en-US ] = "Embedded database";
+               Text[ en-US ] = "HSQL database engine";
        };
        String STR_THUNDERBIRD
        {
@@ -281,3 +280,4 @@
 {
        Text [ en-US ] = "The name '$#$' already exists.\nPlease enter another 
name." ;
 };
+

File [changed]: dsntypes.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dsntypes.cxx?r1=1.35.28.1&r2=1.35.28.2
Delta lines:  +27 -115
----------------------
--- dsntypes.cxx        2007-08-28 13:28:37+0000        1.35.28.1
+++ dsntypes.cxx        2007-08-29 11:59:52+0000        1.35.28.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dsntypes.cxx,v $
  *
- *  $Revision: 1.35.28.1 $
+ *  $Revision: 1.35.28.2 $
  *
- *  last change: $Author: fs $ $Date: 2007/08/28 13:28:37 $
+ *  last change: $Author: fs $ $Date: 2007/08/29 11:59:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -64,9 +64,6 @@
 #include <osl/file.hxx>
 #endif
 // ---
-#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_ 
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
-#endif
 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
 #include "dbustrings.hrc"
 #endif
@@ -254,50 +251,6 @@
        return _rDsn.Copy(sPrefix.Len());
 }
 // 
-----------------------------------------------------------------------------
-namespace
-{
-       ::rtl::OUString lcl_getEmbeddedDatabases()
-       {
-               static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/EmbeddedDatabases"));
-               return s_sNodeName;
-       }
-       // 
-----------------------------------------------------------------------------
-       ::rtl::OUString lcl_getDefaultEmbeddedDatabase()
-       {
-               static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("DefaultEmbeddedDatabase"));
-               return s_sNodeName;
-       }
-       // 
-----------------------------------------------------------------------------
-       ::rtl::OUString lcl_getEmbeddedDatabaseNames()
-       {
-               static ::rtl::OUString 
s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("EmbeddedDatabaseNames"));
-               return s_sNodeName;
-       }
-       // 
-----------------------------------------------------------------------------
-       ::utl::OConfigurationNode lcl_getEmbeddedDatabase(const Reference< 
XMultiServiceFactory >& _rxORB)
-       {
-               ::utl::OConfigurationTreeRoot aEmbeddedDatabases = 
::utl::OConfigurationTreeRoot::createWithServiceFactory(
-                       _rxORB, ::dbaui::lcl_getEmbeddedDatabases(), -1, 
::utl::OConfigurationTreeRoot::CM_READONLY);
-
-               if ( aEmbeddedDatabases.isValid() )
-               {
-                       ::rtl::OUString sDefaultEmbededDatabaseName;
-                       
aEmbeddedDatabases.getNodeValue(::dbaui::lcl_getDefaultEmbeddedDatabase()) >>= 
sDefaultEmbededDatabaseName;
-
-                       ::utl::OConfigurationNode aEmbddedDatabaseNames = 
aEmbeddedDatabases.openNode(::dbaui::lcl_getEmbeddedDatabaseNames());
-                       if ( aEmbddedDatabaseNames.isValid() )
-                       {
-                               ::utl::OConfigurationNode aEmbeddedDatabase = 
aEmbddedDatabaseNames.openNode(sDefaultEmbededDatabaseName);
-                               if ( aEmbeddedDatabase.isValid() )
-                               {
-                                       return aEmbeddedDatabase;
-                               }
-                       }
-               }
-               return ::utl::OConfigurationNode();
-       }
-}
-// 
-----------------------------------------------------------------------------
 void ODsnTypeCollection::extractHostNamePort(const String& _rDsn,String& 
_sDatabaseName,String& _rsHostname,sal_Int32& _nPortNumber) const
 {
        DATASOURCE_TYPE eType = getType(_rDsn);
@@ -498,8 +451,8 @@
        if (_rDsn.EqualsIgnoreCaseAscii("sdbc:calc:", 0, nSeparator))
                return DST_CALC;
 
-       if (_rDsn.EqualsIgnoreCaseAscii("sdbc:embedded:", 0, nSeparator))
-               return DST_EMBEDDED;
+       if (_rDsn.EqualsIgnoreCaseAscii("sdbc:embedded:hsqldb", 0, _rDsn.Len()))
+               return DST_EMBEDDED_HSQLDB;
 
        if (_rDsn.EqualsIgnoreCaseAscii("sdbc:address:", 0, nSeparator))
        {
@@ -568,74 +521,33 @@
        return -1;
 }
 // 
-----------------------------------------------------------------------------
-DATASOURCE_TYPE ODsnTypeCollection::getEmbeddedDatabaseType(const Reference< 
XMultiServiceFactory >& _rxORB) const
+Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( 
DATASOURCE_TYPE _eType ) const
 {
-       DATASOURCE_TYPE eRet = DST_DBASE;
-       ::utl::OConfigurationNode aEmbeddedDatabase = 
lcl_getEmbeddedDatabase(_rxORB);
-       if ( aEmbeddedDatabase.isValid() )
-    {
-        ::rtl::OUString sURLPrefix = getEmbeddedDatabaseURL(_rxORB);
-        Reference< XDriverAccess > 
xDriverManager(_rxORB->createInstance(SERVICE_SDBC_DRIVERMANAGER), UNO_QUERY);
-        if ( xDriverManager.is() && 
xDriverManager->getDriverByURL(sURLPrefix).is() )
-        {
-                   eRet = DST_EMBEDDED;
-        }
-    }
-       return eRet;
-}
-// 
-----------------------------------------------------------------------------
-::rtl::OUString ODsnTypeCollection::getEmbeddedDatabaseURL(const Reference< 
XMultiServiceFactory >& _rxORB) const
-{
-       ::rtl::OUString sRet;
-       ::utl::OConfigurationNode aEmbeddedDatabase = 
lcl_getEmbeddedDatabase(_rxORB);
-       if ( aEmbeddedDatabase.isValid() )
-       {
-               static ::rtl::OUString 
s_sURL(RTL_CONSTASCII_USTRINGPARAM("URL"));
-               aEmbeddedDatabase.getNodeValue(s_sURL) >>= sRet;
-       }
-       return sRet;
-}
-// 
-----------------------------------------------------------------------------
-::rtl::OUString ODsnTypeCollection::getEmbeddedDatabaseUIName(const Reference< 
XMultiServiceFactory >& _rxORB) const
-{
-       ::rtl::OUString sRet;
-       ::utl::OConfigurationNode aEmbeddedDatabase = 
lcl_getEmbeddedDatabase(_rxORB);
-       if ( aEmbeddedDatabase.isValid() )
-       {
-               // read the needed information
-               static ::rtl::OUString 
s_sUIName(RTL_CONSTASCII_USTRINGPARAM("UIName"));
-               aEmbeddedDatabase.getNodeValue(s_sUIName) >>= sRet;
-       }
-       return sRet;
-}
-// 
-----------------------------------------------------------------------------
-Sequence<PropertyValue> 
ODsnTypeCollection::getEmbeddedDatabaseProperties(const Reference< 
XMultiServiceFactory >& _rxORB) const
-{
-       Sequence<PropertyValue> aRet;
-       ::utl::OConfigurationNode aEmbeddedDatabase = 
lcl_getEmbeddedDatabase(_rxORB);
-       if ( aEmbeddedDatabase.isValid() )
-       {
-               static ::rtl::OUString 
s_sEmbeddedDatabaseSettings(RTL_CONSTASCII_USTRINGPARAM("EmbeddedDatabaseSettings"));
-               ::utl::OConfigurationNode aSettings = 
aEmbeddedDatabase.openNode(s_sEmbeddedDatabaseSettings);
-               if ( aSettings.isValid() )
-               {
-                       Sequence< ::rtl::OUString > aNodeNames = 
aSettings.getNodeNames();
-                       aRet.realloc(aNodeNames.getLength());
-                       PropertyValue* pInfos = aRet.getArray();
+       Sequence< PropertyValue > aSettings;
 
-                       for (   const ::rtl::OUString* pNodeNames = 
aNodeNames.getConstArray() + aNodeNames.getLength() - 1;
-                                       pNodeNames >= 
aNodeNames.getConstArray();
-                                       --pNodeNames, ++pInfos
-                               )
+    switch ( _eType )
                        {
-                               ::utl::OConfigurationNode aItemSubNode = 
aSettings.openNode(*pNodeNames);
-                               pInfos->Name = *pNodeNames;
-                               pInfos->Value = 
aItemSubNode.getNodeValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")));
-                       }
-               }
+    case DST_EMBEDDED_HSQLDB:
+        aSettings.realloc( 3 );
+
+        aSettings[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"AutoIncrementCreation" ) );
+        aSettings[0].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"IDENTITY" ) );
+
+        aSettings[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"AutoRetrievingStatement" ) );
+        aSettings[1].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"CALL IDENTITY()" ) );
+
+        aSettings[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
"IsAutoRetrievingEnabled" ) );
+        aSettings[2].Value <<= (sal_Bool)sal_True;
+        break;
+
+    default:
+        DBG_ERROR( "ODsnTypeCollection::getDefaultDBSettings: type is 
unsupported by this method!" );
+        break;
        }
-       return aRet;
+
+    return aSettings;
 }
+
 // 
-----------------------------------------------------------------------------
 String ODsnTypeCollection::getTypeExtension(DATASOURCE_TYPE _eType) const
 {

File [changed]: dbumiscres.hrc
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dbumiscres.hrc?r1=1.9&r2=1.9.226.1
Delta lines:  +4 -4
-------------------
--- dbumiscres.hrc      2006-02-28 10:36:49+0000        1.9
+++ dbumiscres.hrc      2007-08-29 11:59:52+0000        1.9.226.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbumiscres.hrc,v $
  *
- *  $Revision: 1.9 $
+ *  $Revision: 1.9.226.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/02/28 10:36:49 $
+ *  last change: $Author: fs $ $Date: 2007/08/29 11:59:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -58,7 +58,7 @@
 #define STR_EVOLUTION_GROUPWISE        17 
 #define STR_EVOLUTION_LDAP             18
 #define STR_KAB                                        19
-#define STR_EMBEDDED                   20
+#define STR_EMBEDDED_HSQLDB     20
 #define STR_THUNDERBIRD                        21
 
 #define STR_END                                        STR_THUNDERBIRD + 1

File [changed]: dsmeta.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/dsmeta.cxx?r1=1.1.2.4&r2=1.1.2.5
Delta lines:  +4 -4
-------------------
--- dsmeta.cxx  2007-08-28 13:28:24+0000        1.1.2.4
+++ dsmeta.cxx  2007-08-29 11:59:52+0000        1.1.2.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dsmeta.cxx,v $
  *
- *  $Revision: 1.1.2.4 $
+ *  $Revision: 1.1.2.5 $
  *
- *  last change: $Author: fs $ $Date: 2007/08/28 13:28:24 $
+ *  last change: $Author: fs $ $Date: 2007/08/29 11:59:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -140,7 +140,7 @@
             s_aSupport[ DST_EVOLUTION_GROUPWISE ] = InitAdvanced( 
InitAdvanced::None );
             s_aSupport[ DST_EVOLUTION_LDAP      ] = InitAdvanced( 
InitAdvanced::None );
             s_aSupport[ DST_KAB                 ] = InitAdvanced( 
InitAdvanced::None );
-            s_aSupport[ DST_EMBEDDED            ] = InitAdvanced( 0, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 1, 1, 0 );
+            s_aSupport[ DST_EMBEDDED_HSQLDB            ] = InitAdvanced( 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 );
             s_aSupport[ DST_USERDEFINE1         ] = InitAdvanced( 
InitAdvanced::All );
             s_aSupport[ DST_USERDEFINE2         ] = InitAdvanced( 
InitAdvanced::All );
             s_aSupport[ DST_USERDEFINE3         ] = InitAdvanced( 
InitAdvanced::All );
@@ -183,7 +183,7 @@
             s_aSupport[ DST_EVOLUTION_GROUPWISE ] = FeatureSupport( AuthNone   
 );
             s_aSupport[ DST_EVOLUTION_LDAP      ] = FeatureSupport( AuthNone   
 );
             s_aSupport[ DST_KAB                 ] = FeatureSupport( AuthNone   
 );
-            s_aSupport[ DST_EMBEDDED            ] = FeatureSupport( AuthNone   
 );
+            s_aSupport[ DST_EMBEDDED_HSQLDB            ] = FeatureSupport( 
AuthNone    );
             s_aSupport[ DST_USERDEFINE1         ] = FeatureSupport( 
AuthUserPwd );
             s_aSupport[ DST_USERDEFINE2         ] = FeatureSupport( 
AuthUserPwd );
             s_aSupport[ DST_USERDEFINE3         ] = FeatureSupport( 
AuthUserPwd );




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to