Michele Liberi software
versione 1.03, 1 settembre 2022
|
|
Michele Liberi
mail: mliberi@gmail.com
cell: 3485211456
|
liberix
woha administrator's guide
administrator's guide
Class management menu is available only for class owner and for class administrators, if any.
It contains the following functions:
classes
A class is a row container, it has types, attributes, methods and parameters.
A row is a data container, it contains a value for each class attribute.
A class may have subclasses, a subclass inherits types, attributes, methods and parameters from parent class.
new class
Create a new subclass of current class. The newly created subclass inherits types, attributes, methods, and parameters from parent class.
copy class
Create a new subclass of current class, and also copy types, attributes and methods from another class. This way you can set up a class with multiple inheritance.
delete class
Delete current class. A class can be deleted only if empty. A class can't be deleted if it has subclasses and/or contains rows.
types
A class type has a name and contains a list of strings.
It is useful to define which value an attribute with data type oneof or manyof is allowed to get.
new type
Create a new type in the current class.
edit type
View, modify or delete a type.
attributes
An attribute is a data container, all together attributes compose a row.
An attribute has a name, a data type and some other markers described in detail below.
new attribute
Create a new attribute in current class.
When creating an attribute you must provide the following markers:
- name
- the attribute name
- data type
- specify what kind of value the attribute is allowed to contain. Valid data types are:
- string
- any sequence of characters
- number
- a valid string representation of a number
- boolean
- 'true' or 'false'
- rating
- an integer number from zero up to a max, graphically represented with stars
- date
- a valid timestamp in the specified format
- oneof
- a single string taken from a given class type
- manyof
- a set of strings taken from a given class type
- textarea
- a text allowed to contain multiple lines
- fileset
- a compound field: a filename, a file content, and a searchable index automatically created at insert/update time
- image
- a compound field: a filename and an image, graphically represented as a picture
- created_ts
- a self maintained field, auto filled with timestamp of row creation
- lastupdated_ts
- a self maintained field, auto filled with timestamp of row last update
- username_owner
- a self maintained field, auto filled with the username of row owner, that is who created the row
- key field
- each row has a key, composed by concatenating the values of all key fields;
- the key is forced to be unique, in other words two rows with the same key are not allowed to coexist in the same class;
- row key can be used to efficiently retrieve it at search or update time.
- required
- a required attribute can't be empty, it must contain a not null value.
- hide
- an attribute with hide=true will be hidden in main window. You can view it by opening the view window or by forcing it to be shown.
- revision
- woha is able to keep multiple revisions for the same row. You can see history of changes in view window. A new revision is automatically created whenever the value of an attribute with revision=true changes.
- insert only
- an insert only attribute can't be updated.
- unique
- a class can't contain two rows with an attribute marked as unique having the same value.
- auto total
- if the class contains at least one attribute with auto total=true, woha will add an extra row in the main window displaying the sum of values.
- auto calc
- an attribute marked as auto calc=true can't be entered by user at insert time or update time. It will be calculated by class methods just after insert or update.
- idx
- marking an attribute with idx=true tells woha to build and maintain an index.
- hint
- a short help message to guide the user while filling the input form.
- format
- format is a REE: attribute value is acceptable only if matches it. An empty format is meaningless.
edit attribute
Open a new window showing all attributes. Click on a row to get a attribute details window in order to change some marker, or to delete the attribute.
move after
Change the sequence of attributes, that is the order attributes get displayed in all views. To move forward an attribute: select it, select the attribute placed just before the target new position, choose move after menu entry.
move before
Change the sequence of attributes, that is the order attributes get displayed in all views. To move backward an attribute: select it, select the attribute placed just after the target new position, choose move before menu entry.
methods
Methods are programs, the logic acting on data.
Woha is designed to create and manage methods as bash scripts, but there is no limitation about the language used to write them.
The main distinction about methods is between automatic and manual: automatic methods run when an event occur, manual methods run when called by user.
new method
When creating a method you must provide:
- name
- the method name
- type
- specify the behaviour of this method. Valid method types are:
- row read
- manual: can run only if user has read permission on row
- row read/write
- manual: can run only if user has read and write permissions on row
- table read
- manual: can run only if user has read permission on class
- table read/write
- manual: can run only if user has read and write permissions on class
- class owner
- manual: can run only if user is class owner or administrator
- before insert
- automatic: called just before inserting a new row in the class
- operation can occur only if return code is zero, otherwise it is cancelled
- after insert
- automatic: called just after inserting a new row in the class
- usually it computes and sets all auto calc attribute values
- before update
- automatic: called just before updating a row
- operation can occur only if return code is zero, otherwise it is cancelled
- after update
- automatic: called just after updating a row
- usually it computes and sets all auto calc attribute values
- before delete
- automatic: called just before deleting a row
- operation can occur only if return code is zero, otherwise it is cancelled
- after delete
- automatic: called just after deleting a row
- post download
- automatic: called just after user downloaded a set of rows
- insert
- automatic: customized insert form, overrides standard form
- edit
- automatic: customized edit form, overrides standard form
- sort order
- a string: specify order for building user's menu (manual methods), or order used to run them (automatic methods)
edit method
Call this function to view or modify an existing method.
settings
ACL
ACL stands for Access Control List, it is a standard structure managed by the operating system to manage access permissions.
Each class, row and method can have its own ACL.
parameters
Each class has a set of parameters. Subclasses inherit parameters from parent class.
If prefixed with a ! (bang) character, a flag is false
Call this function to view and eventually change current class parameters:
- default filters
- filters set in the default view. Each filter is in the form =name=ree, where name is the attribute name, and ree is an expression of regular expressions.
- default sorting keys
- sorting keys in the default view. Four forms are legal:
- ^name: sort by attribute with given name, from lower to higher
- vname: sort by attribute with given name, from higher to lower
- ^id: sort by attribute with given ID, from lower to higher
- vid: sort by attribute with given ID, from higher to lower
- show_rowid flag
- If true, show row id (a unique identifier automatically assigned by woha at insert time) in the main window. The row id is always visible in view window.
- encrypt flag
- If true, all attribute values are stored in the database in encrypted form.
- index flag
- If true, woha maintains an index of data contained in the class. It will speed up accessing data stored in class with many rows, but has two disadvantages: encryption is not effective, access permissions are not effective.
- max rows number
- When you enter a class a main window will be shown only if the number of rows going to be displayed is less than this number, otherwise user is broght directly to search window. Default value is 128.
- umask
- Umask is a hexadecimal number, with the same meaning as in UNIX systems. It will be used at insert time to set default row access permissions.
- class administrators
- By default each class is managed by its owner. Class owner can allow or disallow users to manage his class.
A=username | set named user as class administrator
|
A= | empty list of class administrators
|
A+username | add named user to the list of class administrators
|
A-username | subtract named user from the list of class administrators
|
set home class
Each database has a home class. When you access a DB the current class is the home class.
By calling this function database administrator sets the current class as the home class.