Howto link to the latest results in ProjectAction

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Howto link to the latest results in ProjectAction

Ulli Hafner-2
Hi,

How do I link to the latests results in a ProjectAction? (I.e., a link
on the sidepanel on the project page.)

E.g., in my FindBugsProjectAction I have overwritten the method

    /** {@inheritDoc} */
    public String getUrlName() {
        return "findbugs";
    }

I tried to replace this URL with "latestBuild/findbugsResult": that
works for the project action, but then the trend graph is not working
anymore (which ist referenced from the jelly files with
findbugs/doGraph.

Best regards, Ulli
--
Avaloq - essential for banking.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Howto link to the latest results in ProjectAction

Kohsuke Kawaguchi
Administrator
Hafner Ullrich wrote:

> How do I link to the latests results in a ProjectAction? (I.e., a link
> on the sidepanel on the project page.)
>
> E.g., in my FindBugsProjectAction I have overwritten the method
>
>     /** {@inheritDoc} */
>     public String getUrlName() {
>         return "findbugs";
>     }
>
> I tried to replace this URL with "latestBuild/findbugsResult": that
> works for the project action, but then the trend graph is not working
> anymore (which ist referenced from the jelly files with
> findbugs/doGraph.
I don't think getUrlName() expects more than one token. I'll clarify
javadoc.

What you should do is to define the doIndex() method and redirect:

   public void doIndex(StaplerRequest req, StaplerResponse rsp) {
     rsp.sendRedirect2("../latestBuild/findbugsResult");
   }

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment