1862 |
30 Jan 06 |
nicklas |
1 |
<%-- $Id$ |
1862 |
30 Jan 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
1862 |
30 Jan 06 |
nicklas |
4 |
|
2304 |
22 May 06 |
jari |
5 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
6 |
Available at http://base.thep.lu.se/ |
1862 |
30 Jan 06 |
nicklas |
7 |
|
1862 |
30 Jan 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
1862 |
30 Jan 06 |
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 |
1862 |
30 Jan 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
1862 |
30 Jan 06 |
nicklas |
12 |
|
1862 |
30 Jan 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
1862 |
30 Jan 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1862 |
30 Jan 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1862 |
30 Jan 06 |
nicklas |
16 |
GNU General Public License for more details. |
1862 |
30 Jan 06 |
nicklas |
17 |
|
1862 |
30 Jan 06 |
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/>. |
1862 |
30 Jan 06 |
nicklas |
20 |
------------------------------------------------------------------ |
1862 |
30 Jan 06 |
nicklas |
21 |
@author Nicklas |
1862 |
30 Jan 06 |
nicklas |
22 |
@version 2.0 |
1862 |
30 Jan 06 |
nicklas |
23 |
--%> |
5426 |
24 Sep 10 |
nicklas |
24 |
<%@ page pageEncoding="UTF-8" session="false" |
1862 |
30 Jan 06 |
nicklas |
25 |
import="net.sf.basedb.core.SessionControl" |
1862 |
30 Jan 06 |
nicklas |
26 |
import="net.sf.basedb.core.DbControl" |
1862 |
30 Jan 06 |
nicklas |
27 |
import="net.sf.basedb.core.Item" |
1862 |
30 Jan 06 |
nicklas |
28 |
import="net.sf.basedb.core.ItemContext" |
1862 |
30 Jan 06 |
nicklas |
29 |
import="net.sf.basedb.core.Permission" |
1862 |
30 Jan 06 |
nicklas |
30 |
import="net.sf.basedb.core.Well" |
1862 |
30 Jan 06 |
nicklas |
31 |
import="net.sf.basedb.core.Plate" |
1862 |
30 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.PermissionDeniedException" |
5920 |
10 Jan 12 |
nicklas |
33 |
import="net.sf.basedb.core.Reporter" |
1862 |
30 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.core.data.ReporterData" |
1862 |
30 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.core.BaseException" |
1862 |
30 Jan 06 |
nicklas |
36 |
import="net.sf.basedb.clients.web.Base" |
1862 |
30 Jan 06 |
nicklas |
37 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
38 |
import="net.sf.basedb.util.Values" |
4860 |
27 Mar 09 |
martin |
39 |
import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
5498 |
17 Nov 10 |
nicklas |
40 |
import="net.sf.basedb.core.plugin.GuiContext" |
5498 |
17 Nov 10 |
nicklas |
41 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5498 |
17 Nov 10 |
nicklas |
42 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5498 |
17 Nov 10 |
nicklas |
43 |
import="net.sf.basedb.clients.web.extensions.edit.EditUtil" |
7604 |
25 Feb 19 |
nicklas |
44 |
import="net.sf.basedb.clients.web.extensions.tabcontrol.TabAction" |
5498 |
17 Nov 10 |
nicklas |
45 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
1862 |
30 Jan 06 |
nicklas |
46 |
%> |
1862 |
30 Jan 06 |
nicklas |
47 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1862 |
30 Jan 06 |
nicklas |
48 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
6312 |
28 Aug 13 |
nicklas |
49 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
1862 |
30 Jan 06 |
nicklas |
50 |
<% |
1862 |
30 Jan 06 |
nicklas |
51 |
final Item itemType = Item.WELL; |
1862 |
30 Jan 06 |
nicklas |
52 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1862 |
30 Jan 06 |
nicklas |
53 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1862 |
30 Jan 06 |
nicklas |
54 |
final int itemId = cc.getId(); |
1862 |
30 Jan 06 |
nicklas |
55 |
final int plateId = Values.getInt(request.getParameter("plate_id")); |
1862 |
30 Jan 06 |
nicklas |
56 |
final String ID = sc.getId(); |
1862 |
30 Jan 06 |
nicklas |
57 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
58 |
final DbControl dc = sc.newDbControl(":Edit "+itemType); |
1862 |
30 Jan 06 |
nicklas |
59 |
try |
1862 |
30 Jan 06 |
nicklas |
60 |
{ |
1862 |
30 Jan 06 |
nicklas |
61 |
String title = null; |
1862 |
30 Jan 06 |
nicklas |
62 |
Well well = Well.getById(dc, itemId); |
6312 |
28 Aug 13 |
nicklas |
63 |
well.checkPermission(Permission.WRITE); |
1862 |
30 Jan 06 |
nicklas |
64 |
Plate plate = well.getPlate(); |
1862 |
30 Jan 06 |
nicklas |
65 |
ReporterData reporter = well.getReporter(); |
5920 |
10 Jan 12 |
nicklas |
66 |
if (reporter != null) reporter = Reporter.getById(dc, reporter.getId()); |
4860 |
27 Mar 09 |
martin |
67 |
WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); |
4860 |
27 Mar 09 |
martin |
68 |
WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); |
1862 |
30 Jan 06 |
nicklas |
69 |
|
5920 |
10 Jan 12 |
nicklas |
70 |
title = "Edit well -- " + HTML.encodeTags(plate.getName()) + " [" + rowFormatter.format(well.getRow()) + columnFormatter.format(well.getColumn()) + "]"; |
1862 |
30 Jan 06 |
nicklas |
71 |
cc.setObject("item", well); |
5498 |
17 Nov 10 |
nicklas |
72 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, GuiContext.item(itemType), well); |
7604 |
25 Feb 19 |
nicklas |
73 |
ExtensionsInvoker<TabAction> invoker = EditUtil.useEditExtensions(jspContext); |
1862 |
30 Jan 06 |
nicklas |
74 |
%> |
6312 |
28 Aug 13 |
nicklas |
75 |
<base:page type="popup" title="<%=title%>" id="edit-page"> |
6312 |
28 Aug 13 |
nicklas |
76 |
<base:head scripts="tabcontrol-2.js,~wells.js" styles="tabcontrol.css"> |
5498 |
17 Nov 10 |
nicklas |
77 |
<ext:scripts context="<%=jspContext%>" /> |
5498 |
17 Nov 10 |
nicklas |
78 |
<ext:stylesheets context="<%=jspContext%>" /> |
1862 |
30 Jan 06 |
nicklas |
79 |
</base:head> |
1862 |
30 Jan 06 |
nicklas |
80 |
<base:body> |
5920 |
10 Jan 12 |
nicklas |
81 |
<h1><%=title%> <base:help tabcontrol="settings" /></h1> |
6162 |
10 Oct 12 |
nicklas |
82 |
<form action="index.jsp?ID=<%=ID%>" method="post" name="well"> |
1862 |
30 Jan 06 |
nicklas |
83 |
<input type="hidden" name="cmd" value="UpdateItem"> |
1862 |
30 Jan 06 |
nicklas |
84 |
<input type="hidden" name="plate_id" value="<%=plateId%>"> |
1862 |
30 Jan 06 |
nicklas |
85 |
|
5920 |
10 Jan 12 |
nicklas |
86 |
<t:tabcontrol id="settings" |
5920 |
10 Jan 12 |
nicklas |
87 |
subclass="content dialogtabcontrol" |
6254 |
22 Mar 13 |
nicklas |
88 |
position="bottom" |
5498 |
17 Nov 10 |
nicklas |
89 |
extensions="<%=invoker%>"> |
6312 |
28 Aug 13 |
nicklas |
90 |
<t:tab id="info" title="Well" helpid="well.edit"> |
5920 |
10 Jan 12 |
nicklas |
91 |
<table class="fullform input100 outlined"> |
1862 |
30 Jan 06 |
nicklas |
92 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
93 |
<th>Plate</th> |
1862 |
30 Jan 06 |
nicklas |
94 |
<td><%=HTML.encodeTags(plate.getName())%></td> |
1862 |
30 Jan 06 |
nicklas |
95 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
96 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
97 |
<th>Coordinate</th> |
5920 |
10 Jan 12 |
nicklas |
98 |
<td><%=rowFormatter.format(well.getRow())%><%=columnFormatter.format(well.getColumn())%></td> |
1862 |
30 Jan 06 |
nicklas |
99 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
100 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
101 |
<th>Reporter name</th> |
1862 |
30 Jan 06 |
nicklas |
102 |
<td><%=reporter == null ? "<i>- none -</i>" : HTML.encodeTags(reporter.getName())%></td> |
1862 |
30 Jan 06 |
nicklas |
103 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
104 |
<tr> |
5920 |
10 Jan 12 |
nicklas |
105 |
<th>Reporter External ID</th> |
1862 |
30 Jan 06 |
nicklas |
106 |
<td><%=reporter == null ? "<i>- none -</i>" : HTML.encodeTags(reporter.getExternalId())%></td> |
1862 |
30 Jan 06 |
nicklas |
107 |
</tr> |
5920 |
10 Jan 12 |
nicklas |
108 |
<tr class="dynamic"> |
5920 |
10 Jan 12 |
nicklas |
109 |
<th></th> |
5920 |
10 Jan 12 |
nicklas |
110 |
<td></td> |
5920 |
10 Jan 12 |
nicklas |
111 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
112 |
</table> |
1862 |
30 Jan 06 |
nicklas |
113 |
</t:tab> |
1862 |
30 Jan 06 |
nicklas |
114 |
|
6312 |
28 Aug 13 |
nicklas |
115 |
<t:tab id="annotations" title="Annotations" helpid="annotations.edit"> |
6254 |
22 Mar 13 |
nicklas |
116 |
<jsp:include page="../../../common/annotations/annotate_frameset.jsp"> |
6254 |
22 Mar 13 |
nicklas |
117 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
6254 |
22 Mar 13 |
nicklas |
118 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
6254 |
22 Mar 13 |
nicklas |
119 |
<jsp:param name="ID" value="<%=ID%>" /> |
6254 |
22 Mar 13 |
nicklas |
120 |
</jsp:include> |
6254 |
22 Mar 13 |
nicklas |
121 |
</t:tab> |
1862 |
30 Jan 06 |
nicklas |
122 |
</t:tabcontrol> |
5920 |
10 Jan 12 |
nicklas |
123 |
</form> |
1862 |
30 Jan 06 |
nicklas |
124 |
|
5920 |
10 Jan 12 |
nicklas |
125 |
<base:buttongroup subclass="dialogbuttons"> |
6312 |
28 Aug 13 |
nicklas |
126 |
<base:button id="btnSave" title="Save" /> |
6312 |
28 Aug 13 |
nicklas |
127 |
<base:button id="close" title="Cancel" /> |
5920 |
10 Jan 12 |
nicklas |
128 |
</base:buttongroup> |
1862 |
30 Jan 06 |
nicklas |
129 |
</base:body> |
1862 |
30 Jan 06 |
nicklas |
130 |
</base:page> |
1862 |
30 Jan 06 |
nicklas |
131 |
<% |
1862 |
30 Jan 06 |
nicklas |
132 |
} |
1862 |
30 Jan 06 |
nicklas |
133 |
finally |
1862 |
30 Jan 06 |
nicklas |
134 |
{ |
1862 |
30 Jan 06 |
nicklas |
135 |
if (dc != null) dc.close(); |
1862 |
30 Jan 06 |
nicklas |
136 |
} |
1862 |
30 Jan 06 |
nicklas |
137 |
%> |