This type of Inspector helps you to author HTML commands to create customized content for the BigFix Console and Web Reports. They allow construction of HTML snippets that can be used to display BigFix data elements in a browser.
When generating HTML, you will be working with the html type. This type can be thought of as a string that carries around an indication that its content is to be treated as HTML. This automatically keeps track of normal string characters that have special meaning in HTML (such as < , > , and &), and escapes them.
An HTML inspector automatically converts:
- The reserved characters to the appropriate HTML entities.
- The results of evaluated relevance instructions to HTML before inserting them into the presentation HTML. This means that you can write Relevance expressions just as you would expect and simply use the html Inspector to convert them, for example:
html of "AT&T"
Or you can cast a string as an html type explicitly to achieve the same results (but without the bracketing
<html> tags), for example:
"<h1>Heading</h1>" as html
If you actually want HTML code to be output, you can use an indexed HTML command such as:
As an alternative to HTML-formatted retrieved properties, consider reporting the results in plain text and doing the formatting from within the presentation.
If you concatenate html with strings, it will automatically escape any reserved characters:
html "<h1>" & "PG&E" & html"</h1>"
concatenation of (html<h1>"; "R&D" as html; html "</h1>")
Note that for concatenation, the items in the list must all have the same type, so the following will not work:
concatenation of (html<h1>"; "R&D"; html "</h1>")
Returns the error: Incompatible types (html and string).
HTML tag Inspectors
Although it is possible to use the "html" indexed property (as shown above), the HTML tag Inspectors are recommended instead:
html tag "h1" of "Johnson & Johnson"
<h1>Johnson & Johnson</h1>
The "html tag" takes as an index parameter the name of the HTML element with which to surround the direct object text. The direct object (the object after the "of") can be either a string or html. If it is a string, it will be HTML-escaped. The index parameter can also include attributes, separated from the element name by whitespace:
html tag "h1 id='Ben & Jerry'" of "Ben & Jerry"
<h1 id='Ben & Jerry'>Ben & Jerry</h1>
Nesting tags is straightforward:
html tag "div id='header'" of html tag "h1" of "AT&T"
Most common HTML elements have a shorthand tag property:
h1 of "P&G"
Like the generic html tag Inspector each shorthand tag property accepts either strings or html as a direct object. Each also accepts HTML attributes as an index parameter:
h1 "id='P&G' class='header'" of "P&G"
<h1 id='P&G' class='header'>P&G</h1>
The following tags are supported:
Because "a" is ignored by the relevance evaluator, the "a" shorthand property is replaced by "anchor".
anchor "href='http://www.ibm.com'" of "ibm"
Finally, there are a few special purpose aggregating properties:
- ordered list
- unordered list
- definition list
These produce HTML lists (of the respective types) of their plural string or html direct object:
ordered list of ("<"; ">"; "&")
unordered list of ("<"; ">"; "&")
The definition list command alternates between dt and dd elements. Use it where you have a natural set of name/value pairs:
definition list of (name of it; free space of it as string) of drives whose (exists free space of it)
var myArray = new Array();myArray = "a";myArray = "b";myArray = "c";.