Table of Contents
SRCRELPATH, DATE, TITLE, [CONTENT_TYPE], [HEAD], [BODYATTR])[TOOLTIPWIDTH], [FILE], [ImgScale], [ANCHOR])TEXT)IP, [LABEL], [TITLE])[URL], [LABEL], [TITLE], [ATTRS])CMD, [SHOW])CMD, [SHOW], [PARAMS], [INITFONTSIZE], [TOOLTIPATTRINCID], [TOOLTIPATTRDECID], [TOOLTIPATTRRESID], [TOOLTIPATTRFITID], [ID], [FILENAMETITLE])CMD, [SHOW], [FILENAMETITLE])[CODE])FILE, [LINES], [LABEL], [RETURN], [RETURN_LABEL], [TEXT_MODE], [DISPLAY_WIDTH], [LINE_NUMBER], [TITLE], [SYNCKEY], [BUTTONATTRS], [IEFORCEJUMP], [FORMATTRS], [PDFTITLE])FILE, [LINES], [AUTO], [LABEL], [RETURN], [RETURN_LABEL], [TEXT_MODE], [DISPLAY_WIDTH], [LINE_NUMBER], [TITLE], [SYNCKEY], [BUTTONATTRS], [IEFORCEJUMP], [FORMATTRS])FILE, [LINES], [LABEL], [RETURN], [RETURN_LABEL], [TEXT_MODE], [DISPLAY_WIDTH], [LINE_NUMBER], [SYNCKEY], [IEFORCEJUMP])DIR, [LABEL], [RETURN], [TITLE], [RETURN_FROM], [DIRFILTER], [FILEFILTER], [ATTR], [RETURNLABEL], [SYNCKEY], [FORMATTRS])DIR, [LABEL], [RETURN], [RETURN_FROM], [SYNCKEY], [DIRFILTER], [FILEFILTER], [RETURNLABEL])SECTIONNAME, URL, LABEL, [WIDTH], [BOLD])PAGENAME, URL, LABEL, [WIDTH])[LABEL], [HIDDEN], [TITLE], [ATTRS])NAME, FILE, [ROWS], [COLS], [TITLE], [CLASS], [ATTRIBUTES])FILE, LABEL, [SAVERETURL], [SYNCKEY], [ATTRS], [NOSAVERETURL], [IEFORCEJUMP], [RETURN_FROM], [RETURN_LABEL], [RETURN_BACK], [RETURN_LABEL_BACK], [RETURN_FROM_BACK])NAME, FILE, OWNER, GROUP, PERMS)[TITLE], [WIDTH])FILE, [WIDTH], [TITLE], [KEYTITLE])DIRECTORY, [WIDTH], [TITLE], [DIRTITLE], [DIRFILTERTITLE], [DIRFILTER], [FILEFILTERTITLE], [FILEFILTER])URL, [WIDTH], [TITLE], [KEYTITLE])PROGRAM, [LABEL], [SECTION])The first line of any bash CGI script in the NST WUI.
The following parameters are recognized:
Relative path from the source top level checkout.
The date the script was originally created (YYYY-MM-DD).
The title for the CGI script.
The content-type which script produces (defaults to "text/html; charset=ISO-8859-1" if omitted).
Arbitrary block of HTML/JavaScript code to include at the end of the <head> section.
Any extra attributes for the <body> entity.
Example of using the macro:
@bashCgiBegin("wui/cgi-bin/networking/route.cgi","2009-09-30","Route Utility")
@bashCgiOutBegin()
@p("The following shows the currently routing table.")
@runCommand("/sbin/route")
@bashCgiOutEnd()
@bashCgiEnd()
Assuming the com.ccg.macros.at.All
class is within your CLASSPATH and the
config/bash.at macros file has been
generated (Hint: run make atmacros in the
wui directory), a developer should be able to
run the above example by copy/pasting from below:
[root@probe root]#java com.ccg.macros.at.All <<EOF@include("config/bash.at",,"d")@bashCgiBegin("wui/cgi-bin/networking/route.cgi","2009-09-30","Route Utility") @bashCgiOutBegin() @p("The following shows the currently routing table.") @runCommand("/sbin/route") @bashCgiOutEnd() @bashCgiEnd()EOF
This macro is defined as:
#!/usr/bin/bash
if [ \"${__FORM_SH}\" != "true" ]; then
. '@topDir()/cgi-bin/include/form.sh';
fi
#
# Make sure static info files are present (create if necessary) and
# then load in the static information variables
static_info check "@topDir()";
if [ \"${__CONFIG_SH}\" != "true" ]; then
. '@topDir()/cgi-bin/include/config.sh';
fi
if [ \"${__REQUIRE_BASH}\" != "true" ]; then
. '@topDir()/cgi-bin/include/require.bash';
fi
if [ \"${__WUI_REQUIRE_SH}\" != "true" ]; then
. '@topDir()/cgi-bin/include/wui_require.sh';
fi
if [ \"${__IP_BASH}\" != "true" ]; then
. '@topDir()/cgi-bin/include/ip.bash';
fi
@define("exitAnchor","")
#
# Set IP_LABEL to "IP (HOST)" or "IP" if unable to lookup host. NOTE:
# apache provides us with a HOSTNAME variable as well - maybe we should
# just use that?
#
IP_LABEL=\"${SERVER_ADDR}\";
NST_FQDN=\"\";
if IP_HOST=\"$(get_host_for_ip "${SERVER_ADDR}")\"; then
IP_LABEL=\"${IP_LABEL} (${IP_HOST})\";
NST_FQDN=\"${IP_HOST}\";
else
# Use server IP address as host name
IP_HOST=\"${SERVER_ADDR}\";
fi
#
# Get NST time stamps from system...
#
# Determine time format...
if [ \"${SYSINFO_FORMAT_TIME_24}\" == \"true\" ]; then
NST_TIME_FMT=\"%T %Z\";
else
NST_TIME_FMT=\"%r %Z\";
fi
eval $(/bin/date "+NST_DATE='%a %b %d, %Y'; NST_TIME='${NST_TIME_FMT}'; NST_TIME_SECS='%s'; NST_TIME_NANOS=\$((1%N - 1000000000));");
RFC_2822_DATE=\"$(TZ=GMT /bin/date --rfc-2822)\";
#
# Get values reported by: "uptime"...
@parseUpTime()
@bashCgiOutBegin()
@httpdContentType("@param(3)","${RFC_2822_DATE}")
@docBegin("@param(0)","@param(1)","@param(2)","@param(4)","@param(5)","@param(3)")
@bashCgiOutEnd()