[Zope] CMFCore.DirectoryView

Dieter Maurer dieter@handshake.de
Mon, 30 Dec 2002 21:12:29 +0100


Elena Schulz wrote at 2002-12-30 15:00 +0100:
 > I try to connect ZPT to my local Filesytem. Previouesly I used localFS and
 > DTML which worked nicely. But according to an earlier post by Dieter I
 > learned that I should use DirectoryView from the CMFCore now.
I did not say, you *should* but you might...

An alternative would be to extend LocalFS such that it recognizes
PageTemplates.

 > But thats not so easy as I found.
 > Does the registration have to be done on every serverstart again? (How to
 > automate it if so?)
Yes, it does.

It is automated by defining a product (or using one that already exists)
that does the registration (e.g.) in its "__init__.py"
 > How to add new extensions and metatypes?
You use either "registerFileExtension" or "registerMetaType".
Look at "CMFCore/FSSTXMethod.py" for examples.

 > Up to now I succeeded to register an arbitrary Directory on my local FS and
 > different MetaTypes with the external Method given below. But a
 > corresponding klass has to be given for the registration. How to do that
 > using classes like the 'FSObject' return bad file error when I try to view
 > the object in ZMI.
Maybe, because it is the abstract base class.
Try "FSFile" or "FSImage" (or whatever other type you need).


Dieter