Monday, May 11, 2009

Using RSS to Trac Tickets

Like many web development firms, we work on many projects at once and often they are quite small projects. I find the combination of Trac + Subversion really helpful to keep a record of changes through a project and also to be able to break a project down into it's components so that each component can be assigned to the person who specialises in that area. With a team of developers who are distributed across different locations and timezones these tools really assist with project management.

The problem is though, we now have lots of different Trac and Subversion installations - one for each project, and it was getting hard to keep an eye on all the tickets assigned to each of us for the various projects. I considered the idea of moving them all into one installation of the Trac and Subversion but then we would lose the ability to allow clients to login to Trac to keep an eye on the progress of their project, unless of course we allowed them to view all details of all projects.

Another option was to move to something a bit more advanced than Trac, but I didn't like the look of the license fees involved with Jira.

I solved this little problem by using my RSS reader (Liferea) to aggregrate the ticket feeds from each of the Trac installs. I chose Liferea because it supports http authentication, but there are plenty of RSS readers around that would do just as good. I started by making a folder in Liferea called 'My Trac Tasks' and then for each project I went to the trac page listing 'My Tickets' and selected the RSS feed link. I added each of these feeds to Liferea.

Normally an RSS reader is used to read news, so there were a few little settings I had to change to get Liferea to suit my needs.

Normally an RSS reader remembers results that you haven't read yet, even if they're no longer included in the RSS feed's XML. I didn't want this, I wanted my aggregated list in Liferea to simply represent a list of exactly all the items in the RSS feeds I added, without remembering items from the past.

Also, an RSS reader normally removes items from display that you have already read. Again I didn't want this, I only wanted items to be removed form display if the ticket has been closed and the item is no longer listed in the RSS XML.

The two options I needed to change to suit my needs were:
Tools -> Feeds -> Feed Cache Handling - set the 'Default number of items per feed to save:' to 0.

For each feed, right click on the feed name and select properties -> archive and then select 'Unlimited cache'.

Now I have a single place that lists all of the open Trac tickets assigned to me. I might still setup another folder within Liferea and add the Trac feeds for ALL open tickets rather than just mine, then I would get a good overview of where everyone else is up to with each of the projects.

Sunday, May 3, 2009

Getting FCKEditor Styles Right in Drupal

We've got a multi-site install of Drupal and we like to place the more common modules at the global 'drupal_install/sites/all/modules' location. Being able to do this is great because it means that when a module needs to be upgraded it helps us upgrade all the sites that use that module at once.

Once such global module is fckeditor. While we do want the module to be stored once at the global level we also want to be able to customise the toolbar and styles for each site, and we want to keep those settings after a module upgrade.

So here's how it's done:

There are two important files used to style fckeditor in a drupal site.

1. fckeditor.config.js
This file belongs to the Drupal module (i.e. stored as ..../modules/fckeditor/fckeditor.config.js) and stores profiles of toolbar sets.

2. fckstyles.xml
This file belongs to FCKEditor itself (i.e. stored as ..../modules/fckeditor/fckeditor/fckstyles.xml)

To be able to customise FCKEditor for each drupal site in a multi-site install. Copy the two files above into your theme folder (i.e ..../themes/my_theme/).

Now, edit the fckeditor profiles you want to use (goto mydrupalsite.com/admin/settings/fckeditor and click 'edit' next to a profile).

Open the CSS fieldset and select 'Use theme fckstyles.xml' from the Predefined Styles options.






Open the Advanced fieldset and set Load fckeditor.config.js from theme path to 'yes'.









Now you can edit fckeditor.config.js and fckstyles.xml within your theme's path to customise fckeditor for only one site. When the time comes to upgrade fckeditor your styles and profiles will remain after the upgrade.