euphorie.content.behaviour

The euphorie.content.behaviour package implements variours behaviours of content in the site. Some of these are implemented using plone.behavior and configured using the FTI, others are implemented using more traditional patterns.

Rich description

Several content types in euphorie use a rich text description. This requires a little bit of special interaction for Plone, which is implemented in this behaviour.

Enabling this behaviour for a content type does two things: it replaces the standard description field with a rich text version, and registers a catalog indexer which returns a plain text version of the description.

Unique ids

Within a survey every element must have a unique identification number. This is managed through two behaviours: a content type with the IIdGenerationRoot behaviour acts as a id numbering boundary. All items underneath this root will have a unique number. The INameFromUniqueId behaviour indicates that a type’s instances should get unique numbers.

interface euphorie.content.behaviour.uniqueid.IIdGenerationRoot

Marker interface for objects which act as the root for ids.

Generated ids do not always need to be globally unique. Objects with this marked interface (or dexterity behaviour) act as uniqueness root.

interface euphorie.content.behaviour.uniqueid.INameFromUniqueId

Marker interface for objects which should get a unique id.

Objects with this interface automatically get a unique id when they are added to an container (as long as INameChooser is used). Ids are unique within the context of IIdGenerationRoot.

class euphorie.content.behaviour.uniqueid.UniqueNameChooser(context)

INameChooser for INameFromUniqueId objects.

This implementation uses a simple increasing numerical id, starting with 1.

Dirty tree tracking

It can be useful to know if a content tree has any unpublished changes. This behaviour manages that by tracking creation, deletion, moving and modification of content objects and updating a dirty flag on the first parent object which provides the IDirtyTreeRoot marker interface. The flag is reset on succesfull workflow transitions.

interface euphorie.content.behaviour.dirtytree.IDirtyTreeRoot

Marker interface for objects which act as the root of a dirty tree.

euphorie.content.behaviour.dirtytree.clearDirty(obj)

Explicitly clear the ditry flag on an object.

euphorie.content.behaviour.dirtytree.isDirty(obj)

Check if an object is dirty, ie it has modified children.

Table Of Contents

Previous topic

Code reference

Next topic

euphorie.content.countrymanager

This Page