docs.roxen.comView this page in a printer friendly mode
DocsRoxen2.2Web Site Creator ManualRoxen Concepts
Copyright © 2004, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com
 DEMO  DOCS  PIKE
 COMMUNITY  DOWNLOAD
www.roxen.com

   

RXML Evaluation
URL Extensions

Roxen Concepts

Before looking into the actual features provided for static and dynamic page generation, let's have a look at what we want to accomplish with these features. The following list outlines four major properties in the WWW that must be implemented on the server side to be reliable and secure.

  • Connection to content generation, such as image rendering or database retrieval.

  • Interaction, such as posting information on chat boards, committing polls or performing searches in search engines.

  • Monitoring and control, such as bandwidth throttling, access control and page access counters.

  • Traffic control, such as HTTP cache settings and HTTP redirects.

Furthermore we want to be able to do content/layout separation as well as using macro functions to shorten development time and ease maintenance. Though these two properties does not have to be done at the server side, it is a good compromise between letting a content generation program creating static content and relying on the client to interpret the information correctly.

Scripts

Traditionally scripts has been the answer to demand for the above properties. A script is a small program that is run when a client has requested a certain URL, and the output from the program is then sent back to the client. The benefits are complete control over the transaction enabling implementation of all the above properties, but there are several drawbacks. Scripts are more expensive to handle, since you need programmers to create programs, and it is difficult to reuse the script code in an efficient manner.

Several types of scripts are supported by Roxen WebServer. Pike scripts are the most efficient, since they run inside the server process itself. The second most efficient way of using scripts is using the Extscript feature in Roxen, currently supporting Perl, which keeps the overhead of starting a Perl interpretor low by letting several requests use the same interpretor before it is discarded. Finally Roxen WebServer supports the FCGI and CGI interface making it possible to run virtually any script.

Modules

Modules in Roxen WebServer can be considered as scripts through which all requests passes, and it is up to the module to decide when to react on a request. This solves both the problems with scripts, that they are not general and that they are not as manageable. The script code can now be reused for any page that we like, e.g. by inserting a marker into the page or by explicitly adding the page URL to that modules configuration. The use of markers to trigger some kind of action in the module, e.g. inclusion of certain data, also makes the web site more manageable, since backend programmers and page designers now work on different levels.

This description of modules is an oversimplification, since there are many different kinds of modules in Roxen WebServer, with different tasks and ways to be activated. Read the Adminstrator and Programmer manual for more in-depth information.

RXML

RXML is Roxens own "marker system" for many of its modules. RXML, RoXen Makro Language (it was invented before XML), is a functional, serverside, XML compliant scripting language that easily integrates itself with web content. Since its syntax is already familiar for many it is often very easy to learn. Its tight integration with the XML in the pages enables the module programmer to keep as little HTML as possible in the program code, thus leaving more creative freedom to the web designer, i.e. a good separation between layout and functional code.


<table>
<emit source="sql" query="select * from users">
  <tr><td>&_.name;</td><td><a href="mailto:&_.email;">&_.email;</a></td></tr>
</emit>
</table>

In-page scripting

To "complete the circle" it should also be mentioned that it is possible to do in-page scripting, i.e. putting functional code inside the actual web pages. This is currently possible with Pike code and Perl code.