Personal tools
You are here: Home Products Plone Roadmap #207: Allow Custom Portlet Managers
Document Actions

#207: Allow Custom Portlet Managers

Contents
  1. Motivation
  2. Proposal
  3. Implementation
  4. Deliverables
  5. Progress log
by George Lee last modified February 24, 2008 - 16:49
Change GenericSetup handling of portlet managers to allow for custom portlet managers, not only portlet managers that use the default class.
Proposed by
George Lee
Proposal type
Architecture
Assigned to release
Repository branch
plip207-custom-portlet-managers
State
completed

Motivation

When the current GenericSetup import handler for portlets.xml registers a new portlet manager, it automatically creates one of class PortletManager from plone/portlets/manager.py.

This PortletManager class has a method getAddablePortletTypes which a developer may want to override. Specifically, with the current code, if a portlet type is not registered with any column interface, then it can be added to any portlet manager. A developer may want to create a portlet manager that blocks some of the standard portlets (such as Events or News) from being added to a portlet column. Currently, there is no way of specifying an alternative portlet manager class to use in order to allow different getAddablePortletTypes behavior like this.

By allowing a custom portlet manager class, we also allow developers to define portlet managers with additional methods, attributes, etc. on the class that might be useful for their use cases.

Proposal

Add support for an optional "manager" variable in the portlets.xml declaration of a portlet manager, equal to the dotted name of an alternative portlet manager class to use. If no name is specified, the default PortletManager class will still be used.

In addition, the export handling will export the dotted name of a portlet manager's class if it is different from the default.

Implementation

Example XML from portlets.xml using the new implementation:

Register a portlet manager that provides a custom interface IColumn and whose class is a custom type FooPortletManager:

<portletmanager name="plone.foo_column"
  type="plone.app.portlets.interfaces.IColumn"
  class="plone.app.portlets.tests.utils.FooPortletManager"
  />

Deliverables

  1. The new code!
  2. Modified or new test coverage

Progress log

Code completed!

Framework team vote

Posted by Martijn Pieters at December 14, 2007 - 14:00
+1

Framework team vote

Posted by Andreas Zeidler at December 14, 2007 - 14:30
+1 (see http://lists.plone.org/pipermail/framework-team/2007-December/001540.html)

Framework team vote

Posted by Raphael Ritz at December 17, 2007 - 13:22
+1

Framework team vote

Posted by Tom Lazar at December 20, 2007 - 13:08
+1

Framework team vote

Posted by Danny Bloemendaal at December 22, 2007 - 17:45
+1

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by