Hi Carsten,

I'm so sorry (and glad), because I tried this with my variables and it seem
to work for me as well. I don't know what the reason was, why it didn't work
for me at the first time. Maybe it has something to do with the sitemap's
asynchronous reload, but I often restarted the complete IDE to eliminate
such effects...

I have to thank you very much for your help and patience. I am evaluating
different cocoon mechanisms for an important project in order to decide
which of them can be used, and I'm glad that this kind of pipeline switching
does really work.

Best regards,
- Volker -


-----Original Message-----
From: Carsten Ziegeler [mailto:[EMAIL PROTECTED]]
Sent: Mittwoch, 10. April 2002 12:24
To: [EMAIL PROTECTED]
Subject: RE: Problem with ParameterSelector



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"/>
  </map:action-set>

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:serialize/>
            </map:when>
            <map:when test="B">
                <map:generate src="test2.xml"/>
                <map:serialize/>
            </map:when>
        </map:select>
    </map:act>
</map:match>

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
"1"/"A"
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

HTH

Carsten


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to