Sunday, February 1, 2009

JQuery on JIRA

Yesterday, i did some learning about jquery in jira. Impressive, Jquery is an easy tool to get your site ajax enabled. The way they develop jquery makes the development of my site is independent each other (between client side script and server side script).  As long as you can create a servlet which returns an xml to client, all of the thing neeeded to build an ajax enabled are done. Luckily, jira provides a way to build a servlet plugin. Thus, updating the process which happens in jira is done via servlet.

In the plugin that I created, actually, I'd like to create an ajax enabled using DWR. As JIRA using a very old library (maybe it is the first release of DWR), I tried to use it. The result is im stuck on the way to access a javascript which is supposed to be created by DWR on the fly. I tried to change several configurations in regards of jira servlet plugin and configuration of general servlet. Some more, I did overwrite the code of DWR servlet (so that I can access dwr.xml which is needed by the servlet to create javascript files). All of the things ended with unluckyness. Even, accessing the configuration file is successfull but the javascript file cannot be produced by the servlet (strange enough). There must be something that I missed, definitely, in regards of the creation of the files.

After that, I managed to move to JQuery. Yeah, this stuff is so impressive. I can implement the things that I need using this stuff (However, I had managed to change from javascript enabled to wizard). Because I had changed the way the plugin works, thus I dont want to change anything in the plugin, just be my knowledge, huehuehue.

Basically, what I did to implement JQuery on JIRA (This must be applicable on Confluence as well) are:
  1.  Create servlet to give information needed by client side script.
  2.  Create javascript to access the servlet. In this test, I created a progress bar to update the information of transferring process from 1 jira instance to another instance. There is actually a plugin but strange, I cannot make it work. Thus, I tried to develop my own progress bar (using their progress bar image :P) and it does work well. A very simple progress bar, but at least it does fulfill what I want.
That's all my experience on researching ajax enabled for jira.