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