|  About  |  Archives  |  Log in  | 

Updates

I have had a busy weekend, updating and improving this site.
First, I got the details down on implementing a search function for this blog, using the Apache Lucene search engine. As noted earlier, I have been wanting to get this done for some time and you can now see the result in the menu on the left. The way in which Lucene is used on these pages is illustrated by the class diagram shown below.

Next, I have deployed ROME - Rss and atOM utilitiEs - to generate a RSS 2.0 syndicated web feed from recent blog entries. ROME required a small work-around, since there is a problem with the encoding of the generated XML (in ROME v. 0.5).
ROME uses the

as the super type for all feeds. The encoding to be used can be set using the

setEncoding(java.lang.String encoding)

method. Unfortunately, any set encoding is not used by the ROME parser, so usage of this method is to no avail. Luckily, ROME can output the generated feed to a JDOM

Document

object (

) upon which an encoding can be set, and the

Document

object can then be outputted to XML, using JDOM's

. This is actually what ROME does behind the scenes, save for the encoding bit.
The hack goes something along these lines:

/* Generate feed using ROME API prior to this */
SyndFeedOutput output = new SyndFeedOutput();
Document doc = output.outputJDom(feed);
String encoding = feed.getEncoding();
Format format = Format.getPrettyFormat();
format.setEncoding(encoding);
XMLOutputter outputter = new XMLOutputter(format);
outputter.output(doc, writer);

Finally, I decided to subscribe to the services offered by statcounter.com:

Got a website? Get a StatCounter! A free yet reliable invisible web tracker, highly configurable hit counter and real-time detailed web stats. Insert a simple piece of our code on your web page and you will be able to analyse and monitor all the visitors to your website in real-time!

It took me approx. five minutes to register, set up a project for this application and copy-paste the necessary bits of code into my pages. So far, it has been most informative.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Related Posts:

Leave a Reply

Quicktags: