Hello!
My method in a WAFileLibrary subclass returns dynamic contents (composes it on the fly). But when I'm trying to download it (no matter how many times) - the contents is the same as in the begining. Is it possible to get a dynamically created file from WAFileLibrary so it could be different for each request? Thanks. _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside signature.asc (269 bytes) Download Attachment |
sure you can, i think you need to implement #documentForFile: or #documentAt:ifAbsent:. I think the first returns the data of the file while the second returns a WAResponse with the data and its mimetype. Kind Regards Karsten Oleg Korsak wrote: Hello! My method in a WAFileLibrary subclass returns dynamic contents (composes it on the fly). But when I'm trying to download it (no matter how many times) - the contents is the same as in the begining. Is it possible to get a dynamically created file from WAFileLibrary so it could be different for each request? Thanks. -- Karsten Kusche - Dipl.Inf. - [hidden email] Tel: +49 3496 21 43 29 Georg Heeg eK - Köthen Handelsregister: Amtsgericht Dortmund A 12812 _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Oleg Korsak
Hi Oleg,
Here is how I return dynamic content: renderContentOn: html html anchor callback: [self returnCSV]; with: 'Export CVS file to Excel'; yourself. returnCSV | response | response := WAResponse document: self asCSV mimeType: (WAFileLibrary mimetypeFor: 'csv') fileName: caption , ' (' , DateAndTime now printString , ').csv'. response doNotCache. self session returnResponse: response. Hope that helps, James Foster On Feb 24, 2009, at 5:02 PM, Oleg Korsak wrote: > Hello! > > My method in a WAFileLibrary subclass returns dynamic contents > (composes > it on the fly). But when I'm trying to download it (no matter how many > times) - the contents is the same as in the begining. Is it possible > to > get a dynamically created file from WAFileLibrary so it could be > different for each request? > > Thanks. > > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Oleg Korsak
> My method in a WAFileLibrary subclass returns dynamic contents (composes
> it on the fly). But when I'm trying to download it (no matter how many > times) - the contents is the same as in the begining. Is it possible to > get a dynamically created file from WAFileLibrary so it could be > different for each request? WAFileLibrary sets the header fields so that the browser can cache the files. That's why you don't see any changes. Better write a custom WARequestHandler subclass to create dynamic content. Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
In reply to this post by Oleg Korsak
Oleg Korsak wrote:
> Hello! > > My method in a WAFileLibrary subclass returns dynamic contents (composes > it on the fly). But when I'm trying to download it (no matter how many > times) - the contents is the same as in the begining. Is it possible to > get a dynamically created file from WAFileLibrary so it could be > different for each request? > > Thanks. > which if you subclass, the #documentClass is set to #NonCachedDocument Keith _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |