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 needed to develop web site exploring Z database.
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 $WebPage specific attribute, see following section.
The .tab files are table data importable in Z database and may be created by the simple text editor. Its first line describes scheme of data. Fields are separated only by the semicolon. If field text has special symbols, particularly one from the ';:, , field text need be enclosed in double quotes, “'A';'B'”. Single quotes are intolerable. It should be remembered that words started with #<digital> or with $<Capital letter> have specific use, that is, #<number> - numbered field, $<Name> specific field.
Following table is the view of the DatabaseSystem.tab in the Ex/Navigator example directory. First field is used for target object, next fields - for it’s properties. Call attention how the page1.html file reference is specified for Sav Z Server 0.2 object.
database system; vendor; platform; query language; price; $WebPage "Sav Z Server 0.2"; Anet; Unix; Z; $199; page1.html "SQL Server 6.5 - 5 clients"; Microsoft; Win 95/98/NT; SQL; $1200 "SQL Plus 8.0 for Windows 95"; Oracle; Win 95/98/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; 0.2
We need run Z Interpreter and then import the data tables in desktop variant of the database, see Preparing Navigation help in Z Interpreter when it will be running. Learning Z language wills helpful for understanding of Z DBMS features and for farther database development.
The standalone web server (servletrunner) from JSDK of Sun Microsystems is required, servletrunner.exe for Windows or servletrunner for UNIX.
Next auxiliary files are necessary both for off-line and on-line mode:
servlet.properties The servlet initialization parameters. File is located in Lib directory with the servlet class. See following example. The dbName parameter sets name of Z database. The stringOutLimit is byte limitation of data deduced from the database after the query.
servlet.zserver.code=Sav.Servlet.HTTPConnection
servlet.zserver.initArgs=\
dbName=Common.ass,\
stringOutLimit=100000
ZServer.html The source html page that starts Z Server and defines dialog structure. This sample
assumes that Z Server is running as zserver on your machine, localhost, at port 8080.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"> <TITLE>Sav Z Server</TITLE> </HEAD> <FRAMESET ROWS="50%,50%" FRAMEBORDER=1> <FRAMESET COLS="20%,80%" > <FRAMESET ROWS="56,*"> <FRAME NAME="Frame0" MARGINHEIGHT=5 MARGINWIDTH=5 SRC="ZServer.gif"> <FRAME NAME="Frame1" SRC="http://localhost:8080/servlet/zserver"> </FRAMESET> <FRAME NAME="Frame2" SRC="blank.html"> </FRAMESET> <FRAME NAME="Frame3" SRC="blank.html"> </FRAMESET> <NOFRAMES> <BODY> <P>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.<BR> </BODY> </NOFRAMES> </HTML>
ZServer.gif Label file. It is placed in one directory with ZServer.html and enables the aware users be oriented to the dialog features.
If you go to the Ex/Server directory, you will look other files, Common.ass, page1.html
and page2.html.
Its are data of example and are sole you need make yourself fully for your web data server interface.
Common.ass Database, that defines the dialog.
*.html, *.gif, *.jpeg, *.txt, ... Web pages, database references to.
See and start SServer.bat (win32).
servletrunner -s C:/SavZS/Lib/servlet.properties -r C:/SavZS/Ex/Server
The -r parameter sets root directory of the data. Path of -s and -d may be relative to servletrunner directory.
We can run web browser after servletrunner, open ZServer.html source page and test a dialog. The character set of the web browser must be agree with the system default character set of the server (servletrunner).
Please familiar with the servlet environment of your web server and configure it with regard to the requirements of the previous section.