开发者

Jenkins plugin - referring to global plugin settings in project plugin settings

开发者 https://www.devze.com 2023-02-16 01:24 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消