cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carmona Perez, David" <DPerez...@fcc.es>
Subject RE: Parameter matcher
Date Thu, 24 Apr 2003 09:06:19 GMT
Maybe, I haven't selected the right type of matcher.  Does anyone know how I can branch on
the value of a sitemap variable?

------
David

-----Mensaje original-----
De: Carmona Perez, David 
Enviado el: jueves, 24 de abril de 2003 10:17
Para: cocoon-users@xml.apache.org
Asunto: Parameter matcher

Hi all,

I have an action that can set a sitemap parameter whose name is "redirect", and when it is
set the pipeline processing must branch to some other place.

Have this sitemap:

<map:matchers default="wildcard">
        <map:matcher logger="sitemap.matcher.wildcard" name="wildcard"
                src="org.apache.cocoon.matching.WildcardURIMatcher"/>
        <map:matcher logger="sitemap.matcher.regexp" name="regexp"
                src="org.apache.cocoon.matching.RegexpURIMatcher"/>
        <map:matcher logger="sitemap.matcher.regexp" name="parameter"
                src="org.apache.cocoon.matching.ParameterMatcher"/>
</map:matchers>

<map:pipeline>
        <map:act name="myAction">
                <map:match type="parameter" pattern="redirect">
                <map:redirect-to uri="{1}"/>
                </map:match>
                ....
        </map:act>
</map:pipeline>


And the matcher "parameter" always fails because it receives always an empty parameters.

public Map match(String pattern, Map objectModel, Parameters parameters) {
}

The compiled sitemap, for the matcher call has something like this:

      if ((map = matches("parameter", matcher_N400121_expr, "redirect",
Parameters.EMPTY_PARAMETERS, objectModel)) != null) {
                environment.redirect (false, substitute(listOfMaps, "{1}", environment));
}

Any help will be greatly appreciated!

------
David


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

---------------------------------------------------------------------
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