[Zope-CMF] Moving Items with Workflow
Ryan P. de Vega
rpd4972@hbu.edu
Thu, 29 Aug 2002 11:15:46 -0500
runyaga@runyaga.com writes:
>
>you are in need of CMFVersions/CMFStaging. This is exactly what this is
>
>made for.
>
>it increases the complexity of your CMF. but then you have a proper
>
>versioning
>
>and staging system. and things that are pending are in different versions
>of
>
>stages.
>
>they are promoted to production using workflow.
>
>~runyaga
Ok. I'm interested now. I have read about this but everyone else is
saying that this is not ready yet and that this quite involved. Have you
started up the BackTalk server yet? Has Tim Hoffman had the chance to
develop any go bys for the implementation of CMF staging? I am at ground
zero here with the staging thing, so all help is appreciated.
>
>
>
>p.s. Ryan do you work down by medical center/rice? I live in Montrose.
Close. About 15min. away. I work at highway 59 & Fondren Rd.
Also, got any ideas on how I need to screen for the existence of the
copied object in my destination folder in my script? The line that is
commented out is the one that I am having problems with. I am fairly new
to Python, so forgive my code if it is a little sloppy. This script is
run on the publish ('after') transition. Basically, if the object exists,
delete it so that the new one can be copied to the destination folder.
I am willing to give the CMFstaging thing a shot but for now I have to get
this code working before I add the bells and whistles that versioning adds.
Thanks again for your help Alan!
Sincerely,
Ryan de Vega
Programmer, Database Support
Houston Baptist University
281-649-3449
----------------------------------------------------------------------------------------------------------------------
o=getattr(state_change, 'object')
obj_parent=o.aq_parent
portal_root=context.portal_url.getPortalObject()
content_type = o.getTypeInfo().getId()
mappings = {'Discussion Item' : 'pages'
,'Document' : 'pages'
,'Favorite' : 'pages'
,'File' : 'pages'
,'Folder' : 'pages'
,'Image' : 'pages'
,'Link' : 'pages'
,'News Item' : 'pages'
,'Topic' : 'pages'
,}
if content_type in mappings.keys():
id = obj_parent.getId()
title = obj_parent.title_or_id()
location = portal_root[mappings[content_type]]
if not hasattr(location, id):
location.manage_addPortalFolder( id, title)
obj2=getattr(location, id)
"""if location.hasattr(state_change, 'object'):
location.manage_delObjects(o.getId())"""
obj2.manage_pasteObjects(obj_parent.manage_copyObjects(o.getId()))
----------------------------------------------------------------------------------------------------------------------