roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guy Katz" <gk...@allot.com>
Subject RE: Proper way to make custom modules available in themes?
Date Tue, 16 Oct 2007 11:39:29 GMT
Also;
What method should I invoke on the cache manager for maximum
performance?
Must I invalidate everything? (there are many methods for invalidation
of folders, users, comments, etc...) I just want to invalidate enough to
have my model displayed properly.
Thanks in advance.

-----Original Message-----
From: Dave [mailto:snoopdave@gmail.com] 
Sent: Tuesday, October 16, 2007 4:05 AM
To: user@roller.apache.org
Subject: Re: Proper way to make custom modules available in themes?

On 10/12/07, Fredrik Jonson <fredrik@myrealbox.com> wrote:
> I need to add a small homegrown module for custom user polls to
roller,
> so that it is available in the velocity templates of my themes. I've
> looked  around but haven't found any hint on how to achieve that.
>
> I guess I could write and add a servlet filter that instantiates my
> object and publishes it in the user's session. But I'm hoping there is
> a better, ie more proper way?
>
> I'm developing on the roller 4.0 release candidate, btw.

Hi Fredrik,

To make your own object available in Roller scripts here's what you do:

1) Have your object implement the Roller interface "PageModel"

2) In your roller-custom.properties file, override these properties.
For each, you'll have to replicate the original list of classnames
*and* add your new model.
   rendering.siteModels=
   rendering.pageModels=
   rendering.searchModels=
   rendering.previewModels=

If you just want your object to be available in the aggregated
front-page blog and nowhere else, then add it only to the
rendering.siteModels property.

There is an example model plugin at the following link, but it has not
bee updated for the Roller 4.0 classnames: http://tinyurl.com/3bx8q6

- Dave

Mime
View raw message