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