If you look at the URL of a portlet graph you'll see something like 
view/MyDash/portlet/dashboard_portlet_3/summaryGraph/png?width=600&height=400
The stapler binding to the portlet from the view should then be 
"portlet/dashboard_portlet_3"

So you should be able to change your form action to something like

<f:form method="post" action="portlet/${it.getId()}/configSubmit" 
name="reportplugin">

And it might work.

Robert Sandell
Software Tools Engineer - Tools and Integration
Sony Mobile Communications


> -----Original Message-----
> From: [email protected] [mailto:jenkinsci-
> [email protected]] On Behalf Of Ullrich Hafner
> Sent: den 21 maj 2012 14:25
> To: [email protected]
> Subject: Re: Sending stapler request to different class than one
> stapler binds jelly to
> 
> Ok, seems that the view "MyDash" is the last object that is searched
> for
> your method. I.e., the containing portlets are not asked. So I don't
> think that your use case is possible up to now...
> 
> Ulli
> 
> On 05/21/2012 12:47 PM, jrusnack wrote:
> > Stapler StackTrace:
> >
> > http://localhost:8080/view/MyDash/configSubmit
> >
> > POST /view/MyDash/configSubmit HTTP/1.1
> > Host: localhost:8080
> > User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120421
> > Firefox/10.0.4
> > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/
> > *;q=0.8
> > Accept-Language: en-us,en;q=0.5
> > Accept-Encoding: gzip, deflate
> > Connection: keep-alive
> > Referer: http://localhost:8080/view/MyDash/
> > Cookie: screenResolution=1280x720; iconSize=32x32;
> > hudson_auto_refresh=false
> > Content-Type: application/x-www-form-urlencoded
> > Content-Length: 23
> >
> > HTTP/1.1 400 Bad Request
> > Stapler-Trace-001: ->
> > evaluate(<hudson.model.Hudson@145c38c1> :hudson.model.Hudson,"/view/
> > MyDash/configSubmit")
> > Stapler-Trace-002: ->
> >
> evaluate(((StaplerProxy)<hudson.model.Hudson@145c38c1>).getTarget(),"/
> > view/MyDash/configSubmit")
> > Stapler-Trace-003: ->
> > evaluate(<hudson.model.Hudson@145c38c1>.getView("MyDash"),"/
> > configSubmit")
> > Stapler-Trace-004: ->
> >
> evaluate(<hudson.plugins.view.dashboard.Dashboard@4d84aa4e> :hudson.plu
> gins.view.dashboard.Dashboard,"/
> > configSubmit")
> > Stapler-Trace-005: ->
> > <hudson.plugins.view.dashboard.Dashboard@4d84aa4e>.doConfigSubmit(...)
> > Content-Type: text/html; charset=utf-8
> > Stapler-Trace-006: ->
> >
> evaluate(<hudson.plugins.view.dashboard.Dashboard@4d84aa4e> :hudson.plu
> gins.view.dashboard.Dashboard,"/
> > error")
> > Stapler-Trace-007: -> hudson/model/AbstractModelObject/error.jelly on
> > <hudson.plugins.view.dashboard.Dashboard@4d84aa4e>
> > Expires: 0
> > X-Hudson-Theme: default
> > Transfer-Encoding: chunked
> > Server: Jetty(6.1.1)
> >
> > What exactly do you mean by "views" ? Do you have method doSave in
> > class that extends DashboardPortlet ?
> >
> > On May 21, 12:00 pm, Ullrich Hafner <[email protected]> wrote:
> >> In my views I have a method
> >>
> >>     public void doSave(final StaplerRequest request, final
> >> StaplerResponse response) {
> >>
> >> which is called when pressing save
> >>
> >>       <f:form method="post" action="save" name="Save">
> >>
> >>         [...]
> >>         <f:entry title="">
> >>           <input type="submit" name="Submit'" value="${%Save}"
> >>             class="submit-button" />
> >>         </f:entry>
> >>
> >> What is the Stapler URL trace?
> >>
> >> Ulli
> >>
> >> On 05/21/2012 11:54 AM, jrusnack wrote:
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>> Yes, I will resort to moving those option to Edit View, but if it`s
> >>> possible, I would like to have some minimum amount of interactive
> >>> selection right under graph.
> >>> And yes, do method in ReportPluginPortlet class is not called, and
> >>> that is what I would like to achieve.
> >>> On May 21, 11:45 am, Ullrich Hafner <[email protected]>
> wrote:
> >>>> I see. Wouldn't it be better if all Jenkins portlets behave in the
> same
> >>>> way, i.e. only in edit view there are configurable (and so the
> edit part
> >>>> will take space from the actual graph)?
> >>>> What I don't understand is why you don't delegate to your code
> from the
> >>>> portlet? Is the do method not called?
> >>>> Ulli
> >>>> On 05/21/2012 11:29 AM, jrusnack wrote:
> >>>>> My plugin generates trend graph with test results and I use
> textboxes
> >>>>> and drowdown lists to configure this graph. Configuration options
> >>>>> include: how many builds to include in report (or which), which
> >>>>> configurations should be included, even groovy expression for
> >>>>> filtering matrix configurations that should contribute results to
> >>>>> trend graph. All these are right below graph (all part of
> portlet), so
> >>>>> user can choose what he wants to see interactively. Problem is
> >>>>> submitting these to my plugin, not dashboardView. Obviously, by
> moving
> >>>>> these options to Edit View, I loose interactivity I want to
> achieve.
> >>>>> On May 21, 11:16 am, Ullrich Hafner <[email protected]>
> wrote:
> >>>>>> I'm not sure if I understand your use case - maybe you need to
> >>>>>> elaborate: the dashboard portlets already provide an extensible
> UI for
> >>>>>> the configuration. What extra buttons and views do you want to
> show?
> >>>>>> Ulli
> >>>>>> On 05/21/2012 10:19 AM, jrusnack wrote:
> >>>>>>> Hi,
> >>>>>>> I am working on plugin that will show some trends and
> statistics and I
> >>>>>>> also want ability to add it to dasboard (DashboardView plugin).
> Also,
> >>>>>>> I need buttons and forms that will control what statistics and
> trend
> >>>>>>> graphs are displayed. I am able to extend dashboardView plugin,
> but I
> >>>>>>> cannot submit form with data from within DashboardView portlet
> to my
> >>>>>>> plugin (stapler sends request to dashboardView plugin, which
> replies
> >>>>>>> Error: no name specified.). So, my question is, how can I send
> data
> >>>>>>> from jelly included in one plugin (dashboard) to class of other
> plugin
> >>>>>>> (mine) ? Thank you in advance.
> >>>>>>> public class ReportPluginPortlet extends DashboardPortlet{
> >>>>>>>     ...
> >>>>>>>     public void doConfigSubmit(StaplerRequest req,
> StaplerResponse
> >>>>>>> rsp) throws ServletException,
> >>>>>>>             IOException, InterruptedException {
> >>>>>>>     ....
> >>>>>>>     }
> >>>>>>>     ....
> >>>>>>> }
> >>>>>>> portlet.jelly:
> >>>>>>> <f:form method="post" action="configSubmit"
> name="reportplugin">
> >>>>>>>     ...

Reply via email to