Back to index

plone3  3.1.7
Functions
plone.portlets.events Namespace Reference

Functions

def dispatchToComponent
def registerPortletManagerRenderer
def unregisterPortletManagerRenderer

Function Documentation

def plone.portlets.events.dispatchToComponent (   registration,
  event 
)
When a utility is registered, dispatch to an event handler registered for 
the particular component registered, the registration and the event.

Definition at line 16 of file events.py.

00016 
00017 def dispatchToComponent(registration, event):
00018     """When a utility is registered, dispatch to an event handler registered for 
00019     the particular component registered, the registration and the event.
00020     """
00021     handlers = zope.component.subscribers((registration.component, registration, event), None)
00022     for handler in handlers:
00023         pass # getting them does the work
00024       
@zope.component.adapter(IPortletManager, IUtilityRegistration, IRegistered)
def plone.portlets.events.registerPortletManagerRenderer (   manager,
  registration,
  event 
)
When a portlet manager is registered as a utility, make an appropriate
adapter registration for its IPortletManagerRenderer so that the
provider: expression can find it, and ensure the manager's __name__ is 
the same as the name of the utility, which will also be the name of the
adapter.

Definition at line 25 of file events.py.

00025 
00026 def registerPortletManagerRenderer(manager, registration, event):
00027     """When a portlet manager is registered as a utility, make an appropriate
00028     adapter registration for its IPortletManagerRenderer so that the
00029     provider: expression can find it, and ensure the manager's __name__ is 
00030     the same as the name of the utility, which will also be the name of the
00031     adapter.
00032     """
00033     manager.__name__ = registration.name
00034     registry = registration.registry
00035     registry.registerAdapter(factory=manager,
00036                              required=(Interface, IBrowserRequest, IBrowserView),
00037                              provided=IPortletManagerRenderer,
00038                              name=registration.name)
00039                              
@zope.component.adapter(IPortletManager, IUtilityRegistration, IUnregistered)
def plone.portlets.events.unregisterPortletManagerRenderer (   manager,
  registration,
  event 
)
When a portlet manager is unregistered as a utility, unregister its 
IPortletManagerRenderer.

Definition at line 40 of file events.py.

00040 
00041 def unregisterPortletManagerRenderer(manager, registration, event):
00042     """When a portlet manager is unregistered as a utility, unregister its 
00043     IPortletManagerRenderer.
00044     """
00045     registry = registration.registry
00046     registry.unregisterAdapter(factory=manager,
00047                                required=(Interface, IBrowserRequest, IBrowserView),
00048                                provided=IPortletManagerRenderer,
                               name=registration.name)