[Zope-CMF] Getting folder contents of objects derived form portal folder

Dieter Maurer dieter@handshake.de
Sun, 9 Jun 2002 20:15:08 +0200


Rainer Thaden writes:
 > Since i got no answer to my question, maybe i should go more into
 > detail:
 > 
 > I derived a ZClass 'Employee' from PortalContent, PortalFolder and
 > DefaultDublinCoreImpl. It's a class for handling employees which 
 > should contain images etc. I implemented a view and edit method, added
 > information in the portal_types tool and set isPrincipiaFolderish=1.
 > Everything works fine except for one thing:
 > 
 > When i add an image to an Employee instance (let's call them 'img'
 > and 'emp') via the 'New...' button in the folder contents, the image
 > is inside the object and can be accessed via http://.../emp/img.
 > 
 > But the image is not listed in the folder contents of 'emp'.
 > Even a call of objectValues() on 'emp' returns no results.
 > It seems as if the instance emp is not considered as a folder in the
 > ZMI (no '+' sign in the tree view).
When you use multiple inheritance (as you do), the derivation order
is relevant:

  I expect, that "PortalContent" (sillily) defines "objectValues", too.
  As you derive first from "PortalContent" and then from "PortalFolder",
  you will get "PortalContent.objectValues".

  It is not clear that changing the derivation order will solve
  all your problems. In fact, the mailing list archives show
  that there will always be a conflict for "manage_afterAdd"
  and "manage_beforeDelete" defined by both of these classes.
  You will need to provide an implementation in your
  derived class that calls them both.

Maybe, further problems of the same kind are lingering...


Dieter