## a little twist to this great script will
## allow you to map a 'News Item' to the folder 'newsitems',
## an 'Image' to the folder 'graphics', and so on.
o=getattr(state_change, 'object')
obj_parent=o.aq_parent
portal_root=context.portal_url.getPortalObject()
content_type = o.getTypeInfo().getId()
mappings = {'News Item' : 'newsitems'
,'Image' : 'graphics'
. . .
,}
if content_type in mappings.keys():
portal_root[mappings[content_type]].manage_pasteObjects( obj_parent.manage_cutObjects(o.getId()) )
|