OpenOffice.org Base Switchboard

(4 votes)
Switchboard With Icons

The Switchboard extension generates a Switchboard/Main Menu interface to access Base forms and reports. The switchboard can be grouped into categories, each of which can contain any number of menu entries. Furthermore, you can specify the size and screen location of the form to be opened.

The generators creates three database objects.

1)The SWITCHBOARD table which has some basic information about the switchboard such as size and location of main form as well as size and positioning of menu entries.
2)The SWITCHBOARDITEMS table which has the menu entries configuration information.
3)The SWITCHBOARD form. This is a blank form generated by the wizard, and is populated with the menu entries. This form document can be modified by the user—keeping in mind that the menu entries need to be positioned at runtime.

All these items are generated automatically when the extension main hook is launched, and that database document does not have said objects. The main hook can be accessed through the Tools | Add-ons | OpenOffice.org Base Switchboard menu option. The extension can only be opened from a Registered Base document.

Currently, there are four types of menu entries that can be generated. Forms, Reports, Switchboards, and Switchboard Links. The Form and Report entries open a form or report, respectively. At runtime, the difference between a Switchboard and Switchboard Link is trivial. A Switchboard is an entry that appears as the parent of other entries (a menu). A Switchboard Link is an entry that links to another Switchboard menu—but does not have entries; this is usefully to get back to another menu (such as main menu) from an entry that may be nested somewhere down the hierarchy.

A Database form or report need not be located in the database where the Switchboard is located. This feature makes it possible to have a main switchboard that gives access to forms and reports from any number of databases.

Here is a sample Switchboard with icons.

NOTE:Icons used in samples and Extension Menu entry are owned by dryicons.com

Download extension
Operating System: System Independent
Official release: 1.1.0
Date: 2009-Oct-28
Size: 68.15 KB
License: opensource | Read license
Further product information: Screenshots | Product details
Provider: Roberto Benitez

Comments

WRONG LANGUAGE

It is very difficult for me to understand the Swedish (? or Danish) words! Please correct it (there is no english info). For example the title is "Onderligende Skakelbord Skepper" and the settings is written "Stellings"...
(but anyway thank you)

Switchboard

Cette extension Switchboard est une réponse intéressante à la demande des utilisateurs qui souhaitent utiliser la base sans avoir à entrer dans les objets. Il ne manque plus que la possibilité de lancer directement ce switchboard au démarrage.

C.fricard

Je ne parle pas français.

Je ne parle pas français. sauf pour dire: je ne parle pas français. et cette déclaration à l'expliquer.

But I believe the question is: how to launch a form, such as the switchboard when Base opens.

In the OOo 3.1 this is alot easier. simply bind the code to open a form as usual to the [Open Document] Event of the Base document for which you want this behavoir. Tools -> Customize. Select the events tab.

This code works for me:

[code]
Sub AutoExec
On Error Goto HandleError
Dim FormDocs As Object
Dim DBDoc As Object
Dim DataSource As Object
Dim Conn As Object
Dim Args(1) As New com.sun.star.beans.PropertyValue
Dim FormName As String
Dim FormDoc As Object
Dim UserName As String
Dim Password As String

UserName="" : Password=""
DBDoc=ThisComponent
DataSource=DBDoc.DataSource
Conn=DataSource.getConnection(UserName,Password)

FormName="SWITCHBOARD"

FormDocs=DBDoc.FormDocuments
Args(0).Name="ActiveConnection" : Args(0).Value=Conn
If FormDocs.hasByName(FormName) Then
FormDoc=FormDocs.loadComponentFromURL(FormName,"_self",0,Args() )
'FormDoc.CurrentController.Frame.ContainerWindow.setFocus()
FormDoc.CurrentController.Frame.ComponentWindow.setFocus()
End If
HandleError:
If Err<>0 Then
MsgBox "An error occured while loading the form [ " & FormName & " ]"
Exit Sub
End If
End Sub
[code]

I will include this code in the extension in the next release.

[FIXED IN NEW RELEASE] Refresh Error on menu entry generation.

Following from a post in one of the OOo forums in regards to menu entries disappearing from switchboard:

Not sure [b]exactly [/b]what the problem is, but can solved by refreshing the form document after the menu entries are generated. Not sure exactly what is happening, but seems that new elements (labels mainly) are placed on top of existing ones until they are repositioned--that is the behavior i see when I pause between each menu entry, but could be wrong. or perhaps previous versions were refreshing automatically.

FOR NOW, YOU CAN FIX AS FOLLOWS (until I find a few minutes to upload a new release):

1) Open the [b]Switchboard [/b]Basic library.
2) open the module named [b]Runtime[/b]
3) at the end of the function named [i]Function loadMenu(MenuId As Integer,FormDoc As Object, Form As Object) As Boolean[/i] add the following line of code

[code]
FormDoc.refresh()
[/code]

Can go right after the While loop

[BUG FIX POSTED--SEE NEW VERSION] Sub Menu/Category Bug

I noted that Sub Menues/Categories are not rendered in the latest version. It seems I accidentally removed a function call which resulted in a field getting incorrect data (Tisk ^ 2). I am currently waiting on confirmation for a few language translations. As soon as I get those, I will re-package it and submit the bug fix and languages.

Access DB

The switch board does not work if I have an Access DB. Any help will be greatly appreciated. I get an error that it can not create the tables. If I create it manually then I get to the switchboard settings but I can not save nor I can add items to it.

Javier

Cause of Problem:

The problem seems to be with the data type names from access not being recognized by the MetaData Service. Currently the extension relies on the column's data type name to determine which updateXXX(...) and getXXX(...) method to use when fetching/updating column values. if it cannot detrmine the data type name, it fails to update. at this point the updater returns and the insert function tries to commit a blank insert buffer. Short story: inserts cannot be made.

A workaround is to create a blank Base db with only the switchboard. Make all the buttons point/open forms/reports in your Base doc that connects to the access db.

In the mean time, I will try to figure out a different way to detrmine which ?XXX(...) methods to use.

Size bug

There was a bug I thought I had fixed on version 1.0.3, but was still there in some OOo installations--the configuration dialog opened with a size much smaller than the actual settings. This should hopefully be fixed now. Should the error persist, double-click anywhere on the dialog to expand. If nothing happens, you may be clicking on a label which happens to have a transparent back ground. If there is no dialog area that is not covered by a label, you can also double click on the white area at the top-left corner. Continue to double-click until the dialog is the desired size.

Translations

If you are interested in translating the GUI, please fill out this form and email it back to me. I figured out how to change font size, as the default font size in Base 3.0 forms appears to be quite small. I will make this correction soon and upload new release.

Documentation

Click here for a brief documentation of the Switchboard Extenstion