Sav Z (Web Data) Server:

Web Developer’s Guide

Introducing

Sav Z Web Data Server is realized as Java servlet, providing connection a lot of Internet clients with Z database. Clients are end-users, receiving data via the usual web browser. Server automatically forms for clients the interface defined by the contents of the host Z database. It significantly simplifies development of the user interaction with remote database.

Consider steps that are needed to develop web site exploring Z database.

1. Preparing web pages

The outer tools are needed for preparing of web pages. Database may contain references to the html|gif|jpeg|text|... files. It enables to use Z Web Data Server as wizard for navigation in WWW. All the references are formed by the $WebPage specific attribute, see following section.

2. Creating tab files

The .tab files are table data importable in Z database and may be created by the simple text editor. Table's first line describes scheme of the data. Only the semicolon separates fields. If field text has special symbols, particularly one from the *# {[(}])-:=~, , field text should be enclosed in the quotes, “ A: B - C; ”. It should be remembered that words started with #<digital>, with $<letter>, with \, or with / have specific use, that is, #<number> - numbered field, $<name> - specific field, \<sentence>, /<sentence> - unallowable here fields.

Following table is the view of the DS.tab in the Ex/Basic example directory. First field is used for target object, next fields - for it’s properties. Call attention how the ../data/page1.html URL is specified for the Sav Z Server 1.0 object. The data in the many-valued fields is separated by the ',' comma.

database system      ; vendor              ; platform            ; query language; price; $WebPage
"Sav Z Server 1.0"   ; Anet,"Technopoles-M"; Unix                ; Z             ; $199 ;"../data/page1.html"
"SQL Server 6.5 - 5" ; Microsoft           ; Win 95,Win 98,Win NT; SQL           ; $1200
"SQL Plus 8.0 Win 95"; Oracle              ; Win 95,Win 98,Win NT; SQL           ; None

First field is properly primary key, it may be coded by numbers #1, #2 , … . For example:

database system; name        ; version
#1             ; Sav Z Server; 1.0

Usually each table corresponds to the separate class of the target objects. For optimal dialog with Z database in WWW the table may not exceed 100000 bytes .

Learning Z language wills helpful for understanding of Z DBMS features and for farther database development.

3. Filling Z database

We need run Z Table converter and import the data tables in desktop variant of the database.

java [<options>] Sav.Z.Table [<table_options>] <database> <table_file> [<key_colon_number> [<colon_number> ...]]
<table_options> = -a[nalyse] | -r[ead]

Example:

java Sav.Z.Table Ex/Common Ex/Basic/DS.tab

or

java Sav.Z.Table -r Ex/Common.ass Ex/Basic/DS.tab 1 2 3 4 5 6

See and running createBase.bat in Ex/Basic example directory.

4. Testing clients’ interface in off-line mode

The standalone web server from JSWDK 1.0.1 of Sun Microsystems is required.

Configuration

All the following files are necessary both for off-line and on-line mode:

webserver.xml, JSWDK server's configuration.

...
<WebServer id="webServer">
    <Service id="service0">
        <WebApplication id="zserver" mapping="/SavZServer" docBase="SavZServer"/>
    </Service>
</WebServer>

Next files are placed in JSWDK-1.0/SavZServer by coping SavZS/SavZServer directory.

servlets.properties, the servlet initialization parameters. File is located in JSWDK-1.0/SavZServer/WEB-INF. The dbName parameter sets name of Z database. The outLimit is byte limitation of data deduced from the database to the client.

zserver.code=Sav.Servlet.HTTPConnection
zserver.initparams=dbName=Common.ass,outLimit=100000

index.html, Source file, defines frame of the dialog with Z Server.
ZServer.gif
, Label file, enables the aware users be oriented to the dialog features.
Blank.html, Empty file, is needed only for clients with Netscape Navigator.

If you go to the SavZServer/Data directory, you will look other files, Common.ass, page1.html and page2.html. Its are data of the Ex/Basic example that you need make for your web data server interface.
Common.ass Database, that defines the dialog.
*.html, *.gif, *.jpeg, *.txt, ...
Web pages, database references to.

Starting web server

See and start startserver.bat (Win32) or startserver (Unix).

Running web browser

We can open http://localhost:8080/SavZServer/ source page after starting of the web server and test a dialog in a web browser. The character set of the web browser must be agree with the system default character set of the server.

5. Executing Z Server in on-line mode

Please familiar with the servlet environment of your web server and configure it with regard to the requirements of the previous section.