cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: Problem with ParameterSelector
Date Wed, 10 Apr 2002 10:23:36 GMT

Volker Schneider wrote:
> Do you think it is possible to fix this problem in a later
> release, because
> I think using an action-set is a comfortable way to write application for
> better maintenance.
Hi Volker,

I just checked the behaviour of the action-set (compiled and interpreted
version) and here it works perfectly.

Here is what I did:
- I wrote three actions named T1, T2, T3
- T1 returns "A" for key "1"
- T2 returns "B" for key "2"
- T3 returns "C" for key "3"

The action-set looks like this:
  <map:action-set name="test">
   <map:act type="t1"/>
   <map:act action="add" type="t2"/>
   <map:act action="del" type="t3"/>

And the pipeline:
<map:match pattern="test">
    <map:act set="test">
        <map:select type="parameter">
            <map:parameter name="parameter-selector-test" value="{2}"/>
            <map:when test="A">
                <map:generate src="test.xml"/>
            <map:when test="B">
                <map:generate src="test2.xml"/>

Now, if I request "test", only the t1 action is called, putting "1"/"A" into
the Map. As the selector tests for "2", no map:when matches.

Requesting "test?cocoon-action=add" invokes actions t1 and t2, putting
and "2"/"B" into the Map. The selector tests for "2" and the value is "B",
so the file generator reads "test2.xml"

And so on...

So everything as it should be



Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message