[Zope] External Method Help - Rendered HTML to Disk

Samir Mishra SamirMishra at cbuae.gov.ae
Tue Jan 20 00:53:47 EST 2004


Hello All,

I'm experiencing a mental block on this, hoping someone can help with some
pointers, resources to get me started on the right path.

I'd like to have a generic DTML method (or preferably a python script), call
it write2FS, that can be called as, e.g.

http://my-zope-site//somefolder/index_html/write2FS?filename=somepath%2Fsome
file

and this will create a file called {ZOPEPATH}/var/somepath/somefile.html
containing the rendered version of index_html. Optionally, 

1. if a filename is not supplied to the method above, the script/method will
render & write index_html to file {ZOPEPATH}/var/someFolder/index_html.html.


2. if the method is invoked as
http://my-zope-site//someFolder/index_html/write2FS?filename=somepath%2Fsome
file&link=someOtherFolder%2FZopeObj it will write a file named
{ZOPEPATH}/var/somepath/somefile.html containing the rendered elements of
http://my-zope-site//someOtherFolder/ZopeObj

I hope the above is intelligible. 

My motivation for the above is that I'm dealing with a lot of dynamic
financial time series data, up to a point. Once the data is published, e.g.
at the end of a week/month, it is static. Therefore, instead of performing a
DB query each time a report is requested, I'd like to save the canned
reports as static pages once data is published and have apache handle them. 

Later, perhaps I'll consider saving the reports in a DB as text BLOBs.

Thanks in advance.

Samir.



More information about the Zope mailing list