Hi McB,
a Cocoon pipeline is only made of SAX Events, so only XML can flow in
the pipe. Anyway, any component of the pipeline has access to the HTTP
request parameters, so they can actually save your binary data to a
file. I don't know if the source writing transformer actually supports
doing this (having a PUT binary parameter as an input), but if you know
how to write Java you can easily expand it or code a new component for
doing it.

One simpler alternative is to use flowscript. With flowscript you need
two very simple matches in your pipeline : one to call the javascript
function, the other to display a success page to the user; in their most
basic form they are 6 lines of code. Then you can write your javascript
function, with "var data = cocoon.request.getParameter('param-name')"
you get the binary data, and with a common FileOutputStream you can
write it to a file, and then with a sendPage display go back to the
sitemap to display the success page.

Hope this helps,
Simone

mcburton wrote:

> I have a client side application that is sending non-xml data to
> cocoon via a HTTP PUT request.  The content-type is
> "application/octet-stream", it is usually text, but could be binary
> data.  I am trying to figure out how to access this data within a
> pipline and cannot figure it out (I am new to cocoon).  On the list
> there is  lot of talk about StreamGenerator but that sounds like it
> only handles XML.
> The first thing I would like to do is take this PUT request data and
> simply write it as a file, probably using the
> SourceWritingTransformer, yes?  But how do I get the stream to the
> SourceWritingTransformer?
> Eventually I might even want to try parsing the incoming data (if it
> is text) into XML (using Chaperon most likely) to pass to a
> stylesheet.  But before I can do any of this i need to understand how
> to access the PUT data within a pipeline.  What would a sitemap that
> receives PUT requests look like?  Please forgive me if this doesn't
> make sense, I'm still learning how to speak Cocoon.
>
> thanks,
> mcb
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
-- 
Simone Gianni

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

Reply via email to