OpenWGA 7.6 - OpenWGA Concepts and Features

Design and development » WebTML » Basic concepts

Organisation

WebTML code is organized in WebTML modules, which is a type of text file in an OpenWGA designs. They contain the WebTML code as plaintext.

Each request that results in a WebTML page at first determines a single WebTML Module that will be the outer layout for this request. This choice is either directly done in the calling URL or indirectly by choosing a content document to display, whose content type in turn points to a WebTML module as outer layout. Details of this process can be looked up under Layout determination.

After the outer layout determination is done the WebTML module representing the outer layout is rendered with its complete WebTML code.

Of course it would be impractical and unmaintainable to contain the whole WebTML code making up a page in one outer layout module. Therefor WebTML code is able to include other modules using the tag <tml:include> and descendant tags:

<tml:include ref="header"/>

This includes a WebTML module of name "header", meaning that the code of that WebTML module is executed at the place where the include is specified, just like that code stood there instead.

The outer layout of a WebTML page typically contains dozens of WebTML includes where each is responsible for a special section of the page. Having functionalities in their separate WebTML modules of course also allows them to be used at multiple places of the site. They just need to be included where they are needed.

WebTML includes can be nested. An included WebTML include can include other modules itself. A nesting level down to 32 modules is allowed, where this barrier should be taken more as a protection from endless "self-inclusions" which would endanger the server.

Including the inner layout

A special type of include can be chosen if the current request has a main context: Including the inner layout of the main context document:

<tml:innerlayout/>

This follows the strategy of "Content-driven layout determination" (see Layout determination) in that the content to be displayed should choose the right layout. The <tml:innerlayout> tag includes the WebTML module that the content type of the main context content identifies as "inner layout".

This allows you to use the same outer layout  module for multiple content types while still differing on the inner layout between types, as the module to include here is not determined in layout but by the content itself.

Including WebTML portlets

Another special type of include in WebTML is the WebTML portlet

<tml:portlet name="news" ref="portlet:news:portlet"/>

The WebTML portlet is effectively another way to include a WebTML module but which allows more features for the module, like an own personalized storage, local scope variables, automatic AJAX reloading functionality and more. In short it supports true modular programming in WebTML.  See details about this feature in chapter WebTML portlets.