You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrzej Jan Taramina <an...@chaeron.com> on 2004/12/15 18:27:01 UTC

Matching on HTTP method?

Is there any easy way in a Sitemap to match against the HTTP Method of the 
request.  That is, whether it was a Get/Post/Put/Delete/Head/etc?

I suppose I could write an extended matcher that does this....but figured 
that maybe someone already has one out there?

Thanks!

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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


Re: Matching on HTTP method?

Posted by Andrzej Jan Taramina <an...@chaeron.com>.
Upayavira:

> There really isn't that much to the RequestMethodSelector, so 
> documenting it isn't particularly hard. The problem wasn't that the 
> selector is hard to work out how to use, more about how to discover its
> existence, for which, even a basic page on the Cocoon site saying "The
> RequestMethodSelector selects based upon reqest Method" would suffice.

True enuf.....

> So, I have written a page that says just a little more than that, and will
> commit it today. It will make it onto the site with the next site update.

Thanks....

> There is another initative at the moment to document all sitemap 
> components, and this component would have been documented through that
> process. However, there's no harm in beating them to the post!

That is good to hear....and will go a long way to helping Cocoon adoption 
increase!

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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


Re: Matching on HTTP method?

Posted by Upayavira <uv...@upaya.co.uk>.
Andrzej Jan Taramina wrote:

>Hey Gregor:
>
>  
>
>>you could try using a selector like thus:
>>
>>  <match pattern="*.xls">
>>    <select type="request-method">
>>      <when test="GET">
>>         <generate src="{1}.xml"/>
>>         <transform src="xml2poi.xls"/>
>>         <serialize type="hssf"/>
>>      </when>
>>      <when test="PUT">
>>         <generate type="xls2poi"/>
>>         <transform src="poi2sourcewrite"/>
>>         <transform type="sourcewrite"/>
>>         <serialize type="dummyserializer"/>
>>      </when>
>>      [...]
>></match>
>>    
>>
>
>Figures....googling and searching the Cocoon site turned up no mention of the 
>RequestMethodSelector.  Figures I should have just cruised through the source 
>code.
>
>Cocoon's shite documentation strikes again.  
>
>I despair of Cocoon ever attaining wide(r) acceptance/deployment just due to 
>the abysmal state of the documentation.
>
>So it goes...
>  
>
There really isn't that much to the RequestMethodSelector, so 
documenting it isn't particularly hard. The problem wasn't that the 
selector is hard to work out how to use, more about how to discover its 
existence, for which, even a basic page on the Cocoon site saying "The 
RequestMethodSelector selects based upon reqest Method" would suffice.

So, I have written a page that says just a little more than that, and 
will commit it today. It will make it onto the site with the next site 
update.

There is another initative at the moment to document all sitemap 
components, and this component would have been documented through that 
process. However, there's no harm in beating them to the post!

Regards, Upayavira


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


Re: Matching on HTTP method?

Posted by Andrzej Jan Taramina <an...@chaeron.com>.
Hey Gregor:

> you could try using a selector like thus:
> 
>   <match pattern="*.xls">
>     <select type="request-method">
>       <when test="GET">
>          <generate src="{1}.xml"/>
>          <transform src="xml2poi.xls"/>
>          <serialize type="hssf"/>
>       </when>
>       <when test="PUT">
>          <generate type="xls2poi"/>
>          <transform src="poi2sourcewrite"/>
>          <transform type="sourcewrite"/>
>          <serialize type="dummyserializer"/>
>       </when>
>       [...]
> </match>

Figures....googling and searching the Cocoon site turned up no mention of the 
RequestMethodSelector.  Figures I should have just cruised through the source 
code.

Cocoon's shite documentation strikes again.  

I despair of Cocoon ever attaining wide(r) acceptance/deployment just due to 
the abysmal state of the documentation.

So it goes...

Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


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


Re: Matching on HTTP method?

Posted by "Gregor J. Rothfuss" <gr...@apache.org>.
Andrzej Jan Taramina wrote:
> Is there any easy way in a Sitemap to match against the HTTP Method of the 
> request.  That is, whether it was a Get/Post/Put/Delete/Head/etc?
> 
> I suppose I could write an extended matcher that does this....but figured 
> that maybe someone already has one out there?

you could try using a selector like thus:

  <match pattern="*.xls">
    <select type="request-method">
      <when test="GET">
         <generate src="{1}.xml"/>
         <transform src="xml2poi.xls"/>
         <serialize type="hssf"/>
      </when>
      <when test="PUT">
         <generate type="xls2poi"/>
         <transform src="poi2sourcewrite"/>
         <transform type="sourcewrite"/>
         <serialize type="dummyserializer"/>
      </when>
      [...]
</match>


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