You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

projectdoc Toolbox

Shows how to import properties from other documents to use them for transclusion.

Iteration
Filled
Type
Level of Experience

Description

This short tip shows how properties from other documents can be used to transclude text with placeholders. Other documents will provide default values that may be overridden by the transcluding document.

The Use Case

Imagine there is a document type Configuration to define configurations for systems. A configuration document defines configuration options for a set of systems.

A second doctype defines Systems. Theses systems provide properties that import their default values from a particular configuration document and may override properties selectively.

Configuration Doctype

For simplicity the Configuration doctype defines two properties and a text with variables, we call placeholders.

There is a text with placeholders referencing the values from these properties.

Note that this section is hidden.

To actually render the section where the two placeholders are replaced with actual property values, a transclusion is required.

The following parameters of the Transclusion Macro are set.

First reference the current document by the @self reference (this is especially important for template authors).

Second it is also important to define the section to transclude (otherwise there will be a recursion detected with an error box).

Last but not least you need to check the box for Apply Document Properties to actually use the document's properties for the placeholders.

So this is essentially the document as seen by the document authors.

Note that the box around the contents of the Description section is only visible to users of Confluence with write access to the document. It is a marker to remind authors that the content is transcluded. Also note that you may hide the properties since the information is presented in the Description section.

System Doctype

The System doctype now needs to override the Port property with a specific value (81), but will use the default memory from the configuration.

There are two way to import the values from the Web Server Configuration. Either by Delegate Document or by the use of Display Document Property macros (e.g. Display Document Property Ref Macro).

Delegate Document

With a delegate document you import properties and sections selectively. First use the Document Properties Marker Macro to define the delegate document.

Specify the properties you need to import with the delegate control.

Then translude the section Configuration Description with the placeholders from the Web Server Configuration:



  • No labels