Presentation is loading. Please wait.

Presentation is loading. Please wait.

SIR and the WEB By Dave Doulton University of Southampton.

Similar presentations


Presentation on theme: "SIR and the WEB By Dave Doulton University of Southampton."— Presentation transcript:

1 SIR and the WEB By Dave Doulton University of Southampton

2 Agenda Setting up the web server Using sirweb.cgi Writing HTML Using Forms Conclusion

3 Setting up the web server This will vary depending on web software E.g. PWS or IIS or Unix apache webserver Basically you need to set up 3 virtual directories. Set the path to SIR software Set SIRTEMP and possibly SIRDIR

4 Setting up the web server The directories are wwwroot a root for the web directories on MS defaults to c:\inetpub\wwwroot 2 apparent subdirectories of root cgi-bin and images

5 Setting up the web server Copy sirweb.cgi into the cgi-bin directory Copy red.gif from c:\program files\sir2002\images into the images directory

6 Setting up the web server Virtual directories Web directories are virtual directories They can be any directories and the structure does not necessarily follow actual directory structure

7 Setting up the web server For example C:\inetpub\wwwroot can be http://host/ The root of the server C:\sir2002 can be http://host/cgi-binhttp://host/cgi-bin Which appears to be a subdirectory of root

8 In any PQL you use the real filenames to access files. You use the virtual filenames in output that will be used by the web. Setting up the web server

9 The directories need the correct permissions these are set up on MS by using the pws.exe program or by setting the web sharing properties on the folder property option. Read write and execute are assigned as needed

10 Using sirweb.cgi Once the directories are set up and the server is running(start by using admin tools) Create a pql file in cgi-bin directory Program Write ‘hello world’

11 Using sirweb.cgi Open a web browser and type in http://host/cgi-bin/sirweb.cgi ?sirapp=sysproc.cgi.runfile &RUNFILE=hello.pql Contiguously on the address line

12 Using sirweb.cgi You will get some output. You have run your first cgi script using SIR The sirapp option specifies a member to run The provided options most commonly used are sysproc.cgi.runfile, runmemb and go

13 Using sirweb.cgi Sysproc.cgi.runfile runs the pql in the file named by the RUNFILE option Note uppercase The file must be in the same directory as sirweb.cgi

14 Using sirweb.cgi Sysproc.cgi.runmemb runs a member specified by the MEMBER option From a procfile specified by the PROCFILE option http://host/cgi-bin/sirweb.cgi ?PROCFILE=c:\program?PROCFILE=c:\program%20files\sir2002\sirproc.srp &MEMBER=cgi.hello

15 Using sirweb.cgi Sysproc.cgi.go runs a member in the cgi family of sysproc as specified by the sirmem parameter http://host/cgi-bin/sirweb.cgi ?sirapp=sysproc.cgi.go &sirmem=descrip

16 Writing HTML If you change the earlier program to Program Write ‘hello’ Write ‘ world’ You will find the output is the same as before

17 Writing HTML Whitespace is condensed to single spaces To avoid the we need to use some HTML (HyperText Markup Language) to mark up how we want the text. The simplest thing we can do to solve our problem is to add a and to our program

18 Writing HTML So the program becomes Program Write ‘ ’ Write ‘hello’ Write ‘world’ Write ‘ End program

19 Writing HTML Did you spot the problem? ‘ ’ looks just like a global variable Which is not set so produces nothing To cure this call sysproc.tools.htmlcode before the program. This defines HTML codes to be themselves.

20 Writing HTML So the program is now Call sysproc.tools.htmlcode Program Write ‘ ’ Write ‘hello’ Write ‘ world’ Write ‘ ’ End program

21 Writing HTML So far I have just used write to produce output. However there is an attribute cgi which works better in that if you run the program in ordinary SIR it produces a file called sircgi.htm which can be viewed in a browser but behaves like write in sirweb.cgi.

22 Writing HTML To format the output the way you want check any book on HTML it is all available to you now.

23 Using Forms Instead of typing parameters in the address line one can create a file of html that includes a form which will submit the parameters for you.

24 Using Forms For example Enter member name

25 Using Forms If you change the method to post then the parameters do not appear on the address bar. If more than one field is present then a button is needed. Use for example

26 Using Forms There are all the usual form types available. Check box, radio box, text box drop down selection box. Also images that can be clicked returning positions clicked. See examples in the notes.

27 Conclusion With HTML combined with sirweb.cgi the world is yours. Your data is available formatted as you like to the whole world. Data can be input directly from anywhere in the world.

28 Conclusion Example PQL and HTML can be found at http://www.soton.ac.uk/~sug/conf2002/pql And http://www.soton.ac.uk/~sug/conf2002/html


Download ppt "SIR and the WEB By Dave Doulton University of Southampton."

Similar presentations


Ads by Google