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

Marco Primi marco.primi at lu.unisi.ch
Tue May 15 10:05:08 UTC 2007


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?
Ciao
Marco

(P.S. Using seaside 2.6 on VW, but that shouldn't matter much)



More information about the seaside mailing list