[Seaside] Serving non-html dynamically

Julian Fitzell jfitzell at gmail.com
Fri Jul 2 18:20:16 UTC 2010


Note that's 2.8. In 3.0 you would call "self requestContext response"
to get a response object and then use instance-side methods to set it
up as you want. Or

self requestContext respond: [ :response | "set up your response here" ]

You might also like to create a RequestHandler subclass if you are
doing a lot of this and the URLs are more "REST-like" (rather than
doing this in a component).

Julian

On Fri, Jul 2, 2010 at 5:24 PM, James Foster <Smalltalk at jgfoster.net> wrote:
> Hi Sven,
>
> I have occasion to return dynamically generated documents that open in Excel. The following gives the general approach (where 'self returnCSV' is in an anchor callback block):
>
>
> MyWAComponent>>#'returnCSV'
>
>        | response |
>        response := WAResponse
>                document: self asCSV
>                mimeType: (WAFileLibrary mimetypeFor: 'csv')
>                fileName: self caption , ' (' , DateAndTime now printString , ').csv'.
>        response doNotCache.
>        self session returnResponse: response.
>
> James
>
>
> On Jul 2, 2010, at 1:24 AM, Sven Van Caekenberghe wrote:
>
>> Hi,
>>
>> Does anybody know or can point me to a simple/elegant solution to serving non text/html content dynamically using Seaside ?
>>
>> Say you have a Seaside app that generates dynamic reports in formats like PDF or XLS, how to you generate such an answers ? Serving dynamically generated images like graphs would be another use case.
>>
>> TIA,
>>
>> Sven
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list