[Zope-CMF] Point of publication

Chris Withers chrisw@nipltd.com
Fri, 19 Apr 2002 12:07:46 +0100


Is this kindof detail for the DCWorkflow tool documented anywhere?

cheers,

Chris

Dieter Maurer wrote:
> 
> Kevin Carlson writes:
>  > Reviving an old thread...
>  >
>  > I have been able to modify the DefaultWorkflow.py source to accomplish
>  > moving an object to a different folder on publication.  Now that I am
>  > finally getting around to attempting to do this with a script, I am having
>  > some trouble.  Any sample source available?
> I use the following External Method to move an object to a "DataCenter".
> 
> def releaseNew(stateChange):
>   obj= stateChange.object
>   p= stateChange.getPortal()
>   Center= getCenter(p,obj); t= getType(obj)
>   # remove the object from its original place - this should uncatalog
>   p= obj.aq_inner.aq_parent
>   p._delObject(obj.id)
>   # now install
>   n= Center.addObject(obj)
>   # finally, tell the workflow that we moved the object
>   raise stateChange.ObjectMoved(n,_redirect(n,t + ' freigegeben und ins DataCenter übertragen'))
> 
> The DataCenter has a special method "addObject" that adds an object,
> giving it a new automatically generated id.
> You can use the "ObjectManager._setObject" method, when the
> destination is a standard "ObjectManager".
> 
> Dieter
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
> 
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests