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