[opencms-dev] Velocity support classes now available from Website

Alexander Kandzior alex at opencms.com
Thu Mar 28 22:15:54 CET 2002


Hi all,

Werners OpenCms / Velocity classes are now available from the OpenCms
website, along with his usage notes. You can check this out here:

http://www.opencms.org/opencms/opencms/community/velocity.html

BTW, I agree with Werner that the Velocity template engine is in essence
much easier to use and superior to the OpenCms XMLTemplates. I will try
to integrate Velocity more tightly in OpenCms when I am finished with
the JSP stuff.

Regads,
Alex.

Alexander Kandzior
OpenCms Group

-----Original Message-----
From: owner-opencms-dev at www.opencms.com
[mailto:owner-opencms-dev at www.opencms.com] On Behalf Of Werner Punz
Sent: Wednesday, March 27, 2002 10:51 PM
To: opencms-dev at www.opencms.com
Subject: RE: [opencms-dev] Velocity support


Am Mit, 2002-03-27 um 21.33 schrieb Alexander Kandzior:
> Werner,
> 
> This definitly looks promising. Would you mind if I make your files 
> available on the opencms.org website?
> 
> I am currently working on a JSP integration, but I think will try to 
> integrate Velocity Templates in the Workplace as a new file type. 
> Perhaps you can help me somewhat with that, since my personal 
> experience in Velocity is rather limited? I am sure we can use your 
> current files as a base for a "full" integration.
> 
> Regards,
> Alex.
> 


Hi Alex. I finally have the chance to answer directly since I'm at home
(my work email addy doesn't work so I had to route my mail through my
bosses email address), 

As for your questions, feel free to add the code, it is under the same
license as OpenCMS (LGPL) so I see no problem either to make it
available for download or for integration in OpenCMS. As I said before
It is very short but very powerful.

As for template integration, sure I would be glad, my OpenCMS hack more
or less was developed after one day of digging into the velocity code so
my insight to this code is limited as well. (for instance I'm very
unhappy how the CmsObject is passed down the driver since it forces the
code to be synchronized but as I searched the code it seemed to be the
only way without a Velocity rewrite, I'm also unsure about how to
integrate the velocity and component cache)

I was rather lucky to find a factory pattern in the code which I could
identify as some kind of file loader driver pattern. At this point I
finally had a starting point to hook OpenCMS into without having to
alter even a single line of OpenCMS code. Anyway if you need help or
assistance regarding Velocity (aka I think the best thing would be to
integrate the thing somehwere in one of the base classes) feel free to
contact me I will be glad to assist if possible.

Btw. don't get it into the wrong throat (its by far no critique since
OpenCMS is a great system), but working with both models, the XML based
template model and an Velocity based template model within OpenCMS I
personally think that the Velocity model is far superior, since it
allows much more flexibility and is much more fault tolerant (aka pages
don't bomb out if you handle non defined vars in the template and you
even can check if a var is defined, a missing process tag in OpenCMS
causes the page to bomb out entirely also it is much easier to make
content more dynamic) 

Also my experience the last few weeks using Velocity has shown me that
some parts of gui related coding is shifted back from the velocity java
hooks into the template code (aka if you have to show sets of data you
can code it out in velocity, you can automate the passing of command
line parameters into it as well etc..., I personally even can think
about using it for generation of predefined pages within the VFS)

Anyway since I'm out of work today, I will post additional info on how
to integrate OpenCMS and Velocity tomorrow (I more or less have a
generic class which does most of the parameter passing down to velocity
engine, which I hook in the page control file upon upon the called page)


Werner Punz Labor_C




More information about the opencms-dev mailing list