So when I came to Atlassian I didn’t know what to expect. First day, I was introduced to the Javablogs source code on IDEA, running on Resin and Tomcat. For most of you, this is probably a walk in the park – but coming from a “corporate” background where Websphere is the only application server deemed worthy of deploying “business critical applications” and using the Eclipse based Rational Application Developer as “the” IDE – I was slightly disoriented.
But that lasted for all of 5 minutes, thanks to the confluence team 🙂
As soon as I got my head around the dev environment I spent a day or two browsing through the Javablogs code. What surprised me the most was the immense use of libraries: webwork, hibernate, spring, os_user, seraph, bucket, etc – I knew prior to joining that Atlassian was a pro-opensource company, I didn’t think it’d be like this. [In the corporate world you need libraries to be “approved” before you can use them, and by the time a particular version is “approved” a newer stable version is released]
So that’s pretty much wraps up my background. The first two major things I had to get my head around was the Webwork (very intuitive), Spring (also intuitive once you get the purpose of IoC) and Hibernate (I had played with rails before so it seemed like a similar ORM). This “getting my head around” phase is still on going. I haven’t really had the time to sit down and learn the ins and outs of these libraries, but online documentation, and again the confluence team, have been awesome so far.
My task on javablogs was to fix a few smallish bugs. The most memorable was the Forgot Password Button. Although this button was working, the forgot username button was not. And that’s when i met os_user, and wished I didn’t. There was no standard way for looking up users based on their email address, so the hacky solution was straight JDBC.
Having fixed the immediate bugs, the next thing to move on to was essential features. A lot of people have whinged about the lack of language filtering for the blogs and blog entries – which is understandable, there is no point in having half the front page filled with Chinese blogs if you can only speak English (and vice versa). This required a few changes in different places, and allowed me to become more familiar with Hibernate, Velocity, Webwork UI and a lot of the Javablogs code. The result was pretty cool – user’s could set their preferred languages, and the filter would be applied to all pages so that only blogs and entries from their chosen languages would be displayed. As suggested by Charles, we also allowed unregistered users to have the option of selecting English as their default language (using a persistent cookie).
So this seemingly simple feature – took me 3 days to implement. But in those 3 days, I feel that I’ve learnt so much more than I learnt in previous 3 months. And the learning hasn’t stopped.
I also implemented features like dynamic ad management, so admin’s can crud web/email text/email html ads, and the relevant views and templates to display these ads.
By now I had gotten used to the standard libraries and had more confidence and efficiency developing javablogs.
The next task was markedly larger than the previous two and it was to update the libraries which javablogs use. The first library I had to update was ROME (the RSS/Atom Java Library). This was a piece of cake. I reviewed the change logs to make sure there is nothing obvious that’s going to kill us, changed the maven project.xml to require the newer version, and voila!
But I hit the wall for a bit trying to upgrade Lucene. I still remember that day vividly. It went something like this:
Charles: Next, update the search libraries.
Charles: Use Bonnie.
Charles: Look at the Confluence code.
Look at the Confluence code. Having sat with the Confluence team for a month, it had just occurred to me that I knew very little about confluence other than “enterprise wiki”. Once I’d obtained the source CVS, I realised what I was missing. Good code.
After drooling over the code for two minutes, I looked at the relevant search package and the bonnie source. I had a vague idea of what’s going on after reading the Lucene docs. Basically, you have documents, they get indexed/stored in an index file, and you can search these documents by executing queries over the index. However, the Lucene Faq described so much more, such as keeping current index readers, optimizing every so often etc. I realised that Bonnie implements a lot of these necessary “usage guidelines” and the rest is implemented in Confluence. There is probably quite a lot from confluence which could be moved into bonnie, such as: the indexing process including the scheduled jobs, tasks, index queue as well as extractors, summarizer, etc.
It was quite a learning curve because there was quite a bit of source code and docos to read through to get my head around the search process. I also learnt about the scheduling subsystem and process which occur in the background of javablogs/confluence.
Once the core search libraries and files were updated (this took about a week), I moved on to improving the search functionality within javablogs. If you’ve used javablogs before you’ll realise that search was pretty substandard. Some new features:
- sorting options by: lucene’s relevance score, date, reads.
- filtering by: all blogs, favourite blogs, unignored blogs.
- filtering by date range like confluence.
- better paging (looks more like confluence).
- ajaxy update of favourites handling (see below).
- xml rss of search results (for user specific search filters such as favourite/ignored blogs, user languages we adopted the method used by confluence – using seraph’s basic authenticator to do http authentication to log in the user).
My prior experience with ajax can be summarised here, ie. very little. But that’s primarily because I hadn’t had time to play around with it properly (I was usually working on back end stuff while i was “corporate”). I love making things look cool – so I thought that this would be a chance to have a go at it.
The next step was the coolification process – which had been greatly simplified by Yahoo’s UI Toolkit. This is quite a gem, the DHTML goodness is awesome. It provides a pretty thorough eventing library to minimise cross-browser quirks (it’s hard to appreciate this until you actually become aware of the oddities). It also has some pretty cool animation effects and all the other things you’d expect like drag and drop and general shinyness.
Check it out: javablogs.com!