[Zope] How do I include a file into a DTML box?

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Tue, 3 Apr 2001 11:25:44 +0200


> Hi!

> At http://www.iglu.org.il/ we have a front page which contains several
> left boxes ( a la slashdot). One of them displays the status of the latest
> Linux kernel version.

> At the moment it is updated manually but I wrote a script to automatically
> generate it based on information from www.linuxhq.com.

> The file with the HTML code is somewhere on the computer's directory
> structure, and I wish to include it as part of the box (or at least to
> write a script that will modify it inside zope).

> How do I do such a thing?

Quick&dirty (not really dirty, but sure quick): 
Take a look at the LocalFS Product, it makes it possible to
get through to the local fs.

Zope-integrated:
 Take a look at ZPublisher.Client, a small howto is at
http://www.zope.org/Members/lstaffor/ZClientMethod
to see how to write an external method which does everything 
which your script does. Perhaps zope in 2.3 you can use a 
python-script for this task, don't know that though.
This opens the problem to periodically fetch the data,
but it would make it possible to get it again for every 
client-request (which you don't want to do I guess).


A mix between the two.
Take a look at utilities/load_site.py in your zope-directory to see  
the necessary things to do to add methods/folders via script. 
You just have to construct the right URIs to call inside your 
script which add a method/text file through a web interface.

You can also use ftp-access or DAV to easily put the data into
zope.

cheers,
oliver