[Seaside] Grabbing the current render stream (to save the current page)

Philippe Marschall philippe.marschall at gmail.com
Tue May 15 10:13:14 UTC 2007


2007/5/15, Marco Primi <marco.primi at lu.unisi.ch>:
> Hi!,
> i'm trying to save the content of the current web page on server side.
>
> example, somewhere in one of my components i have:
>
> AComponent>>renderContentOn: html
> html anchor
>  callback: [self saveCurrentPage ];
>  with: 'Save snapshot'.
>
> what saveCurrentPage should do is just putting the current page in a FileLibrary
> for example, however i see no clean way of doing that.
>
> I tried to look up the stack during a render, found what i want in
> WARender>>buildResponse
>  [...]
>  self writeOnLoadOn: stream.
>  stream close.
>  [...]
>
> if i inspect that stream before the call to close, i find exactly what i want (a
> byte array '<!DOCTYPE ....page... </html>')
> but i found no way to access it AFTER the render has completed or access it from
> a component
>
> Any idea/hack?

What about subclassing WASession and overriding #returnResponse:?

Cheers
Philippe

> Ciao
> Marco
>
> (P.S. Using seaside 2.6 on VW, but that shouldn't matter much)
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list