1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: wiz_DatabaseWizard.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:42 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : Database Wizard
38 '\***********************************************************************
39 sub wiz_DatabaseWizard
42 call tOpenNoneDatabaseDocument
55 '-------------------------------------------------------------------------
58 Kontext "DocumentWriter"
59 if (DocumentWriter.exists(1)) then
60 DocumentWriter.UseMenu
62 Kontext "DocumentBackground"
63 DocumentBackground.UseMenu
71 Kontext "DatabaseWizard"
72 CreateNewDatabase.Check
79 Kontext "SpeichernDlg"
80 if ( Dateiname.getSelText() = "" ) then
81 warnlog "#i58413# Default filename is missing"
82 Dim sFileName as String
83 sFileName = ConvertPath(gOfficePath + "user/work/TTDB1.odb")
84 if ( app.Dir( ConvertPath(sFileName) ) ) <> "" then
85 app.kill(ConvertPath(sFileName))
87 Dateiname.setText(sFileName)
93 if MessageBox.exists then
99 Kontext "ContainerView"
105 call fCloseDatabase(true)
108 '-------------------------------------------------------------------------
109 testcase tOpenDatabase
111 Kontext "DocumentWriter"
112 if (DocumentWriter.exists(1)) then
113 DocumentWriter.UseMenu
115 Kontext "DocumentBackground"
116 DocumentBackground.UseMenu
124 Kontext "DatabaseWizard"
125 OpenExistingDoc.Check
130 Kontext "GeneralFileDialog"
131 printlog "open database from: " + Convertpath(gofficePath + "user/database/biblio.odb")
132 Dateiname.setText(Convertpath(gofficePath + "user/database/biblio.odb"))
136 Kontext "ContainerView"
142 call fCloseDatabase(false)
145 '-------------------------------------------------------------------------
146 testcase tOpenNoneDatabaseDocument
148 Kontext "DocumentWriter"
149 if (DocumentWriter.exists(1)) then
150 DocumentWriter.UseMenu
152 Kontext "DocumentBackground"
153 DocumentBackground.UseMenu
161 Kontext "DatabaseWizard"
162 OpenExistingDoc.Check
167 Kontext "GeneralFileDialog"
168 printlog "open spreadsheet file from: " + Convertpath(gTesttoolPath + "dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods")
169 Dateiname.setText(Convertpath(gTesttoolPath + "dbaccess/optional/input/spreadsheet_datasource/TT_Query1.ods"))
173 Kontext "DocumentCalc"
174 if (DocumentCalc.exists()) then
175 warnlog "the spreadsheet should not appear"
176 call hCloseDocument()
179 if(MessageBox.exists(1)) then
180 printlog "messagebox appear ->> OK"
182 Kontext "DatabaseWizard"
183 DatabaseWizard.Cancel
185 warnlog "there should be a message box about the fact that this is no database"
186 Kontext "DatabaseWizard"
187 DatabaseWizard.Cancel
192 '-------------------------------------------------------------------------
194 qaerrorlog "not yet implemented"
196 '-------------------------------------------------------------------------
199 if gPlatgroup <> "lin" then
200 printlog "Evolution does only exists under linux."
204 call fCreateEvolutionAddressbookDatasource(gOfficePath + "user/work/tt_evolution.odb")
205 call fOpendatabase(gOfficePath + "user/work/tt_evolution.odb")
207 Kontext "ContainerView"
210 call fCloseDatabase(true)
213 '-------------------------------------------------------------------------
216 if ( fCreateMozillaAddressbookDatasource(gOfficePath + "user/work/tt_mozilla.odb") = true) then
217 if ( fOpendatabase(gOfficePath + "user/work/tt_mozilla.odb") = true) then
218 Kontext "ContainerView"
221 warnlog "mozilla database could not be open."
225 qaerrorlog "mozilla database could not be created. Maybe you have no mozilla installed."
227 if (MessageBox.exists(1)) then
231 ' try to close the database
232 call fCloseDatabase(false)
235 '-------------------------------------------------------------------------
237 qaerrorlog "not yet implemented"
239 '-------------------------------------------------------------------------
242 qaerrorlog "not yet implemented"
245 qaerrorlog "not yet implemented"
248 if gPlatform = "x86" then
249 printlog "Adabas doesn't exists under x86."
252 printlog "Adabas doesn't exists under Openoffice.org."
256 dim aDatabaseProperties(6) as string
257 aDatabaseProperties() = tools_dbtools_fgetAdabasDatabaseProperties()
259 ' if and only if no properties are defined in the environment file the test is stopped
260 if(aDatabaseProperties(1) = "no") then
261 qaerrorlog "No database properties from Adabas defiened. The Test is stopped here."
265 call fCreateAdabasDatasource( sFileName, aDatabaseProperties(2), aDatabaseProperties(3), aDatabaseProperties(4))
266 call fOpendatabase(gOfficePath + "user/work/tt_adabas.odb","testuser")
268 Kontext "ContainerView"
271 call fCloseDatabase(true)
274 '-------------------------------------------------------------------------
277 call fCreateDbaseDatasource(gOfficePath + "user/work/tt_dbase.odb",gOfficePath + "user/work/")
278 call fOpendatabase(gOfficePath + "user/work/tt_dbase.odb")
280 Kontext "ContainerView"
283 call fCloseDatabase(true)
286 '-------------------------------------------------------------------------
288 qaerrorlog "not yet implemented"
290 '-------------------------------------------------------------------------
292 qaerrorlog "not yet implemented"
294 '-------------------------------------------------------------------------
295 testcase tSpreadsheet
296 qaerrorlog "not yet implemented"
298 '-------------------------------------------------------------------------
301 call fCreateTextDatasource(gOfficePath + "user/work/tt_text.odb",gOfficePath + "user/work/")
302 call fOpendatabase(gOfficePath + "user/work/tt_text.odb")
304 Kontext "ContainerView"
307 call fCloseDatabase(true)
310 '-------------------------------------------------------------------------
312 qaerrorlog "not yet implemented"
314 '-------------------------------------------------------------------------