Shiny new collections

The new collections provide a much nicer query UI with live results. Gier Baekholt has a short video online showing them off:

Upgrading Plone

When upgrading your plone site, the old collections will still be available to you only they're be label "Collection (old-style)." Old collections will NOT be migrated to new-style collections.

Add-on product compatibility

Most add-ons right now that use collections for their functionality are not currently compatible.

Enabling old-style collections

If you're starting a new Plone site from scratch, the old collections will not be enabled by default and you may still want to use them on your site--especially if you're running add-ons that depend on the old-style collections yet.

To manual enable old-style collections, follow these steps:

  1. Visit the ZMI(or append /manage onto the url of your plone site)
  2. Click "portal_types"
  3. Click "Topic (Collection (old-style))"
  4. Check the "Implicitly addable?"
  5. Click the "Save" button

Developing for old and new collections

New style collections still implement the queryCatalog method which results the results from the catalog query so most likely the only thing you'll need to change is interface registrations and references to portal_type.

I have just updated collective.plonetruegallery for the new collections so I'll share some tips on integrating.

Conditional ZCML

In order to be backward compatible, you should use conditional zcml for any registrations or code that needs to be loaded. The collective docs has a good section on how to do this.

A simple example in practice is:


Registering an interface for new collection

<class class=""
<implements interface=".interfaces.IGallery" />

Retrieve the raw query

from import queryparser
query = queryparser.parseFormquery(collectionobj, collectionobj.getRawQuery())