Jenkins plugin - referring to global plugin settings in project plugin settings
I would like to wrote simple hudson plugin. I got stuck on one thing. I would like to be able to use global settings from global.jelly as defaults values for config.jelly.
Is it possible? How can I do this? One more thing - I'm going to have dyna开发者_JAVA百科mic form in global.jelly (I will use <f:repeatable>
tag).
When the user submits the global configuration, configure(StaplerRequest req, JSONObject json)
is called on your descriptor. Usually you extract your setting from the request and put it into a field in your descriptor, where it will be automatically persisted.
Now define a getter for the setting in your descriptor and use e.g. <f:textbox default="${descriptor.getSetting()}/>
in the config.jelly to access the global setting.
精彩评论