Monday, April 23, 2007

Keep On Keeping On

So it didn't take too long for me to realize I had the g3p project setup all wrong. When I posted last I was using Google Code to host the GWT compiled files (which are the Javascript/HTML/CSS source files) and not the actual Java source. This was stupid for more than one reason. First of all, GWT hashes the names of the important compiled files in order to prevent browsers from caching them. This would have been a nightmare to manage with subversion so I'm glad I was able to fix this early on. Second of all, it doesn't make any sense to have an open-source project that doesn't provide you with the actual source. So after many iterations of trying to get the directory structure right, the svn trunk finally contains the *right* elements.

This means in order to compile you will have to:
a) create a new project in GWT with the name com.flatown.client.g3p (this requires downloading GWT of course)
b) checkout the source code from Google Code into the src/ directory for your GWT distribution (you might have to delete the files GWT created there first)

Of course, this doesn't solve the problem of being able to use it as a Google Gadget. I was not happy with the idea of checking out the source code on my server and having to sync/recompile it every time I made changes. Nor did I like that I would have to install Java on the server in order to do this (I don't even know if I'm allowed to). My solution to this was to create a bash script that executes a simple rsync command to synchronize my local public/ directory with my server's, which isn't all that clever. Nonetheless, after all this, I finally have a comfortable development cycle.

I've also already done a decent amount of work on the gadget itself, which can now be found at:

http://www.flatown.com/g3p/g3p.xml

(If you use the Google Personalized Homepage just click Add Stuff in the upper righthand corner, then click Add by URL next to the search box button and paste the above URL into the textbox that pops up)

All in all I'm pretty happy with the progress I've made. Next time I'll go into the details of the actual Java/GWT development process, which even so far could have been a whole blog entry unto itself. Anyway, back to work...

Wednesday, April 18, 2007

GWT Gadgets, etc.

So I knew that I wanted to create the g3p gadget using the Google Web Toolkit (GWT), since we all know writing AJAX by hand can be a pain in the ass and this is almost exactly what GWT was created for. However, when I wrote my first Google gadget for the student gadget contest back in November, I did in fact first write it without the GWT, and then later started to rewrite it using the GWT. If you want to see what these look like, here is Version 1 and Version 2 (these are links to the XML files, you can try them out by adding them to your Personalized Google homepage).

Getting the GWT app to work as a gadget is not as easy as you might think, however, and I am still not sure what the best way to do it is. I also noticed that Google suggested making this easier as number 2 of their GSoC ideas. Somebody did in fact pick up this idea (here), and so I emailed him asking if he had any suggestions for the right way to do this in the meantime. I haven't heard back yet though, so I decided to take matters into my own hands.

The first problem I ran into was that I was trying to use the Google hosting SVN repo as my file server, which it turns out is a bad idea. So I checked out a copy of the project on my flatown.com server. The next problem was that I had originally embedded the GWT XML inside the Gadget XML, but this was causing javascript domain security issues when the gwt.js file injects its iframes and they try to refer back to the parent. What I ended up having to do was put an iframe inside the Gadget module with the GWT project's HTML file as the source, though I am really not very happy with this solution. Nonetheless, I settled on the fact that this was probably going to be the way I have to do it for the g3p gadget. The main reason I don't like this is because I am not looking forward to having to pass the gadget preferences to the GWT app, but perhaps this is the best/only way to do it. Anyway, that's the story and I am glad I can at least start working on the gadget in GWT for now.

Monday, April 16, 2007

Welcome

Welcome to my blog documenting the creation of the g3p (Google Gadget Gateway to PubMed) and my experience in the Google Summer of Code 2007. I am hosting the project here using Google Project Hosting. My mentoring organization is the Robert H. Lurie Comprehensive Cancer Center of Northwestern University.

I am really excited to begin the GSoC and I can't wait until I finish school so I can start working on the project full-time. I'm not really sure what form this blog is going to take on but I hope the rest of the posts won't be this boring. I'm going to try to update as often as possible, but I'm not expecting too much to happen until May. Stay tuned...