I agree that it would make sense to have the entry anchor creation process be pluggable since in various environments there are reasons for it to be different. I think it just hasn't happened yet because nobody has really cared about it enough to spend time on it.

Your hack is the right thing to do and if you want to round it out a bit and submit it as a patch we can look at incorporating it into Roller.

-- Allen


Sam Neth wrote:
I want to describe the one customization I have applied to Roller, and ask if there's a better way to accomplish it, either in 3.1 or 4.0.

The "anchor" generated for blog posts (which appears in the url) is not to my liking. I don't want extra words stripped out, I want dashes rather than underscores (widely regarded as preferable for Google SEO), and I'd like to apply some special rules (e.g. replace ampersand with the word 'and'). Basically I want better-looking URLs.

To accomplish this, I modified org.apache.roller.pojos.WeblogEntryData.createAnchorBase to do things my way, and patched roller-business.jar. It's an embarassing hack. I think I tried using a patch jar and ran into classloader security problems, but it's been a little while. I think maybe I could fix that if I put my patch jar in a dark place it doesn't belong.

Anyway, in an ideal world I'd like to compile a single subclass against the Roller jars, run a patch jar over the release build, and make a single configuration change to tell Roller to use my new class. Scratch that. In an ideal world I'd like something as arbitrary as createAnchorBase to be explicitly implemented as a customization point.
Any thoughts?

Reply via email to