programmable relational database
with graphical user interface
Below documentation is part of the MUIbase dictribution and is also available in PDF.
Filters can be used to hide records. This chapter describes what types of filters are available and how to use them.
MUIbase knows two types of filters, record filters and reference filters.
10.1 Record Filter
A record filter can be installed into a table to filter out records that are not of interest to you. Records that are filtered out are excluded in the table mask and thus the user can't see or browse to them.
10.1.1 Filter Expression
A filter is defined by specifying a Boolean expression that may contain calls to MUIbase programming functions. For each record of the table the filter is specified for, this expression is evaluated. If it returns NIL then the record is filtered out, otherwise it is included in the table mask.
Each table can have its own filter expression.
10.1.2 Changing Filters
To change the filter of the current table select menu item `Table - Change filter'. This will open a window containing
After you are done with the specification of the filter expression click on the `Ok' button to leave the window. The entered expression is now compiled and on successful compilation, the expression is evaluated for all records. Those records for which the Boolean expression doesn't hold are then discarded in the table mask.
In case the expression doesn't compile you will get an error message displayed in the window title bar.
A filter can be turned on and off by clicking on the `F' button in the table's panel (if it is installed). After you have specified a filter expression for a table the filter for this table is turned on automatically.
If you (re-)activate a filter then all records of the table are checked whether they match the filter or not.
If a filter is currently active and you change a (filter relevant) attribute in a record of this table then the match-filter state of this record is not recomputed and stays unchanged.
If you allocate a new record in a table with an activated filter then there is no check if the new record matches the filter and the new record has its match-filter state set to TRUE.
10.1.3 Filter Examples
Here are some examples for valid filter expressions:
Please note that MUIbase' programming language uses a lisp-like syntax. For more information about the programming language, see Programming MUIbase.
10.2 Reference Filter
Reference attributes can also have a filter behavior. This is useful e.g. for building a hierarchy of tables. As an example see the project `Albums'.
If the filter of a reference attribute is turned on then the following features are activated:
Note: Cascading delete has to be implemented manually (by using a delete trigger function).
Do not use the reference filter on cyclic graphs, e.g. self-referencing tables, as it doesn't make much sense.
This document was generated on September, 11 2016 using texi2html