[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.3 and 1.4

version 1.3, 2004/09/27 01:20:46 version 1.4, 2004/09/27 08:32:05
Line 1 
Line 1 
 % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.2 2004/09/24 13:15:27 takayama Exp $  % $OpenXM: OpenXM/src/kan96xx/Doc/cgi.sm1,v 1.3 2004/09/27 01:20:46 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 96 
Line 96 
 /cgiPolymake {  /cgiPolymake {
   {    {
    [(getenv) (QUERY_STRING)] extension /cgi.query_string set     [(getenv) (QUERY_STRING)] extension /cgi.query_string set
    cgi.query_string isString { }     cgi.query_string isString {
        cgi.query_string length 0 eq  {
          cgiPolymake.errorMessage message  exit
        } { } ifelse
      }
    {     {
      cgiPolymake.errorMessage message  exit       cgiPolymake.errorMessage message  exit
    } ifelse     } ifelse
    cgi.body.http0 message     cgi.body.http0 message
    cgi.query_string cgiPolymake.0     cgi.query_string cgiPolymake.0
    cgi.body cgiReplyInHttp0 /cgi.body.http set     cgi.body cgiReplyInHttp0 /cgi.body.http set
    cgi.body.http message     cgi.body.http message
    exit     exit
   } loop    } loop
     [(flush)] extension
 } def  } def
 /cgiPolymake.errorMessage  /cgiPolymake.errorMessage
   [ (Content-Type: text/html) nl    [ (Content-Type: text/html) nl
Line 120 
Line 125 
     (</pre>) nl      (</pre>) nl
     (<form>) nl      (<form>) nl
     (<input type=submit>) nl      (<input type=submit>) nl
     (<textarea name="oxMesassageBody") nl      (<textarea name="oxMessageBody") nl
     ( rows=10 cols="80" wrap="soft"></textarea>) nl      ( rows=10 cols="80" wrap="soft"></textarea>) nl
     (</form>) nl      (</form>) nl
     (</body></html>) nl      (</body></html>) nl
Line 136  def
Line 141  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] extension /kv set      [(cgiUrlEncodingToKeyValuePair) [(?) sss] cat] extension /kv set
     kv (oxMessageBody) getNode /comm set      kv (oxMessageBody) getNode /comm set
   %   [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.
     comm (array) dc /comm set      comm (array) dc /comm set
     /i 0 def      /i 0 def
Line 167  def
Line 173  def
     [cgiPolymake.polymakeName (stringInOut://cgi_body.poly) acti0] addStdoutStderr      [cgiPolymake.polymakeName (stringInOut://cgi_body.poly) acti0] addStdoutStderr
     oxshell pop      oxshell pop
     pError [@@@stdout @@@stderr] append /pError set      pError [@@@stdout @@@stderr] append /pError set
     /cgi.body cgi_body def      /cgi.body cgi_body def
   ] pop    ] pop
   popVariables    popVariables
 } def  } def
Line 195  def
Line 201  def
     /ss arg1 def      /ss arg1 def
     [[(Content-Body) ss]      [[(Content-Body) ss]
 %     [(Content-Type) (text/plain)]  %     [(Content-Type) (text/plain)]
      [(oxshell-stdout) @@@stdout]       [(oxshell-stdout) [(cgiStringToUrlEncoding) @@@stdout] extension]
      [(oxshell-stderr) @@@stderr]       [(oxshell-stderr) [(cgiStringToUrlEncoding) @@@stderr] extension]
     ] /sskv set      ] /sskv set
     [(cgiKeyValuePairToHttpString) sskv] extension /arg1 set      [(cgiKeyValuePairToHttpString) sskv] extension /arg1 set
   ] pop    ] pop
Line 205  def
Line 211  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 {
   /arg2 set /arg1 set    /arg2 set /arg1 set
   [/saction /sfile /ff /ff1 /sss2 /goo /pp /pp2] pushVariables    [/saction /sfile /ff /ff1 /sss2 /goo /pp /pp2] pushVariables
Line 266  def
Line 272  def
     @@@polymake.k0.ccc ( QuoteMode(0); ) oxexecutestring      @@@polymake.k0.ccc ( QuoteMode(0); ) oxexecutestring
     [(treeToPolymake) ptree] extension /pNative set      [(treeToPolymake) ptree] extension /pNative set
 %% step 2: calling the polymake  %% step 2: calling the polymake
     [(which) (polymake)] oxshell tag 0 eq  %    [(which) (polymake)] oxshell tag 0 eq
       1  % always call web service
     {      {
 % cgi-polymake  % cgi-polymake
        (Trying web service.) message         (Trying web service.) message

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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