Kbase P175483: What is the minimum SpeedScript code necessary for a WebSpeed CGI wrapper?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2010 |
|
Status: Unverified
GOAL:
What is the minimum SpeedScript code necessary for a WebSpeed CGI wrapper?
GOAL:
What is the least possible Progress OpenEdge ABL / 4GL code needed to write a CGI wrapper procedure?
GOAL:
How to create a CGI wrapper outside of the AppBuilder
FACT(s) (Environment):
All Supported Operating Systems
Progress 9.x
OpenEdge 10.x
FIX:
The following example illustrates the minimum code necessary to write a functioning CGI wrapper:
{src/web/method/cgidefs.i}
output-content-type("text/html").
{&OUT} "<html>hello</html>"
This code contains only the essential elements of a CGI wrapper:
src/method/cgidefs.i contains all the definitions necessary for a simple CGI wrapper. Unlike src/web2/wrap-cgi.i, it does not contain the definitions necessary for using ADM objects.
The output-content-type function sets and outputs the HTTP Content-Type header, which is mandatory for any content sent to the Web output stream.
The &OUT preprocessor variable puts the output text to the Web output stream.
The rest of the code is a string containing a short but valid HTML document.
This code does not require the AppBuilder to develop, and in fact it cannot be saved in the AppBuilder.
A more realistic CGI wrapper would use additional SpeedScript code to access data in an OpenEdge database and to perform business logic, as well as to generate the HTML that displays the results.