## 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 586 2006-09-28 22:10:21Z joachim $ """ FIXME: add docstring. """ from Products.CMFCore.utils import getToolByName here = context if context.portal_type == "University": here = context.academics ti = getToolByName(here, 'portal_types').getTypeInfo(here.portal_type) meth_id = ti.queryMethodID('view', 'folder_contents') ret_url = here.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(here, id) from Products.CPSCore.EventServiceTool import getPublicEventService evtool = getPublicEventService(here) evtool.notifyEvent('workflow_delete', ob, {}) here.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)