You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Ludwig <st...@advanceit.ch> on 2008/02/19 09:47:34 UTC

Max file size in FileGenerator and encoding in StreamGenerator

Hi, 

I try to generate pdf and excel documents from a XML-Datafile (sent via
multipart/form-data). The datafile can be very large (about 20MByte) and
encoded in ISO or Unicode (ISO-8859-1 or UTF-8).

The FileGenerator works perfect with Encoding (gets encoding from
XML-Datafile), but with large XML-Datafiles the Generator doesen't work
(nothing happens - no exceptions or something like that. after 30mins I
have stopped tomcat).

The StreamGenerator works fine with large files (from 20MByte XML-Data
to PDF in just 2mins!), but encoding doesn't work. This generator gets
encoding from request, but i need the encoding from XML-Datafile.

Anyone an idee?

Thx and regards
Steff

My pipe for this case:

<map:match pattern="generate">
  
  <!-- Generate SAX-Evenets from multipart/form-data -->
  <!-- <map:generate type="stream">
    <map:parameter name="form-name" value="file"/>
  </map:generate> -->
  <map:generate src="upload://file"/>
					
  <!-- Check requested DocType (Commission or Billing) -->
  <map:act type="doctype">
    <map:parameter name="doctype" value="{request-param:doctype}"/>
  </map:act>
					
  <!-- <map:transform type="log">
    <map:parameter name="logfile" value="pipapo.log" />
    <map:parameter name="append" value="no"/>
  </map:transform> -->
					
  <!-- Transform to FOP or GMR -->
  <map:transform
src="context://stylesheets/{request-param:doctype}-{request-param:output}.xsl">
    <map:parameter name="locale" value="{../locale}" />
    <map:parameter name="ticketnumber" value="{request-param:ticket}"/>
    <map:parameter name="doctype" value="{request-param:doctype}"/>
  </map:transform>
					
  <!-- Internationalization -->
  <map:transform type="i18n">
    <map:parameter name="locale" value="{../locale}" />
  </map:transform>
					
  <!-- Serialize PDF or Excel -->
  <map:select type="request-parameter">
    <map:parameter name="parameter-name" value="output"/>
    <map:when test="pdf">
      <map:serialize type="fo2pdf"/>
    </map:when>
    <map:when test="xls">
      <map:serialize type="xls"/>
    </map:when>
  </map:select>
					
</map:match>







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


Re: Max file size in FileGenerator and encoding in StreamGenerator

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.02.2008 16:05, Stefan Ludwig wrote:

> my problem is solved!
> 
> now i use the FileGenerator. configured like this:
> <map:generate type="file" src="{request-param:file}"/>

I'm really surprised this works. It seems to be a valid alternative to 
upload protocol. But then I wonder why having the latter at all?

> last (non-working for bigger files) configuration for FileGenerator was:
> <map:generate type="file" src="upload://file"/>

This sounds very much like an error in the upload source implementation. 
Maybe it creates an additional buffer. But even that (an additional 
memory usage of 20 MB) doesn't sound to bad.

Joerg


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


Re: Max file size in FileGenerator and encoding in StreamGenerator

Posted by Stefan Ludwig <st...@advanceit.ch>.
hi all,

my problem is solved!

now i use the FileGenerator. configured like this:
<map:generate type="file" src="{request-param:file}"/>

so the temporary file (uploaded from multipart/form-data) located in
"cocoon-files/upload-dir" will be used.

last (non-working for bigger files) configuration for FileGenerator was:
<map:generate type="file" src="upload://file"/>

best regards
stefan


-----Original Message-----
From: Stefan Ludwig <st...@advanceit.ch>
Reply-To: stefan.ludwig@advanceit.ch
To: users@cocoon.apache.org
Subject: Re: Max file size in FileGenerator and encoding in
StreamGenerator
Date: Tue, 26 Feb 2008 11:01:10 +0100

no, i have no chance to set request encoding to the same as datafile
encoding.

situation:
i have to transform a xml-datafile (max file size about 20MB) to a pdf
or a excel document.
the customer want to have a simple html form to upload the xml file and
to set the mandatory informations like language and output format. the
xml file can be encoded in utf-8 or iso-8859-1.

so i have:
- html form (multipart/form-data) with following params:
  - file -> xml-datafile
  - output -> serialise excel or pdf
  - locale -> language of serialised doc

- pipe:
  - StreamGenerator (encoding problem)
    or FileGenerator (filesize problem)
  - transformer to fop (pdf) or gmr (excel)
  - transformer i18n for multilanguage
  - serialiser to pdf or excel

my trial:
my own implementation of StreamGenerator (just a copy of the cocoon
one ;). in my implementation i have set encoding fixed to "ISO-8859-1".

result: in this trial also, just files which are utf-8 encoded were be
shown correct.

any ideas to this..?

i don't no exactly, what you mean with the reader thing you wrote...

thanks a lot
steff

-----Original Message-----
From: Alexander Daniel <al...@gmx.at>
Reply-To: users@cocoon.apache.org
To: users@cocoon.apache.org
Subject: Re: Max file size in FileGenerator and encoding in
StreamGenerator
Date: Wed, 20 Feb 2008 20:56:15 +0100

On 19.02.2008, at 09:47, Stefan Ludwig wrote:
> The StreamGenerator works fine with large files (from 20MByte XML-Data
> to PDF in just 2mins!), but encoding doesn't work. This generator gets
> encoding from request, but i need the encoding from XML-Datafile.

Is there any chance that you make the character encoding of the  
request the same as the character encoding of the XML-Datafile?

> The FileGenerator works perfect with Encoding (gets encoding from
> XML-Datafile), but with large XML-Datafiles the Generator doesen't  
> work
> (nothing happens - no exceptions or something like that. after  
> 30mins I
> have stopped tomcat).

This might be a problem of the upload pseudo protocol or the  
FileGenerator. You could try to use the upload pseudo protocol with a  
reader to determine which of the two components causes the described  
behaviour.

Alex


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



________________________________________________________________________

advanceIT GmbH
Galgenholzstrasse 35
8500 Frauenfeld
Switzerland

Phone: +41 52 721 48 88
Fax: +41 52 721 48 90
Mobile: +41 78 768 02 14


________________________________________________________________________

CONFIDENTIALITY NOTICE
The information contained in this e-mail message is intended only for
the exclusive use of the individual or entity named above and may
contain information that is privileged, confidential or exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, or the employee or agent responsible for
delivery of the message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by e-mail
and delete the material from any computer.
Thank you.


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


Re: Max file size in FileGenerator and encoding in StreamGenerator

Posted by Stefan Ludwig <st...@advanceit.ch>.
no, i have no chance to set request encoding to the same as datafile
encoding.

situation:
i have to transform a xml-datafile (max file size about 20MB) to a pdf
or a excel document.
the customer want to have a simple html form to upload the xml file and
to set the mandatory informations like language and output format. the
xml file can be encoded in utf-8 or iso-8859-1.

so i have:
- html form (multipart/form-data) with following params:
  - file -> xml-datafile
  - output -> serialise excel or pdf
  - locale -> language of serialised doc

- pipe:
  - StreamGenerator (encoding problem)
    or FileGenerator (filesize problem)
  - transformer to fop (pdf) or gmr (excel)
  - transformer i18n for multilanguage
  - serialiser to pdf or excel

my trial:
my own implementation of StreamGenerator (just a copy of the cocoon
one ;). in my implementation i have set encoding fixed to "ISO-8859-1".

result: in this trial also, just files which are utf-8 encoded were be
shown correct.

any ideas to this..?

i don't no exactly, what you mean with the reader thing you wrote...

thanks a lot
steff

-----Original Message-----
From: Alexander Daniel <al...@gmx.at>
Reply-To: users@cocoon.apache.org
To: users@cocoon.apache.org
Subject: Re: Max file size in FileGenerator and encoding in
StreamGenerator
Date: Wed, 20 Feb 2008 20:56:15 +0100

On 19.02.2008, at 09:47, Stefan Ludwig wrote:
> The StreamGenerator works fine with large files (from 20MByte XML-Data
> to PDF in just 2mins!), but encoding doesn't work. This generator gets
> encoding from request, but i need the encoding from XML-Datafile.

Is there any chance that you make the character encoding of the  
request the same as the character encoding of the XML-Datafile?

> The FileGenerator works perfect with Encoding (gets encoding from
> XML-Datafile), but with large XML-Datafiles the Generator doesen't  
> work
> (nothing happens - no exceptions or something like that. after  
> 30mins I
> have stopped tomcat).

This might be a problem of the upload pseudo protocol or the  
FileGenerator. You could try to use the upload pseudo protocol with a  
reader to determine which of the two components causes the described  
behaviour.

Alex


---------------------------------------------------------------------
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: Max file size in FileGenerator and encoding in StreamGenerator

Posted by Alexander Daniel <al...@gmx.at>.
On 19.02.2008, at 09:47, Stefan Ludwig wrote:
> The StreamGenerator works fine with large files (from 20MByte XML-Data
> to PDF in just 2mins!), but encoding doesn't work. This generator gets
> encoding from request, but i need the encoding from XML-Datafile.

Is there any chance that you make the character encoding of the  
request the same as the character encoding of the XML-Datafile?

> The FileGenerator works perfect with Encoding (gets encoding from
> XML-Datafile), but with large XML-Datafiles the Generator doesen't  
> work
> (nothing happens - no exceptions or something like that. after  
> 30mins I
> have stopped tomcat).

This might be a problem of the upload pseudo protocol or the  
FileGenerator. You could try to use the upload pseudo protocol with a  
reader to determine which of the two components causes the described  
behaviour.

Alex


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