Commit a587b12b authored by Arnaud Fontaine's avatar Arnaud Fontaine

ExpressionMixin: Allow to specify the property storing the TALES Expression.

Until now it was only used in ERP5Catalog where the expression property is
`expression` for both Python Script and SQL Method but this is also needed
for ERP5Workflow `guard_expression` and `variable_expression`.
parent 7aafd50e
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -42,9 +42,7 @@ We don\'t use ExpressConfiguration_displayDownload script, because it would crea
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -65,17 +63,4 @@ We don\'t use ExpressConfiguration_displayDownload script, because it would crea
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -66,17 +64,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -43,9 +43,7 @@
</item>
<item>
<key> <string>guard_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string>python: True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -68,17 +66,4 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>transition/getReference|nothing</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>user/getIdOrUserName</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
</item>
</dictionary>
......
......@@ -24,21 +24,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getHistory</string> </value>
</item>
</dictionary>
......
......@@ -49,21 +49,6 @@
</item>
<item>
<key> <string>variable_expression</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>state_change/getDateTime</string> </value>
</item>
</dictionary>
......
......@@ -223,7 +223,7 @@ class TestERP5Workflow(ERP5TypeTestCase):
self.assertEqual(transition.guard_group, ('Group1', 'Group2'))
# expression
transition.setGuardExpression('python: "Hello, world"')
self.assertEqual(transition.guard_expression.text, 'python: "Hello, world"')
self.assertEqual(transition.getGuardExpressionInstance().text, 'python: "Hello, world"')
def test_InteractionGuards(self):
self.test_TransitionGuards(transition_type='Interaction')
......
......@@ -207,7 +207,7 @@ class TestWorklist(ERP5TypeTestCase):
if variable_value is None:
variable_value = worklist_value.newContent(portal_type='Worklist Variable')
variable_value.setReference('region_uid')
variable_value.setVariableExpressionText(v)
variable_value.setVariableExpression(v)
if 'variable_base_category_id' in props:
variable_value = worklist_value._getOb('variable_base_category_id', None)
v = props.get('variable_base_category_id', None)
......
......@@ -64,7 +64,7 @@ class PythonScriptThroughZMI(XMLObject):
def __init__(self, *args, **kw):
assert False
class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin):
class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin('expression')):
""" Script python for ERP5
"""
......
......@@ -60,7 +60,7 @@ def manage_addSQLMethod(self, id, title='',
REQUEST['RESPONSE'].redirect( 'manage_main' )
return c
class SQLMethod(XMLObject, ZSQL, ExpressionMixin):
class SQLMethod(XMLObject, ZSQL, ExpressionMixin('expression')):
"""SQLMethod for ERP5.
"""
......
......@@ -94,7 +94,7 @@
<string>my_guard_permission_list</string>
<string>my_guard_role_list</string>
<string>my_guard_group_list</string>
<string>my_guard_expression_text</string>
<string>my_guard_expression</string>
<string>my_before_script_list</string>
<string>my_after_script_list</string>
<string>my_before_commit_script_list</string>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_guard_expression_text</string> </value>
<value> <string>my_guard_expression</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -106,7 +106,7 @@
<string>my_guard_permission_list</string>
<string>my_guard_role_list</string>
<string>my_guard_group_list</string>
<string>my_guard_expression_text</string>
<string>my_guard_expression</string>
<string>my_before_script_list</string>
<string>my_after_script_list</string>
</list>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_guard_expression_text</string> </value>
<value> <string>my_guard_expression</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -93,7 +93,7 @@
<string>my_status_included</string>
<string>my_automatic_update</string>
<string>my_variable_value</string>
<string>my_variable_expression_text</string>
<string>my_variable_expression</string>
</list>
</value>
</item>
......@@ -101,7 +101,7 @@
<key> <string>right</string> </key>
<value>
<list>
<string>my_guard_expression_text</string>
<string>my_guard_expression</string>
<string>my_guard_group_list</string>
<string>my_guard_permission_list</string>
<string>my_guard_role_list</string>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_guard_expression_text</string> </value>
<value> <string>my_guard_expression</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_variable_expression_text</string> </value>
<value> <string>my_variable_expression</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -275,7 +275,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: cell.getVariableExpressionText()</string> </value>
<value> <string>python: cell.getVariableExpression()</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -109,7 +109,7 @@
<string>my_guard_permission_list</string>
<string>my_guard_role_list</string>
<string>my_guard_group_list</string>
<string>my_guard_expression_text</string>
<string>my_guard_expression</string>
</list>
</value>
</item>
......
......@@ -17,7 +17,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_guard_expression_text</string> </value>
<value> <string>my_guard_expression</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -28,31 +28,61 @@
from AccessControl import ClassSecurityInfo
from Products.CMFCore.Expression import Expression
from Products.ERP5Type import Permissions
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Utils import convertToUpperCase
class ExpressionMixin:
security = ClassSecurityInfo()
def ExpressionMixin(property_reference='expression'):
"""
Mixin for a common pattern where ERP5 objects stores a TALES Expression as text.
Usage examples:
Python Script/SQL Method: expression_property (reference=expression)
GuardableMixin: guard_expression_property (reference=guard_expression)
def _setExpression(self, value):
CMFCore.Expression already stores the Expression text as 'text' property and
create a volatile for the instance, so this may seem redundant and we may
have stored an Expression instance directly on the object. However this
would make exported objects depend on CMFCore.Expression and not storing
"directly" user input.
"""
property_reference_uppercase = convertToUpperCase(property_reference)
volatile_attribute_name = '_v_' + property_reference + '_instance'
def _setter(self, value):
"""
_set<PropertyReference>()
"""
try:
del self._v_expression_instance
delattr(self, volatile_attribute_name)
except AttributeError:
pass
self._baseSetExpression(value)
getattr(self, '_baseSet' + property_reference_uppercase)(value)
security.declareProtected(Permissions.AccessContentsInformation, 'getExpressionInstance')
def getExpressionInstance(self, default=None):
def getter(self, default=None):
"""
get<PropertyReference>Instance()
"""
try:
return self._v_expression_instance
return getattr(self, volatile_attribute_name)
except AttributeError:
expression = self.getExpression()
expression = getattr(self, 'get' + property_reference_uppercase)
# Check if the expression is not None, because Expression(<expression>)
# raises an error in case `expression` is empty or None.
if expression:
result = Expression(expression)
else:
result = None
self._v_expression_instance = result
setattr(self, volatile_attribute_name, result)
return result
InitializeClass(ExpressionMixin)
class ExpressionMixin:
security = ClassSecurityInfo()
_setter.__name__ = '_set' + property_reference_uppercase
setattr(Expression, _setter.__name__, _setter)
getter.__name__ = 'get' + property_reference_uppercase + 'Instance'
setattr(ExpressionMixin, getter.__name__, getter)
ExpressionMixin.security.declareProtected(Permissions.AccessContentsInformation,
getter.__name__)
return ExpressionMixin
......@@ -596,7 +596,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
if not vdef.checkGuard(getSecurityManager(), self, ob):
return default
status = self.getCurrentStatusDict(ob)
variable_expression = vdef.getVariableExpression()
variable_expression = vdef.getVariableExpressionInstance()
if status is not None and status.has_key(name):
value = status[name]
......@@ -849,7 +849,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
transition_expression_dict = {}
if tdef is not None:
transition_expression_dict = {
variable.getCausalityId(): variable.getVariableExpression()
variable.getCausalityId(): variable.getVariableExpressionInstance()
for variable in tdef.objectValues(portal_type='Transition Variable')
}
......@@ -875,12 +875,12 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Preserve former value
value = former_status[variable_reference]
else:
variable_expression = vdef.getVariableExpression()
variable_expression = vdef.getVariableExpressionInstance()
if variable_expression is not None:
# PATCH : if Default expression for 'actor' is 'user/getUserName',
# we use 'user/getIdOrUserName' instead to store user ID for ERP5
# user.
if variable_id == 'actor' and variable_expression == 'user/getUserName':
if variable_id == 'actor' and vdef.getVariableExpression() == 'user/getUserName':
expr = userGetIdOrUserNameExpression
else:
expr = variable_expression
......@@ -1123,7 +1123,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for tr_var in tr_var_list:
reference = self._getOb(tr_var.getCausalityId()).getReference()
transition_variable = SubElement(transition_variables, property_id, attrib=dict(id=reference,type='variable'))
transition_variable.text = str(tr_var.getVariableExpressionText())
transition_variable.text = str(tr_var.getVariableExpression())
else:
property_value = tdef.getProperty(property_id)
property_type = tdef.getPropertyType(property_id)
......@@ -1293,7 +1293,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
# Preserve former value
value = former_status[id]
else:
variable_expression = vdef.getVariableExpression()
variable_expression = vdef.getVariableExpressionInstance()
if variable_expression is not None:
expr = variable_expression
else:
......@@ -1346,7 +1346,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
for variable in self.getVariableValueList():
if variable.getForCatalog():
variable_id = variable.getReference()
variable_expression = variable.getVariableExpression()
variable_expression = variable.getVariableExpressionInstance()
if status.has_key(variable_id):
value = status[variable_id]
elif variable_expression is not None:
......
......@@ -32,9 +32,12 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5Type.id_as_reference import IdAsReferenceMixin
from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Workflow.mixin.guardable import GuardableMixin
from Products.ERP5.mixin.expression import ExpressionMixin
class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject,
GuardableMixin):
class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"),
XMLObject,
GuardableMixin,
ExpressionMixin('variable_expression')):
"""
A ERP5 Workflow Variable.
"""
......@@ -65,21 +68,3 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject,
PropertySheet.Guard,
PropertySheet.WorkflowVariable,
)
def _setVariableExpression(self, expression):
if isinstance(expression, basestring) and expression:
self.setVariableExpressionText(expression)
elif isinstance(expression, Expression) and expression.text:
self.variable_expression = expression
else:
self.variable_expression = None
security.declareProtected(Permissions.ModifyPortalContent,
'setVariableExpressionText')
def setVariableExpressionText(self, text):
self.variable_expression = Expression(text)
security.declareProtected(Permissions.AccessContentsInformation,
'getVariableExpressionText')
def getVariableExpressionText(self):
return getattr(self.variable_expression, 'text', '')
......@@ -7,6 +7,7 @@ from App.class_init import InitializeClass
from App.special_dtml import DTMLFile
from Persistence import Persistent
from Products.ERP5.mixin.expression import ExpressionMixin
from Products.CMFCore.Expression import Expression
from Products.CMFCore.utils import _checkPermission
from Products.ERP5Type import Permissions
......@@ -16,13 +17,16 @@ from Products.DCWorkflow.Expression import createExprContext
from Products.DCWorkflow.utils import _dtmldir
class GuardableMixin(object):
'''
class GuardableMixin(ExpressionMixin('guard_expression')):
"""
code of methods and functions taken from
Products.DCWorkflow-2.2.4 > Guard.py
'''
guard_expression = Expression('')
ExpressionMixin:
_setGuardExpression()
getGuardExpressionInstance(default=None)
"""
guard_expression = None
guard_group = ()
guard_permission = ()
guard_role = ()
......@@ -88,23 +92,11 @@ class GuardableMixin(object):
break
else:
return False
guard_expression = self.getGuardExpression()
if guard_expression and guard_expression.text:
guard_expression = self.getGuardExpressionInstance()
if guard_expression is not None:
expression_context = createExprContext(StateChangeInfo(current_object,
workflow,
kwargs=kw))
if not guard_expression(expression_context):
return False
return True
# Same as WorkflowVariable.variable_expression
def _setGuardExpression(self, text):
if text:
self.guard_expression = Expression(text)
else:
self.guard_expression = None
def _getGuardExpression(self):
if self.guard_expression is None:
return Expression('')
return self.guard_expression
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