cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: [c2] use examples for sendRedirect in xsp pages
Date Wed, 18 Apr 2001 21:39:24 GMT


On Wed, 18 Apr 2001, Donald Ball wrote:

> On Wed, 18 Apr 2001, Berin Loritsch wrote:
>
> > The other solution is to return values in the map that specify error, etc.
> > If only the Selectors let you expand values....  It would be great to do something
> > with the CodedSelector like this:
> >
> > <map:act type="add-work">
> >   <map:select>
> >     <map:when test="&qout;data&quot.equals({error-type})">
> >       <map:redirect-to uri="insufficient-data.html"/>
> >     </map:when>
> >     <map:when test="&quot;jdbc&quot;.equals({error-type})">
> >       <map:redirect-to uri="database-error.html"/>
> >     </map:when>
> >     <map:otherwise>
> >       <map:redirect-to uri="success.html"/>
> >     </map:otherwise>
> >   </map:select>
> > </map:act>
> >
> > Unfortunately, the sitemap doesn't expand test values.
>
> hmm, but the map that the action returns is available in that context,
> right? so it should be possible to modify the CodedSelector to transform
> {} variables into calls to the map, right? e.g.

It's not a matter of the CodedSelector to expand values (no component
has access to those Maps). It has to be done by the sitemap engine. If I
get enought +1 for that (well, I haven't thought out the consequences) I
can make the test values expanded.

>
> {foo} turns into map.get("foo") or (String)map.get("foo")

Keep in mind that all the Maps returnd from components are kept in a
List to hold all Maps from outer elements (matchers in actions in
matchers aso.). This is made so that one is able to reference values
from outer Maps in a xpath like syntax:

  <map:match pattern="foo**"> <!-- returns the ** value as {1} -->
    <map:act type="bar"> <!-- returns a value as {foobar} -->
      <map:act type="baz"> <!-- returns a value as {bingo} -->
        <map:generate src="{../foobar}/{bingo}/{../../1}.xml"/>
      <map:act>
    <map:act>
  </map:match>

Giacomo


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


Mime
View raw message