You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Scott Eade <se...@backstagetech.com.au> on 2002/02/18 12:55:20 UTC

Loading Velocity templates with ClasspathResourceLoader

The default TR.props in tdk 2.1 includes the configuration of a
ClasspathResourceLoader for loading Velocity templates from a jar file in
WEB-INF/lib.

I've been trying to make this work with Turbine but the starting directory
to include in the jar file is not obvious and I have unfortunately been
unable to get it to work so far (I have tried the templates directory and
the screens directory).

Has anyone managed to get this working?

Thanks,

Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Loading Velocity templates with ClasspathResourceLoader

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Scott Eade <se...@backstagetech.com.au> writes:

>> From: Daniel Rall <dl...@finemaltcoding.com>
>> Hey Scott.  I'm using an extension to Veocity's
>> ClasspathResourceLoader in Eyebrowse <http://eyebrowse.tigris.org/>.
>> Not directly applicable, but might be of help to see a working
>> example.  Tigris has CVSWeb, so you can browse the source online if
>> you like.
>
> Thanks Dan.  Eyebrowse uses Velocity without Turbine.  I think the use of
> ClasspathResourceLoader (or the extension used in Eyebrowse) with straight
> Velocity is tried and tested.  Turbine however has the added complication of
> the directory structure (email, layouts, navigations, screens) that I am not
> certain is dealt with anywhere.
>
> Given the lack of response am I to assume that nobody is using the default
> ClasspathResourceLoader that is configured in TurbineResources.properties?

TurbineVelocityService feeds configuration parameters directly to the
Velocity engine.  If you've gotten the Velocity configuration right,
it's probably Turbine's handling of
layouts/navigations/screens/etc. that you'll want to scrutinize the
inner workings of.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: HELP...Comiling Class Files In Turbine

Posted by Todd Burian <tb...@interactapps.com>.
Ok. thanks

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: Wednesday, February 20, 2002 2:53 PM
To: turbine-user
Subject: Re: HELP...Comiling Class Files In Turbine


> From: "Todd Burian" <tb...@interactapps.com>
>
> Yes I got newapp working, I think I have a velocity config issue? Since
> newapp worked I am assuming that Velocity HAS to be working correctly, is
> this the case?

I don't think Velocity is your problem.  You are getting compile time errors
because javac cannot find one or more if the jar files it needs.

It is well worth studying the ant files build.xml and build properties and
making the necessary changes so that you can use ant to do the compile.

Scott



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: HELP...Comiling Class Files In Turbine

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: "Todd Burian" <tb...@interactapps.com>
> 
> Yes I got newapp working, I think I have a velocity config issue? Since
> newapp worked I am assuming that Velocity HAS to be working correctly, is
> this the case?

I don't think Velocity is your problem.  You are getting compile time errors
because javac cannot find one or more if the jar files it needs.

It is well worth studying the ant files build.xml and build properties and
making the necessary changes so that you can use ant to do the compile.

Scott



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: HELP...Comiling Class Files In Turbine

Posted by Todd Burian <tb...@interactapps.com>.
Yes I got newapp working, I think I have a velocity config issue? Since
newapp worked I am assuming that Velocity HAS to be working correctly, is
this the case?

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: Wednesday, February 20, 2002 2:31 PM
To: turbine-user
Subject: Re: HELP...Comiling Class Files In Turbine


Todd,

It does look like a classpath problem.  Did you get the stock standard
newapp running correctly before you moved on to HelloWorld?

You may have better luck using Ant for your compiles as this will manage the
classpath for you (assuming you configure it correctly).

If you managed to get newapp working then you need to look carefully at
anything you have subsequently changed.

HTH,

Scott

> From: "Todd Burian" <tb...@interactapps.com>
>
> I am trying to write my first template, when I try to compile
> HelloWorld.java I am receiving the following:
> C:\tdk\webapps\newapp\WEB-INF\classes>javac HelloWorld.java
> HelloWorld.java:5: cannot resolve symbol
> symbol  : class RunData
> location: package util
> import org.apache.turbine.util.RunData;
>                              ^
> HelloWorld.java:6: cannot resolve symbol
> symbol  : class VelocityScreen
> location: package screens
> import org.apache.turbine.modules.screens.VelocityScreen;
>                                         ^
> HelloWorld.java:8: cannot resolve symbol
> symbol  : class VelocityScreen
> location: class HelloWorld
> public class HelloWorld extends VelocityScreen
>                               ^
> HelloWorld.java:10: cannot resolve symbol
> symbol  : class RunData
> location: class HelloWorld
>   public void doBuildTemplate( RunData data, Context context )
>                                ^
> 4 errors
>
> I have set CLASSPATH etc
> Thanks,
> Todd


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: HELP...Comiling Class Files In Turbine

Posted by Scott Eade <se...@backstagetech.com.au>.
Todd,

It does look like a classpath problem.  Did you get the stock standard
newapp running correctly before you moved on to HelloWorld?

You may have better luck using Ant for your compiles as this will manage the
classpath for you (assuming you configure it correctly).

If you managed to get newapp working then you need to look carefully at
anything you have subsequently changed.

HTH,

Scott

> From: "Todd Burian" <tb...@interactapps.com>
> 
> I am trying to write my first template, when I try to compile
> HelloWorld.java I am receiving the following:
> C:\tdk\webapps\newapp\WEB-INF\classes>javac HelloWorld.java
> HelloWorld.java:5: cannot resolve symbol
> symbol  : class RunData
> location: package util
> import org.apache.turbine.util.RunData;
>                              ^
> HelloWorld.java:6: cannot resolve symbol
> symbol  : class VelocityScreen
> location: package screens
> import org.apache.turbine.modules.screens.VelocityScreen;
>                                         ^
> HelloWorld.java:8: cannot resolve symbol
> symbol  : class VelocityScreen
> location: class HelloWorld
> public class HelloWorld extends VelocityScreen
>                               ^
> HelloWorld.java:10: cannot resolve symbol
> symbol  : class RunData
> location: class HelloWorld
>   public void doBuildTemplate( RunData data, Context context )
>                                ^
> 4 errors
> 
> I have set CLASSPATH etc
> Thanks,
> Todd


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


HELP...Comiling Class Files In Turbine

Posted by Todd Burian <tb...@interactapps.com>.
I am trying to write my first template, when I try to compile
HelloWorld.java I am receiving the following:
C:\tdk\webapps\newapp\WEB-INF\classes>javac HelloWorld.java
HelloWorld.java:5: cannot resolve symbol
symbol  : class RunData
location: package util
import org.apache.turbine.util.RunData;
                               ^
HelloWorld.java:6: cannot resolve symbol
symbol  : class VelocityScreen
location: package screens
import org.apache.turbine.modules.screens.VelocityScreen;
                                          ^
HelloWorld.java:8: cannot resolve symbol
symbol  : class VelocityScreen
location: class HelloWorld
public class HelloWorld extends VelocityScreen
                                ^
HelloWorld.java:10: cannot resolve symbol
symbol  : class RunData
location: class HelloWorld
    public void doBuildTemplate( RunData data, Context context )
                                 ^
4 errors

I have set CLASSPATH etc
Thanks,
Todd

-----Original Message-----
From: Andy Pols [mailto:apols@softpurchase.com]
Sent: Wednesday, February 20, 2002 5:58 AM
To: Turbine Users List
Subject: RE: Loading Velocity templates with ClasspathResourceLoader


Scott,

<<Given the lack of response am I to assume that nobody is using the default
ClasspathResourceLoader that is configured in TurbineResources.properties?>>

We've got it working ok with Turbine.  The base dir is the template source
dir - but you said you tried this, so I guess you have something else wrong.

We had to put the template.jar file in the server's lib dir as it did not
work
in the webapp's lib dir (probably bad config on out part :().  Could this be
your problem?

Cheers
Andy

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: 20 February 2002 10:17
To: turbine-user
Subject: Re: Loading Velocity templates with ClasspathResourceLoader


> From: Daniel Rall <dl...@finemaltcoding.com>
>> Scott Eade <se...@backstagetech.com.au> writes:
>> The default TR.props in tdk 2.1 includes the configuration of a
>> ClasspathResourceLoader for loading Velocity templates from a jar file in
>> WEB-INF/lib.
>>
>> I've been trying to make this work with Turbine but the starting
directory
>> to include in the jar file is not obvious and I have unfortunately been
>> unable to get it to work so far (I have tried the templates directory and
>> the screens directory).
>>
>> Has anyone managed to get this working?
>
> Hey Scott.  I'm using an extension to Veocity's
> ClasspathResourceLoader in Eyebrowse <http://eyebrowse.tigris.org/>.
Sco> Not directly applicable, but might be of help to see a working
> example.  Tigris has CVSWeb, so you can browse the source online if
> you like.
>
> Dan

Thanks Dan.  Eyebrowse uses Velocity without Turbine.  I think the use of
ClasspathResourceLoader (or the extension used in Eyebrowse) with straight
Velocity is tried and tested.  Turbine however has the added complication of
the directory structure (email, layouts, navigations, screens) that I am not
certain is dealt with anywhere.

Given the lack of response am I to assume that nobody is using the default
ClasspathResourceLoader that is configured in TurbineResources.properties?

Cheers,

Scott


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Loading Velocity templates with ClasspathResourceLoader

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: "Andy Pols" <ap...@softpurchase.com>
> 
> Scott,
> 
>> Given the lack of response am I to assume that nobody is using the default
>> ClasspathResourceLoader that is configured in TurbineResources.properties?
> 
> We've got it working ok with Turbine.  The base dir is the template source dir
> - but you said you tried this, so I guess you have something else wrong.

Does this mean that if I "jar -tf template.jar" I will see
"app/screens/Login.vm" or "templates/app/screens/Login.vm"?

> We had to put the template.jar file in the server's lib dir as it did not work
> in the webapp's lib dir (probably bad config on out part :().  Could this be
> your problem?

I'll give this a shot, but I won't be able to do this for the hosted
application.

> Cheers Andy
> 

Thanks for the reply Andy.

Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Loading Velocity templates with ClasspathResourceLoader

Posted by Andy Pols <ap...@softpurchase.com>.
Scott,

<<Given the lack of response am I to assume that nobody is using the default
ClasspathResourceLoader that is configured in TurbineResources.properties?>>

We've got it working ok with Turbine.  The base dir is the template source
dir - but you said you tried this, so I guess you have something else wrong.

We had to put the template.jar file in the server's lib dir as it did not
work
in the webapp's lib dir (probably bad config on out part :().  Could this be
your problem?

Cheers
Andy

-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: 20 February 2002 10:17
To: turbine-user
Subject: Re: Loading Velocity templates with ClasspathResourceLoader


> From: Daniel Rall <dl...@finemaltcoding.com>
>> Scott Eade <se...@backstagetech.com.au> writes:
>> The default TR.props in tdk 2.1 includes the configuration of a
>> ClasspathResourceLoader for loading Velocity templates from a jar file in
>> WEB-INF/lib.
>>
>> I've been trying to make this work with Turbine but the starting
directory
>> to include in the jar file is not obvious and I have unfortunately been
>> unable to get it to work so far (I have tried the templates directory and
>> the screens directory).
>>
>> Has anyone managed to get this working?
>
> Hey Scott.  I'm using an extension to Veocity's
> ClasspathResourceLoader in Eyebrowse <http://eyebrowse.tigris.org/>.
Sco> Not directly applicable, but might be of help to see a working
> example.  Tigris has CVSWeb, so you can browse the source online if
> you like.
>
> Dan

Thanks Dan.  Eyebrowse uses Velocity without Turbine.  I think the use of
ClasspathResourceLoader (or the extension used in Eyebrowse) with straight
Velocity is tried and tested.  Turbine however has the added complication of
the directory structure (email, layouts, navigations, screens) that I am not
certain is dealt with anywhere.

Given the lack of response am I to assume that nobody is using the default
ClasspathResourceLoader that is configured in TurbineResources.properties?

Cheers,

Scott


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Loading Velocity templates with ClasspathResourceLoader

Posted by Scott Eade <se...@backstagetech.com.au>.
> From: Daniel Rall <dl...@finemaltcoding.com>
>> Scott Eade <se...@backstagetech.com.au> writes:
>> The default TR.props in tdk 2.1 includes the configuration of a
>> ClasspathResourceLoader for loading Velocity templates from a jar file in
>> WEB-INF/lib.
>> 
>> I've been trying to make this work with Turbine but the starting directory
>> to include in the jar file is not obvious and I have unfortunately been
>> unable to get it to work so far (I have tried the templates directory and
>> the screens directory).
>> 
>> Has anyone managed to get this working?
> 
> Hey Scott.  I'm using an extension to Veocity's
> ClasspathResourceLoader in Eyebrowse <http://eyebrowse.tigris.org/>.
> Not directly applicable, but might be of help to see a working
> example.  Tigris has CVSWeb, so you can browse the source online if
> you like.
> 
> Dan

Thanks Dan.  Eyebrowse uses Velocity without Turbine.  I think the use of
ClasspathResourceLoader (or the extension used in Eyebrowse) with straight
Velocity is tried and tested.  Turbine however has the added complication of
the directory structure (email, layouts, navigations, screens) that I am not
certain is dealt with anywhere.

Given the lack of response am I to assume that nobody is using the default
ClasspathResourceLoader that is configured in TurbineResources.properties?

Cheers,

Scott


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Loading Velocity templates with ClasspathResourceLoader

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Scott Eade <se...@backstagetech.com.au> writes:

> The default TR.props in tdk 2.1 includes the configuration of a
> ClasspathResourceLoader for loading Velocity templates from a jar file in
> WEB-INF/lib.
>
> I've been trying to make this work with Turbine but the starting directory
> to include in the jar file is not obvious and I have unfortunately been
> unable to get it to work so far (I have tried the templates directory and
> the screens directory).
>
> Has anyone managed to get this working?

Hey Scott.  I'm using an extension to Veocity's
ClasspathResourceLoader in Eyebrowse <http://eyebrowse.tigris.org/>.
Not directly applicable, but might be of help to see a working
example.  Tigris has CVSWeb, so you can browse the source online if
you like.

Dan


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>