HTML Inspectors

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"

returns: <html>AT&amp;T</html>.

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

returns: &lt;h1&gt;Heading&lt;/h1&gt;

If you actually want HTML code to be output, you can use an indexed HTML command such as:

html "<h1>Heading</h1>"

which returns: <h1>Heading</h1>

As an alternative to HTML-formatted retrieved properties, consider reporting the results in plain text and doing the formatting from within the presentation.

Concatenation samples

If you concatenate html with strings, it will automatically escape any reserved characters:

html "<h1>" & "PG&E" & html"</h1>"

returns: <h1>PG&amp;E</h1>

Or:

concatenation of (html<h1>"; "R&D" as html; html "</h1>")

returns: returns: <h1>R&amp;D</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"

returns: <h1>Johnson &amp; 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"

returns:<h1 id='Ben & Jerry'>Ben &amp; Jerry</h1>

Nesting tags is straightforward:

html tag "div id='header'" of html tag "h1" of "AT&T"

returns: <div id='header'><h1>AT&amp;T</h1></div>

Most common HTML elements have a shorthand tag property:

h1 of "P&G"

returns: <h1>P&amp;G</h1>

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"

returns: <h1 id='P&G' class='header'>P&amp;G</h1>

The following tags are supported:


abbr acronym address anchor b
base big blockquote body caption
cite code col colgroup dd
del dfn div dt em
h1 h2 h3 h4 h5
h6 head html i ins
kbd li link meta ol
p pre q samp small
span strong sub sup table
tbody td tfoot th thead
title tr tt ul var

Because "a" is ignored by the relevance evaluator, the "a" shorthand property is replaced by "anchor".

anchor "href='https://www.hcltechsw.com/'" of "HCL"

returns: <a href='https://www.hcltechsw.com/'>HCL</a>

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 ("<"; ">"; "&")

returns: <ol><li>&lt;</li><li>&gt;</li><li>&amp;</li></ol>

unordered list of ("<"; ">"; "&")

returns: <ul><li>&lt;</li><li>&gt;</li><li>&amp;</li></ul>

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)

returns: <dl><dt>C:</dt><dd>32183602176</dd> <dt>G:</dt><dd>4845355008</dd></dl>


Examples

javascript array "myArray" of ("a"; "b"; "c")

Creates the JavaScript snippet: var myArray = new Array();myArray[0] = "a";myArray[1] = "b";myArray[2] = "c";.