Kbase P319: How to use WebSpeed CGI Wrappers
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to use WebSpeed CGI wrappers
FACT(s) (Environment):
WebSpeed 3.x
CGI wrappers
FIX:
The CGI wrapper uses special WebSpeed statements to output characters to the browser, hence it has HTML embedded within the 4GL. A CGI wrapper is a "structured" procedure that you use to output HTML source code.
A structured file is a file that the Progress AppBuilder generates. It is organized into sections according to the AppBuilder standard file format.
A CGI wrapper has no associated .htm file. It has only a procedure (.p) file and the corresponding compiled r-code file. CGI wrappers are used to perform complicated multi-step transactions while maintaining a structure that is easy to read.
When you use CGI wrapper, existing business logic from other existing 4GL reports could be incorporated into the procedure by using include files or running external procedures.
Since the CGI wrapper contains no static HTML source code, the CGI wrapper gives the programmer complete control over the HTML that is output. The {&OUT} is used to start output of the HTML source code.
There are 4 primary coding sections within CGI wrapper:
- Definitions:
Input parameters, widgets, and local variables are defined.
- Main Block:
Primary code section of the procedure file.
- Output-Header:
Outputs the MIME header to the web stream and initiates the output of an HTML page to a browser. This section is run from the process-web-request and must run to output an HTML page.
- Process-Web-Request:
Outputs the HTML components to build the page to the web stream. This is where you add code to create the entire page.
As a WebSpeed developer, you should be become familiar with how to use each type of WebSpeed file for development. You must be able to determine the correct file type to use for your differing Web-based solutions.