1. Introduction

This document describes the project sidu-base for developers.

1.1. Purpose

sidu-base provides a toolkit for developing graphical interfaces for browser based applications.

1.2. Architecture

This is a template and plugin driven approach which can be extended and modified easily.

There is a skeleton offering flow control, handling of configuration, storing of user specific data and so on.

Each page of the application is handled by a plugin implemented by a class derived from Page to administrate this page.

The basic html page is defined in a template. The content area of the page will be created from the plugin.
This allows using one template for all pages (equal design).

1.3. Navigation

There are two methods for navigations: menu driven or button driven.

1.3.1.Navigation by Buttons

The standard http process only allows access to the input field values if a button inside the form has been pushed. Therefore the navigation uses buttons instead of links.

Without this construction the user must push a "store" button and the data will be lost if he does not (very uncomfortable).

With the navigation by buttons the plugin can store the field values and then it changes the page.

1.3.2.Menu

The menu must be described by a content and by design:

The content is written to a textfile.

The HTML code is defined in a template.

2. Plugins

2.1. Tasks of a Plugin

A plugin has a class (derived from Page) and and a "snippet file" containing the HTML parts of the page.

2.2. Methods to Overwrite (always)

The plugin class must overwrite the abstract methods of the class Page. See page.php.

2.3. Methods to Overwrite (optional)

The following methods are predefined but can be overwritten.

2.4. Plugin services

The most important helper functions in the base class Page...

.. and in the class SessionBase:

The most important helper functions in the base class Page...

3. Template and Snippets

3.1. Template pageframe.html

The HTML pages will be built from the template file template/configuration.

This file contains HTML code and placeholders:

3.2.Snippets

The snippet file contain HTML snippets. A snippet is a name and HTML code. Inside the code there can be placeholders.

Convention: snippet names are noted in upper case.

The file must define a snippet named "MAIN".

Snippets will automatically read from Page. The derived class can get a single snippet by self._snippet.get(snippetName).

3.3. Placeholders

4. Content Template

The content area will be filled by a plugin. It should use a template to divide design and code. The plugin should use markers to communicate with the template.

The filling of the input fields with values inserted earlier will be done by the core modules. Therefore the names of the fields must be known.

5. Configuration

5.1. Language Independent Configuration Data

The file conf/applicationX.conf contains configuration data valid for all languages, e.g. the page chain.

# List of the page names separated by ','.
# The series defines the effect of the Back and Next buttons.
# The page name is the name of the plugin.
.gui.pages=home,boot,user,network,run

Convention: the placeholder name is divided into page name and variable name.

5.2. Language Dependent Configuration Data

The files conf/applicationX_lang.conf contain configuration data in each supported language, e.g. a title in applicationX_de.conf

home.txt_title=Startseite

Convention: the placeholder name is divided into page name and variable name.

5.3. User Data

The value of the input fields will be stored into a client specific file. This is used as a "memory" of each page.

6. Data flow

to be continued...