Bug Hunting Session
Bug 43369 - Specific UI for collecting PostgreSQL connection settings
Summary: Specific UI for collecting PostgreSQL connection settings
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, skillVcl, topicUI
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2011-11-30 03:09 UTC by Lionel Elie Mamane
Modified: 2017-11-05 23:35 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of MySQL-specific UI (8.92 KB, image/png)
2011-11-30 03:09 UTC, Lionel Elie Mamane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2011-11-30 03:09:14 UTC
Created attachment 53965 [details]
screenshot of MySQL-specific UI

When connecting to a PostgreSQL database (through PostgreSQL-SDBC driver), we currently just ask the user to type a conninfo string. That's familiar to PostgreSQL experts, but other people would benefit from some hand-holding.

Implement a PostgreSQL-specific UI to get the connection info, along the lines of the MySQL-specific UI we already have.


The file you need to change in LibreOffice is dbaccess/source/ui/dlg/ConnectionHelper.cxx, in function

   IMPL_LINK(OConnectionHelper, OnBrowseConnections, PushButton*, /*_pButton*/)

there is a big

        switch ( eType )

We need to add a case for PostgreSQL. You can take inspiration from the MySQL case.

You may also need to adapt ODbDataSourceAdministrationHelper::getConnectionURL() in file DbAdminImpl.cxx, as well as ODbTypeWizDialog::determineNextState in file dbwiz to activate a new state ADDITIONAL_PAGE_PGSQL, which you have to create first.

Finally, the dialog itself would be in file dbaccess/source/ui/dlg/dbadminsetup.src, in a to-be-created section TabPage PAGE_DBWIZARD_PGSQL.

You could just generate a conninfo string from that, but I'd prefer if you set it as properties of the datasouce/database/..., so that the driver gets it through the same interface as the username and password; cf handling of these for inspiration. There is already support for that in the driver, see connectivity/source/drivers/postgresql/pq_connection.cxx, function properties2arrays. POssibly you need to extend the handling there to support more keywords.


Please *also* allow advanced users to enter a conninfo string, and mixing of entering a conninfo string (like now) and information through widgets in the specific UI. See http://developer.postgresql.org/pgdocs/postgres/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS for an up-to-date list of all recognised connection settings. Make a decision on which of these settings make or do not make sense to give a friendly UI for.
Comment 1 Terrence Enger 2011-11-30 05:16:04 UTC Comment hidden (obsolete)
Comment 2 Lionel Elie Mamane 2011-11-30 05:28:47 UTC Comment hidden (no-value)
Comment 3 Terrence Enger 2011-11-30 05:48:22 UTC Comment hidden (no-value)
Comment 4 Björn Michaelsen 2013-10-04 18:47:47 UTC Comment hidden (no-value)
Comment 5 Alex Thurgood 2015-01-03 17:39:37 UTC Comment hidden (no-value)
Comment 6 Robinson Tryon (qubit) 2015-12-14 07:02:30 UTC Comment hidden (obsolete)
Comment 7 Robinson Tryon (qubit) 2016-02-18 14:52:31 UTC Comment hidden (obsolete)
Comment 8 kerem 2016-03-29 19:05:04 UTC
I sent following for this patch;

https://gerrit.libreoffice.org/#/c/23602/
Comment 9 Lionel Elie Mamane 2016-04-04 08:08:17 UTC
You'll need to create new dialogs (.ui files) for that. This is done with a tool called "Glade", run from a shell after doing

export GLADE_CATALOG_SEARCH_PATH=${PATH_TO_BUILT_LIBREOFFICE_SOURCE_TREE}/instdir/share/glade

You can use the ones we have for MySQL as inspiration:

dbaccess/uiconfig/ui/dbwizmysqlnativepage.ui
dbaccess/uiconfig/ui/mysqlnativepage.ui
dbaccess/uiconfig/ui/mysqlnativesettings.ui