cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fawzib Rojas <f_ro...@spectron-msim.com>
Subject Re: Question about serializers
Date Thu, 15 Dec 2005 15:45:10 GMT
Jason Johnston wrote:

> Seems to me you could accomplish this fairly easily with Flowscript. 
> Something like:  <snip>
>

I have never used flowscript but I have to say is very cool, but 
unfortunately is not doing what I expect. The script looks like this:

function main() {
    var count = 0;
    var path=cocoon.parameters["report"];
    var param=getRequestParameters();
    var bytes=0;
    var outputStream = new com.spectron.cocoon.SpectronOutputStream();
    //
    cocoon.processPipelineTo(path+'.pdf_pipe?'+param,'',outputStream);
    for(
        bytes=outputStream.size();
        !outputStream.isClosed();
        count++,bytes=outputStream.size()
    ) {
        cocoon.sendPageAndWait("progress.jx", {"stream_size" : 
bytes,"count":count } );
    }
    // PDF is finished, now display it:
    cocoon.sendPage(
        "pdf-display/"+path+'?'+getRequestParameters(),
        {byteArray : new 
java.io.ByteArrayInputStream(outputStream.toByteArray())}
    );
}

It seems that when I do the "cocoon.sendPageAndWait" the 
"cocoon.processPipeline" is aborted because the outputStream.size() 
remains constant. If I remove the for loop it creates the PDF correctly. 
Is there a way to create a thread in flowscript and have the 
"cocoon.processPipeline" run in it?

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


Mime
View raw message