Quantcast

Use static content of a plugin and non-standard context path

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Use static content of a plugin and non-standard context path

Stefan Wolf
Hi,

I have the following problem:
The groovy post-build plugin has a help page which is shown on its configure page: https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/webapp/projectconfig.html
This static html page references some other images which are in the webapp directory of the plugin via urls like /plugin/groovy-postbuild/images/warning.gif. This all works pretty fine as long as jenkins runs with context path /. As soon as jenkins runs with another context path, e.g. jenkins/, then the images are not found any more from the help page, since the correct path would be /jenkins/plugin/groovy-postbuild/images/warning.gif.
How can I solve this problem?

Best regards,
Stefan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Jesse Glick-4
On 08/23/2012 04:03 PM, Stefan Wolf wrote:
> How can I solve this problem?

${rootURL} is what you want I think.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Stefan Wolf
I want to use it in the html page. Is this possible? Or do I have to convert it to jelly and put it to another location?

Am Donnerstag, 23. August 2012 22:16:54 UTC+2 schrieb Jesse Glick:
On 08/23/2012 04:03 PM, Stefan Wolf wrote:
> How can I solve this problem?

${rootURL} is what you want I think.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

stephenconnolly
In reply to this post by Jesse Glick-4
On 23 August 2012 21:16, Jesse Glick <[hidden email]> wrote:
On 08/23/2012 04:03 PM, Stefan Wolf wrote:
How can I solve this problem?

${rootURL} is what you want I think.

${resURL} more correctly to aid static content caching
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RE: Use static content of a plugin and non-standard context path

Sandell, Robert-2
In reply to this post by Stefan Wolf

Use relative paths

images/warning.gif

 

 

Robert Sandell

Software Tools Engineer - Tools and Integration

Sony Mobile Communications

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Stefan Wolf
Sent: den 23 augusti 2012 22:04
To: [hidden email]
Subject: Use static content of a plugin and non-standard context path

 

Hi,

 

I have the following problem:

The groovy post-build plugin has a help page which is shown on its configure page: https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/webapp/projectconfig.html

This static html page references some other images which are in the webapp directory of the plugin via urls like /plugin/groovy-postbuild/images/warning.gif. This all works pretty fine as long as jenkins runs with context path /. As soon as jenkins runs with another context path, e.g. jenkins/, then the images are not found any more from the help page, since the correct path would be /jenkins/plugin/groovy-postbuild/images/warning.gif.

How can I solve this problem?

 

Best regards,

Stefan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Jesse Glick-4
In reply to this post by stephenconnolly
On 08/24/2012 05:16 AM, Stephen Connolly wrote:
>> ${rootURL} is what you want I think.
>
> ${resURL} more correctly to aid static content caching

These did not seem to be documented, so:

https://wiki.jenkins-ci.org/display/JENKINS/Basic+guide+to+Jelly+usage+in+Jenkins#BasicguidetoJellyusageinJenkins-PredefinedURLs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Stefan Wolf
In reply to this post by Sandell, Robert-2
I cannot use relative paths since the help file is included in the configuration page. Can somebody please give me a pointer what the correct jelly expression is? resURL or rootUrl? Where is this documented?

On Friday, August 24, 2012 12:33:17 PM UTC+2, Robert Sandell wrote:

Use relative paths

images/warning.gif

 

 

Robert Sandell

Software Tools Engineer - Tools and Integration

Sony Mobile Communications

 

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gUZCegREQbcJ">jenkin...@... [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gUZCegREQbcJ">jenkin...@googlegroups.com] On Behalf Of Stefan Wolf
Sent: den 23 augusti 2012 22:04
To: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gUZCegREQbcJ">jenkin...@...
Subject: Use static content of a plugin and non-standard context path

 

Hi,

 

I have the following problem:

The groovy post-build plugin has a help page which is shown on its configure page: https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/webapp/projectconfig.html

This static html page references some other images which are in the webapp directory of the plugin via urls like /plugin/groovy-postbuild/images/warning.gif. This all works pretty fine as long as jenkins runs with context path /. As soon as jenkins runs with another context path, e.g. jenkins/, then the images are not found any more from the help page, since the correct path would be /jenkins/plugin/groovy-postbuild/images/warning.gif.

How can I solve this problem?

 

Best regards,

Stefan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Stefan Wolf
Hi all,

I tried as suggested. I don't know why, but it seems like the rootURL in my help.jelly file is not expanded. Any ideas? I pushed my changes to github: https://github.com/jenkinsci/groovy-postbuild-plugin/tree/rootUrl. If anybody could have a look at it and tell me why it does not get expanded correctly.

Thank you,
Stefan

On Friday, August 24, 2012 3:29:15 PM UTC+2, Stefan Wolf wrote:
I cannot use relative paths since the help file is included in the configuration page. Can somebody please give me a pointer what the correct jelly expression is? resURL or rootUrl? Where is this documented?

On Friday, August 24, 2012 12:33:17 PM UTC+2, Robert Sandell wrote:

Use relative paths

images/warning.gif

 

 

Robert Sandell

Software Tools Engineer - Tools and Integration

Sony Mobile Communications

 

From: [hidden email] [mailto:jenkin...@googlegroups.com] On Behalf Of Stefan Wolf
Sent: den 23 augusti 2012 22:04
To: [hidden email]
Subject: Use static content of a plugin and non-standard context path

 

Hi,

 

I have the following problem:

The groovy post-build plugin has a help page which is shown on its configure page: https://github.com/jenkinsci/groovy-postbuild-plugin/blob/master/src/main/webapp/projectconfig.html

This static html page references some other images which are in the webapp directory of the plugin via urls like /plugin/groovy-postbuild/images/warning.gif. This all works pretty fine as long as jenkins runs with context path /. As soon as jenkins runs with another context path, e.g. jenkins/, then the images are not found any more from the help page, since the correct path would be /jenkins/plugin/groovy-postbuild/images/warning.gif.

How can I solve this problem?

 

Best regards,

Stefan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Use static content of a plugin and non-standard context path

Kohsuke Kawaguchi
Administrator
In reply to this post by Jesse Glick-4
Loading...