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 primarly for export to other systems
from N For qureies 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 is disabled in the tree.
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 is not imported.
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
<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 Octopus 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 column="Machine" id="MachineGuid" action="Machine" controller="Machine" />
        <link column="MostFrequentUser" id="MostFrequentUserGuid" action="User" controller="User" />
</weblinks>

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

Attribute Required Default Value Description
column Y The column that should be rendered as a hyperlink
id Y The column that contains the guid of the target object
action Y ASP.Net MVC action name
controller Y ASP.Net MVC controller name
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.

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

Use of predefined groups in the grid is deprecated in OctoSAM 1.8.10 and later. Instead let the user define her own groups and use the Save Layout function.

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
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.