added categories
February 06 2004 12:10 AM

I added the ability to categorize my blog posts today. This will allow me to write about things other than computer programming and still deliver RSS feeds to aggregators like javablogs that only contain programming related posts.

Implementing this change was fairly painless. Since I use prevayler for persistence I needed to set the serialVersionID of the classes that would be changing. Determining the correct value of this ID is done by running the "serialver" utility on the old version of the class. What if you don't have the old version of the class? I'm not sure... but prevayler is gracious enough to report to you the ID it was expecting when it tried to deserialize to a new version of the class not containing the ID (yup, I forgot to put the ID in one of the classes that needed it).

After the coding was done and everything was back to normal I needed to update the existing posts. This I did by hand. As I only have a few posts I was able to hand edit the XML file generated by prevayler. This won't work in the future when I have many many more posts. Alternative: write a utility program in Java that uses prevayler to deserialize the persistence store, makes the necessary changes to the objects, and uses prevayler to serialize the changes. Another alternative: XSLt -- problem is, prevayler's generated XML is too ugly.

Next up: ability to list the categories and a list of RSS feeds.

Comments (0), Add Comment