In a single or start tag, white space and attributes are allowed between the macro name and the closing delimiter. An attribute typically consists of an attribute name, an equal sign, and a value (although some attributes may be just a name). White space is allowed around the equal sign. The value may be contained within quotes.
Attributes:
Examples:Live = (yes/no)
Whether to access the variable in the live configuration, or in the parallel copy used for editing purposes. Default is "not live".
(path) = (value)
The attribute name specifies the full path to the variable to be modified. The attribute value gives the new value to be appended to the variable.
Create a Database Query String from a Submitted Form
<!--#set table_query="select * from " -->
<!--#append table_query=@database -->
<!--#append table_query=".." -->
<!--#append table_query=@table -->
<!doctype html public "-//IETF//DTD HTML 3.0//EN"><html>which informs the browser that the document will make use of HTML 3.0 tags, as well as declaring the start of the document.
Examples:
A Simple Page
<!--#begin -->
<h1>A Simple Page</h1>
<!--#end -->
Attributes:
Examples:into = (variable)
The name of the variable in which to store the result. If this attribute is empty or undefined, the result is automatically displayed within the current document.
macro = (script name)
Executes the embedded WebMacro script with the specified name.
perl = (script name)
Executes the embedded WebPerl script with the specified name.
rexx = (script name)
Executes the embedded WebRexx script with the specified name.
Call the Perl TimeZone Script
<!--#call perl=PerlTime -->
Attributes:
Examples:Live = (yes/no)
Whether to access the variable in the live configuration, or in the parallel copy used for editing purposes. Default is "not live".
Var = (variable)
The name of a variable to concatenate with the result so far. Multiple "var" attributes may be used to combine several variables. If the variable is a "list" then each of its members is concatenated. It is essential that the "var" attribute follow any applicable "prefix", "suffix" and "separator" attributes, otherwise they will be ignored.
Prefix = (value)
The text value to output before each concatenated item.
Suffix = (value)
The text value to output after each concatenated item.
Separator = (value)
The text value to output between each concatenated item. The default separator is a comma ",".
Into = (variable)
The name of the variable in which to store the result. If this attribute is empty or undefined, the result is automatically displayed within the current document.
Show all the Database Query Headings
<!--#concat prefix='<b>' suffix='</b>' separator='<br>' var=Request:/Loop -->
Attributes:
Examples:errmsg = (text)
The (text) defines the new error message to display when a macro encounters an error, such as a syntax error or a variable not found error.
timefmt = (format)
A format string to use when displaying dates with the FLastMod macro. This format string is compatible with the C runtime library strftime function, allowing the following special sub-format specifications:a
abbreviated weekday name
A
full weekday name
b
abbreviated month name
B
full month name
d
day
H
24 hour
I
12 hour
m
month
M
minute
S
second
w
weekday 0-6, Sunday=0
x
date representation
X
time representation
y
2 digit year
Y
4 digit year
%
percent
sizefmt = (format)
A format string to use when displaying file sizes with the FSize macro. The allowed formats are "bytes" and "abbrev". "Bytes" shows the size as a thousands-separated count of bytes, and "abbrev" shows the size as a number of "K" (kilobytes), "M" (megabytes) or "G" (gigabytes).
Display the Current Time with Graphics
The time is now <!--#config timefmt="%H:%M:%S" -->
<img src=/$font?text=<!--#flastmod timezone=local now -->&style=gif&file=digital1.gif&charset=time&dir=/icons/digits -->
Attributes:
Examples:Company = (text)
The name of the company.
Mail = (text)
The e-mail address of the contact at the company.
URL = (text)
The Web Home Page for the company.
Display a Standard Copyright Notice
<!--#copyright company="Acme Insurance" mail="info@acme.com" url="www.acme.com" -->
Attributes:
Examples:Parent = (variable)
The directory in which to create the variable. If no parent is given, then "request:/argument" is assumed.
Name = (text)
The name of the variable to create.
Type = (type)
The type of variable to create, with the default being "text".It Can Be One Of:
Text
A sequence of printable characters ending in a null (0) character. The maximum length is 2 gigabytes, subject to virtual memory constraints.
Integer
A 4-byte (32 bit) signed integer.
Float
An 8-byte (double precision) signed floating point number.
Binary
A sequence of bytes that may contain embedded null (0) characters. The maximum length is 2 gigabytes, subject to virtual memory constraints.
List
A directory of other variables. There is no limit to the number of hierarchy levels.
Value = (text)
The initial value to assign to the variable. If this attribute is absent, the variable is given a null value.
Live = (yes/no)
Whether to create the variable in the live configuration, or in the parallel copy used for editing purposes. Default is "not live".
Create a Variable if the User did not Submit a Complete Form
<!--#if !defined=Quantity -->
<!--#create name=Quantity type=integer value=1 -->
<!--#endif -->
Attributes:
Examples:Live = (yes/no)
Whether to delete the variable in the live configuration, or in the parallel copy used for editing purposes. Default is "not live".
(path)
The full path to the variable to be deleted.
Destroy a Temporary Variable after use
<!--#destroy Request:/Argument/TempVar -->
This PowerWeb Macro is more powerful in that you have full control over what files are displayed, as well as their format and surrounding text above and below the directory listing.
Attributes:
Examples:file = (wildcard pattern)
The files that you wish to see listed.
virtual = (wildcard pattern)
The virtual URLs on your site that you wish to see listed.
Fancy = (yes/no)
Default is TRUE.
IncludeDirectories = (yes/no)
Default is FALSE.
IconsAreLinks = (yes/no)
Default is FALSE.
ScanHTMLTitles = (yes/no)
Default is FALSE.
SuppressDescription = (yes/no)
Default is TRUE.
SuppressLastModified = (yes/no)
Default is FALSE.
SuppressSize = (yes/no)
Default is FALSE.
List all ZIP files present in the Current Directory
<!--#dir file="*.zip" -->
Attributes:
Examples:Var = (path or CGI variable)
The full path of the PowerWeb Server++ variable to be displayed, or the name of an NCSA CGI variable. Usage of CGI variables is discouraged because of their higher overhead and lesser functionality.
NotFound = (text)
The text to display if the variable is not found.
Format = (text)
The only format currently supported is "escaped" which allows the variable to be used within a generated URL.
Attrib = (type)
Specifies that variables in any following conditional attributes will be evaluated according to the given attribute type.Valid Attribute Types Are:
Value
The value of the variable.
Size
The size of the variable, 0 if it is empty.
Name
The name of the variable.
Path
The full directory path name of the variable.
Live = (yes/no)
If Live is YES, it specifies that the currently active live configuration is to be used, otherwise the copy of the configuration that is currently being edited is used. The default is YES.
Into = (variable)
The name of the variable in which to store the result. If this attribute is empty or undefined, the result is automatically displayed within the current document.
Display the Current Number of Connections
<!--#echo var=Server:/Stats/Clients -->
Display the Number of Form Fields Submitted
<!--#echo attrib=size var=Request:/Argument -->
Create a Hidden Field to Pass on a Field from one Form to Another
<input type=hidden name=pass value= "<!--#echo notfound='my_default' var=pass -->" >
</body></html>which informs the browser that the document is complete.
Examples:
A Simple Page
<!--#begin -->
<h1>A Simple Page</h1>
<!--#end -->
The C, Perl and Rexx scripts have full access to the PowerWeb APIs, so they can query or set variables, perform validation, output customised text, etc. Refer to the API reference manual for more information.
Attributes:
Examples:cmd = (executable program)
Executes an operating system executable program or built-in command, which takes no keyboard input. The program output is displayed in the document.
cgi = (CGI script)
The CGI script is a URL specifying the CGI program to run. Any headers output by the CGI script are ignored, because the headers of the current document take precedence.
api = (module!function)
The API script is a URL specifying the API library module and function to run.
rexx = (module)
The Rexx script is a URL specifying the Rexx command module to run. If no directory is mentioned, the file is assumed to be in the same directory as the HTML document referring to it.
perl = (package!function)
The Perl package name must be on your PERLLIB path and is case sensitive. Note that the "perl-bin" directory is automatically placed on your PERLLIB path when PowerWeb starts up. The function name must be the name of a function contained within the specified package and is called with the PowerWeb "parcel" as its argument.
Execute a Rexx Script in the Current Directory, Displaying its Output Within the Current Document
<!--#exec rexx=common.cmd -->
Note: you must have set Access Control Permissions to allow API script execution from within the Resource protecting that directory.
Execute a Perl Package Function
<!--#exec perl=Sample!TimeZone -->
Load and Run a Perl Script within a Specific Directory
<!--#exec perl=/perl-bin/test.pl -->
Attributes:
Examples:file = (filename)
The filename path is relative to the current directory of the original HTML document.
virtual = (local URL)
The URL specified must be local to the current server and is specified in the same way as a normal local document hyperlink reference within an HTML document.
Thousands = (character)
The character to use as a thousands separator when displaying sizes. The default is a comma.
Into = (variable)
The name of the variable in which to store the result. If this attribute is empty or undefined, the result is automatically displayed within the current document.
Display the Size of a Photo File
Download the <a href=photo.jpg>photo</a> which is of size <!--#fsize virtual=photo.jpg -->.
Attributes:
Examples:file = (filename)
The filename path is relative to the current directory of the original HTML document.
virtual = (local URL)
The URL specified must be local to the current server and is specified in the same way as a normal local document hyperlink reference within an HTML document.
Now
Uses the current date and time instead of that for a given file.
Timezone = (GMT/local)
Specifies a timezone for displaying the date and time. The default is GMT.
Into = (variable)
The name of the variable in which to store the result. If this attribute is empty or undefined, the result is automatically displayed within the current document.
Display the Last Modification Date of the Current Document
This document was last updated on <!--#flastmod virtual=@Request:/VirtualResource -->
The structure of IF/ELIF/ELSE/ENDIF is as follows:
<!--#if (conditions 1) -->The If and Elif macros contain conditional attributes which are evaluated to TRUE or FALSE to determine whether to include the block of HTML into the document.
HTML to output if the "if" conditions are true.
<!--#elif (conditions 2) -->
HTML to output if the "elif" conditions are true.
<!--#elif (conditions 3) -->
HTML to output if the next "elif" conditions are true.
<!--#else -->
HTML to output if the "if" and all the "elif" conditions are false.
<!--#endif -->
Optional attribute attributes can be included to refine the evaluation of the conditional attributes.
Specification Attributes:
Conditional Attributes:And
The conditions that follow are combined with AND. The first condition that evaluates FALSE, causes the entire IF condition to evaluate FALSE.
Or
The conditions that follow are combined with OR. The first condition that evaluates TRUE, causes the entire IF condition to evaluate TRUE.
Attrib = (type)
Specifies that variables in any following conditional attributes will be evaluated according to the given attribute type.Valid Attribute Types Are:
Value
The value of the variable.
Size
The size of the variable, 0 if it is empty.
Name
The name of the variable.
Path
The full directory path name of the variable.
Live = (yes/no)
If Live is YES, it specifies that the currently active live configuration is to be used, otherwise the copy of the configuration that is currently being edited is used. The default is YES.
All conditional attributes can start with an optional '!' character which reverses the condition.
Examples:Defined = (variable)
Evaluates to TRUE if the specified variable exists.
Empty = (variable)
Evaluates to TRUE if the specified variable does not exist, or if its contents are empty or NULL.
Var = (variable)
Evaluates to TRUE if the specified variable exists and its contents evaluate to TRUE.
@(variable) (condition) (value)
Evaluates the expression where (variable) can be any PowerWeb variable, (value) can be a constant or a reference to any PowerWeb variable, and (condition) is one of:=
Tests for equality.
<
Tests less than.
>
Tests greater than.
?
Tests whether the (value) can be found by a text search within the (variable). If (value) contains any wildcard characters (? or *), then a regular expression match is performed.
File = (wildcard pattern)
Evaluates to TRUE if any file exists on your site that matches the specified wildcard pattern.
Virtual = (wildcard pattern)
Evaluates to TRUE if any local URL exists on your site that matches the specified wildcard pattern.
Counter
Evaluates to TRUE if a page access counter exists for the current document.
Counter = (uri)
Evaluates to TRUE if a page access counter exists for the specified document.
0
Evaluates to FALSE.
1
Evaluates to TRUE.
Test for Correctly Filled-in Forms
<!--#if or empty=LastName empty=FirstName -->
You did not fill in the FirstName or LastName field on the form.
<!--#endif -->Tests whether the form fields FirstName and LastName were entered, and, if not, includes an error message in the document returned to the user.
Take Different Actions According to Form Fields
<!--#if @Pizza=Pepperoni -->
You ordered a Pepperoni pizza.
<!--#elif @Pizza=Hawaiian -->
You ordered our house speciality, the Hawaiian pizza.
<!--#else -->
There is no pizza named <!--#echo var=Pizza --> on our menu.
<!--#endif -->Displays which pizza the user ordered, with an error message if the user ordered a pizza which is not on the menu.
Return Different Documents or Messages According to Domain or IP Address
<!--#if @connection:/RemoteAddress?"12.34.56.*" -->
You are on our private network.
<!--#elif @connection:/RemoteHost?"*.widget.com" -->
You are on the widget.com domain.
<!--#else -->
This server is not allowed to show you this document.
<!--#endif -->This example illustrates how you can return different documents or messages according to the domain or IP address from which the user accesses your server. Access control rules within the server configuration can also be used to prevent unauthorised access.
Attributes:
Examples:file = (filename)
The filename path is relative to the current directory of the original HTML document.
virtual = (local URL)
The URL specified must be local to the current server and is specified in the same way as a normal local document hyperlink reference within an HTML document.
Include Boiler-Plate Text into a Document
<!--#include virtual=template.htm -->
Conditionally Show a Page According to the Client Browser
<!--#if @Request:/Header/In/User-Agent ? "Mozilla" -->
<!--#include virtual=netscape.htm -->
<!--#else -->
<!--#include virtual=generic.htm -->
<!--#endif -->
Attributes:
var = (directory)
The name of a PowerWeb Server++ variable directory which contains the list of allowed options.
name = (text)
The name to give to the HTML input field.
type = (text)
The type of data entry field to use, currently only listboxes and comboboxes are supported.
size = (number)
This is the number of data items to display without scrolling. A value of 1 results in a combobox, and a larger number results in a listbox which uses scrollbars only if the number of options exceeds the value given here.
live = (yes/no)
Whether to look for the directory in the live configuration, or in the parallel copy used for editing purposes.
Attributes:
var = (directory)
The name of a PowerWeb Server++ variable directory which contains the list of variables to edit.
mode = (text)
The mode determines whether the table is read-only or editable. Use "input" for an editable table, and "browse" for a read-only table.
live = (yes/no)
Whether to look for the directory in the live configuration, or in the parallel copy used for editing purposes.
The Loop macro stores its loop control variable within a special WebObject directory. Its default location is "Request:/Loop/RowNumber". There are also two other WebObject variables within that directory:
Attributes:
var = (directory)
The name of a PowerWeb Server++ WebObject variable directory which contains the list of objects to iterate over. If this is specified, do not use the "from", "to" or "step" attributes.
from = (number)
The starting numeric value for the iteration. You should also specify the "to" attribute, but not the "var" attribute.
to = (number)
The ending numeric value for the iteration. You should also specify the "from" attribute, but not the "var" attribute.
step = (number)
The increment for the loop value for each iteration. Defaults to 1. You should also specify the "from" and "to" attributes, but not the "var" attribute.
maxrows = (number)
The maximum number of iterations to perform. If the from/to/step attributes imply a larger number of iterations, the "to" specification is adjusted accordingly. You must also specify either the "from" or the "var" attribute.
live = (yes/no)
Whether to look for the "var" WebObject in the live configuration, or in the parallel copy used for editing purposes. Defaults to "yes".
cursor = (directory)
The name of the directory in which to place loop control variables. It defaults to "Loop", and is always created under the "Request:/" directory. Naming your loop allows you to create nested loops. The directory and its variables are automatically created for you and are deleted at the end of the loop iteration.
heading = (script name)
The name of the embedded WebScript to execute to display a heading. Only output if the loop iteration is valid.
row = (script name)
The name of the embedded WebScript to execute for each iteration of the loop.
trailer = (script name)
The name of the embedded WebScript to execute to display a trailer. Only output if the loop iteration is valid.
Examples:
Iterating a WebMacro, According to the Submitted HTML Form Field named "Count"
<!--#script LoopScript -->
Row number <!--#echo var=Request:/Loop/RowNumber --><br>
<!--#/script -->
<!--#loop from=1 to="<!--#echo notfound=5 var=count -->" row=LoopScript -->
Attributes:
Examples:virtual = (url)
The full URL to redirect the client's browser to.
Redirect Users on a Specified Subnet to Another Server
<!--#if @connection:/RemoteAddress?"12.34.56.*" -->
<!--#redirect virtual="http://internal.acme.com/thispage.htm" -->
<!--#endif -->
The "EndScript" or "/Script" WebMacro must be used to define the end of the script.
The script has a logical scope of the current HTTP request only and is deleted after the HTTP request is complete.
Scripts can be contained within #include files and can be called as many times as required by using the #call and #loop WebMacros.
You should read the API Reference Manual for details on creating scripts. In particular, you should also read the manuals on Perl Scripts or Rexx Scripts.
Attributes:
Examples:(name)
The name to give to the script. This is the name that must be supplied when using the Call or Loop WebMacros.
Calling a Perl ODBC Package from within HTML
<!--#Script ODBC_Servers -->
use ODBC;
my($html) = WebPerl::Find(WebPerl::GetParcel(), 'Request:/Result');
WebPerl::AppendText($html, '', ODBC::AvailableServers());
0;
<!--#EndScript -->
<!--#Call perl=ODBC_Servers -->
Perl Script Example
Look at the code within "\powerweb\system\tour\perltime.htm".
Rexx Script Example
Look at the code within "\powerweb\system\tour\rexxtime.htm".
Attributes:
Examples:Live = (yes/no)
Whether to access the variable in the live configuration, or in the parallel copy used for editing purposes. Default is "not live".
(path) = (value)
The attribute name specifies the full path to the variable to be modified. The attribute value gives the new value to be assigned into the variable. If the variable does not exist and only a name, not a path, is specified, then the variable is auto-created in the "Request:/Argument" variable directory as a text variable.
Define a Temporary Variable
<!--#set TempVar="my_value" -->
Attributes:
var = (directory)
The name of a PowerWeb Server++ variable directory which contains the list of variables to edit.
free = (number)
The Free attribute determines how many blank records are presented for creating new records at the end of the table. A value of 0 prevents the creation of new records.
mode = (text)
The mode determines whether the table is read-only or editable. Use "input" for an editable table, and "browse" for a read-only table.
type = (0/1)
The type determines the display and editing format of the table. If it is omitted, the default table type is used, as defined by the variable "Config:/Console/TableType". Use 0 for a table using pre-formatted text with a single record editing facility, and use 1 for an HTML 3.0 table with multiple record editing capability.
live = (yes/no)
Whether to look for the directory in the live configuration, or in the parallel copy used for editing purposes.
colX = (text)
Defines the contents of the column numbered X in the table. If the (text) includes a colon, then all text after the colon is used as a column heading, and the prior text defines the name of the field in the record to display.
colX_edit = (text)
Defines whether column X may be edited and whether it must be filled in when creating new records.Legitimate Edit Modes Are:
No
The column is read-only.
Yes
The column is always allowed to be edited.
Auto
Determines whether the column is editable according to the variable's permission settings.
Required
The column is always allowed to be edited and must be filled in before a new record will be accepted.
OneOf
The column is always allowed to be edited and it, or another column also marked OneOf, must be filled in before a new record will be accepted.
Link
The column is read-only in this table, but hyperlinks to another data entry screen for editing.
colX_width = (number)
Defines the number of characters to specify as the input field width in column X.
colX_null = (text)
Defines the text to show if column X has a NULL value. Also any text entered which matches this value is considered to be NULL.