Subversion Repositories wimsdev

Rev

Rev 5766 | Rev 5920 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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