[Zope] Copy/Paste objects in DTML??

Kevin Dangoor kid@kendermedia.com
Thu, 12 Aug 1999 19:24:49 -0400


Hi,

    I'm trying to do a mass conversion of old Folder objects into shiny new
ZClasses, and I need to copy all of the subobjects of the Folder and paste
it into the new ZClass. The subobjects are primarily Images.

Here is what I was trying to use:

[in the context of the old Folder]
<dtml-if "objectIds()">
<dtml-call "REQUEST.set('cdata', manage_copyObjects(objectIds(), _.None,
_.None))">
<dtml-else>
<dtml-call "REQUEST.set('cdata', '')">
</dtml-if>

[in the context of the new ZClass]
<dtml-call "manage_pasteObjects(REQUEST['cdata'], _.None)">


I get an error stating that the object referred to in the clipboard was not
found. Here is the last chunk of the traceback:

  File C:\Program Files\Byproducts\lib\python\DocumentTemplate\DT_Util.py,
line 315, in eval
    (Object: manage_pasteObjects(REQUEST['cdata'], _.None))
  File &lt;string&gt;, line 0, in ?
  File C:\Program Files\Byproducts\lib\python\OFS\CopySupport.py, line 198,
in manage_pasteObjects
    (Object: CatalogAware)
Copy Error: (see above)


I don't think I've *ever* been able to copy and paste objects properly via
DTML :(

The reason I am calling manage_copyObjects(objectIds(), _.None, _.None) is
that I don't want it to go to the management screens... I am trying to copy
from a bunch of Folders to a bunch of ZClasses in one invocation of the
Method.

What am I doing wrong?

TIA,

Kevin