diner - THE HTTP-server for the BeOS
Contents

diner ]
Introduction ]
What's new? ]
Installation ]
Configuration ]
Usage ]
Licence ]
Contact ]
Thanks ]
Features ]
Availability ]
Environment ]
Inline Module Invocation ]
Restrictions ]
Known bugs and problems ]
Future ]
History ]

InlineModuleInvocation

This module's main purpose is to parse HTML pages and fill in variables that are in that page. These variables are filled out by different modules, some of them are internal, but in the feature an addon-interface will be available so you can add your own modules to this system.

To realize this dynamic server parsed HTML, three new tags are introduced:

<Block [BlockName] [Argument1 Argument2 ...]>
</Block>

<Var [VariableName]>

They should not collide with existing tags, but to make this system more compatible to future changes in HTML or for new stuff like XML, these tags will be user definable in the next version of the InlineModuleInvocation addon.

"<Block [BlockName] [Argument1 Argument2 ...]>" starts a new block with the name "BlockName". Some blocks may use the additional arguments, some don't.

"</Block>" ends the current block. Inside a block you can have normal HTML mixed with other blocks. Inside these blocks you can have as much variables defined with "<Var [VariableName]>" as you like.

At the end of a block, an internal module is called which replaces all the variables with their values. If a module with the given name does not exist, the whole block is stripped from the generated page. If a variable does not exist, it depends on the called module wether it is just stripped or replaced by a warning. Some modules may not only replace the variables, but also repeat the block contents multiple times.

Please have a look at the templates now to get an idea how the templates work.

Currently there are three modules available:

  • CGI
  • Query
  • List


"CGI" can be used to insert given CGI parameters into the page. For example if the BeMall application would be accessed like

http://www.yourhost.com/BeMall?Test=HelloWorld


the variable "Test" in the template would be replaced by "HelloWorld". The template

.
.
<Block CGI>
The parameter "Test" has the value "<Var Test>".
</Block>
.
.

would result in the page

.
.
The parameter "Test" has the value "HelloWorld".
.
.


"Query" realizes the BeOS queries for your HTML pages. For every item found, the block is filled out and added to the HTML file. The variables are replaced by the attributes from the item. For example if you want to list all the "People" from your system:

.
.
<table>
<tr><th>Name</th><th>Phone</th><th>E-mail</th></tr>
<Block Query "META:name=*">
<tr><td><Var META:name></td><td><Var META:phone></td><td><Var META:mail></td></tr>
</Block>
</table>
.
.

"List" is very similar, but it just lists the file from a given directory. For every item found, the block is filled out and added to the HTML file. The variables are replaced by the attributes from the item. For example if you want to list all the "People" from /boot/home/people:

.
.
<table>
<tr><th>Name</th><th>Phone</th><th>E-mail</th></tr>
<Block List "/boot/home/people">
<tr><td><Var META:name></td><td><Var META:phone></td><td><Var META:mail></td></tr>
</Block>
</table>
.
.

Copyright © 1997-99 Stegemann & Co., Inc., all rights reserved.
Created: November 29th, 1997. Last modified: January 13th, 1999.