How to Start a Software Company 2.0

by Richard Rodger

       
 
Roller's Ugly Permalinks

I'm using Roller 1.2 for this blog at the moment. Roller 2.0 is out, but I'm in the middle of a beta-testing a new product so I'm not going to risk upgrading for a few weeks yet, in case I end up yak shaving.

I'm pretty happy with Roller. It's a great piece of code and it's been really easy to customise. I run it because I was already running tomcat, and it's just easier to keep everything Java focused if you can. (more on that later - there's a big deficiency in the webmail area with Java).

So anyway, the one thing that was really annoying me was the permalinks. The standard form is:

http://www.richardrodger.com/roller/page/richard?entry=foobar

Yuck. Not only does it look ugly, but the entry is only identified in the query parameters and is thus not analysed properly in most web stats packages (including google analytics, which I was lucky enough to get an account on). This makes it hard to tell which entries are getting the most hits etc. Also, the permalink is not search-engine friendly.

So time to put the hacking hat on. After scanning through the Velocity templates in the Roller distribution I was none the wiser. But then I decided to bite the bullet and hack the code. In the end it was pretty easy to change the permalink code. First, links of the form

http://www.richardrodger.com/roller/page/richard/Weblog/foobar

are supported (why are they not standard? dunno.), so this was my target. After a bit of global searching, I discovered the getPermaLink method in org.roller.pojos.WeblogEntryData. Replace the line:

String plink = "/page/" + website.getUser().getUserName() + "?entry=" + lAnchor;

with

String plink = "/page/" + website.getUser().getUserName() + "/Weblog/" + lAnchor;

And now the permalinks are just right. By the way, the easiest way to make this kind of quick change is to download the source and tools distributions, unpack them, and run build.sh all. It all "just works". Great stuff.

Of course, as you may have noticed, mucking with your feeds is not a good idea. If you change the permalink then all the old entries get replicated, because the aggregators think they are all new. So make this change before you go live.

@ 08:39 PM GMT+00:00 [ comments [0] ]   email this   links to this

If you liked this entry, please consider bookmarking it &mdash Thanks!
Bookmark Roller's Ugly Permalinks at del.icio.us Digg Roller's Ugly Permalinks at Digg.com Bookmark Roller's Ugly Permalinks at reddit.com Bookmark Roller's Ugly Permalinks at YahooMyWeb Bookmark Roller's Ugly Permalinks at Spurl.net Bookmark Roller's Ugly Permalinks at Simpy.com Bookmark Polyphasic Mutants at NewsVine Blink this Roller's Ugly Permalinks at blinklist.com Bookmark Roller's Ugly Permalinks at Furl.net Fark Roller's Ugly Permalinks at Fark.com

 
 
Trackback URL: http://old.richardrodger.com/roller/trackback/richard/Weblog/roller_s_ugly_permalinks
Comments:

Comments for this have been disabled. Please send me a mail if you want to comment and I will activate comments again.
 
YahooBloglines
NewsgatorMSN
Google Readerdel.icio.us FurlSubscribe with myFeedster
« December 2005 »
SunMonTueWedThuFriSat
    
3
5
10
11
13
17
18
24
25
26
27
28
29
30
31
       
Today

All | General | Java | Business | Fun | Perl | Rant | Ireland | Web
[This is a Roller site]
[Valid Atom 1.0] [Valid RSS]
Technology Blog Top Sites
Blogarama - The Blogs Directory

Blog Directory & Search engine

Blog Flux Directory
Irish Blogs
 View My Public Stats on MyBlogLog.com

Performancing
Enter your Email


Powered by FeedBlitz
Theme adapted from Sotto.
 
Ricebridge XML Manager
  • Convert XML to a table of data
  • Convert XML to CSV, and CSV to XML
  • High-speed, single-pass XPath
  • Memory-stable and fault-tolerant
  • Loads of documentation
  • Cut-and-paste code examples
  • Find a bug, get a gift cert
Ricebridge Java XML Manager Component


Ricebridge CSV Manager
  • Convert CSV to a table of data
  • Handle any type of delimited file
  • Memory-stable and fault-tolerant
  • Loads of documentation
  • Cut-and-paste code examples
  • Find a bug, get a gift cert
Ricebridge Java CSV Manager Component


Popular Posts

 Sign up for MyBlogLog.com
Alertra Website Monitoring Service
Get Chitika eMiniMalls
Solo Tees
BlogJet