BiblioteQ

A Library Application

Document Revised 2024.02.07

 

Table of Contents

Introduction

Accessing an Existing SQLite Database

Adding An Item

Administrator Browser

BiblioteQ.INI

BiblioteQ.conf

Change Password

Connecting to a PostgreSQL Database

Creating a PostgreSQL Database

Creating an SQLite Database

Custom Query

Database Content

Database Enumerations Browser

Database Layouts

Disconnecting from a Database

Error Log

Exporting a Table View to a CSV File

File Attachments

Hyperlinks

Importing

Limitations

Main Window Tool Buttons

Members Browser

Member’s Reservation History

Open Library

Operating Systems

PDF

PostgreSQL Accounts

PostgreSQL Benefits

PostgreSQL unaccent()

Preparing biblioteq.conf

Requesting an Item

Reserving an Item

Returning an Item

SQL Injections

SRU & Z39.50

Special Data

Terminal Options

Translations

Upgrading a PostgreSQL Database Schema

Upgrading an SQLite Database Schema

 

Introduction

BiblioteQ is a complex, highly-configurable, and mature library application. The software supports large, medium, and small institutions. Personal libraries are also supported.

BiblioteQ should be functional on any operating system where Qt LTS, SQLite, and YAZ are supported. BiblioteQ also supports the PostgreSQL database engine. Qt 4.8.x is considered obsolete and is not supported. The YAZ library is optional and can be removed by modifying the Qt project files.

The source of BiblioteQ is available at https://github.com/textbrowser/biblioteq.

The purpose of this document is to detail the functionality of BiblioteQ. Installation instructions are not described in this document. Please refer to the Administrator Guide document for installation information.

 

Accessing an Existing SQLite Database

An existing SQLite database file may be opened via two methods. The first method involves the Recent SQLite Files option of the File menu.

 

The Recent SQLite Files sub-menu contains a list of BiblioteQ’s recently-accessed SQLite files. If an SQLite file is selected, the specified SQLite database is opened. Please note that BiblioteQ will first close an existing database, if one is open, before opening the specified database. A Clear option is also included in the sub-menu. If Clear is activated, the list of the recently-accessed SQLite files is emptied. BiblioteQ will remove duplicate sqlite_db_ entries from the INI file shortly after the application is launched. Also removed will be entries whose corresponding files lack read and write permissions.

The second method of accessing an SQLite database is through the Branch Selection dialog. The dialog may be accessed via the Connect option of the File menu.

 

After opening the Branch Selection dialog, select local_db as the Branch Name. This will prepare the dialog for accessing SQLite databases. Afterwards, click on the Select SQLite Database button to launch a file-selection dialog.

Adding An Item

For PostgreSQL databases, items may be added by administrator and librarian accounts. For SQLite databases, file owners may add items.

BiblioteQ supports books, compact discs, digital video discs, grey literature, journals, magazines, photograph collections, and video games.

To add an item, click on the Add Item tool button and select the desired category. A Create window will be displayed. Required fields are highlighted.

Multiple items may be added simultaneously.

 

Administrator Browser

The Administrator Browser is available if an administrator role is connected to a PostgreSQL database. The browser may be accessed via the Configure Administrator Privileges tool button.

Four roles are available. Changes should be committed via the Save Changes button.

The process of committing changes to the PostgreSQL database is as follows:

  1. 1.The table’s current state is inspected. The operator is notified of administrators without privileges as well as duplicate administrators and the process is aborted. 

  2. 2.A database transaction is prepared. If an error occurs, the process is aborted. 

  3. 3.Deleted accounts are removed from the admin database table as well as from the PostgreSQL database. If an error occurs with either sub-process, the process is aborted and the previous changes are reverted. 

  4. 4.Existing admin table entries are updated. New accounts are inserted into the admin table. If an error occurs, the process is aborted and the previous changes are reverted. 

  5. 5.Existing admin table entries are granted the specified privileges after all potential privileges are revoked. New accounts are created in the PostgreSQL database and assigned the appropriate privileges. If an error occurs, the process is aborted and the previous changes are reverted. 

  6. 6.If all of the aforementioned statements execute correctly, the database transaction is committed. 

Please note that leading and trailing spaces will be removed from user names during the database-recording process.

 

BiblioteQ.INI

The BiblioteQ.INI file contains interface settings. The file resides in the user’s home directory within the .biblioteq folder. Editing should be performed with care.

BiblioteQ.conf

The BiblioteQ.conf file contains Amazon, SRU, Z39.50, and other information. Please edit this file using a text editor.

Change Password

A PostgreSQL account’s password may be changed via the Password Selection dialog. A password must contain at least eight characters. Guest accounts are excluded.

 

Connecting to a PostgreSQL Database

 
BiblioteQ supports both the
PostgreSQL
and
the
SQLite
database engines.
This section will cover the details involved in connecting to a PostgreSQL database.
 

Click the Connect option of the File menu.

 

Select the appropriate non-local_db Branch Name if one is available. Provide the Password and Userid information, if applicable, and press the Connect button.

Note: The sections Accessing an Existing SQLite Database and Creating an SQLite Database cover the details of accessing and creating SQLite databases, respectively.

 

Creating a PostgreSQL Database

BiblioteQ supports PostgreSQL 8.x, 9.x, and newer. Please note that PostgreSQL 8.x and 9.x are not supported by PostgreSQL. Please follow the PostgreSQL-provided documentation for installing PostgreSQL. After installing the required PostgreSQL packages, please perform the following operations:

  1. 1.Create the xbook_db database via createdb xbook_db -E UTF8 or via the PostgreSQL-recommended procedure. Please note that the database name xbook_db is only a suggestion. 

  2. 2.Execute createlang plpgsql -d xbook_db or the PostgreSQL-recommended procedure for adding a new programming language to the xbook_db database. If the language already exists, PostgreSQL will produce an error. Please ignore the error. 

  3. 3.If desired, replace all instances of the default administrator xbook_admin in the postgresql_create_schema.sql file. A password may also be set afterwards. 

  4. 4.Log into your PostgreSQL xbook_db database and load the postgresql_create_schema.sql file via \i postgresql_create_schema.sql. 

 

Creating an SQLite Database

A new BiblioteQ SQLite database file may be created via the New SQLite Database option of the File menu.

 

After the option is selected, a file-selection dialog is displayed. An existing or a new file may be specified. A confirmation dialog is displayed if an existing file is selected.

Once the SQLite database file has been initialized, BiblioteQ will open it. If a database is already open,  a confirmation prompt is displayed. If confirmed, the current database is closed and the newly-created database is opened.

 

Custom Query

Custom SQL queries may be performed via the Custom Query window.

After a successful query is performed, the main table’s columns will be set according to the query statement. Please avoid including columns of type QByteArray in the custom query as the associated data will burden the software.

 

Database Content

All content, save for configuration values, is stored in the respective database. For instance, image data are stored in a database. Temporary data reside in the application’s memory space.

Image information is recorded as Base-64.

 

Database Enumerations Browser

The Database Enumerations Browser is available to accounts having administrator or librarian privileges and is accessible via the Database Enumerations tool button. The browser contains configurable item values. The browser is available for PostgreSQL and SQLite databases.

The process of committing changes to a database is as follows:

  1. 1.For each sub-panel (Book Binding Types, etc.), a database transaction is prepared. If an error occurs, the process iterates to the next sub-panel. 

  2. 2.All items in the respective database table are deleted. For example, for the Book Binding Types sub-panel, all entries from the book_binding_types database table are deleted. If the process fails, changes are reverted and the process proceeds to the next sub-panel. 

  3. 3.New values are inserted into the respective database table. If the process fails, changes are reverted and the process proceeds to the next sub-panel. 

  4. 4.The current database transaction is committed. 

 

Database Layouts

 
 

Disconnecting from a Database

To disconnect from a connected database, click the File menu. Then click the Disconnect option.

 

Error Log

The Error Log may be accessed via the View menu. The window details critical exceptions which were raised during a BiblioteQ session. The status bar of the main window will indicate whether or not the log contains entries.

 

Exporting a Table View to a CSV File

The current table view’s contents may be exported to a CSV file via the Export Table View as CSV option of the File menu.

 

If clicked, a file-selection dialog is displayed.

The generated CSV file will contain comma-separated values. Values which contain commas will be encased in double-quotes. For example, A book of abstract algebra,"Pinter, Charles C.",McGraw-Hill,1990-01-01,New York,2,"Algebra, Abstract.",English,0070501386,0.00,Dollar,1,Hardcover,Home,9780070501386,89035355,QA162 .P56 1990,512/.02,1,0,Original,As New,.

The first line of the generated file contains the exported view’s header strings. The exported columns are governed by the settings in Viewable Columns.

 

File Attachments

Several categories (books, grey literature, journals, magazines) include file attachments. Attached files are compressed before being inserted into the respective database. BiblioteQ employs the ZLIB algorithm for compression.

 

Hyperlinks

BiblioteQ supports embedded hyperlinks. If a hyperlink is clicked, a search is initiated using the specified text for the given category. Please note that a clicked hyperlink will not be activated if the parent widget is editable.

 

Importing

BiblioteQ provides an import mechanism for importing book and patron data contained in a CSV file. Please review the Tools menu.

Limitations

BiblioteQ does not impose limits on the data content. Please note that both PostgreSQL and SQLite have rigid limits. Please read https://www.sqlite.org/limits.html for SQLite details.

Generally:

 

Main Window Tool Buttons

This page will describe the various tool buttons which are present on the main window.

The tool buttons are described from left to right.

View Selected Item(s)

Open the detail window(s) of the selected item(s). A confirmation prompt is displayed if the number of selected items exceeds four. The tool button is disabled if the current account has administrator privileges.

Add Item

Add an item. The tool button is disabled if the current account does not have Item Creation privileges.

Duplicate Selected Item(s)

Open the detail window(s) of the selected item(s). A confirmation prompt is displayed if the number of selected items exceeds four. The tool button is disabled if the current account does not have Item Creation privileges.

Delete Selected Item(s)

Delete the selected item(s). A confirmation prompt is displayed. The tool button is disabled if the current account does not have Item Deletion privileges.

Modify Selected Item(s)

Modify the selected item(s). A confirmation prompt is displayed if the number of selected items exceeds four. The tool button is disabled if the current account does not have Item Updates privileges.

Print Current View

Print the items in the current view. A Print dialog is displayed.

Select Viewable Columns

Select the columns that are to be shown in the main window’s table per each category (books, cds, etc.). Please note that column order is not preserved.

View Member’s Reservation History (Patrons Only)

Display the current patron’s reserved items. The tool button is enabled only for patron accounts.

Request Selected Item(s) / Cancel Selected Request(s)

Available for patrons, these options allow for the requesting of items as well as for the canceling of requested items.

Reserve Selected Item

Reserve the selected item. The tool button is disabled if the current account does not have Item Reservations privileges.

Display Members Browser

Display the Members Browser window. Only available for administrator, circulation, and membership accounts.

Files Browser

Display the Files Browser window.

Database Search

Activates a context menu containing various search options.

Custom Database Query

Display the Custom Query window.

Refresh Table

Reload the current view.

Again, the tool buttons are described from left to right.

Connect

Display the Branch Selection dialog.

Disconnect

Disconnect from the current database.

Change Password

Display the Password Selection dialog. Not available for PostgreSQL guest accounts and SQLite databases.

Configure Administrator Privileges

Display the Administrator Browser window. Only available for administrator accounts. Not available for SQLite databases.

Database Enumerations

Display the Database Enumerations Browser window. Only available for administrator and librarian accounts.

Exit BiblioteQ

Terminate the application.

 

Members Browser

The Members Browser is available from the View menu. For PostgreSQL databases, the browser is accessible if the current role is administrator, circulation, or membership. For SQLite databases, access to the browser is always granted.

The browser allows administrators to create, delete, and modify patron account details. Reservation processes are also available in the Members Browser. A mechanism for exporting the patrons is also included.

Grant Privileges

Grant Privileges is available for PostgreSQL databases. If pressed, each listed account is removed from and added to the biblioteq_patron role.

 

Member’s Reservation History

A patron’s reservation history may be accessed via the Member’s Reservation History window. Reservation histories are initially disabled.

 

Open Library

BiblioteQ supports the Open Library Internet search query for books.

 

Operating Systems

BiblioteQ supports Android, FreeBSD, Linux, Mac OS X, OS/2, OpenBSD, and Windows. Generally, the application should be compatible with any operating system where Qt, SQLite, and YAZ are supported. Please note that the YAZ library is totally optional. The software has also been tested on a variety of architectures, including AMD, ARM, Alpha 21264, PowerPC, and Sun UltraSparc.

 

PDF

BiblioteQ supports PDF content through the Poppler open source library. Browsing, printing, and searching options are included. Support is optional.

 

PostgreSQL Accounts

BiblioteQ provides three tiers of PostgreSQL database roles: administrator, guest, and patron.

Initially, the postgresql_create_schema.sql script may be used to create the administrator account xbook_admin.

Guest roles are provided a read-only interface. Patron roles are granted reservation permissions.

PostgreSQL accounts may be modified via the Administrator Browser. Please note that the Administrator Browser is only available within an administrator role.

Additionally, there are four administrator levels:
Administrator
,
Circulation
,
Librarian
, and
Membership
. The abilities of each
level
is described next.
 

Administrator permissions:

Circulation permissions:

Librarian permissions:

Membership permissions:

 

PostgreSQL Benefits

PostgreSQL is an open-source relational database management system. Some of the benefits of PostgreSQL include:

 

PostgreSQL unaccent()

BiblioteQ supports PostgreSQL's unaccent() extension. Documentation describing the unaccent() function is located at https://www.postgresql.org/docs/current/unaccent.html.

Greek-language users may wish to supplement their unaccent.rules files with information contained at https://gist.github.com/marinoszak/7d5d6a8670faae0f4589c2da988f2ba3. The PostgreSQL database may require restarting after a rules file is altered.

 

Preparing biblioteq.conf

The biblioteq.conf file contains non-user settings. The location of the file varies with distribution. This page will describe the various properties which may be defined in the biblioteq.conf file.

[Amazon Back Cover Images]

Describes required settings for retrieving book back-cover images from amazon.com.

host

Host name of the Amazon image server.

path

Path of the image file. BiblioteQ substitutes the respective ISBN in the percent sign. Please note that ASINs may also work.

The optional properties proxy_host, proxy_password, proxy_port, proxy_type, and proxy_username are also supported. The proxy_type property supports values of HTTP, None, Socks5, and System.

[Amazon Front Cover Images]

Please read previous section.

[Branch-1]

The first database branch.

connection_options

PostgreSQL-specific connection options. An example is connect_timeout=10;sslmode=verify-full.

database_name

The name of the database as it will appear in the Branch Selection dialog.

database_type

The database’s type. Must be set to postgresql or sqlite.

hostname

The host name of the PostgreSQL database server. Both IP addresses and fully-qualified domain names may be assigned.

port

The port value of the PostgreSQL database server.

ssl_enabled

If false, SSL/TLS communications are disabled.

[Open Library]

Describes required settings for retrieving book information from openlibrary.org

url_isbn

URL of book. BiblioteQ substitutes the respective ISBNs.

[Open Library Cover Images]

Describes required settings for retrieving book cover images from covers.openlibrary.org.

back_url

URL of the back-cover image file. BiblioteQ substitutes the respective ISBN in the $value field.

front_url

URL of the front-cover image file. BiblioteQ substitutes the respective ISBN in the $value field.

[SRU-1]

Describes the first SRU site.

name

Name of the site as it will appear in the application.

url_isbn

Complete URL of the site for retrieving data via ISBNs. The tokens %1 and %2 are replaced by the ISBN-10 and ISBN-13 fields.

url_issn

Complete URL of the site for retrieving data via ISSNs. The token %1 is replaced by the ISSN field.

The optional properties proxy_host, proxy_password, proxy_port, proxy_type, and proxy_username are also supported. The proxy_type property supports values of HTTP, None, Socks5, and System.

[Z39.50-1]

Describes the first Z39.50 site. Please also see http://www.indexdata.com/yaz/doc/zoom.records.html.

database_name

The remote database name.

format

Render format. An example: marc8,utf-8.

name

Name of the site as it will appear in the application.

password

Account password. Optional.

port

The remote database’s port number.

record_syntax

Preferred record syntax. Example: MARC21.

The optional properties password, proxy_host, proxy_port, and username are also supported.

timeout

Maximum number of seconds for the query to complete.

username

Account username. Optional.

yaz_

Configure YAZ options. The option (yaz_option minus yaz_) must be supported by the YAZ library. For example, yaz_charset and yaz_databaseName are suitable options.

 

Requesting an Item

PostgreSQL patrons may request one or more books, compact discs, digital video discs, grey literature, journals, magazines, and video games. After selecting an item, please press the green Telephone tool button. To cancel a request, please set the Category to All Requested, select the desired item, and press the red Telephone tool button. A confirmation dialog is displayed and if accepted, the selected request is canceled.

 

Reserving an Item

For PostgreSQL databases, items may be reserved by administrator and circulation accounts. Owners of SQLite databases may reserve items. Books, compact discs, digital video discs, grey literature, journals, magazines, and video games may be reserved. To reserve an item, select it in the main window and press the Reserve Selected Item tool button. If the item is available for reservation, the Members Browser will be displayed. Select the desired patron in the Members Browser and press the Reserve Selected Item tool button in the Members Browser.  The Copy Browser dialog is displayed. Specify the Due Date and select the desired copy. Finalize the reservation process by clicking the Reserve button.

Please note that the default Due Date may be modified via the Database Enumerations Browser.

 

Returning an Item

For PostgreSQL databases, reserved items may be returned by administrator and circulation accounts. Owners of SQLite databases may return reserved items. The simplest method of identifying reserved items is by the All Reserved category of the View menu. An item may be returned via its details window. Open the selected item’s details and click the Reservation Status button. The Item Reservation Status dialog is displayed. Select the copy which is about to be returned and click the Return button. Confirm the process.

Selected items may also be returned via the All Reserved category.

 

SQL Injections

Most BiblioteQ queries are parameterized. Prepared SQL statements are resilient against SQL injections. Please note that some fixed fields (for instance, Locations) are embedded in the statements.

 

SRU & Z39.50

BiblioteQ supports both the SRU and Z39.50 Internet search queries for books, journals, and magazines. Sites may be defined within the biblioteq.conf file.

 

Special Data

Dates are recorded in MM/dd/yyyy format.

ISBNs are recorded without hyphens.

 

Terminal Options

--open-postgresql-database <name-of-database>

Connect to the specified PostgreSQL database. The connection is established via the guest account.

--open-sqlite-database <absolute-path-of-database-file>

Open the specified SQLite database file.

--special-executable <absolute-path-of-executable>

The argument provided to special-executable will appear in Tools → External Applications. The environment variable BIBLIOTEQ_DATABASE_NAME is available to the new process. Multiple special-executable instances are allowed. Please note that BiblioteQ does not validate the paths of the applications.

--special-executable-icon <absolute-path-of-icon>

Set the action icon of the application specified via --special-executable. Please note that BiblioteQ does not validate the paths of the icons.

Example: BiblioteQ --special-executable /opt/dooble/Dooble –special-executable-icon /opt/dooble/Dooble.png.

 

Translations

Translations are incomplete. Translating BiblioteQ text is simple. Please download and install Qt from https://download.qt.io, download BiblioteQ’s source, and familiarize yourself with Qt’s Linguist. Linguist documentation is available at https://doc.qt.io/qt-5/qtlinguist-index.html.

Literal text, for example text housed in a combination-box widget, will be recorded to a database in its translated form. In general, BiblioteQ does not translate database entries.

 

Upgrading a PostgreSQL Database Schema

Some software releases require database schema changes. Please read the version-specific section of the postgresql_update_schema.sql file and execute the required SQL statements.

 

Upgrading an SQLite Database Schema

It may be necessary to upgrade an existing BiblioteQ SQLite database schema after a software release. An upgrade tool is available via the Tools menu. A confirmation prompt is displayed before the process is initiated. After the upgrade process is completed, a dialog depicting the results of the upgrade will be displayed. Please create a backup of the SQLite database before upgrading it.

 
Index

Index

21264        32

Accessing an Existing SQLite Database        11

Add Item        6, 26

admin        7

administrator        6 f., 16, 26 ff., 34, 42 f.

Administrator        34

Administrator Browser        7, 27, 34

Administrator Guide        3

All Requested        41

All Reserved        43

Alpha        32

AMD        32

Android        32

ARM        32

ASINs        38

back_url        39

biblioteq_patron        29

biblioteq.conf        38, 45

BiblioteQ.conf        9

BiblioteQ.INI        8

Book Binding Types        16

books        6, 22, 31, 41, 45

Books        42

Branch Name        5, 11

Branch Selection        4, 27, 38

Category        41

Change Password        27

circulation        27, 29, 42 f.

Circulation        34

Clear        4

compact discs        6, 41 f.

Configure Administrator Privileges        7, 27

Connect        4, 11, 27

connection_options        38

Copy Browser        42

Create        6

createdb        12

createlang        12

Creating an SQLite Database        11

CSV        21, 24

Custom Database Query        27

Custom Query        14

Database Enumerations        16, 27

Database Enumerations Browser        16, 28, 42

Database Search        27

database_name        38 f.

database_type        38

Delete Selected Item(s)        26

digital video discs        6, 41 f.

Disconnect        19, 27

Display Members Browser        27

Due Date        42

Duplicate Selected Item(s)        26

Error Log        20

Exit BiblioteQ        28

Export Table View as CSV        21

File        4, 11, 13, 19, 21

Files Browser        27

format        40

FreeBSD        32

front_url        39

Grant Privileges        29

grey literature        6, 22, 41 f.

guest        27, 34

host        38

hostname        38

HTTP        38 f.

hyperlinks        23

Item Creation        26, 34 f.

Item Deletion        26, 34 f.

Item Reservation Status        43

Item Reservations        27, 34 f.

Item Returns        34 f.

Item Updates        26, 35

journals        6, 22, 41 f., 45

librarian        6, 16, 28

Librarian        34

LIMIT        25

Linguist        48

Linux        32

local_db        5, 11

Mac OS X        32

magazines        6, 22, 41 f., 45

Member Creation        35

Member Deletion        35

Member Updates        35

Member’s Reservation History        30

Members Browser        42

membership        27, 29

Membership        34

Modify Selected Item(s)        26

name        39 f.

New SQLite Database        13

None        38 f.

OFFSET        25

Open Library        31

OpenBSD        32

OS/2        32

Pagination        25

password        10, 40

Password        11

Password Selection        10, 27

path        38

patron        26, 34

patrons        41

PDF        33

photograph collections        6

plpgsql        12

Poppler        33

port        38, 40

postgresql        38

PostgreSQL        3, 6 f., 11 f., 25, 29, 34, 41 ff.

postgresql_create_schema.sql        12, 34

postgresql_update_schema.sql        49

PowerPC        32

Print Current View        26

proxy_host        38 ff.

proxy_password        38 f.

proxy_port        38 ff.

proxy_type        38 f.

proxy_username        38 f.

Qt        32, 48

Qt LTS        3

Recent SQLite Files        4

record_syntax        40

Refresh Table        27

Request Selected Item(s) / Cancel Selected Request(s)        26

Reservation Histories        35

Reservation Status        43

Reserve        42

Reserve Selected Item        27, 42

Save Changes        7

Select SQLite Database        5

Select Viewable Columns        26

Socks5        38 f.

sqlite        38

SQLite        3 f., 6, 11, 13, 25, 29, 32, 50

SRU        45

ssl_enabled        39

Sun UltraSparc        32

System        38 f.

Telephone        41

timeout        40

Tools        24, 50

Translations        48

unaccent()        37

upgrade        50

url_isbn        39

url_issn        39

Userid        11

username        40

video games        6, 41 f.

View        20, 29, 43

View Member’s Reservation History (Patrons Only)        26

View Selected Item(s)        26

Windows        32

xbook_admin        12, 34

xbook_db        12

YAZ        3, 32

yaz_        40

Z39.50        45

 Administrator Privileges        7

[Amazon Back Cover Images]        38

[Amazon Front Cover Images]        38

[Branch-1]        38

[Open Library Cover Images]        39

[Open Library]        39

[SRU-1]        39

[Z39.50-1]        39