|
|
Frontend installation and configuration
Preconditions
- Apache HTTP server with working PHP4 or PHP5 running under user „apache“ and group „apache“. If your operating system uses different username nad/or group you should alter
- Running instance of OasisMiddleware.
- A directory writable by apache user or apache group eg. /tmp/oasisfe-cache
Installation
- Extract the ZIP archive to the WWW directory of Apache eg. ** /var/www/OasisFrontend</p>
- Change the value of MIDDLEWARE_URL constant in file config/conf_local.php
- Change value of DIR_ATTR_CACHE constant in file config/conf_local.php which should refer to the directory writable by apache user. Frontend will use this directory to store transalted OASIS attributes fetched from the OasisMiddleware.
Main Configuration Items
All important counstants concerning OasisFrontend configuration are located in config/conf_local.php.
Design customization
Our web-frontend architecture is designed according to MVC (Model View Controller) architectural pattern [17] which solves the problem of separation of data and user interface by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate component: the controller:
- Model: The domain-specific representation of the information on which the application operates. This comprises persistent repository and enetites implementing the application logic. From the OasisFrontend's point of view, this is the OasisMiddleware layer. From OasisMiddleware's point of view this is DB-Adapter layer.
- View: This layer renders the user interface. Concerning the OasisFrontend, all related files are located in tpl/ directory, that is why we are refering to the term template-layer.
- Controller: Processes and responds to events, typically user actions, and may invoke changes on the model. In OasisFrontend the controller is implemented as PHP class Application. Each action has been implemented as an extension of abstract class BaseAction. The action is instantiated by controller according to ACT HTTP request parameter. During the lifecycle of each action, the method setActionTemplate() must be called in order to specify the template name used in template layer. In case of an error, or undefined template, the default tpl/error.php template will be used.
In order to change design specific parts of the frontend one should look into tpl/ directory. The main template file tpl/skeleton.php specifies common HTML strucuture augmented with the tpl/style.css file which defines common CSS rules. Moreover, each action automatically uses specific CSS file located in directory tpl/autocss/.
- Example: setActionTemplate('my_action.php') implies that tpl/my_action.php will be used as a template together with tpl/autocss/my_action.php as additional CSS file.
Following table describes the structure of design-related files and directories.
Authentication / Authorization
If available rules and requests on authentication and authorization demands at the OASIS Middleware
There is a LOGIN page in OasisFrontend where user could provide username and password. After submitting the login form, the authentication data are sent by OasisMiddleware to each DB-Adapter registered in the system. Each DB-Adapter responds to the request and returns a description text about the authentication process. This text is intended only to inform user whether the username:password has been accepted or not (and why).
Afterwards, OasisFrontend sends the username/password pair in further queries to middleware which sends it to DB-Adapters. DB-Adapter should use this pair to alter the search results in an unspecified way. It could provide more results and/or slightly modified results comparing to results without authentification.
Reflection of User Interface / Frontend (Description of Fields requestes)
If you wish, you might also add some information about former interface proposals that have been rejected by the OASIS group.
Localization
Default set of supported languages includes: English (en), German (de), French (fr), Polish (pl), Czech (cz), Slovak (sk). The localization process consists of two main parts:
- Frontend part: In order to support a new language, the user interface must be modified to provide all textual descriptions in the new language.
- Middleware part: While the Middleware contains the list of all OASIS attributes, it is necessary to translate all labels, descriptions and enumerations.
Frontend Localisation
Localized descriptions which could be rendered on the web page are located in languages/lang_{LANG}.php file, where {LANG} is the ISO-639-1 language code [18].
Each language is represented by national flag symbol, located in languages/lang_{LANG}.png file.
The last part of frontend localization is to replace images of buttons containing text such as Search, Advanced Search, Login etc. These images are located in tpl/img/{LANG}/ directory.
Middleware Localization
In chapter Fehler! Verweisquelle konnte nicht gefunden werden. we described the process of modification of oasis-attributes.xml document containing localized values of all OASIS attributes.
In order to include a new language we have to perform following actions:
- Element <language> must be inserted as a subelement of <languages>
- Element <label> must be inserted as a subelement of each <attribute>
- Element <description> must be inserted as a subelement of each <attribute>
- Element <enumeration> must be inserted as a subelement of each <attribute>, which has type=“enum“
- XML file must be recompiled using mini-compiler (see chapter Customization of OASIS Attributes)
- Finally, cache of all connected frontends must be deleted in order to synchronize changes.
An article by Viliam Simko
|
|
|