[Zope-CMF] Workflow transition after PUT

Florent Guillaume fg@nuxeo.com
Thu, 25 Jul 2002 16:41:13 +0200


In article <00e801c2337c$4d1cf5a0$0401a8c0@DELILLO> Alan writes:
> I always knew I would have to do this.. and thought it would be easy when I
> needed to do it... but I am having problems.
> I want some objects to automatically transition *after* the objects PUT
> method is called.  not after its instaniated (this is how is works
> currently?)
> 
> If you put an object in 'Pending' as its initial state.  After its created
> it is in that state and members can not change it becasue only Reviewers can
> edit it in that state.  So I need it to happen not on initial state.. but
> after its been PUT.

I'm not sure I got everything here...

> Also.. it seems that when a object defines PUT() -- that is participating
> with the ZPublisher system (is this correct?)  well.. it seems like my
> object (derives from CMFDefault.Document)  does not have Acquistion context
> in the PUT method. the method signature is def PUT(self, REQUEST, RESPONSE)
> and I'm not quite sure how to get an Acquistion context  so that I can get
> to workflow tool to call doActionFor( self , 'submit')... but even when I
> get this to work.  I will end up  having to hardcode this in the class's PUT
> method.  any insight is greatly appreciated.

My reading of the code (webdav.NullResource line 122) says that:
- PUT is called on an unwrapped object.
- the the object is _setObject'ed in its parent

So you'll have to do your stuff in manage_afterAdd I fear...
Don't forget to call the inheritedAttribute'ed one :-)

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com