[CMF-checkins] CVS: CMF/CMFDefault - DiscussionItem.py:1.25

Florent Guillaume fg@nuxeo.com
Sat, 29 Jun 2002 22:11:51 -0400


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv13933/CMFDefault

Modified Files:
	DiscussionItem.py 
Log Message:
Fixed handling of discussion items so that they are correctly indexed,
unindexed and reinserted into the workflows when copied or moved.

This gets rid of the ugly "ERROR(200) Catalog uncatalogObject
unsuccessfully attempted to uncatalog an object with a uid of ..."
errors when deleting an object that had discussion items and that had
been copied.


=== CMF/CMFDefault/DiscussionItem.py 1.24 => 1.25 ===
                     REQUEST.RESPONSE.notFoundError("%s\n%s" % (name, ''))
 
+    security.declarePrivate('manage_afterAdd')
+    def manage_afterAdd(self, item, container):
+        """
+            We have juste been added or moved.
+            Add the contained items to the catalog.
+        """
+        if aq_base(container) is not aq_base(self):
+            for obj in self.objectValues():
+                obj.__of__(self).manage_afterAdd(item, container)
+
+    security.declarePrivate('manage_afterClone')
+    def manage_afterClone(self, item):
+        """
+            We have just been cloned.
+            Notify the workflow about the contained items.
+        """
+        for obj in self.objectValues():
+            obj.__of__(self).manage_afterClone(item)
+
     security.declarePrivate( 'manage_beforeDelete' )
     def manage_beforeDelete(self, item, container):
         """