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

Compare with Current View Page History

Version 1 Next »

projectdoc Toolbox

Control macros in Confluence pages via HTTP request properties.

Audience
Type
Level of Experience
Expected Duration
15 min
 

Changing the contents of a projectdoc document - a Confluence page using projectdoc - dynamically for each request. This feature of the projectdoc Toolbox for Confluence is called Remote Controlled Document.

The configuration of many projectdoc macros on the page can be controlled by providing a HTTP-Query-String to the page URL

Control Query

 

For instance the Display Table Macro is used to display pages according to some filter criteria e.g. a Where or Select parameter analogous to the Page Properties Report Macro. Additionally our macro can be configured at request time adding a HTTP-Query-String to adjust the macro parameters and change the generated document list of macro.

Changing the contents of a page dependent on the reader's request enables context-sensitive rendering of information. This feature of the projectdoc Toolbox for Confluence is called Remote Controlled Document.

The configuration of macros on the page is controllable by request parameters.

Control Query

 

For instance the Where or Select parameter of the Display Table Macro can be adjusted by parameters in the request controlling the document list of the query result.

Control Transclusion

 

Another example is the transclusion of page fragments which can be controlled by altering parameters of the Transclude Documents Macro or the Transclusion Macro.

One use case is allowing to render information from a remote information system on a page. A system may render the documentation for error codes by adding context information about the error to the request URL that points to a page on the Confluence server.

Another use case is to render a page from the context of the calling page. With version 2.3.1, the Wiki Link Macro allows to provide request parameters. This way a reader clicking on a link created by this macro has a view on the rendered page that knows the context of the page the reader is coming from. This tip will show this use case in detail.

Remote Control with Wiki Link Macro

Suppose you have a Library Space that collects all external resources for a selection of work groups. The teams of the work groups may have their individual Workspaces with a Space Index rendering all resources from the library using a Display Table Macro. Alternatively the workspaces could use the Wiki Link Macro to render a link to the resources homepage of the Library Space and control the selection criteria by overriding the Where parameter of the Display Table Macro on that page.

ID for Display Table Macro

To control a macro remotely the macro needs to have an identifier.

For instance add the identifier pd-documents to the Display Table Macro.

Wiki Link Macro

The Wiki Link Macro provides a Request Parameters parameter to configure.

First specify the page to link to. Since we are addressing the homepage for resources on a delegate space, we use the Page parameter to specify the name.

 

We assume that the library space is already configured as a delegate space and the work space has no Resources page.

Next we set the request parameters:

pd-documents:where=$<Tags>=[My Workgroup]

Result

The label is in italic indicating that the (in our case) the resources are on a delegate space.

The URL generated with the Wiki Link Macro looks like this:

.../confluence/display/MYSPACE/Resources?pd-documents:where=%24<Tags>%3D[My+Workgroup]

The resources page of the library for the request launched by clicking the Resources link will only contain resources that are tagged with "My Workgroup".

Conclusion

It depends on your use case whether to have a individual resources pages on each space or reuse a central resource page on a delegate space that is remote controllable.

This tip simply wants to remind you that the projectdoc Toolbox supports Remote Controlled Documents.

  • No labels