Re: [Zope] Automatically Populating the title Property on html filesimported via ftp
Rik Hoekstra wrote:
I've been trying to figure out a way to do this and have been banging my head against the wall. The end user still want's to edit the site with dreamweaver but needs the titles to show up in the catalog search. When using the ftp interface you lose properties that have been set, and you have nothing set on new documents. Any suggestions?
If you want to work really hard, you could create your own kind of object that parsed the title out of the HTML that gets FTPed up.
Other than that, I can't think of any better way than getting an
editor
that speaks HTTP in a scriptable way or XML-RPC.
-Michel
A colleague of mine wrote up an object that sucks files of the local filesystem, replaces the start of the doc with <dtml-var standard_html_header> and the bottom with footer, and nicks whatever is within <TITLE></TITLE> to make the Title property of the DTML-doc.. Works rather neatly, but is still in development.. I'll talk to him about making it a product if it is stable and someone are interested.. Doesn't help you with ftp, though ..
AFAIK this is already included with the zope distribution. Look for <zope root>/utilities/load_site.py. This only works with the filesystem and not for ftp, but you might use it in some way.
Rik
Works that way. You have to do some small changes in DTMLDocument.py and in the code provided by Oleg Broytman. You can find it in load_site-py. I have a working adaption for ftp/http-put that does nearly the same job as does load_site for files. I am just working on it because I need a way to tell Zope *not to change* the code in certain cases and because one thing that does not work is adding the meta-information as an additional property. If you're interested, I'll send you that code and a bit of documentation though both is *extremely* ugly (still learning python ...) BTW, I tried ob.manage_addProperty and the like from DTMLDocument.py to add metainformation but the only thing I achieved was adding a property to the parent folder or different sorts of errors (sorry, I'm writing out of memory, so no tracebacks:-). Any hints? Chris -- Webteam der Universität Bielefeld mailto:webteam@uni-bielefeld.de Tel. 0521 / 106-3651
participants (1)
-
Webteam der Uni Bielefeld