Thanks Dave - I found an easier solution, rather than creating plugins,
For anyone doing anything similar where templates are pulled from the
file system, rather than a specific roller theme. Then a resource loader
of type file (FileResourceLoader) can be created in the
velocity.properties file in addition to the
RollerResourceLoader,WebappResourceLoader and ClasspathResourceLoader .
As below:
resource.loader = file
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = c:/roller/templates
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = 2
then to display the template -> #parse("templateName.vm")
see the following link ->
http://www.javaranch.com/journal/2004/03/Velocity-AnIntroduction.html
Regards, Colm
-----Original Message-----
From: Dave [mailto:[EMAIL PROTECTED]
Sent: 26 August 2008 14:03
To: [email protected]
Subject: Re: using templates which are not in the roller database but on
the file system
On Wed, Aug 20, 2008 at 12:02 PM, Mullan Colm
<[EMAIL PROTECTED]> wrote:
> Can you tell me where in the java source code, the #includeTemplate
> function on the weblog.vm calls.
The includeTemplate macro looks like this:
#macro(includeTemplate $weblog $pageName)
#set($pageArg = false)## This is required for such constructs; see
Velocity docs and ROL-689
#set($pageArg = $weblog.getPageByName($pageName))
#if ($pageArg)
#parse($pageArg.id)
#end
#end
The $weblog object is of type org.apache.roller.weblogger.pojos.Weblog.
Here's some discussion of how to create a page model object for use in
Roller page templates:
http://markmail.org/message/jdrk5jw4tg2ynkdp
- Dave
>
> Thanks Colm
>
> -----Original Message-----
> From: Mullan Colm
> Sent: 20 August 2008 14:42
> To: [email protected]
> Subject: RE: using templates which are not in the roller database but
on
> the file system
>
> Hi Dave,
> Thanks for the reply.
>
> Could you send an example of a page Model plug-in for starters?
>
> I would like Roller to pull the styles, images, header and footer
files
> from a directory. I was wondering if these files could be placed in
the
> upload directory, or would the plugin approach be best. I notice there
> is a max size of files to be uploaded currently set to 4 mb, I would
> have to increase this value, plus the fact that it doesn't allow
nested
> directories in the upload.dirs. Can we set more that one upload
> directory?
>
> I think the plug-in approach would best suit me. I would greatly
> appreciate if you could send me on a few page model plug-in examples.
> (or a URL to them)
>
> Many Thanks Colm
>
> -----Original Message-----
> From: Dave [mailto:[EMAIL PROTECTED]
> Sent: 20 August 2008 14:14
> To: [email protected]
> Subject: Re: using templates which are not in the roller database but
on
> the file system
>
> On Tue, Aug 19, 2008 at 7:10 AM, Mullan Colm
> <[EMAIL PROTECTED]> wrote:
>> I am working on customising roller to be the same style as a website
> and
>> when the web styles change the styles for Roller will change also.
>>
>> Is it possible in Roller to include templates from a file source,
> rather
>> than from Roller database.
>>
>> Instead of #includeTemplate($model.weblog "_header") where _header is
> in the
>> roller database.
>>
>> I would like to include the following file from the file system i.e.
>> \\company-san\inetpub\active\_includes\header.htm
>
> None of the Roller macros or page model objects support that.
>
> If you've got some Java dev expertise, you could write a Page Model
> plugin to do it.
>
> - Dave
>