[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container - contents.py:1.7.2.3

runyaga runyaga@thisbox.com
Wed, 5 Feb 2003 11:06:40 -0500


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

Modified Files:
      Tag: paris-copypasterename-branch
	contents.py 
Log Message:
enable the copy stuff in the UI and
changes to the contents model


=== Zope3/src/zope/app/browser/container/contents.py 1.7.2.2 => 1.7.2.3 ===
--- Zope3/src/zope/app/browser/container/contents.py:1.7.2.2	Wed Feb  5 08:08:17 2003
+++ Zope3/src/zope/app/browser/container/contents.py	Wed Feb  5 11:06:07 2003
@@ -111,7 +111,8 @@
         self.request.response.redirect('@@contents.html')
 
     def pasteObjects(self):
-        '''Iterate over clipboard contents and perform the move/copy operations'''
+        """Iterate over clipboard contents and perform the 
+           move/copy operations"""
         container = self.context
         target = container
         physical = getAdapter(container, IPhysicallyLocatable)
@@ -133,6 +134,22 @@
 
         self.request.response.redirect('@@contents.html')
 
+    def hasClipboardContents(self):
+        """ interogates the PrinicipalAnnotation to see if 
+           clipboard contents exist """ 
+
+        user = self.request.user
+
+        annotationsvc = getService(self.context, 'PrincipalAnnotation')
+        annotations = annotationsvc.getAnnotation(user)
+        clipboard = getAdapter(annotations, IPrincipalClipboard)
+
+        if clipboard.getContents():
+            return True
+
+        return False
+
+        
     def listContentInfo(self):
         return map(self._extractContentInfo,
                    getAdapter(self.context, IZopeContainer).items())