Re: export excel file via an OutputStream

2008-04-02 Thread Erik van Oosten
That looks like an excellent API. Would it be very hard to implement this? Personally I am also looking for something like this, but then bookmarkable. I got some suggestions on how to do this with the current APIs, but I did not like them at all. So now I am using a servlet. Regards,

Re: export excel file via an OutputStream

2008-04-02 Thread Igor Vaynberg
it is trivial to implement and can be pretty much factored out of downloadlink. -igor On Tue, Apr 1, 2008 at 11:35 PM, Erik van Oosten [EMAIL PROTECTED] wrote: That looks like an excellent API. Would it be very hard to implement this? Personally I am also looking for something like this,

Re: export excel file via an OutputStream

2008-04-02 Thread Johan Compagner
stream = class AbstractResourceStreamWriter() { public void write(OutputStream output) { // do youre writing } } getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(stream).setFileName(file.xls)); johan On Tue, Apr 1, 2008 at 9:31 AM, [EMAIL PROTECTED] wrote: Hello: I am

Re: export excel file via an OutputStream

2008-04-02 Thread dvd
That is exactly what I am looking for. Perhaps someone could show a sample of implementation or even better to make it in the release? Sorry if there was any misunderstanding of my question but this is something Wicket should excel against other frameworks. That looks like an excellent API.

Re: export excel file via an OutputStream

2008-04-02 Thread dvd
Never mind. I just saw and tested Johan Campagner's posted solution and it resolves all issues. This is why I like Wicket and its developers. That is exactly what I am looking for. Perhaps someone could show a sample of implementation or even better to make it in the release? Sorry if there was

export excel file via an OutputStream

2008-04-01 Thread dvd
Hello: I am trying to export dynamically generated excel file. The generator would send the file.xls to an OutputStream. In wicket, I am trying to use example as below but  how can I connect the OutputStream to the inputstream ins.  Pipedoutputstream would block. Using a separate thread is not

Re: export excel file via an OutputStream

2008-04-01 Thread Igor Vaynberg
see Streams.copy() in wicket utils package -igor On Tue, Apr 1, 2008 at 12:31 AM, [EMAIL PROTECTED] wrote: Hello: I am trying to export dynamically generated excel file. The generator would send the file.xls to an OutputStream. In wicket, I am trying to use example as below but how

Re: export excel file via an OutputStream

2008-04-01 Thread dvd
This does not apply as it copies input to output. My issue is that in OnClick() I call excelGen(OutputStream) to produce the bytes on the fly. but the ResourceStream needs InputStream that wicket would read data to send as response. My take is that I need to get a handle of the reponse

Re: export excel file via an OutputStream

2008-04-01 Thread Igor Vaynberg
is it really that difficult to do some legwork? the hint in downloadlink is to do getrequestcycle().setrequesttarget(new irequesttarget() {..}); irequesttarget has a respond(requestcycle cycle); cycle in turn has a cycle.getresponse().getoutputstream(). -igor On Tue, Apr 1, 2008 at 12:59 AM,

Re: export excel file via an OutputStream

2008-04-01 Thread dvd
In a raw servlet programming, it is trivial, just get response outputstream, set headers and pass it to the excelGen (as a poorman's way, close the connection after done) Wicket got to have a more structured api for this common task. This one (even with model args) falls to the same category of

Re: export excel file via an OutputStream

2008-04-01 Thread dvd
FY. Once you reach getResponse.getOutputStream, you are back to square one with servlet programming. wtf -igor On Tue, Apr 1, 2008 at 1:12 AM, [EMAIL PROTECTED] wrote: In a raw servlet programming, it is trivial, just get response outputstream, set headers and pass it to the excelGen

Re: export excel file via an OutputStream

2008-04-01 Thread Mats Norén
What's the problem with that? You want an OutputStream to send to your excelGen and Igor showed you how to obtain one...what else do you need? /M On Tue, Apr 1, 2008 at 12:06 PM, [EMAIL PROTECTED] wrote: FY. Once you reach getResponse.getOutputStream, you are back to square one with

Re: export excel file via an OutputStream

2008-04-01 Thread Nino Saturnino Martinez Vazquez Wael
I guess what he wanted where something like response.writeArray or like? Mats Norén wrote: What's the problem with that? You want an OutputStream to send to your excelGen and Igor showed you how to obtain one...what else do you need? /M On Tue, Apr 1, 2008 at 12:06 PM, [EMAIL PROTECTED]

Re: export excel file via an OutputStream

2008-04-01 Thread James Carman
Well, if you're using WicketFilter, then you can just write your own servlet. If WicketFilter doesn't think it's responsible for the request, it'll let it flow through. So, you could just code this using Servlets anyway. Wouldn't extending WebResource and using ResourceLink be the way to do

Re: export excel file via an OutputStream

2008-04-01 Thread Nino Saturnino Martinez Vazquez Wael
James Carman wrote: Well, if you're using WicketFilter, then you can just write your own servlet. If WicketFilter doesn't think it's responsible for the request, it'll let it flow through. So, you could just code this using Servlets anyway. I think the point were that he wanted something

Re: export excel file via an OutputStream

2008-04-01 Thread Peter Ertl
use AbstractResourceStreamWriter Wicket got to have a more structured api for this common task. usually it's not wicket but you when something is not working the way you expect it Am 01.04.2008 um 09:31 schrieb [EMAIL PROTECTED]: Hello: I am trying to export dynamically generated

Re: export excel file via an OutputStream

2008-04-01 Thread Al Maw
I think he makes a valid point, personally. People do want to do this sort of thing quite frequently. It wouldn't kill us to implement an OutputStreamLink that looked like this: add(new StreamingLink(link) { public String getFileName() { return download.xls; } public String