Elements

query Element

<query object="Machine" 
        guid="{9e0767b0-1c00-11e3-b773-0800200c9a66}"
        tooltiptables="Machine,SoftwarePackage">
</query>
Attribute Required Default Value Description
desktop N true This query is available in desktop UI
export N Can specify 'JSON' or 'SQL' to preset the export dialog for queries designed mainly for export to other systems
from N For queries started from an OctoSAM Inventory object, specify the name of the object
guid Y A unique GUID for each query
license N A comma separated list of required license options for this query. If a license option is not installed the query will not be available in the UI.
multidelete N true if set to true, allows to select multiple rows in the output grid for delete operations
multiselect N true if set to true, allows to select multiple rows in the output grid
object N specifies the "main" object that this query returns, for queries that do not return a main object, specify "none"
required N A comma separated list of required tables or views for this query. If a required table or view does not exist at time of import, the query will not be available in the UI.
tooltiptables N A comma separated list of database tables that are used for column header tooltips
verbatim N false Use column names exactly as specified in the query, no OctoSAM casing/spacing. Useful for exports to other systems
web N true This query is available in the web UI

description Element

<description> 
        <p>All Machines with their most frequent and last users.</p>
</description>

The description element may contain a subset of HTML elements to define a short description of the Query. The description is displayed in the query selection tree in the OctoSAM Inventory GUI.

HTML Element
<b> <strong> Bold
<br /> Line Break
<i> <em> Italics
<li> List item
<ol> Ordered list
<p> Paragraph
<u> Underlined Text
<ul> Unordered List

pragmas Element

<pragmas> 
        <pragma name="pragma_name" value="pragma_value" />
</pragmas>

The <pragmas> element configures settings that are mainly used for internal debugging and unit testing. These settings are internal to OctoSAM.

Attribute Required Default Value Description
name Y OctoSAM object to link to
value Y Column to use for the linked object ObjectID
<links> 
        <link object="Machine" id="MachineID" />
        <link object="User" id="MostFrequentUserID" />
        <link object="User" id="LastUserID" />
</links>

The <links> element establishes links from the grid to specified OctoSAM Inventory object windows.

Attribute Required Default Value Description
object Y OctoSAM object to link to
id Y Column to use for the linked object ObjectID
Tip

Multiple links to the same object type can be defined if a query returns multiple logical objects of the same type on the same row. For example a Query can return both the MostFrequentUser and the LastUser. In this case, OctoSAM Inventory will automatically annotate the different links of the same type in the Select Object dialog.

<weblinks> 
        <link object="Machine" column="Machine" id="MachineGuid"  />
            <link object="User" column="MostFrequentUser" id="MostFrequentUserGuid" />
</weblinks>

The <links> element establishes links from the grid to specified OctoSAM Inventory object windows.

Attribute Required Default Value Description
object N OctoSAM oobject to link to
column Y The column that should be rendered as a hyperlink
id Y The column that contains the guid of the target object
action N ASP.Net MVC action name (do not use for standard objects or queries)
controller N ASP.Net MVC controller name (do not use for standard objects or queries)
query N Guid of a query to call. objectid parameter of the query will be set to the value of the column named in id. Currently, controller and action must be set to "Query" if you use this.

Currently query to query links are only supported for web queries.

You have to make sure that the column used for the hyperlink is not confusing in the desktop rendering of the query.

Note that weblinks always start from a specified column, while the traditional links start from the entire row.

Action and controller attributes allow to link to a specific part in the application. This is reserved for queries maintained by OctoSAM, since it depends on undocumented internals of the application. To link to the standard starting page of an object, use the object attribute.

initially Element

The <initially> element allows to define properties at initial load of the query definition. It is executed exactly once when the query is loaded.

input Element

<input> elements are used within dialogs to define input fields.

finally Element

Property definitions in the <finally> element are executed right before the select statement is sent to the database. In case of a refresh or Re-Query, this element is executed again. Property values may get overwritten. This is an exception to the rule that properties are read-only once they are set.

<dialog prefix="dialog"> 
    <input type="checkbox" name="junk" title="Including Junk" />
</dialog>

<finally>
    <property name="junk_condition" 
              select-if="${dialog_junk}=false" 
              value="WHERE SoftwareCategory.Junk = 0"/> 
    <property name="junk_condition" 
              select-if="${dialog_junk}=true" 
              value=""/> 
</finally>

This example shows the typical usage of the <finally> element to construct chunks of SQL code based on dialog input. The property ${junk_condition} would then be used within the <select> element.

groups Element

<groups>
    <group column="Column1" />
    <group column="Column2" />
</groups>
Attribute Required Default Value Description
column Y Column to group

The groups element can be used to pre-define grouping in the result grid.

Info

Standard OctoSAM queries do not define groups, instead the suer can define groups and save them using the Save Layout function. Pre-defined groups may make sense in site-specific queries.

columns Element

Attribute Required Default Value Description
align N "left" Align the contents of the column
autoellipsis N true If true, the grid displays ellipsis if the value does not fit the visible cell
defaults N Select OctoSAM default formats for date, time or ratio type columns.
format N "{0}" .net format specification
webformat N "{0}" Telerik UI for ASP.Net MVC format
exportformat N Excel Export format
header N Can be used to specify a column header thats different from the column name
measureitem N A string to define the width of the column
name Y Column name
tooltip N Text of tooltip to display for this column
visible N true Initial visibility of the column
webvisible N true Initial visibility of the column in web interfaces

Tooltips

Tooltips are usually formed using the documentation of the database columns via the tooltiptables attribute in the <query> element. Some often needed tooltips are defined globally and distributed with the queries. Aggregated and computed columns need custom tooltips defined per column in the tooltip attribute of the column element. The tooltip attribute can also refer to database documentation by using the prefix db: in front of the original column name.

  <column name="Host" tooltip="db:Machine.PrintableName" />

This will use the database documentation of the Machine.PrintableName column.