StagingAddOn - developer notes

Some implementation details...

What StagingAddOn really does and how to use its API

Read tests/testUsage.py. It shows what StagingAddOn really does and how to use its API.

Patches

Archetyptes.BaseObject.manage_afterClone() is monkey-patched in patches.py. I would prefer using event subcribers, but it does not work in Zope 2.8 and I want StagingAddOn to be compatible with this version of Zope (which should be used with Plone 2.1 and can be used with Plone 2.5).

CMFUid.UniqueIdHandlerTool.[_]queryBrain() are monkey-patched in patches.py. See this file for further details.

New attributes

We have chosen to store relationship informations on the object itself, not in portal_staging tool. Hereafter is the list of the current attributes that StagingAddOn adds to the objects. Note that I am not really satisfied with this design: this may change in the future (migration code will be provided, naturally).

_version
the revision number.
_versions
a list which contains the UID of all versions of the object. This list is sorted by the creation date. At any time, this list may contain references to objects which do not exist anymore: use the getVersions() method of the tool.
_new_version
the UID of the last version which is currently under work. This UID may reference an object which does not exist anymore: use the getNewVersion() method of the tool.
_is_a_version_of
the UID of the canonical version. As above, this UID may reference an object which does not exist anymore: use the getCurrentVersion() method of the tool. (Note that this attribute is set only on the non-current versions.)