@tailButton(FILE, [LINES], [LABEL], [RETURN], [RETURN_LABEL], [TEXT_MODE], [DISPLAY_WIDTH], [LINE_NUMBER], [TITLE], [SYNCKEY], [BUTTONATTRS], [IEFORCEJUMP], [FORMATTRS], [PDFTITLE])

Insert a single form button to view end of file on server.

The following parameters are recognized:

FILE

The full path to the file to display (on the server).

[LINES]

The maximum number of lines to display, or "all" (the default) for entire file.

[LABEL]

The text the user clicks on. If omitted defaults to FILE.

[RETURN]

The URL to return to when user finishes browsing file. If omitted, returns to index page of WUI.

[RETURN_LABEL]

The label to put on the "Return" button. Defaults to "Return" if omitted.

[TEXT_MODE]

Can be used to force the displayed text mode to: "ASCII" or "Hex".

[DISPLAY_WIDTH]

Can be used to change the width of the text area box displaying the file content. It is expressed as a percentage of the browser's window width. A default value of 95 percent is used.

[LINE_NUMBER]

Used to add line numbers preceding each line of a file. Set the value to "checked" for line numbers or leave blank to disable.

[TITLE]

Optional title attribute to appear as a tooltip to the user when their mouse hovers over the button.

[SYNCKEY]

Used to set a unique ID you want returned. Useful for passing a parameter back to a calling cgi script. NOTE: You need to encode/escape the form parameter yourself.

[BUTTONATTRS]

Optional set of attributes to apply to input button entity.

[IEFORCEJUMP]

Used for jumping to an exact location on a page specific to the IE browser when returning from the NST File Viewer. Set this parameter to an "ID Tag Attribute" on the page as an anchor to jump to.

[FORMATTRS]

Optional set of attributes to apply to the form entity.

[PDFTITLE]

Optional title for PDF rendering.

This macro is useful when you want to let the user browse a file on the system. It uses a HTML form and you may use bash environment variables and functions as your parameters.

Example of using the macro:

@tailButton("/var/log/boot.log","${QUERY_lines}","boot.log",,,"ASCII","95","checked")

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")
@tailButton("/var/log/boot.log","${QUERY_lines}","boot.log",,,"ASCII","95","checked")
EOF

This macro is defined as:

<form@htmlAttr("action","@topDir()/cgi-bin/system/tail.cgi")@ifEqual("@param(12)","","","@param(12)")>
@wuiInputHidden("filename","@param(0)")
@wuiInputHidden("lines","@fnb("@param(1)","100")")
@wuiInputHidden("return","@fnb("@param(3)","@topDir()/index.cgi")")
@wuiInputHidden("return_label","@fnb("@param(4)","Return")")
@wuiInputHidden("prevtextmode","@fnb("@param(5)")")
@wuiInputHidden("displaywidth","@fnb("@param(6)","95")")
@wuiInputHidden("linenum","@fnb("@param(7)")")
@wuiInputHidden("synckey","@fnb("@param(9)")")
@wuiInputHidden("ieForceJump","@fnb("@param(11)")")
@wuiInputHidden("pdftitle","@fnb("@param(13)")")
@wuiInputButton("submit","@fnb("@param(2)","Show @param(0)")","@fnb("@param(8)","@ttNSTFileViewer("@param(0)","$(calcDomTTLen "@param(0)" 50 300 1600)")")","@fnb("@param(10)")")
</form>