cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Handling Preconditions
Date Sun, 02 Jan 2000 22:12:10 GMT
apfarr@vipsurf.de wrote:
> 
> Hi,
> 
> I'm missing a framework for handling preconditions in Cocoon. In my applications, I usually
have to validate a user against a database and check for pages he/she has already visited.
This could be easiliy achieved via preconditions: Before actually calling the Engine (or as
the first action of the engine itself), I'd call something like
> 
> while(true) {
>         Precondition pre = preconditions.getCondition(document);
>         if(!pre.accomplished())
>                 doSomething();
> }
> 
> In my special environment, I'd check for a valid DB-Connection ID and, if I don't find
one, redirect the user to a longin-page.

Something like this does not belong to Cocoon but to the servlet engine.
Anyway a new design pattern called "Interceptor" has been proposed for
Tomcat that will allow you to do that. Some code is already there. Take
a look at the Tomcat CVS module at jakarta.apache.org
 
> This would also allow to handover "global" data (e.g. Connections) to the processors
via the parameter-map and would therefore eliminate the need to code this in the document
itself (see how SQLProcessor deals with connection - and with the potential security hazards
associated with this method)
> 
> Talking about the Sitemap Proposal:
> Don't forget to add XCatalog-Support to your configuration file. This would dramatically
reduce customization efforts.

Great point. You're totally right, I knew I was missing something :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------


Mime
View raw message