Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFCore.CMFCatalogAware Namespace Reference

Classes

class  CMFCatalogAware

Functions

def handleContentishEvent
def handleDynamicTypeCopiedEvent
def dispatchToOpaqueItems
def handleOpaqueItemEvent

Variables

tuple logger = logging.getLogger('CMFCore.CMFCatalogAware')

Function Documentation

Dispatch an event to opaque sub-items of a given object.

Definition at line 277 of file CMFCatalogAware.py.

00277 
00278 def dispatchToOpaqueItems(ob, event):
00279     """Dispatch an event to opaque sub-items of a given object.
00280     """
00281     for opaque in ob.opaqueValues():
00282         s = getattr(opaque, '_p_changed', 0)
00283         for ignored in subscribers((opaque, event), None):
00284             pass # They do work in the adapter fetch
00285         if s is None:
00286             opaque._p_deactivate()

Event subscriber for (IContentish, IObjectEvent) events.

Definition at line 244 of file CMFCatalogAware.py.

00244 
00245 def handleContentishEvent(ob, event):
00246     """ Event subscriber for (IContentish, IObjectEvent) events.
00247     """
00248     if IObjectAddedEvent.providedBy(event):
00249         if event.newParent is not None:
00250             ob.indexObject()
00251 
00252     elif IObjectClonedEvent.providedBy(event):
00253         ob.notifyWorkflowCreated()
00254 
00255     elif IObjectMovedEvent.providedBy(event):
00256         if event.newParent is not None:
00257             ob.indexObject()
00258 
00259     elif IObjectWillBeMovedEvent.providedBy(event):
00260         if event.oldParent is not None:
00261             ob.unindexObject()

Event subscriber for (IDynamicType, IObjectCopiedEvent) events.

Definition at line 262 of file CMFCatalogAware.py.

00262 
00263 def handleDynamicTypeCopiedEvent(ob, event):
00264     """ Event subscriber for (IDynamicType, IObjectCopiedEvent) events.
00265     """
00266     # Make sure owner local role is set after pasting
00267     # The standard Zope mechanisms take care of executable ownership
00268     current_user = _getAuthenticatedUser(ob)
00269     if current_user is None:
00270         return
00271 
00272     current_user_id = current_user.getId()
00273     if current_user_id is not None:
00274         local_role_holders = [ x[0] for x in ob.get_local_roles() ]
00275         ob.manage_delLocalRoles(local_role_holders)
00276         ob.manage_setLocalRoles(current_user_id, ['Owner'])

Here is the call graph for this function:

Event subscriber for (ICallableOpaqueItemEvents, IObjectEvent) events.

Definition at line 287 of file CMFCatalogAware.py.

00287 
00288 def handleOpaqueItemEvent(ob, event):
00289     """ Event subscriber for (ICallableOpaqueItemEvents, IObjectEvent) events.
00290     """
00291     if IObjectAddedEvent.providedBy(event):
00292         if event.newParent is not None:
00293             ob.manage_afterAdd(ob, event.newParent)
00294 
00295     elif IObjectClonedEvent.providedBy(event):
00296         ob.manage_afterClone(ob)
00297 
00298     elif IObjectMovedEvent.providedBy(event):
00299         if event.newParent is not None:
00300             ob.manage_afterAdd(ob, event.newParent)
00301 
00302     elif IObjectWillBeMovedEvent.providedBy(event):
00303         if event.oldParent is not None:
00304             ob.manage_beforeDelete(ob, event.oldParent)

Variable Documentation

tuple CMFCore.CMFCatalogAware.logger = logging.getLogger('CMFCore.CMFCatalogAware')

Definition at line 41 of file CMFCatalogAware.py.