Consultor Eletrônico



Kbase P22361: What are the 3 File Types Used for WebSpeed 3.x Development
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

What are the 3 File Types Used for WebSpeed 3.x Development

FACT(s) (Environment):

WebSpeed 3.x

FIX:

The three primary types of files that are used for Progress WebSpeed development. It provides a deeper understanding of the functionality and techniques used within each file type.

The three primary file types for WebSpeed development are:

- Embedded SpeedScript.

- CGI wrappers.

- Mapped web objects.

SpeedScript is Progress 4GL code that is added directly to an HTML file to create dynamic output of HTML source code.

It is 4GL code that is embedded into an HTML document, therefore
this file type of file has both 4GL code and HTML in the same
file. This file type is considered "unstructured".

An unstructured file is a file created either entirely by the
user, or with the aid of a template. All HTML files are
unstructured, including those that contain embedded SpeedScript
or those that deal with any report or detail wizard.

You add SpeedScript to an HTML file with special HTML tags and
format. When an HTML file that contains SpeedScript compiles, the
4GL code is parsed and compiled into an .r file that recreates
the original HTML. Dynamic content that was created by
SpeedScript and any additional processing logic added by
SpeedScript is added the static HTML output. The SpeedScript code
is resolved on the server. Only the .r file is required in a
production environment to run the file.

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.

The WebSpeed mapped web object template provides a way to relate and HTML document that contains forms to a Progress procedures that maps each of the HTML form elements to database tables/fields, SDO elements, and variables.

Mapped web objects are structured files. The file type is used
when there is a need to perform complex data manipulation that
contains detailed logic executing database updates (for example,
filling out registration forms).

The mapping procedure outputs the value of the Progress element
as the initial value of the form element in the HTML page at the
time the page is rendered. Mapped web objects are the quickest
way to develop pages that update forms related directly to
database tables.

HT.ML mapping separates the user interface from the business logic
and allows you to modify the HTML without affecting the logic or
without knowing about Progress or WebSpeed.

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.

Not every solution can be developed easily using only one kind of file. The determination should be made on a page-by-page basis. Developers should consider the ease of updating the HTML or business logic in a page so that when changes are needed, they can be done quickly and efficiently.