How can I invoke MainConfigProcesser writeTo on my Class?

I want to store settings from within my controller. The controller has a refrence to my Configuration-Class which implements MainConfigProcessor.

How can I invoke writeTo() programmatically? Where do I get the "serverConfigRoot" Element from?

When clicking on save on the general settings page, my Configuration-Classes callback is called. However, I want to explicitely store the preferences from within my controller.configurations plugins

0
3 comments
Avatar
Permanently deleted user

BTW: The documentation in the TeamCity Documentation is outdated:


  • Server-wide settings
    • Please support an example when MainConfigProcessor#writeTo() is called
    • JavaDoc for MainConfigProcessor doesn't explain anything, neither
  • Project-wide settings
    • ProjectManager#persistAllProjects isn't available anymore
0

The simplest way currently is to store your plugin settings in separate file. You can use ServerPaths object to obtain path to configuration directory. Then you can create a file there for your plugin settings.
At the moment TeamCity does not have special API for custom settings.

0
Avatar
Permanently deleted user

Hi Pavel,

thank you for your answer. I will use your suggested way and create a new configuration file.

However, I think this should be changed in the documentation, because it is misleading.

0

Please sign in to leave a comment.