Meta-HTML

This chapter provides an overview of Meta-HTML and discusses the following topics:

Click to jump to parent topicUnderstanding Meta-HTML

PeopleSoft Pure Internet Architecture page processing includes functionality to perform certain substitutions on the generated HTML. These substitutions are known as Meta-HTML. These Meta-HTML elements enable access to some of the environment, and in some cases, to perform browser-dependent substitutions.

The Meta-HTML processing is performed on the entire page, including the contents of any HTML areas in the page. Thus Meta-HTML can be used in an HTML area.

Meta-HTML processing is not currently done in the results of an internet script, so the iScript programmer cannot use Meta-HTML.

A limited subset of the Meta-HTML processing is also done on any JavaScript or auxiliary HTML files attached and downloaded to the web server. This processing occurs both for files attached to PeopleSoft Pure Internet Architecture pages and for files attached to an iScript.

An auxiliary file may be attached to an HTML area using the Meta-HTML %JavaScript method.

An auxiliary page may be attached to a iScript page or a PeopleSoft Pure Internet Architecture page using the Response method GetJavaScriptURL.

Each Meta-HTML element that may be used in auxiliary files is noted in its description.

Find References Tool Considerations

When you specify a definition name in an HTML area, it is not found using the Find References tool. It also won't be automatically renamed when a definition is renamed. All text within an HTML area is treated like a quoted string, a literal.

For example, Find References won't find the image PSLOGO or the HTML definition PT_EDITSCRIPTS.

<img src='%Image(PSLOGO)'> <script src='%JavaScript(PT_EDITSCRIPTS)'></script>

See Also

%JavaScript

GetJavaScriptURL

Click to jump to parent topicVariables

A Meta-HTML variable has the form %name, similar to the PeopleCode system variables. It's replaced by the substituted value wherever it appears. In the following example, the Meta-HTML variable is replaced by the current component name:

%Component

Click to jump to parent topicFunctions

A Meta-HTML function has the following form:

%name(parameter,parameter...)

The entire expression is replaced by a substituted value, where the parameters are used in determining the value to be substituted. The parameters are arbitrary sequences of characters separated by commas. Do not place quotes around the parameters unless they form part of the value to be used.

In the following example, the entire text is replaced by the contents of the message 126, 45 from the message catalog, or the phrase "Unable to load images" if that message isn't found.

%Message(126, 45, Unable to load images)

Click to jump to parent topicComments

The Meta-HTML processor recognizes two forms of comments. These comments are deleted from the generated HTML or JavaScript. They enable the application developer to comment the HTML objects in the database without increasing the size of the HTML passed to the browser.

The recognized comments are as follows:

Two slashes followed by a percent sign at the start of a line deletes everything to the end of the line containing the slashes.

//% anything

A less-than sign, followed by an exclamation mark and a percentage sign deletes everything from those marks to the mark -->, which may be on another line.

<!% anything -->

These Meta-HTML comments may be used both in HTML areas and attached auxiliary files.

Click to jump to parent topicAlphabetical List of Meta-HTML Elements

In this section, we discuss each Meta-HTML element. Throughout this section, typographical conventions are used to distinguish between different elements of the PeopleCode language, such as bold to indicate function names, italics for arguments, and so on.

See Also

PeopleCode Typographical Conventions.

Click to jump to top of pageClick to jump to parent topic%Appserver

Description

At runtime %Appserver is replaced with the name of the application server.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%AppsRel

Description

At runtime %AppsRel is replaced with the application release string.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%Browser

Description

At runtime %Browser is replaced with the browser name as specified by the browser loading the current page.

Click to jump to top of pageClick to jump to parent topic%BrowserPlatform

Description

At runtime %BrowserPlatform is replaced with the operating system name as specified by the browser loading the current page.

Click to jump to top of pageClick to jump to parent topic%BrowserVersion

Description

At runtime %BrowserVersion is replaced by the version string as specified by the browser loading the current page.

Click to jump to top of pageClick to jump to parent topic%Cols

Syntax

%Cols(n)

Description

At runtime %Cols(n) is replaced with COLS=n.

Parameters

n

Specify the number of columns.

This metafunction is valid for use in attached auxiliary files, but always generates COLS=n, that is, it isn't Browser-aware when used in attached files.

Click to jump to top of pageClick to jump to parent topic%Component

Description

At runtime %Component is replaced with the component name of the current component.

Click to jump to top of pageClick to jump to parent topic%Copyright

Description

At runtime %Copyright is replaced with a string suitable for use as a standard PeopleSoft copyright notice.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%DBName

Description

At runtime %DBName is replaced with the name of the application database.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%DBType

Description

At runtime %DBType is replaced with the type of the application database.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%Encode

Syntax

%Encode(anything)

Description

At runtime %Encode plus anything is replaced with the encoded string. Encoding is done according to normal URL encoding rules.

Parameters

anything

Specify the string to be encoded.

This metafunction is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%Formname

Description

At runtime %Formname is replaced with the name of the HTML FORM generated for the current page.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%HtmlContent

Syntax

%HtmlContent(ContentName)

Description

At runtime %HtmlContent and ContentName are replaced by the URL suitable for referencing the content on the web server. In addition, the content is loaded into the web server's cache directory.

Parameters

ContentName

Specify the content you want to access, as a string.

Click to jump to top of pageClick to jump to parent topic%Image

Syntax

%Image(imagename)

Description

At runtime %Image and imagename are replaced by the URL suitable for referencing the image on the web server. In addition, the image is loaded into the web server's cache directory.

Parameters

imagename

Specify the name of an image saved as an image definition in Application Designer.

Example

<img src='%Image(PSLOGO)'>

Click to jump to top of pageClick to jump to parent topic%JavaScript

Syntax

%JavaScript(HTMLDefinition)

Description

At runtime %JavaScript and the HTMLDefinition are replaced by the URL suitable for referencing the .js file on the web server. In addition, the JavaScript is loaded into the web server's cache directory.

Parameters

HTMLDefinition

Specify the name of an HTML definition that contains a JavaScript program.

Example

<script src='%JavaScript(PT_EDITSCRIPTS)'></script>

Click to jump to top of pageClick to jump to parent topic%LabelTag

Description

At runtime %LableTag is replaced with the text LABEL.

This metavariable is valid for use in attached auxiliary files, but always generates LABEL, that is, it isn't Browser-aware when used in attached files.

Click to jump to top of pageClick to jump to parent topic%LanguageISO

Description

At runtime %LanguageISO is replaced with a string value representing the current session’s language code or language code and country code if a country code exists.

Use %LanguageISO to declare the language of a Web page using the HTML lang attribute.

For instance, if the language for the current language is English, then <html lang="%LanguageISO"> resolves to <html lang="en"> at runtime. If the current language is Canadian French then it would resolve to <html lang="fr-ca"> .

Example

&html = "<html dir='" | %Direction | "' lang='" | %LanguageISO | "'>";

Click to jump to top of pageClick to jump to parent topic%Menu

Description

At runtime %Menu is replaced by the menu name for the currently loaded component.

Click to jump to top of pageClick to jump to parent topic%Message

Syntax

%Message(message_set, message_num, default_msg_txt [, paramlist])

where paramlist is an arbitrary-length list of parameters to be substituted in the resulting text string, in the form:

param1 [, param2]. . .

Description

%Message retrieves a message from the PeopleCode Message Catalog and substitutes in the values of the parameters into the message.

The message_set and message_num parameters specify the message to retrieve from the catalog. If the message is not found in the Message Catalog, the default message provided in default_msg_txt is used. Message sets 1 through 19,999 are reserved for use by PeopleSoft applications. Message sets 20,000 through 32,767 can be used by PeopleSoft users.

The parameters listed in the optional paramlist are referenced in the message using the % character followed by an integer referencing the position of the parameter in the function call. For example, if the first and second parameters in paramlist were MONDAY and 12/5/2001, they would be inserted into the message string as %1 and %2. To include a literal percent sign in the string, use %%; %\ is used to indicate an end-of-string and terminates the string at that point, this is generally used to specify fixed-length strings with trailing blanks.

The message is obtained using the current user language code.

Parameters

message_set

Specify the message set to be retrieved from the catalog. This parameter takes a number value.

message_num

Specify the message number to be retrieved from the catalog. This parameter takes a number value.

default_msg_txt

Specify the text to be displayed if the message isn't found. This parameter takes a string value.

paramlist

Specify values to be substituted into the message.

This is valid for use in attached auxiliary files.

Note. If the message is changed (or a new language version is added) after the auxiliary file has been loaded to the web server, the auxiliary file still contains the old version of the message. It is necessary to manually delete the file from the web server cache directory to get it to re-retrieve the (unmodified) auxiliary component with the (modified) message bindings.

Click to jump to top of pageClick to jump to parent topic%Page

Description

At runtime %Page is replaced by the name of the current page.

Click to jump to top of pageClick to jump to parent topic%ServicePack

Description

At runtime %ServicePack is replaced with the application service pack string.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%SubmitScriptName

Description

At runtime %SubmitScriptName is replaced with the name of the JavaScript function that the current page uses to submit the form when a server action is required.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%ToolsRel

Description

At runtime %ToolsRel is replaced with the tools release string.

This metavariable is valid for use in attached auxiliary files.

Click to jump to top of pageClick to jump to parent topic%URL

Syntax

%URL(URLIdentifier [, NOENCODE | ENCODE | DESCR])

Description

The %URL Meta-HTML function finds the URL specified by URLIdentifier and substitutes its value. The URLIdentifier must already exist and have been created using URL Maintenance.

Parameters

URLIdentifier

Specify a URL Identifier for a URL that already exists and was created using the URL Maintenance page.

NOENCODE | ENCODE | DESCR

Specify any encoding or other processing to be done with the URL. ENCODE is the default value. If you specify ENCODE, special characters in the URL are encoded using standard URL encoding rules, that is, blanks are replaced with %20, and so on.

If you specify NOENCODE, no encoding is done with the URL.

If you specify DESCR, the description from the URL definition is used instead of the URL itself.

This metafunction is valid for use in attached auxiliary files.

Example

<a href='%URL(homepage)'>%URL(homepage, DESCR)</a>

See Also

URL Maintenance.

Click to jump to top of pageClick to jump to parent topic%UserId

Description

At runtime %UserID is replaced with the current UserId.