I'm trying to get the path to the "images/icons" folder. In my development environment, it is in /jira/webapp/images/icons folder, but that will obviously not be the path in Production. Is there a way through the API to dynamically find this path?
Thanks!
Community moderators have prevented the ability to post new answers.
Images are stored in your install directory under atlassian-jira
{jira-install}/atlassian-jira/images/icons
See http://confluence.atlassian.com/display/CONFDEV/Adding+Plugin+and+Module+Resources about the relative location. I see two cases when I'm referring to an image resource in a .vm file. Usually:
<img src="${req.getContextPath()}/download/resources/com.consultingtoolsmiths.jira.plugins.templatehelper:templatehelper-resources/new_blink"
But in a gadget I have to use
<img src="../../../download/resources/com.consultingtoolsmiths.jira.plugins.templatehelper:templatehelper-resources/new_blink"
Hope this helps,
~Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In most cases, you can just use /images/icons. The resource is declared like that and so it doesn't matter what folder structure sits above it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I've actually tried that...along with some other things, with no luck. I'm still trying, so if you have any other ideas, I would appreciate it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you adding your own image files? If so, you can add it as a resource in the plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, I'm not. I'm just trying to get access to the icons that come loaded in JIRA by default.
For instance, the development environment path is: /webapp/images/icons.
But, in production, it will be something like: /jira/atlassian-jira-4.3/atlassian-jira/images/icons.
How do I get the "/jira/atlassian-jira-4.3/atlassian-jira" part of the URL?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. If you accessing from a jsp, you can do it as follows:
<img src="<%=request.getContextPath()%>/images/icons/your_image.png" alt="" title="Some title">
Basically, you invoke it using the context path in the front.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I tried that. Actually, it's coming from Java code, not necessarily a JSP. My code looked like this:
String iconDirectory = JiraWebUtils.getHttpRequest().getContextPath() + File.separator + "images" + File.separator + "icons";
File iconFile = new File(iconDirectory);
String files[] = iconFile.listFiles();
But, that just gave me "/jira/images/icons" which was not what I needed.
I appreciate your comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should be able to read the system property catalina.base and append the rest. Difficult to see why you need this in code though...?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ie: System.getProperty("catalina.base")
I'm assuming tomcat, for other app servers it will be something different, but same principal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or try ActionContext.getContext().getRequestImpl().getContextPath() ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.