You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Klaus Drechsler <dr...@gmx.net> on 2001/02/11 19:27:10 UTC

Re: Action ... (new question inside ;))

Hi,

At 17:22 11.02.2001, you wrote:
>Here you try to get at the value of {1} from the Map returned by your action.
>Unfortunately your map does not contain a member named "1". the only one you
>have is "validSession".


Thank you very much. That works now :-)

But I have another question to you:
Is it possible to to do something like an "if ... then ...else" with the 
results from an acion in the sitemap?.
I mean something like this:

    <map:match pattern="sm/*">
     <map:act set="mytest">

         <map:when {test}=true>   <!-- HOW DO I DO THIS? -->

                 <map:generate type="serverpages" 
src="dbprakhouse/{test}.xsp"/>
                 <map:transform src="dbprakhouse/sm-logicsheet.xsl"/>
                 <map:serialize type="html"/>
         </map:when>

     </map:act>
    </map:match>

If this is possible, could you give me the correct syntax please? I tried 
to figure it out by myself, but that wasn´t very successful.

Thanks in advice!

Bye,
  Klaus
-- 
Farewell! I will omit no opportunity
That may convey my greetings, love, to thee.
Romeo&Juliet
                         (Act III, Scene V)
---------------------------------------------
PGP-Key: http://pgp.kdnet.de (soon!)
---------------------------------------------


Re: Action ... (new question inside ;))

Posted by Giacomo Pati <gi...@apache.org>.
Klaus Drechsler wrote:
> Hi,
>
> At 17:22 11.02.2001, you wrote:
> >Here you try to get at the value of {1} from the Map returned by your
> > action. Unfortunately your map does not contain a member named "1". the
> > only one you have is "validSession".
>
> Thank you very much. That works now :-)
>
> But I have another question to you:
> Is it possible to to do something like an "if ... then ...else" with the
> results from an acion in the sitemap?.
> I mean something like this:
>
>     <map:match pattern="sm/*">
>      <map:act set="mytest">
>
>          <map:when {test}=true>   <!-- HOW DO I DO THIS? -->
>
>                  <map:generate type="serverpages"
> src="dbprakhouse/{test}.xsp"/>
>                  <map:transform src="dbprakhouse/sm-logicsheet.xsl"/>
>                  <map:serialize type="html"/>
>          </map:when>
>
>      </map:act>
>     </map:match>
>
> If this is possible, could you give me the correct syntax please? I tried
> to figure it out by myself, but that wasn´t very successful.

No, there is no such thing like what you are expecting. There was a 
Selector called CodedSelectorFactory but unfortunately I've missed the docs 
from Marcus Crafter. Maybe you'll find there what you are looking for. I 
think you can always use an action to do your checking and return an 
appropriate value to the sitemap to be used as a replacement for resources.

Marcus, did you post the docs for your Selector?

Giacomo