velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Punz" <w.p...@labor-c.net>
Subject Feature request
Date Wed, 07 Aug 2002 09:09:45 GMT
I already mailed this in this dev mailing list, but it went under there
unnoticed. 
It seems that the user mailing list is read more. So I will repost it
again.

First I guess, I introduce myself. I am one of the persons, who tries to
integrate Velocity into the OpenCMS project (in fact I started it).
(http://www.opencms.org)

So far it works fine except one problem. I have to access via Velocity a
virtual file system, which is based on a relational database.I made my
own resource loader for accessing the system. But the problem is there
is no way within the standard Velocity API to pass down an extra
parameter which can change dynamically upon loading the resource to the
resource loader, unless you pass it directly to the loader. 

But then you have to put the whole loading into a synchronized block to
avoid threading problems.

Anyway, this parameter is essential in my case to give access to the
virtual file system.

Passing it down directly via statics and synchronize the pass and call,
was my first solution. After a longer discussion in OpenCMS mailing list
we opted for another solution, by adding methods to the Velocity classes
which allow the passing of a separate object down to the resource
loader, if the loader implements a special interface. The problem with
this is, that every time a new Velocity version comes out the code has
to be readjusted. The best way to solve these problems probably would be
to integrate an extension which allows the passings of additional
parameters down to the local resource loader.

I have a working code here for 1.3.1 RC2 (but not published yet since I
want to wait for 1.3.1 final to before sending out the code into the
wild) I could send it in to have the additions (they are additions to
the core classes not really changes) evaluated and maybe merged into the
main branch. I just donĀ“t know whom to contact on this issue. 
Anyway a short description what I did. Not very much, my own classloader
which might enter the OpenCMS core one time.
And an extension to the ResourceManager,
ResourceManagerImpl,RuntimeInstance and Runtimesingleton classes, adding
exactly one method which adds an Object parameter which then gets passed
down to the resource loader (I followed the trace of the parameters from
the outside to the resource loaders). I also moved my extended classes
into another package to avoid conflicts with the core system. In an
earlier version you can find on the opencms.org site there also is a
cache factory added, so that the OpenCMS content cache theoretically can
be added, but this thing fortunately became obsolete with 1.3 :-)


Werner Punz Labor_C


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message