Versions Compared

Key

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

...

Section
titleTagging a Document

A Confluence wiki page becomes a projectdoc Document by adding the Document Properties Marker Macro. The macro expects a table with three columns to specify document properties. A Name or a Short Description is a property, but also Tags and Type. Authors may specify any property in this table since a property is simply a name (stored in the first column of the table), a value (stored in the second column), and an optional control (which goes into the third column, e.g. hide to not show the table row when rendered in the view).

Document Properties Marker Macro with some properties.

As you can see the value for a property may be a simple text string, but may also be an image (not shown in this example). , or a macro.


Section
titleReporting on Documents

Reports may have many forms. In this short tip we'll focus on the Display Table Macro. It allows to list a number of projectdoc documents (aka Confluence pages with our Document Properties Marker Macro) that match the given query constraint. The list is rendered in form of a table: each document of the result is rendered in a table row, each property of the document, in a table column.

Note Box

The rendering may also be in other formats, but we'll keep it simple here. It is recommended to use this macro for tables and the Display List Macro or its cousin Display List Template Macro for lists. These macros may render trees of results, while the Display Table Macro renders the result list always flat.

The Display Table Macro has a couple of parameters, but for this short example we focus on two of them:

  1. Select: Enumerate the properties you actually want to render in the columns – if not specified the Name and Short Description is rendered per default
  2. Where: Specify the query constraint

Display Table Macro in the Macro Editor

Note that the name of a property you use as constraint must not contains spaces. Hence we type "LevelofExperience", which is not easy to read.

We therefore recommend to use property name delimiters so that projectdoc will do the translation for you.

Again the Display Table Macro in the Macro Editor, this time with encoded properties in the Where constraint

One could argue that this is not really easier to read:

Code Block
languagetext
$<Type>=[Tip] AND $<Level of Experience>=[Novice]

But it comes with an additional feature! By using the square brackets on the side of the expected value you can make an exact match. While in the before mentioned query you may also find document with types having the string "Tip" in it, the second version only allows types that match this three letter word (T i p) and nothing else.

Tip Box

And to put more sugar on the ugly special syntax: you can use the property value of your current document as in 

Code Block
languagetext
$<Type>=[${Type}] AND $<Level of Experience>=[Novice]

Note that we match type with an exact match to the same type our document is type of.

One important caveat: In case your document may have multiple values for a property (for instance for Tags), you would need to use the list constraint like this:

Code Block
languagetext
$<Tags>~(${Tags})

For more information on constructing constraints, please refer to Search Tips!


...