LibreOffice Module dbaccess (master) 1
dbwizsetup.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <core_resource.hxx>
21#include <dbwizsetup.hxx>
22#include <dsmeta.hxx>
24#include <strings.hrc>
25#include <strings.hxx>
26#include <dsitems.hxx>
27#include "dsnItem.hxx"
28
30#include <svl/stritem.hxx>
31#include "adminpages.hxx"
32#include <sfx2/docfilt.hxx>
34#include "generalpage.hxx"
36#include "DbAdminImpl.hxx"
37#include <helpids.h>
39#include <UITools.hxx>
44#include <com/sun/star/frame/TerminationVetoException.hpp>
45#include <com/sun/star/frame/XStorable.hpp>
46#include <com/sun/star/sdb/DatabaseContext.hpp>
47#include <com/sun/star/frame/Desktop.hpp>
48#include <com/sun/star/frame/FrameSearchFlag.hpp>
49#include <com/sun/star/frame/XComponentLoader.hpp>
50#include <com/sun/star/frame/XModel.hpp>
51#include <com/sun/star/ucb/SimpleFileAccess.hpp>
52#include <com/sun/star/ucb/InteractiveIOException.hpp>
53#include <com/sun/star/io/IOException.hpp>
54#include <com/sun/star/frame/XTerminateListener.hpp>
55#include <com/sun/star/document/MacroExecMode.hpp>
56#include <com/sun/star/ucb/IOErrorCode.hpp>
57#include <com/sun/star/task/InteractionHandler.hpp>
58#include <com/sun/star/task/XInteractionHandler2.hpp>
59#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
60
64#include <osl/diagnose.h>
66#include <utility>
67
68namespace dbaui
69{
70using namespace dbtools;
71using namespace vcl;
72using namespace com::sun::star;
73using namespace com::sun::star::uno;
74using namespace com::sun::star::sdbc;
75using namespace com::sun::star::sdbcx;
76using namespace com::sun::star::task;
77using namespace com::sun::star::lang;
78using namespace com::sun::star::io;
79using namespace com::sun::star::util;
80using namespace com::sun::star::beans;
81using namespace com::sun::star::container;
82using namespace com::sun::star::frame;
83using namespace com::sun::star::ucb;
84using namespace ::com::sun::star::sdb;
85using namespace ::com::sun::star::document;
86using namespace ::comphelper;
87using namespace ::cppu;
88
90
91// ODbTypeWizDialogSetup
93 ,SfxItemSet const * _pItems
95 ,const css::uno::Any& _aDataSourceName
96 )
97 : vcl::RoadmapWizardMachine( _pParent )
98
99 , m_bIsConnectable( false)
100 , m_sRM_IntroText( DBA_RES( STR_PAGETITLE_INTROPAGE ) )
101 , m_sRM_dBaseText( DBA_RES( STR_PAGETITLE_DBASE ) )
102 , m_sRM_TextText( DBA_RES( STR_PAGETITLE_TEXT ) )
103 , m_sRM_MSAccessText( DBA_RES( STR_PAGETITLE_MSACCESS ) )
104 , m_sRM_LDAPText( DBA_RES( STR_PAGETITLE_LDAP ) )
105 , m_sRM_ADOText( DBA_RES( STR_PAGETITLE_ADO ) )
106 , m_sRM_JDBCText( DBA_RES( STR_PAGETITLE_JDBC ) )
107 , m_sRM_MySQLNativePageTitle( DBA_RES( STR_PAGETITLE_MYSQL_NATIVE ) )
108 , m_sRM_OracleText( DBA_RES( STR_PAGETITLE_ORACLE ) )
109 , m_sRM_PostgresText( DBA_RES( STR_PAGETITLE_POSTGRES ) )
110 , m_sRM_MySQLText( DBA_RES( STR_PAGETITLE_MYSQL ) )
111 , m_sRM_ODBCText( DBA_RES( STR_PAGETITLE_ODBC ) )
112 , m_sRM_DocumentOrSpreadSheetText( DBA_RES( STR_PAGETITLE_DOCUMENT_OR_SPREADSHEET ) )
113 , m_sRM_AuthentificationText( DBA_RES( STR_PAGETITLE_AUTHENTIFICATION ) )
114 , m_sRM_FinalText( DBA_RES( STR_PAGETITLE_FINAL ) )
115 , m_sWorkPath( SvtPathOptions().GetWorkPath() )
116 , m_pGeneralPage( nullptr )
117 , m_pMySQLIntroPage( nullptr )
118 , m_pFinalPage( nullptr )
119{
120 // no local resources needed anymore
121 // extract the datasource type collection from the item set
122 const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>(_pItems->GetItem(DSID_TYPECOLLECTION));
123 assert(pCollectionItem && "must exist");
124 m_pCollection = pCollectionItem->getCollection();
125
126 assert(m_pCollection && "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
127
128 m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB, m_xAssistant.get(), _pParent, this));
129 m_pImpl->setDataSourceOrName(_aDataSourceName);
130 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
131 m_pOutSet.reset( new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() ) );
132
133 m_pImpl->translateProperties(xDatasource, *m_pOutSet);
134
135 defaultButton(WizardButtonFlags::NEXT);
136 enableButtons(WizardButtonFlags::FINISH, true);
138
141 for(PathId i = 1;aIter != aEnd;++aIter,++i)
142 {
143 const OUString& sURLPrefix = aIter.getURLPrefix();
144 WizardPath aPath;
145 aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);
146 m_pCollection->fillPageIds(sURLPrefix,aPath);
148 aPath.push_back(PAGE_DBSETUPWIZARD_FINAL);
149
150 declareAuthDepPath(sURLPrefix,i,aPath);
151 }
152
153 WizardPath aPath;
154 aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);
155 declarePath( static_cast<PathId>(m_pCollection->size()+1), aPath);
156
157 // Set general help ID for the roadmap
159
160 m_xPrevPage->set_help_id(HID_DBWIZ_PREVIOUS);
161 m_xNextPage->set_help_id(HID_DBWIZ_NEXT);
162 m_xCancel->set_help_id(HID_DBWIZ_CANCEL);
163 m_xFinish->set_help_id(HID_DBWIZ_FINISH);
164 m_xHelp->set_help_id(HID_DBWIZ_HELP);
165 ActivatePage();
166 setTitleBase(DBA_RES(STR_DBWIZARDTITLE));
167 m_xAssistant->set_current_page(0);
168}
169
170void ODbTypeWizDialogSetup::declareAuthDepPath( const OUString& _sURL, PathId _nPathId, const WizardPath& _rPaths)
171{
172 bool bHasAuthentication = DataSourceMetaData::getAuthentication( _sURL ) != AuthNone;
173
174 // collect the elements of the path
175 WizardPath aPath;
176
177 for (auto const& path : _rPaths)
178 {
179 if ( bHasAuthentication || ( path != PAGE_DBSETUPWIZARD_AUTHENTIFICATION ) )
180 aPath.push_back(path);
181 }
182
183 // call base method
185}
186
188{
189 OUString sRoadmapItem;
190 switch( _nState )
191 {
193 sRoadmapItem = m_sRM_IntroText;
194 break;
195
197 sRoadmapItem = m_sRM_dBaseText;
198 break;
200 sRoadmapItem = m_sRM_ADOText;
201 break;
203 sRoadmapItem = m_sRM_TextText;
204 break;
206 sRoadmapItem = m_sRM_MSAccessText;
207 break;
209 sRoadmapItem = m_sRM_LDAPText;
210 break;
212 sRoadmapItem = m_sRM_JDBCText;
213 break;
215 sRoadmapItem = m_sRM_OracleText;
216 break;
218 sRoadmapItem = m_sRM_PostgresText;
219 break;
221 sRoadmapItem = m_sRM_MySQLText;
222 break;
224 sRoadmapItem = m_sRM_JDBCText;
225 break;
227 sRoadmapItem = m_sRM_MySQLNativePageTitle;
228 break;
230 sRoadmapItem = m_sRM_ODBCText;
231 break;
233 sRoadmapItem = m_sRM_ODBCText;
234 break;
236 sRoadmapItem = m_sRM_DocumentOrSpreadSheetText;
237 break;
239 sRoadmapItem = m_sRM_AuthentificationText;
240 break;
242 sRoadmapItem = DBA_RES(STR_PAGETITLE_CONNECTION);
243 break;
245 sRoadmapItem = m_sRM_FinalText;
246 break;
247 default:
248 break;
249 }
250 return sRoadmapItem;
251}
252
254{
255}
256
258{
259 activateDatabasePath();
260}
261
262static void lcl_removeUnused(const ::comphelper::NamedValueCollection& _aOld,const ::comphelper::NamedValueCollection& _aNew,::comphelper::NamedValueCollection& _rDSInfo)
263{
264 _rDSInfo.merge(_aNew,true);
265 uno::Sequence< beans::NamedValue > aOldValues = _aOld.getNamedValues();
266 const beans::NamedValue* pIter = aOldValues.getConstArray();
267 const beans::NamedValue* pEnd = pIter + aOldValues.getLength();
268 for(;pIter != pEnd;++pIter)
269 {
270 if ( !_aNew.has(pIter->Name) )
271 {
272 _rDSInfo.remove(pIter->Name);
273 }
274 }
275}
276
277void DataSourceInfoConverter::convert(const Reference<XComponentContext> & xContext, const ::dbaccess::ODsnTypeCollection* _pCollection, std::u16string_view _sOldURLPrefix, std::u16string_view _sNewURLPrefix,const css::uno::Reference< css::beans::XPropertySet >& _xDatasource)
278{
279 if ( _pCollection->getPrefix(_sOldURLPrefix) == _pCollection->getPrefix(_sNewURLPrefix) )
280 return ;
281 uno::Sequence< beans::PropertyValue> aInfo;
282 _xDatasource->getPropertyValue(PROPERTY_INFO) >>= aInfo;
284
285 ::connectivity::DriversConfig aDriverConfig(xContext);
286
287 const ::comphelper::NamedValueCollection& aOldProperties = aDriverConfig.getProperties(_sOldURLPrefix);
288 const ::comphelper::NamedValueCollection& aNewProperties = aDriverConfig.getProperties(_sNewURLPrefix);
289 lcl_removeUnused(aOldProperties,aNewProperties,aDS);
290
291 aDS >>= aInfo;
292 _xDatasource->setPropertyValue(PROPERTY_INFO,uno::Any(aInfo));
293}
294
296{
298 {
300 {
301 sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pGeneralPage->GetSelectedType() );
302 if ( nCreateNewDBIndex == -1 )
303 nCreateNewDBIndex = m_pCollection->getIndexOf( u"sdbc:dbase:" );
304 OSL_ENSURE( nCreateNewDBIndex != -1, "ODbTypeWizDialogSetup::activateDatabasePath: the GeneralPage should have prevented this!" );
305 activatePath( static_cast< PathId >( nCreateNewDBIndex + 1 ), true );
306
308 enableButtons( WizardButtonFlags::FINISH, true);
309 }
310 break;
312 {
313 OUString sOld = m_sURL;
315 DataSourceInfoConverter::convert(getORB(), m_pCollection,sOld,m_sURL,m_pImpl->getCurrentDataSource());
319
320 activatePath( static_cast<PathId>(m_pCollection->getIndexOf(m_sURL) + 1), true);
322 }
323 break;
325 {
326 activatePath( static_cast<PathId>(m_pCollection->size() + 1), true );
327 enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocumentURL().isEmpty() );
328 }
329 break;
330 default:
331 OSL_FAIL( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" );
332 }
333
335 // TODO: this should go into the base class. Point is, we activate a path whose *last*
336 // step is also the current one. The base class should automatically disable
337 // the Next button in such a case. However, not for this patch ...
338}
339
341{
342 bool bDoEnable = false;
343 bool bIsConnectionRequired = m_pCollection->isConnectionUrlRequired(m_sURL);
344 if (!bIsConnectionRequired)
345 {
346 bDoEnable = true;
347 }
348 else if ( m_sURL == m_sOldURL )
349 {
350 bDoEnable = m_bIsConnectable;
351 }
354 enableButtons( WizardButtonFlags::FINISH, bDoEnable);
355}
356
358{
359 // remove all items which relate to indirect properties from the input set
360 // (without this, the following may happen: select an arbitrary data source where some indirect properties
361 // are set. Select another data source of the same type, where the indirect props are not set (yet). Then,
362 // the indirect property values of the first ds are shown in the second ds ...)
363 const ODbDataSourceAdministrationHelper::MapInt2String& rMap = m_pImpl->getIndirectProperties();
364 for (auto const& elem : rMap)
365 getWriteOutputSet()->ClearItem( static_cast<sal_uInt16>(elem.first) );
366
367 // extract all relevant data from the property set of the data source
368 m_pImpl->translateProperties(_rxDatasource, *getWriteOutputSet());
369}
370
372{
373 return m_pOutSet.get();
374}
375
377{
378 return m_pOutSet.get();
379}
380
381std::pair< Reference<XConnection>,bool> ODbTypeWizDialogSetup::createConnection()
382{
383 return m_pImpl->createConnection();
384}
385
387{
388 return m_pImpl->getORB();
389}
390
392{
393 return m_pImpl->getDriver();
394}
395
397{
398 ::dbaccess::DATASOURCE_TYPE LocDatabaseType = DatabaseType;
399 if ((LocDatabaseType == ::dbaccess::DST_MYSQL_JDBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_ODBC) || (LocDatabaseType == ::dbaccess::DST_MYSQL_NATIVE))
400 {
401 if (m_pMySQLIntroPage != nullptr)
402 {
404 {
411 }
412 }
413 }
414 return LocDatabaseType;
415}
416
418{
421 {
423 {
425 sRet = "sdbc:mysql:jdbc:";
426 break;
428 sRet = "sdbc:mysql:mysqlc:";
429 break;
431 sRet = "sdbc:mysql:odbc:";
432 break;
433 }
434 }
435 return sRet;
436}
437
439{
440 m_pImpl->clearPassword();
441}
442
444{
445 m_pMySQLIntroPage = pPage;
447}
448
450{
451 m_pGeneralPage = pPage;
453 m_pGeneralPage->SetCreationModeHandler(LINK( this, ODbTypeWizDialogSetup, OnChangeCreationMode ) );
454 m_pGeneralPage->SetDocumentSelectionHandler(LINK( this, ODbTypeWizDialogSetup, OnRecentDocumentSelected ) );
455 m_pGeneralPage->SetChooseDocumentHandler(LINK( this, ODbTypeWizDialogSetup, OnSingleDocumentChosen ) );
456}
457
459{
460 m_pFinalPage = pPage;
461}
462
463std::unique_ptr<BuilderPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
464{
465 std::unique_ptr<OGenericAdministrationPage> xPage;
466
467 OUString sIdent(OUString::number(_nState));
468 weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
469
470 switch(_nState)
471 {
473 xPage = std::make_unique<OGeneralPageWizard>(pPageContainer,this,*m_pOutSet);
474 break;
475
477 xPage = OConnectionTabPageSetup::CreateDbaseTabPage(pPageContainer, this, *m_pOutSet);
478 break;
479
481 xPage = OConnectionTabPageSetup::CreateADOTabPage(pPageContainer, this, *m_pOutSet);
482 break;
483
485 xPage = OTextConnectionPageSetup::CreateTextTabPage(pPageContainer, this, *m_pOutSet);
486 break;
487
489 xPage = OConnectionTabPageSetup::CreateODBCTabPage(pPageContainer, this, *m_pOutSet);
490 break;
491
493 xPage = OJDBCConnectionPageSetup::CreateJDBCTabPage(pPageContainer, this, *m_pOutSet);
494 break;
495
498 xPage = OConnectionTabPageSetup::CreateODBCTabPage(pPageContainer, this, *m_pOutSet);
499 break;
500
504 break;
506 m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix(u"sdbc:mysql:mysqlc:")));
507 xPage = MySQLNativeSetupPage::Create(pPageContainer, this, *m_pOutSet);
508 break;
509
512 break;
513
516 break;
517
519 xPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(pPageContainer, this, *m_pOutSet);
520 break;
521
524 break;
525
527 xPage = OConnectionTabPageSetup::CreateMSAccessTabPage(pPageContainer, this, *m_pOutSet);
528 break;
530 xPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(pPageContainer, this, *m_pOutSet);
531 break;
532
535 break;
536
538 xPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(pPageContainer, this, *m_pOutSet);
539 break;
540
542 xPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(pPageContainer, this, *m_pOutSet);
543 break;
544 }
545
546 if ( xPage )
547 {
548 if ((_nState != PAGE_DBSETUPWIZARD_INTRO) && (_nState != PAGE_DBSETUPWIZARD_AUTHENTIFICATION))
549 {
550 xPage->SetModifiedHandler(LINK( this, ODbTypeWizDialogSetup, ImplModifiedHdl ) );
551 }
552
553 xPage->SetServiceFactory( m_pImpl->getORB() );
554 xPage->SetAdminDialog(this, this);
555
556 defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WizardButtonFlags::FINISH : WizardButtonFlags::NEXT );
557 enableButtons( WizardButtonFlags::FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL );
558 enableButtons( WizardButtonFlags::NEXT, _nState != PAGE_DBSETUPWIZARD_FINAL );
559
560 m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState));
561 }
562 return xPage;
563}
564
565IMPL_LINK(ODbTypeWizDialogSetup, ImplModifiedHdl, OGenericAdministrationPage const *, _pConnectionPageSetup, void)
566{
567 m_bIsConnectable = _pConnectionPageSetup->GetRoadmapStateValue( );
568 enableState(PAGE_DBSETUPWIZARD_FINAL, m_bIsConnectable);
569 enableState(PAGE_DBSETUPWIZARD_AUTHENTIFICATION, m_bIsConnectable);
570 if (getCurrentState() == PAGE_DBSETUPWIZARD_FINAL)
571 enableButtons( WizardButtonFlags::FINISH, true);
572 else
573 enableButtons( WizardButtonFlags::FINISH, m_bIsConnectable);
574 enableButtons( WizardButtonFlags::NEXT, m_bIsConnectable && (getCurrentState() != PAGE_DBSETUPWIZARD_FINAL));
575}
576
577IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, _pMySQLIntroPageSetup, void)
578{
579 OUString sURLPrefix;
580 switch( _pMySQLIntroPageSetup->getMySQLMode() )
581 {
583 sURLPrefix = "sdbc:mysql:odbc:";
584 break;
586 sURLPrefix = "sdbc:mysql:jdbc:";
587 break;
589 sURLPrefix = "sdbc:mysql:mysqlc:";
590 break;
591 }
592 activatePath( static_cast<PathId>(m_pCollection->getIndexOf(sURLPrefix) + 1), true);
593}
594
596{
597 activateDatabasePath();
598}
599
601{
602 enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocumentURL().isEmpty() );
603}
604
606{
607 if (prepareLeaveCurrentState(WizardTypes::eFinish))
608 onFinish();
609}
610
612{
615 switch(_nState)
616 {
619 break;
621 enableButtons( WizardButtonFlags::FINISH, true);
622 if ( m_pFinalPage )
624 break;
625 }
626}
627
629{
630 SfxTabPage* pPage = static_cast<SfxTabPage*>(GetPage(getCurrentState()));
631 if ( pPage )
632 pPage->FillItemSet(m_pOutSet.get());
633}
634
636{
637 if (_nState == PAGE_DBSETUPWIZARD_MYSQL_INTRO)
638 return true;
639 if ( _nState == PAGE_DBSETUPWIZARD_INTRO && m_sURL != m_sOldURL )
640 {
641 resetPages(m_pImpl->getCurrentDataSource());
642 }
643 SfxTabPage* pPage = static_cast<SfxTabPage*>(GetPage(_nState));
644 return pPage && pPage->DeactivatePage(m_pOutSet.get()) != DeactivateRC::KeepPage;
645}
646
647void ODbTypeWizDialogSetup::setTitle(const OUString& _sTitle)
648{
649 m_xAssistant->set_title(_sTitle);
650}
651
653{
654}
655
656namespace
657{
658 bool lcl_handle( const Reference< XInteractionHandler2 >& _rxHandler, const Any& _rRequest )
659 {
662 pRequest->addContinuation( pAbort );
663
664 return _rxHandler->handleInteractionRequest( pRequest );
665 }
666}
667
669{
670 Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(getORB(), nullptr) );
671 try
672 {
673 if (callSaveAsDialog())
674 {
675 m_pImpl->saveChanges(*m_pOutSet);
676 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
677 Reference< XModel > xModel( getDataSourceOrModel( xDatasource ), UNO_QUERY_THROW );
678 Reference< XStorable > xStore( xModel, UNO_QUERY_THROW );
679
682
683 ::comphelper::NamedValueCollection aArgs( xModel->getArgs() );
684 aArgs.put( "Overwrite", true );
685 aArgs.put( "InteractionHandler", xHandler );
686 aArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG );
687 aArgs.put( "IgnoreFirebirdMigration", true );
688
690 xStore->storeAsURL( sPath, aArgs.getPropertyValues() );
691
694
695 return true;
696 }
697 }
698 catch ( const Exception& e )
699 {
700 Any aError = ::cppu::getCaughtException();
701 if ( xHandler.is() )
702 {
703 if ( !lcl_handle( xHandler, aError ) )
704 {
705 InteractiveIOException aRequest;
706 aRequest.Classification = InteractionClassification_ERROR;
707 if ( aError.isExtractableTo( ::cppu::UnoType< IOException >::get() ) )
708 // assume saving the document failed
709 aRequest.Code = IOErrorCode_CANT_WRITE;
710 else
711 aRequest.Code = IOErrorCode_GENERAL;
712 aRequest.Message = e.Message;
713 aRequest.Context = e.Context;
714 lcl_handle( xHandler, Any( aRequest ) );
715 }
716 }
717 }
718 return false;
719}
720
722 {
724 return true;
725
726 if ( m_pFinalPage != nullptr )
728
729 return true;
730 }
731
733 {
735 return false;
736
737 if ( m_pFinalPage != nullptr )
739
740 return false;
741 }
742
744 {
745 OUString sUrl;
746 const OUString eType = m_pGeneralPage->GetSelectedType();
748 {
749 sUrl = eType;
750 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
751 OSL_ENSURE(xDatasource.is(),"DataSource is null!");
752 if ( xDatasource.is() )
753 xDatasource->setPropertyValue( PROPERTY_INFO, Any( m_pCollection->getDefaultDBSettings( eType ) ) );
754 m_pImpl->translateProperties(xDatasource,*m_pOutSet);
755 }
757 {
758 Reference< XSimpleFileAccess3 > xSimpleFileAccess(ucb::SimpleFileAccess::create(getORB()));
759 INetURLObject aDBPathURL(m_sWorkPath);
760 aDBPathURL.Append(m_aDocURL.getBase());
761 createUniqueFolderName(&aDBPathURL);
763 xSimpleFileAccess->createFolder(sUrl);
764 sUrl = eType + sUrl;
765 }
767 m_pImpl->saveChanges(*m_pOutSet);
768 }
769
771 {
772 Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
773 Reference< XDatabaseContext > xDatabaseContext( DatabaseContext::create(getORB()) );
774 INetURLObject aURL( _sPath );
776 OUString sDatabaseName = ::dbtools::createUniqueName(xDatabaseContext, sFilename, false);
777 xDatabaseContext->registerObject(sDatabaseName, xDatasource);
778 }
779
781 {
782 bool bRet = false;
784 ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
785 FileDialogFlags::NONE, m_xAssistant.get());
787 std::shared_ptr<const SfxFilter> pFilter = getStandardDatabaseFilter();
788 if ( pFilter )
789 {
790 OUString sDefaultName = DBA_RES( STR_DATABASEDEFAULTNAME );
791 OUString sExtension = pFilter->GetDefaultExtension();
792 sDefaultName += sExtension.replaceAt( 0, 1, u"" );
793 INetURLObject aWorkURL( m_sWorkPath );
794 aWorkURL.Append( sDefaultName );
795 sDefaultName = createUniqueFileName( aWorkURL );
796 aFileDlg.SetFileName( sDefaultName );
797
798 aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension());
799 aFileDlg.SetCurrentFilter(pFilter->GetUIName());
800 }
801 if ( aFileDlg.Execute() == ERRCODE_NONE )
802 {
803 m_aDocURL = INetURLObject(aFileDlg.GetPath());
804
805 if( m_aDocURL.GetProtocol() != INetProtocol::NotValid )
806 {
808 if ( ::utl::UCBContentHelper::IsDocument(sFileName) )
809 ::utl::UCBContentHelper::Kill(sFileName);
810 m_pOutSet->Put(SfxStringItem(DSID_DOCUMENT_URL, sFileName));
811 bRet = true;
812 }
813 }
814 return bRet;
815 }
816
818 {
819 Reference< XSimpleFileAccess3 > xSimpleFileAccess(ucb::SimpleFileAccess::create(getORB()));
820 OUString sLastSegmentName = pURL->getName();
821 bool bFolderExists = true;
822 sal_Int32 i = 1;
823 while (bFolderExists)
824 {
825 bFolderExists = xSimpleFileAccess->isFolder(pURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ));
826 if (bFolderExists)
827 {
828 i++;
829 pURL->setName(Concat2View(sLastSegmentName + OUString::number(i)));
830 }
831 }
832 }
833
835 {
836 Reference< XSimpleFileAccess3 > xSimpleFileAccess(ucb::SimpleFileAccess::create(getORB()));
837 OUString BaseName = _rURL.getBase();
838
839 bool bElementExists = true;
840
841 INetURLObject aExistenceCheck( _rURL );
842 for ( sal_Int32 i = 1; bElementExists; )
843 {
844 bElementExists = xSimpleFileAccess->exists( aExistenceCheck.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
845 if ( bElementExists )
846 {
847 aExistenceCheck.setBase( Concat2View(BaseName + OUString::number( i ) ));
848 ++i;
849 }
850 }
852 }
853
854 vcl::IWizardPageController* ODbTypeWizDialogSetup::getPageController(BuilderPage* pCurrentPage) const
855 {
856 OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(pCurrentPage);
857 return pPage;
858 }
859
860 namespace
861 {
862 typedef ::cppu::WeakImplHelper< XTerminateListener
863 > AsyncLoader_Base;
864 class AsyncLoader : public AsyncLoader_Base
865 {
866 private:
870 OUString m_sURL;
871 OAsynchronousLink m_aAsyncCaller;
872
873 public:
874 AsyncLoader( const Reference< XComponentContext >& _xORB, OUString _aURL );
875
876 void doLoadAsync();
877
878 // XTerminateListener
879 virtual void SAL_CALL queryTermination( const css::lang::EventObject& Event ) override;
880 virtual void SAL_CALL notifyTermination( const css::lang::EventObject& Event ) override;
881 // XEventListener
882 virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
883
884 private:
885 DECL_LINK( OnOpenDocument, void*, void );
886 };
887
888 AsyncLoader::AsyncLoader( const Reference< XComponentContext >& _rxORB, OUString _aURL )
889 :m_sURL(std::move( _aURL ))
890 ,m_aAsyncCaller( LINK( this, AsyncLoader, OnOpenDocument ) )
891 {
892 try
893 {
894 m_xDesktop.set( Desktop::create(_rxORB) );
895 m_xFrameLoader.set( m_xDesktop, UNO_QUERY_THROW );
896 m_xInteractionHandler = InteractionHandler::createWithParent(_rxORB, nullptr);
897 }
898 catch( const Exception& )
899 {
900 DBG_UNHANDLED_EXCEPTION("dbaccess");
901 }
902 }
903
904 void AsyncLoader::doLoadAsync()
905 {
906 OSL_ENSURE( !m_aAsyncCaller.IsRunning(), "AsyncLoader:doLoadAsync: already running!" );
907
908 acquire();
909 try
910 {
911 if ( m_xDesktop.is() )
912 m_xDesktop->addTerminateListener( this );
913 }
914 catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); }
915
916 m_aAsyncCaller.Call();
917 }
918
919 IMPL_LINK_NOARG( AsyncLoader, OnOpenDocument, void*, void )
920 {
921 try
922 {
923 if ( m_xFrameLoader.is() )
924 {
926 aLoadArgs.put( "InteractionHandler", m_xInteractionHandler );
927 aLoadArgs.put( "MacroExecutionMode", MacroExecMode::USE_CONFIG );
928
929 Sequence< PropertyValue > aLoadArgPV;
930 aLoadArgs >>= aLoadArgPV;
931
932 m_xFrameLoader->loadComponentFromURL( m_sURL,
933 "_default",
934 FrameSearchFlag::ALL,
935 aLoadArgPV
936 );
937 }
938 }
939 catch( const Exception& )
940 {
941 // do not assert.
942 // Such an exception happens for instance of the to-be-loaded document does not exist anymore.
943 }
944
945 try
946 {
947 if ( m_xDesktop.is() )
948 m_xDesktop->removeTerminateListener( this );
949 }
950 catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); }
951
952 release();
953 }
954
955 void SAL_CALL AsyncLoader::queryTermination( const css::lang::EventObject& /*Event*/ )
956 {
957 throw TerminationVetoException();
958 }
959
960 void SAL_CALL AsyncLoader::notifyTermination( const css::lang::EventObject& /*Event*/ )
961 {
962 }
963 void SAL_CALL AsyncLoader::disposing( const css::lang::EventObject& /*Source*/ )
964 {
965 }
966 }
967
968 bool ODbTypeWizDialogSetup::onFinish()
969 {
970 if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPageWizard::eOpenExisting )
971 {
972 // we're not going to re-use the XModel we have - since the document the user
973 // wants us to load could be a non-database document. Instead, we asynchronously
974 // open the selected document. Thus, the wizard's return value is RET_CANCEL,
975 // which means to not continue loading the database document
976 if ( !WizardMachine::Finish() )
977 return false;
978
979 try
980 {
981 rtl::Reference<AsyncLoader> pAsyncLoader = new AsyncLoader( getORB(), m_pGeneralPage->GetSelectedDocumentURL() );
982 pAsyncLoader->doLoadAsync();
983 }
984 catch( const Exception& )
985 {
986 DBG_UNHANDLED_EXCEPTION("dbaccess");
987 }
988
989 return true;
990 }
991
992 if (getCurrentState() != PAGE_DBSETUPWIZARD_FINAL)
993 {
994 skipUntil(PAGE_DBSETUPWIZARD_FINAL);
995 }
996 if (getCurrentState() == PAGE_DBSETUPWIZARD_FINAL)
997 return SaveDatabaseDocument() && WizardMachine::onFinish();
998 else
999 {
1000 enableButtons( WizardButtonFlags::FINISH, false );
1001 return false;
1002 }
1003 }
1004
1005} // namespace dbaui
1006
1007/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString getName(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
OUString getBase(sal_Int32 nIndex=LAST_SEGMENT, bool bIgnoreFinalSlash=true, DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool setBase(std::u16string_view rTheBase, sal_Int32 nIndex=LAST_SEGMENT, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool setName(std::u16string_view rTheName, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
INetProtocol GetProtocol() const
bool Append(std::u16string_view rTheSegment, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
bool IsVisible() const
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet)
virtual bool FillItemSet(SfxItemSet *)
bool remove(const OUString &_rValueName)
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::NamedValue > getNamedValues() const
NamedValueCollection & merge(const NamedValueCollection &_rAdditionalValues, bool _bOverwriteExisting)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
DATASOURCE_TYPE determineType(std::u16string_view _rDsn) const
Definition: dsntypes.cxx:299
TypeIterator end() const
get access to the (last + 1st) element of the types collection
Definition: dsntypes.hxx:217
bool supportsTableCreation(std::u16string_view _sURL) const
check if the given data source allows creation of tables
Definition: dsntypes.cxx:255
bool isFileSystemBased(std::u16string_view _sURL) const
check if the given data source type is based on the file system - i.e. the URL is a prefix plus a fil...
Definition: dsntypes.cxx:249
static bool isEmbeddedDatabase(std::u16string_view _sURL)
checks if the given data source type embeds its data into the database document
Definition: dsntypes.cxx:285
OUString getPrefix(std::u16string_view _sURL) const
on a given string, return the type prefix
Definition: dsntypes.cxx:110
void fillPageIds(std::u16string_view _sURL, std::vector< sal_Int16 > &_rOutPathIds) const
Definition: dsntypes.cxx:413
TypeIterator begin() const
get access to the first element of the types collection
Definition: dsntypes.hxx:216
sal_Int32 size() const
Definition: dsntypes.cxx:514
css::uno::Sequence< css::beans::PropertyValue > getDefaultDBSettings(std::u16string_view _sURL) const
returns default settings for newly created databases of the given type.
Definition: dsntypes.cxx:279
bool isConnectionUrlRequired(std::u16string_view _sURL) const
Definition: dsntypes.cxx:137
sal_Int32 getIndexOf(std::u16string_view _sURL) const
Definition: dsntypes.cxx:495
TypeIterator(const TypeIterator &_rSource)
static AuthenticationMode getAuthentication(const OUString &_sURL)
determines whether or not the data source requires authentication
Definition: dsmeta.cxx:158
allows an ODsnTypeCollection to be transported in an SfxItemSet
Definition: dsnItem.hxx:34
::dbaccess::ODsnTypeCollection * getCollection() const
Definition: dsnItem.hxx:44
static std::unique_ptr< OGenericAdministrationPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateAuthentificationTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateADOTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateUserDefinedTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateDbaseTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateODBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateMSAccessTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
std::map< sal_Int32, OUString > MapInt2String
Definition: DbAdminImpl.hxx:52
static OUString getDocumentUrl(SfxItemSet const &_rDest)
static OUString getDatasourceType(const SfxItemSet &_rSet)
extracts the connection type from the given setThe connection type is determined by the value of the ...
virtual void clearPassword() override
Definition: dbwizsetup.cxx:438
virtual OUString getStateDisplayName(WizardState _nState) const override
Definition: dbwizsetup.cxx:187
void SetFinalPage(OFinalDBPageSetup *pPage)
Definition: dbwizsetup.cxx:458
OUString createUniqueFileName(const INetURLObject &rURL)
Definition: dbwizsetup.cxx:834
bool IsTableWizardToBeStarted() const
returns <TRUE> if the table wizard should be opened, otherwise <FALSE>.
Definition: dbwizsetup.cxx:732
virtual const SfxItemSet * getOutputSet() const override
Definition: dbwizsetup.cxx:371
virtual bool leaveState(WizardState _nState) override
Definition: dbwizsetup.cxx:635
void SetGeneralPage(OGeneralPageWizard *pPage)
Definition: dbwizsetup.cxx:449
virtual css::uno::Reference< css::uno::XComponentContext > getORB() const override
Definition: dbwizsetup.cxx:386
virtual css::uno::Reference< css::sdbc::XDriver > getDriver() override
Definition: dbwizsetup.cxx:391
OGeneralPageWizard * m_pGeneralPage
Definition: dbwizsetup.hxx:82
virtual std::unique_ptr< BuilderPage > createPage(WizardState _nState) override
to override to create new pages
Definition: dbwizsetup.cxx:463
virtual SfxItemSet * getWriteOutputSet() override
Definition: dbwizsetup.cxx:376
::dbaccess::ODsnTypeCollection * m_pCollection
Definition: dbwizsetup.hxx:87
void declareAuthDepPath(const OUString &_sURL, PathId _nPathId, const vcl::RoadmapWizardTypes::WizardPath &_rPaths)
declares a path with or without authentication, as indicated by the database type
Definition: dbwizsetup.cxx:170
virtual void enableConfirmSettings(bool _bEnable) override
enables or disables the user's possibility to confirm the settings
Definition: dbwizsetup.cxx:652
void resetPages(const css::uno::Reference< css::beans::XPropertySet > &_rxDatasource)
Definition: dbwizsetup.cxx:357
virtual void saveDatasource() override
Definition: dbwizsetup.cxx:628
virtual void setTitle(const OUString &_sTitle) override
Definition: dbwizsetup.cxx:647
virtual std::pair< css::uno::Reference< css::sdbc::XConnection >, bool > createConnection() override
Definition: dbwizsetup.cxx:381
virtual ~ODbTypeWizDialogSetup() override
Definition: dbwizsetup.cxx:253
std::unique_ptr< SfxItemSet > m_pOutSet
Definition: dbwizsetup.hxx:61
virtual OUString getDatasourceType(const SfxItemSet &_rSet) const override
Definition: dbwizsetup.cxx:417
OFinalDBPageSetup * m_pFinalPage
Definition: dbwizsetup.hxx:84
ODbTypeWizDialogSetup(weld::Window *pParent, SfxItemSet const *_pItems, const css::uno::Reference< css::uno::XComponentContext > &_rxORB, const css::uno::Any &_aDataSourceName)
the DSN type collection instance
Definition: dbwizsetup.cxx:92
OMySQLIntroPageSetup * m_pMySQLIntroPage
Definition: dbwizsetup.hxx:83
bool IsDatabaseDocumentToBeOpened() const
returns <TRUE> if the database should be opened, otherwise <FALSE>.
Definition: dbwizsetup.cxx:721
virtual void enterState(WizardState _nState) override
Definition: dbwizsetup.cxx:611
void RegisterDataSourceByLocation(std::u16string_view sPath)
Definition: dbwizsetup.cxx:770
void SetIntroPage(OMySQLIntroPageSetup *pPage)
Definition: dbwizsetup.cxx:443
virtual ::vcl::IWizardPageController * getPageController(BuilderPage *pCurrentPage) const override
Definition: dbwizsetup.cxx:854
::dbaccess::DATASOURCE_TYPE VerifyDataSourceType(const ::dbaccess::DATASOURCE_TYPE DatabaseType) const
Definition: dbwizsetup.cxx:396
OUString m_sRM_DocumentOrSpreadSheetText
Definition: dbwizsetup.hxx:77
void createUniqueFolderName(INetURLObject *pURL)
Definition: dbwizsetup.cxx:817
std::unique_ptr< ODbDataSourceAdministrationHelper > m_pImpl
Definition: dbwizsetup.hxx:60
void enableTableWizardCheckBox(bool _bSupportsTableCreation)
static std::unique_ptr< OGenericAdministrationPage > CreateFinalDBTabPageSetup(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &_rAttrSet)
CreationMode GetDatabaseCreationMode() const
OUString GetSelectedDocumentURL() const
void SetChooseDocumentHandler(const Link< OGeneralPageWizard &, void > &_rHandler)
void SetDocumentSelectionHandler(const Link< OGeneralPageWizard &, void > &_rHandler)
void SetCreationModeHandler(const Link< OGeneralPageWizard &, void > &_rHandler)
void SetTypeSelectHandler(const Link< OGeneralPage &, void > &_rHandler)
set a handler which gets called every time the user selects a new type
Definition: generalpage.hxx:65
const OUString & GetSelectedType() const
get the currently selected datasource type
Definition: generalpage.hxx:68
static std::unique_ptr< OGenericAdministrationPage > CreateOracleJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateMySQLJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateLDAPTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
void SetClickHdl(const Link< OMySQLIntroPageSetup *, void > &rLink)
static std::unique_ptr< OMySQLIntroPageSetup > CreateMySQLIntroTabPage(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreatePostgresTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateDocumentOrSpreadSheetTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
static std::unique_ptr< OGenericAdministrationPage > CreateTextTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
OUString GetPath() const
void AddFilter(const OUString &rFilterName, const OUString &rExtension)
void SetFileName(const OUString &_rFileName)
void SetCurrentFilter(const OUString &rFilter)
void SetContext(Context _eNewContext)
void SetRoadmapHelpId(const OUString &_rId)
void declarePath(RoadmapWizardTypes::PathId _nPathId, const RoadmapWizardTypes::WizardPath &_lWizardStates)
void activatePath(RoadmapWizardTypes::PathId _nPathId, bool _bDecideForIt=false)
virtual void enterState(WizardTypes::WizardState nState) override
void enableState(WizardTypes::WizardState nState, bool _bEnable=true)
std::unique_ptr< weld::Button > m_xNextPage
std::unique_ptr< weld::Button > m_xCancel
void defaultButton(WizardButtonFlags _nWizardButtonFlags)
void enableAutomaticNextButtonState()
std::unique_ptr< weld::Button > m_xPrevPage
virtual void ActivatePage()
void enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable)
std::unique_ptr< weld::Button > m_xHelp
std::unique_ptr< weld::Button > m_xFinish
WizardTypes::WizardState getCurrentState() const
void setTitleBase(const OUString &_rTitleBase)
BuilderPage * GetPage(WizardTypes::WizardState eState) const
std::unique_ptr< weld::Assistant > m_xAssistant
#define DBA_RES(id)
Reference< XComponentLoader > m_xFrameLoader
Definition: dbwizsetup.cxx:867
OUString m_sURL
Definition: dbwizsetup.cxx:870
Reference< XDesktop2 > m_xDesktop
Definition: dbwizsetup.cxx:868
OAsynchronousLink m_aAsyncCaller
Definition: dbwizsetup.cxx:871
Reference< XInteractionHandler2 > m_xInteractionHandler
Definition: dbwizsetup.cxx:869
#define DBG_UNHANDLED_EXCEPTION(...)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
#define DSID_DOCUMENT_URL
Definition: dsitems.hxx:82
#define DSID_CONNECTURL
Definition: dsitems.hxx:36
#define DSID_TYPECOLLECTION
Definition: dsitems.hxx:38
#define PAGE_DBSETUPWIZARD_ADO
Definition: dsntypes.hxx:94
#define PAGE_DBSETUPWIZARD_MYSQL_INTRO
Definition: dsntypes.hxx:89
#define PAGE_DBSETUPWIZARD_MYSQL_NATIVE
Definition: dsntypes.hxx:100
#define PAGE_DBSETUPWIZARD_MSACCESS
Definition: dsntypes.hxx:86
#define PAGE_DBSETUPWIZARD_POSTGRES
Definition: dsntypes.hxx:101
#define PAGE_DBSETUPWIZARD_JDBC
Definition: dsntypes.hxx:93
#define PAGE_DBSETUPWIZARD_MYSQL_JDBC
Definition: dsntypes.hxx:90
#define PAGE_DBSETUPWIZARD_DOCUMENT_OR_SPREADSHEET
Definition: dsntypes.hxx:96
#define PAGE_DBSETUPWIZARD_LDAP
Definition: dsntypes.hxx:87
#define PAGE_DBSETUPWIZARD_DBASE
Definition: dsntypes.hxx:84
#define PAGE_DBSETUPWIZARD_MYSQL_ODBC
Definition: dsntypes.hxx:91
#define PAGE_DBSETUPWIZARD_AUTHENTIFICATION
Definition: dsntypes.hxx:97
#define PAGE_DBSETUPWIZARD_USERDEFINED
Definition: dsntypes.hxx:99
#define PAGE_DBSETUPWIZARD_INTRO
Definition: dsntypes.hxx:83
#define PAGE_DBSETUPWIZARD_TEXT
Definition: dsntypes.hxx:85
#define PAGE_DBSETUPWIZARD_ODBC
Definition: dsntypes.hxx:95
#define PAGE_DBSETUPWIZARD_ORACLE
Definition: dsntypes.hxx:92
#define PAGE_DBSETUPWIZARD_FINAL
Definition: dsntypes.hxx:98
float u
#define ERRCODE_NONE
OUString eType
Definition: generalpage.cxx:78
constexpr OUStringLiteral HID_DBWIZ_NEXT
Definition: helpids.h:104
constexpr OUStringLiteral HID_DBWIZ_CANCEL
Definition: helpids.h:105
constexpr OUStringLiteral HID_DBWIZ_HELP
Definition: helpids.h:107
constexpr OUStringLiteral HID_DBWIZ_PREVIOUS
Definition: helpids.h:103
constexpr OUStringLiteral HID_DBWIZ_ROADMAP
Definition: helpids.h:109
constexpr OUStringLiteral HID_DBWIZ_FINISH
Definition: helpids.h:106
URL aURL
Definition: intercept.cxx:87
@ Exception
DATASOURCE_TYPE
known datasource types
Definition: dsntypes.hxx:36
@ DST_MYSQL_JDBC
Definition: dsntypes.hxx:39
@ DST_MYSQL_ODBC
Definition: dsntypes.hxx:38
@ DST_MYSQL_NATIVE
Definition: dsntypes.hxx:60
@ DST_UNKNOWN
unrecognized type
Definition: dsntypes.hxx:80
void convert(const css::uno::Reference< css::uno::XComponentContext > &xContext, const ::dbaccess::ODsnTypeCollection *_pCollection, std::u16string_view _sOldURLPrefix, std::u16string_view _sNewURLPrefix, const css::uno::Reference< css::beans::XPropertySet > &_xDatasource)
static void lcl_removeUnused(const ::comphelper::NamedValueCollection &_aOld, const ::comphelper::NamedValueCollection &_aNew,::comphelper::NamedValueCollection &_rDSInfo)
Definition: dbwizsetup.cxx:262
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
@ AuthNone
Definition: dsmeta.hxx:38
IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnSingleDocumentChosen, OGeneralPageWizard &, void)
Definition: dbwizsetup.cxx:605
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
css::uno::Reference< css::uno::XInterface > getDataSourceOrModel(const css::uno::Reference< css::uno::XInterface > &_xObject)
returns either the model when data source is given as parameter, or returns a data source when a mode...
std::shared_ptr< const SfxFilter > getStandardDatabaseFilter()
returns the standard database filter
Definition: UITools.cxx:861
int i
sal_Int16 PathId
::std::vector< WizardTypes::WizardState > WizardPath
sal_Int16 WizardState
constexpr OUStringLiteral PROPERTY_INFO(u"Info")
Reference< XModel > xModel
the model of the sub component. Might be <NULL>