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