[BACK]Return to cgi.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Doc

Diff for /OpenXM/src/kan96xx/Doc/cgi.sm1 between version 1.5 and 1.8

version 1.5, 2004/09/27 11:18:23 version 1.8, 2004/11/22 12:30:32
Line 1 
Line 1 
 % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.4 2004/09/27 08:32:05 takayama Exp $  % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.7 2004/10/13 12:11:31 takayama Exp $
 %  OpenXM/src/polymake/cgi/cgi-polymake.sh  %  OpenXM/src/polymake/cgi/cgi-polymake.sh
 %   is a shell script to call sm1/polymake as a CGI script.  %   is a shell script to call sm1/polymake as a CGI script.
 %  Override as /doPolymake {doPolymake.OoHG} def if you need.  %  Override as /doPolymake {doPolymake.OoHG} def if you need.
Line 143  def
Line 143  def
   [    [
     /sss arg1 def      /sss arg1 def
 % Step 1.  analyze the query string in URL encoding.  % Step 1.  analyze the query string in URL encoding.
     [(cgiUrlEncodingToKeyValuePair) [(?) sss] cat] extension /kv set      [(cgiUrlEncodingToKeyValuePair) sss] extension /kv set
     kv (oxMessageBody) getNode /comm set      kv (oxMessageBody) getNode /comm set
 %   [nl nl] cat message sss message kv message  % for debug.  %   [nl nl] cat message sss message kv message  % for debug.
 % Step 2. Extract action part and file part for polymake.  % Step 2. Extract action part and file part for polymake.
Line 220  def
Line 220  def
   [    [
     /saction arg1 def /sfile arg2 def      /saction arg1 def /sfile arg2 def
 % step1. Generate query in URL encoding.  % step1. Generate query in URL encoding.
     [[(URL) cgiQueryPolymake.cginame]      [[(URL) [(http://) cgiQueryPolymake.hostname cgiQueryPolymake.cginame] cat]
   % full URL necessary for virtual host of apache.
      [(oxMessageBody)       [(oxMessageBody)
      [saction ( )       [saction ( )
       sfile nl ] cat        sfile nl ] cat
Line 232  def
Line 233  def
         [80 cgiQueryPolymake.hostname]] extension 0 get /goo set          [80 cgiQueryPolymake.hostname]] extension 0 get /goo set
      [(sm1.socket) (write) [goo sss2]]  extension       [(sm1.socket) (write) [goo sss2]]  extension
      goo readHTTP0 /pp set       goo readHTTP0 /pp set
   
        % For the case of error.
        [(regexec) (200 OK) [pp]] extension length 0 eq {
           (sss2=) message
           sss2 message
           (pp=) message
           pp message
           (cgi.sm1: there seems to be an error in the HTTP connection.)
        } { } ifelse
   
      cgi.verbose { pp message } {  } ifelse       cgi.verbose { pp message } {  } ifelse
      [(sm1.socket) (close) [goo]] extension       [(sm1.socket) (close) [goo]] extension
      [(cgiHttpToKeyValuePair) pp] extension /pp2 set       [(cgiHttpToKeyValuePair) pp] extension /pp2 set
Line 248  def
Line 259  def
   
 % Overrides doPolymake  % Overrides doPolymake
 %/doPolymake { doPolymake.OoHG } def  %/doPolymake { doPolymake.OoHG } def
   %/polymake.start { polymake.start.OoHG } def
   
 [(doPolymake.OoHG)  [(doPolymake.OoHG)
 [(It first looks for local polymake. If there is, it calls the local polymake.)  [(It first looks for local polymake. If there is, it calls the local polymake.)
Line 281  def
Line 293  def
        (Trying web service.) message         (Trying web service.) message
        pAction pNative  cgiQueryPolymake /doPolymake.OoHG.result set         pAction pNative  cgiQueryPolymake /doPolymake.OoHG.result set
   
         [(regexec) (Not Found) [doPolymake.OoHG.result 0 get ]]
         extension length 0 eq not {
            doPolymake.OoHG.result message
            (The polymake cgi seems to be out of service.) error
         } {  } ifelse
   
       doPolymake.OoHG.result 0 get /pNative set        doPolymake.OoHG.result 0 get /pNative set
   
   
       pError doPolymake.OoHG.result rest append /pError set        pError doPolymake.OoHG.result rest append /pError set
     } {      } {
 % local polymake  % local polymake
Line 303  def
Line 323  def
   ] pop    ] pop
   popVariables    popVariables
   arg1    arg1
   } def
   
   /polymake.start.OoHG {
     (ox.k0.loaded) boundp {  }
     { [(parse) (ox.sm1) pushfile] extension
       /@@@polymake.k0.ccc [ ] def
     } ifelse
     @@@polymake.k0.ccc [ ] eq {
        k0connectr /@@@polymake.k0.ccc oxk0.ccc def /oxk0.ccc [ ] def
        @@@polymake.k0.ccc oxsetmathcap @@@polymake.k0.ccc oxmathcap
     } {  } ifelse
     @@@polymake.k0.ccc 0 get (closed) eq {
        k0connectr /@@@polymake.k0.ccc oxk0.ccc def /oxk0.ccc [ ] def
        @@@polymake.k0.ccc oxsetmathcap @@@polymake.k0.ccc oxmathcap
     } {  } ifelse
     [(which) (polymake2tfb)] oxshell tag 0 eq {
        (polymake2tfb is not installed in this system.) error
     } {  } ifelse
 } def  } def
   
   

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.8

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>