|
Detailed Description of a WebZ Session - continued
Start Page, Stage 1, Stage 2, Stage 3
Stage 1: The user sends a request to begin a WebZ session.
The user begins a WebZ session by opening the WebZ Logon screen in a browser, entering a user id and a password, then clicking the GO! button. In the example session discussed here, the user does not enter a unique user id or password but simply uses the WebZ OBI defaults (user id is WebZGuest, password is WebZGuest).
The Logon screen for the default style of the OBI is shown below. The HTML source code for the Logon screen is index.html, which is located in the htdocs/ directory of your WebZ installation. It is helpful to refer to the HTML source code as you proceed through this stage.
When the user clicks the GO! button, the browser sends an HTTP message (also called a user request) to WebZ instructing it to begin a new WebZ session.
The Content of the User Request
The following is the content of the HTTP message sent to WebZ when the user clicks the GO! button:
POST /WebZ/Authorize:sessionid=0: \ next=html%2Fhomeframe.html: \ bad=error%2Fauthofail.html: \ autho=WebZGuest:password=WebZGuest: \ x=14:y=20
Note: |
The backslashes ( \ ) are included for readability and are not part of the HTTP message. Also, the HTTP message shown above is a simplified version of the actual message that is sent to WebZ. If you were to look at the actual HTTP message as it appears in the JaSSI user log file, you would see that the message also includes information about the browser itself, the HTTP referer, and more. That kind of information, though interesting, will not be discussed in this topic because it does not play a role in how the interface is generated.
|
Description of the User Request
The following table describes each element in the HTTP message. As you go through the list, it is helpful to refer to the source code for the index.html file itself.
HTTP Message Element
|
Description
|
POST
|
The POST method is an HTTP command for sending structured data in the form of name-value pairs, such as "sessionid=0", or "name=WebZGuest". For more information on the POST command, consult an HTML reference guide.
The WebZ interface uses the POST method (and sometimes GET) to send user requests to WebZ.
|
/WebZ/
|
The WebZ namespace. When the web server receives an HTTP message containing this namespace, it directs the message to the WebZ Extension for processing. Every user request message must contain this namespace in order for WebZ to process the request. When you install WebZ on your system, the default namespace is "WebZ". You can change this value, but it is not recommended.
|
Authorize
|
This is a WebZ verb. A verb is a command that instructs WebZ to perform a particular action, such as execute a query, fetch a record, etc. Verbs are Java classes designed to perform specific tasks, and WebZ has a wide range of verbs for use in your interface.
Refer to
the ORG.oclc.webz
package for a list of WebZ verbs. Verbs that appears in all
CAPS in the package list in are designed to perform specific Z39.50
functions, such as INIT, QUERY, ISOILL, etc.
Some verbs require additional parameters in order to execute. These parameters, called widgets, are included in the same user request as the verb itself and are passed as arguments to the process the verb generates.
The Authorize
verb instructs WebZ to attempt to authorize the user for access
to WebZ. This process involves the WebZ Access
component, which controls access to WebZ by authenticating the
user's userid and password (or IP address) against a profile database.
The Authorize verb uses the autho and password widgets
(below) as arguments in the authorization process.
|
sessionid=0
|
The presence of sessionid=0 causes WebZ to begin a new session for the user. This process of starting a new session performed by the OpServe component. The OpServe assigns the new user to an available JaSSI (which will then handle the user's session until logoff) and gives the user a unique session id that identifies the user for the entire session.
|
next=html%2Fhomeframe.html
|
The next widget instructs WebZ what to do in case of a successful execution of the verb, which in this case is the Authorize verb. In the example shown here, the next command instructs WebZ to load the html/homeframe.html page in response to a successful user authorization.
Note: |
The "%2F" is the hex code for a forward slash ( / ) and, although not written this way in HTML source for the Logon screen, it is inserted by the web server when the HTTP message passes through it. Thus, when the message arrives at WebZ, the forward slash has become a %2F.
|
|
bad=error%2Fauthofail.html
|
Identical to the next widget, but it instructs WebZ what to do in case the authorization process fails. In the example shown here, the bad command instructs WebZ to load the error/authofail.html page.
|
autho=WebZGuest password=WebZGuest
|
The autho and password widgets contain the user id and password values the user entered on the Logon screen. These values are used by the Authorize verb to authorize the user and begin a new session.
Note: |
In our example session, the user accepted the WebZ defaults for user id and password.
|
|
x=14 y=20
|
These coordinates indicate precisely where the user clicked the GO! button graphic on the Logon screen. These values are not used by WebZ, but it's pretty slick information nonetheless.
|
Syntax for a WebZ User Request
In general, a WebZ user request adheres to the following syntax:
Method /namespace/verb:session id:widget1:widget2:widget3:...
Notes:
- The colon ( : ) is used to separate the individual elements in the user request.
- Method is the HTTP method to be performed. The method will usually be POST or GET. For information on these HTTP methods, consult an HTML reference source.
- The namespace is what allows the web server to route the HTTP message to the WebZ extension, which in turn routes the message to WebZ. Unless you define it to be otherwise, namespace is "WebZ."
- The verb is the primary instruction or command being sent to WebZ. When WebZ receives the HTTP message, it will try and execute the action specified by the verb.
- The sessionid is the unique identifier for the user in a WebZ session. Without the session id, WebZ cannot maintain a session state for the user. The session id is assigned to a user by the OpServe component when the user initiates a logon.
- Widgets are parameters or values used by the verb.
Summary
In Stage 1, the user clicks the GO! button to logon to WebZ and an HTTP message is sent to WebZ requesting that a new session be started.
What Happens Next? In Stage 2, WebZ receives the HTTP message, interprets the message, and starts a new session.
Start Page, Stage 1, Stage 2, Stage 3
|