I reported this problem a while ago to the user's list, but did not get any reply, so here again...
The documentation says that the option global="true" or global="yes" should make it possible to abort an aggregation and send a redirect via http.
http://cocoon.apache.org/2.1/userdocs/concepts/redirection.html#Global+Redirects
That does not work for me (Cocoon 2.1.4). Excerpt from a sitemap:
<map:pipeline>
<map:match pattern="redirect">
<map:redirect-to uri="redirected"/>
</map:match> <map:match pattern="aggregate">
<map:aggregate element="root">
<map:part src="cocoon://aggregatedRedirect"/>
</map:aggregate>
<map:serialize/>
</map:match> <map:match pattern="aggregatedRedirect">
<map:redirect-to global="true" uri="redirected"/>
</map:match>
</map:pipeline>Accessing "redirect" correctly results in a http-redirect to "redirected". However, "aggregate" is trying to resolve "redirected" internally and does not send the redirect.
I had a look on what's going on, but as sitemap processing involves quiet a lot a things, I could not figure it out exactly. I could observe however, that the attribute "global" gets lost (is not present in the node's "Configuration" object) and that the uri somehow gets prefixed with "cocoon:/".
I attached an complete example sitemap.
Best regards,
Thomas
<?xml version="1.0" encoding="UTF-8"?> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<map:components>
<map:generators/>
<map:transformers/>
<map:serializers default="html">
<map:serializer logger="sitemap.serializer.html" mime-type="text/html" name="html" pool-grow="4" pool-max="32" pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
<doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
</map:serializer>
</map:serializers>
<map:readers/>
<map:matchers default="wildcard">
<map:matcher logger="sitemap.matcher.wildcard" name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>
<map:selectors/>
<map:actions/>
<map:pipes default="noncaching">
<map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>
</map:pipes>
</map:components>
<map:pipelines>
<map:pipeline>
<map:match pattern="redirect">
<map:redirect-to uri="redirected"/>
</map:match>
<map:match pattern="aggregate">
<map:aggregate element="root">
<map:part src="cocoon://aggregatedRedirect"/>
</map:aggregate>
<map:serialize/>
</map:match>
<map:match pattern="aggregatedRedirect">
<map:redirect-to global="true" uri="redirected"/>
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
