Local portlets

Implementation strategy

Local portlets are displayed in “Slots”, which are part of a theme. Unlike theme elements,

local portlets are directly managed by users, finally they are visible only in some areas of the

site and under certain conditions. This draft discusses general implementation issues.

Background: Zope2 implementation

(In CPSPortlets , local portlets are physically stored in folders (Workspaces, Sections, etc.).

  • This has the following advantages
  • portlets are “local”, i.e. they are visible in the folders in which they are located and in the
  • subfolders.
  • Some extra information (the portlet’s “visibility range”) defines the depth levels below the
  • folder at which portlets will be visible
  • Some extra information (“portlet override”) makes it possible inside a same slot to
  • override all portlets located in the folders above.
  • Access rights to the portlets are defined by the access rights set on the folders.

This has the following disadvantages:

  • portlets are stored locally in the site’s folders in a local portlet container (.cps_portlets).
  • This implies the modification of existing site folders.
  • export / import of portlets requires a traversal of the entire site.
  • performance is not as good as it could be because of the traversals and the filtering of
  • portlets for each folder up to the site’s root (using a catalog could improve performance)
  • users can only edit the portlets in the folders inside which they have right access (users without administrator priviledges cannot edit the portlets located on the site’s top page for instance).

Zope3 implementation

  • store portlets in a central repository (BtreeContainer).
  • (this simplifies site export / import, the portlet’s schema is accessed only when necessary)
  • implement portlet visibility as a Format Element that knows where a portlet box will be visible (a list of paths + some visibility rules such as “starting from”, “everywhere except in”, …)
  • Use relations to implement “portlet override” portlet box __ overrides __ slot display (box group)
  • implement access control on the theme’s slots Display Element instead of implementing it on the actual site folders.

(this would allow a category of users to update the portlets located on the site’s top page

provided that they can modify the Display Element associated to the Slot).