Versions Compared

Key

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

...

Section
titleSelect Clauses in Display Macros

Select a property by specifying the name of the property.

Example Box
titleSelect the value of the Name property

Name


Section
titleDeep Links in Select Clause

Since version 2.0 the projectdoc Toolbox also supports Deep Links as an experimental feature. If the property name references a property whose value is a link, a deep link (specified with "->") allows to traverse the document tree.

Example Box
titleDeep Links

Suppose a document provides a property named "Ref" that is a reference to another document.

To select the short description of the referenced document, use Ref->Short Description.

Deep Links may have deeper depth than 1.

Example Box
titleDeep Links with Depth > 1

Ref->Person->Address->Phone

Note that currently only single valued properties can be used with deep links. If more than one link is found in a property value, only the first will be traversed. See

Jira
serversmartics JIRA
serverId79ad43bc-d289-364e-bfc7-46c09847bebd
keyPDAC-825
.

Macros supporting Deep Links:

  • Display Table Macro
  • Transclude Documents Macro
  • Display List Macro
  • Display List Template Macro
  • Tour Macro
  • Display Table
    doctypemacro
    render-modedefinition
    selectName, Short Description
    space-keysPDAC1
    where$<Tags>=[Deep Link]

    Display Document Properties Macro



    Section
    titleWhere Clauses in Display Macros

    The where clause of display macros allows to add a constraint on the documents to display in the result set.

    Section
    titleProperty Names

    To use property names in Lucene searches, the property names must not contain blanks. So if the search is restricted to user stories with just one story point, use this:

    Code Block
    languagetext
    StoryPoints = "1" 

    Template authors may use the $[...] marker to translate the property name to its normalized form:

    Code Block
    languagetext
    $[Story Points] = "1" 

    This is especially useful if the labels are provided by localized resource bundles. In this case the template author has not to bother, if the name contains spaces or not.


    Section
    titleReference Property Values

    If the result set should contain only documents where one property matches the value of a property of the current document, use the ${...} placeholder to reference the property in the current document.

    Code Block
    languagetext
    $[Story Points] = ${Magic Value}

    For the example, the result set will only contain documents, that have the Story Point property set to a value matching that of the Magic Value property of the document the search is part of.

    Content Marker
    idcurly-braces


    Caution Box
    titleCurly Braces

    Curly braces may cause problems on some instances of Confluence when used in a string parameter field of a macro. This is especially true (and reproducible) if you use an opening and an immediate closing bracket like this: "{}".

    This is a known issue (CONFSERVER-33399) and is also discussed in Do curly braces in string macro parameters break the macro?.

    To work around this problem you may escape the curly braces with a backslash as in

    Code Block
    languagetext
    $[Story Points] = $\{Magic Value\}

    You need to use this workaround if you cannot save the page (as described in the issue above). Otherwise it is just a failed rendering of the macro in the macro editor.



    Section
    titleDeep Links in Where Clause

    Since version 2.0 of the projectdoc Toolbox Deep Links are supported for property references (on the right side) as an experimental features.

    Example Box
    $<Story Points> = [${Master->Ref Story Points}]




    Section
    titleExact Match Queries

    If the result should be an exact match query, use the following pattern:

    Code Block
    languagetext
    $<Story Points> = [Magic Value]

    In case the value is not a constant, you may also use a reference to the property of the document:

    Code Block
    languagetext
    $<Story Points> = [${Magic Value}]


    Note Box

    The syntax $<...> is read as: Please run the preprocessor of projectdoc over the value before it is passed to Lucene.



    Section
    titleEscaping Special Characters

    Since version 1.9 it is possible to escape special characters with a backslash (\).

    Code Block
    languagetext
    $<Name> = [My Name \(with brackets\)]

    To escape the escape character also use the escape character.

    Code Block
    languagetext
    $<Name> = [My Name \\ containing a slash]



    Section
    titleSubtree Queries

    If you need to constrain the search result to documents with a given ancestor, you can take advantage of artificial properties like AncestorNames and AncestorIds.

    Code Block
    languagetext
    $<AncestorNames> = [This Root Page]

    Or you could constrain the search result by the current page.

    Code Block
    languagetext
    $<AncestorIds> = [${Page ID}]


    Tip Box

    See Subtree Queries for examples.



    Section
    titleAncestor Queries

    For some type of properties it is useful to query for a given value or its ancestors. E.g. if you want to have all documents relevant for the Quick Response Team (QRT), a role derived from Ops, you may want to collect all documents marked with either QRT or Ops.

    Code Block
    languagetext
    $<Audience> = ^QRT^

    This is not only a shortcut for not listening all parents. If you add the following to the role template, the document will show all documents relevant for the role:

    Code Block
    languagetext
    $<Audience> = ^${Name}^

    Note that in the above example Audience is a property of a document that refers to documents of type Role. The hierarchy is defines on role documents. It may be confusing for new uses if they assume that the hierarchy is defined on the document containing the the Audience property.

    If you need to search the hierarchy down the tree, use "°" instead of "^". So "°" stands for downstream, "^" for upstream search.

    Caution Box

    Ancestor queries are based on the property information in the blueprint of a document type. Document authors cannot define hierarchies based on document instances. It is the job of template authors to do this.

    If you encounter unexpected results, you may want to refresh your caches, especially the doctype cache. Please refer to Cache Refresh Actions for details.


    Tip Box

    See Ancestor Queries for examples.



    Section
    titleList Queries


    Version Box
    title2.0

    List queries are supported since version 2.0.


    Content Marker
    idList Query Examples

    List queries run an exact match on a property where one of the values in the list has to match.

    Code Block
    $<Name> ~ (One, Two, Three)

    expands to

    Code Block
    $<Name>=[One] OR $<Name>=[Two] OR $<Name>=[Three]

    This is especially useful when a value is provided as a property.

    Code Block
    $<Name> ~ (${Some Names})

    Note that the List of values found in Some Names may have links or be a macro (such as the Name List Macro). Values with a comma are not allowed since the comma is the delimiter of the list elements.



    ...