LibreOffice Module dbaccess (master) 1
DBSetupConnectionPages.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 <config_java.h>
21
23#include <core_resource.hxx>
24#include <sqlmessage.hxx>
25#include <strings.hrc>
26#include <svl/itemset.hxx>
27#include <svl/stritem.hxx>
28#include <svl/eitem.hxx>
29#include <svl/intitem.hxx>
30#include <dsitems.hxx>
31#include "dsnItem.hxx"
32
33#if HAVE_FEATURE_JAVA
35#endif
36
38#include <dbwizsetup.hxx>
40#include <osl/diagnose.h>
41
42#include <IItemSetHelper.hxx>
43#include <comphelper/string.hxx>
44
45namespace dbaui
46{
47using namespace ::com::sun::star;
48
49 std::unique_ptr<OGenericAdministrationPage> OTextConnectionPageSetup::CreateTextTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
50 {
51 return std::make_unique<OTextConnectionPageSetup>(pPage, pController, _rAttrSet);
52 }
53
54 // OTextConnectionPageSetup
56 : OConnectionTabPageSetup(pPage, pController, "dbaccess/ui/dbwiztextpage.ui", "DBWizTextPage",
57 rCoreAttrs, STR_TEXT_HELPTEXT, STR_TEXT_HEADERTEXT, STR_TEXT_PATH_OR_FILE)
58 , m_xSubContainer(m_xBuilder->weld_widget("TextPageContainer"))
59 , m_xTextConnectionHelper(new OTextConnectionHelper(m_xSubContainer.get(), TC_EXTENSION | TC_SEPARATORS))
60 {
61 m_xTextConnectionHelper->SetClickHandler(LINK( this, OTextConnectionPageSetup, ImplGetExtensionHdl ) );
62 }
63
65 {
67 }
68
70 {
71 SetRoadmapStateValue(!m_xTextConnectionHelper->GetExtension().isEmpty() && OConnectionTabPageSetup::checkTestConnection());
72 callModifiedHdl();
73 }
74
76 {
78 bDoEnable = !m_xTextConnectionHelper->GetExtension().isEmpty() && bDoEnable;
79 return bDoEnable;
80 }
81
82 void OTextConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
83 {
85 m_xTextConnectionHelper->fillControls(_rControlList);
86 }
87
88 void OTextConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
89 {
91 m_xTextConnectionHelper->fillWindows(_rControlList);
92 }
93
94 void OTextConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
95 {
96 // first check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
97 bool bValid, bReadonly;
98 getFlags(_rSet, bValid, bReadonly);
100 m_xTextConnectionHelper->implInitControls(_rSet, bValid);
101 }
102
104 {
105 bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
106 bChangedSomething = m_xTextConnectionHelper->FillItemSet(*_rSet, bChangedSomething);
107 return bChangedSomething;
108 }
109
111 {
112 return m_xTextConnectionHelper->prepareLeave();
113 }
114
115 std::unique_ptr<OGenericAdministrationPage> OLDAPConnectionPageSetup::CreateLDAPTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet )
116 {
117 return std::make_unique<OLDAPConnectionPageSetup>(pPage, pController, _rAttrSet);
118 }
119
120 // OLDAPPageSetup
122 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/ldapconnectionpage.ui", "LDAPConnectionPage", _rCoreAttrs)
123 , m_xFTHelpText(m_xBuilder->weld_label("helpLabel"))
124 , m_xFTHostServer(m_xBuilder->weld_label("hostNameLabel"))
125 , m_xETHostServer(m_xBuilder->weld_entry("hostNameEntry"))
126 , m_xFTBaseDN(m_xBuilder->weld_label("baseDNLabel"))
127 , m_xETBaseDN(m_xBuilder->weld_entry("baseDNEntry"))
128 , m_xFTPortNumber(m_xBuilder->weld_label("portNumLabel"))
129 , m_xNFPortNumber(m_xBuilder->weld_spin_button("portNumEntry"))
130 , m_xFTDefaultPortNumber(m_xBuilder->weld_label("portNumDefLabel"))
131 , m_xCBUseSSL(m_xBuilder->weld_check_button("useSSLCheckbutton"))
132 {
133 m_xETHostServer->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
134 m_xETBaseDN->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
135 m_xNFPortNumber->connect_value_changed(LINK(this, OGenericAdministrationPage, OnControlSpinButtonModifyHdl));
136 m_xCBUseSSL->connect_toggled( LINK(this, OGenericAdministrationPage, OnControlModifiedButtonClick) );
138 }
139
141 {
142 }
143
145 {
146 bool bChangedSomething = false;
147 fillString(*_rSet,m_xETBaseDN.get(),DSID_CONN_LDAP_BASEDN, bChangedSomething);
148 fillInt32(*_rSet,m_xNFPortNumber.get(),DSID_CONN_LDAP_PORTNUMBER,bChangedSomething);
149
150 if ( m_xETHostServer->get_value_changed_from_saved() )
151 {
152 const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet->GetItem(DSID_TYPECOLLECTION) );
153 ::dbaccess::ODsnTypeCollection* pCollection = nullptr;
154 if (pCollectionItem)
155 pCollection = pCollectionItem->getCollection();
156 OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !");
157 if (pCollection)
158 {
159 OUString sUrl = pCollection->getPrefix( u"sdbc:address:ldap:") + m_xETHostServer->get_text();
160 _rSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl));
161 bChangedSomething = true;
162 }
163 }
164
165 fillBool(*_rSet,m_xCBUseSSL.get(),DSID_CONN_LDAP_USESSL,false,bChangedSomething);
166 return bChangedSomething;
167 }
168 void OLDAPConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
169 {
170 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETHostServer.get()));
171 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETBaseDN.get()));
172 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
173 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xCBUseSSL.get()));
174 }
175 void OLDAPConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
176 {
177 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHelpText.get()));
178 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHostServer.get()));
179 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTBaseDN.get()));
180 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTPortNumber.get()));
181 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTDefaultPortNumber.get()));
182 }
183 void OLDAPConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
184 {
185 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
186 bool bValid, bReadonly;
187 getFlags(_rSet, bValid, bReadonly);
188
190 const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(DSID_CONN_LDAP_PORTNUMBER);
191
192 if ( bValid )
193 {
194 m_xETBaseDN->set_text(pBaseDN->GetValue());
195 m_xNFPortNumber->set_value(pPortNumber->GetValue());
196 }
199 }
200
202 {
203 bool bRoadmapState = ((!m_xETHostServer->get_text().isEmpty() ) && ( !m_xETBaseDN->get_text().isEmpty() ) && (!m_xFTPortNumber->get_label().isEmpty() ));
204 SetRoadmapStateValue(bRoadmapState);
206 }
207
208 std::unique_ptr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& rAttrSet)
209 {
210 return std::make_unique<OMySQLIntroPageSetup>(pPage, pController, rAttrSet);
211 }
212
214 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/dbwizmysqlintropage.ui", "DBWizMysqlIntroPage", _rCoreAttrs)
215 , m_xODBCDatabase(m_xBuilder->weld_radio_button("odbc"))
216 , m_xJDBCDatabase(m_xBuilder->weld_radio_button("jdbc"))
217 , m_xNATIVEDatabase(m_xBuilder->weld_radio_button("directly"))
218 {
219 m_xODBCDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
220 m_xJDBCDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
221 m_xNATIVEDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected));
222 pController->SetIntroPage(this);
223 }
224
226 {
227 }
228
230 {
231 maClickHdl.Call( this );
232 }
233
234 void OMySQLIntroPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
235 {
236 // show the "Connect directly" option only if the driver is installed
237 const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet.GetItem(DSID_TYPECOLLECTION) );
238 bool bHasMySQLNative = ( pCollectionItem != nullptr ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysql:mysqlc:" );
239 if ( bHasMySQLNative )
240 m_xNATIVEDatabase->show();
241
242 // if any of the options is checked, then there's nothing to do
243 if ( m_xODBCDatabase->get_active() || m_xJDBCDatabase->get_active() || m_xNATIVEDatabase->get_active() )
244 return;
245
246 // prefer "native" or "JDBC"
247 if ( bHasMySQLNative )
248 m_xNATIVEDatabase->set_active(true);
249 else
250 m_xJDBCDatabase->set_active(true);
251 }
252
253 void OMySQLIntroPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
254 {
255 }
256
257 void OMySQLIntroPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
258 {
259 }
260
262 {
263 OSL_FAIL("Who called me?! Please ask oj for more information.");
264 return true;
265 }
266
268 {
269 if (m_xJDBCDatabase->get_active())
270 return VIA_JDBC;
271 else if (m_xNATIVEDatabase->get_active())
272 return VIA_NATIVE;
273 else
274 return VIA_ODBC;
275 }
276
277 // MySQLNativeSetupPage
279 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/dbwizmysqlnativepage.ui", "DBWizMysqlNativePage", rCoreAttrs)
280 , m_xHelpText(m_xBuilder->weld_label("helptext"))
281 , m_xSettingsContainer(m_xBuilder->weld_container("MySQLSettingsContainer"))
282 , m_xMySQLSettings(new MySQLNativeSettings(m_xSettingsContainer.get(), LINK(this, OGenericAdministrationPage, OnControlModified)))
283 {
285 }
286
288 {
289 m_xMySQLSettings.reset();
290 }
291
292 std::unique_ptr<OGenericAdministrationPage> MySQLNativeSetupPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet)
293 {
294 return std::make_unique<MySQLNativeSetupPage>(pPage, pController, rAttrSet);
295 }
296
297 void MySQLNativeSetupPage::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
298 {
299 m_xMySQLSettings->fillControls( _rControlList );
300 }
301
302 void MySQLNativeSetupPage::fillWindows(std::vector<std::unique_ptr<ISaveValueWrapper>>& rControlList)
303 {
304 rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xHelpText.get()));
305 m_xMySQLSettings->fillWindows(rControlList);
306 }
307
309 {
310 return m_xMySQLSettings->FillItemSet( _rSet );
311 }
312
313 void MySQLNativeSetupPage::implInitControls( const SfxItemSet& _rSet, bool _bSaveValue )
314 {
315 m_xMySQLSettings->implInitControls( _rSet );
316
318
320 }
321
323 {
324 SetRoadmapStateValue( m_xMySQLSettings->canAdvance() );
325
327 }
328
329 // OMySQLJDBCConnectionPageSetup
330 OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, TranslateId pDefaultPortResId, TranslateId pHelpTextResId, TranslateId pHeaderTextResId, TranslateId pDriverClassId)
331 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/specialjdbcconnectionpage.ui", "SpecialJDBCConnectionPage", _rCoreAttrs)
332 , m_nPortId(_nPortId)
333 , m_xHeaderText(m_xBuilder->weld_label("header"))
334 , m_xFTHelpText(m_xBuilder->weld_label("helpLabel"))
335 , m_xFTDatabasename(m_xBuilder->weld_label("dbNameLabel"))
336 , m_xETDatabasename(m_xBuilder->weld_entry("dbNameEntry"))
337 , m_xFTHostname(m_xBuilder->weld_label("hostNameLabel"))
338 , m_xETHostname(m_xBuilder->weld_entry("hostNameEntry"))
339 , m_xFTPortNumber(m_xBuilder->weld_label("portNumLabel"))
340 , m_xFTDefaultPortNumber(m_xBuilder->weld_label("portNumDefLabel"))
341 , m_xNFPortNumber(m_xBuilder->weld_spin_button("portNumEntry"))
342 , m_xFTDriverClass(m_xBuilder->weld_label("jdbcDriverLabel"))
343 , m_xETDriverClass(m_xBuilder->weld_entry("jdbcDriverEntry"))
344 , m_xPBTestJavaDriver(m_xBuilder->weld_button("testDriverButton"))
345 {
346 m_xFTDriverClass->set_label(DBA_RES(pDriverClassId));
347
348 m_xFTDefaultPortNumber->set_label(DBA_RES(pDefaultPortResId));
349 OUString sHelpText = DBA_RES(pHelpTextResId);
350 m_xFTHelpText->set_label(sHelpText);
351 //TODO this code snippet is redundant
352 m_xHeaderText->set_label(DBA_RES(pHeaderTextResId));
353
354 m_xETDatabasename->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
355 m_xETHostname->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
356 m_xNFPortNumber->connect_value_changed(LINK(this, OGenericAdministrationPage, OnControlSpinButtonModifyHdl));
357
358 m_xETDriverClass->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
359 m_xPBTestJavaDriver->connect_clicked(LINK(this,OGeneralSpecialJDBCConnectionPageSetup,OnTestJavaClickHdl));
360
361 const SfxStringItem* pUrlItem = _rCoreAttrs.GetItem<SfxStringItem>(DSID_CONNECTURL);
363 ::dbaccess::ODsnTypeCollection* pTypeCollection = pTypesItem ? pTypesItem->getCollection() : nullptr;
364 if (pTypeCollection && pUrlItem && pUrlItem->GetValue().getLength() )
365 {
366 m_sDefaultJdbcDriverName = pTypeCollection->getJavaDriverClass(pUrlItem->GetValue());
367 }
368
370 }
371
373 {
374 }
375
376 std::unique_ptr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet )
377 {
378 return std::make_unique<OGeneralSpecialJDBCConnectionPageSetup>(pPage, pController,
379 _rAttrSet,
381 STR_MYSQL_DEFAULT,
382 STR_MYSQLJDBC_HELPTEXT,
383 STR_MYSQLJDBC_HEADERTEXT,
384 STR_MYSQL_DRIVERCLASSTEXT);
385 }
386
387 std::unique_ptr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet )
388 {
389 return std::make_unique<OGeneralSpecialJDBCConnectionPageSetup>(pPage, pController,
390 _rAttrSet,
392 STR_ORACLE_DEFAULT,
393 STR_ORACLE_HELPTEXT,
394 STR_ORACLE_HEADERTEXT,
395 STR_ORACLE_DRIVERCLASSTEXT);
396 }
397
398 void OGeneralSpecialJDBCConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
399 {
400 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETDatabasename.get()));
401 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETDriverClass.get()));
402 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETHostname.get()));
403 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
404 }
405
406 void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
407 {
408 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHelpText.get()));
409 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTDatabasename.get()));
410 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHostname.get()));
411 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTPortNumber.get()));
412 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTDefaultPortNumber.get()));
413 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTDriverClass.get()));
414 }
415
417 {
418 bool bChangedSomething = false;
419 fillString(*_rSet,m_xETDriverClass.get(),DSID_JDBCDRIVERCLASS,bChangedSomething);
420 fillString(*_rSet,m_xETHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
421 fillString(*_rSet,m_xETDatabasename.get(),DSID_DATABASENAME,bChangedSomething);
422 fillInt32(*_rSet,m_xNFPortNumber.get(),m_nPortId,bChangedSomething );
423 return bChangedSomething;
424 }
425
427 {
428 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
429 bool bValid, bReadonly;
430 getFlags(_rSet, bValid, bReadonly);
431
432 const SfxStringItem* pDatabaseName = _rSet.GetItem<SfxStringItem>(DSID_DATABASENAME);
434 const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
435 const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(m_nPortId);
436
437 if ( bValid )
438 {
439 m_xETDatabasename->set_text(pDatabaseName->GetValue());
440 m_xETDatabasename->save_value();
441
442 m_xETDriverClass->set_text(pDrvItem->GetValue());
443 m_xETDriverClass->save_value();
444
445 m_xETHostname->set_text(pHostName->GetValue());
446 m_xETHostname->save_value();
447
448 m_xNFPortNumber->set_value(pPortNumber->GetValue());
449 m_xNFPortNumber->save_value();
450 }
452
453 // to get the correct value when saveValue was called by base class
454 if ( o3tl::trim(m_xETDriverClass->get_text()).empty() )
455 {
457 m_xETDriverClass->save_value();
458 }
460
461 bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && (!m_xETHostname->get_text().isEmpty()) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !m_xETDriverClass->get_text().isEmpty() ));
462 SetRoadmapStateValue(bRoadmapState);
463 }
464
466 {
467 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
468
469 bool bSuccess = false;
470#if HAVE_FEATURE_JAVA
471 try
472 {
473 if ( !o3tl::trim(m_xETDriverClass->get_text()).empty() )
474 {
475// TODO change jvmaccess
476 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
477 m_xETDriverClass->set_text(m_xETDriverClass->get_text().trim()); // fdo#68341
478 bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_xETDriverClass->get_text());
479 }
480 }
481 catch(css::uno::Exception&)
482 {
483 }
484#endif
485 TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
486 const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
487 OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
488 aMsg.run();
489 }
490
492 {
493 if (pControl == m_xETDriverClass.get())
494 m_xPBTestJavaDriver->set_sensitive( !o3tl::trim(m_xETDriverClass->get_text()).empty() );
495 bool bRoadmapState = ((!m_xETDatabasename->get_text().isEmpty() ) && ( !m_xETHostname->get_text().isEmpty() ) && (!m_xNFPortNumber->get_text().isEmpty() ) && ( !o3tl::trim(m_xETDriverClass->get_text()).empty() ));
496 SetRoadmapStateValue(bRoadmapState);
498 }
499
500 std::unique_ptr<OGenericAdministrationPage> OJDBCConnectionPageSetup::CreateJDBCTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
501 {
502 return std::make_unique<OJDBCConnectionPageSetup>(pPage, pController, _rAttrSet);
503 }
504
505 // OPostgresConnectionPageSetup
507 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/postgrespage.ui", "SpecialPostgresPage", _rCoreAttrs)
508 , m_nPortId(_nPortId)
509 , m_xETDatabasename(m_xBuilder->weld_entry("dbNameEntry"))
510 , m_xETHostname(m_xBuilder->weld_entry("hostNameEntry"))
511 , m_xNFPortNumber(m_xBuilder->weld_spin_button("portNumEntry"))
512 , m_xConnectionURL(new OConnectionURLEdit(m_xBuilder->weld_entry("browseurl"), m_xBuilder->weld_label("browselabel")))
513 {
514 m_xETDatabasename->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
515 m_xETHostname->connect_changed(LINK(this, OGenericAdministrationPage, OnControlEntryModifyHdl));
516 m_xNFPortNumber->connect_value_changed(LINK(this, OGenericAdministrationPage, OnControlSpinButtonModifyHdl));
517 const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rCoreAttrs.GetItem(DSID_TYPECOLLECTION) );
518 if (pCollectionItem)
519 m_pCollection = pCollectionItem->getCollection();
520 OSL_ENSURE(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !");
521 m_xConnectionURL->SetTypeCollection(m_pCollection);
522
524 }
525
527 {
528 }
529
530 std::unique_ptr<OGenericAdministrationPage> OPostgresConnectionPageSetup::CreatePostgresTabPage( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet )
531 {
532 return std::make_unique<OPostgresConnectionPageSetup>(pPage, pController,
533 _rAttrSet,
535 }
536
537 void OPostgresConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
538 {
539 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETDatabasename.get()));
540 _rControlList.emplace_back( new OSaveValueWidgetWrapper<OConnectionURLEdit>( m_xConnectionURL.get() ) );
541 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETHostname.get()));
542 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
543 }
544
546 {
547 bool bChangedSomething = false;
548 fillString(*_rSet,m_xConnectionURL.get(), DSID_CONNECTURL, bChangedSomething);
549 fillString(*_rSet,m_xETHostname.get(),DSID_CONN_HOSTNAME,bChangedSomething);
550 fillString(*_rSet,m_xETDatabasename.get(),DSID_DATABASENAME,bChangedSomething);
551 fillInt32(*_rSet,m_xNFPortNumber.get(),m_nPortId,bChangedSomething );
552 return bChangedSomething;
553 }
554
555 void OPostgresConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
556 {
557 }
558
560 {
561 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
563 bool bValid, bReadonly;
564 getFlags(_rSet, bValid, bReadonly);
565
566 m_xConnectionURL->show();
567 m_xConnectionURL->ShowPrefix( false);
568
569 const SfxStringItem* pDatabaseName = _rSet.GetItem<SfxStringItem>(DSID_DATABASENAME);
570 const SfxStringItem* pUrlItem = _rSet.GetItem<SfxStringItem>(DSID_CONNECTURL);
571 const SfxStringItem* pHostName = _rSet.GetItem<SfxStringItem>(DSID_CONN_HOSTNAME);
572 const SfxInt32Item* pPortNumber = _rSet.GetItem<SfxInt32Item>(m_nPortId);
573
574 if ( bValid )
575 {
576 m_xETDatabasename->set_text(pDatabaseName->GetValue());
577 m_xETDatabasename->save_value();
578
579 OUString sUrl = pUrlItem->GetValue();
580 setURL( sUrl );
581 m_xConnectionURL->save_value();
582
583 m_xETHostname->set_text(pHostName->GetValue());
584 m_xETHostname->save_value();
585
586 m_xNFPortNumber->set_value(pPortNumber->GetValue());
587 m_xNFPortNumber->save_value();
588 }
589
591
593 }
594
596 {
597 return commitURL();
598 }
599
601 {
602 OUString sURL = m_xConnectionURL->GetTextNoPrefix();
603 setURLNoPrefix(sURL);
604 m_xConnectionURL->SaveValueNoPrefix();
605 return true;
606 }
607
608 void OPostgresConnectionPageSetup::impl_setURL( std::u16string_view _rURL, bool _bPrefix )
609 {
610 OUString sURL( comphelper::string::stripEnd(_rURL, '*') );
611 OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" );
612 if ( _bPrefix )
613 m_xConnectionURL->SetText( sURL );
614 else
615 m_xConnectionURL->SetTextNoPrefix( sURL );
616 }
617
618 void OPostgresConnectionPageSetup::setURLNoPrefix( std::u16string_view _rURL )
619 {
620 impl_setURL( _rURL,false);
621 }
622
623 void OPostgresConnectionPageSetup::setURL( std::u16string_view _rURL )
624 {
625 impl_setURL( _rURL, true);
626 }
627
628 // OMySQLJDBCConnectionPageSetup
630 : OConnectionTabPageSetup(pPage, pController, "dbaccess/ui/jdbcconnectionpage.ui", "JDBCConnectionPage", rCoreAttrs,
631 STR_JDBC_HELPTEXT, STR_JDBC_HEADERTEXT, STR_COMMONURL)
632 , m_xFTDriverClass(m_xBuilder->weld_label("jdbcLabel"))
633 , m_xETDriverClass(m_xBuilder->weld_entry("jdbcEntry"))
634 , m_xPBTestJavaDriver(m_xBuilder->weld_button("jdbcButton"))
635 {
636 m_xETDriverClass->connect_changed(LINK(this, OJDBCConnectionPageSetup, OnEditModified));
637 m_xPBTestJavaDriver->connect_clicked(LINK(this,OJDBCConnectionPageSetup,OnTestJavaClickHdl));
638 }
639
641 {
642 }
643
644 void OJDBCConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
645 {
646 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETDriverClass.get()));
647 }
648
649 void OJDBCConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
650 {
651 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTDriverClass.get()));
652 }
653
655 {
656 bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
657 fillString(*_rSet,m_xETDriverClass.get(),DSID_JDBCDRIVERCLASS,bChangedSomething);
658 return bChangedSomething;
659 }
660
661 void OJDBCConnectionPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
662 {
663 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
664 bool bValid, bReadonly;
665 getFlags(_rSet, bValid, bReadonly);
666
668
669 if ( bValid )
670 {
671 if ( !pDrvItem->GetValue().getLength() )
672 {
673 OUString sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType);
674 if ( !sDefaultJdbcDriverName.isEmpty() )
675 {
676 m_xETDriverClass->set_text(sDefaultJdbcDriverName);
677 m_xETDriverClass->save_value();
678 }
679 }
680 else
681 {
682 m_xETDriverClass->set_text(pDrvItem->GetValue());
683 m_xETDriverClass->save_value();
684 }
685 }
686 bool bEnable = pDrvItem->GetValue().getLength() != 0;
687 m_xPBTestJavaDriver->set_sensitive(bEnable);
689
691 }
692
694 {
695 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
696 bool bEnableTestConnection = !m_xConnectionURL->get_visible() || !m_xConnectionURL->GetTextNoPrefix().isEmpty();
697 bEnableTestConnection = bEnableTestConnection && (!m_xETDriverClass->get_text().isEmpty());
698 return bEnableTestConnection;
699 }
700
702 {
703 OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF");
704 bool bSuccess = false;
705#if HAVE_FEATURE_JAVA
706 try
707 {
708 if ( !m_xETDriverClass->get_text().isEmpty() )
709 {
710// TODO change jvmaccess
711 ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
712 m_xETDriverClass->set_text(m_xETDriverClass->get_text().trim()); // fdo#68341
713 bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_xETDriverClass->get_text());
714 }
715 }
716 catch(css::uno::Exception&)
717 {
718 }
719#endif
720 TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
721 const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
722 OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
723 aMsg.run();
724 }
725
726 IMPL_LINK(OJDBCConnectionPageSetup, OnEditModified, weld::Entry&, rEdit, void)
727 {
728 if (&rEdit == m_xETDriverClass.get())
729 m_xPBTestJavaDriver->set_sensitive(!m_xETDriverClass->get_text().isEmpty());
730 SetRoadmapStateValue(checkTestConnection());
731 // tell the listener we were modified
732 callModifiedHdl();
733 }
734
735 std::unique_ptr<OGenericAdministrationPage> OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
736 {
737 return std::make_unique<OSpreadSheetConnectionPageSetup>(pPage, pController, _rAttrSet);
738 }
739
741 : OConnectionTabPageSetup(pPage, pController, "dbaccess/ui/dbwizspreadsheetpage.ui", "DBWizSpreadsheetPage",
742 rCoreAttrs, STR_SPREADSHEET_HELPTEXT, STR_SPREADSHEET_HEADERTEXT, STR_SPREADSHEETPATH)
743 , m_xPasswordrequired(m_xBuilder->weld_check_button("passwordrequired"))
744 {
745 m_xPasswordrequired->connect_toggled(LINK(this, OGenericAdministrationPage, OnControlModifiedButtonClick));
746 }
747
749 {
750 }
751
752 void OSpreadSheetConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
753 {
754 }
755
756 void OSpreadSheetConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
757 {
759 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xPasswordrequired.get()));
760
761 }
762
764 {
765 bool bChangedSomething = OConnectionTabPageSetup::FillItemSet(_rSet);
766 fillBool(*_rSet,m_xPasswordrequired.get(),DSID_PASSWORDREQUIRED,false,bChangedSomething);
767 return bChangedSomething;
768 }
769
770 std::unique_ptr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& _rAttrSet)
771 {
772 return std::make_unique<OAuthentificationPageSetup>(pPage, pController, _rAttrSet);
773 }
774
776 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/authentificationpage.ui", "AuthentificationPage", _rCoreAttrs)
777 , m_xFTHelpText(m_xBuilder->weld_label("helptext"))
778 , m_xFTUserName(m_xBuilder->weld_label("generalUserNameLabel"))
779 , m_xETUserName(m_xBuilder->weld_entry("generalUserNameEntry"))
780 , m_xCBPasswordRequired(m_xBuilder->weld_check_button("passRequiredCheckbutton"))
781 , m_xPBTestConnection(m_xBuilder->weld_button("testConnectionButton"))
782 {
783 m_xETUserName->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl));
784 m_xCBPasswordRequired->connect_toggled(LINK(this,OGenericAdministrationPage,OnControlModifiedButtonClick));
785 m_xPBTestConnection->connect_clicked(LINK(this,OGenericAdministrationPage,OnTestConnectionButtonClickHdl));
786 }
787
789 {
790 }
791
792 void OAuthentificationPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
793 {
794 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHelpText.get()));
795 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTUserName.get()));
796 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Button>(m_xPBTestConnection.get()));
797 }
798
799 void OAuthentificationPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
800 {
801 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETUserName.get()));
802 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xCBPasswordRequired.get()));
803 }
804
805 void OAuthentificationPageSetup::implInitControls(const SfxItemSet& _rSet, bool /*_bSaveValue*/)
806 {
807 // check whether or not the selection is invalid or readonly (invalid implies readonly, but not vice versa)
808 bool bValid, bReadonly;
809 getFlags(_rSet, bValid, bReadonly);
810 const SfxStringItem* pUidItem = _rSet.GetItem<SfxStringItem>(DSID_USER);
811 const SfxBoolItem* pAllowEmptyPwd = _rSet.GetItem<SfxBoolItem>(DSID_PASSWORDREQUIRED);
812
813 m_xETUserName->set_text(pUidItem->GetValue());
814 m_xCBPasswordRequired->set_active(pAllowEmptyPwd->GetValue());
815
816 m_xETUserName->save_value();
817 }
818
820 {
821 bool bChangedSomething = false;
822
823 if (m_xETUserName->get_value_changed_from_saved())
824 {
825 _rSet->Put(SfxStringItem(DSID_USER, m_xETUserName->get_text()));
826 _rSet->Put(SfxStringItem(DSID_PASSWORD, OUString()));
827 bChangedSomething = true;
828 }
829 fillBool(*_rSet, m_xCBPasswordRequired.get(), DSID_PASSWORDREQUIRED, false, bChangedSomething);
830 return bChangedSomething;
831 }
832
833 std::unique_ptr<OGenericAdministrationPage> OFinalDBPageSetup::CreateFinalDBTabPageSetup(weld::Container* pPage, ODbTypeWizDialogSetup* pController, const SfxItemSet& _rAttrSet)
834 {
835 return std::make_unique<OFinalDBPageSetup>(pPage, pController, _rAttrSet);
836 }
837
839 : OGenericAdministrationPage(pPage, pController, "dbaccess/ui/finalpagewizard.ui", "PageFinal", _rCoreAttrs)
840 , m_xFTFinalHeader(m_xBuilder->weld_label("headerText"))
841 , m_xFTFinalHelpText(m_xBuilder->weld_label("helpText"))
842 , m_xRBRegisterDataSource(m_xBuilder->weld_radio_button("yesregister"))
843 , m_xRBDontregisterDataSource(m_xBuilder->weld_radio_button("noregister"))
844 , m_xFTAdditionalSettings(m_xBuilder->weld_label("additionalText"))
845 , m_xCBOpenAfterwards(m_xBuilder->weld_check_button("openediting"))
846 , m_xCBStartTableWizard(m_xBuilder->weld_check_button("usewizard"))
847 , m_xFTFinalText(m_xBuilder->weld_label("finishText"))
848 {
849 m_xCBOpenAfterwards->connect_toggled(LINK(this, OFinalDBPageSetup, OnOpenSelected));
850 m_xRBRegisterDataSource->set_active(true);
851 pController->SetFinalPage(this);
852 }
853
855 {
856 }
857
859 {
860 return m_xRBRegisterDataSource->get_active() && m_xRBRegisterDataSource->get_sensitive();
861 }
862
864 {
865 return m_xCBOpenAfterwards->get_active() && m_xCBOpenAfterwards->get_sensitive();
866 }
867
869 {
870 return m_xCBStartTableWizard->get_active() && m_xCBStartTableWizard->get_sensitive();
871 }
872
873 void OFinalDBPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
874 {
875 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTFinalHeader.get()));
876 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTFinalHelpText.get()));
877 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTAdditionalSettings.get()));
878 _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTFinalText.get()));
879 }
880
881 void OFinalDBPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
882 {
883 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xCBOpenAfterwards.get()));
884 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xCBStartTableWizard.get()));
885 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xRBRegisterDataSource.get()));
886 _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Toggleable>(m_xRBDontregisterDataSource.get()));
887 }
888
889 void OFinalDBPageSetup::implInitControls(const SfxItemSet& /*_rSet*/, bool /*_bSaveValue*/)
890 {
891 m_xCBOpenAfterwards->set_active(true);
892 }
893
894 void OFinalDBPageSetup::enableTableWizardCheckBox( bool _bSupportsTableCreation)
895 {
896 m_xCBStartTableWizard->set_sensitive(_bSupportsTableCreation);
897 }
898
900 {
901 return true;
902 }
903
904 IMPL_LINK(OFinalDBPageSetup, OnOpenSelected, weld::Toggleable&, rBox, void)
905 {
906 m_xCBStartTableWizard->set_sensitive(rBox.get_sensitive() && rBox.get_active());
907 }
908}
909
910// namespace dbaui
911
912/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TC_SEPARATORS
#define TC_EXTENSION
const OUString & GetValue() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool hasDriver(const char *_pAsciiPattern) const
determines whether there is a driver for the given URL prefix/pattern
Definition: dsntypes.cxx:131
OUString getPrefix(std::u16string_view _sURL) const
on a given string, return the type prefix
Definition: dsntypes.cxx:110
OUString getJavaDriverClass(std::u16string_view _sURL) const
on a given string, return the Java Driver Class
Definition: dsntypes.cxx:243
allows an ODsnTypeCollection to be transported in an SfxItemSet
Definition: dsnItem.hxx:34
::dbaccess::ODsnTypeCollection * getCollection() const
Definition: dsnItem.hxx:44
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
std::unique_ptr< MySQLNativeSettings > m_xMySQLSettings
MySQLNativeSetupPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
virtual void callModifiedHdl(weld::Widget *pControl=nullptr) override
std::unique_ptr< weld::Label > m_xHelpText
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)
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::Label > m_xFTHelpText
std::unique_ptr< weld::Button > m_xPBTestConnection
std::unique_ptr< weld::CheckButton > m_xCBPasswordRequired
OAuthentificationPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
std::unique_ptr< weld::Entry > m_xETUserName
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
std::unique_ptr< weld::Label > m_xFTUserName
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
std::unique_ptr< OConnectionURLEdit > m_xConnectionURL
::dbaccess::ODsnTypeCollection * m_pCollection
implements the connection page of the data source properties dialog.
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual bool checkTestConnection() override
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
void SetFinalPage(OFinalDBPageSetup *pPage)
Definition: dbwizsetup.cxx:458
void SetIntroPage(OMySQLIntroPageSetup *pPage)
Definition: dbwizsetup.cxx:443
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::CheckButton > m_xCBStartTableWizard
std::unique_ptr< weld::RadioButton > m_xRBDontregisterDataSource
OFinalDBPageSetup(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::RadioButton > m_xRBRegisterDataSource
std::unique_ptr< weld::Label > m_xFTAdditionalSettings
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
std::unique_ptr< weld::Label > m_xFTFinalText
std::unique_ptr< weld::Label > m_xFTFinalHeader
void enableTableWizardCheckBox(bool _bSupportsTableCreation)
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
static std::unique_ptr< OGenericAdministrationPage > CreateFinalDBTabPageSetup(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &_rAttrSet)
std::unique_ptr< weld::Label > m_xFTFinalHelpText
std::unique_ptr< weld::CheckButton > m_xCBOpenAfterwards
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void callModifiedHdl(weld::Widget *pControl=nullptr) override
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
static std::unique_ptr< OGenericAdministrationPage > CreateOracleJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
static std::unique_ptr< OGenericAdministrationPage > CreateMySQLJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
OGeneralSpecialJDBCConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs, sal_uInt16 _nPortId, TranslateId pDefaultPortResId, TranslateId pHelpTextResId, TranslateId pHeaderTextResId, TranslateId pDriverClassId)
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
static void getFlags(const SfxItemSet &_rSet, bool &_rValid, bool &_rReadonly)
analyze the invalid and the readonly flag which may be present in the set
Definition: adminpages.cxx:93
IDatabaseSettingsDialog * m_pAdminDialog
Definition: adminpages.hxx:94
static void fillString(SfxItemSet &_rSet, const weld::Entry *pEdit, TypedWhichId< SfxStringItem > _nID, bool &_bChangedSomething)
fills the String value into the item set when the value changed.
Definition: adminpages.cxx:219
void SetRoadmapStateValue(bool _bDoEnable)
Definition: adminpages.hxx:142
virtual void callModifiedHdl(weld::Widget *=nullptr)
Definition: adminpages.hxx:157
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue)
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
Definition: adminpages.cxx:150
static void fillBool(SfxItemSet &_rSet, const weld::CheckButton *pCheckBox, sal_uInt16 _nID, bool bOptionalBool, bool &_bChangedSomething, bool _bRevertValue=false)
fills the Boolean value into the item set when the value changed.
Definition: adminpages.cxx:190
static void fillInt32(SfxItemSet &_rSet, const weld::SpinButton *pEdit, TypedWhichId< SfxInt32Item > _nID, bool &_bChangedSomething)
fills the int value into the item set when the value changed.
Definition: adminpages.cxx:211
std::unique_ptr< weld::Label > m_xFTDriverClass
static std::unique_ptr< OGenericAdministrationPage > CreateJDBCTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
std::unique_ptr< weld::Entry > m_xETDriverClass
OJDBCConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::Button > m_xPBTestJavaDriver
virtual bool checkTestConnection() override
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
std::unique_ptr< weld::Entry > m_xETBaseDN
std::unique_ptr< weld::Label > m_xFTPortNumber
std::unique_ptr< weld::CheckButton > m_xCBUseSSL
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::Label > m_xFTHostServer
virtual void callModifiedHdl(weld::Widget *pControl=nullptr) override
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
std::unique_ptr< weld::Entry > m_xETHostServer
static std::unique_ptr< OGenericAdministrationPage > CreateLDAPTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
OLDAPConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::Label > m_xFTBaseDN
std::unique_ptr< weld::Label > m_xFTDefaultPortNumber
std::unique_ptr< weld::Label > m_xFTHelpText
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
std::unique_ptr< weld::RadioButton > m_xODBCDatabase
std::unique_ptr< weld::RadioButton > m_xNATIVEDatabase
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
static std::unique_ptr< OMySQLIntroPageSetup > CreateMySQLIntroTabPage(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &rAttrSet)
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual bool FillItemSet(SfxItemSet *_rSet) override
std::unique_ptr< weld::RadioButton > m_xJDBCDatabase
OMySQLIntroPageSetup(weld::Container *pPage, ODbTypeWizDialogSetup *pController, const SfxItemSet &rCoreAttrs)
std::unique_ptr< OConnectionURLEdit > m_xConnectionURL
void setURLNoPrefix(std::u16string_view _rURL)
::dbaccess::ODsnTypeCollection * m_pCollection
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override
void impl_setURL(std::u16string_view _rURL, bool _bPrefix)
used for the connection URL
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
OPostgresConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs, sal_uInt16 _nPortId)
static std::unique_ptr< OGenericAdministrationPage > CreatePostgresTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
std::unique_ptr< weld::Entry > m_xETDatabasename
std::unique_ptr< weld::SpinButton > m_xNFPortNumber
std::unique_ptr< weld::Entry > m_xETHostname
void setURL(std::u16string_view _rURL)
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
OSpreadSheetConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::CheckButton > m_xPasswordrequired
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
static std::unique_ptr< OGenericAdministrationPage > CreateDocumentOrSpreadSheetTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
virtual void fillWindows(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to disable if necessary
std::unique_ptr< OTextConnectionHelper > m_xTextConnectionHelper
static std::unique_ptr< OGenericAdministrationPage > CreateTextTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rAttrSet)
OTextConnectionPageSetup(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
virtual void implInitControls(const SfxItemSet &_rSet, bool _bSaveValue) override
called from within Reset and ActivatePage, use to initialize the controls with the items from the giv...
virtual void fillControls(std::vector< std::unique_ptr< ISaveValueWrapper > > &_rControlList) override
will be called inside <method>implInitControls</method> to save the value if necessary
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
virtual bool prepareLeave() override
called from within DeactivatePage. The page is allowed to be deactivated if this method returns sal_T...
virtual short run()
#define DBA_RES(id)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define DSID_CONN_LDAP_BASEDN
Definition: dsitems.hxx:65
#define DSID_PASSWORD
Definition: dsitems.hxx:42
#define DSID_CONN_LDAP_PORTNUMBER
Definition: dsitems.hxx:66
#define DSID_DATABASENAME
Definition: dsitems.hxx:84
#define DSID_CONN_LDAP_USESSL
Definition: dsitems.hxx:81
#define DSID_CONNECTURL
Definition: dsitems.hxx:36
#define DSID_TYPECOLLECTION
Definition: dsitems.hxx:38
#define DSID_CONN_HOSTNAME
Definition: dsitems.hxx:64
#define DSID_MYSQL_PORTNUMBER
Definition: dsitems.hxx:73
#define DSID_POSTGRES_PORTNUMBER
Definition: dsitems.hxx:94
#define DSID_JDBCDRIVERCLASS
Definition: dsitems.hxx:48
#define DSID_USER
Definition: dsitems.hxx:41
#define DSID_ORACLE_PORTNUMBER
Definition: dsitems.hxx:76
#define DSID_PASSWORDREQUIRED
Definition: dsitems.hxx:45
float u
OString stripEnd(const OString &rIn, char c)
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)