Kbase P6342: How to compile an HTML file with embedded SpeedScript in 4GL
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/07/2008 |
|
Status: Verified
GOAL:
How to compile an HTML file with embedded SpeedScript in 4GL
GOAL:
How to compile an HTML file with embedded WebSpeed's SpeedScript program in batch mode
GOAL:
How to compile WebSpeed code outside of WebSpeed Workshop
GOAL:
How to use e4gl-gen.p
GOAL:
Does the compiler need to be changed to embedded SpeedScript code?
FACT(s) (Environment):
All Supported Operating Systems
WebSpeed 2.1
WebSpeed 3.x
OpenEdge 10.x
FIX:
- Start a Progress Character (TTY) session using _progres and from the Procedure Editor run the program e.g. _progres <database name> <additional connection parameters>
- Generate a 4GL program corresponding to the HTML file. The code provided shows how to generate a "meta.w" file for a "meta.html" file.
{ src/web/method/cgidefs.i "NEW"}
/* The line above is required only for WS 2.1 and not in WS 3.x */
DEFINE VARIABLE speedfile AS CHARACTER.
DEFINE VARIABLE wsoptions AS CHARACTER.
ASSIGN speedfile = "meta.w"
wsoptions = "".
RUN tty/webutil/e4gl-gen.r
(INPUT "meta.html",
INPUT-OUTPUT speedfile,
INPUT-OUTPUT wsoptions). - Use the 4GL COMPILE statement to compile the generated program into a .r (r-code).
COMPILE meta.w SAVE.
or
COMPILE VALUE(speedfile) SAVE.
You can customize this program to fit your needs, for example, add an option to get the HTML file names from a file or run it from the command line, so you can compile many files in batch mode.
This program will generate a .w file corresponding to the HTML file with embedded SpeedScript. Use this program only for this type of HTML web objects. An HTML file corresponding to a mapped WebObject has a .w file associated, which has the 4GL code. Using the program above will overwrite the existing .w file.