Commit 10f91a59 authored by Bartek Górny's avatar Bartek Górny

Implemented publication workflow side effects

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9933 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bae6c8a6
......@@ -68,7 +68,19 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string></string> </value>
<value> <string>o=state_change.object\n
ref=o.getReference()\n
if ref is None: # this shouldn\'t happen\n
raise Exception(\'how on earth can reference be None?\')\n
lng=o.getLanguage()\n
if lng is None: # ibidem\n
raise Exception(\'how on earth can language be None?\')\n
res=context.portal_catalog(reference=ref,portal_type=o.getPortalType(),simulation_state=\'published\')\n
res=[r.getObject() for r in res]\n
res=filter(lambda o:o.getLanguage()==lng,res)\n
for ob in res: # again, this should never happen, but still\n
o.portal_workflow.doActionFor(ob,\'archive_action\')\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -111,6 +123,20 @@
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>o</string>
<string>ref</string>
<string>None</string>
<string>Exception</string>
<string>lng</string>
<string>context</string>
<string>res</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>filter</string>
<string>ob</string>
</tuple>
</value>
</item>
......
......@@ -68,7 +68,19 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string></string> </value>
<value> <string>o=state_change.object\n
ref=o.getReference()\n
if ref is None: # this shouldn\'t happen\n
raise Exception(\'how on earth can reference be None?\')\n
lng=o.getLanguage()\n
if lng is None: # ibidem\n
raise Exception(\'how on earth can language be None?\')\n
res=context.portal_catalog(reference=ref,portal_type=o.getPortalType(),simulation_state=\'released\')\n
res=[r.getObject() for r in res]\n
res=filter(lambda o:o.getLanguage()==lng,res)\n
for ob in res: # again, this should never happen, but still\n
o.portal_workflow.doActionFor(ob,\'archive_action\')\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -111,6 +123,20 @@
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>o</string>
<string>ref</string>
<string>None</string>
<string>Exception</string>
<string>lng</string>
<string>context</string>
<string>res</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>filter</string>
<string>ob</string>
</tuple>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment