* Submit a command-level command to Model 204. * This sample program provides both the form and the response to the * form. You determine whether a user is getting a form or submiting * it by querying the 'METHOD' parameter in the form's header * (using $WEB_HDR_PARM). If METHOD=POST, you're supposed to respond * to the user's request. Begin * Declare and initialize. %ListO is Float %rc is Float %x is Float %CForm is String LEN 10 %Command is String LEN 100 %Sclass is String LEN 10 %ListO = $ListNew * Set the global "TITLE" and use $WEB_SUB to make it appear on the page. %rc = $SetG('TITLE',- 'Data Access Demonstrations / Janus Web Server' ) %rc = $Web_Type('TEXT/HTML') %rc = $Web_Sub('@@') * Route terminal output to the user. %rc = $Web_On * Get the value of the form parameter 'CFORM'. %CForm = $UpCase($Web_Form_Parm('CFORM')) In JANWEB Include WEB/TEMPLATE_TOP Html

Model 204 Command Processor


Submit commands to Model 204 from the web. This form simply invokes a rules the runs the submitted command in the 204 address space running the Janus web server.

Would you like to see the code that generates this form?


Command:
End Html * If the form was POST'd to us, process the command. If $Web_Hdr_Parm('METHOD') eq 'POST' Then %Command = $UpCase($Web_Form_Parm('CMD')) If $Index(%Command,'EOJ') or - $Index(%Command,'EOD') or - $Index(%Command,'BUMP') or - $Index(%Command,'JANUS FORCE') or - $Index(%Command,'JANUS DRAIN') or - $Index(%Command,'INITIALIZE') Then Html Data Good try. But it wouldn't have worked as you don't have the privileges to run that command. Stop End If * submit command for "sdaemon" processing. %rc = $CommndL($UpCase($Web_Form_Parm('CMD')),,%ListO) * print the return. Print '' For %x from 1 to $ListCnt(%ListO) Print $ListInf(%ListO,%x) End For Print '' END IF * Send footer. Html
 
End Html In JANWEB Include WEB/TEMPLATE_BOTTOM END