Subversion Repositories wimsdev

Rev

Rev 17228 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5798 bpr 1
<p>
17238 bpr 2
  Each WIMS module has a private home directory in which go all the files
15246 obado 3
  of this module.
4
</p>
32 reyssat 5
A module must have at least the following files:
17238 bpr 6
!!tit contains <li>
1091 bpr 7
<ul>
15246 obado 8
    $tit A variable definition file $emph var.def$emphend. $titend
9
    This file defines $emph external$emphend variables of the module. A parameter given by the
10
    user must have a name declared in this file, except parameter names reserved by
17238 bpr 11
    WIMS (cmd, session, module, ...). And exactly variables declared in this
15246 obado 12
    file will be saved in the session directory (to be recalled at the next
13
    request from the same session).
17238 bpr 14
  </li>
15246 obado 15
    $tit A variable processing file $emph var.proc$emphend.$titend
16
     This file is processed at EACH request of the module (except special
17
     requests: when cmd=intro or getins).
17238 bpr 18
  </li>
15246 obado 19
    $tit A main phtml file $emph main.phtml$emphend.$titend
20
    This file will be processed at avery request to the module, except under
21
    special commands (when cmd=intro or getins).
17238 bpr 22
  </li>
15246 obado 23
    $tit An indexing file $emph INDEX$emphend, which defines the application's nature.$titend
17238 bpr 24
    This file will be used by WIMS database for searching available modules.
15246 obado 25
  </li>
1091 bpr 26
</ul>
15246 obado 27
<p>And it may often contain the following (optional) files too:</p>
32 reyssat 28
<ul>
15246 obado 29
    $tit A variable initialisation file $emph var.init$emphend.$titend
30
    This file has the same syntax as the file $emph var.proc$emphend, and is processed
31
    exactly at requests with cmd=new or cmd=renew.
17238 bpr 32
  </li>
15246 obado 33
    $tit A introductory page $emph intro.phtml$emphend.$titend
34
    This is a phtml file, which is processed when the module is
35
    accessed with cmd=intro. It is usually used to introduce the content of the
36
    module, and to let the user choose starting options.
37
  </li>
32 reyssat 38
</ul>
15246 obado 39
<p>
40
  There may be any number of other files, like a $emph README.md$emphend file, one or more
41
  help pages, an $emph about$emphend page, one or more graphics files, files called by one
42
  of the above mandatory or optional files, etc.
5798 bpr 43
</p>
15246 obado 44
 
17228 bpr 45
<hr><h4>Variable processing files</h4>
5798 bpr 46
<p>
15246 obado 47
  The files $emph var.init$emphend and $emph var.proc$emphend,
48
  as well as any files called by these two
49
  files, are variable processing files.
50
</p><p>
51
  A variable processing file is divided into lines, separated by
52
  non-escaped new-line characters. A new-line character can be escaped by the
53
  character $emph \$emphend, in which case it does not separate the two lines
54
  before and after it.
5798 bpr 55
</p>
32 reyssat 56
Every line of a variable processing file must be one of the following:
57
<ol>
15246 obado 58
  <li>A comment line, whose first non-space character is either the character
59
    $emph #$emphend, or $emph!$emphend followed by another $emph!$emphend.
60
  </li>
61
  <li>A variable definition line, in the form of
62
    $emph name$emphend=$(emph)value$emphend. The content of
63
    $(emph)value$emphend may be a string (if this string contains a new-line
17238 bpr 64
    character, it must be escaped by the character $emph \$emphend), or a WIMS
15246 obado 65
    variable command (which must then start with the character $emph!$emphend).
66
  </li>
67
  <li>A command line, whose first non-space character is the character
68
    $emph!$emphend, followed by the command name and optional parameters.
17228 bpr 69
    <br>If the command produces an output string, this output will be ignored.
15246 obado 70
  </li>
71
  <li>A label line, whose first non-space character is the character
72
    $emph:$emphend, followed by the name of the label. Anything following the
73
    label name will be considered as comment and ignored by the interpreter.
17228 bpr 74
    <br>Label is used in conjunction with the jumping command
15246 obado 75
    $emph!goto$emphend.
17228 bpr 76
    <br>A label starting with the character '*' is catch-all, matching any
15246 obado 77
    $emph!goto$emphend label.
78
  </li>
79
  <li>
17238 bpr 80
    Any line not fitting into one of the above 4 will generate a WIMS error
15246 obado 81
    message.
82
  </li>
83
</ol>
32 reyssat 84
 
17228 bpr 85
<hr><h4>Phtml files</h4>
5798 bpr 86
<p>
15246 obado 87
  The files main.phtml and intro.phtml, as well as any files called by these
88
  two files, are phtml files (programmable html).
5798 bpr 89
</p><p>
15246 obado 90
  A phtml file is an ordinary html file, except for lines whose
91
  first non-space character is a $emph!$emphend or a $emph:$emphend.
5798 bpr 92
</p><p>
15246 obado 93
  Lines can be escaped by $emph\$emphend, just as in the case of a variable
94
  processing file.
5798 bpr 95
</p><p>
15246 obado 96
  A line starting with $emph:$emphend is a label line, as in the case of a
97
  variable processing file.
5798 bpr 98
</p><p>
15246 obado 99
  A line starting with $emph!$emphend is a command line, as in the case of a
100
  variable processing file. To the difference that if the command produces an
101
  output string, this output will be inserted into the html page, at the place
102
  of the line.
5798 bpr 103
</p><p>
15246 obado 104
  Lines not of the above two types will be sent to the http client, after
105
  substitution of variables.
5798 bpr 106
</p>