You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Varga Zsombor <va...@gmail.com> on 2008/09/29 10:31:35 UTC

action for each request

Hi!

I'd like to run an action before every request, and after it use
matchers to decide what to happen. For example:


<map match pattern="a.html">
  <map:generate type="serverpages" src="AA.xsp">
  <map:transform src="XXX.xsl"/>
  <map:serialize/>
</map:match>

<map match pattern="b.html">
  <map:generate src="b.xml">
  <map:transform src="YYY.xsl"/>
  <map:serialize/>
</map:match>

<map:match pattern="*">
  <map:act type="my-action">
    <???????>
  </map:act>
  <map:serialize/>
</map:match>


I know, that i can put the action around of all matcher, but there
could be lots of matchers in the pipeline.
And this solution is not good for me:
<map:match pattern="*">
  <map:act type="my-action">
     <map:generate type="serverpages" src="{../1}.xsp">
     <map:transform src="{../1}.xsl"/>
     <map:serialize/>
  </map:act>
  <map:serialize/>
</map:match>

Because there are differnt types of generators, and serializers.

Thanks

Zsombor

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


Re: action for each request

Posted by Alexander Daniel <al...@gmx.at>.
On 29.09.2008, at 13:40, Varga Zsombor wrote:

> Thanks a lot!
> I will try it. But where can i find documentation abou this (the sub  
> matchers)?

On [1] when you search for "Matchers can be nested"


> Is it true that the latest stable version of Cocoon 2.1 is 2.1.11? As
> i remember there was an version 2.1.18, am i right?

Yes, the latest stable version of Cocoon 2.1 is 2.1.11.

Alex

[1] http://cocoon.apache.org/2.1/userdocs/concepts/matchers_selectors.html



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


Re: action for each request

Posted by Varga Zsombor <va...@gmail.com>.
Thanks a lot!
I will try it. But where can i find documentation abou this (the sub matchers)?

Is it true that the latest stable version of Cocoon 2.1 is 2.1.11? As
i remember there was an version 2.1.18, am i right?

Zsombor

On Mon, Sep 29, 2008 at 13:22, Alexander Daniel <al...@gmx.at> wrote:
> On 29.09.2008, at 10:31, Varga Zsombor wrote:
>
>> Hi!
>>
>> I'd like to run an action before every request, and after it use
>> matchers to decide what to happen. For example:
>>
>>
>> <map match pattern="a.html">
>>  <map:generate type="serverpages" src="AA.xsp">
>>  <map:transform src="XXX.xsl"/>
>>  <map:serialize/>
>> </map:match>
>>
>> <map match pattern="b.html">
>>  <map:generate src="b.xml">
>>  <map:transform src="YYY.xsl"/>
>>  <map:serialize/>
>> </map:match>
>>
>> <map:match pattern="*">
>>  <map:act type="my-action">
>>   <???????>
>>  </map:act>
>>  <map:serialize/>
>> </map:match>
>>
>
> You could use sub-matchers:
>
> <map:match pattern="*">
>        <map:act type="my-action">
>
>                <map:match pattern="a.html">
>                        <map:generate type="serverpages" src="AA.xsp"/>
>                        <map:transform src="XXX.xsl"/>
>                </map:match>
>
>                <map:match pattern="b.html">
>                        <map:generate src="b.xml"/>
>                        <map:transform src="YYY.xsl"/>
>                </map:match>
>
>        </map:act>
>        <map:serialize/>
> </map:match>
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

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


Re: action for each request

Posted by Alexander Daniel <al...@gmx.at>.
On 29.09.2008, at 10:31, Varga Zsombor wrote:

> Hi!
>
> I'd like to run an action before every request, and after it use
> matchers to decide what to happen. For example:
>
>
> <map match pattern="a.html">
>  <map:generate type="serverpages" src="AA.xsp">
>  <map:transform src="XXX.xsl"/>
>  <map:serialize/>
> </map:match>
>
> <map match pattern="b.html">
>  <map:generate src="b.xml">
>  <map:transform src="YYY.xsl"/>
>  <map:serialize/>
> </map:match>
>
> <map:match pattern="*">
>  <map:act type="my-action">
>    <???????>
>  </map:act>
>  <map:serialize/>
> </map:match>
>

You could use sub-matchers:

<map:match pattern="*">
	<map:act type="my-action">
		
		<map:match pattern="a.html">
			<map:generate type="serverpages" src="AA.xsp"/>
			<map:transform src="XXX.xsl"/>
		</map:match>
		
		<map:match pattern="b.html">
			<map:generate src="b.xml"/>
			<map:transform src="YYY.xsl"/>
		</map:match>
		
	</map:act>
	<map:serialize/>
</map:match>

Alex

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