On Dec 21, 2005, at 9:52 PM, M. Purbo wrote:
I'm trying to make roller to display all weblog entries in a usual
paginated page, e.g. like google search result. Something like:
...
2. if i do have to customize the source code, is the following steps are
the right way to go (in general):

2.1. extends/customize PageModel
2.2. extends/customize BasePageServlet
2.3. create my own vm library (e.g. with macros for nextPage, prevPage,
etc.) that calls the customized PageModel
2.4. create a theme using this vm library

That looks correct.


3. is it a wise thing to do at all (to customize roller). or is it safer
just to make a seperate web-app/action that would read directly from
roller database, and display it using JSP, for example.

I think you'll want to customize Roller. Where possible, you should
keep your code separate from Roller.

For example, put your source code in:
    sandbox/pagination/src

And then tell Roller's build to compile it by adding this to custom/custom-src-web.xmlf:
    <src dir="${basedir}/sandbox/pagination/src" />

And put your web files (e.g. velocity scripts) in a web dir structure under:
    sandbox/pagination/web

And then tell Roller's build to included it by adding this to custom/custom-web.xmlf:

   <copy todir="${build.stage_web}" overwrite="true">
      <fileset dir="${basedir}/sandbox/pagination/web">
         <include name="**/**" />
      </fileset>
   </copy>

If you extend PageModel, tell Roller to use your new one by setting the property:
   velocity.pagemodel.classname=


Hope that helps.

If you'd like to contribute this work to Roller: the custom for larger changes (like this one) is to write a short proposal on the wiki, then submit a patch
for our review.

- Dave

Reply via email to