copy / paste - paste checking for valid objects
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? Thanks in advance... Cheers. -------------------------------------- Phil Robinson. philrobinson@ponytrot.net --------------------------------------
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
participants (2)
-
Dieter Maurer -
philrobinson