How to retrieve cumulative differences between versions when referenced images are involved
Purpose
CMFEdtions currently retrieves the latest version's referenced image for all versions when difference between the versions is sought. There is a portal modifier property retainATRefs which is unable to retain references.
The below mentioned method will help in retaining the references made in a content type.
Prerequisities
Create a content type like a document or a page involving a reference field to another content type like an image to it. Try creating different set of revisions with different set of images.
Now retrieve the differences between the revisions. You will find the referenced field showing the latest reference for all the revisions.
Step by step
In the file ArchivistTool.py the
class LazyHistory has a function called
def __getitem__(self, selector):
This function inturn calls this function _modifier.afterRetrieveModifier
from the following function statement
refs_to_be_deleted, attr_handling_references, preserved_data = \ self._modifier.afterRetrieveModifier(self._obj, repo_clone, self._preserve)
which is where the references get deleted. Hence restoring the condition i.e performing the undeletion makes the references to appear when the version differences are sought. Hence instead of calling the above function
- assign null containers to refs_to_be_deleted and preserved_data.
- attr_handling_references = ['_objects']
At the front end it can be retrieved using
python:vdata.object.at_references.items()
and suitable looping mechanism.
Further information
The following file gives a presentation on the architecture of CMFEditions by Alec Mitchell.
http://plone.org/events/conferences/seattle-2006/presentations/versioning-at-last.pdf/view

Author: