<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE></TITLE>

<META content="MSHTML 6.00.2800.1528" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2>Hi David,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2>I reviewed OFS.CopySupport.py which is how I knew that eInvalid exception 
is being raised. I also called manage_cutObjects with the REQUEST as you 
mention. That's what is weird about this whole thing. I know that I had 
clipboard data and the __cp cookie is set. Everytime I tried to do the paste, 
I'd get the "cookie truncated" message. You're right about the documentation. As 
with most Zope documentation, it's not that great. Lately, I go straight to the 
source. I find I learn more that way.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=457595813-09032006><FONT color=#0000ff 
size=2>Tom</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> David [mailto:bluepaul@earthlink.net] 
<BR><B>Sent:</B> Thursday, March 09, 2006 12:44 AM<BR><B>To:</B> Palermo, 
Tom<BR><B>Cc:</B> 'zope@zope.org'<BR><B>Subject:</B> Re: [Zope] 
manage_pasteObjects question<BR></FONT><BR></DIV>
<DIV></DIV>Palermo, Tom wrote: 
<BLOCKQUOTE 
cite=mid4E2885D0FE18D64E9DA136C82BB7A773021091B1@bth-exchange.constellagroup.com 
type="cite">
  <META content="MSHTML 6.00.2800.1528" name=GENERATOR>
  <DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
  class=374435100-09032006>Hi David,</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
  class=374435100-09032006></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT color=#0000ff size=2><SPAN 
  class=374435100-09032006>In my last post, I wrote that I tried calling 
  manage_pasteObjects a variety of ways:</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT size=2><SPAN 
  class=374435100-09032006>context.manage_pasteObjects(context.REQUEST)</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT size=+0><SPAN class=374435100-09032006><FONT 
  size=2>context.manage_pasteObjects(context.cb_dataItems())</FONT> 
  </SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006>as well as the 
  original:</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN 
  class=374435100-09032006>context.manage_pasteObjects(cb_copy_data=context.cb_dataItems(),REQUEST=req['__cp'])</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006><FONT color=#0000ff>All 3 of 
  these attemps results in the eInvalid exception gettting raised by 
  manage_pasteObjects( ). req['__cp'] is a reference to the cookie that gets set 
  when you place something on the clipboard. I was trying to grab a specific 
  piece of the REQUEST instead of the whole thing. Does 
  context.manage_pasteObjects(context.REQUEST) need to be written as: 
  context.manage_pasteObjects(REQUEST=context.REQUEST)?</FONT></SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006><FONT color=#0000ff>It's kind 
  of a moot point now anyway. I'm using some SESSION variables now to store the 
  ids of te objects I want to cut and the path of their container so I can do 
  the cut and paste from a single script. Not sure if this is good or not but 
  it's working for me now. It's one of those times when I just need something to 
  work.</FONT></SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=374435100-09032006><FONT 
  color=#0000ff>-Tom</FONT>&nbsp;</SPAN></FONT></DIV>
  <DIV><FONT size=2><BR></FONT></DIV>
  <DIV dir=ltr align=left><BR></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B></B></FONT></DIV><BR></BLOCKQUOTE>Hi Tom,<BR><BR>I'm 
glad you found 'another way' but in the interest of no one I wish to add the 
following.<BR><BR>These methods:&nbsp; manage_copyObjects, manage_cutObjects and 
manage_pasteObjects should be reviewed in /OFS/CopySupport.py - because the 
current docs do not describe them well.<BR><BR>For example, the copy method 
works differently depending on whether you just pass the container's Ids or pass 
the Ids *and* the REQUEST.<BR><BR>No reason to beat a dead horse&nbsp; but of 
the 3 tries you listed only the first can (but conditionally) 
work:<BR><BR>context.manage_pasteObjects(context.REQUEST) <BR><BR>But *only* if 
you first called manage_copyObjects (or manage_cutObject) with the REQUEST as a 
parameter included .... (only then does REQUEST get the __cp object)<BR><BR>Your 
second try:<BR><FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006><FONT 
size=2><BIG>context.manage_pasteObjects(context.cb_dataItems())</BIG></FONT></SPAN></FONT><BR><FONT 
size=+0><SPAN class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006><FONT size=2><BIG>Is wrong because it is passing a list 
of items in the clip board instead of the the encoded copy object (returned by 
manage_copyObjects) that "manage_pasteObjects" 
expects</BIG></FONT></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006><FONT size=2><BIG>Your last try is wrong because both 
parameters are incorrect.</BIG></FONT></SPAN></FONT> :-)<FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006><FONT size=2><BIG><BR>All 
best,</BIG></FONT></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006><FONT 
size=2><BIG>David</BIG></FONT></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><FONT size=+0><SPAN 
class=374435100-09032006></SPAN></FONT><BR><BR><BR></BODY></HTML>