summaryrefslogtreecommitdiff
path: root/testautomation/dbaccess
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-07-03 12:24:35 +0000
committerRelease Engineers <releng@openoffice.org>2009-07-03 12:24:35 +0000
commitba413f83cc3d21e5834ecdfd9a094d56fe76bf8c (patch)
tree98a67b7d1003a2d05afa77e2f05f91040d626e32 /testautomation/dbaccess
parentb37f665758a8eebc1cbeb0155d7d24787ca3401e (diff)
CWS-TOOLING: integrate CWS dbaperf2
2009-06-22 11:04:36 +0200 msc r273202 : #100000# fix to run this test 2009-06-22 09:41:04 +0200 msc r273200 : #100000# correct case 2009-06-22 09:02:42 +0200 msc r273199 : new SRB 2009-06-22 08:53:26 +0200 msc r273198 : #100000 2009-06-15 12:36:32 +0200 oj r272976 : test 2009-06-12 14:23:23 +0200 msc r272918 : #101587# unused feature was removed 2009-06-12 06:45:17 +0200 oj r272903 : use GUI instead of OS 2009-06-11 09:12:30 +0200 oj r272845 : remove unused dep 2009-06-11 09:11:09 +0200 oj r272844 : ColumnAliasInOrderBy not supported 2009-06-11 08:27:00 +0200 oj r272843 : CWS-TOOLING: rebase CWS dbaperf2 to trunk@272827 (milestone: DEV300:m50) 2009-06-10 15:30:17 +0200 msc r272822 : #100000 2009-06-10 15:27:40 +0200 msc r272820 : #102515# new function for the database type list 2009-06-10 15:26:09 +0200 msc r272818 : move file to dbaccess/tools/dbcreatetools.inc 2009-06-10 15:20:10 +0200 msc r272816 : #102515# new function for the database type list 2009-06-10 12:34:46 +0200 oj r272803 : #i101587# check extension 2009-06-10 11:53:45 +0200 oj r272800 : remove unused code 2009-06-09 09:57:25 +0200 oj r272752 : #i101587# EscapeDateTime moved into features section 2009-06-09 09:56:26 +0200 oj r272751 : enable finish 2009-06-08 11:50:37 +0200 oj r272726 : #i102588# move convert tzo saveDataSource 2009-06-05 11:54:20 +0200 jsk r272676 : #i102515# - NEW: Functions to retrieve Database names from API 2009-06-05 10:52:22 +0200 jsk r272671 : NEW: Functions to retrieve Database names from API 2009-06-05 09:36:54 +0200 oj r272666 : handle win and unx differently 2009-06-05 09:36:28 +0200 oj r272665 : handle win and unx differently 2009-06-04 13:41:56 +0200 oj r272625 : #i101268# make use of stringbuffer instead of oustring 2009-06-04 10:18:14 +0200 oj r272612 : add SAL_DLLPUBLIC_EXPORT 2009-05-28 10:56:33 +0200 oj r272381 : #i101587# create langpacks 2009-05-28 10:41:59 +0200 oj r272380 : #i101587# create langpacks 2009-05-28 10:29:30 +0200 oj r272379 : #i101587# create langpacks 2009-05-07 10:11:46 +0200 oj r271635 : fix compile warnings 2009-05-07 07:01:31 +0200 oj r271619 : change type from int32 to PathID 2009-05-07 06:53:19 +0200 oj r271618 : add all 2009-05-06 14:57:02 +0200 oj r271595 : add missing lib 2009-05-06 14:56:54 +0200 oj r271594 : no used anymore 2009-05-06 14:56:08 +0200 oj r271593 : no used anymore 2009-05-06 14:54:25 +0200 oj r271592 : no used anymore 2009-05-06 14:45:59 +0200 oj r271591 : add missing lib 2009-05-06 14:41:54 +0200 oj r271590 : change wnt 2009-05-06 14:22:21 +0200 oj r271589 : #i101587# use config for the drivers 2009-05-06 14:21:39 +0200 oj r271588 : #i101587# add new set for metadata and config data for driver 2009-05-06 14:19:36 +0200 oj r271587 : #i101587# handle metadata and props of driver 2009-05-06 10:11:11 +0200 oj r271570 : #i101587# correct wrong use of reference 2009-05-06 09:24:33 +0200 oj r271567 : #i101587# add new set for metadata 2009-05-06 08:52:06 +0200 oj r271563 : #i101587# add driver configuration 2009-05-06 08:51:04 +0200 oj r271562 : #i101587# add driver configuration 2009-05-04 10:24:41 +0200 oj r271442 : CWS-TOOLING: rebase CWS dbaperf2 to trunk@271427 (milestone: DEV300:m47) 2009-04-28 07:06:22 +0200 oj r271303 : compile error 2009-04-27 14:12:48 +0200 oj r271270 : #i101268# make use of stringbuffer instead of oustring 2009-04-27 14:12:27 +0200 oj r271269 : #i101268# make use of stringbuffer instead of oustring 2009-04-27 09:30:10 +0200 oj r271255 : use string buffer when possible 2009-04-24 11:56:01 +0200 oj r271207 : #i101268# remove end() call from loop 2009-04-23 14:24:03 +0200 oj r271171 : add dep 2009-04-23 13:25:25 +0200 oj r271164 : #i101268# add config entries for database drivers 2009-04-23 13:07:13 +0200 oj r271161 : #i101268# add config entries for database drivers 2009-04-23 13:06:33 +0200 oj r271160 : #i101268# add parent url pattern entry for driver node 2009-04-23 13:05:39 +0200 oj r271159 : #i101268# add config entry for driver node 2009-04-23 13:04:09 +0200 oj r271157 : #i101268# add config entry for driver node 2009-04-23 06:41:32 +0200 oj r271142 : #i101268# add new configuration file Drivers 2009-04-22 13:49:19 +0200 oj r271103 : convert EOL 2009-04-22 13:29:17 +0200 oj r271101 : #i101268# use of driver configuration entries for features and properties 2009-04-22 13:28:08 +0200 oj r271100 : #i101268# use of driver configuration entries for features and properties 2009-04-22 13:15:26 +0200 oj r271098 : #i101268# add new configuration file Drivers 2009-04-22 13:14:43 +0200 oj r271097 : #i101268# use of driver configuration entries for features and properties
Diffstat (limited to 'testautomation/dbaccess')
-rwxr-xr-xtestautomation/dbaccess/optional/includes/db_IndexDesign.inc2
-rwxr-xr-xtestautomation/dbaccess/optional/includes/db_Text.inc6
-rwxr-xr-xtestautomation/dbaccess/required/includes/DatabaseTypes.inc30
-rwxr-xr-xtestautomation/dbaccess/required/input/sun-report-builder.oxtbin2836156 -> 2184747 bytes
-rwxr-xr-xtestautomation/dbaccess/tools/dbcreatetools.inc229
5 files changed, 155 insertions, 112 deletions
diff --git a/testautomation/dbaccess/optional/includes/db_IndexDesign.inc b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
index 04a1f2284d9a..e116af853d51 100755
--- a/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
+++ b/testautomation/dbaccess/optional/includes/db_IndexDesign.inc
@@ -76,7 +76,7 @@ function tIndex(sFileName as String, sTableName as String)
if ( not DatabaseIndexes.exists(3) ) then
warnlog "The index design doesn't exists"
endif
- IndexList.select 2
+ IndexList.select 1
DropIndex.Click
Kontext "MessageBox"
MessageBox.Yes
diff --git a/testautomation/dbaccess/optional/includes/db_Text.inc b/testautomation/dbaccess/optional/includes/db_Text.inc
index b345b872df85..e242bdaaf56a 100755
--- a/testautomation/dbaccess/optional/includes/db_Text.inc
+++ b/testautomation/dbaccess/optional/includes/db_Text.inc
@@ -85,8 +85,8 @@ endcase
'-------------------------------------------------------------------------
testcase tOpenUTF8File(sFilename as string)
- '/// copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_Database.txt" to your local wotk directory
- printlog "copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_Database.txt to your local wotk directory"
+ '/// copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_database.txt" to your local wotk directory
+ printlog "copy the file TesttoolPath + dbaccess/optional/input/text_datasource/text_database.txt to your local wotk directory"
app.FileCopy gTesttoolPath + ConvertPath("dbaccess/optional/input/text_datasource/text_database.txt"),gOfficePath + ConvertPath("user/work/text_database.txt")
'/// open the text database create in the bas file
@@ -131,7 +131,7 @@ testcase tOpenUTF8File(sFilename as string)
'/// open the table text_database
printlog "open the table text_Database"
- call fOpenTable("text_Database")
+ call fOpenTable("text_database")
'/// check if the first row contains the string öäü
printlog "check if the first row contains the string öäü"
diff --git a/testautomation/dbaccess/required/includes/DatabaseTypes.inc b/testautomation/dbaccess/required/includes/DatabaseTypes.inc
index 7a24feb50024..2c2178f1c6ee 100755
--- a/testautomation/dbaccess/required/includes/DatabaseTypes.inc
+++ b/testautomation/dbaccess/required/includes/DatabaseTypes.inc
@@ -87,7 +87,7 @@ testcase tMySQLODBCProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("MySQLODBC"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:odbc:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -125,7 +125,7 @@ testcase tMySQLJDBCProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("MySQLJDBC"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:mysql:jdbc:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -175,7 +175,7 @@ testcase tAdabasProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("AdabasD"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:adabas:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -213,7 +213,7 @@ testcase tOracleJDBCProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("OracleJDBC")
+ DataBaseType.select(hGetDatabaseDisplayName("jdbc:oracle:thin:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -249,7 +249,7 @@ testcase tJDBCProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("JDBC")
+ DataBaseType.select(hGetDatabaseDisplayName("jdbc:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -282,7 +282,7 @@ testcase tLDAPProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("LDAP") + 1 ) ' +1 because for mysql there are 2 entries
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:ldap:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -325,7 +325,7 @@ testcase tEvolutionProperties
call DialogTest(TabGeneral)
try
if ( DatabaseType.getItemCount() > 12 ) then
- DataBaseType.select(getIdForDatabaseType("Evolution"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:evolution:ldap"))
Kontext "ConnectionType"
ConnectionType.OK
else
@@ -365,7 +365,7 @@ testcase tMozillaProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("Mozilla"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:address:mozilla:"))
'add sleep to give OOo time to react
sleep(2)
@@ -396,7 +396,7 @@ testcase tSpreadsheetProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("CALC"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:calc:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -426,7 +426,7 @@ testcase tTextProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("Text"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:flat:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -464,7 +464,7 @@ testcase tdBaseProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("dBase"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:dbase:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -502,7 +502,7 @@ testcase tODBCProperties
Kontext "TabGeneral"
call DialogTest(TabGeneral)
- DataBaseType.select(getIdForDatabaseType("ODBC"))
+ DataBaseType.select(hGetDatabaseDisplayName("sdbc:odbc:*"))
Kontext "ConnectionType"
NextBtn.Click
@@ -576,12 +576,12 @@ function fCheckAdvancedDialog(sType as string)
elseif sType = "MySQLODBC" OR sType = "MySQLJDBC" then
'call fcheckControl(SQL92Check)
- call fcheckControl(AppendAlias)
+ 'call fcheckControl(AppendAlias)
call fcheckControl(Ignoreprivileges)
- call fcheckControl(ParameterSubstiti)
+ 'call fcheckControl(ParameterSubstiti)
call fcheckControl(DisplayVersionColumns)
call fcheckControl(BooleanComparison)
- call fcheckControl(EnableOuterJoin)
+ 'call fcheckControl(EnableOuterJoin)
call fcheckControl(CheckRequiredFields)
diff --git a/testautomation/dbaccess/required/input/sun-report-builder.oxt b/testautomation/dbaccess/required/input/sun-report-builder.oxt
index 53be26307a45..658fedac671b 100755
--- a/testautomation/dbaccess/required/input/sun-report-builder.oxt
+++ b/testautomation/dbaccess/required/input/sun-report-builder.oxt
Binary files differ
diff --git a/testautomation/dbaccess/tools/dbcreatetools.inc b/testautomation/dbaccess/tools/dbcreatetools.inc
index d0c8dba29d9e..a13831065242 100755
--- a/testautomation/dbaccess/tools/dbcreatetools.inc
+++ b/testautomation/dbaccess/tools/dbcreatetools.inc
@@ -91,7 +91,7 @@ function fCreateMySQL_ODBC_Datasource(sFileName, sOdbcDSN, sUser,optional sRegis
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("MySQLODBC")
+ DatabaseType.select( hGetDatabaseDisplayName( "sdbc:mysql:odbc:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -182,7 +182,7 @@ function fCreateMySQL_JDBC_Datasource(sFileName,sDatabaseName,sHost,sPort,sUser,
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("MySQLJDBC") - 1
+ DatabaseType.select( hGetDatabaseDisplayName( "sdbc:mysql:jdbc:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -271,7 +271,7 @@ function fCreateAdabasDatasource(sFileName,sURL,sUser, optional sRegister) as b
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("AdabasD") - 1
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:adabas:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -369,7 +369,7 @@ function fCreateLocalAdabasDatasource(sFileName,sDatabaseName,sSuperUser,sSuper
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("AdabasD")
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:adabas:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -647,7 +647,7 @@ function fCreateDbaseDatasource(sFileName,sURL, optional sRegister) as boolean
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("dBase", DatabaseType) - 1
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:dbase:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -715,7 +715,7 @@ function fCreateADODatasource(sFileName,sURL,optional sRegister) as boolean
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("ADO", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:ado:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -784,7 +784,7 @@ function fCreateTextDatasource(sFileName,sURL, optional sRegister) as boolean
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("Text", DatabaseType) - 1
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:flat:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -859,7 +859,7 @@ function fCreateSpreadsheetDatasource(sFileName,sURL, optional sRegister) as boo
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.Select (getIdForDatabaseType("CALC", DatabaseType) - 1) ' -1 because in the wizard there is on datasource less because of mysql
+ DatabaseType.Select (hGetDatabaseDisplayName( "sdbc:calc:*" ))
sleep(1)
NextBtn.Click
sleep(1)
@@ -936,7 +936,7 @@ function fCreateLDAPAddressbookDatasource(sFileName,sHostName,sBaseDN,sPortNr,op
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("LDAP", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:ldap:*" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1011,7 +1011,7 @@ function fCreateEvolutionAddressbookDatasource(sFileName, optional sRegister) as
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("Evolution", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:evolution:ldap" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1083,7 +1083,7 @@ function fCreateKDEAddressbookDatasource(sFileName , optional sRegister) as bool
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("KDE", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:kab" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1155,7 +1155,7 @@ function fCreateWindowsAddressbookDatasource(sFileName , optional sRegister) as
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("Windows", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:outlookexp" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1227,7 +1227,7 @@ function fCreateOutlookAddressbookDatasource(sFileName, optional sRegister) as b
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("Outlook", DatabaseType)
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:outlook" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1299,7 +1299,7 @@ function fCreateMozillaAddressbookDatasource(sFileName, optional sRegister) as b
Kontext "DatabaseWizard"
ConnectToDatabase.Check
sleep(1)
- DatabaseType.select getIdForDatabaseType("Mozilla", DatabaseType) - 1
+ DatabaseType.select ( hGetDatabaseDisplayName( "sdbc:address:mozilla:" ) )
sleep(1)
NextBtn.Click
sleep(1)
@@ -1460,92 +1460,135 @@ function fSetJDBCDriverFiles(sClassPath) as boolean
end function
'-------------------------------------------------------------------------
-function getIdForDatabaseType(sType as String ) as Integer
- '/// get the index of the database type in the database type list box
- '///+ in the connection type dialog
- '/// <u>parameter:</u>
- '/// <b>sType:</b> The name of the database type in english
+private const VERBOSE = false
- dim ii as integer
+function hGetInstalledDatabaseDrivers( dbDriverList() as string ) as integer
- if (sType = "AdabasD") then
- ii = 4
- elseif (sType = "dBase") then
- if gPlatform = "osx" then
- ii = 5
- else
- ii = 6
- endif
- elseif (sType = "Access") then
- ii = 0
- elseif (sType = "Evolution") then
- ii = 13
- elseif (sType = "JDBC") then
- if gPlatform = "osx" then
- ii = 7
- else
- ii = 8
- endif
- elseif (sType = "LDAP") then
- if gPlatGroup = "w95" then
- ii = 12
- else
- ii = 11
- endif
- elseif (sType = "Mozilla") then
- if gPlatGroup = "w95" then
- ii = 11
- elseif gPlatform = "osx" then
- ii = 9
- else
- ii = 10
- endif
- elseif (sType = "MySQLJDBC") then
- ii = 2
- elseif (sType = "MySQLODBC") then
- ii = 1
- elseif (sType = "ODBC") then
- if gPlatform = "osx" then
- ii = 8
- else
- ii = 9
- endif
- elseif (sType = "OracleJDBC") then
- ii = 3
- elseif (sType = "CALC") then
- if gPlatform = "osx" then
- ii = 4
- else
- ii = 5
- endif
- elseif (sType = "Text") then
- if gPlatform = "osx" then
- ii = 6
- else
- ii = 7
- endif
- elseif (sType = "ADO") then
- ii = 9 ' only 9 because on windows +1 is added at the end
- elseif (sType = "Windows") then ' windows addressbook
- ii = 14 ' only 14 because on windows +1 is added at the end
- elseif (sType = "KDE") then
- ii = 12
+ ' This function returns the number of currently installed database drivers.
+ ' Additionally it fills a given list (which should be large enough to hold
+ ' the names of all installed drivers) with the names and makes the list
+ ' compatible to the listfunctions (which places the list size in element 0)
+ ' The list is platform dependent and might be locale dependent
+ ' Note that some drivers (like e.g. HSQL Database Engine) do *not* show up
+ ' in the Database Wizards listbox!
+
+ dim oUnoOfficeConnection as object
+ dim oUnoConfigurationAccess as object
+ dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue
+ dim xViewRoot as object
+ dim aElements() as string
+ dim iCurrentDriver as integer
+ dim iDriverCount as integer
+
+ const CFN = "global::tools::includes::optional::t_database.inc::hGetInstalledDatabaseDrivers(): "
+
+ ' Path to the node, searches all files below "Drivers" for "Installed"
+ aPropertyValue( 0 ).Name = "nodepath"
+ aPropertyValue( 0 ).Value = "org.openoffice.Office.DataAccess.Drivers/Installed"
+
+ ' Connect to remote UNO
+ oUnoOfficeConnection = hGetUnoService( TRUE )
+
+ if ( isNull( oUnoOfficeConnection )) then
+ warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" )
+ hGetInstalledDatabaseDrivers() = 0
else
- ii = 0
+ ' Get a configuration provider
+ oUnoConfigurationAccess = oUnoOfficeConnection.createInstance( "com.sun.star.configuration.ConfigurationProvider" )
+
+ ' Get access
+ xViewRoot = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() )
+ aElements() = xViewRoot.getElementNames()
+
+ iDriverCount = ubound( aElements() )
+ dbDriverList( 0 ) = iDriverCount
+ for iCurrentDriver = 1 to iDriverCount
+ dbDriverList( iCurrentDriver ) = xViewRoot.getByName( aElements( iCurrentDriver ) ).getByName( "DriverTypeDisplayName" )
+ next iCurrentDriver
+
endif
+
+ if ( VERBOSE ) then
+ printlog( CFN & "Returning " & iDriverCount & " drivers" )
+ endif
+ hGetInstalledDatabaseDrivers() = iDriverCount
+
+end function
- ' when windows then +1 because the first entry 'MS Access' is only available under windows
- if gPlatGroup = "w95" then
- ii = ii + 1
- ' when x86 then -1 because the Adabas entry on the 4. position is missing
- elseif gPlatForm = "x86" then
- if ii > 3 then
- ii = ii - 1
- endif
+'*******************************************************************************
+
+function hGetDatabaseDisplayName( dbDriverURL as string ) as string
+
+ ' The xcu files (based on dev300m47) hold following driver definitions
+ ' which are used as parameter to this function. You get a plain text
+ ' localized driver name as returnvalue which can be used directly to select
+ ' a driver in the Database Wizard.
+
+ ' adabas.xcu: "sdbc:adabas:*"
+ ' calc.xcu: "sdbc:calc:*"
+ ' dbase.xcu: "sdbc:dbase:*"
+ ' evoab.xcu: "sdbc:address:evolution:ldap"
+ ' evoab.xcu: "sdbc:address:evolution:groupwise"
+ ' flat.xcu: "sdbc:flat:*"
+ ' ado.xcu: "sdbc:ado:*"
+ ' hsqldb.xcu: "sdbc:embedded:hsqldb"
+ ' kab.xcu: "sdbc:address:kab"
+ ' mozab.xcu: "sdbc:address:outlook"
+ ' mozab.xcu: "sdbc:address:outlookexp"
+ ' mozab.xcu: "sdbc:address:mozilla:"
+ ' mozab.xcu: "sdbc:address:thunderbird:"
+ ' mozab.xcu: "sdbc:address:ldap:*"
+ ' mysql.xcu: "sdbc:mysql:jdbc:*"
+ ' mysql.xcu: "sdbc:mysql:odbc:*"
+ ' odbc.xcu: "sdbc:odbc:*"
+ ' jdbc.xcu: "jdbc:*"
+ ' jdbc.xcu: "jdbc:oracle:thin:*"
+ ' mysql.xcu: "sdbc:mysql:jdbc:*"
+
+
+ ' Note that some drivers (like e.g. HSQL Database Engine) do *not* show up
+ ' in the Database Wizards listbox!
+
+
+ dim oUnoOfficeConnection as object
+ dim oUnoConfigurationAccess as object
+ dim aPropertyValue(1) as new com.sun.star.beans.PropertyValue
+ dim oConfig as object
+ dim oDriver as object
+ dim sDatabaseName as string
+
+ const CFN = "global::tools::includes::optional::t_database.inc::hGetDatabaseDisplayName(): "
+
+ ' Path to the node, searches all files below "Drivers" for "Installed"
+ aPropertyValue( 0 ).Name = "nodepath"
+ aPropertyValue( 0 ).Value = "org.openoffice.Office.DataAccess.Drivers/Installed/"
+
+ ' Connect to remote UNO
+ oUnoOfficeConnection = hGetUnoService( TRUE )
+
+ if ( isNull( oUnoOfficeConnection )) then
+ warnlog( CFN & "Failed to establish UNO connection, hGetUnoService failed" )
+ sDatabaseName = ""
+ else
+ ' Get a configuration provider
+ oUnoConfigurationAccess = oUnoOfficeConnection.createInstance( "com.sun.star.configuration.ConfigurationProvider" )
+
+ ' Get access
+ oConfig = oUnoConfigurationAccess.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aPropertyValue() )
+ try
+ oDriver = oConfig.getByName( dbDriverURL )
+ sDatabaseName = oDriver.getByName( "DriverTypeDisplayName" )
+ catch
+ warnlog( CFN & "Invalid driver or driver unsupported on this platform" )
+ sDatabaseName ""
+ endcatch
+
endif
- getIdForDatabaseType = ii
+ if ( VERBOSE ) then
+ printlog( CFN & "Database display string: " & sDatabaseName )
+ endif
+ hGetDataBaseDisplayName() = sDatabaseName
end function
-