News

OpenOffice.org Base – No Frills Document Management

A no-frills personal document management system can come in handy in many situations. Read on to find out how OpenOffice.org Base can really come into its own…

OpenOfficeOrgBase FormDesign

This article originally appeared in issue 91 of Linux User & Developer magazine.

buy_online
Subscribe and save more than 30% and receive our exclusive money back guarantee – click here to find out more.

Document management systems (DMS) are not necessarily reserved for companies with complex workflows and thousands of documents. A no-frills personal DMS can come in handy in many situations. You can use it to organise your research materials, or manage article submissions. While there are a few open source DMSes out there, most are geared towards companies who need to manage their complicated document workflow. Also, most DMSes are server-based applications which require some skill to deploy and maintain.

But why not build your own little desktop document management solution? After all, OpenOffice.org Base is a rather capable tool for creating databases, and the OpenOffice.org Basic built-in scripting language can help to add some nifty features to your database applications. Like the idea but don’t know where to start? No problem: this tutorial will guide you through the process of creating a simple document management database and adding a couple of useful features to it with OpenOffice.org
Basic macros.

The first order of business is, of course, to create a new database. Fire up the OpenOffice.org Base application, and use the Database Wizard to create a new database. When prompted, tick the ‘Yes, register the database for me’ checkbox to register the created database as a data source. Press Finish to save the database under the DocMaBase name (or any other name you like) and open it for editing.

The next step is to add a table and populate it with fields. Switch to the Tables section and click on the ‘Create Table in Design View’ link. Which fields to add to the table depend largely on what information you want to store in the database. In our case, we add the following fields: ID (a numeric primary key), Title (the document’s title), DateAdded (record creation date), Notes (miscellaneous notes), Status (document’s status, eg In Progress, Archived etc), FileName (name of the attached document) and FileObj (a binary field for storing documents). Once the table is ready, give it a name (eg ‘documents’) and save it.

We now need to create a form which will act as a graphical front-end to the data stored in the ‘documents’ table. To create a new form, switch to the Forms section and click on the ‘Create Form in Design View’ link. Creating a form using the Form Designer is rather straightforward. All you have to do is to add the fields you want to the form, then specify their properties. There are, however, a couple of things that require some additional work. Since the Status field is used to store the status of the document, it is most likely to contain only a handful of unique items (In Progress, Proofread, Archived and so on).

So instead of typing the same status every time you create a new record, you can add a combo box which lets you simply select the desired item from the list. To do this, choose the Combo Box control in the Form Controls toolbar and draw a box in the form. This opens the Combo Box Wizard which helps you to configure the created combo box. By default, the created combo box is empty, so you have to enter the name of the status you want. Once you’ve done that, the entry is saved in the database and it appears in the combo box.

The key feature of the document management solution is the ability to store documents and files in the database itself. To add this feature, you need two form elements: a file selection field and buttons to import and export the selected file. The buttons are used to trigger OpenOffice.org Basic macros that insert the selected file into the FileObj field and save the file in the specified directory on the hard disk.

Proceed to page 2…

Click here for more tutorials from Linux User & Developer

[twitter username=”linuxusermag”]

×