Function processPipelineTo([String] uri, [Object] bizData, [java.io.OutputStream] stream)
The api says is should be an object...
So maybe try
cocoon.processPipelineTo(fmt+"_pipe/"+url, {} ,output_stream); //using object literal
I don't know if you need a context but you sure aren't setting any...
Cheers,
Robby
-----Original Message-----
From: Fawzib Rojas [mailto:f_rojas@spectron-msim.com]
Sent: Friday, March 19, 2010 6:43 PM
To: users@cocoon.apache.org
Subject: Re: Runnable in flowscript?
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
|