cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [Cocoon 2] Regex matchers :-)
Date Fri, 12 May 2000 13:12:02 GMT
Ross Burton wrote:

> > I think you touched a very important point I tried not to touch before:
> > site migration. While the goal is to make the sitemap simple and
> > effective, you are right that normally people have to migrate one site
> > into another, possibly doing URI-space rearchitecting without breaking
> > usage and creating floods of broken links.
> > I'm wide open to suggestions on this.
> I think what is needed is a <redirect> tag along with the <process> tags,
> matches patterns in a similar manner to the process tags.  These can rewrite
> the user's URL (just as process does) but throw a client-side redirect (301
> Moved Permanently IIRC) so that bookmarks can be updated.
> Something like:
>     <redirect source="/htdocs/foo/**/*.shtml" target="/foo/**/*.xml"/>
> Although this would be possible using the existing matchers, a regex matcher
> might make it easier.  :-)

I cannot understand how.

The "extended wildcard matching" that Pier implemented allows you to use
the stars as variables and move the location abstracted by the wildcard
into the next expression... while, in theory, this doesn't work all the
time, Pier showed it is possible to make it work, so I'm happy (for

Now, how can this work using full regexp? say we allow the use of
pluggable matching with sort of XPointer syntax


What does the star mean? [a|b|c]? I can't see how this can be easier
than using wildcards... less verbose, totally, but reducing verbosity
doesn't always increase readability, expecially in configurations.

> Well, that's my idea anyway.  I'm getting a feeling that the <process> etc
> tags might need to be pluggable in the sitemap...

There you go: 1, 2, then N = flexibility syndrome.

I rethought about your issue and I think redirection is _not_ something
that Cocoon should deal with.

Cocoon is, after all, a servlet. A servlet is usually mapped to a
particular location and it is never ran alone, but only in a serving
enviornment which, normally, takes care of its URI space. Cocoon uses
the sitemap to take care of its URI space, which, in general, is a
subset of the serving environment's URI space.

You say that redirection is useful when you have to do tons of it:
usually when doing a URI mapping port. This is _exactly_ the place for
stuff like mod_rewrite and I do not want to include mod_rewriting hacks
into Cocoon2, which was designed specifically to avoid them.
> Another thing - any plans on using Xinclude in the sitemap file?  A
> large-ish redirect sitemap fragment could be pretty messy, it would be nice
> to have it in another file.

Even if I don't like <redirect> in the sitemap, I think the use of
sitemap linking is vital, expecially when site administration is
fragmented into more than one group.

So my votes are:

1) pluggable matching syntax: +1
2) redirect capabilities in the sitemap: -0 (maybe useful in non-apache
enviornments, but I don't care for Cocoon 2.0)
3) xinclude in the sitemap: +1

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

View raw message