Add feature to abort individual host queue entries the job detail and host detail pages.  Performed a few other cleanups along the way.
-refactor TableActionsPanel, extract separate TableSelectionPanel
-make TableDecorator support a SelectionManager and a TableActionsPanel (or selection panel or other such control) just above the paginator.  this makes it really easy to add selection capability, selection checkboxes, and an actions menu to any table.
-refactor TableDecorator in general since it kinda sucked
-change all existing code that does table selection to use the new TableDecorator support.  this include job list view, the create job host selector (which now uses the common selection links instead of its old buttons), and tko.TableView.
-add selection support + a bulk abort action to the tables in job detail view and host detail view. this itself was easy given the above refactorings.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@2283 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index 41048ab..02468b4 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -357,23 +357,17 @@
     return job.id
 
 
-def abort_job(id):
+def abort_host_queue_entries(**filter_data):
     """\
-    Abort the job with the given id number.
-
-    TODO: this method is deprecated in favor of abort_jobs().  We need
-    to eventually remove this rpc call entirely.
+    Abort a set of host queue entries.
     """
-    job = models.Job.objects.get(id=id)
-    job.abort()
+    query = models.HostQueueEntry.query_objects(filter_data)
+    host_queue_entries = list(query.select_related())
+    models.AclGroup.check_for_acl_violation_queue_entries(host_queue_entries)
 
-
-def abort_jobs(job_ids):
-    """\
-    Abort a list of jobs.
-    """
-    for job in models.Job.objects.in_bulk(job_ids).values():
-        job.abort()
+    user = thread_local.get_user()
+    for queue_entry in host_queue_entries:
+        queue_entry.abort(user)
 
 
 def get_jobs(not_yet_run=False, running=False, finished=False, **filter_data):