Difference between revisions of "Xebra Documentation"

(Xebra Tag Libraries)
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Xebra]]
 
[[Category:Xebra]]
 +
[[Xebra About|About]] | [[Xebra Installation|Installation]] |  [[Xebra Documentation|Documentation]] |  [[Xebra Tutorial|Tutorials]] | [[Xebra FAQ|Frequently Asked Questions]]
 +
 +
=Overview=
 +
* [[Xebra Socket Communication]]
  
 
=Xebra HTTP Server Plugins=
 
=Xebra HTTP Server Plugins=
 
* [[Xebra Module Communication Protocol|Module Communication Protocol]]
 
* [[Xebra Module Communication Protocol|Module Communication Protocol]]
 +
* [[Xebra Module Content Types|Content Types]]
 +
 +
==Mod_xebra for Apache==
 
* [[Xebra Apache Module Windows|Apache Module Windows]]
 
* [[Xebra Apache Module Windows|Apache Module Windows]]
  
=Xebra Tag Libraries=
+
=Xebra Server=
 +
* [[Xebra Server Administration]]
  
 +
= Web Applications =
 +
* [[Xebra Webapp Config File]]
 +
 +
==Xebra Tag Libraries==
 +
On the following pages you can find the descriptions of the different tags of the available tag libraries.
 
* [[Xebra Taglib Page|Page]]
 
* [[Xebra Taglib Page|Page]]
 
* [[Xebra Taglib Xeb|Xeb]]
 
* [[Xebra Taglib Xeb|Xeb]]
 
* [[Xebra Taglib Form|Form]]
 
* [[Xebra Taglib Form|Form]]
 +
* [[Xebra Taglib XRPC|XRPC]]
 +
* [[Xebra Tag Attribute|Tag Attribute]]
 +
 +
==Master pages==
 +
* [[Xebra Master Pages|Templates with master pages]]
 +
 +
==XML_RPC==
 +
* [[Xebra XML_RPC]]
 +
 +
=Code documentation=
 +
==Xebra Libraries==
 +
=== Thread Utilities ===
 +
An implementation of a [http://en.wikipedia.org/wiki/Thread_pool_pattern| Thread Pool]. There are two implementations: with or without data class reuse (DATA_THREAD_POOL and THREAD_POOL).
 +
 +
=== Xebra AST Elements ===
 +
This library contains various classes which model eiffel language constructs. It consists of classes, features, comments, locals and expressions. They can be combined to build an object model of an eiffel class. Convenience features are provided to add locals and variables with unique names.
 +
AST Elements can be serialized to a text representation.
 +
It also contains some specialized classes for Xebra.
 +
 +
=== Xebra Common ===
 +
 +
Xebra_common contains all commands, command responses and interfaces for commands that are used by the server and the webapps. Furthermore, it contains deferred classes for server modules and webapp config classes.
 +
 +
=== Xebra Error===
 +
Provides internal error types for all xebra applications such as XERROR_CANNOT_OPEN_FILE or XERROR_SOCKET_NOT_BOUND. These errors are not supplied to the browser but only displayed in the log/console.
 +
 +
=== Xebra Error Responses ===
 +
Classes from xebra_error_responses are split into XER_SERVER: error responses generated by the server and XER_APP: error responses generated by the webapp. Both types are ultimately sent to the http server plugin and displayed in the user's browser. For instance XER_POST_TOO_BIG is a server error response that is created if the post request is bigger than allowed. XER_APP_CANNOT_FIND_PAGE is a response created by the webapp and then sent to the server if no servlet with the specified name was defined.
 +
 +
=== Xebra Http ===
 +
 +
Xebra_http provides classes for cookies, html requests, html responses, sessions and their parsers.
 +
 +
=== Xebra Taglibrary Base ===
 +
The base tag library contains all the basic Xebra tag implementations like display, call and iterate. For a more detailed explanation of the tags see [[Xebra_Taglib_Xeb| the documentation]].
 +
 +
=== Xebra Taglibrary Form ===
 +
The form tag library contains all tag implementations for form related tags. Automatic wrapping of values, controls and validations are included in this library. For a more detailed explanation see [[Xebra_Taglib_Form|here]].
 +
 +
=== Xebra Taglibrary XRPC ===
 +
This tag library contains tags for XML-RPC applications. For further information see [[Xebra_Taglib_XRPC|here]].
 +
 +
=== Xebra Utilities ===
 +
 +
Xebra_utilities is a collection of independent helper classes such as text escaper, file utilities, log outputter, stopwatch, string expander etc.
 +
 +
=== Xebra Tags ===
 +
Contains all super classes used for xebra tags and xebra tag arguments. Also contains super classes for servlet generation (XGEN_SERVLET_GENERATOR).
 +
 +
===Xebra Web Application===
 +
 +
Provides all necessary base classes such as XWA_SERVLET, XWA_CONTROLLER, XWA_APPLICATION to webapp applications. Takes care of communication with server.
  
===Form===
+
= Other =
{| class="wikitable"
+
* [[Xebra Benchmarks|Benchmarks]]
! Tag
+
! Description
+
|-
+
|
+
<xml>
+
<f:form class="..." variable="...">
+
</f:form>
+
</xml>
+
|
+
All form tags have to be contained in a f-form. A variable and class can be optionally defined to automatically wrap input forms to an object.
+
|-
+
|
+
<xml>
+
<f:button value="..." action="..."/>
+
</xml>
+
|
+
A button is a normal html button. It is associated with a controller function ("action") which is executed if the validation of all inputs field where successful. The automatically wrapped object is then passed to the action. The value designates the Label on the button.
+
|-
+
|
+
<xml>
+
<f:input_text value="..." name="..." text="..."/>
+
<f:input_secret value="..." name="..." text="..." />
+
</xml>
+
|
+
These two input fields are basically the same. The designated normal html inputs. Additionally they provide a name which makes them identifiable for validation output. f-validator tags can be added to the inputs to define validators.
+
|-
+
|
+
<xml>
+
<f:textarea value="..." name="..." text="..." rows="..." cols="..."/>
+
</xml>
+
|
+
Basically the same as the input fields but with some additional auxiliary textarea-specific attributes (rows, cols).
+
|-
+
|
+
<xml>
+
<f:command_link label="..." action="..." variable="..." />
+
</xml>
+
|
+
A command link is a html link. It acts though like a button and executes the defined action on the controller. If a variable is defined, it will be passed to the action (feature). Variable names can be used from f-form or xeb-iterate.
+
|-
+
|
+
<xml>
+
<f:validator class="..." />
+
</xml>
+
|
+
A validator validates an input. It can be added to input fields (or textareas) to check the input.
+
|-
+
|
+
<xml>
+
<f:validation_result name="..." />
+
</xml>
+
|
+
Outputs potential validation errors coming from the input field with the name "name".
+
|}
+
====Example====
+
For the forms framework we will use a simple display of reservations with an input mask and delete command links.
+
<xml>
+
<table>
+
<tr>
+
<td>Name</td>
+
<td>Date</td>
+
<td>Persons</td>
+
<xeb:container render="authenticated_admin">
+
<td>Delete</td>
+
</xeb:container>
+
<xeb:container render="not_authenticated_admin">
+
<td>Details</td>
+
</xeb:container>
+
</tr>
+
<f:form>
+
<xeb:iterate list="global_state.db.reservations" variable="reservation" type="RESERVATION">
+
<tr>
+
<td><xeb:display feature="#{reservation.name}"/></td>
+
<td><xeb:display feature="#{reservation.date}"/></td>
+
<td>
+
<f:command_link label="Delete" action="delete" variable="reservation" />
+
</td>
+
</tr>
+
</xeb:iterate>
+
</f:form>
+
</table>
+
<h2>New Reservation</h2>
+
<f:form variable="new_reservation" class="RESERVATION">
+
<table>
+
<tr>
+
<td>Name</td>
+
<td><f:input_text value="name" name="a_name" text="#{new_reservation.name}" /></td>
+
</tr>
+
<tr>
+
<td>Date</td>
+
<td><f:input_text value="date" name="a_date" text="#{new_reservation.date}" /></td>
+
</tr>
+
<tr>
+
<td colspan="2">
+
<div align="center">
+
<f:button value="Save" action="save" type="submit" /></div>
+
</td>
+
</tr>
+
</table>
+
</f:form>
+
</xml>
+
  
==Tag Attributes==
+
== Howtos ==
While most tag attributes are plain text and thus static, sometimes it is useful or even necessary to use dynamically bound attributes.
+
===Build Windows Installer===
In Xebra there are two different types of dynamic attributes:
+
  
{| class="wikitable"
+
* Install apache (c:\apache)
! Tag
+
*Visual Build Professional 7:
! Description
+
**Open xebra\tools\installer\win\XebraBuild.bld
|-
+
**Adapt Macro->Project variables to match your system (APACHE, ROOT)
|
+
**Run
<xml>
+
*Inno Setup 5 Compiler
... attr="%=call%"...
+
**Open xebra\tools\installer\win\innosetup\xebra_install_test.iss
</xml>
+
**Generate new AppId
|
+
**Changed AppVersion
Call designates a controller feature which returns a STRING.
+
**Check that LicenseFile file exists (gnu licence?)
|-
+
**Check Source files are correct folder
|
+
**Build
<xml>
+
... attr="#{variable.name}"...
+
</xml>
+
|
+
Uses a - predefined (form/iterate) - variable to retrieve a value.
+
|}
+

Latest revision as of 09:02, 1 September 2009

About | Installation | Documentation | Tutorials | Frequently Asked Questions

Overview

Xebra HTTP Server Plugins

Mod_xebra for Apache

Xebra Server

Web Applications

Xebra Tag Libraries

On the following pages you can find the descriptions of the different tags of the available tag libraries.

Master pages

XML_RPC

Code documentation

Xebra Libraries

Thread Utilities

An implementation of a Thread Pool. There are two implementations: with or without data class reuse (DATA_THREAD_POOL and THREAD_POOL).

Xebra AST Elements

This library contains various classes which model eiffel language constructs. It consists of classes, features, comments, locals and expressions. They can be combined to build an object model of an eiffel class. Convenience features are provided to add locals and variables with unique names. AST Elements can be serialized to a text representation. It also contains some specialized classes for Xebra.

Xebra Common

Xebra_common contains all commands, command responses and interfaces for commands that are used by the server and the webapps. Furthermore, it contains deferred classes for server modules and webapp config classes.

Xebra Error

Provides internal error types for all xebra applications such as XERROR_CANNOT_OPEN_FILE or XERROR_SOCKET_NOT_BOUND. These errors are not supplied to the browser but only displayed in the log/console.

Xebra Error Responses

Classes from xebra_error_responses are split into XER_SERVER: error responses generated by the server and XER_APP: error responses generated by the webapp. Both types are ultimately sent to the http server plugin and displayed in the user's browser. For instance XER_POST_TOO_BIG is a server error response that is created if the post request is bigger than allowed. XER_APP_CANNOT_FIND_PAGE is a response created by the webapp and then sent to the server if no servlet with the specified name was defined.

Xebra Http

Xebra_http provides classes for cookies, html requests, html responses, sessions and their parsers.

Xebra Taglibrary Base

The base tag library contains all the basic Xebra tag implementations like display, call and iterate. For a more detailed explanation of the tags see the documentation.

Xebra Taglibrary Form

The form tag library contains all tag implementations for form related tags. Automatic wrapping of values, controls and validations are included in this library. For a more detailed explanation see here.

Xebra Taglibrary XRPC

This tag library contains tags for XML-RPC applications. For further information see here.

Xebra Utilities

Xebra_utilities is a collection of independent helper classes such as text escaper, file utilities, log outputter, stopwatch, string expander etc.

Xebra Tags

Contains all super classes used for xebra tags and xebra tag arguments. Also contains super classes for servlet generation (XGEN_SERVLET_GENERATOR).

Xebra Web Application

Provides all necessary base classes such as XWA_SERVLET, XWA_CONTROLLER, XWA_APPLICATION to webapp applications. Takes care of communication with server.

Other

Howtos

Build Windows Installer

  • Install apache (c:\apache)
  • Visual Build Professional 7:
    • Open xebra\tools\installer\win\XebraBuild.bld
    • Adapt Macro->Project variables to match your system (APACHE, ROOT)
    • Run
  • Inno Setup 5 Compiler
    • Open xebra\tools\installer\win\innosetup\xebra_install_test.iss
    • Generate new AppId
    • Changed AppVersion
    • Check that LicenseFile file exists (gnu licence?)
    • Check Source files are correct folder
    • Build