cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geoff Howard" <coc...@leverageweb.com>
Subject RE: problem with the sitemap and patterns
Date Mon, 16 Dec 2002 14:40:59 GMT
I'm not sure if that behaviour was is by design or not - I'd suggest that
you
post an "is this correct sitemap behaviour" on the dev list, being sure to
include which version you're using.

In the meantime, if you want your sub-sitemap to handle unmatched requests,
you can put a generic match at the end of the pipeline:

<map:match pattern="**">
    <map:generate src="foo.xml"/>
    <map:transform src="error.xsl"/>
    <map:serialize type="html"/>
</map:match>

where the foo.xml is a hack to allow you to use the same style sheet to
process
not found the same as error.  it ought to have real, but short xml in it.
<foo/> might do
as the whole contents of the file.

Geoff

> -----Original Message-----
> From: pmirco@inwind.it [mailto:pmirco@inwind.it]
> Sent: Monday, December 16, 2002 3:34 AM
> To: cocoon-users
> Subject: RE: problem with the sitemap and patterns
>
>
> Ok, the problem it's a bit more clear, now.
>
> My custom sylesheet is only executed if I force the error:
>
> <map:pipeline>
>    <map:match pattern="index.html">
>       <map:read src="index.html"/>
>    </map:match>
>    <map:match pattern="dir1/dir2/index.html">
>       <map:read src="index.html"/>
>    </map:match>
>    <!-- force an error -->
>    <map:match pattern="*.html">
>       <map:read src="{1}.html"/>
>    </map:match>
>    <map:handle-errors>
>       <map:transform src="error.xsl"/>
>       <map:serialize type="html"/>
>    </map:handle-errors>
> </map:pipeline>
>
> It seesms that Cocoon performs my handle-errors only if it finds
> an error WHILE processing a match pattern.
> Whithout the <map:match pattern="*.html">, my error.xsl isn't executed.
>
> I think this is a Cocoon bug ...
>
> > From what I understand, you should have seen your expected custom
> > stylesheet.  Are you certain it's finding your error.xsl, and are you
> > certain there are no problems with it?  Look in sitemap.log - trace the
> > request as it's being processed.
> >
> > Geoff
> >
> > > -----Original Message-----
> > >
> > > Well, maybe what I supposed to know about pipelines and matchers is
> > > wrong, but ...
> > >
> > > <map:match pattern="mysite/**">
> > >   <map:mount check-reload="yes" reload-method="synchron"
> > > src="mysite/sitemap.xmap" uri-prefix="mysite"/>
> > > </map:match>
> > >
> > > and the mounted pipeline is something like:
> > > <map:match pattern="index.html">
> > >   <map:read src="index.html"/>
> > > </map:match>
> > > <map:match pattern="dir1/dir2/index.html">
> > >   <map:read src="index.html"/>
> > > </map:match>
> > > <map:handle-errors>
> > >   <map:transform src="error.xsl"/>
> > >   <map:serialize type="html"/>
> > > </map:handle-errors>
> > >
> > > Now, if I call
> > > http://localhost:8080/cocoon/mysite/index.html
> > > or
> > > http://localhost:8080/cocoon/mysite/dir1/dir2/index.html
> > > it works
> > >
> > > but if I try
> > > http://localhost;8080/cocoon/mysite/anything.html
> > > I get the well known white page with the blu header "Cocoon 2 -
> > > Resource not found",
> > > while I expected to find my custom error page.
> > >
> > > Coccon processes a request which begins with "mysite" and,
> according to
> > > the "2 asterisks rule", the mounted pipeline is executed.
> > > But there isn't a pattern that matches the request, an error occurs.
> > > So why my custom handler isn't processed?
> > >
> > > Where I'm wrong?
> > >
> > > Cocoon 2.0.3 - Tomcat 4.1.12 - j2sdk1.4.0 - Win2k server
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message