Auch. Might be a large problem...

First problem is that read and redirect-to are only allowed on their own inside a map:match. (as far as I know). Wouldn't make sense if otherwise. The idea is that a read provides a stream of bytes that is passed on directly. Redirect channels a stream of bytes from an other location. So if the cocoon:/lenya... pipe is supposed to deliver XML, you will probably want to use map:generate...

You are trying to generate XML and replace that with (potentially) non-XML. This can only be done with a serializer. Something like a RequestSerializer? It will require the functionality of map:read, but behave like a serializer. This is not yet available, as far as I know...

Isn't it easier to just use the sitemap matching mechanisme for this? It is static, but not that hard to maintain. Create a sitemap that is accessed through /redirect/ and add the triggers you need in matches, which contain the appropriate redirects (and only that).

Alternatively, you could think of using one of the selectors, but unless there is an advanced one that can read some XML and use that for its decisions, you still have to put your values in the sitemap...

Anyone else suggestions?

Cheers

Well, the file is static, no doubt, but it would be reading from multiple 
files, pulling out that one value, and using it in the pipeline.  The above was 
an example, but not what I was aiming for.  This ties into Lenya, but this 
example should still be easy to follow:

I create a "doctype" labeled "redirector" in Lenya.  I can create a pipeline to match for 
all "redirector" doctypes as so:

<map:pipeline>
  <map:match pattern="lenyabody-*/*/*/redirector/**">
    <map:read 
src="cocoon:/lenya-document-{1}/{3}/redirector/{page-envelope:document-path}"/>
    <map:redirect-to url="{value inside <url> tags}"/>
  </map:match>
</map:pipeline>

where the read part (if indeed a <map:read/> is needed - I'm only guessing) 
would come back with the contents of the file, which would look like this:

<redirector>
  <url>http://www.someplace.com/</url>
</redirector>

See where I am trying to head with this one?  Basically, if I find that the document requested 
is of doctype "redirector", I read the file's contents, and use the value to redirect 
the user to the appropriate place.  I know that you can technically just generate the file, and 
use a transformer to create an HTML page where inside the <head> tags you can add a 
meta-refresh, but there's a slight pause there, even if set at 0 for the time.  I've been 
adding pipelines to each page that needs to do this, but I'm looking for a more general 
solution.

Someone had given me their solution, but I'm a bit lost with it, so by going 
this route, I hope to learn enough to understand their solution as well.

Jon

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to