Wafl Home

Using Web Servers Tutorial

Configuration File Example

An Example of Wafl Service Configuration File

<!-- Wafl service definition. Mandatory. -->
<WaflService 
    <!-- The service name. Mandatory. -->
    name="My Site"
    <!-- The service type. Optional. If specified, it must be "WWW". -->
    type="WWW"
    <!-- The service description. Optional. Default value is empty string. -->
    description="This is a test site"
>
 
    <!-- 
        Specific definitions for WWW service.
        This tag is mandatory if the service type is "WWW".
    -->
    <WWW>
        <!-- 
            Host names dedicated to this service.
            Optional. 
            It should not be specified if there is only one Wafl site per server 
            or the high isolation is specified at server.
            It is mandatory in any other case.
            Multiple host names are allowed.
        -->
        <Host name="www.waflproject.org" />
        <Host name="123.123.123.123" />
        <Host name="127.0.0.1" />
        <Host name="localhost" />
 
        <!-- Base path for this service. Optional. Default value is "/". -->
        <Basedir path="/home" />
    </WWW>
 
    <!-- 
        Service directories. This tag is mandatory. 
        Relative paths may be used for Wafl Web Server.
    -->
    <Directories
        <!-- The root directory of the service. Optional. -->
        serviceRoot="D:\My Site\wwwroot" 
        <!-- The directory with service libraries. Mandatory. -->
        serviceLib="D:\My Site\wafllib"
        <!-- The directory with system libraries. Mandatory. -->
        systemLib="C:\Program Files\Wafl\Lib"
    />
 
    <!-- Default service settings. This tag is mandatory. -->
    <Default
        <!-- The default service file -->
        file="index.wafl"
        <!-- The default type of the resources -->
        mimetype="text/html"
    />
 
    <!-- Database settings. Optional. -->
    <Database
        <!-- Database driver. Mandatory. -->
        driver="DB2"
        <!-- Database alias. Mandatory. -->
        alias="WaflDB"
        <!-- Username for the db connection. Mandatory. -->
        username="wafluser"
        <!-- Password for the db connection. Mandatory. -->
        password="wafluserpassword"
    />
 
    <!-- The service evaluators settings. Optional -->
    <Evaluators
        <!-- 
            The maximum count of evaluator threads. 
            Should not be larger than 4 times processor cores.
            Optional. Default value is "4" 
        -->
        maxthreads="4"
    />
 
    <!--
        The debugging settings.
        Optional. Default mode is without debugging features.
    -->
    <Debug
        <!-- Is the debug mode on (1) or off (0)? -->
        on="1"
        <!-- The path and name base for log files -->
        errLogFileBase="D:\My Site\log\[WaflSite]"
    />
 
    <!-- Application and environment settings. Optional. -->
    <Parameters>
        <!-- 
            Wafl service parameters. 
            Optional. Multiple parameters supported. 
        -->
        <Param name="testvar1" value="testvalue1" />
        <!-- 
            Parameters of process environment. 
            Optional. Multiple parameters supported. 
        -->
        <!-- DB2 communication protocol. -->
        <EnvParam name="DB2COMM" value="TCPIP" />
    </Parameters>
 
</WaflService>

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.