JIRA's Web Resource Plugin Module documentation suggests that using the jira.general context "Applies to every page in JIRA"
But this doesn't work for the login page http://localhost:2990/jira/login.jsp
Ideas?
Community moderators have prevented the ability to post new answers.
Hello gents, I've tested this by creating two plugins; one for JIRA 4 and one for JIRA 5. In JIRA 4 it works, but in JIRA 5 it does not, sorry about that. Right now there is no solution to include your web-resource on the login.jps page. I used the following to test:
atlassian-plugin.xml
<?xml version="1.0" encoding="UTF-8"?> <atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2"> <plugin-info> <description>${project.description}</description> <version>${project.version}</version> <vendor name="${project.organization.name}" url="${project.organization.url}"/> </plugin-info> <web-resource name="My Web Resource" i18n-name-key="my-web-resource.name" key="my-web-resource"> <description key="my-web-resource.description">The My Web Resource Plugin</description> <resource name="test.js" type="download" location="/templates/test.js"/> <context>atl.general</context> </web-resource> <resource type="i18n" name="i18n" location="atlassian-plugin"/> </atlassian-plugin>
/templates/test.js:
alert("hey jira!");
There has been a lot of work done between JIRA 4 and JIRA 5 with the decorators, so this bug probably just sneaked in there. Therefore I raised a bug ticket here: JRA-27960
I recommend to vote on this ticket and watch it to get updates on the progress.
I think you're right. It's a bug. I've only tried with JIRA 5. If what you've discovered is correct, it'll be worth updating the JIRA Web Resource Plugin Module documentation too.
I'm still going to hang back and wait a couple of days in case anyone has a better suggestion :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found out how you can probably fix this for now. You need to add the following to your login.jsp, above any of the html document:
<%@ page import="com.atlassian.plugin.webresource.WebResourceManager" %> <% WebResourceManager webResourceManager = ComponentManager.getComponent(WebResourceManager.class); webResourceManager.requireResourcesForContext("atl.general"); webResourceManager.requireResourcesForContext("jira.general"); %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David, is there anything else you need for this question?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The dirty hack, which has the advantage to work for creating new pages as well:
1) Place your modified login.jsp as a resource in the plugin
2) On the plugin boot (osgi starup hook), check if the login is the one you have packed in your plugin; if not, copy the login.jsp over it (rename it prior to that)
3) Ha ha !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
of course, a more nice stuff would be to patch the existing, but you will have to define insertion points ... anyway, that's the general idea.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice plan, but <sob>I just want it to work properly</sob>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure. Thanks. The gadget is not really an issue, but the login page is completely separate.
I'm talking about this page: https://jira.atlassian.com/login.jsp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess javascript is restricted on login.jsp , its a guess :)
you can even have a look at atlassian-jira/includes/loginform.jsp for a better idea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Matt Doar suggests using a jira-footer module - it's seemingly an undocumented module type, but example syntax is available in system-footer-plugin.xml:
<atlassian-plugin name='JIRA Footer' key='jira.footer' i18n-name-key="footer.plugin.name"> <plugin-info> <description key="footer.plugin.desc">This plugin renders the content of the footer in JIRA.</description> <vendor name="Atlassian" url="http://www.atlassian.com"/> <application-version min="3.12" max="4.3"/> <version>1.0</version> </plugin-info> <jira-footer key="standard-footer" i18n-name-key="footer.plugin.standard.name" name="Standard Footer" class="com.atlassian.jira.plugin.navigation.DefaultPluggableFooter"> <resource type="velocity" name="view" location="templates/plugins/footer/footer.vm"/> <order>10</order> </jira-footer> </atlassian-plugin>
...I wonder whether this works with JIRA 5.x
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I answered this already but I can't find it.
Last time I checked then there is no context defined on the login page. Not even atl.general/jira.general.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if your using jira 5.0 add ur javascrip in
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { ur javascript here..... }):
and include as webresource.
if ur using old version try with page load or document .ready
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But how do you get the web resource to appear on the login page?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be really cool if this was documented somewhere :)
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.