2004-08-02 14:45:10 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* 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.
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* 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).
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
2008-04-10 13:47:01 +00:00
|
|
|
* 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.
|
2004-08-02 14:45:10 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 06:08:13 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_dbaccess.hxx"
|
|
|
|
|
2004-08-02 14:45:10 +00:00
|
|
|
#ifndef DBAUI_DBWIZ_HXX
|
|
|
|
#include "dbwiz.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_DBADMIN_HRC_
|
|
|
|
#include "dbadmin.hrc"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBU_DLG_HRC_
|
|
|
|
#include "dbu_dlg.hrc"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_DATASOURCEITEMS_HXX_
|
|
|
|
#include "dsitems.hxx"
|
|
|
|
#endif
|
2009-07-03 12:24:35 +00:00
|
|
|
#include "dsnItem.hxx"
|
2004-08-02 14:45:10 +00:00
|
|
|
#ifndef _SFXSTRITEM_HXX
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/stritem.hxx>
|
2004-08-02 14:45:10 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _SFXENUMITEM_HXX
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/eitem.hxx>
|
2004-08-02 14:45:10 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _SFXINTITEM_HXX
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/intitem.hxx>
|
2004-08-02 14:45:10 +00:00
|
|
|
#endif
|
|
|
|
#ifndef _SV_MSGBOX_HXX
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
|
|
|
|
#include "dbustrings.hrc"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_ADMINPAGES_HXX_
|
|
|
|
#include "adminpages.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_GENERALPAGE_HXX_
|
|
|
|
#include "generalpage.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_LOCALRESACCESS_HXX_
|
|
|
|
#include "localresaccess.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_STRINGLISTITEM_HXX_
|
|
|
|
#include "stringlistitem.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_PROPERTYSETITEM_HXX_
|
|
|
|
#include "propertysetitem.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _UNOTOOLS_CONFIGNODE_HXX_
|
|
|
|
#include <unotools/confignode.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef DBAUI_CONNECTIONPAGE_HXX
|
|
|
|
#include "ConnectionPage.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef DBAUI_DRIVERSETTINGS_HXX
|
|
|
|
#include "DriverSettings.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBAUI_DBADMINIMPL_HXX_
|
|
|
|
#include "DbAdminImpl.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBA_DBACCESS_HELPID_HRC_
|
|
|
|
#include "dbaccess_helpid.hrc"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
using namespace svt;
|
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::sdbc;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::util;
|
|
|
|
using namespace com::sun::star::beans;
|
|
|
|
using namespace com::sun::star::container;
|
|
|
|
|
2004-10-27 12:02:39 +00:00
|
|
|
#define START_PAGE 0
|
|
|
|
#define CONNECTION_PAGE 1
|
|
|
|
#define ADDITIONAL_PAGE_DBASE 2
|
|
|
|
#define ADDITIONAL_PAGE_FLAT 3
|
|
|
|
#define ADDITIONAL_PAGE_LDAP 4
|
|
|
|
#define ADDITIONAL_PAGE_ADABAS 5
|
|
|
|
#define ADDITIONAL_PAGE_MYSQL_JDBC 6
|
|
|
|
#define ADDITIONAL_PAGE_MYSQL_ODBC 7
|
|
|
|
#define ADDITIONAL_PAGE_ORACLE_JDBC 8
|
|
|
|
#define ADDITIONAL_PAGE_ADO 9
|
|
|
|
#define ADDITIONAL_PAGE_ODBC 10
|
|
|
|
#define ADDITIONAL_USERDEFINED 11
|
2008-03-05 15:58:22 +00:00
|
|
|
#define ADDITIONAL_PAGE_MYSQL_NATIVE 12
|
2004-08-02 14:45:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
DBG_NAME(ODbTypeWizDialog)
|
|
|
|
//=========================================================================
|
|
|
|
//= ODbTypeWizDialog
|
|
|
|
//=========================================================================
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
ODbTypeWizDialog::ODbTypeWizDialog(Window* _pParent
|
|
|
|
,SfxItemSet* _pItems
|
|
|
|
,const Reference< XMultiServiceFactory >& _rxORB
|
|
|
|
,const ::com::sun::star::uno::Any& _aDataSourceName
|
|
|
|
)
|
2008-03-06 17:18:41 +00:00
|
|
|
:OWizardMachine(_pParent, ModuleRes(DLG_DATABASE_TYPE_CHANGE), WZB_NEXT | WZB_PREVIOUS | WZB_FINISH | WZB_CANCEL | WZB_HELP )
|
2006-06-20 02:06:18 +00:00
|
|
|
,m_pOutSet(NULL)
|
2004-08-02 14:45:10 +00:00
|
|
|
,m_bResetting(sal_False)
|
|
|
|
,m_bApplied(sal_False)
|
|
|
|
,m_bUIEnabled( sal_True )
|
|
|
|
{
|
|
|
|
DBG_CTOR(ODbTypeWizDialog,NULL);
|
|
|
|
m_pImpl = ::std::auto_ptr<ODbDataSourceAdministrationHelper>(new ODbDataSourceAdministrationHelper(_rxORB,this,this));
|
2005-06-30 15:32:42 +00:00
|
|
|
m_pImpl->setDataSourceOrName(_aDataSourceName);
|
2004-08-02 14:45:10 +00:00
|
|
|
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
|
|
|
|
m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() );
|
|
|
|
|
|
|
|
m_pImpl->translateProperties(xDatasource, *m_pOutSet);
|
|
|
|
m_eType = m_pImpl->getDatasourceType(*m_pOutSet);
|
|
|
|
|
|
|
|
SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MAP_APPFONT));
|
|
|
|
ShowButtonFixedLine(sal_True);
|
|
|
|
defaultButton(WZB_NEXT);
|
|
|
|
enableButtons(WZB_FINISH, sal_False);
|
2008-03-06 17:18:41 +00:00
|
|
|
enableAutomaticNextButtonState( true );
|
2004-08-02 14:45:10 +00:00
|
|
|
|
|
|
|
m_pPrevPage->SetHelpId(HID_DBWIZ_PREVIOUS);
|
|
|
|
m_pNextPage->SetHelpId(HID_DBWIZ_NEXT);
|
|
|
|
m_pCancel->SetHelpId(HID_DBWIZ_CANCEL);
|
|
|
|
m_pFinish->SetHelpId(HID_DBWIZ_FINISH);
|
|
|
|
m_pHelp->SetUniqueId(UID_DBWIZ_HELP);
|
|
|
|
// no local resources needed anymore
|
2009-07-03 12:24:35 +00:00
|
|
|
|
|
|
|
DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
|
|
|
|
m_pCollection = pCollectionItem->getCollection();
|
|
|
|
|
2004-08-02 14:45:10 +00:00
|
|
|
FreeResource();
|
|
|
|
ActivatePage();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
ODbTypeWizDialog::~ODbTypeWizDialog()
|
|
|
|
{
|
|
|
|
DBG_DTOR(ODbTypeWizDialog,NULL);
|
|
|
|
delete m_pOutSet;
|
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
IMPL_LINK(ODbTypeWizDialog, OnTypeSelected, OGeneralPage*, _pTabPage)
|
|
|
|
{
|
|
|
|
m_eType = _pTabPage->GetSelectedType();
|
2009-07-03 12:24:35 +00:00
|
|
|
const bool bURLRequired = m_pCollection->isConnectionUrlRequired(m_eType);
|
|
|
|
enableButtons(WZB_NEXT,bURLRequired);
|
|
|
|
enableButtons(WZB_FINISH,!bURLRequired);
|
2004-08-02 14:45:10 +00:00
|
|
|
return 1L;
|
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
2008-03-06 17:18:41 +00:00
|
|
|
WizardTypes::WizardState ODbTypeWizDialog::determineNextState( WizardState _nCurrentState ) const
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
|
|
|
WizardTypes::WizardState nNextState = WZS_INVALID_STATE;
|
|
|
|
switch(_nCurrentState)
|
|
|
|
{
|
|
|
|
case START_PAGE:
|
2009-07-03 12:24:35 +00:00
|
|
|
switch(m_pCollection->determineType(m_eType))
|
2005-03-10 15:49:19 +00:00
|
|
|
{
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_MOZILLA:
|
|
|
|
case ::dbaccess::DST_OUTLOOK:
|
|
|
|
case ::dbaccess::DST_OUTLOOKEXP:
|
|
|
|
case ::dbaccess::DST_EVOLUTION:
|
CWS-TOOLING: integrate CWS evoab2def
2009-05-28 16:00:19 +0200 fs r272412 : don't use createFalse - Evo 2.22 simply hangs when ask for all contacts without a first name. Instead, in the WHERE 0=1 case, simply create an empty result set
2009-05-22 14:25:51 +0200 fs r272193 : #i10000#
2009-05-22 14:25:37 +0200 fs r272192 : oops, ENABLE_EVOAB2 for some platforms only, not generically
2009-05-22 14:19:00 +0200 fs r272191 : #i10000#
2009-05-22 12:42:38 +0200 fs r272183 : when sorting, properly use a syslocale collator, instead of comparing the numerical values of the string's UTF-16 code points
2009-05-20 15:09:00 +0200 fs r272131 : clear/getWarnings: also allowed without cache
2009-05-20 14:11:19 +0200 fs r272128 : removed debug traces
2009-05-20 14:03:31 +0200 fs r272126 : #i55701# +STR_SORT_BY_COL_ONLY
2009-05-20 14:02:29 +0200 fs r272125 : implement sorting
2009-05-20 10:10:19 +0200 fs r272107 : #i10000#
2009-05-19 16:02:17 +0200 fs r272089 : #i10000#
2009-05-19 16:02:02 +0200 fs r272088 : #i55701# strings for new error condition DATA_CANNOT_SELECT_UNFILTERED
2009-05-19 16:01:31 +0200 fs r272087 : #i55701# use DATA_CANNOT_SELECT_UNFILTERED as standardized error code
2009-05-19 15:59:59 +0200 fs r272086 : #i55701# +DATA_CANNOT_SELECT_UNFILTERED
2009-05-19 15:46:12 +0200 fs r272084 : #i55701# recognize the DATA_CANNOT_SELECT_UNFILTERED error condition, and allow filtering in this case, even when the result set is empty
2009-05-19 09:06:50 +0200 fs r272059 : merging changes from CWS dba32b, to prevent future conflicts with upcoming local changes
2009-05-18 21:48:58 +0200 fs r272054 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing
2009-05-18 21:48:42 +0200 fs r272053 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing
2009-05-18 21:47:41 +0200 fs r272052 : +setExternalWarnings
2009-05-18 21:47:12 +0200 fs r272051 : #i55701# when re/loading the form, display any possible warnings
2009-05-18 21:43:26 +0200 fs r272050 : #i55701# implement XWarningsSupplier, exposing the warnings of our result set
2009-05-18 21:42:51 +0200 fs r272049 : #i55701# implement XWarningsSupplier, exposing the warnings of our aggregate RowSet
2009-05-18 17:53:59 +0200 fs r272041 : #i55701# moved the (I)WarningsContainer from dbaccess to connectivity, to be able to use it in the latter module, too
2009-05-18 17:24:10 +0200 fs r272040 : #i55701# properly enable the various Evolution types
2009-05-18 14:52:19 +0200 fs r272024 : #i55701# properly enable the Evolution types
2009-05-18 13:57:10 +0200 fs r272018 : fixed/extended whereAnalysis (column searching still not enabled, as neither LIKE nor = seem to work with my (somewhat older) Evolution version)
2009-05-18 13:56:08 +0200 fs r272017 : extended showParseTree
2009-05-18 13:55:25 +0200 fs r272016 : extended showParseTree
2009-05-18 11:40:16 +0200 fs r272008 : #i55701#
2009-05-18 11:39:02 +0200 fs r272006 : let the PreparedStatement return proper meta data, too
2009-05-18 10:05:37 +0200 fs r271999 : moved the XStatement interface to from OCommonStatement to OStatement - the former class is also the base for other classes which should not have this interface
2009-05-15 21:53:22 +0200 fs r271973 : collectColumnInformation: report invalid meta data as assertion
2009-05-15 21:51:40 +0200 fs r271972 : showParseTree should be const
2009-05-15 21:51:26 +0200 fs r271971 : showParseTree should be const
2009-05-15 21:51:03 +0200 fs r271970 : properly recognize the 'WHERE 0 = 1' clause, this way having proper statement meta data, this way saving much much calls from the DBA framework
2009-05-15 20:29:03 +0200 fs r271969 : cleaned up the mess with the statement classes
2009-05-15 15:51:11 +0200 fs r271944 : let the result set properly init its meta data
2009-05-15 15:29:54 +0200 fs r271939 : proper property implementations for the resultset class
2009-05-15 15:01:31 +0200 fs r271936 : proper property implementations for the statement class
2009-05-08 14:46:33 +0200 fs r271717 : component_foo must be PUBLIC
2009-05-06 09:20:05 +0200 fs r271565 : #i10000# (warnings on unxlngi6)
2009-05-06 09:01:30 +0200 fs r271564 : #i101493#
2009-05-05 23:08:12 +0200 fs r271560 : #i55701# merging the changes from the ancient (CVS-based) CWS evoab2default into this CWS here
2009-06-05 12:31:05 +00:00
|
|
|
case ::dbaccess::DST_EVOLUTION_GROUPWISE:
|
|
|
|
case ::dbaccess::DST_EVOLUTION_LDAP:
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_KAB:
|
|
|
|
case ::dbaccess::DST_MACAB:
|
2005-03-10 15:49:19 +00:00
|
|
|
nNextState = WZS_INVALID_STATE;
|
|
|
|
break;
|
2009-02-16 07:31:09 +00:00
|
|
|
case ::dbaccess::DST_MYSQL_NATIVE:
|
|
|
|
nNextState = ADDITIONAL_PAGE_MYSQL_NATIVE;
|
|
|
|
break;
|
2005-03-10 15:49:19 +00:00
|
|
|
default:
|
|
|
|
nNextState = CONNECTION_PAGE;
|
|
|
|
break;
|
|
|
|
}
|
2004-08-02 14:45:10 +00:00
|
|
|
break;
|
|
|
|
case CONNECTION_PAGE:
|
2009-07-03 12:24:35 +00:00
|
|
|
switch(m_pCollection->determineType(m_eType))
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_MOZILLA:
|
|
|
|
case ::dbaccess::DST_THUNDERBIRD:
|
|
|
|
case ::dbaccess::DST_OUTLOOK:
|
|
|
|
case ::dbaccess::DST_OUTLOOKEXP:
|
|
|
|
case ::dbaccess::DST_EVOLUTION:
|
CWS-TOOLING: integrate CWS evoab2def
2009-05-28 16:00:19 +0200 fs r272412 : don't use createFalse - Evo 2.22 simply hangs when ask for all contacts without a first name. Instead, in the WHERE 0=1 case, simply create an empty result set
2009-05-22 14:25:51 +0200 fs r272193 : #i10000#
2009-05-22 14:25:37 +0200 fs r272192 : oops, ENABLE_EVOAB2 for some platforms only, not generically
2009-05-22 14:19:00 +0200 fs r272191 : #i10000#
2009-05-22 12:42:38 +0200 fs r272183 : when sorting, properly use a syslocale collator, instead of comparing the numerical values of the string's UTF-16 code points
2009-05-20 15:09:00 +0200 fs r272131 : clear/getWarnings: also allowed without cache
2009-05-20 14:11:19 +0200 fs r272128 : removed debug traces
2009-05-20 14:03:31 +0200 fs r272126 : #i55701# +STR_SORT_BY_COL_ONLY
2009-05-20 14:02:29 +0200 fs r272125 : implement sorting
2009-05-20 10:10:19 +0200 fs r272107 : #i10000#
2009-05-19 16:02:17 +0200 fs r272089 : #i10000#
2009-05-19 16:02:02 +0200 fs r272088 : #i55701# strings for new error condition DATA_CANNOT_SELECT_UNFILTERED
2009-05-19 16:01:31 +0200 fs r272087 : #i55701# use DATA_CANNOT_SELECT_UNFILTERED as standardized error code
2009-05-19 15:59:59 +0200 fs r272086 : #i55701# +DATA_CANNOT_SELECT_UNFILTERED
2009-05-19 15:46:12 +0200 fs r272084 : #i55701# recognize the DATA_CANNOT_SELECT_UNFILTERED error condition, and allow filtering in this case, even when the result set is empty
2009-05-19 09:06:50 +0200 fs r272059 : merging changes from CWS dba32b, to prevent future conflicts with upcoming local changes
2009-05-18 21:48:58 +0200 fs r272054 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing
2009-05-18 21:48:42 +0200 fs r272053 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing
2009-05-18 21:47:41 +0200 fs r272052 : +setExternalWarnings
2009-05-18 21:47:12 +0200 fs r272051 : #i55701# when re/loading the form, display any possible warnings
2009-05-18 21:43:26 +0200 fs r272050 : #i55701# implement XWarningsSupplier, exposing the warnings of our result set
2009-05-18 21:42:51 +0200 fs r272049 : #i55701# implement XWarningsSupplier, exposing the warnings of our aggregate RowSet
2009-05-18 17:53:59 +0200 fs r272041 : #i55701# moved the (I)WarningsContainer from dbaccess to connectivity, to be able to use it in the latter module, too
2009-05-18 17:24:10 +0200 fs r272040 : #i55701# properly enable the various Evolution types
2009-05-18 14:52:19 +0200 fs r272024 : #i55701# properly enable the Evolution types
2009-05-18 13:57:10 +0200 fs r272018 : fixed/extended whereAnalysis (column searching still not enabled, as neither LIKE nor = seem to work with my (somewhat older) Evolution version)
2009-05-18 13:56:08 +0200 fs r272017 : extended showParseTree
2009-05-18 13:55:25 +0200 fs r272016 : extended showParseTree
2009-05-18 11:40:16 +0200 fs r272008 : #i55701#
2009-05-18 11:39:02 +0200 fs r272006 : let the PreparedStatement return proper meta data, too
2009-05-18 10:05:37 +0200 fs r271999 : moved the XStatement interface to from OCommonStatement to OStatement - the former class is also the base for other classes which should not have this interface
2009-05-15 21:53:22 +0200 fs r271973 : collectColumnInformation: report invalid meta data as assertion
2009-05-15 21:51:40 +0200 fs r271972 : showParseTree should be const
2009-05-15 21:51:26 +0200 fs r271971 : showParseTree should be const
2009-05-15 21:51:03 +0200 fs r271970 : properly recognize the 'WHERE 0 = 1' clause, this way having proper statement meta data, this way saving much much calls from the DBA framework
2009-05-15 20:29:03 +0200 fs r271969 : cleaned up the mess with the statement classes
2009-05-15 15:51:11 +0200 fs r271944 : let the result set properly init its meta data
2009-05-15 15:29:54 +0200 fs r271939 : proper property implementations for the resultset class
2009-05-15 15:01:31 +0200 fs r271936 : proper property implementations for the statement class
2009-05-08 14:46:33 +0200 fs r271717 : component_foo must be PUBLIC
2009-05-06 09:20:05 +0200 fs r271565 : #i10000# (warnings on unxlngi6)
2009-05-06 09:01:30 +0200 fs r271564 : #i101493#
2009-05-05 23:08:12 +0200 fs r271560 : #i55701# merging the changes from the ancient (CVS-based) CWS evoab2default into this CWS here
2009-06-05 12:31:05 +00:00
|
|
|
case ::dbaccess::DST_EVOLUTION_GROUPWISE:
|
|
|
|
case ::dbaccess::DST_EVOLUTION_LDAP:
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_KAB:
|
|
|
|
case ::dbaccess::DST_MACAB:
|
|
|
|
case ::dbaccess::DST_MSACCESS:
|
|
|
|
case ::dbaccess::DST_MSACCESS_2007:
|
|
|
|
case ::dbaccess::DST_JDBC:
|
|
|
|
case ::dbaccess::DST_CALC:
|
2004-08-02 14:45:10 +00:00
|
|
|
nNextState = WZS_INVALID_STATE;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_DBASE:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_DBASE;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_FLAT:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_FLAT;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_LDAP:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_LDAP;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_ADABAS:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_ADABAS;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_MYSQL_JDBC:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_MYSQL_JDBC;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_MYSQL_ODBC:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_MYSQL_ODBC;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_ORACLE_JDBC:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_ORACLE_JDBC;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_ADO:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_ADO;
|
|
|
|
break;
|
2008-10-01 12:28:29 +00:00
|
|
|
case ::dbaccess::DST_ODBC:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = ADDITIONAL_PAGE_ODBC;
|
|
|
|
break;
|
2004-08-02 14:45:10 +00:00
|
|
|
default:
|
2004-10-27 12:02:39 +00:00
|
|
|
nNextState = WZS_INVALID_STATE;
|
2004-08-02 14:45:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nNextState;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
const SfxItemSet* ODbTypeWizDialog::getOutputSet() const
|
|
|
|
{
|
|
|
|
return m_pOutSet;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
SfxItemSet* ODbTypeWizDialog::getWriteOutputSet()
|
|
|
|
{
|
|
|
|
return m_pOutSet;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-01-21 16:14:46 +00:00
|
|
|
::std::pair< Reference<XConnection>,sal_Bool> ODbTypeWizDialog::createConnection()
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
|
|
|
return m_pImpl->createConnection();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2007-11-01 14:12:00 +00:00
|
|
|
Reference< XMultiServiceFactory > ODbTypeWizDialog::getORB() const
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
|
|
|
return m_pImpl->getORB();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XDriver > ODbTypeWizDialog::getDriver()
|
|
|
|
{
|
|
|
|
return m_pImpl->getDriver();
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2009-07-03 12:24:35 +00:00
|
|
|
::rtl::OUString ODbTypeWizDialog::getDatasourceType(const SfxItemSet& _rSet) const
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
|
|
|
return m_pImpl->getDatasourceType(_rSet);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODbTypeWizDialog::clearPassword()
|
|
|
|
{
|
|
|
|
m_pImpl->clearPassword();
|
|
|
|
}
|
2004-10-27 12:02:39 +00:00
|
|
|
|
2004-08-02 14:45:10 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
TabPage* ODbTypeWizDialog::createPage(WizardState _nState)
|
|
|
|
{
|
|
|
|
USHORT nStringId = STR_PAGETITLE_ADVANCED;
|
|
|
|
TabPage* pPage = NULL;
|
|
|
|
switch(_nState)
|
|
|
|
{
|
|
|
|
case START_PAGE: // start state
|
2005-06-30 15:32:42 +00:00
|
|
|
{
|
2004-08-02 14:45:10 +00:00
|
|
|
pPage = OGeneralPage::Create(this,*m_pOutSet);
|
2005-06-30 15:32:42 +00:00
|
|
|
OGeneralPage* pGeneralPage = static_cast< OGeneralPage* >( pPage );
|
|
|
|
pGeneralPage->SetTypeSelectHandler( LINK( this, ODbTypeWizDialog, OnTypeSelected));
|
|
|
|
// pGeneralPage->SetCreationModeHandler( LINK( this, ODbTypeWizDialog, TODO ) );
|
2004-08-02 14:45:10 +00:00
|
|
|
nStringId = STR_PAGETITLE_GENERAL;
|
2005-06-30 15:32:42 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-08-02 14:45:10 +00:00
|
|
|
case CONNECTION_PAGE:
|
|
|
|
pPage = OConnectionTabPage::Create(this,*m_pOutSet);
|
|
|
|
nStringId = STR_PAGETITLE_CONNECTION;
|
|
|
|
break;
|
|
|
|
|
2004-10-27 12:02:39 +00:00
|
|
|
case ADDITIONAL_PAGE_DBASE:
|
|
|
|
pPage = ODriversSettings::CreateDbase(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_FLAT:
|
|
|
|
pPage = ODriversSettings::CreateText(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_LDAP:
|
|
|
|
pPage = ODriversSettings::CreateLDAP(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_ADABAS:
|
|
|
|
pPage = ODriversSettings::CreateAdabas(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_MYSQL_JDBC:
|
|
|
|
pPage = ODriversSettings::CreateMySQLJDBC(this,*m_pOutSet);
|
|
|
|
break;
|
2009-02-16 07:31:09 +00:00
|
|
|
case ADDITIONAL_PAGE_MYSQL_NATIVE:
|
2008-03-05 15:58:22 +00:00
|
|
|
pPage = ODriversSettings::CreateMySQLNATIVE(this,*m_pOutSet);
|
|
|
|
break;
|
2004-10-27 12:02:39 +00:00
|
|
|
case ADDITIONAL_PAGE_MYSQL_ODBC:
|
|
|
|
pPage = ODriversSettings::CreateMySQLODBC(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_ORACLE_JDBC:
|
|
|
|
pPage = ODriversSettings::CreateOracleJDBC(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_ADO:
|
|
|
|
pPage = ODriversSettings::CreateAdo(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_PAGE_ODBC:
|
|
|
|
pPage = ODriversSettings::CreateODBC(this,*m_pOutSet);
|
|
|
|
break;
|
|
|
|
case ADDITIONAL_USERDEFINED:
|
|
|
|
pPage = ODriversSettings::CreateUser(this,*m_pOutSet);
|
2004-08-02 14:45:10 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
OSL_ENSURE(0,"Wrong state!");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// register ourself as modified listener
|
|
|
|
if ( pPage )
|
|
|
|
{
|
|
|
|
static_cast<OGenericAdministrationPage*>(pPage)->SetServiceFactory(m_pImpl->getORB());
|
|
|
|
static_cast<OGenericAdministrationPage*>(pPage)->SetAdminDialog(this,this);
|
|
|
|
// open our own resource block, as the page titles are strings local to this block
|
2006-05-04 07:41:29 +00:00
|
|
|
LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG);
|
2004-08-02 14:45:10 +00:00
|
|
|
|
2007-04-26 06:58:29 +00:00
|
|
|
pPage->SetText(String(ModuleRes(nStringId)));
|
2004-08-02 14:45:10 +00:00
|
|
|
defaultButton( _nState == START_PAGE ? WZB_NEXT : WZB_FINISH );
|
|
|
|
enableButtons( WZB_FINISH, _nState == START_PAGE ? sal_False : sal_True);
|
|
|
|
pPage->Show();
|
|
|
|
}
|
|
|
|
return pPage;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool ODbTypeWizDialog::leaveState(WizardState _nState)
|
|
|
|
{
|
|
|
|
SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(_nState));
|
|
|
|
if ( pPage )
|
|
|
|
pPage->FillItemSet(*m_pOutSet);
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODbTypeWizDialog::setTitle(const ::rtl::OUString& _sTitle)
|
|
|
|
{
|
|
|
|
SetText(_sTitle);
|
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
2007-05-10 09:24:58 +00:00
|
|
|
void ODbTypeWizDialog::enableConfirmSettings( bool _bEnable )
|
|
|
|
{
|
|
|
|
enableButtons( WZB_FINISH, _bEnable );
|
|
|
|
// TODO:
|
|
|
|
// this is hacky. At the moment, this method is used in only one case (#b6532894#).
|
|
|
|
// As soon as it is to be used more wide-spread, we should find a proper concept
|
|
|
|
// for enabling both the Next and Finish buttons, depending on the current page state.
|
|
|
|
// Plus, the concept must also care for the case where those pages are embedded into
|
|
|
|
// anormal tab dialog.
|
|
|
|
}
|
|
|
|
//-------------------------------------------------------------------------
|
2004-08-02 14:45:10 +00:00
|
|
|
sal_Bool ODbTypeWizDialog::saveDatasource()
|
|
|
|
{
|
|
|
|
SfxTabPage* pPage = static_cast<SfxTabPage*>(WizardDialog::GetPage(getCurrentState()));
|
|
|
|
if ( pPage )
|
|
|
|
pPage->FillItemSet(*m_pOutSet);
|
2009-07-03 12:24:35 +00:00
|
|
|
|
|
|
|
DataSourceInfoConverter aConverter(getORB());
|
|
|
|
::rtl::OUString sOldURL;
|
|
|
|
if ( m_pImpl->getCurrentDataSource().is() )
|
|
|
|
m_pImpl->getCurrentDataSource()->getPropertyValue(PROPERTY_URL) >>= sOldURL;
|
|
|
|
aConverter.convert(m_pCollection,sOldURL,m_eType,m_pImpl->getCurrentDataSource());
|
2004-08-02 14:45:10 +00:00
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2010-05-25 10:17:24 +02:00
|
|
|
IWizardPageController* ODbTypeWizDialog::getPageController( TabPage* _pCurrentPage ) const
|
2004-08-02 14:45:10 +00:00
|
|
|
{
|
|
|
|
OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(_pCurrentPage);
|
|
|
|
return pPage;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
sal_Bool ODbTypeWizDialog::onFinish(sal_Int32 _nResult)
|
|
|
|
{
|
|
|
|
saveDatasource();
|
|
|
|
return m_pImpl->saveChanges(*m_pOutSet) ? OWizardMachine::onFinish(_nResult) : sal_False;
|
|
|
|
}
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|