Back to index

plone3  3.1.7
interfaces.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 from plone.portlets.interfaces import IPortletAssignmentMapping
00004 from plone.portlets.interfaces import IPortletManager
00005 from plone.portlets.interfaces import IPlacelessPortletManager
00006 from plone.portlets.interfaces import IPortletRenderer
00007 
00008 class IPortletTypeInterface(Interface):
00009     """IInterface for portlet type interfaces. The portlet ZCML directive
00010     will register the portlet type interface as a utility providing this
00011     interface, with a name corresponding to the addview of the portlet.
00012     """
00013 
00014 class IUserPortletAssignmentMapping(IPortletAssignmentMapping):
00015     """A portlet assignment mapping that's user-specific
00016     """
00017 
00018 class IPortletPermissionChecker(Interface):
00019     """An adapter for an assignment manager, which can check whether the
00020     current user is allowed to manipulate portlets in this mapping.
00021     """
00022     
00023     def __call__():
00024         """Check the adapted assignment manager. Will raise Unathorized if
00025         something fishy is going on.
00026         """
00027 
00028 class IColumn(IPortletManager):
00029     """Common base class for left and right columns.
00030     
00031     Register a portlet for IColumn if it is applicable to regular columns
00032     but not to the dashboard.
00033     """
00034 
00035 class ILeftColumn(IColumn):
00036     """The left column.
00037     
00038     Normally, you will register portlets for IColumn instead.
00039     """
00040 
00041 class IRightColumn(IColumn):
00042     """The right column
00043     
00044     Normally, you will register portlets for IColumn instead.
00045     """
00046     
00047 class IDashboard(IPlacelessPortletManager):
00048     """Common base class for dashboard columns
00049     
00050     Register a portlet for IDashboard if it is applicable to the dashboard
00051     only.
00052     """
00053     
00054 class IDeferredPortletRenderer(IPortletRenderer):
00055     """Provide refresh and dynamic loading functionality"""
00056 
00057     def deferred_update():
00058         """refresh portlet data on KSS events (and only then)
00059 
00060         this is similar to update() but it is only called from a KSS action
00061         and thus can be used to do long computing/retrieval only on loading
00062         the portlet via KSS but not in the initial page load.
00063         """
00064 
00065     def render_full():
00066         """method for rendering the full version of the portlet
00067 
00068         this is usually the one called via KSS events
00069         """
00070 
00071     def render_preload():
00072         """method for rendering the portlet in preloading state
00073 
00074         this usually just contains a class to which an KSS event is bound
00075         """
00076 
00077     def initialized():
00078         """return whether the portlet is initialized or not
00079 
00080         depending on this the render() method chooses whether to render the
00081         preload or full version (if initialized==True).
00082         """
00083 
00084 class IDefaultDashboard(Interface):
00085     """Define an adapter from the user/principal type (by default, this is
00086     Products.PluggableAuthService.interfaces.authservice.IBasicUser) to
00087     this interface and implement __call__ to return a mapping of dashboard
00088     settings. When a new user is created, this adapter will be invoked to
00089     build a default dashboard.
00090     """
00091     
00092     def __call__(self):
00093         """Create and return dashboard portlet assignments. Should be a 
00094         mapping of dashboard column names ('plone.dashboard1', 
00095         'plone.dashboard2', 'plone.dashboard3' and/or 'plone.dashboard4')
00096         and a list of portlet assignmen instances.
00097         """