Dynamically-built Confluence page built based on parameters passed from other system?
Asked by MD:

Hi folks,

I'm working on documentation for a system where users will be working on

- a particular task

- within a particular domain

- with a specific version of one or more rules they need to follow (that cannot be automated -- so the user needs to refer to them in the correct version)

So what I'm wanting to do is create a bunch of excerpts or pages in Confluence, then pass the

- task

- domain

- version

to Confluence, have Confluence build the page of doc that the user needs on the fly, and serve it up.

Is this possible? I've seen Scroll Versions and that gets us part of the way there, but I don't see a way to use Scroll Versions with passed parameters.

Thanks for any guidance you can provide!

MD


Answers:
author: EPS Software Engineering AG
body: Hi [@MD](/t5/user/viewprofilepage/user-id/141096)

As I understand your requirements, you could use our Page Tree Creator and use the REST interface to create the page tree with all documents and tasks for the employees.

Our support team will be happy to help you with the details. You can find the [Page Tree Creator](https://marketplace.atlassian.com/apps/1214062/page-tree-creator-blueprint-creator?hosting=server&tab=overview) at the Marketplace.

Regards,  
Stephan (CEO of EPS Software Engineering AG, the vendor of the Page Tree Creator)


author: Robert Reiner _smartics_
body: I do not know if your use case can be solved with tools provided by Confluence.

If not, then there is a feature called *Remote Control* in our [projectdoc Toolbox](https://marketplace.atlassian.com/1212629), a commercial add-on for Confluence Server. I am a developer of this add-on so my view is certainly biased. :)

Remote Control allows you to control the rendering of a page configured via macro parameters by overriding these macro parameters with HTTP request parameters.

Example: You have a page that defines [transclusions](https://www.smartics.eu/confluence/x/1YXSAw)/excerpts, [dynamic lists](https://www.smartics.eu/confluence/x/5YXSAw) (queries on pages), and [links](https://www.smartics.eu/confluence/x/xQNk) with macros of the projectdoc Toolbox. What is actually rendered on this page is dependent on the values of these macros' parameters. There is a "Where" parameter that specifies a query on content to be transcluded, another "Where" parameter of another macro controls the rendering of references to related documents. With request parameters you can override these macro parameters. The request parameter references the macro by ID (such as "references") and the parameter of the macro by name (such as "Where").

Our use case for Remote Control is "Error code information": A page on Confluence is passed the error code, a user role, some tags to grab further references, and the use case from within an application. Confluence renders a page based on this information. But I assume to provide such a platform with modular information that can be seamlessly composed will still be quite tricky.

In our 'daily' work we use this feature to control the columns and result set of a document query. For instance: A page has a table with 6 columns. For some reasons we want to show only two of them and remove all references to documents that have been marked as "Deprecated".

In case this seems to be a possible approach for a solution to your use case, there is **a short tip [Remote Control](https://www.smartics.eu/confluence/x/6YIbBQ) that has some screenshots that may be helpful**. There you'll find an example of how a request URL would look like.

The drawback of this approach is this: You need to add a properties macro (used for query matches similar to Page Properties) and section macros (content to be transcluded, similar to Excerpts) to your pages (we call this [projectdoc Documents](https://www.smartics.eu/confluence/x/rgDG)). If you start from scratch this is probably no problem. In case you already have a large number of Confluence pages, altering them may not be feasible.


author: James Dellow
body: There are likely a couple of ways of doing this using a combination of standard macros, like the Include Page Macro, page naming conventions, and a custom User Macro to dynamically set the macro parameters to retrieve the appropriate task, domain, and version pages.

How were intending to pass the task, domain, and version parameters - will the user select them or click link from elsewhere with the values pre-populated?

How many different versions of the task, domain, and version pages will there be?

comments: author: MD
body: Hi James --

Thanks for the response!

The task, domain, and version parameters are known in the context of the system being used, and will be passed by the system when it calls Confluence (in whatever way they need to be passed to make it work).

There are a few dozen tasks, lots and lots of domains, and versions will keep being made indefinitely. So any solution that relies on making a bunch of Confluence pages with all the potential iterations will likely not be scalable enough to meet our needs.

Would love to hear your ideas in more detail if you are able to share them! Thanks!


author: James Dellow
body: I think the simplest approach is that you would need each parameter passed to match exactly a corresponding page name. However, I'm not sure about the security implications of parsing the query value, so that is something else you would need to check.


author: JP _AC Bielefeld Leader_
body: HI,

you might want to contact the K15t support (Scroll Versions) directly. I'm sure they will we happy to support you.

<https://www.k15t.com/company/contact>

Best

JP

comments: author: MD
body: Thanks JP -- I will. I am pretty sure Scroll Versions on its own won't solve my problem but maybe they have some ideas.


Tags: confluence-server

context

server