request = container.REQUEST
RESPONSE = request.RESPONSE
from DateTime import DateTime
batch_size = int(batch_size)
src = context
if to not in context.objectIds():
to = context.invokeFactory('Large Plone Falder', to)
dst = context.restrictedTraverse(to)
if batch_size < len(src.objectIds()):
start = DateTime()
dst.manage_pasteObjects(src.manage_cutObjects(src.objectIds()[:batch_size]))
end = DateTime()
print """
<html>
<head>
<meta http-equiv="refresh" content="5" />
<title>Moving...</title>
</head>
<body>
<p>Moving...</p>
Moved %d items from "%s" to "%s" at %s sec.
Last %d
</body>
</html>
""" % (batch_size, src.getId(), dst.getId(), 100000*(end-start), len(src.objectIds()))
else:
dst.manage_pasteObjects(src.manage_cutObjects(src.objectIds()))
print """
<html>
<head>
<title>Moving finished!!!</title>
</head>
<body>
<p>Moving finished!!!</p>
Moved all %d items from "%s" to "%s".
</body>
</html>
""" % (len(dst.objectIds()), src.getId(), dst.getId())
return printed