Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleQueries

Queries define their constraints with the Where parameter, for instance with the Display Table Macro.

For the following examples the Where parameter consists only of a single predicate for simplicity.

Section
titleDeep Links on the querying Document's Side

 Here are two examples of deep links on the right side of a predicate (or right-side deep links for short)

The first constraint selects on all documents whose Type property is equal to this document's referenced Service's Type. We expect the value of the Type properties to be single values. Also the Service property is expected to contain no or only one reference to a service document.

Code Block
$<Type>=[${Service->Type}]

Here is a similar constraint, but this time the property may contain multiple services.

Code Block
$<Type>~(${Services->Type})

In this case the type must match at least one Type value of the referenced services.

Note
titleMatch List Values with List Operator

In case of multiple values only the list operator (~) will return the desired result.

Code Block
languagetext
titleprojectdoc Syntax (probably) not used correctly
$<Type>=[${Services->Type}]

Will check for an exact match with the whole list of values. Since the indexer stores each of the list elements individually, the exact match on the list will never be a match.

For instance the Services has the references Service A with a Type value of A and Service B with a Type value of B, then the predicate above will be resolved to

Code Block
languagetext
titlePseudo Syntax
Type="A, B"

So documents in the result set would require the value A, B as single type value (not the type A and/or B).

In case you actually want to treat a value containing one or more commas as a single value, use the is-single-value control.



Section
titleDeep Links on the matching Document's Side

Deep links on the left side (or left-side deep links) of a predicate reference the matching document.

The following predicate selects on documents who have a Type whose Tags match those of the current document.

Code Block
$<Type->Tags>~(${Tags})

Again a similar constraint using lists and therefore using the list operator.

Code Block
$<Categories->Tags>~(${Tags})


Caution Box
titleMaterialization required!

For these queries to work, the properties on the left side (Type->Tags respectively Categories->Tags) are required to be materialized.

For maximum compatibility make sure that in case of list values, the rendering of those value lists is normalized. It is recommended that values are separated by comma.

Materialization has three forms:

Tour
header-translationsName=Materialization, Short Description=Description
replace-title-with-nametrue



Adding a document property control is typically straight forward. Usually the mat control is provided in a template. If you place it in a document instance, then only the property of this instance is materialized.

Specifying the materialization as a space property automatically materializes the property for the referenced doctype. This only takes effect on document instances that are saved after this space property has been specified. All existing documents need to be reindexed.

The last option is simply a way to move the materialization directive from the document control to the doctype descriptor. If a user removes the mat control from a document, the property is no longer materialized for this particular document instance. The problem is that a type specific information is stored with every single instance of that type. While using the doctype descriptor to define materializations is a proper approach, teams deciding to not use doctype descriptors should use the other two approaches. Using space properties is probably easier for teams using doctypes defined by third parties. It is also less error prone to deletion of controls on document instances. But this is a problem inherent to all Confluence pages since there is no connection between the blueprint and the document after the creation process. Having the control in a template is probably more declarative and easier for teams using their templates in different Confluence environments.


Section
titleDeep Links on both Sides

Left- and rightside deep links can be combined in queries.

Code Block
$<Categories->Tags>~(${Categories->Tags})

But remember to materialize the deep link for the left side queries.


...