4301 |
16 May 08 |
nicklas |
1 |
<%-- $Id$ |
4301 |
16 May 08 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
4301 |
16 May 08 |
nicklas |
4 |
|
4301 |
16 May 08 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
4301 |
16 May 08 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
4301 |
16 May 08 |
nicklas |
7 |
|
4301 |
16 May 08 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
4301 |
16 May 08 |
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 |
4301 |
16 May 08 |
nicklas |
11 |
of the License, or (at your option) any later version. |
4301 |
16 May 08 |
nicklas |
12 |
|
4301 |
16 May 08 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
4301 |
16 May 08 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
4301 |
16 May 08 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4301 |
16 May 08 |
nicklas |
16 |
GNU General Public License for more details. |
4301 |
16 May 08 |
nicklas |
17 |
|
4301 |
16 May 08 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
4301 |
16 May 08 |
nicklas |
20 |
------------------------------------------------------------------ |
4301 |
16 May 08 |
nicklas |
21 |
|
4301 |
16 May 08 |
nicklas |
22 |
@author Nicklas |
4301 |
16 May 08 |
nicklas |
23 |
@version 2.0 |
4301 |
16 May 08 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
4301 |
16 May 08 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
4301 |
16 May 08 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
4301 |
16 May 08 |
nicklas |
28 |
import="net.sf.basedb.core.Item" |
4301 |
16 May 08 |
nicklas |
29 |
import="net.sf.basedb.core.ItemContext" |
4301 |
16 May 08 |
nicklas |
30 |
import="net.sf.basedb.core.Permission" |
4301 |
16 May 08 |
nicklas |
31 |
import="net.sf.basedb.core.ReporterList" |
4301 |
16 May 08 |
nicklas |
32 |
import="net.sf.basedb.core.PermissionDeniedException" |
4301 |
16 May 08 |
nicklas |
33 |
import="net.sf.basedb.clients.web.Base" |
4301 |
16 May 08 |
nicklas |
34 |
import="net.sf.basedb.clients.web.util.HTML" |
4301 |
16 May 08 |
nicklas |
35 |
import="net.sf.basedb.util.Values" |
4301 |
16 May 08 |
nicklas |
36 |
import="java.util.List" |
4301 |
16 May 08 |
nicklas |
37 |
%> |
4301 |
16 May 08 |
nicklas |
38 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
4301 |
16 May 08 |
nicklas |
39 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
4301 |
16 May 08 |
nicklas |
40 |
<% |
4301 |
16 May 08 |
nicklas |
41 |
final Item itemType = Item.REPORTERLIST; |
4301 |
16 May 08 |
nicklas |
42 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
4301 |
16 May 08 |
nicklas |
43 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
4301 |
16 May 08 |
nicklas |
44 |
final int itemId = cc.getId(); |
4301 |
16 May 08 |
nicklas |
45 |
final String ID = sc.getId(); |
4301 |
16 May 08 |
nicklas |
46 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
47 |
final DbControl dc = sc.newDbControl(":Merge reporter lists"); |
4301 |
16 May 08 |
nicklas |
48 |
try |
4301 |
16 May 08 |
nicklas |
49 |
{ |
4301 |
16 May 08 |
nicklas |
50 |
String mergeType = request.getParameter("mergeType"); |
4301 |
16 May 08 |
nicklas |
51 |
ReporterList reporterList = ReporterList.getById(dc, itemId); |
6314 |
02 Sep 13 |
nicklas |
52 |
reporterList.checkPermission(Permission.WRITE); |
4301 |
16 May 08 |
nicklas |
53 |
cc.setObject("item", reporterList); |
4301 |
16 May 08 |
nicklas |
54 |
String title = "Add/keep/remove reporters: " + HTML.encodeTags(reporterList.getName()); |
4301 |
16 May 08 |
nicklas |
55 |
%> |
4301 |
16 May 08 |
nicklas |
56 |
<base:page type="popup" title="<%=title%>"> |
6314 |
02 Sep 13 |
nicklas |
57 |
<base:head scripts="linkitems-2.js,~merge.js" /> |
6314 |
02 Sep 13 |
nicklas |
58 |
<base:body> |
5916 |
19 Dec 11 |
nicklas |
59 |
<h1><%=title%> <base:help helpid="reporterlist.merge" /></h1> |
6162 |
10 Oct 12 |
nicklas |
60 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="merge"> |
4301 |
16 May 08 |
nicklas |
61 |
<input type="hidden" name="cmd" value="MergeItem"> |
4301 |
16 May 08 |
nicklas |
62 |
|
5916 |
19 Dec 11 |
nicklas |
63 |
<div class="content bottomborder"> |
5916 |
19 Dec 11 |
nicklas |
64 |
<table class="fullform input100"> |
4301 |
16 May 08 |
nicklas |
65 |
<tr> |
5916 |
19 Dec 11 |
nicklas |
66 |
<th>This list</th> |
4301 |
16 May 08 |
nicklas |
67 |
<td><%=HTML.encodeTags(reporterList.getName())%></td> |
4301 |
16 May 08 |
nicklas |
68 |
<td rowspan="2"> |
6144 |
21 Sep 12 |
nicklas |
69 |
<img id="mergeImage" src="../../images/set_operations/union_union.png" alt=""> |
4301 |
16 May 08 |
nicklas |
70 |
</td> |
4301 |
16 May 08 |
nicklas |
71 |
</tr> |
5916 |
19 Dec 11 |
nicklas |
72 |
<tr class="big"> |
5916 |
19 Dec 11 |
nicklas |
73 |
<th>What to do</th> |
4301 |
16 May 08 |
nicklas |
74 |
<td> |
6314 |
02 Sep 13 |
nicklas |
75 |
<select name="mergeType" id="mergeType"> |
4301 |
16 May 08 |
nicklas |
76 |
<option value="union" <%="union".equals(mergeType) ? "selected" : ""%> |
4301 |
16 May 08 |
nicklas |
77 |
>Add reporters to |
4301 |
16 May 08 |
nicklas |
78 |
<option value="intersection" <%="intersection".equals(mergeType) ? "selected" : ""%> |
4301 |
16 May 08 |
nicklas |
79 |
>Keep reporters in |
4301 |
16 May 08 |
nicklas |
80 |
<option value="complement" <%="complement".equals(mergeType) ? "selected" : ""%> |
4301 |
16 May 08 |
nicklas |
81 |
>Remove reporters from |
4301 |
16 May 08 |
nicklas |
82 |
</select><br> |
4301 |
16 May 08 |
nicklas |
83 |
this list that are present in |
4301 |
16 May 08 |
nicklas |
84 |
<br> |
6314 |
02 Sep 13 |
nicklas |
85 |
<select name="sourceMerge" id="sourceMerge"> |
4301 |
16 May 08 |
nicklas |
86 |
<option value="union" <%="intersection".equals(mergeType) ? "" : "selected"%> |
4301 |
16 May 08 |
nicklas |
87 |
>some of |
4301 |
16 May 08 |
nicklas |
88 |
<option value="intersection" <%="intersection".equals(mergeType) ? "selected" : ""%> |
4301 |
16 May 08 |
nicklas |
89 |
>all of |
4301 |
16 May 08 |
nicklas |
90 |
</select><br> |
4301 |
16 May 08 |
nicklas |
91 |
the reporter lists selected below. |
4301 |
16 May 08 |
nicklas |
92 |
<p> |
4301 |
16 May 08 |
nicklas |
93 |
After the operation this list will |
5916 |
19 Dec 11 |
nicklas |
94 |
contain reporters from the gray-colored areas in the image. |
4301 |
16 May 08 |
nicklas |
95 |
|
4301 |
16 May 08 |
nicklas |
96 |
</td> |
4301 |
16 May 08 |
nicklas |
97 |
</tr> |
5916 |
19 Dec 11 |
nicklas |
98 |
<tr class="dynamic"> |
5916 |
19 Dec 11 |
nicklas |
99 |
<th>Reporter lists</th> |
4301 |
16 May 08 |
nicklas |
100 |
<td colspan="2"> |
5916 |
19 Dec 11 |
nicklas |
101 |
<div class="selectionlist"> |
5916 |
19 Dec 11 |
nicklas |
102 |
<table> |
5916 |
19 Dec 11 |
nicklas |
103 |
<tr> |
4301 |
16 May 08 |
nicklas |
104 |
<td> |
6314 |
02 Sep 13 |
nicklas |
105 |
<select name="reporterLists" id="reporterLists" |
6314 |
02 Sep 13 |
nicklas |
106 |
class="auto-init" data-auto-init="link-container" |
6314 |
02 Sep 13 |
nicklas |
107 |
size="10" multiple> |
4301 |
16 May 08 |
nicklas |
108 |
</select> |
4301 |
16 May 08 |
nicklas |
109 |
</td> |
4301 |
16 May 08 |
nicklas |
110 |
<td> |
5916 |
19 Dec 11 |
nicklas |
111 |
<td style="vertical-align: top;"> |
5916 |
19 Dec 11 |
nicklas |
112 |
<base:buttongroup vertical="true"> |
5916 |
19 Dec 11 |
nicklas |
113 |
<base:button |
6176 |
19 Oct 12 |
nicklas |
114 |
id="btnAddReporterLists" |
6314 |
02 Sep 13 |
nicklas |
115 |
subclass="leftaligned auto-init" |
6314 |
02 Sep 13 |
nicklas |
116 |
data-auto-init="add-link" |
6314 |
02 Sep 13 |
nicklas |
117 |
data-list-id="reporterLists" |
6314 |
02 Sep 13 |
nicklas |
118 |
data-item-type="REPORTERLIST" |
6314 |
02 Sep 13 |
nicklas |
119 |
data-exclude="<%=itemId%>" |
5916 |
19 Dec 11 |
nicklas |
120 |
style="width: 12em;" |
5916 |
19 Dec 11 |
nicklas |
121 |
title="Add reporter lists…" |
5916 |
19 Dec 11 |
nicklas |
122 |
tooltip="Add reporter lists" |
5916 |
19 Dec 11 |
nicklas |
123 |
/> |
5916 |
19 Dec 11 |
nicklas |
124 |
<base:button |
6314 |
02 Sep 13 |
nicklas |
125 |
subclass="leftaligned auto-init" |
6314 |
02 Sep 13 |
nicklas |
126 |
data-auto-init="remove-link" |
6314 |
02 Sep 13 |
nicklas |
127 |
data-list-id="reporterLists" |
5916 |
19 Dec 11 |
nicklas |
128 |
style="width: 12em;" |
5916 |
19 Dec 11 |
nicklas |
129 |
title="Remove" |
5916 |
19 Dec 11 |
nicklas |
130 |
tooltip="Remove the selected reporter lists" |
5916 |
19 Dec 11 |
nicklas |
131 |
/> |
5916 |
19 Dec 11 |
nicklas |
132 |
</base:buttongroup> |
4301 |
16 May 08 |
nicklas |
133 |
</td> |
4301 |
16 May 08 |
nicklas |
134 |
</tr> |
4301 |
16 May 08 |
nicklas |
135 |
</table> |
5916 |
19 Dec 11 |
nicklas |
136 |
</div> |
4301 |
16 May 08 |
nicklas |
137 |
</td> |
4301 |
16 May 08 |
nicklas |
138 |
</tr> |
5916 |
19 Dec 11 |
nicklas |
139 |
</table> |
4301 |
16 May 08 |
nicklas |
140 |
</div> |
5916 |
19 Dec 11 |
nicklas |
141 |
</form> |
4301 |
16 May 08 |
nicklas |
142 |
|
5916 |
19 Dec 11 |
nicklas |
143 |
<base:buttongroup subclass="dialogbuttons"> |
6314 |
02 Sep 13 |
nicklas |
144 |
<base:button id="btnSave" title="Ok" /> |
6314 |
02 Sep 13 |
nicklas |
145 |
<base:button id="close" title="Cancel" /> |
5916 |
19 Dec 11 |
nicklas |
146 |
</base:buttongroup> |
4301 |
16 May 08 |
nicklas |
147 |
</base:body> |
4301 |
16 May 08 |
nicklas |
148 |
</base:page> |
4301 |
16 May 08 |
nicklas |
149 |
<% |
4301 |
16 May 08 |
nicklas |
150 |
} |
4301 |
16 May 08 |
nicklas |
151 |
finally |
4301 |
16 May 08 |
nicklas |
152 |
{ |
4301 |
16 May 08 |
nicklas |
153 |
if (dc != null) dc.close(); |
4301 |
16 May 08 |
nicklas |
154 |
} |
4301 |
16 May 08 |
nicklas |
155 |
%> |