You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by David Wynter <da...@roamware.co.uk> on 2003/07/17 19:24:46 UTC

Path to find vm templates in T2.3

I have 2 macro templates in <T2.3_project>/templates/app. It cannot find
either as I get the keyword from my Default.vm ( #TurbineHTMLHead() ) and my
macro names appearing on screen. The 2 macro templates are the supplied
TurbineMacros.vm and my own GlobalMacros.vm.

In the Wiki on VelocityOnlyLayout it gives the following advice.

....
You can uses some Turbine supplied macros if you configure the
ClassPathLoader? in your TR.props. These Macros are in a file called
TurbineMacros?.vm which is part of the Turbine Jar itself.
....

I am not sure what settings are required for ClassPathLoader and it is not
covered by any documentation nor in the archives.

My TR.props config has this:

....
services.VelocityService.runtime.log=/logs/velocity.log
services.VelocityService.velocimacro.library = GlobalMacros.vm

services.VelocityService.resource.loader = file
services.VelocityService.file.resource.loader.description = Velocity File
Resource Loader
services.VelocityService.file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
services.VelocityService.file.resource.loader.path = /templates/app
services.VelocityService.file.resource.loader.cache = false
services.VelocityService.file.resource.loader.modificationCheckInterval = 2

services.VelocityService.resource.loader = classpath
services.VelocityService.classpath.resource.loader.description = Velocity
Classpath Resource Loader
services.VelocityService.classpath.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
....

Any ideas?

Regards

David Wynter


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Path to find vm templates in T2.3Turbine Users List

Posted by David Wynter <da...@roamware.co.uk>.
I'll add it to the Wiki, it is not clearly explained anywhere I could find.

Thanks

David

> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de]
> Sent: 18 July 2003 10:19
> To: turbine-user@jakarta.apache.org
> Subject: Re: Path to find vm templates in T2.3
>
>
> "David Wynter" <da...@roamware.co.uk> writes:
>
> >Hi,
>
> >I 'fixed' this by taking the macro items in TurbineMacrcos.vm and putting
> >them in GlobalMacros.vm. It finds the GlobalMacros.vm macro file
> but not the
>
> This is one way to do it.
>
> >TurbineMacros.vm file despite them being in the same directory. Since the
> >line "services.VelocityService.file.resource.loader.path = /templates" is
> >correct I assume it only uses this as a path to get to he screen, layouts
> >and navigation paths?
>
> Simply add a second line:
>
> services.VelocityService.velocimacro.library = macros/TurbineMacros.vm
>
> to your TR.props and you should be all set. Is this not in the Wiki?
>
> Velocity will try to load the "macros/TurbineMacros.vm" from the class
> path loader.
>
> % jar tvf target/turbine-2.3-dev.jar | grep -i macros
>      0 Fri Jul 18 10:42:06 MEST 2003 macros/
>   4293 Fri Jul 18 10:42:06 MEST 2003 macros/TurbineMacros.vm
>
> and here it is. :-)
>
> Multiple velocimacro.library settings are additional, e.g. I have in my
> application:
>
> --- cut ---
> #
> # Class Path Loader, Turbine jar
> services.VelocityService.velocimacro.library = macros/TurbineMacros.vm
> #
> # Class Path Loader, Toolbox jar
> services.VelocityService.velocimacro.library = macros/IntakeMacros.vm
> #
> # Class Path Loader, Toolbox.jar
> services.VelocityService.velocimacro.library = macros/GridMacros.vm
> #
> # File Loader
> services.VelocityService.velocimacro.library = macros/DisplayMacros.vm
>
> services.VelocityService.resource.loader = file
> services.VelocityService.file.resource.loader.description =
> Velocity File Resource Loader
> services.VelocityService.file.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> services.VelocityService.file.resource.loader.path = /templates
> services.VelocityService.file.resource.loader.cache = false
> services.VelocityService.file.resource.loader.modificationCheckInt
> erval = 2
>
> services.VelocityService.resource.loader = classpath
> services.VelocityService.classpath.resource.loader.description =
> Velocity Classpath Resource Loader
> services.VelocityService.classpath.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> --- cut ---
>
> 	Regards
> 		Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
>
> Java, perl, Solaris, Linux, xSP Consulting, Web Services
> freelance consultant -- Jakarta Turbine Development  -- hero for hire
>
> --- Quote of the week: "It is pointless to tell people anything when
> you know that they won't process the message." --- Jonathan Revusky
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Path to find vm templates in T2.3

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"David Wynter" <da...@roamware.co.uk> writes:

>Hi,

>I 'fixed' this by taking the macro items in TurbineMacrcos.vm and putting
>them in GlobalMacros.vm. It finds the GlobalMacros.vm macro file but not the

This is one way to do it.

>TurbineMacros.vm file despite them being in the same directory. Since the
>line "services.VelocityService.file.resource.loader.path = /templates" is
>correct I assume it only uses this as a path to get to he screen, layouts
>and navigation paths?

Simply add a second line:

services.VelocityService.velocimacro.library = macros/TurbineMacros.vm

to your TR.props and you should be all set. Is this not in the Wiki?

Velocity will try to load the "macros/TurbineMacros.vm" from the class
path loader.

% jar tvf target/turbine-2.3-dev.jar | grep -i macros
     0 Fri Jul 18 10:42:06 MEST 2003 macros/
  4293 Fri Jul 18 10:42:06 MEST 2003 macros/TurbineMacros.vm

and here it is. :-)

Multiple velocimacro.library settings are additional, e.g. I have in my
application:

--- cut ---
#
# Class Path Loader, Turbine jar
services.VelocityService.velocimacro.library = macros/TurbineMacros.vm
#
# Class Path Loader, Toolbox jar
services.VelocityService.velocimacro.library = macros/IntakeMacros.vm
#
# Class Path Loader, Toolbox.jar
services.VelocityService.velocimacro.library = macros/GridMacros.vm
#
# File Loader
services.VelocityService.velocimacro.library = macros/DisplayMacros.vm

services.VelocityService.resource.loader = file
services.VelocityService.file.resource.loader.description = Velocity File Resource Loader
services.VelocityService.file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader
services.VelocityService.file.resource.loader.path = /templates
services.VelocityService.file.resource.loader.cache = false
services.VelocityService.file.resource.loader.modificationCheckInterval = 2

services.VelocityService.resource.loader = classpath
services.VelocityService.classpath.resource.loader.description = Velocity Classpath Resource Loader
services.VelocityService.classpath.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
--- cut ---

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

--- Quote of the week: "It is pointless to tell people anything when
you know that they won't process the message." --- Jonathan Revusky

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Path to find vm templates in T2.3

Posted by David Wynter <da...@roamware.co.uk>.
Hi,

I 'fixed' this by taking the macro items in TurbineMacrcos.vm and putting
them in GlobalMacros.vm. It finds the GlobalMacros.vm macro file but not the
TurbineMacros.vm file despite them being in the same directory. Since the
line "services.VelocityService.file.resource.loader.path = /templates" is
correct I assume it only uses this as a path to get to he screen, layouts
and navigation paths?

The GlobalMacros.vm loads due to this line in TR.props I assume

services.VelocityService.velocimacro.library = GlobalMacros.vm

I went to the Velocity developer guide and from whatI see there I'd say that
if I jar'ed the TurbineMacros.vm and put it in WEB-INF/lib then it would be
found by the ClassPathLoader.

Hope this helps others sorting this out.

David

> -----Original Message-----
> From: David Wynter [mailto:david@roamware.co.uk]
> Sent: 17 July 2003 18:25
> To: Turbine-User
> Subject: Path to find vm templates in T2.3
>
>
> I have 2 macro templates in <T2.3_project>/templates/app. It cannot find
> either as I get the keyword from my Default.vm (
> #TurbineHTMLHead() ) and my
> macro names appearing on screen. The 2 macro templates are the supplied
> TurbineMacros.vm and my own GlobalMacros.vm.
>
> In the Wiki on VelocityOnlyLayout it gives the following advice.
>
> ....
> You can uses some Turbine supplied macros if you configure the
> ClassPathLoader? in your TR.props. These Macros are in a file called
> TurbineMacros?.vm which is part of the Turbine Jar itself.
> ....
>
> I am not sure what settings are required for ClassPathLoader and it is not
> covered by any documentation nor in the archives.
>
> My TR.props config has this:
>
> ....
> services.VelocityService.runtime.log=/logs/velocity.log
> services.VelocityService.velocimacro.library = GlobalMacros.vm
>
> services.VelocityService.resource.loader = file
> services.VelocityService.file.resource.loader.description = Velocity File
> Resource Loader
> services.VelocityService.file.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> services.VelocityService.file.resource.loader.path = /templates/app
> services.VelocityService.file.resource.loader.cache = false
> services.VelocityService.file.resource.loader.modificationCheckInt
> erval = 2
>
> services.VelocityService.resource.loader = classpath
> services.VelocityService.classpath.resource.loader.description = Velocity
> Classpath Resource Loader
> services.VelocityService.classpath.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> ....
>
> Any ideas?
>
> Regards
>
> David Wynter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org