Query Expression

Several of the server methods and templates support query expression strings to help select and filter database objects.  These strings have a common format, namely a collection of stanzas that specify a field, a comparison operation, a value and a chaining code to link to other stanzas.  Stanzas are delineated by the ';' character and the fields in the stanza are separated by the '|' character.  An example query expression might be:


A|i_tags|cont|chart=pie;A|i_name|ncont|Total;


This query consists of two stanzas.  The 'A' is the chaining code and stand for 'and'. The first stanza is looking at the i_tags field (the Item object tags field) and the second is looking at the i_name field (the Item object name field). The first stanza uses 'cont' to suggest that the item tags field must contain the value 'chart=pie' and the second stanza specifies that the item name field must not contain the string 'Total'.  In the Nexus Template Editor, this query would look like:


Query stanza chaining commands

A

chain from previous stanza with 'and' logic

O

chain from previous stanza with 'or' logic

Query fields

Note, all fields may be used for Item object type queries. The query will be performed on the associated session or dataset objects if a session or dataset field is specified in an Item query string. For a Session object type query, only session fields are allowed and for a Dataset object type query only dataset fields are allowed.

Item fields

i_name

the item name

i_src

the item source

i_date

the date & time of the item

i_tags

tag string for the item

i_type

the type of the item: 'html', 'string', 'table', 'image', 'anim', 'scene', 'file', 'none'

i_seq

item sequence number

Session fields

s_app

session application name

s_ver

version string for the session application

s_date

the date & time of the session

s_tags

tag string for the session

s_host

the session hostname

s_plat

session platform

s_guid

session GUID

Dataset fields

d_name

the filename of the dataset

d_dir

the original dataset directory

d_fmt

the format of the dataset (for EnSight, this is the reader name)

d_tags

tag string for the dataset

d_guid

dataset GUID

Report Template fields

t_name

the filename of the report template

t_filt

the report template item filter

t_types

the type of the report template (e.g. Layout:basic)

t_mstr_chk

true if the report template is a root level template (vs a child template)

t_date

the date & time of the report template

t_tags

tag string for the report template

t_guid

report template GUID

Comparison operators

Some of these operators have mixed meanings, based on their target fields.

Comparisons for date fields

eq

On the specified date

neq

Not on the specified date

gte

On or after the specified date

gt

After the specified date

lte

On or before the specified date

lt

Before the specified date

Comparisons for the Item type field

cont

Include only these types

ncont

Do not include these types

Comparisons for Item sequence field

cont

Contains one of the specified sequence numbers

ncont

Does not contain any of the specified sequence numbers

eq

Equal to the specified sequence number

neq

Not equal to the specified sequence number

gte

Greater than or equal to the specified sequence number

gt

Greater than the specified sequence number

lte

Less than or equal to the specified sequence number

lt

Less than the specified sequence number

Comparisons for other fields

cont

Contains one of the specified values

ncont

Does not contain any of the specified values

eq

Equal to the specified value

neq

Not equal to the specified value

sw

Starts with the specified value

ew

Ends with the specified value

gte

Greater than or equal to the specified  value

gt

Greater than the specified value

guid

Equal to the value of the object GUID

lte

Less than or equal to the specified value

lt

Less than the specified value


Created with the Personal Edition of HelpNDoc: Easily create EPub books