DMSQuery XML Format

The DMSQuery format is the XML request format for search queries to the enaio® server. It describes which archives and object types to search, which fields should appear in the result and under what conditions objects should be returned.

The corresponding schema file is DMSQuery.xsd. The result of a DMSQuery request is returned in DMSContent XML format.

1. Usage

The DMSQuery format is used as input by the following jobs:

Job Description

dms.GetResultList

Primary research job — executes the query and returns hits in DMSContent format

dms.GetDeletedObjects

Search in the trash — query in DMSQuery format

dms.AddStoredQuery

Create stored search — stores a DMSQuery on the server

dms.UpdateStoredQuery

Update stored search — replaces an existing DMSQuery

dms.GetStoredQuery

Retrieve stored search — returns the stored DMSQuery

dms.ConvertQuery

Converts a DMSQuery to another query format (or vice versa)

dms.ExecuteStoredQuery

Execute a stored search — internally uses the stored DMSQuery

2. Request Types (requesttype)

The requesttype attribute on the <DMSQuery> element determines the structure of the returned DMSContent:

Value Name Result

LOL

Linear Object List

Tabular hit list (<Rowset> in DMSContent). Standard and most performant option.

HOL

Hierarchical Object List

Hierarchical object list (<ObjectList> in DMSContent) with complete field data, optionally with BaseParams, rights, child and parent objects.

MIX

Mixed

HOL data for the requested object combined with LOL data for parents and children.

DTL

Detail (deprecated)

No longer use — use MIX instead.

3. Quick Start — Common Query Patterns

3.1. Simple Field Search (LOL)

Search all documents of a type where a field has a specific value:

<DMSQuery requesttype="LOL" pagesize="20" offset="0">
  <Archive internal_name="patient">
    <ObjectType type="DOCUMENT" internal_name="medical_letter">
      <Fields>
        <Field internal_name="date"/>
        <Field internal_name="subject"/>
        <Field internal_name="physician"/>
      </Fields>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="medical_letter">
          <FieldCondition internal_name="physician" operator="=">
            <Value>Dr. Müller</Value>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
  </Archive>
</DMSQuery>

3.2. Complete HOL Query with Base Parameters

<DMSQuery requesttype="HOL" baseparams="1" pagesize="10" offset="0">
  <Archive internal_name="patient">
    <ObjectType type="DOCUMENT" internal_name="medical_letter">
      <Fields field_schema="ALL"/>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="medical_letter">
          <FieldCondition internal_name="date" operator="BETWEEN">
            <Value>2024-01-01</Value>
            <Value>2024-12-31</Value>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
  </Archive>
</DMSQuery>

4. XML Structure (Overview)

<DMSQuery requesttype="LOL|HOL|MIX"
          pagesize="20" offset="0" maxhits="-1"
          baseparams="0" variants="0" rights="0"
          combined="0" sql="0" icons="0"
          disablesearchgroups="1" narrowsearch="0"
          status="0" fileinfo="0" object_inserts="0"
          registercontext="0" outputformat="0">

  <!-- Optional parameter definitions for parametrized queries -->
  <Params>
    <Param name="myParam"><Value>Search term</Value></Params>
  </Params>

  <!-- One or more archives -->
  <Archive internal_name="archive1">

    <!-- Object type query -->
    <ObjectType type="DOCUMENT" internal_name="invoice" alias="Invoice">
      <Fields field_schema="DEF">
        <Field internal_name="date" sortpos="1" sortorder="DESC"/>
        <Field internal_name="amount"/>
      </Fields>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="invoice">
          <FieldCondition internal_name="status" operator="=" bool_op="AND">
            <Value>approved</Value>
          </FieldCondition>
          <FieldCondition internal_name="amount" operator=">=" bool_op="AND">
            <Value>1000</Value>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
      <!-- HOL: Request child objects -->
      <ChildObjects child_schema="DEF" export_depth="1">
        <ChildObjectType type="REGISTER" internal_name="invoice_items">
          <Fields field_schema="ALL"/>
        </ChildObjectType>
      </ChildObjects>
      <!-- HOL: Request path to parent objects -->
      <ParentObjects parent_schema="DEF">
        <SubObjectType type="FOLDER" internal_name="company"/>
      </ParentObjects>
      <!-- Linked objects from another archive -->
      <ExternalObjects>
        <ExternalArchive internal_name="contacts">
          <ExternalObjectType internal_name="contact_person">
            <Fields field_schema="MIN"/>
          </ExternalObjectType>
        </ExternalArchive>
      </ExternalObjects>
    </ObjectType>

    <!-- Search by base parameters (folders) -->
    <FolderBaseParams>
      <Creator><Value>admin</Value></Creator>
      <Created><From>2024-01-01</From><To>2024-12-31</To></Created>
    </FolderBaseParams>

    <!-- Full-text search -->
    <FulltextQuery>
      <Fulltext MODE="PATTERN">
        <Value>Discharge letter</Value>
      </Fulltext>
    </FulltextQuery>

  </Archive>
</DMSQuery>

5. Elements and Attributes

5.1. <DMSQuery> (root element)

5.1.1. Result Control

Attribute Type Default Description

requesttype

requesttypes

LOL

Request type: LOL, HOL, MIX or DTL (deprecated)

pagesize

xs:long

0

Maximum number of hits per response (0 = all)

offset

xs:long

0

0-based start index for pagination

maxhits

xs:long

-1

Absolute hit limit (-1 = no limit)

baseparams

xs:short

0

1 = return base parameters (creator, date, archiving status etc.)

variants

xs:short

0

1 = return document variant information (HOL only)

combined

xs:short

0

1 = return information about combined documents (HOL only)

rights

xs:short

0

1 = return access rights per object instance

fileinfo

xs:short

0

1 = return file information (MIME type, size, page count)

object_inserts

xs:short

0

1 = return allowed child object types and counts

icons

xs:short

0

1 = return icon ID per object

sql

xs:short

0

1 = write executed SQL statement in result document (LOL only)

5.1.2. Search Behavior

Attribute Type Default Description

disablesearchgroups

xs:short

1

1 = disable search groups; 0 = apply user search groups

narrowsearch

xs:short

0

0 (broad) = for register clauses, objects directly below folder level are also returned.
1 (narrow) = only objects in explicitly specified registers.

registercontext

xs:short

0

0 = register clauses are ignored in HOL; only objects in registers are requested

status

xs:short

0

Status filter for objects (reserved)

outputformat

xs:short

Numeric output format code (supplementary to requesttype)

5.2. <Params> / <Param>

Optional parameter definitions for parametrized queries. Parameters allow storing a DMSQuery template and filling it with values at runtime (e.g. for stored searches via dms.ExecuteStoredQuery).

The name attribute on <Param> is not formally defined in the XSD, but required in practice, as <FieldCondition> refers to it via <ParamValue ref="name">.

Each <Param> contains exactly one of the following value types:

Child element Meaning

<Value>Value</Value>

Fixed standard value

<NULL/>

Parameter is empty (NULL)

<LinkedValue ref="link_name"/>

Value is taken from the field with the specified link_name at runtime

<DMSQuery requesttype="LOL">
  <Params>
    <Param name="doctor"><Value>Dr. Müller</Value></Param>
    <Param name="dateFrom"><Value>2024-01-01</Value></Param>
    <Param name="dateTo"><Value>2024-12-31</Value></Param>
  </Params>
  <Archive internal_name="patient">
    <ObjectType type="DOCUMENT" internal_name="medical_letter">
      <Fields><Field internal_name="subject"/></Fields>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="medical_letter">
          <FieldCondition internal_name="physician" operator="=">
            <ParamValue ref="doctor"/>
          </FieldCondition>
          <FieldCondition internal_name="date" operator="BETWEEN">
            <ParamValue ref="dateFrom"/>
            <ParamValue ref="dateTo"/>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
  </Archive>
</DMSQuery>

5.3. <Archive>

Defines the archive to be searched. At least one of the attributes id, name, internal_name or osguid must be specified. Multiple <Archive> elements are allowed (cross-archive search).

internal_name is only required for cross-archive queries (multiple <Archive> elements) — assuming the contained <ObjectType> elements also use internal_name. For single-archive queries, the attribute can be omitted.
Attribute Type Default Description

id

xs:long

0

Numeric archive ID

name

xs:string

Display name

internal_name

xs:string

Internal name (recommended)

osguid

xs:string

GUID

Child elements (any combination, multiple allowed):

  • <ObjectType> — typed object search

  • <FolderBaseParams> — folder search by base parameters

  • <RegisterBaseParams> — register search by base parameters

  • <DocumentBaseParams> — document search by base parameters

  • <FulltextQuery> — full-text search

5.4. <ObjectType>

Defines the searched object type and the desired output fields and search conditions.

Attribute Type Default Description

type

objecttypes

FOLDER, REGISTER or DOCUMENT (recommended for disambiguation with same names)

id

xs:long

0

Numeric ID of the object type

name

xs:string

Display name

internal_name

xs:string

Internal name (recommended)

osguid

xs:string

GUID

table

xs:string

Database table name

alias

xs:string

Alias name that appears in hit list (faster access for multiple object types)

Child elements:

Element Purpose

<Fields> (optional)

Which fields should appear in the result

<Conditions> (optional)

Filter conditions — which objects should be returned

<ChildObjects> (optional, HOL only)

Child objects that should be returned hierarchically

<ParentObjects> (optional, HOL only)

Parent path (folders/register) that should be returned

<ExternalObjects> (optional)

Linked objects from other archives

5.5. <Fields> / <Field>

<Fields> lists the fields that should appear in the result.

Attribute on <Fields> Type Default Description

field_schema

field_schema

DEF

Predefined selection of fields to return (overridable by individual <Field> elements)

The field_schema attribute on <Fields> controls which fields are defaultly included — individual <Field> elements supplement or override this selection.

Attribute on <Field> Type Default Description

name

xs:string

Display name of the field

internal_name

xs:string

Internal name (recommended)

dbname

xs:string

Database column name

osguid

xs:string

GUID

system

xs:short

0

1 = system field (e.g. OBJECT_ID, folder_id)

sortpos

xs:long

0

Sorting position in the result (0 = no sorting, 1 = primary sort field, …)

sortorder

xs:string

Sorting direction: ASC (ascending) or DESC (descending)

link_name

xs:string

Alias name for the field value — enables use as condition value in <ExternalObjectType> via <LinkedValue ref="link_name">

System fields for position information (only in relation tables): folder_id, register_id, register_type.

5.6. <Conditions> / <ConditionObject>

<Conditions> contains either a list of <ConditionObject> elements or a list of <ObjectID> elements (direct retrieval by ID).

5.6.1. Variant 1 — Field-based Conditions (<ConditionObject>)

Each <ConditionObject> carries the same identification attributes as <ObjectType> and contains any number of condition elements:

Multiple <ConditionObject> elements are connected with AND.

5.6.2. Variant 2 — Direct Retrieval by ID (<ObjectID>)

<Conditions>
  <ObjectID>9823</ObjectID>
  <ObjectID>9824</ObjectID>
</Conditions>

5.7. <FieldCondition>

The central condition for an index field.

Attribute Type Default Description

internal_name

xs:string

Internal field name (recommended)

dbname

xs:string

Database column name

name

xs:string

Display name

system

xs:short

0

1 = system field

operator

ComparisonOperators

=

Comparison operator

bool_op

BooleanOperators

AND

Connection with the previous condition: AND or OR

As a child element (condition value), exactly one of the following types must be specified — for BETWEEN, IN and NOT IN, two or more <Value> elements are required:

Child element Meaning

<Value>text</Value>

Literal comparison value

<Value special="1">#USER#</Value>

Placeholder value (see Placeholders)

<ParamValue ref="paramname"/>

Reference to a declared <Param> parameter

<LinkedValue ref="link_name"/>

Reference to the field value of a field in the main object (for <ExternalObjectType>)

<NULL/>

Check for NULL (no value)

<SpecialValue>text</SpecialValue>

Internal special value

<!-- Equality -->
<FieldCondition internal_name="status" operator="="><Value>approved</Value></FieldCondition>

<!-- Date range -->
<FieldCondition internal_name="date" operator="BETWEEN">
  <Value>2024-01-01</Value>
  <Value>2024-12-31</Value>
</FieldCondition>

<!-- List of values -->
<FieldCondition internal_name="category" operator="IN">
  <Value>A</Value>
  <Value>B</Value>
  <Value>C</Value>
</FieldCondition>

<!-- NULL check -->
<FieldCondition internal_name="archived_by" operator="="><NULL/></FieldCondition>

<!-- Current logged-in user -->
<FieldCondition internal_name="owner" operator="=">
  <Value special="1">#USER#</Value>
</FieldCondition>

<!-- OR connection with previous condition -->
<FieldCondition internal_name="type" operator="=" bool_op="OR"><Value>letter</Value></FieldCondition>

5.8. <FieldGroup>

Groups multiple conditions into a logical unit. Enables nested AND/OR expressions.

Attribute Type Required Description

operator

BooleanOperators

Yes

AND or OR — connects all elements within the group

Child elements: <FieldCondition>, <TableCondition>, date conditions, <FieldGroup> (recursive).

<!-- (status = "open" OR status = "pending") AND amount >= 500 -->
<ConditionObject type="DOCUMENT" internal_name="invoice">
  <FieldGroup operator="OR">
    <FieldCondition internal_name="status" operator="="><Value>open</Value></FieldCondition>
    <FieldCondition internal_name="status" operator="="><Value>pending</Value></FieldCondition>
  </FieldGroup>
  <FieldCondition internal_name="amount" operator=">=" bool_op="AND">
    <Value>500</Value>
  </FieldCondition>
</ConditionObject>

5.9. <TableCondition>

Condition for a table field (Grid control). Each <TableColumn> corresponds to a column of the table field and carries the same attributes and child elements as <FieldCondition>.

Attribute Type Default Description

name / internal_name / dbname

xs:string

Identification of the table field

row

xs:long

0

Row number (0 = any row)

<!-- Search for invoices that contain a position with amount > 1000 -->
<TableCondition internal_name="positions">
  <TableColumn internal_name="pos_amount" operator=">">
    <Value>1000</Value>
  </TableColumn>
</TableCondition>

5.10. <ChildObjects>

Only for HOL queries. Defines which child objects should be returned hierarchically.

Attribute Type Default Description

child_schema

object_schema

DEF

DEF = only explicitly listed types; ALL = all object types of the archive

export_depth

xs:short

0

Depth of hierarchy (0 = one level, 1 = two levels, …)

field_schema

field_schema

Standard field selection for all children

Child elements: <ChildObjectType> (one element per requested child type) or <SubObjectType>.

<ChildObjectType> carries the same identification attributes as <ObjectType> plus: - alias — alias name for the hit list - <Fields> — desired fields - <SubConditions> — additional filter conditions for child objects (HOL only) - <ExternalObjects> — linked foreign archive objects of children

5.11. <ParentObjects>

Only for HOL queries. Returns the path to parent objects (folders, registers).

Attribute Type Default Description

parent_schema

object_schema

DEF

Which parent types should be returned

field_schema

field_schema

Standard field selection for parent objects

Child elements: - <ParentObjectType>+ — explicit parent types - <SubObjectType> — the target object in the path

5.12. <ExternalObjects>

Linked objects from other archives — enables cross-archive joins. Each <ExternalArchive> identifies a foreign archive (via archive_ident attributes) and optionally contains an <ExternalObjectType> element that defines the foreign object type and its fields/conditions.

Field values of the main object can be used as condition values:

  1. In the main object, set the <Field> element with link_name="myAlias".

  2. In the <ExternalObjectType>, formulate the condition with <LinkedValue ref="myAlias"/>.

<ObjectType type="DOCUMENT" internal_name="invoice">
  <Fields>
    <Field internal_name="customer_id" link_name="cust_ref"/>
  </Fields>
  <ExternalObjects>
    <ExternalArchive internal_name="contacts">
      <ExternalObjectType internal_name="company">
        <Fields>
          <Field internal_name="company_name"/>
        </Fields>
        <SubConditions>
          <FieldCondition internal_name="id" operator="=">
            <LinkedValue ref="cust_ref"/>
          </FieldCondition>
        </SubConditions>
      </ExternalObjectType>
    </ExternalArchive>
  </ExternalObjects>
</ObjectType>

Search by base parameters (metadata) allows filtering without knowing the index fields.

5.13.1. <FolderBaseParams> / <RegisterBaseParams>

Search for folders or registers by metadata. Contains the child elements:

Element Description

<Creator><Value>name</Value></Creator>

Created by (up to 2 values; implicitly OR-connected)

<Created><From>date</From><To>date</To></Created>

Creation date range

<Modifier><Value>name</Value>…</Modifier>

Last modified by

<Modified><From>date</From><To>date</To></Modified>

Modification date range

<Owner operator="=" bool_op="OR"><Value>name</Value>…</Owner>

Owner (always OR-connected)

<ChildObjects>…</ChildObjects>

Request child objects of found parent objects (HOL)

5.13.2. <DocumentBaseParams>

Like <FolderBaseParams>, additionally:

Element Description

<ArchiveState><ArchiveStateValue>ARCHIVED</ArchiveStateValue></ArchiveState>

Filter by archiving status (one or more values; implicitly OR)

<Locked><LockStateValue>UNLOCKED</LockStateValue></Locked>

Filter by checkout status

5.14. <FulltextQuery>

Full-text search over all documents of the archive.

<FulltextQuery>
  <Fulltext MODE="PATTERN">
    <Value>discharge* AND Müller</Value>
  </Fulltext>
</FulltextQuery>

Optional control attributes (for the RetrievalWare full-text engine):

Attribute Type Default Description

MODE

FullTextSearchModeType

PATTERN

Search mode

EXPANSION_LEVEL_PROPERTY

xs:short

4

Expansion level for synonyms

FUZZY_SPELL_HALF_WORDS

xs:boolean

false

Fuzzy search for half words

FUZZY_SPELL_THRESHOLD

xs:short

0

Threshold for fuzzy spell correction

MAX_FUZZY_SPELL_PROPERTY

xs:short

15

Maximum fuzzy alternatives

MAX_REG_EXPR_PROPERTY

xs:short

4

Maximum regex expansions

WORD_EXPANSION_LIMIT_PROPERTY

xs:short

20

Limit for word expansions

6. Enumeration Types

6.1. requesttypes

Value Result Format Description

LOL

DMSContent <Rowset>

Linear Object List — tabular format

HOL

DMSContent <ObjectList>

Hierarchical Object List — complete object data

MIX

DMSContent <ObjectList>

Mixed — HOL data + optional LOL data for parents/children

DTL

Deprecated — use MIX instead

6.2. field_schema

Value Description

DEF

Standard fields according to object type configuration

ALL

All fields of the object type

ALLREL

All fields including relational (linked) fields

MIN

Minimal field set (only ID and required fields)

6.3. object_schema

Value Description

DEF

Only explicitly listed types

ALL

All object types of the archive

REGISTER

Only register types

DOCUMENTS

Only document types

6.4. objecttypes

Value Meaning

FOLDER

Folder

REGISTER

Register

DOCUMENT

Document

6.5. ComparisonOperators

Operator Meaning

=

Equal

<> / !=

Not equal

<

Less than

<=

Less than or equal

>

Greater than

>=

Greater than or equal

IN

Value is in a list — specify multiple <Value> elements

NOT IN

Value is not in a list

BETWEEN

Value lies between two limits — specify exactly two <Value> elements

NOT BETWEEN

Value does not lie between two limits

6.6. BooleanOperators

Value Meaning

AND

Connection with AND (default)

OR

Connection with OR

6.7. FullTextSearchModeType

Value Meaning

PATTERN

Pattern recognition with wildcards (*, ?)

BOOLEAN

Boolean expressions (AND, OR, NOT)

CONCEPT

Conceptual search (semantic similarity)

6.8. Placeholders (special="1")

Special values are used in <Value special="1"> and resolved by the server at runtime:

Placeholder Resolved Value

USER

Login name of the current user

OWNER

Owner of the current user

DATE

Current date

CREATOR

Creator (login name)

CREATION_DATE

Creation date

ARCHIVIST

Archivist (login name)

ARCHIVE_DATE

Archiving date

COMPUTER_NAME

Client computer name

COMPUTER_IP

Client IP address

COMPUTER_GUID

Client GUID

7. Complete Examples

7.1. Multi-level Search with FieldGroup (OR/AND Combination)

Search for documents that are (open OR pending) AND amount ≥ 500:

<DMSQuery requesttype="LOL" pagesize="50" offset="0" baseparams="0">
  <Archive internal_name="accounting">
    <ObjectType type="DOCUMENT" internal_name="invoice">
      <Fields>
        <Field internal_name="invoice_number" sortpos="1" sortorder="DESC"/>
        <Field internal_name="date"/>
        <Field internal_name="status"/>
        <Field internal_name="amount"/>
      </Fields>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="invoice">
          <FieldGroup operator="OR">
            <FieldCondition internal_name="status" operator="=">
              <Value>open</Value>
            </FieldCondition>
            <FieldCondition internal_name="status" operator="=">
              <Value>pending</Value>
            </FieldCondition>
          </FieldGroup>
          <FieldCondition internal_name="amount" operator=">=" bool_op="AND">
            <Value>500</Value>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
  </Archive>
</DMSQuery>

7.2. HOL Query with BaseParams and Rights

All documents of the current user from 2024, with base parameters and rights:

<DMSQuery requesttype="HOL" baseparams="1" rights="1" pagesize="20" offset="0">
  <Archive internal_name="patient">
    <ObjectType type="DOCUMENT" internal_name="medical_letter">
      <Fields field_schema="ALL"/>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="medical_letter">
          <FieldCondition internal_name="date" operator="BETWEEN">
            <Value>2024-01-01</Value>
            <Value>2024-12-31</Value>
          </FieldCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
    <DocumentBaseParams>
      <Owner operator="=">
        <Value special="1">#USER#</Value>
      </Owner>
      <ArchiveState>
        <ArchiveStateValue>ARCHIVED</ArchiveStateValue>
        <ArchiveStateValue>ARCHIVABLE</ArchiveStateValue>
      </ArchiveState>
    </DocumentBaseParams>
  </Archive>
</DMSQuery>

7.3. Search by Table Field

Invoices with a position over 1000 €, sorted by invoice number:

<DMSQuery requesttype="LOL" pagesize="20" offset="0">
  <Archive internal_name="accounting">
    <ObjectType type="DOCUMENT" internal_name="invoice">
      <Fields>
        <Field internal_name="invoice_number" sortpos="1" sortorder="ASC"/>
        <Field internal_name="date"/>
      </Fields>
      <Conditions>
        <ConditionObject type="DOCUMENT" internal_name="invoice">
          <TableCondition internal_name="positions">
            <TableColumn internal_name="pos_amount" operator=">">
              <Value>1000</Value>
            </TableColumn>
          </TableCondition>
        </ConditionObject>
      </Conditions>
    </ObjectType>
  </Archive>
</DMSQuery>

7.4. Full-text Search with Child Objects (HOL)

Full-text search in the archive and hierarchical return with sub-registers:

<DMSQuery requesttype="HOL" baseparams="0" pagesize="10" offset="0">
  <Archive internal_name="patient">
    <FulltextQuery>
      <ChildObjects child_schema="DEF">
        <ChildObjectType type="DOCUMENT" internal_name="medical_letter">
          <Fields field_schema="DEF"/>
        </ChildObjectType>
      </ChildObjects>
      <Fulltext MODE="PATTERN">
        <Value>discharge letter*</Value>
      </Fulltext>
    </FulltextQuery>
  </Archive>
</DMSQuery>