## Script (Python) "folder_delete" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=ids=[], REQUEST=None ##title= ## # $Id: folder_delete.py 486 2006-09-06 10:09:39Z joachim $ """ FIXME: add docstring. """ from Products.CMFCore.utils import getToolByName ti = getToolByName(context, 'portal_types').getTypeInfo(context.portal_type) meth_id = ti.queryMethodID('view', 'folder_contents') ret_url = context.absolute_url() + '/' + meth_id if ids: for id in ids: # XXX has to be called from here since the workflow doesn't handle the # deletion yet ob = getattr(context, id) from Products.CPSCore.EventServiceTool import getPublicEventService evtool = getPublicEventService(context) evtool.notifyEvent('workflow_delete', ob, {}) context.manage_delObjects(ids) message = 'portal_status_message=psm_item(s)_deleted' else: message = 'portal_status_message=psm_select_at_least_one_document' if REQUEST is not None: return REQUEST.RESPONSE.redirect(ret_url + '?' + message)