Client User Interface
LZadmin automatically generates the client graphical UI which is an OpenLaszlo program. This runs in a Flash player under the control of a browser. The following sections describe the capabilities of the GUI.
Authentication and Authorization
If use of authentication has been specified in the configuration file then the user is presented with a Login screen on startup. Here the user must enter a valid Username and Password to initiate the client program. If successful, the user if given the permissions associated with the Username.
Classes Panel
On startup a Classes panel is displayed on the left side of the canvas. This contains the Class Names which were specified in the ‘class_list’ key of the configuration. If the ‘class_tree’ key was also specified, then the Class Names will be in a heirarchical tree as defined there. The user can navigate the tree by clicking on its contents.
At the bottom of the Classes panel are the buttons: New and Find. The user must select a Class to operate on before clicking one of these, otherwise an error message will be given. New allows new objects of this class to be created in the database and Find lets the user find existing objects in the database.
This Classes panel remains stationary on the canvas and cannot be removed, although other windows may overlap it. All other objects are moveable, stackable and may be removed by clicking a Cancel button or the X button in the top right corner of the title bar.
New Window
A New window is invoked from the New button of the Classes Panel. The Class Name to be created is shown in the window’s title bar.
A form is presented with the column field names followed by text entry fields or data selection widgets to specify the data for this New class object which will be written to the database when the Submit button is clicked. Different textual formatting options for field names are available using the ‘form_label_style’ key of the configuration.
If the field has been defined as an Enumerated Type, then the names of the defined Items will be selectable in either a list or a radio button group. Which of these is used is based on the number and length of the Item names. A list will be made scrollable if more than 3 Items are defined.
An empty form field will normally result in a NULL value in the database row created, if NULLs are allowed for that field. However, Enumerated Types require a selected value, otherwise the data validation code generated for them will give an error stating: “value null is not a member of enumeration X”. If null-like behavior is desired, then a “Null” or “Undefined” Item can be defined in the Enumerated Type.
Note that database column fields such as ‘id’, ‘created_at’ and ‘updated_at’ are not offered in the forms since the values are provided automatically.
If successfully created, a popup window will be displayed with the Id number of the new class object (and row in the database).
Find Method Window
The Find Method window is invoked from the Find button of the Classes Panel. This lets the user select the find method to be used to retrieve the class selected. This window may be kept open and used to submit additional requests to find different classes or invoke different find methods.
The following sections define the various find methods provided.
Find By Id
The Find By Id method lets the user enter the Id number of an object to retrieve from the database for display. The Id number is the Rails default primary Id column and is the number returned when a new object is created.
Find By Value
This method lets the user enter one or more values into a form to find and retrieve all objects for which all of the entered values are equal to the object’s values.
Find By Match
This method lets the user enter one or more values into a form to find and retrieve all objects for which any of the entered values match the object’s values. This method uses the database comparator “like” instead of “equals” so the ”%” wildcard indicator may be used in fields with string-like behavior.
Find All
The Find All method retrieves and lists all objects of this class.
Display and List Windows
Succesful Find operations return their results in Display or List windows. Display windows display a single object and are used by FindById. List windows list a number of objects and are used by the other find methods which can return multiple objects.
Both of these display their results with a column name header at the top and one or more rows of object data values in a grid format. The column header may be clicked to sort the grid’s rows by the values contained in that column. A second click will reverse the sort order. The sort will be alphabetic or numeric depending upon the datatype of the column.
The user may select an object in the data grid by clicking on it which results in its being highlighting. Then an update or delete operation on that object may be invoked by clicking the Update or Delete button at the bottom of the window.
Update Window
An Update window may be invoked from the Update button in the bottom panel of a List or Display window that is returned from a Find operation. An object must be selected prior to clicking Update. This is done by clicking on and highlighting the entry row of the object to be updated.
Update operates similarily to the New window as data values to update may be entered into text fields or selected from lists or radio groups. One difference is that any existing values of the object will be displayed in the form’s fields when it is first displayed. The user may then modify one or more fields with new data and submit the form to update the object and its row in the database. If successful, a popup message will give the Class Name and Id number of the object updated.
If a text entry field which contains data is cleared of all characters when submitted, then the default value of the column will be assigned in the database if one is defined, else NULL will be used if allowed.
Delete
A Delete operation may be invoked from the Delete button in the bottom panel of a List or Display window that is returned from a Find operation. An object must be selected prior to clicking Delete. This is done by clicking on and highlighting the entry row of the object to be deleted. A popup message will then ask the user to confirm that the Class object with its Id number should be deleted.
Window Concurrency
Multiple windows of the same type may be displayed concurrently for different classes. The ability to work on multiple class objects simultaneously is very helpful, especially when the classes are associated with each other. For example, 3 New windows for 3 different classes may be displayed and worked on concurrently. However, only one of each type of window for the same class may be displayed concurrently. For example there cannot be 2 simultaneous Update windows for the same class although there may be both a New and an Update window for the same class. The window types referred to here are (New, Display, List and Update).
Data Concurrency and Caching
Find operations result in object data being retrieved and associated with Display or List windows. This data binding will remain in effect as long as the window is still open and no new Find operation is executed. This may result in stale data being displayed and reused in Update operations. Therefore care must be taken to refresh any results displayed by invoking a new Find operation after changes are made if further Updates on the same object are planned.
It is possible that multiple end users may login and administer data concurrently from different client systems. In this release there is no locking facility to prevent one user from overwriting changes made by another based on stale data cached in different client systems. Therefore coordination between data administrators may be required to prevent data collisions. This can be done by partitioning the data table responsibilities or by partitioning the timeframes used by different users for data administration.