[dev] display an image in a help file

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

[dev] display an image in a help file

Nigel-7
In the plot plugin I'm developing, I have a config.jelly that  
references help html files.  In the help html, I want to display an  
image (png) that I put in src/main/webapp/examplePlot.png.  I've  
tried many different paths in my <img src=...> tag within the help  
html files and nothing seems to work.  Any clues on how to make this  
work?

Thanks,
Nige

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

Reply | Threaded
Open this post in threaded view
|

Re: [dev] display an image in a help file

Kohsuke Kawaguchi
Administrator
Nigel wrote:
> In the plot plugin I'm developing, I have a config.jelly that  
> references help html files.  In the help html, I want to display an  
> image (png) that I put in src/main/webapp/examplePlot.png.  I've  
> tried many different paths in my <img src=...> tag within the help  
> html files and nothing seems to work.  Any clues on how to make this  
> work?

You'd have to refer to ${rootPath}, so the help html needs to be a jelly
script, too. Then you'd do:

   ${rootPath}/plugin/plot/examplePlot.png

SubversionSCM has one help page written in Jelly. See:

>         <f:entry title="Repository URL" help="/scm/SubversionSCM/url-help">

(this URL is treated as under ${rootPath})

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [dev] display an image in a help file

Nigel-7
On Jul 7, 2007, at 12:39 AM, Kohsuke Kawaguchi wrote:


> Nigel wrote:
>
>> In the plot plugin I'm developing, I have a config.jelly that  
>> references help html files.  In the help html, I want to display  
>> an  image (png) that I put in src/main/webapp/examplePlot.png.  
>> I've  tried many different paths in my <img src=...> tag within  
>> the help  html files and nothing seems to work.  Any clues on how  
>> to make this  work?
>>
>
> You'd have to refer to ${rootPath}, so the help html needs to be a  
> jelly script, too. Then you'd do:
>
>   ${rootPath}/plugin/plot/examplePlot.png
>
> SubversionSCM has one help page written in Jelly. See:
>
>
>>         <f:entry title="Repository URL" help="/scm/SubversionSCM/
>> url-help">
>>
>
> (this URL is treated as under ${rootPath})
>

Still trying to make this work.  Currently this help file is returned  
from PlotPublisher.DescriptorImpl.getHelpFile().  What should the  
string be returned from this method?  I tried "/plugin/plot/
PlotPublisher/DescriptorImpl/help" and placed a help.jelly in plugins/
plot/src/main/resources/hudson/plugins/plot/PlotPublisher/
DescriptorImpl/help.jelly but it didn't work.   More suggestions?

Thanks,
Nige

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

Reply | Threaded
Open this post in threaded view
|

Re: [dev] display an image in a help file

Kohsuke Kawaguchi
Administrator
Nigel wrote:
> Still trying to make this work.  Currently this help file is returned  
> from PlotPublisher.DescriptorImpl.getHelpFile().  What should the  
> string be returned from this method?  I tried "/plugin/plot/
> PlotPublisher/DescriptorImpl/help" and placed a help.jelly in plugins/
> plot/src/main/resources/hudson/plugins/plot/PlotPublisher/
> DescriptorImpl/help.jelly but it didn't work.   More suggestions?

I updated the javadoc as follows:

>     /**
>      * Returns the resource path to the help screen HTML, if any.
>      *
>      * <p>
>      * This value is relative to the context root of Hudson, so normally
>      * the values are something like <tt>"/plugin/emma/help.html"</tt> to
>      * refer to static resource files in a plugin, or <tt>"/publisher/EmmaPublisher/abc"</tt>
>      * to refer to Jelly script <tt>abc.jelly</tt> or a method <tt>EmmaPublisher.doAbc()</tt>.
>      *
>      * @return
>      *      "" to indicate that there's no help.
>      */
>     public String getHelpFile() {
>         return "";
>     }
In your case, you'd like to refer to a view "help.jelly", so the string
would be:

   /publisher/PlotPublisher/help

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment