From: Sidnei da S. <dre...@us...> - 2002-10-30 21:06:16
|
Update of /cvsroot/collective/PloneStaging In directory usw-pr-cvs1:/tmp/cvs-serv3286 Modified Files: PloneWorkflowWithStaging.py Log Message: Fixed Workflow to match our spec. http://plone.org/projects/InterwovenLikeStaging Index: PloneWorkflowWithStaging.py =================================================================== RCS file: /cvsroot/collective/PloneStaging/PloneWorkflowWithStaging.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PloneWorkflowWithStaging.py 29 Oct 2002 23:13:12 -0000 1.3 --- PloneWorkflowWithStaging.py 30 Oct 2002 21:06:10 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- from Products.CMFPlone.PloneWorkflow import setupDefaultPloneWorkflow + p_review = ReviewPortalContent + def setAfterScript(wf, tdef_id, script_id): tdef=wf.transitions[tdef_id] *************** *** 35,45 **** """ setupDefaultPloneWorkflow(wf) ! for t in ('publish', 'reject', 'retract', 'submit', 'hide', 'show'): ! setBeforeScript(wf, t, 'checkout') ! ! setAfterScript(wf, 'submit', 'updateReviewStage') ! setAfterScript(wf, 'publish', 'updateProductionStage') ! setAfterScript(wf, 'retract', 'retractStages') def createPloneWorkflowWithStaging(id): --- 37,78 ---- """ setupDefaultPloneWorkflow(wf) + transitions = ('promoteToReview', 'promoteToProduction', \ + 'syncToProduction') + for t in transitions: + wf.transitions.addTransition(t) ! tdef = wf.transitions['promoteToReview'] ! tdef.setProperties( ! title='Reviewer promotes content to Review Stage', ! new_state_id='', ! actbox_name='Promote from Development to Review Stage', ! actbox_url='', ! props={'guard_permissions':p_review}) ! ! tdef = wf.transitions['promoteToProduction'] ! tdef.setProperties( ! title='Reviewer promotes content to Review/Production Stage', ! new_state_id='', ! actbox_name='Promote from Development to Review and Production Stage', ! actbox_url='', ! props={'guard_permissions':p_review}) ! ! tdef = wf.transitions['syncToProduction'] ! tdef.setProperties( ! title='Sync Review to Production Stage (recursive)', ! new_state_id='', ! actbox_name='Sync Review and Production Stage', ! actbox_url='', ! props={'guard_permissions':p_review}) ! ! for s in ('visible', 'private', 'published'): ! sdef = wf.states[s] ! sdef.setProperties( ! title=sdef.title, ! transitions=sdef.getTransitions() + transitions) ! ! setAfterScript(wf, 'promoteToReview', 'updateReviewStage') ! setAfterScript(wf, 'promoteToProduction', 'updateProductionStage') ! setAfterScript(wf, 'syncToProduction', 'syncReviewAndProduction') def createPloneWorkflowWithStaging(id): *************** *** 67,70 **** --- 100,112 ---- st = object.portal_staging st.updateStages(object, 'dev', ['review', 'prod'], + sci.kwargs.get('comment', '')) + """, + 'syncReviewAndProduction':""" + ## Script (Python) "syncReviewAndProduction" + ##parameters=sci + # Copy the object in development to review and production. + object = sci.object + st = object.portal_staging + st.updateStages(object, 'review', ['prod'], sci.kwargs.get('comment', '')) """, |