source: trunk/www/views/jobs/list_jobs.jsp @ 7290

Last change on this file since 7290 was 7290, checked in by Nicklas Nordborg, 6 years ago

Merged pre-3.10 release changes back to trunk.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 23.8 KB
Line 
1<%-- $Id: list_jobs.jsp 7290 2017-01-31 12:13:44Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
4  Copyright (C) 2007 Johan Enell, Nicklas Nordborg
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  @author Nicklas
24  @version 2.0
25--%>
26<%@ page pageEncoding="UTF-8" session="false"
27  import="net.sf.basedb.core.SessionControl"
28  import="net.sf.basedb.core.DbControl"
29  import="net.sf.basedb.core.Item"
30  import="net.sf.basedb.core.Job"
31  import="net.sf.basedb.core.JobAgent"
32  import="net.sf.basedb.core.ItemSubtype"
33  import="net.sf.basedb.core.ItemQuery"
34  import="net.sf.basedb.core.Include"
35  import="net.sf.basedb.core.ItemResultIterator"
36  import="net.sf.basedb.core.ItemResultList"
37  import="net.sf.basedb.core.ItemContext"
38  import="net.sf.basedb.core.Permission"
39  import="net.sf.basedb.core.Nameable"
40  import="net.sf.basedb.core.PluginDefinition"
41  import="net.sf.basedb.core.PermissionDeniedException"
42  import="net.sf.basedb.core.query.Hql"
43  import="net.sf.basedb.core.query.Orders"
44  import="net.sf.basedb.core.query.Restrictions"
45  import="net.sf.basedb.core.query.Expressions"
46  import="net.sf.basedb.core.plugin.GuiContext"
47  import="net.sf.basedb.core.plugin.Plugin"
48  import="net.sf.basedb.util.Enumeration"
49  import="net.sf.basedb.util.ShareableUtil"
50  import="net.sf.basedb.clients.web.Base"
51  import="net.sf.basedb.clients.web.ModeInfo"
52  import="net.sf.basedb.clients.web.PermissionUtil"
53  import="net.sf.basedb.clients.web.util.HTML"
54  import="net.sf.basedb.util.Values"
55  import="net.sf.basedb.util.formatter.Formatter"
56  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
57  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
58  import="net.sf.basedb.clients.web.extensions.JspContext"
59  import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer"
60  import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil"
61  import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil"
62  import="net.sf.basedb.util.extensions.ExtensionsInvoker"
63  import="java.util.Iterator"
64  import="java.util.List"
65  import="java.util.Map"
66  import="java.util.Date"
67%>
68<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
69<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
70<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %>
71<%!
72  private static final Item itemType = Item.JOB;
73  private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST);
74 
75  private static final Enumeration<String, String> status = new Enumeration<String, String>();
76  private static final Enumeration<String, String> pluginTypes = new Enumeration<String, String>();
77  private static final Enumeration<String, String> execTime = new Enumeration<String, String>();
78  static
79  {
80    for (Job.Status s : Job.Status.values())
81    {
82      status.add(Integer.toString(s.getValue()), HTML.encodeTags(s.toString()));
83    }
84    for (Plugin.MainType pt : Plugin.MainType.values())
85    {
86      pluginTypes.add(Integer.toString(pt.getValue()), HTML.encodeTags(pt.toString()));
87    }
88    for (Job.ExecutionTime et : Job.ExecutionTime.values())
89    {
90      execTime.add(Integer.toString(et.getValue()), HTML.encodeTags(et.toString()));
91    }
92  }
93%>
94<%
95final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, itemType);
96final String ID = sc.getId();
97final boolean createPermission = sc.hasPermission(Permission.CREATE, itemType);
98final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
99final Date now = new Date();
100final ModeInfo mode = ModeInfo.get(request.getParameter("mode"));
101final String callback = request.getParameter("callback");
102final String title = mode.generateTitle("job", "jobs");
103final DbControl dc = sc.newDbControl();
104ItemResultIterator<Job> jobs = null;
105try
106{
107 
108  // Get all job agents
109  final ItemQuery<JobAgent> agentQuery = JobAgent.getQuery();
110  agentQuery.include(Include.ALL);
111  agentQuery.order(Orders.asc(Hql.property("name")));
112  agentQuery.setCacheResult(true);
113  Enumeration<String, String> agents = new Enumeration<String, String>();
114  for (JobAgent a : agentQuery.list(dc))
115  {
116    agents.add(Integer.toString(a.getId()), a.getName());
117  }
118  // Load subtypes
119  final ItemQuery<ItemSubtype> typeQuery = ItemSubtype.getQuery(itemType);
120  typeQuery.order(Orders.asc(Hql.property("name")));
121  typeQuery.setCacheResult(true);
122
123  Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
124  try
125  {
126    final ItemQuery<Job> query = Base.getConfiguredQuery(dc, cc, true, Job.getQuery(), mode);
127    jobs = query.iterate(dc);
128  }
129  catch (Throwable t)
130  {
131    cc.setMessage(t.getMessage());
132    t.printStackTrace();
133  }
134  int numListed = 0;
135  Formatter<Date> dateTimeFormatter = FormatterFactory.getDateTimeFormatter(sc);
136  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, null);
137  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
138  ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext);
139  %>
140  <base:page title="<%=title==null ? "Jobs" : title%>" type="<%=mode.getPageType()%>" id="list-page">
141  <base:head scripts="table.js,~jobs.js" styles="table.css,toolbar.css,progressbar.css">
142    <ext:scripts context="<%=jspContext%>" />
143    <ext:stylesheets context="<%=jspContext%>" />
144  </base:head>
145 
146  <base:body>
147    <h1><%=title==null ? "Jobs" : title%></h1>
148    <div class="content">
149    <tbl:table 
150      id="jobs" 
151      columns="<%=cc.getSetting("columns")%>"
152      sortby="<%=cc.getSortProperty()%>" 
153      direction="<%=cc.getSortDirection()%>"
154      action="index.jsp"
155      sc="<%=sc%>"
156      item="<%=itemType%>"
157      filterrows="<%=cc.getFilterRows()%>"
158      subclass="fulltable"
159      >
160      <tbl:hidden 
161        name="mode" 
162        value="<%=mode.getName()%>" 
163      />
164      <tbl:hidden 
165        name="callback" 
166        value="<%=callback%>" 
167        skip="<%=callback == null%>" 
168      />
169      <tbl:columndef 
170        id="name"
171        property="name"
172        datatype="string"
173        title="Name"
174        sortable="true" 
175        filterable="true"
176        exportable="true"
177        show="always" 
178      />
179      <tbl:columndef 
180        id="id"
181        clazz="uniquecol"
182        property="id"
183        datatype="int"
184        title="ID"
185        sortable="true"
186        filterable="true"
187        exportable="true"
188      />
189      <tbl:columndef 
190        id="externalId"
191        property="externalId"
192        datatype="string"
193        title="External ID"
194        sortable="true"
195        filterable="true"
196        exportable="true"
197      />
198      <tbl:columndef 
199        id="itemSubtype"
200        property="itemSubtype"
201        sortproperty="itemSubtype.name"
202        exportproperty="itemSubtype.name:string"
203        datatype="int"
204        enumeration="<%=Enumeration.fromItems(typeQuery.list(dc), "-none-")%>"
205        title="Subtype"
206        sortable="true" 
207        filterable="true"
208        exportable="true"
209      />
210      <tbl:columndef 
211        id="owner"
212        property="owner.name"
213        datatype="string"
214        title="Owner"
215        sortable="true" 
216        filterable="true"
217        exportable="true"
218      />
219      <tbl:columndef 
220        id="priority"
221        property="priority"
222        datatype="int"
223        title="Priority"
224        sortable="true" 
225        filterable="true"
226        exportable="true"
227      />
228      <tbl:columndef 
229        id="status"
230        property="status"
231        datatype="int"
232        enumeration="<%=status%>"
233        title="Status"
234        sortable="true" 
235        filterable="true"
236        exportable="true"
237      />
238      <tbl:columndef 
239        id="statusMessage"
240        property="statusMessage"
241        datatype="string"
242        title="Status message"
243        sortable="true" 
244        filterable="true"
245        exportable="true"
246      />
247      <tbl:columndef 
248        id="dryRun"
249        property="dryRun"
250        datatype="boolean"
251        title="Dry run"
252        sortable="true" 
253        filterable="true"
254        exportable="true"
255      />
256      <tbl:columndef 
257        id="stackTrace"
258        property="stackTrace"
259        datatype="string"
260        title="Stack trace"
261        sortable="true" 
262        filterable="true"
263        exportable="true"
264      />
265      <tbl:columndef 
266        id="server"
267        property="server"
268        datatype="string"
269        title="Server"
270        sortable="true" 
271        filterable="true"
272        exportable="true"
273      />
274      <tbl:columndef 
275        id="node"
276        property="node"
277        datatype="string"
278        title="Node"
279        sortable="true" 
280        filterable="true"
281        exportable="true"
282      />
283      <tbl:columndef 
284        id="jobagent"
285        property="jobAgentId"
286        datatype="int"
287        title="Job agent"
288        filterable="true"
289        enumeration="<%=agents%>"
290      />
291      <tbl:columndef 
292        id="percentComplete"
293        property="percentComplete"
294        datatype="int"
295        title="Percent complete"
296        sortable="true" 
297        filterable="true"
298        exportable="true"
299      />
300      <tbl:columndef 
301        id="estimatedExecutionTime"
302        property="estimatedExecutionTime"
303        datatype="int"
304        enumeration="<%=execTime%>"
305        title="Estimated time"
306        tooltip="An estimation of the execution time of the plugin"
307        sortable="true" 
308        filterable="true"
309        exportable="true"
310      />
311      <tbl:columndef
312        id="runningTime"
313        title="Running time"
314      />
315      <tbl:columndef 
316        id="created" 
317        property="created"
318        datatype="timestamp" 
319        title="Created" 
320        sortable="true" 
321        filterable="true" 
322        exportable="true"
323        formatter="<%=dateTimeFormatter%>"
324      />
325      <tbl:columndef 
326        id="scheduled" 
327        property="scheduled"
328        datatype="timestamp" 
329        title="Scheduled" 
330        sortable="true" 
331        filterable="true" 
332        exportable="true"
333        formatter="<%=dateTimeFormatter%>"
334      />
335      <tbl:columndef 
336        id="started" 
337        property="started"
338        datatype="timestamp" 
339        title="Started" 
340        sortable="true" 
341        filterable="true" 
342        exportable="true"
343        formatter="<%=dateTimeFormatter%>"
344      />
345      <tbl:columndef 
346        id="ended" 
347        property="ended"
348        datatype="timestamp" 
349        title="Ended" 
350        sortable="true" 
351        filterable="true" 
352        exportable="true"
353        formatter="<%=dateTimeFormatter%>"
354      />
355      <tbl:columndef
356        id="pluginType"
357        property="pluginDefinition.mainType"
358        datatype="int"
359        title="Type"
360        enumeration="<%=pluginTypes%>"
361        sortable="true" 
362        filterable="true"
363        exportable="true"
364      />
365      <tbl:columndef 
366        id="experiment"
367        property="experiment.name"
368        datatype="string"
369        title="Experiment"
370        sortable="true" 
371        filterable="true"
372        exportable="true"
373      />
374      <tbl:columndef 
375        id="plugin"
376        property="pluginDefinition.name"
377        datatype="string"
378        title="Plugin"
379        sortable="true" 
380        filterable="true"
381        exportable="true"
382      />
383      <tbl:columndef 
384        id="pluginVersion"
385        property="pluginVersion"
386        datatype="string"
387        title="Plugin version"
388        sortable="true" 
389        filterable="true"
390        exportable="true"
391      />
392      <tbl:columndef 
393        id="configuration"
394        property="pluginConfiguration.name"
395        datatype="string"
396        title="Configuration"
397        sortable="true" 
398        filterable="true"
399        exportable="true"
400      />
401      <tbl:columndef 
402        id="description"
403        property="description"
404        datatype="string"
405        title="Description" 
406        sortable="true" 
407        filterable="true" 
408        exportable="true"
409      />
410      <tbl:columndef
411        id="permission"
412        title="Permission"
413      />
414      <tbl:columndef
415        id="sharedTo"
416        title="Shared to"
417        filterable="true"
418        filterproperty="!sharedTo.name"
419        datatype="string"
420      />
421      <tbl:columndef 
422        id="xt-columns" 
423        extensions="<%=columnsInvoker%>" 
424        jspcontext="<%=jspContext%>" 
425      />
426      <div class="panelgroup bg-filled-50 bottomborder">
427        <tbl:toolbar
428          subclass="bottomborder"
429          visible="<%=mode.hasToolbar()%>"
430          >
431          <tbl:button 
432            id="btnDeleteItems"
433            image="delete.png"
434            title="Delete" 
435            tooltip="Delete the selected items" 
436          />
437          <tbl:button 
438            id="btnRestoreItems"
439            image="restore.png"
440            title="Restore" 
441            tooltip="Restore the selected (deleted) items"
442          />
443          <tbl:button 
444            id="btnAbort"
445            image="abort.png"
446            title="Abort&hellip;" 
447            tooltip="Abort the selected items"
448          />
449          <tbl:button 
450            id="btnShareItems"
451            image="share.png"
452            title="Share&hellip;" 
453            tooltip="Share the selected items"
454          />
455          <tbl:button 
456            id="btnSetOwner"
457            image="take_ownership.png"
458            title="Set owner&hellip;"
459            tooltip="Change owner of the selected items"
460          />
461          <tbl:button 
462            id="btnColumns"
463            image="columns.png" 
464            title="Columns&hellip;" 
465            tooltip="Show, hide and re-order columns" 
466          />
467          <tbl:button 
468            id="btnImport"
469            data-plugin-type="IMPORT"
470            image="import.png" 
471            title="Import&hellip;" 
472            tooltip="Import data" 
473            visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>"
474          />
475          <tbl:button 
476            id="btnExport"
477            data-plugin-type="EXPORT"
478            image="export.png" 
479            title="Export&hellip;" 
480            tooltip="Export data" 
481            visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>"
482          />
483          <tbl:button 
484            id="btnRunPlugin"
485            data-plugin-type="OTHER"
486            image="runplugin.png" 
487            title="Run plugin&hellip;" 
488            tooltip="Run a plugin" 
489            visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>"
490          />
491          <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" 
492            wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/>
493        </tbl:toolbar>
494        <tbl:panel>
495          <tbl:presetselector />
496          <tbl:navigator
497            page="<%=cc.getPage()%>" 
498            rowsperpage="<%=cc.getRowsPerPage()%>" 
499            totalrows="<%=jobs == null ? 0 : jobs.getTotalCount()%>" 
500            visible="<%=mode.hasNavigator()%>"
501          />
502        </tbl:panel>
503      </div>
504      <tbl:data>
505        <tbl:headers>
506          <tbl:headerrow>
507            <tbl:header colspan="3" />
508            <tbl:columnheaders />
509          </tbl:headerrow>
510          <%
511          int numFilters = cc.getNumPropertyFilters();
512          int numRows = cc.getFilterRows();
513          for (int filterNo = 0; filterNo < numRows; filterNo++)
514          {
515            boolean lastRow = filterNo == numRows-1;
516            %>
517            <tbl:headerrow>
518              <tbl:header subclass="index" />
519              <tbl:header 
520                subclass="check" 
521                visible="<%=mode.hasCheck()%>"
522                ><base:icon 
523                  subclass="link table-check"
524                  image="check_uncheck.png" 
525                  tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" 
526                  visible="<%=lastRow%>"
527                /></tbl:header>
528              <tbl:header 
529                subclass="check" 
530                visible="<%=mode.hasRadio()%>"
531                />
532              <tbl:header 
533                subclass="icons" 
534                visible="<%=mode.hasIcons()%>"
535                >
536                <base:icon
537                  subclass="link table-filter-row-action"
538                  image="add.png"
539                  tooltip="Add extra filter row"
540                  visible="<%=lastRow%>"
541                /><base:icon
542                  subclass="link table-filter-row-action"
543                  image="remove.png"
544                  tooltip="Remove this filter row"
545                  visible="<%=numRows > 1 || numFilters > 0 %>"
546                  data-remove-row="<%=filterNo%>"
547                />
548              </tbl:header>
549              <tbl:propertyfilter row="<%=filterNo%>" />
550            </tbl:headerrow>
551            <%
552          }
553          %>
554        </tbl:headers>
555        <tbl:rows>
556          <%
557          if (cc.getMessage() != null)
558          {
559            %>
560            <tbl:panel subclass="bg-filled-50">
561              <div class="messagecontainer error"><%=cc.getMessage()%></div>
562            </tbl:panel>
563            <%
564            cc.setMessage(null);
565          }
566          int index = cc.getPage()*cc.getRowsPerPage();
567          int selectedItemId = cc.getId();
568          if (jobs != null)
569          {
570            String tooltip = mode.isSelectionMode() ?
571              "Select this item" : "View this item";
572            while (jobs.hasNext())
573            {
574              Job item = jobs.next();
575              int itemId = item.getId();
576              String name = HTML.encodeTags(item.getName());
577             
578              boolean deletePermission = item.hasPermission(Permission.DELETE);
579              index++;
580              numListed++;
581              PluginDefinition plugin = null;
582              boolean readPlugin = true;
583              try
584              {
585                plugin = item.getPluginDefinition();
586              }
587              catch (PermissionDeniedException ex)
588              {
589                readPlugin = false;
590              }
591              JobAgent agent = null;
592              boolean readAgent = true;
593              try
594              {
595                agent = item.getJobAgent();
596              }
597              catch (PermissionDeniedException ex)
598              {
599                readAgent = false;
600              }
601              %>
602              <tbl:row>
603                <tbl:header 
604                  clazz="index"
605                  ><%=index%></tbl:header>
606                <tbl:header 
607                  clazz="check" 
608                  visible="<%=mode.hasCheck()%>"
609                  ><input 
610                    type="checkbox" 
611                    name="<%=itemId%>" 
612                    value="<%=itemId%>" 
613                    title="<%=name%>" 
614                    <%=cc.getSelected().contains(itemId) ? "checked" : ""%> 
615                  ></tbl:header>
616                <tbl:header 
617                  clazz="check" 
618                  visible="<%=mode.hasRadio()%>"
619                  ><input 
620                    type="radio" 
621                    name="item_id" 
622                    value="<%=itemId%>" 
623                    title="<%=name%>" 
624                    <%=selectedItemId == itemId ? "checked" : ""%>
625                  ></tbl:header>
626                <tbl:header 
627                  clazz="icons" 
628                  visible="<%=mode.hasIcons()%>"
629                  ><base:icon 
630                    image="deleted.png"
631                    id="<%="delete."+itemId %>"
632                    subclass="<%=deletePermission ? "table-delete-item" : "disabled" %>"
633                    data-item-id="<%=itemId%>"
634                    tooltip="This item has been scheduled for deletion" 
635                    visible="<%=item.isRemoved()%>"
636                  />&nbsp;</tbl:header>
637                <tbl:cell column="name"><div 
638                  class="link table-item"
639                  data-item-id="<%=itemId%>"
640                  data-no-edit="1"
641                  tabindex="0"
642                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
643                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
644                <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell>
645                <tbl:cell column="itemSubtype"
646                  ><base:propertyvalue 
647                    item="<%=item%>" 
648                    property="itemSubtype"
649                    enableEditLink="<%=mode.hasEditLink()%>" 
650                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
651                  /></tbl:cell>
652                <tbl:cell column="owner"
653                  ><base:propertyvalue 
654                    item="<%=item%>" 
655                    property="owner"
656                    enableEditLink="<%=mode.hasEditLink()%>" 
657                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
658                  /></tbl:cell>
659                <tbl:cell column="priority"><%=item.getPriority()%></tbl:cell>
660                <tbl:cell column="status"><%=item.getStatus()%></tbl:cell>
661                <tbl:cell column="statusMessage"><%=HTML.encodeTags(item.getStatusMessage())%></tbl:cell>
662                <tbl:cell column="dryRun"><%=item.isDryRun()%></tbl:cell>
663                <tbl:cell column="stackTrace"><%=HTML.encodeTags(item.getStackTrace())%></tbl:cell>
664                <tbl:cell column="server"><%=HTML.encodeTags(item.getServer())%></tbl:cell>
665                <tbl:cell column="node"><%=HTML.encodeTags(item.getNode())%></tbl:cell>
666                <tbl:cell column="jobagent"><%=Base.getLinkedName(ID, agent, !readAgent, true)%></tbl:cell>
667                <tbl:cell column="estimatedExecutionTime"><%=item.getEstimatedExecutionTime()%></tbl:cell>
668                <tbl:cell column="percentComplete">
669                  <table class="progressbar <%=item.getStatus() == Job.Status.ERROR ? "failed" : ""%>">
670                  <tr>
671                  <td>
672                    <table class="bar" style="width: 100px;">
673                    <tr>
674                      <%
675                      int percent = item.getPercentComplete();
676                      if (percent > 0) 
677                      {
678                        %>
679                        <td style="width: <%=percent%>%;" class="percentDone">&nbsp;</td>
680                        <% 
681                      }
682                      if (percent == -1)
683                      {
684                        %>
685                        <td style="width: 100%;" class="percentUnknown">unknown</td>
686                        <%
687                      }
688                      else if (percent < 100) 
689                      { 
690                        %>
691                        <td style="width: <%=100-percent%>%;" class="percentRemain">&nbsp;</td>
692                        <%
693                      }
694                      %>
695                    </tr>
696                    </table>
697                  </td>
698                  <%if (percent != -1) { %>
699                    <td class="percentText"><%=percent%>%</td>
700                  <%} %>
701                  </tr>
702                  </table>
703                </tbl:cell>
704                <tbl:cell column="created" value="<%=item.getCreated()%>" />
705                <tbl:cell column="scheduled" value="<%=item.getScheduled()%>" />
706                <tbl:cell column="started" value="<%=item.getStarted()%>" />
707                <tbl:cell column="ended" value="<%=item.getEnded()%>" />
708                <tbl:cell column="runningTime">
709                  <%
710                  Date started = item.getStarted();
711                  if (started != null)
712                  {
713                    Date ended = item.getEnded();
714                    if (ended == null) ended = now;
715                    long runningTime = ended.getTime() - started.getTime();
716                    %>
717                    <%=Values.formatTime(runningTime / 1000)%>
718                    <%
719                  }
720                  %>
721                </tbl:cell>
722                <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell>
723                <tbl:cell column="pluginType">
724                  <%
725                  if (!readPlugin)
726                  {
727                    %>
728                    <i>- denied -</i>
729                    <%
730                  }
731                  else if (plugin == null)
732                  {
733                    %>
734                    <i>- none -</i>
735                    <%
736                  }
737                  else
738                  {
739                    %>
740                    <%=plugin.getMainType()%>
741                    <%
742                  }
743                  %>
744                </tbl:cell>
745                <tbl:cell column="experiment"
746                  ><base:propertyvalue 
747                    item="<%=item%>" 
748                    property="experiment"
749                    enableEditLink="<%=mode.hasEditLink()%>" 
750                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
751                  /></tbl:cell>
752                <tbl:cell column="plugin">
753                  <%
754                  if (!readPlugin)
755                  {
756                    %>
757                    <i>- denied -</i>
758                    <%
759                  }
760                  else if (plugin == null)
761                  {
762                    %>
763                    <i>- none -</i>
764                    <%
765                  }
766                  else
767                  {
768                    %>
769                    <%=HTML.encodeTags(plugin.getName())%>
770                    <%
771                  }
772                  %>
773                </tbl:cell>
774                <tbl:cell column="pluginVersion"><%=HTML.encodeTags(item.getPluginVersion())%></tbl:cell>
775                <tbl:cell column="configuration"
776                  ><base:propertyvalue 
777                    item="<%=item%>" 
778                    property="pluginConfiguration"
779                    enableEditLink="<%=mode.hasEditLink()%>" 
780                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
781                  /></tbl:cell>
782                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
783                <tbl:cell column="sharedTo">
784                  <%
785                  Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator();
786                  while(sharees.hasNext())
787                  {
788                    Nameable n = sharees.next();
789                    if (mode.hasPropertyLink())
790                    {
791                      out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink()));
792                    }
793                    else
794                    {
795                      out.write(HTML.encodeTags(n.getName()));
796                    }
797                    out.write(sharees.hasNext() ? ", " : "");
798                  }
799                  %>
800                </tbl:cell>
801                <tbl:xt-cells dc="<%=dc%>" item="<%=item%>">
802                  <tbl:cell column="xt-columns" />
803                </tbl:xt-cells>
804              </tbl:row>
805              <%
806              }
807            }
808          if (numListed == 0)
809          {
810            %>
811            <tbl:panel subclass="bg-filled-50">
812              <div class="messagecontainer note">
813              <%=jobs == null || jobs.getTotalCount() == 0 ? "No jobs were found" : "No jobs on this page. Please select another page!" %>
814              </div>
815            </tbl:panel>
816            <%
817          }
818          %>
819        </tbl:rows>
820      </tbl:data>
821    </tbl:table>
822    </div>
823   
824    <base:buttongroup subclass="dialogbuttons">
825      <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" />
826      <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" />
827      <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" />
828    </base:buttongroup>
829   
830  </base:body>
831  </base:page>
832  <%
833}
834finally
835{
836  if (jobs != null) jobs.close();
837  if (dc != null) dc.close();
838}
839%>
Note: See TracBrowser for help on using the repository browser.