This can be done easily by setting json="true"; otherwise the default is to pass =false for each unselected job.
Ironically, even with this fix we are sending 2× what is needed,
since currently ListView.submit does not even check the json parameter for job names:
it only pays attention to top-level request parameters that the browser defines for selected checkboxes.
Ideally we could ask buildFormTree to ignore a given form element entirely, so as to avoid the wasted data.
at …
at hudson.model.View.toString(View.java:514)
at java.text.MessageFormat.subformat(MessageFormat.java:1246)
at java.text.MessageFormat.format(MessageFormat.java:836)
at java.text.Format.format(Format.java:140)
at java.text.MessageFormat.format(MessageFormat.java:812)
at java.util.logging.Formatter.formatMessage(Formatter.java:130)
at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:63)
at java.util.logging.StreamHandler.publish(StreamHandler.java:179)
at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)
at java.util.logging.Logger.log(Logger.java:481)
at java.util.logging.Logger.doLog(Logger.java:503)
at java.util.logging.Logger.log(Logger.java:567)
at hudson.model.AbstractItem.getUrl(AbstractItem.java:423)
at hudson.model.View.getViewUrl(View.java:510)
at hudson.model.View.toString(View.java:514)
at …
The basic fix is to use ${rootURL} plus full model object URLs rather than relying on ${jobBaseUrl}.
This is made trickier by the fact that the model object URLs are computed inside ProgressiveRendering.compute,
and therefore will not be correct when nondefault views are in the crumb trail unless the original request information is present.
So modifying ProgressiveRendering to preserve a copy of the original request for use during computation.
(This could probably be used to simplify parts of AsynchPeople as well.)
Also improving AbstractItem.getUrl to properly construct a URL including views even when the current page is not inside the item;
it should suffice for some ancestor of the current item (or a view thereof) to be in the ancestor list of this page.
Existing code referring to a member of type AbstractBuild often called methods not present in Run.
Changed to retain the existing fields and getters but deprecating them and introducing replacements.
Documented this feature and integrated a newer version of Stapler.
I took the opportunity to reorder the content in the section, so that
the tree parameter becomes the main subject.
At this point, the depth parameter should be only used in a limited
circumstance, so it should be treated as such.
I came into this use case while working on the workflow, but I think it's useful in other context as well,
such as Scriptler plugin needing to define some parameters.
Most of methods define @Nonnull inputs and outputs (the legacy behavior is mostly non-documented), but there're several exceptions
Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>