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: Runnable in flowscript?
Date Fri, 19 Mar 2010 17:42:38 GMT
Yes those are all typos the exception I'm getting is not typo related. :)
I'll post the real code I'm using for debugging:

function create_pdf() {
     var use_background_thread=true;
     var path=cocoon.parameters["report"];
     var fmt=cocoon.parameters["format"];
     var queryInfo=getRequestParameters();
     var url=path+"?"+queryInfo;
     var output_file=java.io.File.createTempFile(path,".pdf");
     var output_stream=new 
com.spectron.io.FileProgressOutputStream(output_file);
     //
     if(use_background_thread){
         var r = new java.lang.Runnable() {
             run: function() {
                 // gives an exception here on the console
                 
cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);
                 output_stream.close();
             }
         };
         new java.lang.Thread(r).start();
         // this works, just never finishes because of exception in thread
         while(!output_stream.isClosed()) {
             cocoon.sendPageAndWait("progress.jx",{ "length" : 
output_file.length(), "output_path" : output_file.getCanonicalPath(), });
         }
     }else{
         cocoon.processPipelineTo(fmt+"_pipe/"+url,'',output_stream);
         output_stream.close();
     }
     cocoon.sendPage( fmt+"_pipe/"+url, {file_name : 
output_file.getCanonicalPath() } );
}

On 3/19/2010 1:01 PM, Robby Pelssers wrote:
> I actually see a bunch of typos (?)  Always indent your code properly dear friend so
it's easy to track errors... I indented your code for this little exercise without making
any modifications...
> So check yourself if those are typos or not !!
>
> Cheers,
> Robby Pelssers
>    


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


Mime
View raw message