Jenkins form validation with objects as parameters -
i'm building plugin jenkins , i'm trying validate form (connection test method). worked fine when @queryparameter
strings.
now i'm trying send form validation method object this:
public formvalidation dotestconnection( @queryparameter("url") final string url, @queryparameter("timeout") final string timeout, @queryparameter("bypassproxy") final boolean bypassproxy, @queryparameter("deployercredentialsconfig") final credentialsconfig deployercredentialsconfig, @queryparameter("resolvercredentialsconfig") final credentialsconfig resolvercredentialsconfig ) throws servletexception {
in global.jelly file have this:
<f:validatebutton title="${%test connection}" progress="${%testing...}" method="testconnection" with="url,timeout,bypassproxy,deployercredentialsconfig,resolvercredentialsconfig"/>
my credentialconfig
class implements serializable
guess not enough becuase i'm getting when clicking "test connection" button:
java.lang.illegalargumentexception: failed invoke public hudson.util.formvalidation
org.jfrog.hudson.mybuilder$descriptorimpl.dotestconnection(java.lang.string,java.lang.string,boolean,org.jfrog.hudson.credentialsconfig,org.jfrog.hudson.credentialsconfig) throws javax.servlet.servletexception
jenkins has no documentation using objects inside of formvalidation calls.
looking @ jenkins documentation , code behind <f:validatebutton/>, i believe it's impossible have objects bind in validation logic.
the docs (https://wiki.jenkins-ci.org/display/jenkins/jelly+form+controls):
the 'with' attribute specifies input fields sent server validation. matched against field attribute or name attribute of other input controls. values of nearest input fields above sent server, means button has come after input fields. multiple fields can specified using ','.
the code gets fields names - there no "object assembly" (i believe it's done during actual config submission).
Comments
Post a Comment