6.5. Epilog File
The ‘epilog’ file (“clair.epi”), for “Full Record” display, which resides in the directory C:\ISIS\DATA and executes last. All the statements in it especially the conditional statements in it are executed and displayed at the bottom of the pertinent “pft” file. This produces the error messages as per the syntax error, controls the records to be displayed per page, the heading and the retrieved records detail, and displays the page number by generating it.
The following is the listing of the full file “clair.epi”
'<body ><center>',/ | |
select s(v1091) |
|
case '1':
'<H4>Fatal Error !</H4>'/, case '3': '<H4>Error in Search syntax ! Please reformulate the query</H4>'/, case '4': '<H4>Error: Search run-time exception !</H4>'/, case '5': '<H4>Error: Format syntax !</H4>'/, case '6': '<H4>Error: Format run-time exception !</H4>'/, case '7': '<H4>No records were retrieved !</H4>'/, |
|
,endsel, | |
if val(v1002)>val(v1032) then | |
'<form
action="/scripts/wwwi32.exe/[in=fjdclr.in]/"
method="post">'/ '<input type=hidden name="first" value="',f(val(v1032)+1,0,0), '">'/ '<input type=hidden name="bool" value="', v1021,'">'/ '<input type=submit name="button" value="Next 20 Records" style="font-size: 12pt; font-family: Arial; font-weight: bold">'/ '<input type=hidden name="tag6017" value="',f(val(v6017)+1,0,0), '">'/ '<input type=hidden name="tag6026" value="',f(val(v6026)+20,0,0), '">'/ '<input type=hidden name="tag6027" value="',f(val(v6027)+1,0,0), '">'/ '</form>' |
|
fi/ | |
if val(v1032)>20 then | |
'<br><H4><center>Please use the Back Button in your Browser to view previous page</center></h4><br>' | |
fi/ | |
'<font
size=3><p align="right"> [<a href="http:// www.libres.ait.ac.th /web-catalog.htm">Web Catalog</a>] nbsp; [<a href="http:// www.libres.ait.ac.th /guided-search.htm">Guided Search</a>] [<a href="http:// www.libres.ait.ac.th /simple-search.htm">Direct Search</a>] </p></font>'/ '<p align="center"><b><i><font color=" 660066">''Page # ' f(val(v6017)+1,0,0),/, '</font></i></b></p></body>', '</html>', |
To understand the working of this file a few functions and expressions used are explained here.
s(format expr)
Returns the string expression of the given format.
Ex:s(5) the output is 5 (string) |
select…. case …. [elsecase ….] endsel
select format expr | |
case option-1 :
statement-1 case option-2 : statement-2 case option-n : statement-n [elsecase format-0] |
|
endsel |
Evaluates the format expr and compares the result to each case option (option-1, option-2, … option-n). If the option matches the format expr, the appropriate instruction block is executed (format-1, format-2 … format-n), otherwise elsecase clause (if defined) is executed (format-0)
Note:The format expr must generate a string or numeric value. If format expr evaluates to string, all option values in case clauses must be of string type, otherwise, if format expr is numeric, option values must be also numeric. |
6.5.1. Error Messages Generation
select s(v1091) | ||
case '1': '<H4>Fatal Error
!</H4>'/, case '3': '<H4>Error in Search syntax ! Please reformulate the query</H4>'/, case '4': '<H4>Error: Search run-time exception !</H4>'/, case '5': '<H4>Error: Format syntax !</H4>'/, case '6': '<H4>Error: Format run-time exception !</H4>'/, case '7': '<H4>No records were retrieved !</H4>'/, |
||
,endsel, |
In the field tag 1091, WWWISIS stores the exit code, which is checked. It is being included in the epilog file to generate (error) messages by checking the exit code. Producing the error messages will help the users to find out what is the possible cause for error, if any.
6.5.2. Page Number Display
if val(v1002)>val(v1032) then | |||
| |
|||
'<input type=hidden name="tag6017" value="',f(val(v6017)+1,0,0), '">'/ | |||
| |
|||
fi | |||
'Page # ' f(val(v6017)+1,0,0),/, |
For the purpose of displaying page number at the bottom of each page, the related page number codes are included in the epilog file.
If the total matched records (v1002) is greater than the last “mfn” of that page tag (v1032) then all the statements in if condition execute.
‘<input type=hidden name=”tag6017” value=”’,f(val(v6017)+1,0,0), ‘”>’/
is one among them this also executes. When this is executed the tag 6017 equals to 1. Note this coding will not be executed until the “Next 20 Record” button is clicked.
Therefore first, the statement 'Page # ' f(val(v6017)+1,0,0),/, executes and prints the page number as 1. (Note tag 6017 has the value 0, when this statement executes. It evaluates to 1 because of ‘f’ function).
When the “Next 20 Record” button is clicked the‘<input type=hidden name=”tag6017” value=”’,f(val(v6017)+1,0,0), ‘”>’/ executes and v6017 equals to 1. Thereafter the‘Page # ' f(val(v6017)+1,0,0),/, executes and adds the value to v6017. Thereby v6017 equals to 2 (1+1) and its content prints the value 2 in the second page. This particular process takes place after each selection of “Next 20 Record” button.
6.5.3. Display Message Second Page Onwards
if val(v1032)>20 then | ||
Please use the Back Button in your Browser to view previous page | ||
fi/ |
The message “Please use the Back Button in your Browser to view previous page” is being set to display from the second page. Since 20 records are the maximum records printed per page, the value 20 is compared with the value of last “mfn” contained in tag 1032.