Difference between revisions of "Xebra Documentation"

(Example)
 
(79 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]]
  
=Architecture Overview=
+
=Xebra HTTP Server Plugins=
 +
* [[Xebra Module Communication Protocol|Module Communication Protocol]]
 +
* [[Xebra Module Content Types|Content Types]]
  
(img)
+
==Mod_xebra for Apache==
 +
* [[Xebra Apache Module Windows|Apache Module Windows]]
  
#The Xebra HTTP Plugin (Apache Module or IIS7 Handler) forwards a request from the HTTP server to the Xebra Server and waits for a response.
+
=Xebra Server=
#The Xebra Server forwards a request to the appropriate web application.
+
* [[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 Xeb|Xeb]]
 +
* [[Xebra Taglib Form|Form]]
 +
* [[Xebra Taglib XRPC|XRPC]]
 +
* [[Xebra Tag Attribute|Tag Attribute]]
  
=Website Development=
+
==Master pages==
 +
* [[Xebra Master Pages|Templates with master pages]]
  
(img)
+
==XML_RPC==
 +
* [[Xebra XML_RPC]]
  
The web designer creates xeb files with a html editor. Xeb files consist of html code with The web
+
=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 Libraries=
+
=== Xebra AST Elements ===
===Page===
+
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.
The ''page'' libraries consists of the core tags needed for page configuration and composition. The Tags are:
+
AST Elements can be serialized to a text representation.
 +
It also contains some specialized classes for Xebra.
  
{| class="wikitable"
+
=== Xebra Common ===
! Tag
+
! Description
+
|-
+
|
+
<xml>
+
<page:controller class="..." />
+
</xml>
+
|
+
Defines the controller which should be used for the ''xeb'' page
+
|-
+
|
+
<xml>
+
<page:declare_region id="..." />
+
</xml>
+
|
+
Declares a region at the specific point in the xeb page
+
|-
+
|
+
<xml>
+
<page:define_region id="...">
+
...
+
</page:define_region>
+
</xml>
+
|
+
Defines a region from a template, can only be used inside a page-include tag
+
|-
+
|
+
<xml>
+
<page:include id="..." />
+
</xml>
+
|
+
Includes a template
+
|-
+
|
+
<xml>
+
</page:fragment>
+
</xml>
+
|
+
If used the page is not transformed to a servlet
+
|}
+
  
 +
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.
  
====Example====
+
=== 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.
  
This example shows the workings of the template framework. It consists of a master page which acts as a template and three different types of usage of this template.
+
=== 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.
  
master.xeb
+
=== Xebra Http ===
<xml>
+
<html>
+
<page:controller class="DEFAULT_CONTROLLER"/>
+
<body>
+
<h1>
+
<page:declare_region id="greeting" />
+
</h1>
+
<page:declare_region id="form" />
+
</body>
+
</html>
+
</xml>
+
  
The master page is "deferred", since there are page:declare_region tags. The translator detects the undefined regions and doesn't generate a servlet from this xeb file.
+
Xebra_http provides classes for cookies, html requests, html responses, sessions and their parsers.
  
slave1.xeb
+
=== Xebra Taglibrary Base ===
<xml>
+
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]].
    <page:include template="master">
+
    <page:define_region id="greeting">
+
    Hello, I'm Slave 1
+
    </page:define_region>
+
    <page:define_region id="form">
+
    Other region
+
    </page:define_region>
+
    </page:include>
+
</xml>
+
  
slave2.xeb
+
=== 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]].
  
<xml>
+
=== Xebra Taglibrary XRPC ===
    <html>
+
This tag library contains tags for XML-RPC applications. For further information see [[Xebra_Taglib_XRPC|here]].
    <page:controller class="SLAVE2_CONTROLLER" />
+
    <page:include template="master"
+
      <page:define_region id="form">
+
        Other region 2
+
        </page:define_region>
+
    </page:include>
+
    </html>
+
</xml>
+
  
slave3.xeb
+
=== Xebra Utilities ===
  
<xml>
+
Xebra_utilities is a collection of independent helper classes such as text escaper, file utilities, log outputter, stopwatch, string expander etc.
    <page:include template="slave2.xeb">
+
    <page:controller class="SLAVE2_CONTROLLER" />
+
        <page:define_region id="greetings">
+
        </page:define_region>
+
    </page:include>
+
</xml>
+
  
With these techniques we would be able to minimize duplicated code and hence errors in the xeb files, which are difficult to debug.
+
=== Xebra Tags ===
 +
Contains all super classes used for xebra tags and xebra tag arguments. Also contains super classes for servlet generation (XGEN_SERVLET_GENERATOR).
  
This code will generate exactly three servlets, SLAVE1_SERVLET.e , SLAVE2_SERVLET.e and SLAVE3_SERVLET.e. master.xeb and form.xeb are fragments. SLAVE1_SERVLET inherits the controller from the master page, while SLAVE2_SERVLET "overwrites" this definition and uses SLAVE2_CONTROLLER. All the pages which are deferred (like master.xeb) are not compiled to servlets. Neither are pages which are denoted with the tag page:fragment.
+
===Xebra Web Application===
Template pages could be used to differentiate views based on roles. For instance one could think of roles like 'guest', 'user' and 'admin'. 'guest' and 'user' would then have pages which inherit from a 'master_page', implementing their own menus. 'admin' in contrast would inherit from 'user', since it is a user with additional rights. So it would have to extend the menu and contents. Sub pages which have been added through page:include could act as master pages as well, further encouraging code reuse.
+
  
===Xeb===
+
Provides all necessary base classes such as XWA_SERVLET, XWA_CONTROLLER, XWA_APPLICATION to webapp applications. Takes care of communication with server.
===Form===
+
 
 +
= Other =
 +
* [[Xebra Benchmarks|Benchmarks]]
 +
 
 +
== 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

Latest revision as of 08: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