Configuration

<< Click to Display Table of Contents >>

 

Configuration

The configuration window of a Query Application Hierarchy object, shown on the next figure, allows editing, checking, and viewing the result of a query.

XQuery Editor window

XQuery Editor window

The available options on this window are described on the next table.

Available options on the XQuery Editor window

Option

Description

Context object

Object used as the root object of a query. Click Select object to open AppBrowser and select any object. This option corresponds to the DefaultObjectPath property of the Query Application Hierarchy object

Check

Checks whether the syntax of the script in the XQuery query option is correct. The result of this check is displayed in the Result option. This option corresponds to the VerifyXQuery method of the Query Application Hierarchy object

Run

Executes the script in the XQuery query option and displays the result of this execution in the Result option. This option corresponds to the RunXQuery method of the Query Application Hierarchy object

XQuery query

Script used in this Query. This option corresponds to the Script property of the Query Application Hierarchy object

Result

Shows the result of checking or executing a Query

 

The XQuery language used in a Query Application Hierarchy has the following specificity:

Literal Strings are only allowed with double quotation marks (")

Comments must use the VBScript pattern, with a single straight quotation mark (')

The underline (_) character allows continuing code on the next line

The root object, indicated in the DefaultObjectPath property, starts as the current context object (@me) and the first @foreach command traverses the child objects of this context object

The @with command allows executing child commands on a new context object, allowing to access internal collections of these objects

The argument of a @with command is an expression that must return an object

Use the @with command with a question mark (?) character at the end of the line to indicate that the evaluated expression is optional and must not generate an error, such as when accessing an existing collection which may be empty at the time of the query

 

NOTES

For more information about the specification of the XQuery language, please check the XQuery Language Reference.

A Query Application Hierarchy can also be executed using the XQuery method of the E3Globals module.

 

Usage Examples of a Query Application Hierarchy

To query child objects of the Data folder from the server of Elipse E3's demonstration application, use the next code.

<{Name}>
  @foreach
    <{TypeName(Me)} Name>
    @recurse

 

The result of that query is similar to the next code.

<Data>
  <DemoTag Name='DateTime' />
  <InternalTag Name='EnableAlarmingMode' />
</Data>

 

To access all Links of the Menu Screen from Elipse E3's demonstration application, use the next code.

<root>
  @foreach
    @var Object = {Me.PathName}
    @with Me.Links
      @foreach
        <Link Object Property Source>
    @recurse

 

The result of that query is similar to the next code.

<root>
  <Link Object='AppScreens.Root.Menu.hpLyraMenu1.Monitor' Property='Visible' Source='False' />
  <Link Object='AppScreens.Root.Menu.hpLyraMenu1.StartRunning' Property='Visible' Source='False' />
</root>

Was this page useful?