#77: Constrain addable types on per-folder basis

Contents
  1. Motivation
  2. Proposal
  3. Implementation
  4. Participants
by Alex Limi last modified Jan 21, 2010 07:29 AM

Enable and fix up ATContentType's ConstrainTypesMixin, to allow the list of addable types to be whitelisted or blacklisted on a per-folder-instance basis.

Proposed by
Alexander Limi
Seconded by
Martin Aspeli
Proposal type
User interface
Repository branch
uiteam-plip77-78-content-menu-browser-default-refactoring
State
completed

Motivation

It is a very common use-case to want to have a folder usable only for news items, only for events etc. Currently, this requires making a whole new content type, or mangling getNotAddableTypes.py.

Proposal

  • Enable ConstrainTypesMixin.
  • Preserve exisint getNotAddableTypes hook functionality
  • A whitelist of allowed items, which must be a subset of the allowed types specified by the FTI
  • And a whitelist among these of the in-menu items - rest go on a More... page.
  • Option to use portal default, use parent value (presuming parent is of same type - else it doesn't make sense to inherit, so fall back on portal default), or custom as above

Implementation

  • Functionality done, but needs CSS styling + a little JavaScript magic perhaps, and a cleanup of the "select..." page.
  • Should probably also clean up folder_factories.pt, which wasn't used much before, but now drives the "more..." page.

NOTE: There are two branches, one in ATCT and one in CMFPlone, and these two branches are shared by PLIPs 77 and 78, since they are closely related and were developed in parallel. The branches are:

  • https://svn.plone.org/svn/plone/CMFPlone/branches/uiteam-plip77-78-content-menu-browser-default-refactoring
  • https://svn.plone.org/svn/plone/ATContentTypes/branches/uiteam-plip77-78-content-menu-browser-default-refactoring

On the "refectoring" branch, dependencies have been refactored so that the marker interfaces are in CMFPlone, which ATCT optionally imports if HAS_PLONE2 is true. ConstrainTypesMixin is still defined in ATCT.

In the long run, the interface could be pushed down to CMFCore, and the mixin down to Archetypes.

Participants

Martin Aspeli
David Convent

Comments (0)