[Zope-dev] Re: external product writing to a file system ?

Kent Polk kent@goathill.org
1 Jun 1999 15:45:44 GMT


On 1 Jun 1999 10:15:01 -0500, Dr. Ross Lazarus wrote:
>It's easy to pull text/html files in to dtml methods or documents using
>an external method. I do it a lot to keep the zope ODB from blowing out
>
>Fully rendering dtml to an html string (same way zope does !) from an
>external method still eludes me. Happy to release the zope equivalent of
>wget once that's working. Anyone ?

This is almost trivial to implement.  My filesystemed database app
looks for *.dtml files as it's walking the fs and loads them as
dtml methods of the SubDir (folderish) object in which they reside.
You can use DTMLMethod.add() or handle it directly with the DTMLMethod
class.  Just send the file contents as the "file=" argument.
Acquisition works just like with zope dtml methods, though you may
well need to futz with the object __roles__ when you add it.  You
also would need to add an 'update' method for the dtml file, which
I haven't gotten around to yet. I just restart the server right
now if I need to edit one. :^) 

Since you can read the dtml source in before creating the method,
you have the opportunity to handle any potential metadata that you
may want to store in the dtml source...

Kent