3655 |
10 Aug 07 |
nicklas |
1 |
<%-- $Id$ |
3655 |
10 Aug 07 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Nicklas Nordborg |
3655 |
10 Aug 07 |
nicklas |
4 |
|
3655 |
10 Aug 07 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
3655 |
10 Aug 07 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
3655 |
10 Aug 07 |
nicklas |
7 |
|
3655 |
10 Aug 07 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
3655 |
10 Aug 07 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
10 |
as published by the Free Software Foundation; either version 3 |
3655 |
10 Aug 07 |
nicklas |
11 |
of the License, or (at your option) any later version. |
3655 |
10 Aug 07 |
nicklas |
12 |
|
3655 |
10 Aug 07 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
3655 |
10 Aug 07 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3655 |
10 Aug 07 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3655 |
10 Aug 07 |
nicklas |
16 |
GNU General Public License for more details. |
3655 |
10 Aug 07 |
nicklas |
17 |
|
3655 |
10 Aug 07 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
3655 |
10 Aug 07 |
nicklas |
20 |
------------------------------------------------------------------ |
3655 |
10 Aug 07 |
nicklas |
21 |
|
3655 |
10 Aug 07 |
nicklas |
22 |
Display a progress reporter |
3655 |
10 Aug 07 |
nicklas |
23 |
|
3655 |
10 Aug 07 |
nicklas |
24 |
@author Nicklas |
3655 |
10 Aug 07 |
nicklas |
25 |
@version 2.0 |
3655 |
10 Aug 07 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
3655 |
10 Aug 07 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
3655 |
10 Aug 07 |
nicklas |
29 |
import="net.sf.basedb.core.SimpleProgressReporter" |
3655 |
10 Aug 07 |
nicklas |
30 |
import="net.sf.basedb.util.Values" |
3655 |
10 Aug 07 |
nicklas |
31 |
import="net.sf.basedb.clients.web.Base" |
6802 |
25 Mar 15 |
nicklas |
32 |
import="net.sf.basedb.clients.web.util.HTML" |
3655 |
10 Aug 07 |
nicklas |
33 |
%> |
3655 |
10 Aug 07 |
nicklas |
34 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
3655 |
10 Aug 07 |
nicklas |
35 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
3655 |
10 Aug 07 |
nicklas |
36 |
<% |
3655 |
10 Aug 07 |
nicklas |
37 |
String title = Values.getString(request.getParameter("title")); |
3655 |
10 Aug 07 |
nicklas |
38 |
String progressName = request.getParameter("progress"); |
6802 |
25 Mar 15 |
nicklas |
39 |
String notifyOpener = request.getParameter("notify_opener"); |
3655 |
10 Aug 07 |
nicklas |
40 |
SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
3655 |
10 Aug 07 |
nicklas |
41 |
|
7605 |
26 Feb 19 |
nicklas |
42 |
SimpleProgressReporter progress = sc.getSessionSetting("progress." + progressName); |
5908 |
13 Dec 11 |
nicklas |
43 |
String message = null; |
3655 |
10 Aug 07 |
nicklas |
44 |
int percentDone = 0; |
6694 |
26 Jan 15 |
nicklas |
45 |
boolean isError = false; |
3655 |
10 Aug 07 |
nicklas |
46 |
if (progress != null) |
3655 |
10 Aug 07 |
nicklas |
47 |
{ |
3655 |
10 Aug 07 |
nicklas |
48 |
message = progress.getMessage(); |
3655 |
10 Aug 07 |
nicklas |
49 |
percentDone = progress.getPercent(); |
3655 |
10 Aug 07 |
nicklas |
50 |
} |
5908 |
13 Dec 11 |
nicklas |
51 |
if (message == null) |
3655 |
10 Aug 07 |
nicklas |
52 |
{ |
3655 |
10 Aug 07 |
nicklas |
53 |
message = "Please wait..."; |
3655 |
10 Aug 07 |
nicklas |
54 |
} |
3655 |
10 Aug 07 |
nicklas |
55 |
if (percentDone >= 100) |
3655 |
10 Aug 07 |
nicklas |
56 |
{ |
3655 |
10 Aug 07 |
nicklas |
57 |
sc.setSessionSetting("progress." + progressName, null); |
6694 |
26 Jan 15 |
nicklas |
58 |
isError = progress.getError() != null; |
3655 |
10 Aug 07 |
nicklas |
59 |
} |
3655 |
10 Aug 07 |
nicklas |
60 |
%> |
3655 |
10 Aug 07 |
nicklas |
61 |
<base:page type="popup" title="<%=title%>"> |
6203 |
13 Nov 12 |
nicklas |
62 |
<base:head styles="progressbar.css" scripts="~progress_reporter.js" /> |
6694 |
26 Jan 15 |
nicklas |
63 |
<base:body data-percent-done="<%=percentDone %>" data-is-error="<%=isError ? 1 : 0 %>"> |
5908 |
13 Dec 11 |
nicklas |
64 |
<h1><%=title%></h1> |
6802 |
25 Mar 15 |
nicklas |
65 |
|
6802 |
25 Mar 15 |
nicklas |
66 |
<div id="page-data" class="datacontainer" |
6802 |
25 Mar 15 |
nicklas |
67 |
data-notify-opener="<%=HTML.encodeTags(notifyOpener)%>" |
6802 |
25 Mar 15 |
nicklas |
68 |
></div> |
6802 |
25 Mar 15 |
nicklas |
69 |
|
5908 |
13 Dec 11 |
nicklas |
70 |
<div class="content"> |
5908 |
13 Dec 11 |
nicklas |
71 |
|
6607 |
19 Nov 14 |
nicklas |
72 |
<table class="fullcc bg-filled-50 bottomborder"><tr><td> |
6694 |
26 Jan 15 |
nicklas |
73 |
<table class="progressbar" style="margin: auto;" id="progress-bar"> |
3655 |
10 Aug 07 |
nicklas |
74 |
<tr> |
5908 |
13 Dec 11 |
nicklas |
75 |
<td> |
6203 |
13 Nov 12 |
nicklas |
76 |
<table class="bar" style="width: 200px;"> |
3655 |
10 Aug 07 |
nicklas |
77 |
<tr> |
6203 |
13 Nov 12 |
nicklas |
78 |
<%if (percentDone > 0) {%><td style="width: <%=percentDone%>%;" class="percentDone"> </td><%}%> |
6203 |
13 Nov 12 |
nicklas |
79 |
<%if (percentDone < 100) {%><td style="width: <%=100-percentDone%>%;" class="percentRemain"> </td><%}%> |
3655 |
10 Aug 07 |
nicklas |
80 |
</tr> |
3655 |
10 Aug 07 |
nicklas |
81 |
</table> |
3655 |
10 Aug 07 |
nicklas |
82 |
</td> |
6928 |
04 Jun 15 |
nicklas |
83 |
<td id="percentText" style="padding-left: 2px;"><%=percentDone%>%</td> |
3655 |
10 Aug 07 |
nicklas |
84 |
</tr> |
3655 |
10 Aug 07 |
nicklas |
85 |
</table> |
5908 |
13 Dec 11 |
nicklas |
86 |
<%=message %> |
5908 |
13 Dec 11 |
nicklas |
87 |
<br><br> |
5908 |
13 Dec 11 |
nicklas |
88 |
|
6694 |
26 Jan 15 |
nicklas |
89 |
<div align="center" id="info"> |
5908 |
13 Dec 11 |
nicklas |
90 |
<i>Closing this window will NOT abort the process</i> |
5908 |
13 Dec 11 |
nicklas |
91 |
</div> |
5908 |
13 Dec 11 |
nicklas |
92 |
</td></tr></table> |
3655 |
10 Aug 07 |
nicklas |
93 |
</div> |
3655 |
10 Aug 07 |
nicklas |
94 |
|
5908 |
13 Dec 11 |
nicklas |
95 |
<base:buttongroup subclass="dialogbuttons"> |
6203 |
13 Nov 12 |
nicklas |
96 |
<base:button id="close" title="Close" /> |
5908 |
13 Dec 11 |
nicklas |
97 |
</base:buttongroup> |
5908 |
13 Dec 11 |
nicklas |
98 |
|
3655 |
10 Aug 07 |
nicklas |
99 |
</base:body> |
3655 |
10 Aug 07 |
nicklas |
100 |
</base:page> |