Online documentation - Websydian v6.0 |
Users Guide | Patterns Reference | WebsydianExpress | Search |
Introduction Implementing Other Uses Example Background
The Dispatcher function of a Websydian application must be generated as an executable program. This executable program must have some external configuration parameters in order to load its HTML templates and perform certain kinds of data conversion. These configuration parameters are stored in different ways depending on the variant, i.e. the target platform:
Variant | External parameter storage |
---|---|
PC web server | AllFusion Plex generated INI file of Dispatcher in the section [HTML]. |
AS400 web server | iSeries data areas from the WSYD600 library. |
DWA - Java | AllFusion Plex property file obxxxclient.properties of the application. |
This section describes these settings in detail and explains how these external parameters are used by the Websydian functions.
INI file key | iSeries data area | Java Propery file | Description | Default |
---|---|---|---|---|
None | WSYDDECSEP | None | Defines the decimal separator for numbers. | . |
None | WSYDTHUSEP | None | Defines the thousand separator for numbers. | , |
DATE | WSYDDATMSK |
HTML.DATE |
Describes how a date value is formatted. | yyyy/mm/dd |
TIME | WSYDTMEMSK |
HTML.TIME |
Describes how a time value is formatted | hh:mm:ss |
TIMESTAMP | WSYDTMSMSK |
HTML.TIMESTAMP |
Describes how a timestamp value is formatted | yyyy/mm/dd hh:mm |
PATH | WSYDPATH |
HTML.PATH |
Specifies the location of the Document Templates. Usually a relative path is specified. | C:\; no default for iSeries web server |
The values of the parameters DATE, TIME and TIMESTAMP only apply to fields of type date, time or timestamp respectively, and not to numeric dates.
Example of an INI file section for the PC web server variant:
[HTML]
PATH=..\..\TempDocs\
DATE=mm/dd/yyyy
TIME=hh:mm:ss
TIMESTAMP=mm/dd/yyyy hh:mm
The parameters will be described in details in the following subsections.
Example of a property file section for the Java DWA variant
HTML.PATH=../../TempDocs/
HTML.DATE=mm/dd/yyyy
HTML.TIME=hh:mm:ss
HTML.TIMESTAMP=mm/dd/yyyy hh:mm
The PATH parameter is read by the Page Generator functions, and the value of the parameter is used to specify the path to the Documents Templates.
For the PC web server variant, it is possible to specify both absolute and relative paths. A relative path is preferable, since the web application then can be moved to another location without changing the parameters. A path is specified relative to the library of the run-time objects (e.g. the cgi-bin folder).
For the AS400 web server variant, an absolute path must be specified within the QDLS file system.
The parameters DATE, TIME and DATETIME are used by the Event Handler to interpret datetime fields, and by the Page Generator functions to format datetime fields. The values of these parameters are AllFusion Plex edit masks. Refer to the AllFusion Plex user guide for more information about edit masks.
The Event Handler pattern uses the three datetime parameters to determine the sequence of the individual elements in a datetime field. So the values of these parameters determine how the user should input these fields.
During validation, the edit mask is used only to determine the sequence of the day, month and year.
The Page Generator pattern uses the three datetime parameters to determine the display format and the number of letters of datetime fields, when they are written to the HTML page.
The external parameters will only be used when no FLD edited by LBL triple is specified for a field.
If a user with malicious intentions wants to force the web application to crash, he might try to send a large amount of data in order to use all available memory resources on the Web server.
To prevent this scenario, Websydian rejects any requests where the input exceeds a specified length. The field WorkFields<MaxContentLength> contains the maximum length of the input parameter string. The default value is 10 kb (10240 bytes) but this can be overridden in the 0 Set max content length edit point by assigning a new value to the field WorkFields<MaxContentLength>.
If the Dispatcher function is unable to find an Event Handler function with an implementation name that matches the received event WSYD_EVENT field, a standard Error Page will be generated.
This happens if a developer has forgotten to specify the FNC calls FNC triple between the Dispatcher function and a new Event Handler function:
A Websydian Error Page is called when no Event Handler function is found by the Dispatcher function.
The edit point 0 No events called is placed just before the call to the Error Page. Here, an alternative error message can be specified instead of the standard page generated by Websydian.
A similar Error Page will be generated if the Event Handler program does not exist. This Error Page will have the message text:
"Unable to call Event Handler."
The following only applies to the PC web server variant where the Websydian application should access an iSeries database.
When an AllFusion Plex application for the first time connects to the iSeries, the application uses settings in the applications-INI file to find its information about system, protocol, user ID, etc. If the user ID and password are not valid, a dialog box pops up where the user can enter user ID and password.
From this dialog box the entered user ID and password can be saved to the INI file.
Normally, this approach can be taken with a Websydian application as well. The user directly starts the web application in a browser on the web server machine. When the application then prompts for a userID and password, this information is entered as above.
However, due to the way IIS is running on a Windows Server, IIS is not able to display a dialog box because IIS is running as a service and not as a user process. This means that the applicaton will hang if it tries to display a Windows dialog box.
To avoid this, the option WSYD Connect to AS400 if no web should be used for the Dispatcher function:
Source Object | Verb | Target Object |
---|---|---|
ApplDispatcher | option NME ...Value SYS |
WSYD Connect to AS400 if no web Yes |
If this option is set to Yes and the Dispatcher function is started from the Windows environment, the Dispatcher function will call the iSeries service function DummyRpg, in order to establish a connection to the iSeries.
Before the web application can be run, the Dispatcher function must be run once from the physical Web server machine. When the Dispatcher function prompts for a user ID and a password, this information is entered and written to the INI file.
Now, when the web application is started, all the AS400 settings in the INI file are correct.
By default the Dispatcher function will remove trailing spaces in character fields when data is parsed from the user request sent from the browser.
This functionality can be disabled using the following function option:
Source Object | Verb | Target Object |
---|---|---|
MyPageGenerator | option NME ...value SYS |
Trim trailing blanks No |