|
|
(52 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]] |
| | | |
− | A Xebra Web Application consists of two parts: The xeb-files and the controllers. Xeb-files consist of html code with embedded xeb-tags. They are translated to servlets. Controllers are Eiffel classes that connect the servlets to the rest of the Eiffel classes. Features of controllers can be invoked from within a servlet. Typically, web designers create xeb-files with a html editor and at the same time, web developers create controllers to provide business logic to the servlets. The web application is then translated which means that the xeb-files are generated to servlet eiffel classes and the whole webappliation is compiled to an executable file. The translation and compilation of the web application is initiated by the xebra server.
| + | ==XML_RPC== |
| + | * [[Xebra XML_RPC]] |
| | | |
− | For a step by step guide on how to create a web application see [[Xebra_Tutorial|tutorials]].
| + | =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). |
| | | |
− | =Comparison to other technologies= | + | === Xebra AST Elements === |
− | Some of the features of Xebra are:
| + | 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. |
− | * Fully XML compatible for ease of xeb file validation
| + | AST Elements can be serialized to a text representation. |
− | * Mapping of forms to objects and validation framework
| + | It also contains some specialized classes for Xebra. |
− | {| id="sortable_table_id_1" border="1" cellpadding="4"
| + | |
− | ! align="left" valign="middle" | Project
| + | |
− | ! Language
| + | |
− | !
| + | |
− | [http://en.wikipedia.org/wiki/Ajax_%28programming%29 Ajax]
| + | |
− | !
| + | |
− | [http://en.wikipedia.org/wiki/Model-view-controller MVC]framework
| + | |
− | !
| + | |
− | [http://en.wikipedia.org/wiki/Web_application_framework#Push-based_vs._Pull-based MVC Push/Pull]
| + | |
− | !
| + | |
− | [http://en.wikipedia.org/wiki/Internationalization_and_localization i18n & l10n]
| + | |
− | !
| + | |
− | [http://en.wikipedia.org/wiki/Object-relational_mapping ORM]
| + | |
− | ! Testing framework(s)
| + | |
− | ! DB migration framework(s)
| + | |
− | ! Security Framework(s)
| + | |
− | ! Template Framework(s)
| + | |
− | ! Caching Framework(s)
| + | |
− | ! Form Validation Framework(s)
| + | |
− | |-
| + | |
− | | align="left" valign="middle" |
| + | |
− | [http://dev.eiffel.com/Xebra '''Xebra''']<br />
| + | |
− | | valign="top" |
| + | |
− | [http://www.eiffel.com Eiffel]
| + | |
− | | valign="top" | Can be added later on (using for instance Script.aculo.us)<br />
| + | |
− | | valign="top" | Yes<br />
| + | |
− | | valign="top" | Pull<br />
| + | |
− | | valign="top" | planned<br />
| + | |
− | | valign="top" | No<br />
| + | |
− | | valign="top" | Contracts, Unit Tests<br />
| + | |
− | | valign="top" | <br />
| + | |
− | | valign="top" | planned<br />
| + | |
− | | valign="top" | Yes<br />
| + | |
− | | valign="top" | planned<br />
| + | |
− | | valign="top" | Yes<br />
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Apache_Struts '''Apache Struts''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java]
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | | Push & Pull
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests]
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/ASP.NET_MVC_Framework '''ASP.NET MVC''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/ASP.NET ASP.NET]
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | | Push
| + | |
− | | <br />
| + | |
− | | ORM-independant
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests]
| + | |
− | | <br />
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/ASP.NET ASP.NET]Forms Auth
| + | |
− | | pluggable (default is WebForms)
| + | |
− | | Yes
| + | |
− | | Yes (client-side via plugins)
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Drupal '''Drupal''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/PHP PHP]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/JQuery jQuery]
| + | |
− | |
| + | |
− | Yes[http://en.wikipedia.org/wiki/List_of_web_application_frameworks#cite_note-1 [2]][http://en.wikipedia.org/wiki/List_of_web_application_frameworks#cite_note-2 [3]]
| + | |
− | | <br />
| + | |
− | |
| + | |
− | Yes[http://en.wikipedia.org/wiki/List_of_web_application_frameworks#cite_note-3 [4]][http://en.wikipedia.org/wiki/List_of_web_application_frameworks#cite_note-4 [5]]
| + | |
− | |
| + | |
− | multiple (CCK, QCubed)[http://en.wikipedia.org/wiki/List_of_web_application_frameworks#cite_note-5 [6]]
| + | |
− | | simpletest, devel
| + | |
− | | Schema API
| + | |
− | |
| + | |
− | OG, Node Privacy By Role,[http://en.wikipedia.org/wiki/Access_control_list ACL], Taxonomy Access List
| + | |
− | | PHPTemplate, Smarty, XTemplate, others
| + | |
− | |
| + | |
− | builtin,[http://en.wikipedia.org/wiki/Memcache memcache],[http://en.wikipedia.org/wiki/Alternative_PHP_Cache APC]
| + | |
− | | Form API
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Google_Web_Toolkit '''Google Web Toolkit''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java],[http://en.wikipedia.org/wiki/Javascript Javascript]
| + | |
− | | Yes
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | | , no direct data access
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/JUnit JUnit](too early),[http://en.wikipedia.org/w/index.phptitle=JsUnit&action=edit&redlink=1 jsUnit](too difficult),[http://en.wikipedia.org/wiki/Selenium_%28software%29 Selenium](best)
| + | |
− | | No
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Ruby_on_Rails '''Ruby on Rails''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Ruby_%28programming_language%29 Ruby]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework Prototype],[http://en.wikipedia.org/wiki/Script.aculo.us script.aculo.us]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/ActiveRecord_%28Rails%29 ActiveRecord],[http://en.wikipedia.org/wiki/Ruby_on_Rails Action Pack]
| + | |
− | | Push
| + | |
− | | Localization Plug-in
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/ActiveRecord_%28Rails%29 ActiveRecord]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests], Functional Tests and Integration Tests
| + | |
− | | Yes
| + | |
− | | Plug-in
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Seaside_web_framework '''Seaside''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Smalltalk Smalltalk]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework Prototype],[http://en.wikipedia.org/wiki/Script.aculo.us script.]aculo.us, etc.
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/w/index.phptitle=GLORP&action=edit&redlink=1 GLORP],[http://en.wikipedia.org/wiki/Gemstone_Database_Management_System Gemstone/S], etc.
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests], SUnit
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | | No, intentionally
| + | |
− | | <br />
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Magritte_%28software%29 Magritte]
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/w/index.phptitle=Sphere_Framework&action=edit&redlink=1 '''Sphere''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/PHP PHP]5
| + | |
− | | Toolkit Independent
| + | |
− | | Yes
| + | |
− | | Push, supports Helpers
| + | |
− | | Yes
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Active_Record_Pattern Active Record Pattern]
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests]
| + | |
− | | <br />
| + | |
− | | via module
| + | |
− | | plain PHP by default, can use Smarty or other
| + | |
− | | via module, APC, etc
| + | |
− | | via module
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Spring_Framework '''Spring''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Java_%28programming_language%29 Java]
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | | <br />
| + | |
− | | Yes
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Hibernate_%28Java%29 Hibernate], iBatis, etc
| + | |
− | | <br />
| + | |
− | | <br />
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Spring_Security Spring Security (formerly Acegi)]
| + | |
− | |
| + | |
− | Commons Tiles,[http://en.wikipedia.org/wiki/Apache_Velocity Velocity], etc.
| + | |
− | | ehcache etc.
| + | |
− | | Commons Validator
| + | |
− | |-
| + | |
− | ! align="left" valign="middle" |
| + | |
− | [http://en.wikipedia.org/wiki/Zend_Framework '''Zend''']
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/PHP PHP]5 (>=5.2.4)
| + | |
− | | Toolkit-independent
| + | |
− | | Yes
| + | |
− | | Push & Pull
| + | |
− | | Yes
| + | |
− | | Table and Row data gateway
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Unit_testing Unit Tests]
| + | |
− | | Yes
| + | |
− | |
| + | |
− | [http://en.wikipedia.org/wiki/Access_control_list ACL]-based
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | | Yes
| + | |
− | |}
| + | |
| | | |
− | =Xebra Libraries= | + | === Xebra Common === |
− | ===Page=== | + | |
− | The ''page'' libraries consists of the core tags needed for page configuration and composition. The Tags are:
| + | |
| | | |
− | {| class="wikitable"
| + | 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. |
− | ! 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 where including pages can add specific html code.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <page:define_region id="...">
| + | |
− | ...
| + | |
− | </page:define_region>
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Can only be used inside a page-include tag. Will insert the content into the templates regions (with the same id). See page-include.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <page:include id="..." />
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Includes an other xeb page. If the included page has declare-region tags they have to be implemented with define-region tags.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | </page:fragment>
| + | |
− | </xml>
| + | |
− | |
| + | |
− | If used the page is not transformed to a servlet.
| + | |
− | |}
| + | |
| | | |
| + | === 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. |
| | | |
− | ====Example==== | + | === 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. |
| | | |
− | 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 Http === |
| | | |
− | '''master.xeb'''
| + | Xebra_http provides classes for cookies, html requests, html responses, sessions and their parsers. |
− | <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 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]]. |
| | | |
− | '''slave1.xeb'''
| + | === Xebra Taglibrary Form === |
− | <xml>
| + | 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]]. |
− | <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>
| + | |
| | | |
− | slave1.xeb uses master.xeb as a template and includes it via the page-include tag. Since master.xeb declares two regions, slave1 defines them. The content of the define-region tags are inserted at the locations of the respective declare-region tags of the template. From this xeb file a servlet is generated.
| + | === Xebra Taglibrary XRPC === |
− | Additionally since it's not declaring any controller all controller calls are redirected to the ones in the template.
| + | This tag library contains tags for XML-RPC applications. For further information see [[Xebra_Taglib_XRPC|here]]. |
| | | |
− | '''slave2.xeb'''
| + | === Xebra Utilities === |
− | <xml>
| + | |
− | <page:include template="master"
| + | |
− | <page:define_region id="form">
| + | |
− | Other region 2
| + | |
− | </page:define_region>
| + | |
− | </page:include>
| + | |
− | </xml>
| + | |
− | Templates can also be just imported partially. In slave2.xeb just the "form"-part of the template is implemented. This means that slave2.xeb is itself a template and will not be translated to a servlet.
| + | |
| | | |
− | slave3.xeb
| + | Xebra_utilities is a collection of independent helper classes such as text escaper, file utilities, log outputter, stopwatch, string expander etc. |
| | | |
− | <xml>
| + | === Xebra Tags === |
− | <page:include template="slave2.xeb">
| + | Contains all super classes used for xebra tags and xebra tag arguments. Also contains super classes for servlet generation (XGEN_SERVLET_GENERATOR). |
− | <page:define_region id="greetings">
| + | |
− | </page:define_region>
| + | |
− | </page:include>
| + | |
− | </xml>
| + | |
− | This last example uses slave2.xeb as a template, which has one remaining region to implement: "greetings. The controller is still inherited from master.xeb, that is, controllers are transitive.
| + | |
| | | |
− | With these techniques we would be able to minimize duplicated code and hence errors in the xeb files, which are difficult to debug.
| + | ===Xebra Web Application=== |
| | | |
− | ===Xeb===
| + | Provides all necessary base classes such as XWA_SERVLET, XWA_CONTROLLER, XWA_APPLICATION to webapp applications. Takes care of communication with server. |
− | {| class="wikitable"
| + | |
− | ! Tag
| + | |
− | ! Description
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:call feature="..." />
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Calls the feature on the controller on render-time.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:loop times="..." >
| + | |
− | ...
| + | |
− | </xeb:loop>
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Loops its content "times" times.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:redirect url="..." />
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Redirects the server to a new page at "url". The redirect is done server internally.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:iterate list="..." variable="..." type="...">
| + | |
− | </xeb:iterate>
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Iterates over a list (defined with "list" as a controller call). The current item is stored in "variable" which is of type "type". This variable is then available for its children.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:container>
| + | |
− | ...
| + | |
− | </xeb:container>
| + | |
− | </xml>
| + | |
− | |
| + | |
− | This simple tag just groups parts of the site. Can be used to conditionally render some parts with the "render" attribute.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | <xeb:display feature="..." />
| + | |
− | </xml>
| + | |
− | |
| + | |
− | The display tag simply displays what is written in feature.
| + | |
− | |}
| + | |
| | | |
− | ===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>
| + | == Howtos == |
− | <table >
| + | ===Build Windows Installer=== |
− | <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==
| + | * Install apache (c:\apache) |
− | While most tag attributes are plain text and thus static, sometimes it is useful or even necessary to use dynamically bound attributes.
| + | *Visual Build Professional 7: |
− | In Xebra there are two different types of dynamic attributes:
| + | **Open xebra\tools\installer\win\XebraBuild.bld |
− | | + | **Adapt Macro->Project variables to match your system (APACHE, ROOT) |
− | {| class="wikitable"
| + | **Run |
− | ! Tag
| + | *Inno Setup 5 Compiler |
− | ! Description
| + | **Open xebra\tools\installer\win\innosetup\xebra_install_test.iss |
− | |-
| + | **Generate new AppId |
− | |
| + | **Changed AppVersion |
− | <xml>
| + | **Check that LicenseFile file exists (gnu licence?) |
− | ... attr="%=call%"...
| + | **Check Source files are correct folder |
− | </xml>
| + | **Build |
− | |
| + | |
− | Call designates a controller feature which returns a STRING.
| + | |
− | |-
| + | |
− | |
| + | |
− | <xml>
| + | |
− | ... attr="#{variable.name}"...
| + | |
− | </xml>
| + | |
− | |
| + | |
− | Uses a - predefined (form/iterate) - variable to retrieve a value.
| + | |
− | |}
| + | |
On the following pages you can find the descriptions of the different tags of the available tag libraries.
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 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.
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.
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 provides classes for cookies, html requests, html responses, sessions and their parsers.
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.
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.
This tag library contains tags for XML-RPC applications. For further information see here.
Xebra_utilities is a collection of independent helper classes such as text escaper, file utilities, log outputter, stopwatch, string expander etc.
Contains all super classes used for xebra tags and xebra tag arguments. Also contains super classes for servlet generation (XGEN_SERVLET_GENERATOR).
Provides all necessary base classes such as XWA_SERVLET, XWA_CONTROLLER, XWA_APPLICATION to webapp applications. Takes care of communication with server.