7773 |
17 Feb 20 |
nicklas |
1 |
<%-- $Id: save_preset.jsp 6607 2014-11-19 14:52:20Z nicklas $ |
7773 |
17 Feb 20 |
nicklas |
2 |
------------------------------------------------------------------ |
7773 |
17 Feb 20 |
nicklas |
Copyright (C) 2020 Nicklas Nordborg |
7773 |
17 Feb 20 |
nicklas |
4 |
|
7773 |
17 Feb 20 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
7773 |
17 Feb 20 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
7773 |
17 Feb 20 |
nicklas |
7 |
|
7773 |
17 Feb 20 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
7773 |
17 Feb 20 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
7773 |
17 Feb 20 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
7773 |
17 Feb 20 |
nicklas |
11 |
of the License, or (at your option) any later version. |
7773 |
17 Feb 20 |
nicklas |
12 |
|
7773 |
17 Feb 20 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
7773 |
17 Feb 20 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
7773 |
17 Feb 20 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7773 |
17 Feb 20 |
nicklas |
16 |
GNU General Public License for more details. |
7773 |
17 Feb 20 |
nicklas |
17 |
|
7773 |
17 Feb 20 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
7773 |
17 Feb 20 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
7773 |
17 Feb 20 |
nicklas |
20 |
------------------------------------------------------------------ |
7773 |
17 Feb 20 |
nicklas |
21 |
|
7773 |
17 Feb 20 |
nicklas |
22 |
--%> |
7773 |
17 Feb 20 |
nicklas |
23 |
<%@ page pageEncoding="UTF-8" session="false" |
7773 |
17 Feb 20 |
nicklas |
24 |
import="net.sf.basedb.core.SessionControl" |
7773 |
17 Feb 20 |
nicklas |
25 |
import="net.sf.basedb.core.Item" |
7773 |
17 Feb 20 |
nicklas |
26 |
import="net.sf.basedb.core.SyncFilter.SourceItemTransform" |
7773 |
17 Feb 20 |
nicklas |
27 |
import="net.sf.basedb.clients.web.Base" |
7773 |
17 Feb 20 |
nicklas |
28 |
import="net.sf.basedb.clients.web.util.HTML" |
7773 |
17 Feb 20 |
nicklas |
29 |
import="net.sf.basedb.util.Values" |
7773 |
17 Feb 20 |
nicklas |
30 |
import="net.sf.basedb.util.listable.SourceItemTransformerFactory" |
7773 |
17 Feb 20 |
nicklas |
31 |
import="net.sf.basedb.util.listable.ListableUtil" |
7773 |
17 Feb 20 |
nicklas |
32 |
import="java.util.List" |
7773 |
17 Feb 20 |
nicklas |
33 |
%> |
7773 |
17 Feb 20 |
nicklas |
34 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
7773 |
17 Feb 20 |
nicklas |
35 |
<% |
7773 |
17 Feb 20 |
nicklas |
36 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
7773 |
17 Feb 20 |
nicklas |
37 |
final String ID = sc.getId(); |
7773 |
17 Feb 20 |
nicklas |
38 |
final Item itemType = Item.valueOf(request.getParameter("item_type")); |
7773 |
17 Feb 20 |
nicklas |
39 |
|
7773 |
17 Feb 20 |
nicklas |
40 |
SourceItemTransformerFactory factory = ListableUtil.getTransformerFactory(itemType); |
7773 |
17 Feb 20 |
nicklas |
41 |
List<Item> allowedParentItems = factory.getSupportedSourceItems(SourceItemTransform.PARENT_TO_CHILD); |
7842 |
01 Sep 20 |
nicklas |
42 |
List<Item> allowedChildItems = factory.getSupportedSourceItems(SourceItemTransform.CHILD_TO_PARENT); |
7773 |
17 Feb 20 |
nicklas |
43 |
%> |
7842 |
01 Sep 20 |
nicklas |
44 |
<base:page type="popup" title="Add parent or child item column"> |
8083 |
20 Oct 22 |
nicklas |
45 |
<base:head scripts="~add_relateditem_column.js"> |
8083 |
20 Oct 22 |
nicklas |
46 |
<style> |
8083 |
20 Oct 22 |
nicklas |
47 |
th |
8083 |
20 Oct 22 |
nicklas |
48 |
{ |
8083 |
20 Oct 22 |
nicklas |
49 |
min-width: 10em; |
8083 |
20 Oct 22 |
nicklas |
50 |
} |
8083 |
20 Oct 22 |
nicklas |
51 |
select |
8083 |
20 Oct 22 |
nicklas |
52 |
{ |
8083 |
20 Oct 22 |
nicklas |
53 |
width: calc(100% - 1em); |
8083 |
20 Oct 22 |
nicklas |
54 |
min-width: 15em; |
8083 |
20 Oct 22 |
nicklas |
55 |
} |
8083 |
20 Oct 22 |
nicklas |
56 |
|
8083 |
20 Oct 22 |
nicklas |
57 |
.columnstable |
8083 |
20 Oct 22 |
nicklas |
58 |
{ |
8083 |
20 Oct 22 |
nicklas |
59 |
width: 100%; |
8094 |
04 Nov 22 |
nicklas |
60 |
position: absolute; |
8094 |
04 Nov 22 |
nicklas |
61 |
border-collapse: separate; |
8083 |
20 Oct 22 |
nicklas |
62 |
} |
8083 |
20 Oct 22 |
nicklas |
63 |
|
8094 |
04 Nov 22 |
nicklas |
64 |
.columnstable thead |
8094 |
04 Nov 22 |
nicklas |
65 |
{ |
8094 |
04 Nov 22 |
nicklas |
66 |
position: sticky; |
8094 |
04 Nov 22 |
nicklas |
67 |
top: 0; |
8094 |
04 Nov 22 |
nicklas |
68 |
} |
8094 |
04 Nov 22 |
nicklas |
69 |
|
8083 |
20 Oct 22 |
nicklas |
70 |
.columnstable tr |
8083 |
20 Oct 22 |
nicklas |
71 |
{ |
8083 |
20 Oct 22 |
nicklas |
72 |
vertical-align: top; |
8083 |
20 Oct 22 |
nicklas |
73 |
} |
8083 |
20 Oct 22 |
nicklas |
74 |
|
8094 |
04 Nov 22 |
nicklas |
75 |
.columnstable tr.bottomborder th |
8094 |
04 Nov 22 |
nicklas |
76 |
{ |
8094 |
04 Nov 22 |
nicklas |
77 |
border-bottom-width: 1px; |
8094 |
04 Nov 22 |
nicklas |
78 |
} |
8094 |
04 Nov 22 |
nicklas |
79 |
|
8094 |
04 Nov 22 |
nicklas |
80 |
.columnstable tr.topborder th |
8094 |
04 Nov 22 |
nicklas |
81 |
{ |
8094 |
04 Nov 22 |
nicklas |
82 |
border-top-width: 1px; |
8094 |
04 Nov 22 |
nicklas |
83 |
} |
8094 |
04 Nov 22 |
nicklas |
84 |
|
8083 |
20 Oct 22 |
nicklas |
85 |
.columnstable th |
8083 |
20 Oct 22 |
nicklas |
86 |
{ |
8083 |
20 Oct 22 |
nicklas |
87 |
text-align: left; |
8083 |
20 Oct 22 |
nicklas |
88 |
padding: 2px 4px; |
8083 |
20 Oct 22 |
nicklas |
89 |
} |
8083 |
20 Oct 22 |
nicklas |
90 |
|
8083 |
20 Oct 22 |
nicklas |
91 |
.columnstable td |
8083 |
20 Oct 22 |
nicklas |
92 |
{ |
8083 |
20 Oct 22 |
nicklas |
93 |
text-align: left; |
8083 |
20 Oct 22 |
nicklas |
94 |
padding: 4px 1px; |
8083 |
20 Oct 22 |
nicklas |
95 |
} |
8083 |
20 Oct 22 |
nicklas |
96 |
|
8083 |
20 Oct 22 |
nicklas |
97 |
.columnstable td > div |
8083 |
20 Oct 22 |
nicklas |
98 |
{ |
8083 |
20 Oct 22 |
nicklas |
99 |
margin-bottom: 4px; |
8083 |
20 Oct 22 |
nicklas |
100 |
white-space: nowrap; |
8083 |
20 Oct 22 |
nicklas |
101 |
} |
8083 |
20 Oct 22 |
nicklas |
102 |
|
8083 |
20 Oct 22 |
nicklas |
103 |
#added-column-msg |
8083 |
20 Oct 22 |
nicklas |
104 |
{ |
8083 |
20 Oct 22 |
nicklas |
105 |
position: absolute; |
8083 |
20 Oct 22 |
nicklas |
106 |
bottom: 1em; |
8083 |
20 Oct 22 |
nicklas |
107 |
left: 0; |
8083 |
20 Oct 22 |
nicklas |
108 |
right: 0; |
8083 |
20 Oct 22 |
nicklas |
109 |
display: table; |
8083 |
20 Oct 22 |
nicklas |
110 |
margin-left: auto; |
8083 |
20 Oct 22 |
nicklas |
111 |
margin-right: auto; |
8083 |
20 Oct 22 |
nicklas |
112 |
} |
8083 |
20 Oct 22 |
nicklas |
113 |
|
8083 |
20 Oct 22 |
nicklas |
114 |
.parentitem::before |
8083 |
20 Oct 22 |
nicklas |
115 |
{ |
8083 |
20 Oct 22 |
nicklas |
116 |
content: url('../../images/parent-item.png'); |
8083 |
20 Oct 22 |
nicklas |
117 |
margin: 0 2px; |
8083 |
20 Oct 22 |
nicklas |
118 |
vertical-align: -2px; |
8083 |
20 Oct 22 |
nicklas |
119 |
} |
8083 |
20 Oct 22 |
nicklas |
120 |
.childitem::before |
8083 |
20 Oct 22 |
nicklas |
121 |
{ |
8083 |
20 Oct 22 |
nicklas |
122 |
content: url('../../images/child-item.png'); |
8083 |
20 Oct 22 |
nicklas |
123 |
margin: 0 2px; |
8083 |
20 Oct 22 |
nicklas |
124 |
vertical-align: -2px; |
8083 |
20 Oct 22 |
nicklas |
125 |
} |
8083 |
20 Oct 22 |
nicklas |
126 |
|
8083 |
20 Oct 22 |
nicklas |
127 |
.columnsFrom |
8083 |
20 Oct 22 |
nicklas |
128 |
{ |
8083 |
20 Oct 22 |
nicklas |
129 |
font-weight: bold; |
8083 |
20 Oct 22 |
nicklas |
130 |
} |
8083 |
20 Oct 22 |
nicklas |
131 |
|
8083 |
20 Oct 22 |
nicklas |
132 |
.columnsFrom > span |
8083 |
20 Oct 22 |
nicklas |
133 |
{} |
8083 |
20 Oct 22 |
nicklas |
134 |
</style> |
8083 |
20 Oct 22 |
nicklas |
135 |
</base:head> |
7773 |
17 Feb 20 |
nicklas |
136 |
<base:body> |
7842 |
01 Sep 20 |
nicklas |
137 |
<h1>Add parent or child item column <base:help helpid="columns.configure.add_relateditem_column" /></h1> |
7773 |
17 Feb 20 |
nicklas |
138 |
|
7842 |
01 Sep 20 |
nicklas |
139 |
<form name="relatedItems" method="post"> |
7773 |
17 Feb 20 |
nicklas |
140 |
<input type="hidden" name="ID" value="<%=ID%>"> |
7773 |
17 Feb 20 |
nicklas |
141 |
<input type="hidden" name="item_type" value="<%=itemType.name()%>"> |
7773 |
17 Feb 20 |
nicklas |
142 |
|
7773 |
17 Feb 20 |
nicklas |
143 |
<div class="content"> |
8083 |
20 Oct 22 |
nicklas |
144 |
<div class="absolutefull" > |
8083 |
20 Oct 22 |
nicklas |
145 |
<table class="fullform input100 bottomborder"> |
7773 |
17 Feb 20 |
nicklas |
146 |
<tr> |
8083 |
20 Oct 22 |
nicklas |
147 |
<th>Parent/child</th> |
7773 |
17 Feb 20 |
nicklas |
148 |
<td> |
8083 |
20 Oct 22 |
nicklas |
149 |
<select name="targetItemType" id="targetItemType" class="required"> |
7773 |
17 Feb 20 |
nicklas |
150 |
<option value="">- select - |
7773 |
17 Feb 20 |
nicklas |
151 |
<% |
7773 |
17 Feb 20 |
nicklas |
152 |
for (Item parentType : allowedParentItems) |
7773 |
17 Feb 20 |
nicklas |
153 |
{ |
7773 |
17 Feb 20 |
nicklas |
154 |
%> |
7842 |
01 Sep 20 |
nicklas |
155 |
<option value="<%=parentType.name()%>" data-direction="PARENT">Parent: <%=parentType.toString()%> |
7773 |
17 Feb 20 |
nicklas |
156 |
<% |
7773 |
17 Feb 20 |
nicklas |
157 |
} |
7842 |
01 Sep 20 |
nicklas |
158 |
for (Item childType : allowedChildItems) |
7842 |
01 Sep 20 |
nicklas |
159 |
{ |
7842 |
01 Sep 20 |
nicklas |
160 |
%> |
7842 |
01 Sep 20 |
nicklas |
161 |
<option value="<%=childType.name()%>" data-direction="CHILD">Child: <%=childType.toString()%> |
7842 |
01 Sep 20 |
nicklas |
162 |
<% |
7842 |
01 Sep 20 |
nicklas |
163 |
} |
7773 |
17 Feb 20 |
nicklas |
164 |
%> |
7773 |
17 Feb 20 |
nicklas |
165 |
</select> |
7773 |
17 Feb 20 |
nicklas |
166 |
</td> |
8083 |
20 Oct 22 |
nicklas |
167 |
<td style="white-space: nowrap;">with link to</td> |
8083 |
20 Oct 22 |
nicklas |
168 |
<td> |
8083 |
20 Oct 22 |
nicklas |
169 |
<select name="childItemType" id="childItemType" disabled> |
8083 |
20 Oct 22 |
nicklas |
170 |
<option value="">- optional - |
8083 |
20 Oct 22 |
nicklas |
171 |
</select> |
8083 |
20 Oct 22 |
nicklas |
172 |
</td> |
8083 |
20 Oct 22 |
nicklas |
173 |
<td> |
8083 |
20 Oct 22 |
nicklas |
174 |
</td> |
7773 |
17 Feb 20 |
nicklas |
175 |
</tr> |
7773 |
17 Feb 20 |
nicklas |
176 |
<tr> |
7773 |
17 Feb 20 |
nicklas |
177 |
<th>Subtype</th> |
7773 |
17 Feb 20 |
nicklas |
178 |
<td> |
8083 |
20 Oct 22 |
nicklas |
179 |
<select name="targetSubtype" id="targetSubtype" class="required" disabled> |
7773 |
17 Feb 20 |
nicklas |
180 |
<option value="">- select - |
7773 |
17 Feb 20 |
nicklas |
181 |
</select> |
7773 |
17 Feb 20 |
nicklas |
182 |
</td> |
8083 |
20 Oct 22 |
nicklas |
183 |
<td>subtype</td> |
7773 |
17 Feb 20 |
nicklas |
184 |
<td> |
8083 |
20 Oct 22 |
nicklas |
185 |
<select name="childSubtype" id="childSubtype" disabled> |
8083 |
20 Oct 22 |
nicklas |
186 |
<option value="">- select - |
8083 |
20 Oct 22 |
nicklas |
187 |
</select> |
7773 |
17 Feb 20 |
nicklas |
188 |
</td> |
7773 |
17 Feb 20 |
nicklas |
189 |
</tr> |
8094 |
04 Nov 22 |
nicklas |
190 |
<tr> |
8094 |
04 Nov 22 |
nicklas |
191 |
<th class="subprompt"></th> |
8094 |
04 Nov 22 |
nicklas |
192 |
<td> |
8094 |
04 Nov 22 |
nicklas |
193 |
<label><input type="checkbox" id="showAllAnnotationTypes" |
8094 |
04 Nov 22 |
nicklas |
194 |
name="showAllAnnotationTypes">Show annotations for all subtypes</label> |
8094 |
04 Nov 22 |
nicklas |
195 |
</td> |
8094 |
04 Nov 22 |
nicklas |
196 |
<td></td> |
8094 |
04 Nov 22 |
nicklas |
197 |
<td> |
8094 |
04 Nov 22 |
nicklas |
198 |
<label title="Normally, child items that was passed when going up to the parent are ignored when going down. Enable this option to include all child items." |
8094 |
04 Nov 22 |
nicklas |
199 |
><input type="checkbox" id="allowDoublingBack" name="allowDoublingBack" disabled |
8094 |
04 Nov 22 |
nicklas |
200 |
>Allow doubling back</label> |
8094 |
04 Nov 22 |
nicklas |
201 |
</td> |
8094 |
04 Nov 22 |
nicklas |
202 |
</tr> |
8083 |
20 Oct 22 |
nicklas |
203 |
<tr class="dynamic"> |
8083 |
20 Oct 22 |
nicklas |
204 |
<th></th> |
8094 |
04 Nov 22 |
nicklas |
205 |
<td colspan="3" class="columnsFrom" style="padding-top: 2px;"> |
8094 |
04 Nov 22 |
nicklas |
206 |
<span id="targetPath"></span><span id="childPath" class="childitem" style="display: none;"></span> |
8094 |
04 Nov 22 |
nicklas |
207 |
</td> |
8083 |
20 Oct 22 |
nicklas |
208 |
</tr> |
7773 |
17 Feb 20 |
nicklas |
209 |
</table> |
8083 |
20 Oct 22 |
nicklas |
210 |
</div> |
8083 |
20 Oct 22 |
nicklas |
211 |
|
8094 |
04 Nov 22 |
nicklas |
212 |
<div class="absolutefull" style="top: 6.75em; left: 10em;"> |
8083 |
20 Oct 22 |
nicklas |
213 |
<table id="columnstable" class="columnstable" style="width: 100%;"> |
8094 |
04 Nov 22 |
nicklas |
214 |
<thead class=""> |
8094 |
04 Nov 22 |
nicklas |
215 |
<tr class="bg-filled-100 topborder bottomborder"> |
8083 |
20 Oct 22 |
nicklas |
216 |
<th style="width: 33%;">Columns</th> |
8083 |
20 Oct 22 |
nicklas |
217 |
<th style="width: 33%;">Annotations</th> |
8083 |
20 Oct 22 |
nicklas |
218 |
<th style="width: 34%;">Extensions</th> |
8083 |
20 Oct 22 |
nicklas |
219 |
</tr> |
8083 |
20 Oct 22 |
nicklas |
220 |
</thead> |
8083 |
20 Oct 22 |
nicklas |
221 |
<tbody> |
8083 |
20 Oct 22 |
nicklas |
222 |
<tr> |
8083 |
20 Oct 22 |
nicklas |
223 |
<td id="columns"></td> |
8083 |
20 Oct 22 |
nicklas |
224 |
<td id="annotations"></td> |
8083 |
20 Oct 22 |
nicklas |
225 |
<td id="extensions"></td> |
8083 |
20 Oct 22 |
nicklas |
226 |
</tr> |
8083 |
20 Oct 22 |
nicklas |
227 |
</tbody> |
8083 |
20 Oct 22 |
nicklas |
228 |
</table> |
8083 |
20 Oct 22 |
nicklas |
229 |
</div> |
8083 |
20 Oct 22 |
nicklas |
230 |
|
8083 |
20 Oct 22 |
nicklas |
231 |
<div id="added-column-msg" class="messagecontainer note" style="display:none;">message</div> |
8083 |
20 Oct 22 |
nicklas |
232 |
|
7773 |
17 Feb 20 |
nicklas |
233 |
</div> |
7773 |
17 Feb 20 |
nicklas |
234 |
</form> |
7773 |
17 Feb 20 |
nicklas |
235 |
|
7773 |
17 Feb 20 |
nicklas |
236 |
<base:buttongroup subclass="dialogbuttons"> |
7773 |
17 Feb 20 |
nicklas |
237 |
<base:button id="btnAdd" title="Add" /> |
7773 |
17 Feb 20 |
nicklas |
238 |
<base:button id="close" title="Close" /> |
7773 |
17 Feb 20 |
nicklas |
239 |
</base:buttongroup> |
7773 |
17 Feb 20 |
nicklas |
240 |
|
7773 |
17 Feb 20 |
nicklas |
241 |
</base:body> |
7773 |
17 Feb 20 |
nicklas |
242 |
</base:page> |
7773 |
17 Feb 20 |
nicklas |
243 |
|
7773 |
17 Feb 20 |
nicklas |
244 |
|