Today, I just got a way on how to checkout a code in github. well, let me introduce what is github actually. it is a repository for community. Yeah, you can sign up yourself in the following address:
http://github.com
I have registered myself in the following:
http://github.com/ariemurdianto
Well, you will see a few test project there. Well, as I am noob, it should not a matter. :D
However, this repository is quite unique compare to the others. it provides you almost the same featurea as subversion, the only thing which makes this different is about the command. The command's name is different. Just a few things are the same.
The thing that I did is to clone a project of yql-tables from spullara and then try to perfom add and edit on this clone project. Well, it is successfully being updated there. What does this mean? it means I can start to develop my plugin as yahoo service can reach open table in github.
Yatta!!! the next plugin will be coming shortly.
Thursday, July 16, 2009
How to checkout the source from github
Wednesday, July 8, 2009
Ajax Cross Site
Now, I am trying to develop a Confluence plugin which needs an Ajax cross site. This plugin is actually need a data from outside. It means that I need to open and maybe hold the connection during the data fetching process. If I do this in server side code, it will burden the server a lot. Thus, I need to distribute the burden among the client. Thus, Confluence will not be complained to be slow anymore.
Upon googling around, it seems that it is impossible. A lot of people hit into a security problem. As xhr (XmlHTTPRequest) does not allow any script crossing site. However, I was finding clue which reveal the script of doing cross site. JSONP!! Yeay... By using JSONP technique, it is possible to fetch data from outside using javascript. The idea of JSONP is actually to have a dynamic insertion on function. As you may know that we are allowed to import a script from outside. For example:
< type="text/javascript" src="http://vs1.pbworks.com/shared/statics/packed-v70340828.js">
But, the application which you want to fetch data from, should provide a way so that the json which is a return value of rpc, wrap the return value in certain function. The following is a piece of code which does JSONP:
var surl = baseurl + "&callback=?"
$.getJSON(surl, function(data) {
var res = '<>The data: '+data.screen_name+''
$("#result").html(res)
})
Monday, July 6, 2009
Releasing plugin using maven
I was having difficulties on how to release plugin in maven since this is the first time I develop plugin for open source. A new knowledge for me indeed. My plugin which is about RPC using JSON in Confluence, now has been released. You can have a look at the following page:
* http://confluence.atlassian.com/display/CONFEXT/Confluence+JSON+webservice
* http://www.customware.net/repository/display/AtlassianPlugins/Confluence+JSON+webservice
I hope that many feedback from Confluence users to this plugin.
Anyway, back to the topic. Releasing the plugin is a bit complicated work for beginner. First thing that you need to do is to configure your pom.xml so that it points to the right repos. The configuration that you need to aware of is distributionManagement. DistributionManagement will have a link to servers' configuration in settings.xml. The following pages may be better to explain more on distribution tag:
* http://maven.apache.org/pom.html#Distribution_Management
* http://maven.apache.org/settings.html#Servers
Just to sum up the 2 links above. The distributionManagement tag defines what server to be used as a remote repository (this configuration is defined in pom.xml) and servers tag specifies the credentials or anything so that maven can write and install plugin in the remote repository.
Tuesday, June 30, 2009
Merge dependencies in maven
I have a need to merge dependencies of my Confluence JSON webservice plugin because the plugin needs 2 libraries which are json-lib and ezmorph. There are a few ways on how to do this:
- A very naive way, by unjaring all the dependencies and my plugin together and then rejar it back. This is definitely not a good way since I want to make my plugin is installable via repository client.
- Maven, maven provides you a way on how to merge file. The idea is to unjar the dependencies before maven package the classes to be jar file. So, what I did was to unpack the dependencies to classes directory where maven allocate the classes of my plugin after compile them.
