You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Κώστας Στεργίου <cs...@aias.gr> on 2001/03/22 16:53:22 UTC

TurbineVelocityServive.init() method missing initialization params.

Hi,
I noticed that the TurbineVelocityService is only setting
two properties:
            Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
            Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);

and then calls the init method. 
All the velocity properties in the velocity.properties file are not passed in Velocity
engine. Also, the line:
            Velocity.setProperty(Velocity.TEMPLATE_ENCODING, encoding);

is not correct since one cannot use a different encoding (which is a valid property
within velocity.properties file - template.encoding -).

The code (init() method) could be modified:

            Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
            Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);

            Properties vProps = new Properties();
            vProps.load(new java.io.FileInputStream(vProperties));
            java.util.Enumeration enum = vProps.keys();
            while (enum.hasMoreElements()) {
              String key = (String) enum.nextElement();
              Velocity.setProperty(key, vProps.get(key));
            }

            Velocity.init();

And of course remove the 

            Velocity.setProperty(Velocity.TEMPLATE_ENCODING, encoding);

line.

Thanks,
Costas


Re: TurbineVelocityServive.init() method missing initialization params.

Posted by ??sta? Ste????? <cs...@aias.gr>.
ok, I will be waiting for the tdk1.12 release to see if my problems
are solved there...
To be honest, I have spent the whole day migrating my application
(turbine+velocity) to the new turbine+velocity 1.0b.

I hope it is worth it :)
Thanks for your help,
Costas

----- Original Message -----
From: "Jason van Zyl" <jv...@apache.org>
To: <tu...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 6:42 PM
Subject: Re: TurbineVelocityServive.init() method missing initialization
params.


> ??sta? Ste????? wrote:
> >
> > Since I have spent the last 2 hours trying to find out why I can't get
my
> > app to work with my encoding (8859_7), where the tdk1.11+velocity0.71
> > was working just fine, can you please explain that a bit?
>
> The velocity service is changing: all the properties for the velocity
> service will be contained within TR.props. So the velocity service
> will conform to the way the rest of the turbine services are configured.
>
> I'm sorry this change bit you, but I'm in the middle of changing
> the code up in the template services. It was my mistake that the
> encoding bit was removed. I will put that back in tonight when
> I'm making the TDK.
>
> The configuration mechanism has stablized in velocity and so
> soon will the velocity configuration in Turbine. I would suggest
> sticking with the TDK. Sorry you spend two hours trying to figure
> out what the problem was.
>
> > What exactly is the problem with velocity + turbine + encoding?
> > What do you mean by:
> > > Turbine also needs to have a stated output encoding, and this
> > > will be passed along to velocity. There is currently no output
> > > encoding property but this will be added soon.
>
> Yes, you are right in that there is a locale.default.charset. The
> TR.props files for the two apps I work on most of the time were
> missing it so I didn't see it.
>
> But yes, the value for locale.default.charset in the TR.props
> should get passed on to velocity. This will be in soon.
>
> > The locale.default.charset=8859_7 is not enough? (it worked
> > previously).
> > Can you give me some hint here?
> > Thanks
>
> --
> jvz.
>
> Jason van Zyl
> jvanzyl@periapt.com
>
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/turbine
> http://tambora.zenplex.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>


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


Re: TurbineVelocityServive.init() method missing initialization params.

Posted by Jason van Zyl <jv...@apache.org>.
??sta? Ste????? wrote:
> 
> Since I have spent the last 2 hours trying to find out why I can't get my
> app to work with my encoding (8859_7), where the tdk1.11+velocity0.71
> was working just fine, can you please explain that a bit?

The velocity service is changing: all the properties for the velocity
service will be contained within TR.props. So the velocity service
will conform to the way the rest of the turbine services are configured.

I'm sorry this change bit you, but I'm in the middle of changing
the code up in the template services. It was my mistake that the
encoding bit was removed. I will put that back in tonight when
I'm making the TDK.

The configuration mechanism has stablized in velocity and so
soon will the velocity configuration in Turbine. I would suggest
sticking with the TDK. Sorry you spend two hours trying to figure
out what the problem was.
 
> What exactly is the problem with velocity + turbine + encoding?
> What do you mean by:
> > Turbine also needs to have a stated output encoding, and this
> > will be passed along to velocity. There is currently no output
> > encoding property but this will be added soon.

Yes, you are right in that there is a locale.default.charset. The
TR.props files for the two apps I work on most of the time were
missing it so I didn't see it.

But yes, the value for locale.default.charset in the TR.props
should get passed on to velocity. This will be in soon.
 
> The locale.default.charset=8859_7 is not enough? (it worked
> previously).
> Can you give me some hint here?
> Thanks

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

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


Re: TurbineVelocityServive.init() method missing initialization params.

Posted by ??sta? Ste????? <cs...@aias.gr>.
Since I have spent the last 2 hours trying to find out why I can't get my
app to work with my encoding (8859_7), where the tdk1.11+velocity0.71
was working just fine, can you please explain that a bit?

What exactly is the problem with velocity + turbine + encoding?
What do you mean by:
> Turbine also needs to have a stated output encoding, and this
> will be passed along to velocity. There is currently no output
> encoding property but this will be added soon.

The locale.default.charset=8859_7 is not enough? (it worked
previously).
Can you give me some hint here?
Thanks

p.s. sorry for the html e-mail, just happened


----- Original Message -----
From: "Jason van Zyl" <jv...@apache.org>
To: <tu...@jakarta.apache.org>
Sent: Thursday, March 22, 2001 6:01 PM
Subject: Re: TurbineVelocityServive.init() method missing initialization
params.


> Hi,
>
> Don't send HTML mail!
>
> > Êþóôáò Óôåñãßïõ wrote:
> >
> > Hi,
> > I noticed that the TurbineVelocityService is only setting
> > two properties:
> >
> > Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
> >             Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);
> > and then calls the init method.
> > All the velocity properties in the velocity.properties file are not
> > passed in Velocity
> > engine. Also, the line:
> >             Velocity.setProperty(Velocity.TEMPLATE_ENCODING,
> > encoding);
> >
> > is not correct since one cannot use a different encoding (which is a
> > valid property
> > within velocity.properties file - template.encoding -).
> >
> > The code (init() method) could be modified:
> >
> >
> > Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
> >             Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);
> >
> >             Properties vProps = new Properties();
> >             vProps.load(new java.io.FileInputStream(vProperties));
> >             java.util.Enumeration enum = vProps.keys();
> >             while (enum.hasMoreElements()) {
> >               String key = (String) enum.nextElement();
> >               Velocity.setProperty(key, vProps.get(key));
> >             }
> >
> >             Velocity.init();
> > And of course remove the
> >
> >             Velocity.setProperty(Velocity.TEMPLATE_ENCODING,
> > encoding);
> >
> > line.
> >
> > Thanks,
> > Costas
>
> Thanks for the note, I have quite a few changes to the template
> service but they were all dependent on other changes that were
> made. I have all the goods, but I haven't been around much
> in the last couple of days. Tonight I will continue working
> on the TDK and the fixes to the template services will be
> part of it.
>
> It's already been fixed, not quite like what you have though.
> The properties will all be in TR.props, if you wish to have a
> separate file then you can simply include = my.velocity.props.
> So you will be able to keep them separate if you wish.
>
> Turbine also needs to have a stated output encoding, and this
> will be passed along to velocity. There is currently no output
> encoding property but this will be added soon.
>
> --
> jvz.
>
> Jason van Zyl
> jvanzyl@periapt.com
>
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/turbine
> http://tambora.zenplex.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>


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


Re: TurbineVelocityServive.init() method missing initialization params.

Posted by Jason van Zyl <jv...@apache.org>.
Hi,

Don't send HTML mail!

> Êþóôáò Óôåñãßïõ wrote:
> 
> Hi,
> I noticed that the TurbineVelocityService is only setting
> two properties:
> 
> Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
>             Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);
> and then calls the init method.
> All the velocity properties in the velocity.properties file are not
> passed in Velocity
> engine. Also, the line:
>             Velocity.setProperty(Velocity.TEMPLATE_ENCODING,
> encoding);
> 
> is not correct since one cannot use a different encoding (which is a
> valid property
> within velocity.properties file - template.encoding -).
> 
> The code (init() method) could be modified:
> 
> 
> Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH,vTemplates);
>             Velocity.setProperty(Velocity.RUNTIME_LOG, vLog);
> 
>             Properties vProps = new Properties();
>             vProps.load(new java.io.FileInputStream(vProperties));
>             java.util.Enumeration enum = vProps.keys();
>             while (enum.hasMoreElements()) {
>               String key = (String) enum.nextElement();
>               Velocity.setProperty(key, vProps.get(key));
>             }
> 
>             Velocity.init();
> And of course remove the
> 
>             Velocity.setProperty(Velocity.TEMPLATE_ENCODING,
> encoding);
> 
> line.
> 
> Thanks,
> Costas

Thanks for the note, I have quite a few changes to the template
service but they were all dependent on other changes that were
made. I have all the goods, but I haven't been around much
in the last couple of days. Tonight I will continue working
on the TDK and the fixes to the template services will be
part of it.

It's already been fixed, not quite like what you have though.
The properties will all be in TR.props, if you wish to have a
separate file then you can simply include = my.velocity.props.
So you will be able to keep them separate if you wish.

Turbine also needs to have a stated output encoding, and this
will be passed along to velocity. There is currently no output
encoding property but this will be added soon.

-- 
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://tambora.zenplex.org

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