Commit 65fb9c09 authored by Aurel's avatar Aurel

Configure the listbox of alarms to use the catalog to retrieve active processes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23922 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a982d7f6
...@@ -53,31 +53,19 @@ ...@@ -53,31 +53,19 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string encoding="cdata"><![CDATA[
Returns active processes related to an Alarm \n
ordered by data. sense_value is calculated\n for result in context.getResultList():\n
using the Alarm itself.\n # This is useful is result is returned as a Return instance\n
\n if result.severity > result.INFO:\n
TODO: optimisation of list method to compute values\n return True\n
only on the currently displayed range\n # This is the default case\n
TODO2: optimisation of sense_value through cache\n if getattr(result, \'result\', False):\n
"""\n return True\n
\n return False\n
def sort_date(a,b):\n
return - cmp(a.getStartDate(), b.getStartDate())\n
\n ]]></string> </value>
process_list = context.getCausalityRelatedValueList()\n
process_list.sort(sort_date)\n
return_list = []\n
for process in process_list:\n
process_id = process.getId()\n
start_date = process.getStartDate()\n
sense_value = context.sense(process=process)\n
return_list.append(context.asContext(process_id=process.getId(), \n
start_date=process.getStartDate(),\n
sense_value=sense_value))\n
return return_list\n
</string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -114,16 +102,13 @@ return return_list\n ...@@ -114,16 +102,13 @@ return return_list\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>sort_date</string> <string>_getiter_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>process_list</string> <string>result</string>
<string>return_list</string> <string>True</string>
<string>_getiter_</string> <string>getattr</string>
<string>process</string> <string>False</string>
<string>process_id</string>
<string>start_date</string>
<string>sense_value</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -140,7 +125,7 @@ return return_list\n ...@@ -140,7 +125,7 @@ return return_list\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_getOrderedActiveProcessList</string> </value> <value> <string>ActiveProcess_sense</string> </value>
</item> </item>
<item> <item>
<key> <string>warnings</string> </key> <key> <string>warnings</string> </key>
......
...@@ -61,7 +61,7 @@ if object is None:\n ...@@ -61,7 +61,7 @@ if object is None:\n
\n \n
url = context.absolute_url()\n url = context.absolute_url()\n
method = context.getReportMethodId(\'Alarm_viewReport\')\n method = context.getReportMethodId(\'Alarm_viewReport\')\n
kw = { \'active_process\' : \'portal_activities/%s\' % object.process_id,\n kw = { \'active_process\' : \'portal_activities/%s\' % object.id,\n
\'reset\' : \'1\', \n \'reset\' : \'1\', \n
}\n }\n
\n \n
......
...@@ -179,10 +179,18 @@ ...@@ -179,10 +179,18 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>anchor</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -193,7 +201,9 @@ ...@@ -193,7 +201,9 @@
</item> </item>
<item> <item>
<key> <string>default_params</string> </key> <key> <string>default_params</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -247,6 +257,10 @@ ...@@ -247,6 +257,10 @@
<key> <string>meta_types</string> </key> <key> <string>meta_types</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>page_template</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -295,6 +309,10 @@ ...@@ -295,6 +309,10 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -327,12 +345,16 @@ ...@@ -327,12 +345,16 @@
<key> <string>alternate_name</string> </key> <key> <string>alternate_name</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>anchor</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>columns</string> </key> <key> <string>columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
<string>process_id</string> <string>id</string>
<string>ID</string> <string>ID</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -340,7 +362,7 @@ ...@@ -340,7 +362,7 @@
<string>Date</string> <string>Date</string>
</tuple> </tuple>
<tuple> <tuple>
<string>sense_value</string> <string>ActiveProcess_sense</string>
<string>Problem Detected</string> <string>Problem Detected</string>
</tuple> </tuple>
</list> </list>
...@@ -385,12 +407,7 @@ ...@@ -385,12 +407,7 @@
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list/>
<tuple>
<string>id</string>
<string>Id</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -422,7 +439,7 @@ ...@@ -422,7 +439,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -438,7 +455,12 @@ ...@@ -438,7 +455,12 @@
<item> <item>
<key> <string>portal_types</string> </key> <key> <string>portal_types</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>Active Process</string>
<string>Active Process</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -472,7 +494,12 @@ ...@@ -472,7 +494,12 @@
<item> <item>
<key> <string>sort</string> </key> <key> <string>sort</string> </key>
<value> <value>
<list/> <list>
<tuple>
<string>creation_date</string>
<string>DESC</string>
</tuple>
</list>
</value> </value>
</item> </item>
<item> <item>
...@@ -495,12 +522,18 @@ ...@@ -495,12 +522,18 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Active Processes</string> </value> <value> <string>Active Processes</string> </value>
</item> </item>
<item>
<key> <string>untranslatable_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>url_columns</string> </key> <key> <string>url_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
<string>process_id</string> <string>id</string>
<string>Alarm_getReportURL</string> <string>Alarm_getReportURL</string>
</tuple> </tuple>
<tuple> <tuple>
...@@ -508,7 +541,7 @@ ...@@ -508,7 +541,7 @@
<string>Alarm_getReportURL</string> <string>Alarm_getReportURL</string>
</tuple> </tuple>
<tuple> <tuple>
<string>sense_value</string> <string>ActiveProcess_sense</string>
<string>Alarm_getReportURL</string> <string>Alarm_getReportURL</string>
</tuple> </tuple>
</list> </list>
...@@ -521,6 +554,22 @@ ...@@ -521,6 +554,22 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: [(\'causality_uid\',here.getUid()),]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
...@@ -531,7 +580,7 @@ ...@@ -531,7 +580,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>Alarm_getOrderedActiveProcessList</string> </value> <value> <string>portal_catalog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
971 973
\ No newline at end of file \ No newline at end of file
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