FreeHSQLDB v.0.3

Creating Extension - Shared Libraries
Forum rules
For sharing working examples of macros / scripts. These can be in any script language supported by OpenOffice.org [Basic, Python, Netbean] or as source code files in Java or C# even - but requires the actual source code listing. This forum is not for asking questions about writing your own macros.

FreeHSQLDB v.0.3

Postby Villeroy » Sat Jun 06, 2015 5:43 pm

2015-06-08: First bug fix release 0.3.1 (undeclared variable, sigh)
2015-12-13: 5th bug fix release 0.3.5: Thanks to Bill_NZ for his persistent testing and good advice. New AutoInstaller module. The modified database document will be stored automatically because the save command was not always enabled in the GUI.
2017-03-25: Minor bug fixes (closing braces) for compatibility with LibreOffice.
2017-07-06: More bug fixes for LibreOffice. The FreeForms macro extracts LibreOffice forms from registered databases. OpenOffice can do the trick with unregistered ones as well.

FreeHSQLDB-0.3.7.oxt
(48.95 KiB) Downloaded 74 times


This is a new version of my FreeHSQLDB.oxt for the database developers among us.

FreeHSQLDB_Dialog.png
FreeHSQLDB-0.3 dialog


For this version 0.3

-- I cleaned up fishy Basic code. It is a little bit less restrictive. You can now edit the log-in options for all types of database connections. This is useful with JDBC, ODBC and password protected spreadsheets. It does nothing with text files and behaves a little bit odd with dBase connections.

-- Added a combo box for on-the-fly database registration. It shows any registration name for the current Base document. Select an existing registration name to overwrite the registration with the current Base document. Enter a non-existing name to add a new registration for the current Base document. Clear the combo box to remove any existing registration for the current document. Like the "path of this Base document" text box, this feature is useful with all types of database documents.
The connection features are still restricted to external jdbc:hsqldb:file: connections.

-- Added an auto-install module to this library, very much inspired by the brilliant work of DACM. Copy that module together with the "Helper" module into your distributable database document, adjust the constant values to your requirements and assign the document open event to Sub onDocumentOpen. It offers the same features as the dialog for any distributed package with a Base document, a hsqldb.jar, a HSQL backend and a collection of stand-alone forms with optional registration at the office suite.

-- Added module "FreeForms" which prompts for a target folder where to extract all embedded forms including any subfolders within the forms container. The stand-alone forms are saved with "soft protection" (open read-only without password). The logical forms are either linked to the Base document's registered name or its file URL.

All this is just a Basic library with an ugly dialog. I tried to add a toolbar with 2 buttons to the add-on registration but failed. The advantage of the missing UI is compatibility with any Libre/OpenOffice suite since OpenOffice.org 2.3(?) while the extension manager provides a basic version control by version number.

Please add your own custom UI via menu:Tools>Customize...
The callable routines are:
1) FreeHSQLDB.FreeHSQLDB.Main (as in earlier versions this calls the dialog)
2) FreeHSQLDB.FreeForms.Main (the new forms extractor)
3) <your document library>.AutoInstall.onDocumentOpen which can be event triggered after copying modules "AutoInstall" and "Helpers" to your distributable Base document. After copying both modules, modify the declared AutoInstall constants to match your needs.

To be done:
-- Write a script to extract and rename embedded HSQLDB files.
DONE: [Python] Macro to extract and reconnect embedded HSQLDB

-- Design a nicer multi-step dialog with all availlable HSQL options. This version appends some reasonable options to the connection url
jdbc:hsqldb:file:/path/name;;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false
and you may change them via menu:Edit>Database... The current Basic library contains hard coded HSQL options twice. One for the dialog and one for the auto-insall module.

-- Write a better report engine for stand-alone Writer documents. Sounds crazy? I'm pretty sure it can be scripted. If it would support the serial letter interfaces together with linked Writer tables for each letter then we could generate pretty invoices.

###############################################################################
Example package with auto-install macro: https://forum.openoffice.org/en/forum/v ... 21#p355521
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24656
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Return to Code Snippets

Who is online

Users browsing this forum: No registered users and 3 guests