Introduction
Getting Started
Basic Syntax
Structures
Enumerations
Roles
User Interface
Procedures
Expressions
Translators
Contact, Questions, Discussion
Legal Notes
Updated 02/08/2018
All contents and concepts
©Webware nach Maß |
The Readable Programming Language - Handbook |
||||||||||
User InterfacePages and WidgetsThe user interface of a Lisilogic application is made up of (web)pages and widgets that can be included in these pages. A page is identified by its title: A page or widget is defined by at least one "can" sentence. Several sentences may add elements to the same page or widget. It is possible to add an element to all pages at once: "Home" pageThe "Home" page is predefined, corresponding to the page that gets displayed when no other one is required specifically (index.html, index.php etc.). If the caller isn't logged in (he is a visitor, see Roles), the "Home" page will display a login form, in addition to whatever UI elements have been added on it for the visitor role. LocationsThe layout of a page is organized in several regions as follows:
A widget has only the top, middle ("on") and bottom regions.
Several sentences may add elements to the same region of a page or widget. Inside a region, the elements will appear in the same order as the sentences in the code. In the future, Lisilogic may support different layouts and their locations. StylingFor now, it is not possible to provide styling information in Lisilogic. It is a challenging research topic to find a way to replace CSS (or a meaningful subset of their possibilities)
with descriptions readable and understandable by non-specialists. Syntax of a "can" sentenceA "can" sentence starts with the location on the page where UI elements are to be added: One or several "can" clauses follow. Each "can" clause may be preceded by a condition and defines UI elements for a role: See Basic Syntax: Lists about lists and lists in lists (e.g. list of UI elements in a list of "can" clauses). Each UI element may be preceded by a condition too and is either a displayer (see, read, download), an editor (edit, upload), or a button (click). ConditionsA condition is introduced by if, else if or otherwise,
the word "if" followed by an expression that must result in a boolean (see Expressions). The special there are expressions test if notifications (errors, warnings, messages, or any of these)
have been issued and will be displayed on the page: ButtonsA button has a text, may ask for a confirmation, and triggers an action.
If present, the confirmation must contain a text to be displayed or a value to check introduced by the word with, or both. If a check is whished, the user will be provided with a password field in the confirm dialog. The value he types in will be compared with the value to check and the action will be executed only if they are identical. The value to check doesn't have to be a password, but the check will fail if it can't be compared to the text entered by the user.
The possibility to provide buttons with an image or a calculated text is in development. An action can be a simple action, a navigation action, a procedure call or an anonymous procedure (definition and call in one). Simple Actionslogout save For now, a "save" button placed in a widget saves all editors on the page. In the future, if whished so during pioneer projects, it might save only the editors of the widget. skip continue cancel Navigation ActionsA navigation action is introduced by the verb go to and must indicate the page of the application to navigate to; it may
provide a value for the parameter of the page (the variable "the given ..." in its definition) introduced by for.
See Expressions: Contextual Constants. Navigating to a page of the application terminates the current procedure if there's one (see Procedures). Opening External PagesOpening an external page is introduced by the verb open and must indicate its URL; it may provide a HTML target
( Procedure CallsA procedure call indicates the name of the procedure to be started and may provide a value for its parameter
(the variable "the given ..." in the procedure definition). See Expressions: Contextual Constants. If a value is given, the procedure with the given name whose parameter type exactly matches the type of the given value gets started. There's no automatic conversion. Be aware that the given value might be null, in which case the procedure defined with null as a parameter type gets started. An error will be issued if no procedure definition matches the given value.
Parameters are passed by value, not by reference, but if the passed value is a structure, the procedure may modify its attributes. Starting a procedure terminates the eventual current one. See also Procedures. Anonymous ProceduresAn anonymous procedure is defined directly in the button that starts it:
See Procedures on how to write the definition. Starting an anonymous procedure terminates the eventual current procedure. Inside an anonymous procedure, the "given" and "current" variables as well as all pronouns (himself, his, it, its, them, their, etc.) have the same meaning as in the page or widget where it is defined. See Expressions: Contextual Constants. EditorseditTo include an editor in a page or a widget, you indicate:
On the address_editor, the user can:
- edit the given address's street,
- edit its house_number under the label "Nr.",
- click "Save" to save.
On the "Edit Profile" page, the user can:
- if his address is null, click on "Create address" to create his address,
- otherwise, edit his address using an address_editor under the header "Address".
If no label is specified, Lisilogic will use the name of the attribute to edit. See Structures: Basic Types for informations about the kind of editor used for each attribute type. Remember to add a "save" or "continue" button to any page with editors! uploadFile and image attributes (see Structures: Predefined Structures) may be edited using the verb upload. The normal editor also displays the files or images to be edited, the upload editor only shows a file input. You'll use this variant when the files or images are already displayed otherwise, for instance in a table. Further EditorsA "choose ... from ..." editor is in development. In the future, Lisilogic might allow alternative editors for basic types, for instance radio buttons instead of a dropdown-menu to edit single value enumerated attributes. DisplayersEach displayer may be preceded by a condition, see Conditions. TextA text displayer
Notifications (plain notification, error, warning, success notification) can be tested in conditions using a there are expression, see Conditions. Default DisplayerNearly any value (see Expressions) can be displayed with a default viewer depending on its type, see Structures. The default displayer of a structure is made up of the default displayers of its attributes, except those that are structures themselves. A default displayer can be provided with a title, label or header, introduced by the word under. If none is provided, Lisilogic will try to find an appropriate label, for instance the name of the attribute if the expression to display is an attribute.
DownloadsFiles and images can be viewed with the verb download instead of see. Like the default displayer, it will show a download link, under the filename for files and the thumbnail for images. Unlike their default displayer, but like the default displayer for other structures, it will also display their other attributes. To have a precise control over which attributes are displayed, define and use a widget. Widget IncludeAny value (see Expressions) can be displayed by including a widget introduced by the word using. In the definition of the widget, the passed value corresponds to the expressions "the given ...", see Expressions: Contextual Constants. For now, there is no difference between including a widget with the verb edit or with the verb see. ListA list displayer is defined using:
On the "Friends" page, the user can see the list of his friends
under the title "My Friends" using a profile_viewer. On the "Customers" page, the salesperson can see his customers as a list where he can
- see their name,
- see their address,
- see their bonus_points,
- click on "Add bonus" to add 10 points to their bonus,
- click on "Edit" to open the customer_editor for them.
The definition of the list viewer will be repeated for each element of the list. See also Basic Syntax: Lists on how to write "can" clauses inside a "can" clause. TableA table displayer is defined using:
A column definition indicates:
The definition of each column will be repeated for each row of the table. If no header is provided for a column, Lisilogic will try to calculate a reasonable default, like the name of the attribute if an attribute is displayed in the column. If no alignment is provided for a column, Lisilogic will use the default vertical alignment of the browser for table cells (middle) and the default horizontal alignment corresponding to the type of its content: right aligned for numbers, centered for booleans, left aligned for other values. Values introduced by the word containing are displayed using their default displayer, see above. See also Basic Syntax: Lists on how to write a list of column definitions inside a "can" sentence. |