cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [C2] Sitemap and Request parameters
Date Thu, 15 Jun 2000 18:32:16 GMT
Ross Burton wrote:
> 
> Hi,
> 
> I really should get some sleeping pills - I cannot sleep at the moment and
> end up laying in bed thinking about everything...
> 
> Suppose I am running a news web site on Cocoon 2.  Being sensible it is
> possible to access any days news by entering the correct URL, for example
> http://www.groovynews.com/2000/06/15/ will show the news for today.
> Obviously XSP is going to be used here to retreive the data.
> 
> At the moment, I can see this working by the XSP code breaking the URL down
> into components, validating it and using the individual values to build a
> query.  But why should the XSP know the URL structure?  I think it should
> just work from parameters in the request, something like this: (in a mix of
> sitemap languages)
> 
> <process match="/\([0-9]\{4\}\)/\([0-9]\{2\}\)/\([0-9]\{2\}\)/">
>     <set-parameter name="year" value="$1"/>
>     <set-parameter name="month" value="$2"/>
>     <set-parameter name="day" value="$3"/>
> 
>     <generator name="serverpages" src="/dailynews.xsp">
>     <!-- filters -->
>     <serializer type="html"/>
> </process>
> 
> (anybody know a syntax-highlighted regexp editor!?)
> 
> The XSP code build queries based on the values of year, month and day; which
> are in the Request object.  These variables are also available in the XSLT
> phase.  The regexp also handles validation of the URL - it must be
> /xxxx/xx/xx where x is 0-9.
> 
> Is this a good idea? Or just FS?

Wow, I think this is great!

Yeah, I do see the risk of getting into FS, but this would allow better
"adaptation" of external generators to different URI schemes.

+1

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message