projectdoc Toolbox

Using existing properties from other documents.

Audience
Type
Level of Experience

Deep links allow to reference properties on other documents at request time. But deep links are only available for select clauses and on the right side of where constraints. If you need to take information from the result set into account, there is currently no tool in the projectdoc Toolbox for Confluence to support this use case in queries.

For many use cases this situation could be solved by materializing properties from other documents. Materializing means that there is a property for the document that renders a property from another document. This way there is no longer the need for a deep link on the right side of a where clause.

The tools to accomplish this are Display Document Property Ref Macro, its cousin Display Document Property Ref Concat Macro, and the Parent Property Macro.

Contents

Update

New Feature in 4.5!

 

Since version 4.5 there is support to define materalizers by document property controls, space properties, and doctype metadata.

Materialize by Doctype
Specify which properties to materialize as artificial properties by doctype.
mat
Materialize the controlled property by an artificial property with the given path.
Doctype Descriptor
Describes the doctypes model.

Materialization of Property References

Let's take the example from above where we need to select on the type of an organization a person works for. To materialize the property value from another document, the type of the organization in our example, you need to make it a property of the person document.

Property Reference

Assume that the type is NGO, we could add a property "Works for Organization of Type" and set the string NGO as its value. Better yet, so that changes to the type on the organization document are reflected in the person document, use the Display Document Property Ref Macro.

This way you can use the type of the organization in your queries like this:

$<Works for Organization of Type>=$[Type]

Effectively, the property reference Organization->Type has been materialized in Works for Organization of Type.

Parent Property Reference

There is a special form of a property reference to another document which is the Parent Property Macro. Per default this macro is used for the value of the Parent Property in every doctype provided by smartics. You can take advantage of this property to materialize properties from the parent of this document.

Property Reference with Concat

Concat stands for concatenation and this feature is provided by the Display Document Property Ref Concat Macro. This macro does essentially the same as the Display Document Property Ref Macro but allows to add a text string to the property value. This is useful for properties like phone numbers, where the base phone number is specified in the organization document and you need to append the phone number extension to the phone number stem.

Resources

More information on tools and concepts mentioned in this tip.

Search Tips
Tips on specifying search queries for Lucene. This also applies to projectdoc's query macros.
Display Table Macro
Lists references to projectdoc documents in a table. Allows to select document properties for columns. Also non-list representations are provided.
Display Document Property Ref Macro
Displays a document property from a referenced document.
Display Document Property Ref Concat Macro
Displays a single property of a document that is referred by a property of another document and concatenates it with the value of a local property.
Display Document Properties Macro
Renders a template with property references.
Display Document Property Macro
Renders the value of a property of a document.
Parent Property Macro
Renders the property of the parent document, if it has the same doctype.
Document Type
A document type (doctype) defines the properties and section for document instances. It also provides home and index pages. In Confluence these doctypes are implemented as page blueprints, usually with one template. This template is used to create new pages in Confluence.
projectdoc Document
projectdoc is based on projectdoc documents. Creating a projectdoc document is easy: A projectdoc document is a Confluence page using document properties and sections.