890 |
07 Jul 05 |
nicklas |
1 |
<%-- $Id$ |
890 |
07 Jul 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
890 |
07 Jul 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
890 |
07 Jul 05 |
nicklas |
8 |
|
890 |
07 Jul 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
890 |
07 Jul 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
890 |
07 Jul 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
890 |
07 Jul 05 |
nicklas |
13 |
|
890 |
07 Jul 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
890 |
07 Jul 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
890 |
07 Jul 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
890 |
07 Jul 05 |
nicklas |
17 |
GNU General Public License for more details. |
890 |
07 Jul 05 |
nicklas |
18 |
|
890 |
07 Jul 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
890 |
07 Jul 05 |
nicklas |
21 |
------------------------------------------------------------------ |
890 |
07 Jul 05 |
nicklas |
22 |
|
890 |
07 Jul 05 |
nicklas |
23 |
|
890 |
07 Jul 05 |
nicklas |
24 |
@author Nicklas |
890 |
07 Jul 05 |
nicklas |
25 |
@version 2.0 |
890 |
07 Jul 05 |
nicklas |
26 |
--%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
890 |
07 Jul 05 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
890 |
07 Jul 05 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
890 |
07 Jul 05 |
nicklas |
30 |
import="net.sf.basedb.core.Item" |
1827 |
25 Jan 06 |
nicklas |
31 |
import="net.sf.basedb.core.ItemContext" |
1827 |
25 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.SystemItems" |
890 |
07 Jul 05 |
nicklas |
33 |
import="net.sf.basedb.core.Permission" |
1827 |
25 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.core.Include" |
890 |
07 Jul 05 |
nicklas |
35 |
import="net.sf.basedb.core.PlateGeometry" |
1827 |
25 Jan 06 |
nicklas |
36 |
import="net.sf.basedb.core.ItemQuery" |
1827 |
25 Jan 06 |
nicklas |
37 |
import="net.sf.basedb.core.ItemResultList" |
1827 |
25 Jan 06 |
nicklas |
38 |
import="net.sf.basedb.core.PermissionDeniedException" |
890 |
07 Jul 05 |
nicklas |
39 |
import="net.sf.basedb.core.BaseException" |
1827 |
25 Jan 06 |
nicklas |
40 |
import="net.sf.basedb.core.query.Orders" |
1827 |
25 Jan 06 |
nicklas |
41 |
import="net.sf.basedb.core.query.Hql" |
890 |
07 Jul 05 |
nicklas |
42 |
import="net.sf.basedb.clients.web.Base" |
890 |
07 Jul 05 |
nicklas |
43 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
44 |
import="net.sf.basedb.util.Values" |
5498 |
17 Nov 10 |
nicklas |
45 |
import="net.sf.basedb.core.plugin.GuiContext" |
5498 |
17 Nov 10 |
nicklas |
46 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5498 |
17 Nov 10 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5498 |
17 Nov 10 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
5498 |
17 Nov 10 |
nicklas |
50 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
1827 |
25 Jan 06 |
nicklas |
51 |
import="java.util.List" |
1827 |
25 Jan 06 |
nicklas |
52 |
import="java.util.Set" |
1827 |
25 Jan 06 |
nicklas |
53 |
import="java.util.HashSet" |
1827 |
25 Jan 06 |
nicklas |
54 |
import="java.util.Date" |
890 |
07 Jul 05 |
nicklas |
55 |
%> |
890 |
07 Jul 05 |
nicklas |
56 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
890 |
07 Jul 05 |
nicklas |
57 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6146 |
21 Sep 12 |
nicklas |
58 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
890 |
07 Jul 05 |
nicklas |
59 |
<% |
1827 |
25 Jan 06 |
nicklas |
60 |
final Item itemType = Item.PLATEGEOMETRY; |
1827 |
25 Jan 06 |
nicklas |
61 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1827 |
25 Jan 06 |
nicklas |
62 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1827 |
25 Jan 06 |
nicklas |
63 |
final int itemId = cc.getId(); |
890 |
07 Jul 05 |
nicklas |
64 |
final String ID = sc.getId(); |
890 |
07 Jul 05 |
nicklas |
65 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
66 |
final DbControl dc = sc.newDbControl(":Edit "+itemType); |
890 |
07 Jul 05 |
nicklas |
67 |
try |
890 |
07 Jul 05 |
nicklas |
68 |
{ |
890 |
07 Jul 05 |
nicklas |
69 |
String title = null; |
1827 |
25 Jan 06 |
nicklas |
70 |
PlateGeometry geometry = null; |
1827 |
25 Jan 06 |
nicklas |
71 |
|
1827 |
25 Jan 06 |
nicklas |
72 |
if (itemId == 0) |
890 |
07 Jul 05 |
nicklas |
73 |
{ |
890 |
07 Jul 05 |
nicklas |
74 |
title = "Create plate geometry"; |
1827 |
25 Jan 06 |
nicklas |
75 |
cc.removeObject("item"); |
890 |
07 Jul 05 |
nicklas |
76 |
} |
890 |
07 Jul 05 |
nicklas |
77 |
else |
890 |
07 Jul 05 |
nicklas |
78 |
{ |
1827 |
25 Jan 06 |
nicklas |
79 |
geometry = PlateGeometry.getById(dc, itemId); |
6306 |
13 Aug 13 |
nicklas |
80 |
geometry.checkPermission(Permission.WRITE); |
1827 |
25 Jan 06 |
nicklas |
81 |
cc.setObject("item", geometry); |
1827 |
25 Jan 06 |
nicklas |
82 |
title = "Edit plate geometry -- " + HTML.encodeTags(geometry.getName()); |
6306 |
13 Aug 13 |
nicklas |
83 |
} |
6217 |
14 Dec 12 |
nicklas |
84 |
|
5498 |
17 Nov 10 |
nicklas |
85 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), geometry); |
7604 |
25 Feb 19 |
nicklas |
86 |
ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext); |
890 |
07 Jul 05 |
nicklas |
87 |
%> |
6306 |
13 Aug 13 |
nicklas |
88 |
<base:page type="popup" title="<%=title%>" id="edit-page"> |
6306 |
13 Aug 13 |
nicklas |
89 |
<base:head scripts="tabcontrol-2.js,~geometries.js" styles="tabcontrol.css"> |
5498 |
17 Nov 10 |
nicklas |
90 |
<ext:scripts context="<%=jspContext%>" /> |
5498 |
17 Nov 10 |
nicklas |
91 |
<ext:stylesheets context="<%=jspContext%>" /> |
890 |
07 Jul 05 |
nicklas |
92 |
</base:head> |
6306 |
13 Aug 13 |
nicklas |
93 |
<base:body> |
5920 |
10 Jan 12 |
nicklas |
94 |
<h1><%=title%> <base:help tabcontrol="settings" /></h1> |
5920 |
10 Jan 12 |
nicklas |
95 |
|
6162 |
10 Oct 12 |
nicklas |
96 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="geometry"> |
1827 |
25 Jan 06 |
nicklas |
97 |
<input type="hidden" name="cmd" value="UpdateItem"> |
1827 |
25 Jan 06 |
nicklas |
98 |
|
5920 |
10 Jan 12 |
nicklas |
99 |
<t:tabcontrol id="settings" |
5920 |
10 Jan 12 |
nicklas |
100 |
subclass="content dialogtabcontrol" |
5498 |
17 Nov 10 |
nicklas |
101 |
position="bottom" remember="<%=geometry != null%>" |
5498 |
17 Nov 10 |
nicklas |
102 |
extensions="<%=invoker%>"> |
6306 |
13 Aug 13 |
nicklas |
103 |
<t:tab id="info" title="Plate geometry" helpid="plategeometry.edit"> |
5920 |
10 Jan 12 |
nicklas |
104 |
<table class="fullform input100 smaller"> |
890 |
07 Jul 05 |
nicklas |
105 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
106 |
<th>Name</th> |
6306 |
13 Aug 13 |
nicklas |
107 |
<td><input class="text required auto-init" data-auto-init="<%=geometry == null ? "focus-select" : "focus" %>" |
6306 |
13 Aug 13 |
nicklas |
108 |
type="text" name="name" |
1827 |
25 Jan 06 |
nicklas |
109 |
value="<%=HTML.encodeTags(geometry == null ? Values.getString(cc.getPropertyValue("name"), "New plate geometry") : geometry.getName())%>" |
5920 |
10 Jan 12 |
nicklas |
110 |
maxlength="<%=PlateGeometry.MAX_NAME_LENGTH%>"></td> |
5920 |
10 Jan 12 |
nicklas |
111 |
<td></td> |
890 |
07 Jul 05 |
nicklas |
112 |
</tr> |
890 |
07 Jul 05 |
nicklas |
113 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
114 |
<th>Rows</th> |
890 |
07 Jul 05 |
nicklas |
115 |
<td> |
1827 |
25 Jan 06 |
nicklas |
116 |
<% |
1827 |
25 Jan 06 |
nicklas |
117 |
if (geometry != null) |
890 |
07 Jul 05 |
nicklas |
118 |
{ |
890 |
07 Jul 05 |
nicklas |
119 |
%> |
1827 |
25 Jan 06 |
nicklas |
120 |
<%=geometry.getRows()%> |
890 |
07 Jul 05 |
nicklas |
121 |
<% |
890 |
07 Jul 05 |
nicklas |
122 |
} |
890 |
07 Jul 05 |
nicklas |
123 |
else |
890 |
07 Jul 05 |
nicklas |
124 |
{ |
890 |
07 Jul 05 |
nicklas |
125 |
%> |
6306 |
13 Aug 13 |
nicklas |
126 |
<input class="unchangeable" type="text" name="rows" id="rows" style="width: 15em;" |
1827 |
25 Jan 06 |
nicklas |
127 |
value="<%=cc.getPropertyValue("rows") == null ? "" : Values.getInt(cc.getPropertyValue("rows"))%>" |
6306 |
13 Aug 13 |
nicklas |
128 |
maxlength="10"> |
890 |
07 Jul 05 |
nicklas |
129 |
<% |
890 |
07 Jul 05 |
nicklas |
130 |
} |
890 |
07 Jul 05 |
nicklas |
131 |
%> |
1827 |
25 Jan 06 |
nicklas |
132 |
</td> |
5920 |
10 Jan 12 |
nicklas |
133 |
<td></td> |
890 |
07 Jul 05 |
nicklas |
134 |
</tr> |
890 |
07 Jul 05 |
nicklas |
135 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
136 |
<th>Columns</th> |
890 |
07 Jul 05 |
nicklas |
137 |
<td> |
1827 |
25 Jan 06 |
nicklas |
138 |
<% |
1827 |
25 Jan 06 |
nicklas |
139 |
if (geometry != null) |
890 |
07 Jul 05 |
nicklas |
140 |
{ |
890 |
07 Jul 05 |
nicklas |
141 |
%> |
1827 |
25 Jan 06 |
nicklas |
142 |
<%=geometry.getColumns()%> |
890 |
07 Jul 05 |
nicklas |
143 |
<% |
890 |
07 Jul 05 |
nicklas |
144 |
} |
890 |
07 Jul 05 |
nicklas |
145 |
else |
890 |
07 Jul 05 |
nicklas |
146 |
{ |
890 |
07 Jul 05 |
nicklas |
147 |
%> |
6306 |
13 Aug 13 |
nicklas |
148 |
<input class="unchangeable" type="text" name="columns" id="columns" style="width: 15em;" |
1827 |
25 Jan 06 |
nicklas |
149 |
value="<%=cc.getPropertyValue("columns") == null ? "" : Values.getInt(cc.getPropertyValue("columns"))%>" |
6306 |
13 Aug 13 |
nicklas |
150 |
maxlength="10"> |
890 |
07 Jul 05 |
nicklas |
151 |
<% |
890 |
07 Jul 05 |
nicklas |
152 |
} |
890 |
07 Jul 05 |
nicklas |
153 |
%> |
1827 |
25 Jan 06 |
nicklas |
154 |
</td> |
5920 |
10 Jan 12 |
nicklas |
155 |
<td></td> |
890 |
07 Jul 05 |
nicklas |
156 |
</tr> |
5920 |
10 Jan 12 |
nicklas |
157 |
<tr class="dynamic"> |
5920 |
10 Jan 12 |
nicklas |
158 |
<th>Description</th> |
5920 |
10 Jan 12 |
nicklas |
159 |
<td> |
6217 |
14 Dec 12 |
nicklas |
160 |
<textarea class="text" rows="4" name="description" id="description" |
1827 |
25 Jan 06 |
nicklas |
161 |
><%=HTML.encodeTags(geometry == null ? cc.getPropertyValue("description") : geometry.getDescription())%></textarea> |
890 |
07 Jul 05 |
nicklas |
162 |
</td> |
5920 |
10 Jan 12 |
nicklas |
163 |
<td style="width: 20px;"> |
6215 |
13 Dec 12 |
nicklas |
164 |
<base:zoom textarea="description" title="Description" /> |
5920 |
10 Jan 12 |
nicklas |
165 |
</td> |
890 |
07 Jul 05 |
nicklas |
166 |
</tr> |
890 |
07 Jul 05 |
nicklas |
167 |
</table> |
890 |
07 Jul 05 |
nicklas |
168 |
</t:tab> |
890 |
07 Jul 05 |
nicklas |
169 |
</t:tabcontrol> |
5920 |
10 Jan 12 |
nicklas |
170 |
</form> |
890 |
07 Jul 05 |
nicklas |
171 |
|
5920 |
10 Jan 12 |
nicklas |
172 |
<div class="legend"> |
5946 |
03 Feb 12 |
nicklas |
173 |
<base:icon image="required.png" />= required information |
5920 |
10 Jan 12 |
nicklas |
174 |
<%if (geometry == null) {%><br> |
5967 |
16 Feb 12 |
nicklas |
175 |
<base:icon image="unchangeable.png" />= can't be changed later |
5920 |
10 Jan 12 |
nicklas |
176 |
<%}%> |
5920 |
10 Jan 12 |
nicklas |
177 |
</div> |
5920 |
10 Jan 12 |
nicklas |
178 |
|
5920 |
10 Jan 12 |
nicklas |
179 |
<base:buttongroup subclass="dialogbuttons"> |
6306 |
13 Aug 13 |
nicklas |
180 |
<base:button id="btnSave" title="Save" /> |
6306 |
13 Aug 13 |
nicklas |
181 |
<base:button id="close" title="Cancel" /> |
5920 |
10 Jan 12 |
nicklas |
182 |
</base:buttongroup> |
890 |
07 Jul 05 |
nicklas |
183 |
</base:body> |
890 |
07 Jul 05 |
nicklas |
184 |
</base:page> |
890 |
07 Jul 05 |
nicklas |
185 |
<% |
890 |
07 Jul 05 |
nicklas |
186 |
} |
890 |
07 Jul 05 |
nicklas |
187 |
finally |
890 |
07 Jul 05 |
nicklas |
188 |
{ |
890 |
07 Jul 05 |
nicklas |
189 |
if (dc != null) dc.close(); |
890 |
07 Jul 05 |
nicklas |
190 |
} |
890 |
07 Jul 05 |
nicklas |
191 |
%> |