AW: [opencms-dev] On how to integrate OpenCMS and velocity:

Werner Punz werpu at gmx.at
Mon Apr 1 15:57:43 CEST 2002


The other questions regarding the main integration problems were answered already by other members of the list
(aka problems passing down CmsObject into the velocity system by trying to avoid the synchronized mechanism I used)
I will answer the user access problem.

First of all if you use the resource loader I use, velocity is bound to standard user management of
OpenCMS, if you want to use the objects and methods for user access rights which are provided by OpenCMS
you have to push down the appropriate Objects or wrappers of them into the Velocity context (which is some kind of variable stack Velocity uses), once in the Velocity Context the usage of java objects is rather straight-forward, aka you can use them like every other java object

$myObject.callMyMethod("hello world")
Ok I have no experience of passing constructs like

$myObject.callMyMethod($cmsObject,"hello world") down the system but I think it should work (I have to test that tomorrow)-maybe this could be another way to get CmsObject down to the resource loader :-) to pass it into the context - I will look into that tomorrow in my sparetime.

Another thing someone pointed out is the usage different template mechanisms (aka xml or velocity alone)
The problem is that both template mechanisms don´t exclude each other they can complement each other.
This basically means you could fill existing XML templates with velocity content and both systems wouldn´t interfere, so I think an all or nothing approach (aka either XML or Velocity) is contraproductive a complementive approach should be targetet at least optionally.


Werner



-----Ursprüngliche Nachricht-----
Von: owner-opencms-dev at www.opencms.com
[mailto:owner-opencms-dev at www.opencms.com]Im Auftrag von Alexander
Kandzior
Gesendet: Samstag, 30. März 2002 22:36
An: opencms-dev at www.opencms.com
Betreff: RE: [opencms-dev] On how to integrate OpenCMS and velocity:

Another intersting question is, how will it be possible that you can
access user and acces data of the OpenCms from within Velocity? Since
you have a complte user and right management in OpenCms already, it
would be good if this information could be used in the Velocity
templates as well.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20020401/d9e20906/attachment.htm>


More information about the opencms-dev mailing list