Scripting ExternalFile
Hello everyone, I've got a script that generates HTML content on a regular basis, and I want to be able to make it visible via Zope. The ExternalFile product is just about perfect, except that I want to be able to script the "inclusion" of files into the Zope infrastructure rather than go ExternalFile's GUI each time. I can't just leave the HTML content out in the file system; I need to be able to manage access using Zope's security system. Has anyone got any pointers on how to do this, or even point me in the right direction? Thanks in advance Dave Mitchell
David Mitchell wrote at 2003-8-28 20:45 +1000:
I've got a script that generates HTML content on a regular basis, and I want to be able to make it visible via Zope. The ExternalFile product is just about perfect, except that I want to be able to script the "inclusion" of files into the Zope infrastructure rather than go ExternalFile's GUI each time.
I can't just leave the HTML content out in the file system; I need to be able to manage access using Zope's security system.
Has anyone got any pointers on how to do this, or even point me in the right direction?
Any Zope object provides methods to manage its content. The Management Interface (ZMI) use (part of) these methods to perform its task. You can either: * look at the ZMI source to find out which methods it uses * look at the source to find out which methods are available * use my "DocFinder" product to get this information <http://www.dieter.handshake.de/pyprojects/zope> Dieter
I've got a script that generates HTML content on a regular basis, and I want to be able to make it visible via Zope. The ExternalFile product is just about perfect, except that I want to be able to script the "inclusion" of files into the Zope infrastructure rather than go ExternalFile's GUI each time.
I can't just leave the HTML content out in the file system; I need to be able to manage access using Zope's security system.
Has anyone got any pointers on how to do this, or even point me in the right direction?
Dieter already told you how to find the appropriate methods. Depending on how you do your generating, you can call them from your script by any of several methods. 1) HTTP request. Just like a web browser, but automated. Fabricate a request and send it. Python's 'urllib2' will do nicely, as may curl or wget. Most other languages have similar facilities. 2) The 'Zope.App' method. Search the lists. 3) XML-RPC, which you can get at in most languages. Probably other ways (ZEO, anybody?), but these are most obvious to me. You may also want to look at LocalFS, which may be the easiest way of doing it, provided you can live with the names in Zope being the same as on the FS. --jcc
Hi David, David Mitchell wrote:
I've got a script that generates HTML content on a regular basis, and I want to be able to make it visible via Zope.
I'd have this script, or another, pump the generated HTML into the ZODB as normal Zope file objects...
I can't just leave the HTML content out in the file system; I need to be able to manage access using Zope's security system.
Makes this _much_ easier... cheers, Chris PS: DOn't worry about Data.fs bloat, that's what packign was invented for ;-)
participants (4)
-
Chris Withers -
David Mitchell -
Dieter Maurer -
J Cameron Cooper