[Zope3-checkins] CVS: Zope3/src/zope/app/container - configure.zcml:1.13 copypastemove.py:1.10

Stephan Richter srichter@cosmos.phy.tufts.edu
Sun, 8 Jun 2003 12:40:17 -0400


Update of /cvs-repository/Zope3/src/zope/app/container
In directory cvs.zope.org:/tmp/cvs-serv32472/src/zope/app/container

Modified Files:
	configure.zcml copypastemove.py 
Log Message:
Cleaned up a couple of things about container versus folder:

1. Copy, Cut and Paste support is defined in zope.app.container, so 
   IContainer should be able to execute these actions, not only Folder.

2. Show Copy, Cut and Paste button even though there is no content.

3. Remove IFolder specific tests and ZCML declarations.

Wow, I should have found this bug a long time ago, when I was working on 
Zwiki, but I cheated back then by using Folder as base class...writing
documentation really helps to track these type of problems down.

XXX: The content and browser/content directives look very aged and could be
     redone much better now.


=== Zope3/src/zope/app/container/configure.zcml 1.12 => 1.13 ===
--- Zope3/src/zope/app/container/configure.zcml:1.12	Fri Jun  6 12:21:27 2003
+++ Zope3/src/zope/app/container/configure.zcml	Sun Jun  8 12:39:46 2003
@@ -60,35 +60,35 @@
 
   <adapter
      provides="zope.app.interfaces.container.ICopySource"
-     for="zope.app.interfaces.content.folder.IFolder"
+     for="zope.app.interfaces.container.IContainer"
      permission="zope.ManageContent"
      factory="zope.app.container.copypastemove.CopySource"
      />
 
   <adapter
      provides="zope.app.interfaces.container.INoChildrenCopySource"
-     for="zope.app.interfaces.content.folder.IFolder"
+     for="zope.app.interfaces.container.IContainer"
      permission="zope.ManageContent"
      factory="zope.app.container.copypastemove.NoChildrenCopySource"
      />
 
   <adapter
      provides="zope.app.interfaces.container.IMoveSource"
-     for="zope.app.interfaces.content.folder.IFolder"
+     for="zope.app.interfaces.container.IContainer"
      permission="zope.ManageContent"
      factory="zope.app.container.copypastemove.MoveSource"
      />
 
   <adapter
      provides="zope.app.interfaces.container.IPasteTarget"
-     for="zope.app.interfaces.content.folder.IFolder"
+     for="zope.app.interfaces.container.IContainer"
      permission="zope.ManageContent"
      factory="zope.app.container.copypastemove.PasteTarget"
      />
 
   <adapter
      provides="zope.app.interfaces.container.IPasteNamesChooser"
-     for="zope.app.interfaces.content.folder.IFolder"
+     for="zope.app.interfaces.container.IContainer"
      permission="zope.ManageContent"
      factory="zope.app.container.copypastemove.PasteNamesChooser"
      />


=== Zope3/src/zope/app/container/copypastemove.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/container/copypastemove.py:1.9	Sat Jun  7 02:37:22 2003
+++ Zope3/src/zope/app/container/copypastemove.py	Sun Jun  8 12:39:46 2003
@@ -20,6 +20,7 @@
 from types import StringTypes
 from zope.app.event import publish
 from zope.app.event.objectevent import ObjectModifiedEvent
+from zope.app.interfaces.container import IContainer
 from zope.app.interfaces.container import IContainerNamesContainer
 from zope.app.interfaces.container import ICopySource, INoChildrenCopySource
 from zope.app.interfaces.container import IMoveSource
@@ -36,6 +37,7 @@
 class PasteTarget:
 
     implements(IPasteTarget)
+    __used_for__ = IContainer
 
     def __init__(self, container):
         self.context = container