[Zope-CMF] Historical revisions in CMF (was Re: CMF newbiequestions)

Ausum Studio ausum_studio@hotmail.com
Wed, 26 Mar 2003 19:38:10 -0500


I'd appreciate more people test this, since I'd like to go into production.
One of the nicest features that comes up is the ability to enable the
existing status history page to provide a link to the corresponding
revision, so that we can get to know what it was the current version of the
content object, at the time its status was changed, at least up to the
moment a Data.fs pack was performed. :)



Ausum





----- Original Message -----
From: "Tres Seaver" <tseaver@zope.com>
To: "Ausum Studio" <ausum_studio@hotmail.com>


(...)

> > I've enabled CMF to handle revisions by allowing it to inherit from
> > OFS.History, on a experimental basis, and it works fine so far. If you
want
> > to try it, open CMFCore/PortalContent.py with any editor an perform the
> > changes indicated down below. After you restart Zope, the "History" tab
will
> > appear for all contentish objects, in the management interface. Starting
> > that point you'll need to provide methods (or modify existing ones) to
> > access those revisions. I'm including a simple history-viewer script.
> >
> > A simple and general workaround in your case is to modify the view
methods
> > of your content types to make them render the closest published revision
(or
> > any other you indicate, based on your site's policy), when the object's
> > state is 'retracted' (yes, create that one). As currently there's no
> > relation between revisions and the workflow's review_history, as
provided by
> > 'portal_workflow.getInfoFor', one of your to-write methods might be one
that
> > compares timestamps and returns the mentioned revision object.
> >
> > I'll publish a How-to on this subject, provided there's no code
conflicts
> > I'm not aware of. :)
> >
> >
> >
> > Ausum
> >
> >
> >
> >
> > Modifications to PortalContent.py:
> >
> > ....................
> >     NoWL = 0
> > except ImportError:
> >     NoWL = 1
> >
> > from OFS.History import Historical        # added line
> >
> > class PortalContent(DynamicType, Historical, CMFCatalogAware,
SimpleItem):
> > # added 'Historical'
> >
> >     """
> >         Base class for portal objects.
> >
> >         Provides hooks for reviewing, indexing, and CMF UI.
> > .......
> >
> > and:

(...)

> >         print k, ":", v
> >     historical_object = context.HistoricalRevisions[item['key']]
> >     print historical_object
> >
> > return printed
>
> Given a working example, with reasonable testing:  can anyone see /
> think of a reason not to land this for 1.4?
>
> Tres.
> --
>