cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Burton" <>
Subject [C2] Sitemap and Request parameters
Date Thu, 15 Jun 2000 08:18:20 GMT

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 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"/>

(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?

Ross Burton

View raw message