[Zope] Problem with cut and paste
Jerome Alet
alet@unice.fr
Sat, 27 Jan 2001 16:18:28 +0100
Hi,
I'm trying to modify OFS/dtml/main.dtml and OFS/CopySupport.py
in order to create a shortcut button to cut an object and paste it
in the parent object in one click, because I think this may
save lots of boring clicks, at least for me.
When I call the following method from the management interface
(main.dtml) then I receive this error:
"The data in the clipboard could not be read, possibly due to
cookie data being truncated by your web browser.
Try copying fewer objects."
But when I call if from a PythonScript it works fine.
My method, bound to a MoveUp button of my own:
--CUT---
def manage_moveupObjects(self, ids=None, REQUEST=None):
"""Moves the selected objects to the parent objets (e.g. Folder)"""
if ids is None and REQUEST is not None:
return eNoItemsSpecified
elif ids is None:
raise ValueError, 'ids must be specified'
if type(ids) is type(''):
ids=[ids]
if hasattr(self, 'aq_parent') and hasattr(self.aq_parent, 'manage_pasteObjects') :
cb_copy_data = self.manage_cutObjects(ids, REQUEST)
return self.aq_parent.manage_pasteObjects(cb_copy_data, REQUEST)
---CUT---
If I call self.aq_parent.manage_pasteObjects with None as the
first parameter then it works fine from the management
interface but not from a PythonScript: I receive a
"No clipboard data found" error.
Please could someone explain me what the problem is ?
(I want it to work both from the management interface and from Python)
thanks in advance
Jerome Alet