Version 5.2 |
|||||||||||||||||||||||||||||||||
|
|
The following is a sample of an WSSP document:
<html> <body> <h1>Welcome to %%server%%. Your ID is %%ID%%.</h1> <!--%%IF EXISTS(lastLogin)--> Last time you visited us on %%lastLogin%% <!--%%ENDIF--> </body> </html>
This WSSP document contains the %%server%%, %%ID%%, and %%lastLogin%% text elements, and the <!--%%IF EXISTS(lastLogin)--> and <!--%%ENDIF--> structural elements (these text elements are fictitious, do not try to use these samples in your real .wssp pages).
If the WSSP document should contain non-ASCII symbols, the UTF-8 character set should be used. When the WSSP document is being processed, the Web Application module retrieves the charset string value from the produced data dictionary. If this value is not UTF-8, then the WSSP text is converted into this page charset.
The text and structural WSSP elements use expressions - combinations of names and symbols that specify the data to be retrieved from the data dictionay or from other available sources.
The WSSP scripting uses several types of expressions:
An alphanumeric string (such as system or id) is
a data element name. The value of such an expression is the dataset value associated
with this name. If the dataset does not have a specified key, the expression value is a null-value.
Example: the dataset contains the key system and its associated value is
the Sun Solaris string, the value of the expression system is the string
Sun Solaris.
The dataset dictionary is case-insensitive, so the data element names are case-insensitive, too.
An alphanumeric string followed by the [] symbols is interpreted as an index scanner name. It can be used only inside the <!--%%FOREACH name...--> ....<!--%%ENDFOR name--> structure where this index element is defined (see below). The index scanner names are case-insensitive.
An expression followed by the dot (.) symbol and an alphanumeric string is a keyed
element. The expression before the dot symbol is calculated, and its value should be
a dictionary. The alphanumeric string after the dot symbol specifies the key to be used to extract the
value from that dictionary. If the value of the expression before the dot symbol is not a dictionary,
or if it does not contain the specified key, the keyed element value is a null-value.
Keys can be specified as quoted strings, in this case they can specify non-alphanumeric symbols.
Example: the dataset contains the key settings and its associated value is
the 2-element dictionary: {OS = "Sun Solaris"; CPU = "sparc";}. The value of the
settings.OS expression is the Sun Solaris string, the value of
the settings."OS1" expression is a null-value.
An expression followed by an index expression in square bracket symbols ([index])
is an indexed element. The expression before the square bracket is calculated, and its value should be
an array or a dictionary. The index expression is calculated, and its value should be a number or a string representing a number.
This number specifies which array element or dictionary key becomes the value of this indexed expression.
If the value of the index expression is 0, the first array element or the first dictionary key string is retrieved .
An index expression can be specified as a numeric constant.
If the value of the expression before the bracket symbol is not an array or a dictionary, or if the value of the index expression
is not a number, or if the value of the index expression represents a number that is negative or
is equal or greater than the number of array or dictionary elements, the value of the index expression
is a null-value.
An alphanumeric string followed by the ( symbol is a function call. Elements
after the ( symbol specify the function parameters, and they are followed by the ) symbol.
Function names are case-insensitive.
The following list specifies the available functions and their parameters.
Key | Value |
---|---|
ID | a string with the unqiue identifier of this session |
accountName | a string with the session Account name |
domainName | a string with the name of the Domain the session Account belongs to |
filesRef | a string with the URL prefix needed to retrieve files from the session Skin |
fullAccountName | a string with the session Account full name: accountName@domainName |
loginAddress | a string specifying the network (IP) address the user was using when initiating this session |
loginTime | the timestamp with the session start time |
mailboxes | an array with the names of "selectable" mailboxes |
selectedMailbox | a string with the name of the target mailbox for the last Copy/Move operation |
webFolders | an array with the File Storage folder names |
selectedWebFolder | a string with the name of the target File Storage folder for the last Store File In operation |
webSiteEnabled | this "YES" string element exists if the storage limit for the File Storage is not set to zero |
Text elements are specified using double percent markers. The body of a text element is an expression with an optional prefix.
>=GO=>
>=GO=>
Stop%20It%3F
What do \"they\" think
%%TIME:elapsedTime%%will be substituted with the following string:
40 minutes
%%TIME:elapsedTime%%will be substituted with the
40minsstring.
symbols | substituted with |
^D | the day of month (2-digit) |
^d | the day of month (1- or 2-digit) |
^M | the month name (one of those returned with the MONTHNAMES() function), translated using DICTIONARY("DatePictures") |
^N | the month number (2-digit, from 01 to 12) |
^Y | the year number (2-digit) |
^y | the year number (4-digit) |
^s | the seconds value (2-digit) |
^m | the minutes value (2-digit) |
^H | the hours value (2-digit), from 00 to 23 |
^h | the hours value (1- or 2-digit), from 12,1 to 11 |
^t | the AM or PM string, translated using DICTIONARY("DatePictures") |
^w | the weekday number (Sun - 0) |
^W | the weekday name (one of those returned with the WEEKDAYS() function), translated using DICTIONARY("DatePictures") |
Test Subje..
%%HTMLSUBST(STRING("text1"),var2):STRING("text2")%%will be substituted with
comparing My String1 & My Var2.
The structural elements start with the <!--%% symbols and end with the --> symbols. The structural elements themselves are always removed from the resulting markup code.
<!--%%IF EXISTS(lastLogin)-->We have not seen you since <i>%%HTML:lastLogin%%<iI> <!--%%ELSE-->Welcome, new user! <!--%%ENDIF-->In this example, if the dataset contains the lastLogin element with the 20-Apr-2007 string value, this script portion will produce
<table border="1"> <tr><td>File Name</td><td>File Size</td></tr> <!--%%FOREACH elem in fileList--> <tr><td>%%HTML:elem[].name%%</td><td>%%elem[].size%%</td></tr> <!--%%EMPTYFOR elem--> <tr><td colspan="0"> </td></tr> <!--%%ENDFOR elem--> </table>
<table border="1"> <tr><td>File Name</td><td>File Size</td></tr> <tr><td>MyReport</td><td>2300</td></tr> <tr><td>My Old Report</td><td>4000</td></tr> </table>
<!--%%NUMERICMENU sizeLimit IN (-1,0,100,200,300)-->will be substituted with the following markup text:
<option value="-1">-1<option value="0">0 <option value="100">100<option value="200" selected>200<option value="300">300
<!--%%NUMERICMENU sizeLimit IN (-1,0,100,200,300) DISPLAY DICTIONARY("Limits")-->will be substituted with the following markup text:
<option value="-1">Unlimited<option value="0">Off & Shut <option value="100">100<option value="200" selected>200<option value="300">300
<!--%%NUMERICMENU sizeLimit DEFAULT defLimit IN (-1,0,100,200,300) DISPLAY DICTIONARY("Limits")-->will be substituted with the following markup (HTML) text:
<option value="-2">default(Unlimited) <option value="-1">Unlimited<option value="0">Off & Shut <option value="100">100<option value="200" selected>200<option value="300">300
<!--%%ENUMMENU color IN colors-->will be substituted with the following markup (HTML) text:
<option value="0">Blue<option value="1" selected>Green<option value="2">Red
<!--%%ENUMMENU color IN colors DISPLAY DICTIONARY("Colors")-->will be substituted with the following markup (HTML) text:
<option value="0">Night Blue<option value="1" selected>Grass Green<option value="2">Red
<!--%%ENUMMENU color DEFAULT defColor IN colors DISPLAY DICTIONARY("Colors")-->will be substituted with the following HTML text:
<option value="-1">default(Night Blue)<option value="0">Night Blue <option value="1" selected>Grass Green<option value="2">Red