You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by rachid harradi <ra...@gmx.net> on 2006/09/15 14:19:12 UTC

Output storing after Serializer

Hello,

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.  

<source:write create="true"> 
 <source:source>????? </source:source> -
     <source:path>????? /source:path> 
     <source:fragment>????? </source:fragment> 
     whose is th path to stored like "c:/htmloutput"
 <source:write>

in addition i get the Path from http request (dynamich)


really i need your help 


-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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


How can i get SAX-Event in Transformer

Posted by rachid harradi <ra...@gmx.net>.
hello

i want to develop a Transformer so after the Transfer i will get the SAX Result and Saving it like file new FileoutputStream(filesystem);
-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

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


RE: RE: RE: Output storing after Serializer

Posted by Geert Josten <ge...@daidalos.nl>.
The SaveFilesTransformer can be found at:

http://wiki.apache.org/cocoon/SaveFilesTransformer

Kind regards,
Geert 

> 
   
 
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.
 

> Van: bdelacretaz@gmail.com [mailto:bdelacretaz@gmail.com] 
> Namens Bertrand Delacretaz
> Verzonden: zaterdag 16 september 2006 20:58
> Aan: users@cocoon.apache.org
> Onderwerp: Re: RE: RE: Output storing after Serializer
> 
> On 9/16/06, Geert Josten <ge...@daidalos.nl> wrote:
> 
> > ...Can you give a suggestion where for instance? Somewhere 
> that would 
> > make sense to others?..
> 
> The best IMHO is to create a new page, naming it after your 
> transformer. See 
> http://wiki.apache.org/cocoon/FlowAndWebServices for an example.
> 
> -Bertrand
> 
> ---------------------------------------------------------------------
> 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: RE: RE: Output storing after Serializer

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 9/16/06, Geert Josten <ge...@daidalos.nl> wrote:

> ...Can you give a suggestion where for instance? Somewhere that would make
> sense to others?..

The best IMHO is to create a new page, naming it after your
transformer. See http://wiki.apache.org/cocoon/FlowAndWebServices for
an example.

-Bertrand

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


RE: RE: Output storing after Serializer

Posted by Geert Josten <ge...@daidalos.nl>.
> > ...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?...
> 
> It is, and it's a good spot for relatively simple or 
> specialized contributions, so feel free to put your code there.

Can you give a suggestion where for instance? Somewhere that would make
sense to others?

Kind regards
   
 
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: RE: Output storing after Serializer

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 9/16/06, Geert Josten <ge...@daidalos.nl> wrote:

> ...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?...

It is, and it's a good spot for relatively simple or specialized
contributions, so feel free to put your code there.

-Bertrand

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


RE: Output storing after Serializer

Posted by Geert Josten <ge...@daidalos.nl>.
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Output storing after Serializer

Posted by Andrew Stevens <at...@hotmail.com>.
>From: "rachid harradi" <ra...@gmx.net>
>Date: Fri, 15 Sep 2006 14:19:12 +0200
>
>Hello,
>
>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.
>
><source:write create="true">
>  <source:source>????? </source:source> -
>      <source:path>????? /source:path>
>      <source:fragment>????? </source:fragment>
>      whose is th path to stored like "c:/htmloutput"
>  <source:write>
>
>in addition i get the Path from http request (dynamich)
>
>
>really i need your help

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.



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