[Zope-PTK] Newby question: changing workflow
Arjan de Knegt
adeknegt@worldonline.nl
Thu, 14 Dec 2000 10:34:56 +0100 (MET)
Tres,
Thanks a lot. This should do the trick for me.
Arjan.
-----
On Wed, 13 Dec 2000, Tres Seaver wrote:
> Arjan de Knegt wrote:
>
> Hello all,
>
> I've been playing around with the PTK for a while now and I think it's a
> great portal framework :-). But, as always, there is functionality that I
> would like to add/change:
> When a document with status "published" is edited, the status should be
> reset to "private". Current PTK allows for editing of published documents.
>
> As far as my investigation into PTK sources went, I think I could hack
> Document.py of PTKDemo product to achieve this. Subclass Document class
> and create a new "edit" function or something similar?
You can do the subclassing either on the Filesystem, or in a ZClass (in
either case, I would create a new product). On the filesystem, you
would
override the 'edit' method to set 'review_state' back to 'private' and
then call the orignal method; something like:
from Products.PTKDemo import Document
class MyDocument( Document ):
def edit( self, title, description, text_format
, text, file='', REQUEST=None):
"""
Force us back to 'private'.
"""
self.setReviewState( 'private', 'Edited' )
PTKDemo.edit( self, title, description, text_format
, text, file, REQUEST )
> Being quite a novice on Zope and python development I hope someone can set
> me on the right track.
Hope that helps!
Tres.
--
===============================================================
Tres Seaver tseaver@digicool.com
Digital Creations "Zope Dealers" http://www.zope.org