Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
SpeedScript : Using <META> and <!--WSMETA --> tags : Specifying file type options
 

Specifying file type options

This is the <META> tag syntax for specifying the embedded SpeedScript file:

Syntax

<META NAME="wsoptions" CONTENT=
"web-object-opt[,web-object-opt ]... " | " get-options" >

Syntax: web-object-opt

include | no-compile | web-object | no-content-type | compile | keep-meta-content-type
NAME="wsoptions" indicates that the <META> tag specifies the file type to generate.
If CONTENT contains any combination of web-object-opt, the preprocessed embedded SpeedScript file is formatted as a complete SpeedScript Web object.
If CONTENT contains "include", the preprocessed embedded SpeedScript file is preprocessed as a SpeedScript include file. Thus, the output contains SpeedScript source code without any WebSpeed include file references (such as to cgidefs.i). The source does not include any references to the WebSpeed OutputContentType() procedure or any other code to generate an HTTP header. In all other respects, the file is ready to be referenced as an include file in the source code of some other Web object.
If CONTENT contains "no-compile", the preprocessed embedded SpeedScript file will not be compiled to r-code.
If CONTENT contains only "web-object", the preprocessed embedded SpeedScript file is formatted as a SpeedScript procedure with all the additional SpeedScript elements to make a Web object. This includes appropriate references to WebSpeed include files and the code to generate HTTP header information.
If CONTENT contains "no-content-type", the preprocessed embedded SpeedScript file is formatted as a SpeedScript procedure with all the additional SpeedScript elements to make a Web object. However, the Web object does not execute the code that generates HTTP header information at run time. This allows you to create an embedded SpeedScript Web object that you can call from another Web object that manages the Web page output.
If CONTENT contains "keep-meta-content-type", the include file or Web object is formatted to retain any HTTP header information (content type <META> tags) that is embedded in the HTML file at compile time. Some authoring tools add this tag automatically, whether or not you specify it yourself. In any case, each content type <META> tag can cause some browsers to restart document loading for each generated HTTP header it encounters. To prevent the browser disruption that this can cause, the AppBuilder omits any content type <META> tag from the generated file when you do not specify the keep-meta-content-type option. All content type <META> tags are commented out like this:
<!-- E4GL Disabled: META HTTP-EQUIV="Content-Type" ... -->
By default, the AppBuilder prevents any conflict between additional HTTP header information embedded in the HTML file and the HTTP header information generated at run time. For more information on using content type <META> tags in your embedded SpeedScript, see Specifying HTTP header information.
Note: During preprocessing of the embedded SpeedScript file, the header information in all content type <META> tags is retrieved for the Web object to generate at run time using the output-content-type function.
Any unknown options that you specify in the CONTENT value are ignored.
The "get-options" option is for development applications that manage embedded SpeedScript files, such as to automate a build process. Generally, you pass this option to the embedded SpeedScript preprocessor (install-path/tty/webutil/e4gl-gen.r) to return information about another HTML file. The preprocessor takes three parameters, in this order:
1. Pathname of the HTML file to preprocess (INPUT, AS CHARACTER)
2. Pathname of the output Web object or include file to generate (INPUT-OUTPUT, AS CHARACTER)
3. Comma-delimited list of file type options (INPUT-OUTPUT, AS CHARACTER)
You pass "get-options" as the third parameter and the preprocessor returns a list of all the file type options specified in <META NAME="wsoptions"...> and <!--WSMETA NAME="wsoptions"...--> tags. If any of these tags are found, the string "wsoptions-found" is also appended to the list. You can use this information to determine whether a file contains embedded SpeedScript or is only a static HTML file. You can also add your own CONTENT options to these tags, and although the preprocessor ignores them for its own use, it does return them in the list.
To generate a Web object that omits the HTTP header from its output, you might begin your embedded SpeedScript file like this:

meta.html

<HTML>
<HEAD>
<META NAME="wsoptions" CONTENT="web-object, no-content-type">
</HEAD>
<BODY>
. . .
Note: Depending on options you choose in AppBuilder, you can generate an include or procedure file whether or not you use this <META> tag in the embedded SpeedScript file. If you add this tag to the embedded SpeedScript file, the embedded SpeedScript preprocessor combines the options you specify with any provided by AppBuilder.
In the following code, the file management procedure calls the preprocessor for meta.html, passing "get-options":
DEFINE VARIABLE speedfile AS CHARACTER NO-UNDO.
DEFINE VARIABLE wsoptions AS CHARACTER NO-UNDO.
ASSIGN
  speedfile = "meta.w"
  wsoptions = "get-options".
RUN tty/webutil/e4gl-gen.r
  (INPUT "meta.html",
   INPUT-OUTPUT speedfile,
INPUT-OUTPUT wsoptions).
The preprocessor returns "web-object, no-content-type, wsoptions-found" as the value of wsoptions.