FormServer

It is a program with which the real end user of the databases has to do. This program can evaluate the form descriptions which come from form-editor, display the forms and connect to database. This program must give a receipt for the manipulations on the forms correctly in in the instructions SQL to the databases. Following functions are supported:

By the form-links a navigation is also possible by data contents along the linkage paths (relationship-path). The user can navigate like in hypertext-documents and reach every information. The user must not know the schema to work whith FormServer.

The forms themselves support directly higher abstraction concepts like association, Aggregation and specialization. The knowledge about the consepts of the relational modelling like foreign key and primary key must not exist by user.

Browsing Database with forms

With Form-Links you can brows the database like hypertext-documents.

Figure 2-6. Assoziation der Kardinalität 3 mit einem Attribut

Consider following association Figure 2-6. Ther are three objects (Student, Vorlesung (eng. lesson), Professor) in the relationship Prüfung (eng. exam). The result tables structure.
Professor     {PersNr,Rang,Raum}
Student       {MatrNr,Name,Semester}
Vorlesung     {VorlesungNr,Titel,SWS,PersNr}
pruefen       {MatrNr},VorlesungNr,PersNr,Note}
With form-links man can brows or navigate throw Database Infomation. From Student form you can reach per one click the information which exams he must do.

The Proble: Association has reacher semantic the hyper-links. The Association is transitiv. Hyper-Links are onle one-way references. The association can have more then 2 object (the degree of association can be greater than 2). One object can be associated whith more than one onother objects.

Figure 2-7. navigate (browse) with forms-links

Figure 2-7 shows all form-links types, they correspond to Relationship-Types from Er-model.

1:N

The Association is diplayed as choose-list. This is exactly the same as foreign-keys attributes. You can trigger the link by double-click on the reference-list title.

N:1

The Association is diplayed as action-button. This is just another site of 1:N relationship.

N:N oder N:M:O:...

The Association is diplayed as menu-button. This is just another site of 1:N relationship. The first menu-item is an N:1 Relationship and it link to the realtionship-table. The next item links to objects.

After open the linking form, the linking are conserved. This mean, the form are chained.

user macros in form

There are simple API to extend the form-server with user-procedures (macros). The FormServer is implemented in Tcl and it allow very ease to dynamic change of program-code.

The macros are loaded as tcl-scripts and they become a part of FormServer. The are some simply disigned API to control some main function of program. You can change the bahavior of some form like (delete checking, update checking ...). The idea; you create new Xotcl class derived from FormEngine class and you overwrite some empty methods. This are empty macros for myform form.

 
Class myform -superclass FormEngine
myform instproc update_check klvalues_ref {
    return 1
}
myform instproc delete_check {} {
    return 1
}
myform instproc insert_check klvalues_ref {
    return 1
}
myform instproc after_delete {} {
}
myform instproc reload_form {} {
}
myform instproc position_check {pos} {
    return 1
}
FormEngine instproc filling_form klvalues_ref {
}

See the example accountancy how to write your macros. The are such er-schema.

The macros are used to build following functionality.

see the file sample/accountancy.tcl how to buid such macros (for example how to buil sql-queries in Xdobry).