You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Carlos Tejo Alonso <ca...@fundacionctic.org> on 2008/04/29 17:21:42 UTC

Output, more than one file?

Hello,

Is it possible that a pipe output could be more than one file?

Best regards,

Carlos Tejo Alonso
R&D Deparment - CTIC Foundation [Asturias, Spain]
www.fundacionctic.org


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


Re: Output, more than one file?

Posted by Dev at weitling <de...@weitling.net>.
Hi Carlos,

Carlos Tejo Alonso wrote:
> Hi Antonio,
>  
>   
>> Would you explain the use case? Perhaps we can find another 
>> way to solve 
>> it. :)
>>     
>
> Thanks for your answer. Maybe this simple use case can help.
>
> We have an .xml file (in.xml) in the input and we want "defrag" it in
> several .xml (out-1.xml, out-2.xml, out-3.xml) file

The problem is that you have *one* request which you can return only one 
"file". If you just want to create the files without returning them to 
the client at once you may have a look at the TeeTransformer. Or write 
your own Serializer returning/creating the files as needed. And formerly 
created files may be packaged with the Zip(Archive)Serializer.

Hope that helps,
Florian

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


Re: Output, more than one file?

Posted by so...@apache.org.
On 4/30/08, Carlos Tejo Alonso <ca...@fundacionctic.org> wrote:
>  > Would you explain the use case? Perhaps we can find another
>  > way to solve
>  > it. :)
>  We have an .xml file (in.xml) in the input and we want "defrag" it in
>  several .xml (out-1.xml, out-2.xml, out-3.xml) files
>  Carlos Tejo Alonso

Questions:
Are you using Cocoon for a Web request or just a file-to-files operation?
Is the input file being submitted or does it already exist on the server?
Should the output files remain on the server or are they only needed
fro the response?

If file-to-files, the SourceWritingTransformer will produce multiple
files.  The response should confirm success and give the directory
name where the output files were created.

A Web request has several options:
1. Create the files with the SourceWritingTransformer, then return a
page of links to the new files.  This option leaves the output files
on the server so a cleanup routine may be desirable -- use another
link ("Remove output files") and/or a scheduled process.
2. Create a single response using the SourceWritingTransformer and the
ZipSerializer, returning a ZIP file containing all the output files.
This option is best when you know the users have (and know how to use)
an unzip program.
3. Create each output file on-demand.  The Web request specifies a
number and Cocoon responds with just the output file for that number.
The first response could return a page of links; the difference from
#1 is the response files are not created until the single-output
request is processed.  This option is best if people typically only
need one of the output files.

solprovider

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


RE: Output, more than one file?

Posted by Carlos Tejo Alonso <ca...@fundacionctic.org>.
Hi Antonio,
 
> Would you explain the use case? Perhaps we can find another 
> way to solve 
> it. :)

Thanks for your answer. Maybe this simple use case can help.

We have an .xml file (in.xml) in the input and we want "defrag" it in
several .xml (out-1.xml, out-2.xml, out-3.xml) files

Best regards,

Carlos Tejo Alonso
R&D Deparment - CTIC Foundation [Asturias, Spain]
www.fundacionctic.org

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


Re: Output, more than one file?

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Carlos,

Would you explain the use case? Perhaps we can find another way to solve 
it. :)

Best Regards,

Antonio Gallardo.

Carlos Tejo Alonso escribió:
> Hello,
>
> Is it possible that a pipe output could be more than one file?
>
> Best regards,
>
> Carlos Tejo Alonso
> R&D Deparment - CTIC Foundation [Asturias, Spain]
> www.fundacionctic.org
>
>
> ---------------------------------------------------------------------
> 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: Output, more than one file?

Posted by so...@apache.org.
On 4/29/08, Carlos Tejo Alonso <ca...@fundacionctic.org> wrote:
>  Is it possible that a pipe output could be more than one file?
>  Carlos Tejo Alonso

Q. Can Cocoon send information to multiple outputs?
A. Yes, a Transformer can write to multiple Sources before a
Serializer handles the primary response:
http://cocoon.apache.org/2.1/userdocs/sourcewriting-transformer.html

Q. Can the output of one pipeline be used in multiple pipelines?
A. Yes, multiple pipelines can call the same pipeline.  Cache may
prevent the pipeline from being processed multiple times during the
request.

For more assistance, please tell us what your requirements.

solprovider

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