how to get dynamic files?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get dynamic files?

Oleg Korsak
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
Reply | Threaded
Open this post in threaded view
|

Re: how to get dynamic files?

Karsten Kusche
Hi Oleg,

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.

  

_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-- 
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
Reply | Threaded
Open this post in threaded view
|

Re: how to get dynamic files?

jgfoster
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
Reply | Threaded
Open this post in threaded view
|

Re: how to get dynamic files?

Lukas Renggli
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
Reply | Threaded
Open this post in threaded view
|

Re: how to get dynamic files?

keith1y
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.
>  
Hi, in the squeaksource/Jetsam package you will find WAStandardFilePlus
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