You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sands Alden Fish <sa...@MIT.EDU> on 2010/09/17 18:55:57 UTC
Quick question about Matcher flow
Hi all, I'm trying to make sure I understand what happens in a certain pipeline flow using Matchers.
If you've got an embedded matcher, with further pipeline elements after it, and the inner matcher doesn't match, does the pipeline default to the elements below it?
And more to the point, if the matcher matches, do those additional elements after it get included in pipeline processing? Perhaps the example will illuminate best:
<map:match pattern="disseminate-package/*/*/**">
<map:match type="request-parameter" pattern="package">
<map:read type="DisseminationPackageReader">
<map:parameter name="handle" value="{../1}/{../2}"/>
<map:parameter name="name" value="{../3}"/>
<map:parameter name="package" value="{1}"/>
</map:read>
</map:match>
<map:read type="DisseminationPackageReader">
<map:parameter name="handle" value="{1}/{2}"/>
<map:parameter name="name" value="{3}"/>
</map:read>
</map:match>
It appears to me that the DisseminationPackageReader will execute twice in the situation where the "package" parameter is present. Is this true?
Shouldn't this be using a request-parameter Selector or some such mechanism to decide whether to use the first or the second pipeline?
--
sands fish
Software Engineer
MIT Libraries
Technology Research & Development
sands@MIT.EDU<ma...@MIT.EDU>
E25-131
Re: Quick question about Matcher flow
Posted by Luca Morandini <lm...@ieee.org>.
On 09/17/2010 06:55 PM, Sands Alden Fish wrote:
> Hi all, I'm trying to make sure I understand what happens in a certain
> pipeline flow using Matchers.
>
> If you've got an embedded matcher, with further pipeline elements after
> it, and the inner matcher doesn't match, does the pipeline default to
> the elements below it?
Default it's not the word I would use, let's just say that the execution flow will
proceed to the next element, regardless if the previous is matched or not...
selectors are a different beast, but matchers work like this.
> And more to the point, if the matcher matches, do those additional
> elements after it get included in pipeline processing?
Yes.
> Perhaps the
> example will illuminate best:
>
> <map:match pattern="disseminate-package/*/*/**">
> <map:match type="request-parameter" pattern="package">
> <map:read type="DisseminationPackageReader">
> <map:parameter name="handle" value="{../1}/{../2}"/>
> <map:parameter name="name" value="{../3}"/>
> <map:parameter name="package" value="{1}"/>
> </map:read>
> </map:match>
> <map:read type="DisseminationPackageReader">
> <map:parameter name="handle" value="{1}/{2}"/>
> <map:parameter name="name" value="{3}"/>
> </map:read>
> </map:match>
>
> It appears to me that the DisseminationPackageReader will execute twice
> in the situation where the "package" parameter is present. Is this true?
That is what I would expect.
> Shouldn't this be using a request-parameter Selector or some such
> mechanism to decide whether to use the first or the second pipeline?
Yes.
Regards,
Luca Morandini
[http://www.lucamorandini.it]
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org