200 likes | 333 Views
Implementing Web data access using sirweb.cgi. By Dave Doulton University of Southampton. Agenda . Install SIR2000. Install PWS. Copy files from SIR2000 to PWS. Demonstrate web access. Demonstrate General Purpose Web Access Summary. Install SIR2000. Run Setup.exe.
E N D
Implementing Web data access using sirweb.cgi By Dave Doulton University of Southampton
Agenda • Install SIR2000. • Install PWS. • Copy files from SIR2000 to PWS. • Demonstrate web access. • Demonstrate General Purpose Web Access • Summary
Install SIR2000 • Run Setup.exe. • Install licence file. • Add SIR2000 to path in autoexec.bat.
Install Personal Web Server -1 • Run setup.exe in either • c:\windows\options\cabs\pws • or • \add-ons\pws on Windows 98 CD
Install Personal Web Server -2 • Choose typical install • Leave default directory as suggested. • Install • Reboot system
Install Personal Web Server -3 • If mstdcw causes a fault on reboot • run msconfig from run button • choose startup tab • unclick entry MSTDC mstdcw -start • restart machine
Copy files from SIR2000 to PWS. • Copy sirweb.cgi from SIR2000 directory to c:\inetpub\wwwroot\cgi-bin • Copy red.gif from SIR2000\images toc:\inetpub\wwwroot\images • Copy your html and your pql files to c:\inetpub\wwwroot
Demonstrate web access - 1 • Click on publish icon, check server running. • Start web browser • enter http://localhost/cgi-bin/sirweb.cgi?sirapp=sysproc.cgi.go&sirmem=Run&sirtxt=descrip • localhost can be machine’s name
Demonstrate web access - 2 • More friendly to make a form and allow to choose what to run. • Using simple HTML
Demonstrate web access - 3 <html> <head><title>SIR demo </title> </head><body> <form action="/cgi-bin/sirweb.cgi" method="post"> <input type="hidden" name="sirmem" value="Run"> <input type="hidden" name="sirapp" value="sysproc.cgi.go"> <select name="sirtxt" size="1"> <option value="fcache">flush cache</option> <option value="default">default</option> <option value="stdout">stdout</option> <option value="hello">hello</option> <option value="call">call</option> <option value="menupic">welcome picture</option> <option value="splash">splash</option> <option value="runfile">run file</option> <option selected value="descrip">descriptive</option> <option value="entry">data entry</option> <option value="report1">report</option> <option value="freport">full report</option> <option value="table1">table</option> <option value="tables">tables</option> <option>excel</option> <option value="spss">spss</option> </select> <p>File to execute <input type="text" size="20" name="RUNFILE"> </p> <p><input type="submit" value="submit"> </p> </form></body></html>
Demonstrate web access - 4 • Most useful option is sysproc.cgi.runfile • uses parameter RUNFILE to specify source PQL call sysproc.tools.htmlcode program write(cgi)'<h3> <sirver> <date> <time> </h3>' end program
Demonstrate web access - 5 • Simple form to run file <html> <head> <title>Run SIR PQL </title> </head> <body> <form action="/cgi-bin/sirweb.cgi" method="post"> <input type="hidden" name="sirapp" value="sysproc.cgi.runfile"> File to execute <input type="text" size="20" name="RUNFILE"> <input type="submit" value="submit"> </form></body></html>
Demonstrate web access - 6 • You can have a form that does not look like a form and always does the same thing <HTML><HEAD> <TITLE>Run Descriptive </TITLE> </HEAD><BODY> <A HREF="javascript:document.forms[0].submit()">run desciptive</A><BR> <form name=descrip method=post action="/cgi-bin/sirweb.cgi"> <input type=hidden name=sirapp value=sysproc.cgi.go> <input type=hidden name=sirmem value="Run"> <input type=hidden name=sirtxt value="descrip"> </form></BODY></HTML>
Demonstrate web access - 7 • Source of descrip RETRIEVAL PROCESS CASES ALL . PROCESS REC EMPLOYEE . GET VARS CURRPOS . PERFORM PROCS . END PROCESS REC END PROCESS CASES DESCRIPTIVE VARIABLE=CURRPOS / FILENAME=CGI/ END RETRIEVAL
Demonstrate General Purpose Web Access -1 • Based around idea from data sysproc.cgi.entry • Has two versions show and update based on hidden value on form • DB_WR=yes means update • anything else just show
Demonstrate General Purpose Web Access -2 <HTML> <HEAD> <TITLE>General Purpose SIR2000 Database Access Forms </TITLE> </HEAD> <BODY> <form method=post action="/cgi-bin/sirweb.cgi"> <table> <tr><th>Database Name</th><td><input type=text name=DB_DB></td></tr> <tr><th>Password </th><td><input type=password name=DB_PW></td></tr> <tr><th>Read Security</th><td><input type=password name=DB_RS></td></tr> <tr><th>Write security</th><td><input type=password name=DB_WS></td></tr> <tr><th>Database Prefix</th><td><input type=text name=DB_P></td></tr> <tr><th>Database Master</th><td><input type=text name=DB_MS></td></tr> </table> <input type=submit value=Go> <input type=hidden name=sirapp value=sysproc.cgi.runfile> <input type=hidden name=RUNFILE value="edit.pql"> <input type=hidden name=DB_WR value="yes"> </form></BODY></HTML>
Demonstrate General Purpose Web Access -3 <HTML> <HEAD> <TITLE>General Purpose SIR2000 Database Access Forms </TITLE> </HEAD><BODY> <form method=post action="/cgi-bin/sirweb.cgi"> <table> <tr><th>Database Name</th><td><input type=text name=DB_DB></td></tr> <tr><th>Password </th><td><input type=password name=DB_PW></td></tr> <tr><th>Read Security</th><td><input type=password name=DB_RS></td></tr> <tr><th>Write security</th><td><input type=password name=DB_WS></td></tr> <tr><th>Database Prefix</th><td><input type=text name=DB_P></td></tr> </table> <input type=submit value=Go> <input type=hidden name=sirapp value=sysproc.cgi.runfile> <input type=hidden name=RUNFILE value="edit.pql"> </form></BODY></HTML>
Summary - 1 • Install SIR2000 • Install PWS • Set up files • Test forms
Summary - 2 • Check security • Be careful with sirweb.isa • Check sysproc.cgi.runfile for source of files • Make site available
The End • End of presentation • Any Questions?