[Zope] CMFCore.DirectoryView
Dieter Maurer
dieter@handshake.de
Mon, 6 Jan 2003 19:37:51 +0100
Elena Schulz wrote at 2003-1-4 14:12 +0100:
> I checked the version of Kapil which also needs the registration of a
> directory in advance. But if I need it too eargently I'll have to develop my
> skills to get it done .). Maybe on top of Kapils product.
>
> > You can have a general "__init__.py" that registers all directories
> > it finds by some means (e.g. via a configuration file).
>
> So the roadmap would be to get the directory and extensions from a zmi-form,
> register them,
> write all generated dirViews and extensions to a configfile and read them by
> the __init__.py, I guess.
No.
When you really want to make "DirectoryView" work similar to "LocalFS",
this variant will no longer require registration of directories
(and maybe neither extensions).
The registration only provides for a drop down box when you add
a new DirectoryView (and as a cache).
For your own variant, you would take the directory pathname directly
from a property and store the directories content in a
volatile attribute of the instance (or a module cache; do
not forget syncrhonization, in this case).
> > Also, note, that with one directory all subdirectories can also be
> > accessed.
>
> >From the source I found that there is a flag to controll this.
>
> I would like to extent the product in another direction too. How could
> properties be added like to normal Zope-objects. Would it be a big deal to
> achieve that?
It would when you want to do that through the ZMI.
It would probably not be difficult when the properties were defined
in the file system (you would simply combine the object
and an "FSPropertySheet" object).
Dieter