[Zope] Problem with Cut and Paste

Jerome Alet alet@unice.fr
Mon, 29 Jan 2001 18:49:21 +0100


Hi,

First I'm sorry if this message was already received in this list, 
but I'm sure I've not received it to confirm, so I send it again, sorry
for the inconvenience.

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
(OFS/dtml/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