20#include <config_java.h>
22#include <core_resource.hxx>
36#include <com/sun/star/ucb/XProgressHandler.hpp>
50 using namespace ::
svt;
54 return std::make_unique<OConnectionTabPage>(pPage, pController, *_rAttrSet);
59 :
OConnectionHelper(pPage, pController,
"dbaccess/ui/connectionpage.ui",
"ConnectionPage", _rCoreAttrs)
60 , m_xFL2(m_xBuilder->weld_label(
"userlabel"))
61 , m_xUserNameLabel(m_xBuilder->weld_label(
"userNameLabel"))
62 , m_xUserName(m_xBuilder->weld_entry(
"userNameEntry"))
63 , m_xPasswordRequired(m_xBuilder->weld_check_button(
"passCheckbutton"))
64 , m_xFL3(m_xBuilder->weld_label(
"JDBCLabel"))
65 , m_xJavaDriverLabel(m_xBuilder->weld_label(
"javaDriverLabel"))
66 , m_xJavaDriver(m_xBuilder->weld_entry(
"driverEntry"))
67 , m_xTestJavaDriver(m_xBuilder->weld_button(
"driverButton"))
68 , m_xTestConnection(m_xBuilder->weld_button(
"connectionButton"))
86 bool bValid, bReadonly;
156 sText = sText.replaceAll(
"~",
"");
168 bool bShowUserAuthenfication = ( eAuthMode !=
AuthNone );
172 m_xFL2->set_visible( bShowUserAuthenfication );
174 m_xUserName->set_visible( bShowUser && bShowUserAuthenfication );
191 const OUString& sUrl = pUrlItem->GetValue();
195 if ( !pJdbcDrvItem->GetValue().getLength() )
198 if ( !sDefaultJdbcDriverName.isEmpty() )
208 m_xFL3->set_visible(bEnableJDBC);
220 bool bChangedSomething =
false;
226 bChangedSomething =
true;
238 return bChangedSomething;
242 OSL_ENSURE(m_pAdminDialog,
"No Admin dialog set! ->GPF");
243 bool bSuccess =
false;
247 if ( !
o3tl::trim(m_xJavaDriver->get_text()).empty() )
250 m_xJavaDriver->set_text(m_xJavaDriver->get_text().trim());
251 bSuccess = ::connectivity::existsJavaClassByName(xJVM,
o3tl::trim(m_xJavaDriver->get_text()));
259 TranslateId pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
275 if (&rEdit == m_xJavaDriver.get())
276 m_xTestJavaDriver->set_sensitive( !
o3tl::trim(m_xJavaDriver->get_text()).empty() );
278 checkTestConnection();
const OUString & GetValue() const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
DATASOURCE_TYPE determineType(std::u16string_view _rDsn) const
OUString getJavaDriverClass(std::u16string_view _sURL) const
on a given string, return the Java Driver Class
virtual OUString getDatasourceType(const SfxItemSet &_rSet) const =0
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_xFT_Connection
the DSN type collection instance
std::unique_ptr< OConnectionURLEdit > m_xConnectionURL
::dbaccess::ODsnTypeCollection * m_pCollection
std::unique_ptr< weld::Button > m_xPB_Connection
void setURL(std::u16string_view _rURL)
implements the connection page of the data source properties dialog.
std::unique_ptr< weld::Label > m_xJavaDriverLabel
std::unique_ptr< weld::Button > m_xTestJavaDriver
std::unique_ptr< weld::Entry > m_xJavaDriver
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 checkTestConnection() override
changes the connection URL.
std::unique_ptr< weld::Label > m_xFL2
virtual ~OConnectionTabPage() override
std::unique_ptr< weld::CheckButton > m_xPasswordRequired
OConnectionTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &_rCoreAttrs)
std::unique_ptr< weld::Label > m_xUserNameLabel
std::unique_ptr< weld::Label > m_xFL3
std::unique_ptr< weld::Button > m_xTestConnection
virtual bool FillItemSet(SfxItemSet *_rCoreAttrs) override
std::unique_ptr< weld::Entry > m_xUserName
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *_rAttrSet)
static void getFlags(const SfxItemSet &_rSet, bool &_rValid, bool &_rReadonly)
analyze the invalid and the readonly flag which may be present in the set
IDatabaseSettingsDialog * m_pAdminDialog
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.
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.
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define DSID_JDBCDRIVERCLASS
#define DSID_PASSWORDREQUIRED
constexpr OUStringLiteral HID_DSADMIN_ORACLE_DATABASE
constexpr OUStringLiteral HID_DSADMIN_MYSQL_DATABASE
constexpr OUStringLiteral HID_DSADMIN_MOZILLA_PROFILE_NAME
constexpr OUStringLiteral HID_DSADMIN_MYSQL_ODBC_DATASOURCE
constexpr OUStringLiteral HID_DSADMIN_MSACCESS_MDB_FILE
constexpr OUStringLiteral HID_DSADMIN_LDAP_HOSTNAME
constexpr OUStringLiteral HID_DSADMIN_ODBC_DATASOURCE
constexpr OUStringLiteral HID_DSADMIN_WRITER_PATH
constexpr OUStringLiteral HID_DSADMIN_FLAT_PATH
constexpr OUStringLiteral HID_DSADMIN_THUNDERBIRD_PROFILE_NAME
constexpr OUStringLiteral HID_DSADMIN_CALC_PATH
constexpr OUStringLiteral HID_DSADMIN_DBASE_PATH
constexpr OUStringLiteral HID_DSADMIN_BROWSECONN
#define LINK(Instance, Class, Member)
DATASOURCE_TYPE
known datasource types
@ DST_EVOLUTION_GROUPWISE
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)