[Zope-CMF] ?is the class definition of CMFCatalogAware incorrect in SkinnedFolder

Florent Guillaume fg@nuxeo.com
Fri, 13 Sep 2002 16:12:27 +0000 (UTC)


Tim Hoffman  <timhoffman@cams.wa.gov.au> wrote:
> Hi
> 
> I am playing with some mixin classes that I want all CMF content types
> to use (I am experimenting further with Unique ID's for content)
> 
> I am working with CMF 1.3
> 
> In CMFCore,  PortalFolder inherits from DynamicType, CMFCatalogAware and
> Folder, 
> 
> Where as CMFDefault.SkinnedFolder on the other hand inherits from 
> CMFCatalogAware then PortalFolder.
> 
> Now I have to ask why is CMFCatalogAware being respecified in
> PortalSkinnedFolder? I believe that this is a hold over from pre CMF 1.3
> (ie CMF 1.2) when PortalFolder only inherited from Folder and
> DynamicType. So catalog awareness in SkinnedFolder needed
> CMFCatalogAware.

SkinnedFolder re-inherits from CMFCatalogAware so that it has the right
indexObject, unindexObject and reindexObject methods that are disabled
in PortalFolder. SkinnedFolder is thus explicitely made a full Catalog-
(and workflow-) aware object.

> The current arrangement causes problems if one wants to modify the 
> PortalFolder implementation, as CMFCatalogAware defines manage_afterAdd,
> manage_afterClone etc and if one is trying to change these behaviours 
> in a portalFolder (ie create each of these methods then call the method
> in the new mixin class and in CMFCatalogAware) that is all well and good
> except that SkinnedFolder inherits from CMFCatalogAware before
> PortalFolder so this new behaviour in PortalFolder is hidden, from
> SkinnedFolder 

If you're changing code, why not directly change CMFCatalogAware?
That's where I'd put the changes if I had to do them.

> It would seem that SkinnedFolder should just be inheriting from
> PortalFolder.

But then we'd have to put three explicit functions like

    def indexObject(self):
        " "
        CMFCatalogAware.indexObject(self)

which is probably not the cleanest way to do it.

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com