OpenWGA 7.6 - Query languages reference

hdbmodel

hdbmodel:relationtargets:<relationname>

This query retrieves all possible relation targets for the given relation. The WebTML context under which the query is executed should either be a document of the class, for which the document is defined, or a parent document from which the creation of this document class is valid (which makes option "contentclass" mandatory, see below).

It is the same query which is used to automatically retrieve options for <tml:input>s that should store a HDBModel relation. Also it is the same query type that is executed via TMLScript method HDBModel.getRelationTargets().

You can execute the query without body to simply retrieve the documents. For example for a relation named "targetbuild":

<tml:query type="hdbmodel:relationtargets:targetbuild"/>

You can also extend the query by some HQL part in the body of the <tml:query> tag, for example if you wish to retrieve target contents with a certain title beginning:

<tml:param name="term"><tml:urlparameter name="term" encode="html"/>%</tml:param>

<tml:query type="hdbmodel:relationtargets:targetbuild">content.title like :term</tml:query>

As you see HDBModel queries may also retrieve query parameters just like HQL queries do. The default parameters of HQL queries are also available.

It is also allowed to let the query include an "order by" clause, which defines an output order (overriding eventual orderings defined in the model) just like in query type "hql".

Relation target queries may be parametrized using the following native query options, to be used in <tml:query> attribute options:

Option Purpose
contentclass:contentclass If the document in WebTML context is not the content for which the relation is defined then you need to specify the content class of this content by this query option.
currenttarget:true|false By default this query type will always return the document which is currently targeted by the relation on the content document in context. If that is not desired you can switch it off by setting this query option to false.