Hi there,

> >i need you help. i will to store every Output(pdf html) 
> after Serializer.
> >
> >i had look at source Writing Transformer but i dont 
> understand how can 
> >i use it.

> Not that I want to suggest Cocoon isn't always the best tool 
> whatever the job is, but if you want to store every output 
> (or every one of particular file types) have you considered 
> writing a Filter to do the job instead?  All it needs to do 
> is wrap the respose to capture the output to a byte array 
> output stream, the write it to a file as well as the original 
> servlet output stream...

Andrew, that is exactly what the SourceWritingTransformer does,
actually. Transformers ARE filters.. :-)

Rachid, what you need is the following:

Input for the transformer:
  <source:write>
        <source:source>{path to your output file}</source:source>
      <source:fragment>
                {xml fragment needed by your serializer to be able to
write PDF, most likely XSL-FO}
        </source:fragment>
  </source:write>

Transformer definition:

  <map:transform type="write-source">
        <map:parameter name="serializer" value="{your pdf serializer
name}"/>   
  </map:transform>

A more elaborate explanation of this transformer can be found here:
        
http://cocoon.apache.org/2.1/userdocs/sourcewriting-transformer.html

But you do need to take some extra steps to get to the appropriate input
for this transformer..

In older versions of Cocoon I would have written an XSLT that inserts
the correct path, received through a parameter, set from the sitemap
with {request-param:my-output-path}. The XSLT would also write an
cinclude or xinclude instruction to get XSL-FO code into the fragment
code. So that would mean an XSLT tranform and an include transform
before the write-source transform.

In the newer versions of Cocoon, JX templates might do the setting path
and including XSL-FO in one single generate, so that would be nicer.

But next to all this, there is also FlowScript and JavaFlow with which
you can virtually anything as well. Depending on other things you need,
you could switch to using that. Could be particularly interesting if you
intend to process multiple files with a single call.

Kind regards,
Geert

PS: I once wrote a simplified source-writing transformer that took a src
and target attribute. It simply captured the stream of the src url and
redirected to the target file. Because it doesn't do any XML processing,
it was able to handle binary streams as well.. :) Never found the time
to share it with the community. If there is still interest in this
transformer, just point me to a place where I can leave it. Perhaps,
somewhere on Cocoon Wiki if that is still alive? (sorry, have been out
of the loop for a while)
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.

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

Reply via email to