Commit 4e4dfc00 authored by Julien Muchembled's avatar Julien Muchembled

* Remove links to cancel or invoke activities from manageActivities. It was...

* Remove links to cancel or invoke activities from manageActivities. It was too dangerous and requires too much work to fix.
* Fix display of args column. Use html_quote to display activity_kw, agrs & kw columns.
* Display all activities (processing SQLQueue activities were hidden).
* Add uid column.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27474 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d17700fc
......@@ -45,6 +45,25 @@ class SQLBase:
assert len(result[0]) == 1
return result[0][0]
def getMessageList(self, activity_tool, processing_node=None,
include_processing=0, **kw):
# YO: reading all lines might cause a deadlock
readMessageList = getattr(activity_tool,
self.__class__.__name__ + '_readMessageList',
None)
if readMessageList is None:
return []
return [self.loadMessage(line.message,
uid=line.uid,
processing_node=line.processing_node,
priority=line.priority,
processing=line.processing)
for line in readMessageList(path=None,
method_id=None,
processing_node=processing_node,
to_date=None,
include_processing=include_processing)]
def _getPriority(self, activity_tool, method, default):
result = method()
assert len(result) == 1
......
......@@ -592,20 +592,7 @@ class SQLDict(RAMDict, SQLBase):
if len(uid_list)>0:
activity_tool.SQLDict_delMessage(uid = [x.uid for x in uid_list])
def getMessageList(self, activity_tool, processing_node=None, include_processing=0, **kw):
# YO: reading all lines might cause a deadlock
message_list = []
readMessageList = getattr(activity_tool, 'SQLDict_readMessageList', None)
if readMessageList is not None:
result = readMessageList(path=None, method_id=None, processing_node=None,
to_date=None, include_processing=include_processing)
for line in result:
m = self.loadMessage(line.message, uid = line.uid)
m.processing_node = line.processing_node
m.priority = line.priority
m.processing = line.processing
message_list.append(m)
return message_list
getMessageList = SQLBase.getMessageList
def dumpMessageList(self, activity_tool):
# Dump all messages in the table.
......
......@@ -426,17 +426,7 @@ class SQLQueue(RAMQueue, SQLBase):
if len(result):
activity_tool.SQLQueue_delMessage(uid = [line.uid for line in result])
def getMessageList(self, activity_tool, processing_node=None,**kw):
message_list = []
readMessageList = getattr(activity_tool, 'SQLQueue_readMessageList', None)
if readMessageList is not None:
result = readMessageList(path=None, method_id=None, processing_node=None, to_date=None, include_processing=0)
for line in result:
m = self.loadMessage(line.message)
m.processing_node = line.processing_node
m.priority = line.priority
message_list.append(m)
return message_list
getMessageList = SQLBase.getMessageList
def countMessage(self, activity_tool, tag=None, path=None,
method_id=None, message_uid=None, **kw):
......
......@@ -30,11 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<dtml-var manage_tabs>
<h3>Queued Activities</h3>
<p>Warning: Invoking or canceling activities will invoke/cancel all activities with both the same path and the same method_id.</p>
<p>Warning: Invoking an activity will <b>not</b> run any dependency check.</p>
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<th align="left" valign="top"></th>
<th align="left" valign="top">Uid</th>
<th align="left" valign="top">Object</th>
<th align="left" valign="top">Method Id</th>
<th align="left" valign="top">Activity Kw</th>
......@@ -47,16 +45,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
</tr>
<dtml-in expr="getMessageList(include_processing=1)">
<tr>
<td align="left" valign="top"><a href="manageCancel?object_path=<dtml-var "'/'.join(object_path)">&method_id=<dtml-var method_id>">Cancel</a> <a href="manageInvoke?object_path=<dtml-var "'/'.join(object_path)">&method_id=<dtml-var method_id>">Invoke</a></td>
<td align="left" valign="top"><dtml-var uid></td>
<td align="left" valign="top"><a href="<dtml-var "'/'.join(object_path)">"><dtml-var "'/'.join(object_path)"></a></td>
<td align="left" valign="top"><dtml-var method_id></td>
<td align="left" valign="top"><dtml-var "_.str(activity_kw)[1:-1]"></td>
<dtml-try>
<td align="left" valign="top"><dtml-var "', '.join(args)"></td>
<dtml-except>
<th align="left" valign="top">Not printable</th>
</dtml-try>
<td align="left" valign="top"><dtml-var "_.str(kw)[1:-1]"></td>
<td align="left" valign="top">
<dtml-if activity_kw><dtml-var expr="_.repr(activity_kw)[1:-1]" html_quote>
<dtml-else>&nbsp;
</dtml-if>
</td>
<td align="left" valign="top">
<dtml-if args><dtml-var expr="_.repr(_.list(args))[1:-1]" html_quote>
<dtml-else>&nbsp;
</dtml-if>
</td>
<td align="left" valign="top">
<dtml-if kw><dtml-var expr="_.repr(kw)[1:-1]" html_quote>
<dtml-else>&nbsp;
</dtml-if>
</td>
<td align="left" valign="top"><dtml-var processing_node></td>
<td align="left" valign="top"><dtml-var priority></td>
<td align="left" valign="top">
......
......@@ -19,7 +19,7 @@ SELECT * FROM
message_queue
WHERE
1 = 1
AND processing = 0
<dtml-if expr="not include_processing"> AND processing = 0 </dtml-if>
<dtml-if expr="processing_node is not None"> AND processing_node = <dtml-sqlvar processing_node type="int"> </dtml-if>
<dtml-if expr="path is not None">AND path = <dtml-sqlvar path type="string"></dtml-if>
<dtml-if expr="method_id is not None">AND method_id = <dtml-sqlvar method_id type="string"></dtml-if>
......
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