You are here: Home Plone Hacks in the source code Publish a workflow copy when checking it in
Search
Advanced Search…
E-Mail

Webmail: webmail.wyden.com

E-Mail Preferences: postfix.wyden.com/users

E-Mail Administration: postfix.wyden.com

Statistics
Total: 463
Total Pages: 284
Total Folders: 87
Total Files: 18
Total Links: 26
Last modification: 03.02.2012 16:00
 

Publish a workflow copy when checking it in

by Wyden Silvan last modified 28.11.2009 16:37

The good thing about that is, when you have rules that send emails when an object is published.

/usr/local/Plone/buildout-cache/eggs/plone.app.iterate-1.2.3-py2.4.egg/plone/app/iterate/event.py

class CheckinEvent( ObjectEvent ):

    implements( interfaces.ICheckinEvent )

    def __init__(self, wc, baseline, relation, message):

        #hack by wysi1 2009/11/28
        portal_workflow = wc.portal_workflow
        transitions = portal_workflow.getTransitionsFor(wc)
        transition_ids = [t['id'] for t in transitions]
        if 'publish' in transition_ids and wc.getPhysicalPath()[1] == 'fernuni':
            wfcontext = wc.portal_workflow.doActionFor(wc, 'publish')

        ObjectEvent.__init__( self, wc )
        self.baseline = baseline
        self.relation = relation
        self.message = message