Re: [Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-11-12 Thread yuppie
Charlie Clark wrote:
 Am 11.11.2008 um 16:52 schrieb yuppie:
 
 AFAICT PortalFolder inherits from CMFCatalogAware to make sure it has
 the same manage_afterAdd, manage_afterClone and manage_beforeDelete
 methods as other content classes. But these methods are gone, so I  
 guess
 the dependency is no longer needed.
 
 You didn't hear it from me but this is surely abuse of inheritance?  
 Time to call the cops and stand outside our houses in dressing gowns  
 and slippers tutting and looking superior!

This is the checkin that added CMFCatalogAware to PortalFolder:
http://svn.zope.org/?rev=35114view=rev

It explains why and how it was done. Maybe a first step to clean this up 
would be to split CMFCatalogAware into separate mixins.

Cheers, Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-11-12 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Charlie Clark wrote:
 Am 12.11.2008 um 11:53 schrieb yuppie:
 
 This is the checkin that added CMFCatalogAware to PortalFolder:
 http://svn.zope.org/?rev=35114view=rev
 
 Wow, that's some time ago.
 
 It explains why and how it was done. Maybe a first step to clean  
 this up would be to split CMFCatalogAware into separate mixins.

Or take the responsibility out of the class altogether via event
subscriptions.

 I'm probably missing something but nothing related to IDiscussable  
 seems to be in either PortalFolder or CMFCatalogAware or is that the  
 OpaqueItem stuff?

Yes:  getting the 'talkback' object's items (the comments) catalogued
was the point of the checkin.

 You're probably right to suggest that this should be a two-step  
 change: clean-up CMFCatalogAware; remove it from PortalFolder (it can  
 stay in SkinnedFolder).

If we made the bit about finding the opaque subitems part of the event
subscriber, then we could remove the base class from PortalFolder directly.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJGtWn+gerLs4ltQ4RAgmxAJ9Oe57ZkVkRueZ4cU42Ku39Pzw0BACfRSwC
XjlE1vpczfaMzGlbj1Gsi28=
=MmON
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-11-11 Thread Charlie Clark

Am 29.10.2008 um 16:53 schrieb yuppie:

 I don't think so. OFS.interfaces.IObjectWillBeRemovedEvent is derived
 from OFS.interfaces.IObjectWillBeMovedEvent. So these lines in
 handleContentishEvent() should unindex the object:


 elif IObjectWillBeMovedEvent.providedBy(event):
 if event.oldParent is not None:
 ob.unindexObject()


You are, of course, right and there is a test which tests just this  
feature.  Digging around I've realised that this is because I have  
folderish objects which inherit from PortalFolder which explicitly  
deactivates the ICMFCatalogAware methods. Is there any point in  
implementing ICMFCatalogAware or IWorkflowAware for Folders? What  
would we break if we removed the dependency?

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-11-11 Thread yuppie
Hi Charlie!


Charlie Clark wrote:
 Digging around I've realised that this is because I have  
 folderish objects which inherit from PortalFolder which explicitly  
 deactivates the ICMFCatalogAware methods. Is there any point in  
 implementing ICMFCatalogAware or IWorkflowAware for Folders? What  
 would we break if we removed the dependency?

AFAICT PortalFolder inherits from CMFCatalogAware to make sure it has 
the same manage_afterAdd, manage_afterClone and manage_beforeDelete 
methods as other content classes. But these methods are gone, so I guess 
the dependency is no longer needed.

There might be some code that expects that *all* content classes 
implement ICatalogAware, IWorkflowAware and IOpaqueItemManager, but if 
we add deprecation warnings the other code can be cleaned up.

In the long run I'd like to get rid of CMFCatalogAware completely. Its 
functionality should be moved to adapters and event subscribers.


Cheers,

Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-11-11 Thread Charlie Clark

Am 11.11.2008 um 16:52 schrieb yuppie:

 AFAICT PortalFolder inherits from CMFCatalogAware to make sure it has
 the same manage_afterAdd, manage_afterClone and manage_beforeDelete
 methods as other content classes. But these methods are gone, so I  
 guess
 the dependency is no longer needed.

You didn't hear it from me but this is surely abuse of inheritance?  
Time to call the cops and stand outside our houses in dressing gowns  
and slippers tutting and looking superior!

 There might be some code that expects that *all* content classes
 implement ICatalogAware, IWorkflowAware and IOpaqueItemManager, but if
 we add deprecation warnings the other code can be cleaned up.

+1
It's not as if Folder's behave as content although it is perfectly  
reasonable in my view for Folderish objects to do so.

 In the long run I'd like to get rid of CMFCatalogAware completely. Its
 functionality should be moved to adapters and event subscribers.


Indeed.

And IWorkflowAware should be implemented separately where required, he  
added quietly still working his way through Workflow code. I've  
written an almost generic Transition form for IWorkflowAware objects  
(the workflow should be pumped through the form). Any interest?  
Currently dependent upon adding ?form.workflow_action=xyz to the  
transition action which reminds me of add forms and suggests the whole  
thing probably needs, ahem, revitalising.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-CMF] Missing Event Handler for CMFCatalogAware

2008-10-29 Thread Charlie Clark
Hi,

I noticed in an object derived from CMFCatalogAware that it wasn't  
being removed from the catalogue upon deletion. Looking at the event  
handlers in CMFCatalogAware it's clear that nothing handles  
IObjectWillBeRemovedEvent. Is this intentional or mereley an oversight?

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests