[Zope-dev] Writing custom folderish products

Martijn Faassen faassen@vet.uu.nl
Sat, 20 Nov 1999 00:00:37 +0100


s341625@student.uq.edu.au wrote:
> On 11/19/99, 9:32:08 PM, Martijn Faassen <faassen@vet.uu.nl> wrote
> regarding Re: [Zope-dev] Writing custom folderish products:
>

[VisualZope explanation snipped]

Hm, I'm not sure I get that yet. I have a difficult time understanding
VisualZope, I'm afraid...seeing a working demo would *really* help in my
understanding of it; I tried to install it again today but ended up with
javascript errors. Once I really understand what it's for and what it can
do, I'll be far more able to understand your explanations on how it works.

From what I understand it does sound way cool, though. :)

[ZClass based approach:]
> * Create a Zclass based on a folder and objectManager (this is
> important - an objectManager is always required for some reason)

And 'folder' is in fact not necessary; objectManager is enough.

> * In the Methods area of this class create another zclass (say,
> "MyObject"
> * Then, in the SubObjects area pick MyObject as an object that can be
> added within this folder
>
> Thats it!  The user will only see MyObject in the "Add Object"
> dropdown!

I know this -- I've done this myself. But what I'm developing is a Python-only
product; no ZClasses involved. I have a set of field classes (all deriving
from a common base class; these are Zope products) and I want to make a
folderish class to which they can be added. They shouldn't be addable
anywhere else (in normal folders, for instance).

Going through the source I found some stuff involving all_meta_types,
meta_types and lots of magic code (to me) that seems to make products
addable to folders. Zope's sources could use some documenting though.. I am
assuming there is a clean mechanism to say: 'these products can only be
added to this ObjectManagerish product, and nowhere else'. Could a real Zope
Guru speak up now?

On the bright side, all this Zope source digging does mean I know my way
around significant parts of it now; don't understand much of it yet, but all 
helps on my road to the Zen, I suppose. :)

Regards,

Martijn