You are here: Home Plone products ContentFlavors

ContentFlavors (0.7.0)

1
by maria last modified 2008-05-29
0.0
0.0
0.0
0.0
Released on 2006-10-15 by ObjectRealms for Plone 2.5 under Unavailable License available for All platforms.
Software development stage: stable
A developer and through the web exposed mechanism for applying archetypes schemas to content for the purpose of specialization and repurposing of existing content types with additional schema.

What are flavors?

are bits of behavior and schema that we can add to content. we can gain additional access to icons, actions, views, adapters, and at schemas via adding a flavor to a piece of content.

A flavor is composed of a number of optional parts based on usage, they can contain archetypes schemas to compose, marker interfaces to apply, etc. see the zcml section, for a complete definition.

Using Flavors

Plone content that wants to utilize flavors, should mixin the minimal Products.ContentFlavors.aware.FlavorAware class. This provides the schema lookup/composition and icon delegation.

Flavors aware content has additional flavor tab in the plone user interface which allows the management and ordering of flavors. It also allows some basic flavor browsing of content in the site, to discover which content implements which flavors.

Once a flavor is applied to a content object, the flavor's schema is woven into the content object, and appears in base_view / base_edit views like the content's normal schema. custom edit and view forms of course need explicit integration of the additional fields.

Installation

Content Flavors bridges a number of frameworks, and requires a specific version to operate. Its tested on and supported on the following (stable branch)

  • Plone 2.5.x

  • Zope 2.9.4

  • Five 1.4.x

  • CMFonFive 1.3.3

Additional platform combinations may work, your mileage may vary.

There is also a branch targetting the upcoming Plone 3.0 release.

System Properties

  • a flavor is defined in zcml, it has a name, icon, description, a marker z3 interface, and an archetypes schema.

  • a content object can have zero or more flavors.

  • flavors have associated archetypes schemas, a flavor aware content object has a schema composed of its class schema and all of its applied flavor schemas.

  • flavors are ordered. we use this property during schema composition to give precedence to fields from flavors at the front of the list. These fields override/mask, fields from lower precedence flavors.

  • What flavors can be applied to a given flavor aware content is configurable via interface specification, a default adapter is also available.

  • flavors are ordered, duplicate field entries are resolved by giving precedence to flavors based on order.

  • a content has a primary flavor ( the first flavor of the ordered set ). [ we may do away with this notion, use cases for it are welcome ]

  • flavors can give additional actions to content, based on registered browser menus definitions for flavor views.

  • events are fired when flavors are added or removed to content.

  • we use an intelligent two level schema cache, that never does extraneous schema composition, and gives fast access to composed schemas.

  • schemas are not stored persistently in the zodb. schemas are defined and always preeminant on disk.

  • a content has a primary flavor ( the first flavor of the ordered set ). [ might do away with this, currently only used by icon code ]

Document Actions
Powered by Plone