[Zope] copy / paste - paste checking for valid objects

Dieter Maurer dieter@handshake.de
Tue, 28 Jan 2003 20:32:05 +0100


philrobinson wrote at 2003-1-28 16:00 -0000:
 > I allow people to copy various kinds of objects to
 > the clipboard (using manage_copyObjects()) using
 > a cookie.
 > 
 > If 'cb_dataValid', then I present a button to let
 > them 'manage_pasteObjects()' back again.
 > 
 > But I want to restrict what objects they can
 > paste back out depending on where they are
 > trying to paste it.
 > 
 > For example, they might have copied an object 
 > of type 'a', which can meaningfully be pasted 
 > back into location 'b' but not location 'c'.
 > 
 > So I want my paste button to appear when
 > context is 'b', but not when it is 'c'. It seems to me
 > that I need a way to check the clipboard contents
 > in addition to just cb_dataValid.
 > 
 > Any ideas?
You know Zope is Open Source?

  You have the sources!

  Look at the implementation of "manage_pasteObjects"
  (in "OFS.CopySupport.CopyContainer").

  Of course, it, too, must look in the clipboard content...


Dieter