cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobia Conforto <tobia.confo...@linux.it>
Subject Re: Is there an "url wildcard" selector (equivalent)
Date Mon, 10 Mar 2008 10:10:20 GMT
Rainer Pruy wrote:
> wildcard *matcher* is one of the most used components with cocoon,  
> I'd reckon. But what to do, when one needs to handle X/c/** and X/**  
> (excluding X/c/**) different? At least if the contained components  
> are not "final" (serialize, read)

Cocoon has no URI selector, wildcard or otherwise, probably as some  
kind of deliberate design choice.

This kind of problem is easily solved with Perl-compatible regexps,  
but Cocoon uses the inefficient and less powerful Jakarta Regexp  
package (this is a big gripe of mine, btw) probably for "hysterical  
raisins."

If it used the native java.util.regex you could match on "^X/c/" and  
on "^X/(?!c/)", but alas you're limited to egrep-style regular  
expressions, which lack negative lookaheads.

If you don't like the nested simple selector solution, or the  
resources solution, you will have to write your own matcher or  
selector.  Which is not hard at all, by the way.  Just extend  
AbstractPreparableMatcher or AbstractSwitchSelector, put your class in  
WEB-INF/classes and give it a short name in your sitemap.xconf.


Tobia

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message