[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.12 and 1.15

version 1.12, 2004/12/29 01:42:13 version 1.15, 2013/09/22 08:07:51
Line 1 
Line 1 
 % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.11 2004/11/23 02:38:46 takayama Exp $  % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.14 2013/09/22 05:17:17 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 89 
Line 89 
 /cgiPolymake.polymakeName (polymake) def  /cgiPolymake.polymakeName (polymake) def
 %/cgiPolymake.polymakeName (polymake_dummy) def  %/cgiPolymake.polymakeName (polymake_dummy) def
 %/cgiPolymake.polymakeName (hoge) def  %/cgiPolymake.polymakeName (hoge) def
   /cgiPolymake.log 1 def
   
 [(cgiPolymake)  [(cgiPolymake)
 [(Make sm1 to a polymake server based on CGI/OoHG)  [(Make sm1 to a polymake server based on CGI/OoHG)
Line 111 
Line 112 
        cgiPolymake.errorMessage message  exit         cgiPolymake.errorMessage message  exit
    } { } ifelse     } { } ifelse
    [(read) 0 cgi.content_length] extension /cgi.query_string set     [(read) 0 cgi.content_length] extension /cgi.query_string set
      cgiPolymake.log {
         cgi.query_string (string) dc sm1log
      } { } ifelse
    cgi.query_string isString {     cgi.query_string isString {
      cgi.query_string length 0 eq  {       cgi.query_string length 0 eq  {
        cgiPolymake.errorMessage message  exit         cgiPolymake.errorMessage message  exit
Line 227  def
Line 231  def
 % ------------  client side script ---------------  % ------------  client side script ---------------
 /cgiQueryPolymake.hostname (polymake.math.kobe-u.ac.jp) def  /cgiQueryPolymake.hostname (polymake.math.kobe-u.ac.jp) def
 /cgiQueryPolymake.cginame (/cgi-bin/cgi-polymake.sh) def  /cgiQueryPolymake.cginame (/cgi-bin/cgi-polymake.sh) def
 /cgiQueryPolymake {  %/cgiQueryPolymake { cgiQueryPolymake.curl } def
   /cgiQueryPolymake { cgiQueryPolymake.native } def
   /cgiQueryPolymake.curl {
   /arg2 set /arg1 set    /arg2 set /arg1 set
     [/saction /sfile /ff /ff1 /sss2 /goo /pp /pp2 /key /body /fd] pushVariables
     [
       /saction arg1 def /sfile arg2 def
   % step1. Generate query in URL encoding.
        [(http://) cgiQueryPolymake.hostname cgiQueryPolymake.cginame] cat
        /ff1 set
   % full URL necessary for virtual host of apache.
        [[(oxMessageBody)
          [saction ( )
           sfile nl ] cat
          ]
        ] /ff set
   
        ff 0 get 0 get /key set
        ff 0 get 1 get /body set
   % step 2. Call the server and get the response in pp
        /cgi.verbose 1 def
        (/tmp/sm1-q-cgi.txt) (w) file /fd set
        fd body writestring
        fd closefile
   %     [(curl) (--form) [key (=@/tmp/sm1-q-cgi.txt)] cat  ff1] /ff set
   %     ff  addStdoutStderr oxshell  @@@stdout /pp set
        [(curl  --form ) [key (=@/tmp/sm1-q-cgi.txt )] cat  ff1 (>/tmp/sm1-q-cgi-out.txt)] cat /ff set
        ff system
        [nl (/tmp/sm1-q-cgi-out.txt) pushfile] cat /pp set
   
        cgi.verbose { pp message } {  } ifelse
        [(cgiHttpToKeyValuePair) pp] extension /pp2 set
        pp2 message
   % step 3. Analyze the response.
        [pp2 (Content-Body) getNode
         pp2 (oxshell-stdout) getNode
         pp2 (oxshell-stderr) getNode
        ] /arg1 set
     ] pop
     popVariables
     arg1
   } def
   
   /cgiQueryPolymake.native {
     /arg2 set /arg1 set
   [/saction /sfile /ff /ff1 /sss2 /goo /pp /pp2] pushVariables    [/saction /sfile /ff /ff1 /sss2 /goo /pp /pp2] pushVariables
   [    [
     /saction arg1 def /sfile arg2 def      /saction arg1 def /sfile arg2 def
Line 294  def
Line 341  def
  (If not, it calls http://polymake.math.kobe-u.ac.jp/cgi-bin/cgi-polymake.sh)   (If not, it calls http://polymake.math.kobe-u.ac.jp/cgi-bin/cgi-polymake.sh)
  (to make a computation in polymake.)   (to make a computation in polymake.)
  (See doPolymake for the syntax. doPolymake.OoHG may overrides doPolymake.)   (See doPolymake for the syntax. doPolymake.OoHG may overrides doPolymake.)
    (If you use curl to call the server set as follows after loading cgi.sm1)
    (/cgiQueryPolymake { cgiQueryPolymake.curl } def)
 ]] putUsages  ]] putUsages
 /doPolymake.OoHG  {  /doPolymake.OoHG  {
   /arg1 set    /arg1 set
Line 303  def
Line 352  def
   [    [
     arg1 0 get /pAction set      arg1 0 get /pAction set
     arg1 1 get /pData set      arg1 1 get /pData set
     polymake.start      polymake.start.OoHG
   
     /pError [ ] def      /pError [ ] def
 %% step 1:  polymake tfb ===> polymake native data  %% step 1:  polymake tfb ===> polymake native data

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

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