Monday, November 1, 2010

Section [UserData]

This section contains a list of custom, user-defined variables that can be used in WBSP files, in form:
UserVariable=AnyValue
These variables can be read using functions $WBRV and $WBRRV.
The user-defined variables in UserData section can contain WhizBase tags and functions, same as any WBSP system variable (variables starting with WB_).
Here is an example of UserData section in default.inc file in virtual hosts document root:
[UserData]
AdminEmail=admin@somemailserver.com
MyMailServer=mail.somemailserver.com
Later these variables can be accessed from your WBSP files like this:
[FormFields]
wb_mailserver=$wbrv{MyMailServer}
wb_bcc=$wbrv{AdminEmail}
Or like this:


some html code ...

Please send your comments/questions to
$wbrv[AdminEmail]

Thank you!
 

Subsection [Upload]

This subsection contains variables needed to control file upload using WBSP page. Using these variables, the developer can control where uploaded files will be saved, what is maximum size of a single file, what file types can not be uploaded, weather existing file will be overwritten or not, where to store log data and what prefix to add to URL of uploaded file. The variables that can be stored in this subsection are  (in alphabetic order):
WB_UploadLog
Here's an example of upload subsection (marked with blue):
[FormFields]
WB_BaseName=biblioA.mdb
WB_AllowMultipart=T
WB_Command=A
WB_UID=ISBN
WB_Redirect=titlesQ.wbsp
WB_RcdSet=Titles
[Upload]
WB_Disallow=![jpg,gif]
WB_UploadDir=images/
WB_Overwrite=T
WB_MaxFSize=24576
WB_UploadLog=upload.log
To learn more about uploading files using WBSP read the "Uploading files using WBSP" page.

read more

Section [Referrer Check]

Section Referrer Check defines what commands will require validation of referring page and what domains will be accepted as valid referrers.
It has a variable Referrer that contains a comma-separated list of servers (domains) that  will be accepted by WBSP engine as valid hosts for referring pages.
If this variable does not exist (or it is empty) then WBSP engine will not try to validate referrer. If you want to allow referring page to be located only on same server as WBSP file set this variable to $self$.
The main change from previous versions is that this section is part of the WBSP file while in previous versions it was part of WhizBase.ssc server-side configuration file.
Here is an example of Referrer check section:

[Referrer Check]
Referrer=whizbase.com,wbsp.com
 

Subsection [Include]

This subsection contains a list of files (respecting the WBSP path rules) that WBSP engine will check for input variables if they are not found in original WBSP file. Include files are processed backwards – from end to top of the list. WBSP will stop searching as soon as it finds first occurrence of the variable it search for.
Include files will be processed only if WBSP engine does not find the variable in WBSP file, but before WBSP engine tries to read variable from HTML form input fields. WBSP engine will read include files backwards (starting from the last file in the include section).

Here is an example of Include section (marked blue):




Titles


Year published Title ISBN
$wbf[Year published] $wbf[title] $wbf[ISBN]


$wbnavigator




And include file db.inc looks like this:
[FormFields]
WB_Basename=biblio.mdb

Special case are include files named default.inc.

read more

Subsection [FormFields]

This subsection contains the variables that are essential for processing WBSP file. Here you put information about the database, recordset, template, error template, log file, redirection, etc.
These are the variables that can be stored in FormFields subsection (in alphabetic order):

WB_DBReadDes WB_Debug
WB_FileName
WB_Null
WB_Usr
WB_WholeWord

Here's an example of FormFields section (marked blue):
[FormFields]
WB_basename=biblio.mdb
wb_rcdset=publishers
WB_Command=Q
wb_showlogo=F
wb_order=name




Publishers



$wbf[Name]

$wbsr[titles.sr]


Section [ErrorMessages]

This section contains a list of custom error messages in form:
ErrorNumber=ErrorMessage
ErrorNumber is standard number reported by WBSP engine. It can be either WhizBase error number or Jet  or any other error number. It is not recommended to put any Whizbase tags, functions, etc. in the  ErrorMessage, because it can produce unwanted results. If you need to place such content in  ErrorMessage, it is strongly recommended to test all possible situations before publishing the page to the real world. The exception to this is a reserved word $WBERRRED: followed by the URL of the web content where the WBSP engine will redirect visitor in the case of a specific error occurrence. This will work only if error occurs before WBSP sends HTTP header (e.g. if error  occurs before WBSP starts report rendering).
This is useful for translating the error messages from English or for using IMG HTML tag to display an image instead of error message, or to use block to process certain errors.

Here is an example of ErrorMessages section:
[ErrorMessages]
5034=
3030=
429=
5040=$WBERRRED:/requiredMissing.wbsp
 

Thursday, October 28, 2010

WBSP Server Side Configuration (wbsp.ssc)

WBSP server side configuration file is text file located in the same directory with engine file wbsp.exe. Both these files should not be accessible using HTTP protocol (they should be located above wwwroot directory of the web server or, if WSBP is used as CGI, in a directory without read access). 
WBSP.SSC file has three main sections and a separate configuration section for every virtual host on the server: