Suggestions on how to store/manage custom extension config on a per subwiki basis

Hi,
I wonder whether someone could provide some guidance please?

I have been working on a custom datasource for the “Live Data Macro”. In the environment in which this will be deployed, there will be a subwiki for different Tenants. Ideally, the datasource would be able to look up configuration for each subwiki (Tenant) such that it accesses data specific to that Tenant (it goes off to an external API to retrieve the data). Some of the data/config is sensitive and thus can’t be a URL parameter passed in on the live data macro fields in the page. It would also be a duplication and difficult to manage if every live data macro line had to include this config.

  • Can a subwiki have its own “configuration” that is accessible by extensions? If so, any details you can provide on how to achieve this would be greatly appreciated.
  • Is there a better way to do this?

Thanks in advance,
Alex

I’ve made progress by using the JIRA Extension as a template and I have config for my extension working for the top-level wiki; however, when the same livedata macro is used in a subwiki page the configuration values are null. Also in the Administration / Other section of the subwiki, my extension config does not appear.

The config is currently built as pages in the top-level wiki. Would exporting those pages as an extension and then reinstalling using “Install on Farm” mean that subwikis would each have their own config?

Otherwise, is there a way to make my extension config space on the main wiki available to subwikis? Or, is there another option/setup I’m missing?

Cheers,
Alex

For now, I’ve decided to use global values defined in xwiki.properties.

In the near future, I will likely return to the per-subwiki approach. I’m going to assume that the config pages need to be exported as an XAR and install the pages as an extension and apply that to a subwiki template as well.

Please shout if you know/think I’m going down the wrong path :slight_smile:

Cheers

I’m going to mark this as resolved for now.