[Zope-CMF] Workflows - moving content on a transition

Ryan P. de Vega rpd4972@hbu.edu
Tue, 20 Aug 2002 11:36:50 -0500


I have used the method in the "Comments:" section of this page for copying
my content to a portal folder in the ZMI that was posted in
http://www.zopelabs.com/cookbook/1029298314 
Thanks Alan Runyan and Ronald Roeber for this posting!

My code is as follows:
----------------------------------------------------------------------------------------------------------------------------------------------
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():
    portal_root[mappings[content_type]].manage_pasteObjects(
obj_parent.manage_copyObjects(o.getId()) )
------------------------------------------------------------------------------------------------------------------------------------------------

If you will notice all portal content is copied into a ZMI folder named
"pages" on my "publish" transition - this folder will act as my public
site.  Apparently the versioning capability is not quite be there yet
within the CMF scope, so this is my manual, but seemingly effective way of
managing portal items.

What I am lacking is the capability to build parent, sister, and child
folders for objects when they are copied into my "pages" folder.  I want
the "pages" folder to dynamically look just like the "Members" folder that
the CMF originally pulls portal content from.  Is this possible?  Anyone
have any examples?  Your help is much appreciated!

Sincerely,
Ryan de Vega
rdevega@hbu.edu