manage_pasteObjects and REQUEST
Hi! Does anyone know when manage_PasteObjects will stop requiring REQUEST to be passed? I want to mimick the Cut/Copy/Paste Support of the management interface in a UI of my own. my method "objectsCut" holds: <dtml-call "manage_cutObjects(REQUEST['ids'], REQUEST)"> while my "objectsPaste" method holds: <dtml-call "manage_pasteObjects(_.None, REQUEST)"> Pasting objects will sometimes (!?!) redirect me to the management interface, which I want to hide. I found these last lines in manage_pasteObjects (CopySupport.py): def manage_pasteObjects(self, cb_copy_data=None, REQUEST=None): """Paste previously copied objects into the current object. If calling manage_pasteObjects from python code, pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument.""" ... ... ... if REQUEST is not None: REQUEST['RESPONSE'].setCookie('__cp', 'deleted', path='%s' % cookie_path(REQUEST), expires='Wed, 31-Dec-97 23:59:59 GMT') REQUEST['__cp'] = None return self.manage_main(self, REQUEST, update_menu=1, cb_dataValid=0) I don't want to hack this file. The only way to get the cookie set seems to be passing the REQUEST object. "...pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument" This doesn't help me very much. It would help me if I wanted to Copy/Paste or Cut/Paste at the same time: <dtml-call "REQUEST.set('my_clipboard_data', manage_cutObjects(REQUEST['ids'], REQUEST))"> <dtml-call "manage_pasteObjects(my_clipboard_data)"> works fine, but if I want to do Copy and Paste at completely different times, I have to pass my_clipboard_data along the requests all the time. Is there a simple solution? Is it something I should put in the Bug Collector? Or did I miss something? Thank you very much for your help, Danny
I normally do this by using a session variable, per user. <dtml-call "ses.set('cb',manage_cutObjects(REQUEST['ids']))"> <dtml-call "manage_pasteObjects(cb_copy_data=ses.get('cb') )"> or similar I normally use the CoreSession stuff. hth Phil ----- Original Message ----- From: "Danny William Adair" <danny@adair.net> To: <zope-dev@zope.org> Sent: Monday, August 13, 2001 10:13 PM Subject: [Zope-dev] manage_pasteObjects and REQUEST
Hi!
Does anyone know when manage_PasteObjects will stop requiring REQUEST to be passed? I want to mimick the Cut/Copy/Paste Support of the management interface in a UI of my own.
my method "objectsCut" holds: <dtml-call "manage_cutObjects(REQUEST['ids'], REQUEST)">
while my "objectsPaste" method holds: <dtml-call "manage_pasteObjects(_.None, REQUEST)">
Pasting objects will sometimes (!?!) redirect me to the management interface, which I want to hide. I found these last lines in manage_pasteObjects (CopySupport.py):
def manage_pasteObjects(self, cb_copy_data=None, REQUEST=None): """Paste previously copied objects into the current object. If calling manage_pasteObjects from python code, pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument.""" ... ... ... if REQUEST is not None: REQUEST['RESPONSE'].setCookie('__cp', 'deleted', path='%s' % cookie_path(REQUEST), expires='Wed, 31-Dec-97 23:59:59 GMT') REQUEST['__cp'] = None return self.manage_main(self, REQUEST, update_menu=1, cb_dataValid=0)
I don't want to hack this file. The only way to get the cookie set seems to be passing the REQUEST object.
"...pass the result of a previous call to manage_cutObjects or manage_copyObjects as the first argument"
This doesn't help me very much. It would help me if I wanted to Copy/Paste or Cut/Paste at the same time:
<dtml-call "REQUEST.set('my_clipboard_data', manage_cutObjects(REQUEST['ids'], REQUEST))"> <dtml-call "manage_pasteObjects(my_clipboard_data)">
works fine, but if I want to do Copy and Paste at completely different times, I have to pass my_clipboard_data along the requests all the time.
Is there a simple solution? Is it something I should put in the Bug Collector? Or did I miss something?
Thank you very much for your help,
Danny
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Danny William Adair writes:
Does anyone know when manage_PasteObjects will stop requiring REQUEST to be passed? I want to mimick the Cut/Copy/Paste Support of the management interface in a UI of my own.
my method "objectsCut" holds: <dtml-call "manage_cutObjects(REQUEST['ids'], REQUEST)">
while my "objectsPaste" method holds: <dtml-call "manage_pasteObjects(_.None, REQUEST)">
Pasting objects will sometimes (!?!) redirect me to the management interface, which I want to hide. In these cases, you do not ignore the return value of "manage_pasteObjects" (which you should do).
Dieter
participants (3)
-
Danny William Adair -
Dieter Maurer -
Phil Harris