You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Sam Neth <sa...@neth.com> on 2007/06/22 22:00:20 UTC

Question About Post Anchors

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?

Re: Question About Post Anchors

Posted by Allen Gilliland <al...@sun.com>.
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?

Re: Question About Post Anchors

Posted by Anil Gangolli <an...@busybuddha.org>.
 

If you are using Tomcat and an exploded WAR deployment, you can try
this:  I believe Tomcat will choose classes from the WEB-INF/classes
subdir before it picks one from a jar in WEB-INF/lib.  Put your
replacement .class file in a subdir of WEB-INF/classes corresponding to
the package.

I'm not sure if even closer to the ideal world this would have been one
of the functions which we would have anticipated the need to be
replaceable and would have thought to define an interface and injection
point for.

--a.

On Fri, 2007-06-22 at 13:00 -0700, 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?