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 |
|
1862 |
30 Jan 06 |
nicklas |
22 |
@author Nicklas |
1862 |
30 Jan 06 |
nicklas |
23 |
@version 2.0 |
1862 |
30 Jan 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
1862 |
30 Jan 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
1862 |
30 Jan 06 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
1862 |
30 Jan 06 |
nicklas |
28 |
import="net.sf.basedb.core.SystemItems" |
1862 |
30 Jan 06 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
1862 |
30 Jan 06 |
nicklas |
30 |
import="net.sf.basedb.core.ItemContext" |
1862 |
30 Jan 06 |
nicklas |
31 |
import="net.sf.basedb.core.Permission" |
1862 |
30 Jan 06 |
nicklas |
32 |
import="net.sf.basedb.core.Plate" |
1862 |
30 Jan 06 |
nicklas |
33 |
import="net.sf.basedb.core.PlateEvent" |
1862 |
30 Jan 06 |
nicklas |
34 |
import="net.sf.basedb.core.PlateEventType" |
1862 |
30 Jan 06 |
nicklas |
35 |
import="net.sf.basedb.core.Protocol" |
1862 |
30 Jan 06 |
nicklas |
36 |
import="net.sf.basedb.core.PermissionDeniedException" |
1862 |
30 Jan 06 |
nicklas |
37 |
import="net.sf.basedb.core.PluginDefinition" |
1862 |
30 Jan 06 |
nicklas |
38 |
import="net.sf.basedb.core.plugin.GuiContext" |
1862 |
30 Jan 06 |
nicklas |
39 |
import="net.sf.basedb.core.plugin.Plugin" |
1862 |
30 Jan 06 |
nicklas |
40 |
import="net.sf.basedb.clients.web.Base" |
2386 |
15 Jun 06 |
martin |
41 |
import="net.sf.basedb.clients.web.PermissionUtil" |
1862 |
30 Jan 06 |
nicklas |
42 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
43 |
import="net.sf.basedb.util.Values" |
2942 |
22 Nov 06 |
nicklas |
44 |
import="net.sf.basedb.util.formatter.Formatter" |
2942 |
22 Nov 06 |
nicklas |
45 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4884 |
03 Apr 09 |
nicklas |
46 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4884 |
03 Apr 09 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4884 |
03 Apr 09 |
nicklas |
48 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
49 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
4884 |
03 Apr 09 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
4884 |
03 Apr 09 |
nicklas |
51 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
1862 |
30 Jan 06 |
nicklas |
52 |
import="java.util.Date" |
1862 |
30 Jan 06 |
nicklas |
53 |
import="java.util.Map" |
1862 |
30 Jan 06 |
nicklas |
54 |
import="java.util.Set" |
1862 |
30 Jan 06 |
nicklas |
55 |
%> |
1862 |
30 Jan 06 |
nicklas |
56 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
1862 |
30 Jan 06 |
nicklas |
57 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
1862 |
30 Jan 06 |
nicklas |
58 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
1862 |
30 Jan 06 |
nicklas |
59 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
4884 |
03 Apr 09 |
nicklas |
60 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
1862 |
30 Jan 06 |
nicklas |
61 |
<%! |
1862 |
30 Jan 06 |
nicklas |
62 |
private static final Item itemType = Item.PLATEEVENT; |
1862 |
30 Jan 06 |
nicklas |
63 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
1862 |
30 Jan 06 |
nicklas |
64 |
%> |
1862 |
30 Jan 06 |
nicklas |
65 |
<% |
1862 |
30 Jan 06 |
nicklas |
66 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
1862 |
30 Jan 06 |
nicklas |
67 |
final String ID = sc.getId(); |
1862 |
30 Jan 06 |
nicklas |
68 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
1862 |
30 Jan 06 |
nicklas |
69 |
final int itemId = cc.getId(); |
1862 |
30 Jan 06 |
nicklas |
70 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
71 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
1862 |
30 Jan 06 |
nicklas |
72 |
try |
1862 |
30 Jan 06 |
nicklas |
73 |
{ |
1862 |
30 Jan 06 |
nicklas |
74 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
2942 |
22 Nov 06 |
nicklas |
75 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
1862 |
30 Jan 06 |
nicklas |
76 |
|
1862 |
30 Jan 06 |
nicklas |
77 |
String title = null; |
2216 |
05 May 06 |
nicklas |
78 |
final PlateEvent event = PlateEvent.getById(dc, itemId); |
2216 |
05 May 06 |
nicklas |
79 |
final Plate plate = event.getPlate(); |
2216 |
05 May 06 |
nicklas |
80 |
final int plateId = plate.getId(); |
1862 |
30 Jan 06 |
nicklas |
81 |
|
1862 |
30 Jan 06 |
nicklas |
82 |
PlateEventType currentEventType = null; |
1862 |
30 Jan 06 |
nicklas |
83 |
boolean readCurrentEventType = true; |
1862 |
30 Jan 06 |
nicklas |
84 |
try |
1862 |
30 Jan 06 |
nicklas |
85 |
{ |
1862 |
30 Jan 06 |
nicklas |
86 |
currentEventType = event.getPlateEventType(); |
1862 |
30 Jan 06 |
nicklas |
87 |
} |
1862 |
30 Jan 06 |
nicklas |
88 |
catch (PermissionDeniedException ex) |
1862 |
30 Jan 06 |
nicklas |
89 |
{ |
1862 |
30 Jan 06 |
nicklas |
90 |
readCurrentEventType = false; |
1862 |
30 Jan 06 |
nicklas |
91 |
} |
1862 |
30 Jan 06 |
nicklas |
92 |
|
1862 |
30 Jan 06 |
nicklas |
93 |
final boolean writePermission = event.hasPermission(Permission.WRITE); |
1862 |
30 Jan 06 |
nicklas |
94 |
final boolean deletePermission = event.hasPermission(Permission.DELETE); |
4884 |
03 Apr 09 |
nicklas |
95 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, event); |
7604 |
25 Feb 19 |
nicklas |
96 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
1862 |
30 Jan 06 |
nicklas |
97 |
%> |
6307 |
15 Aug 13 |
nicklas |
98 |
<base:page title="<%=title%>" id="view-page"> |
6307 |
15 Aug 13 |
nicklas |
99 |
<base:head scripts="table.js,tabcontrol-2.js,~events.js" styles="toolbar.css,table.css,headertabcontrol.css,path.css"> |
4884 |
03 Apr 09 |
nicklas |
100 |
<ext:scripts context="<%=jspContext%>" /> |
4884 |
03 Apr 09 |
nicklas |
101 |
<ext:stylesheets context="<%=jspContext%>" /> |
1862 |
30 Jan 06 |
nicklas |
102 |
</base:head> |
1862 |
30 Jan 06 |
nicklas |
103 |
<base:body> |
5943 |
01 Feb 12 |
nicklas |
104 |
<p:path><p:pathelement |
5943 |
01 Feb 12 |
nicklas |
105 |
title="Plates" href="<%="../index.jsp?ID="+ID%>" |
5943 |
01 Feb 12 |
nicklas |
106 |
/><p:pathelement |
1862 |
30 Jan 06 |
nicklas |
107 |
title="<%=HTML.encodeTags(plate.getName())%>" |
6146 |
21 Sep 12 |
nicklas |
108 |
href="<%="index.jsp?ID="+ID+"&plate_id="+plateId%>" |
5943 |
01 Feb 12 |
nicklas |
109 |
/><p:pathelement title="<%="Event: "+Base.getEncodedName(currentEventType, !readCurrentEventType)%>" |
5943 |
01 Feb 12 |
nicklas |
110 |
/></p:path> |
6307 |
15 Aug 13 |
nicklas |
111 |
<div id="page-data" data-item-id="<%=itemId%>" data-plate-id="<%=plateId%>"></div> |
1862 |
30 Jan 06 |
nicklas |
112 |
|
5943 |
01 Feb 12 |
nicklas |
113 |
<t:tabcontrol |
5943 |
01 Feb 12 |
nicklas |
114 |
id="main" |
5943 |
01 Feb 12 |
nicklas |
115 |
subclass="content mastertabcontrol" |
6307 |
15 Aug 13 |
nicklas |
116 |
active="properties"> |
1862 |
30 Jan 06 |
nicklas |
117 |
<t:tab id="properties" title="Properties"> |
5943 |
01 Feb 12 |
nicklas |
118 |
<div> |
5943 |
01 Feb 12 |
nicklas |
119 |
<table class="fullform bottomborder"> |
1862 |
30 Jan 06 |
nicklas |
120 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
121 |
<th class="itemstatus"></th> |
5943 |
01 Feb 12 |
nicklas |
122 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
123 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5943 |
01 Feb 12 |
nicklas |
124 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
125 |
id="btnEdit" |
5943 |
01 Feb 12 |
nicklas |
126 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
127 |
image="edit.png" |
5943 |
01 Feb 12 |
nicklas |
128 |
title="Edit…" |
5943 |
01 Feb 12 |
nicklas |
129 |
tooltip="<%=writePermission ? "Edit this event" : "You do not have permission to edit this event"%>" |
5943 |
01 Feb 12 |
nicklas |
130 |
/> |
5943 |
01 Feb 12 |
nicklas |
131 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
132 |
id="btnDelete" |
6307 |
15 Aug 13 |
nicklas |
133 |
data-confirm="1" |
5943 |
01 Feb 12 |
nicklas |
134 |
disabled="<%=!deletePermission%>" |
5946 |
03 Feb 12 |
nicklas |
135 |
image="delete.png" |
5943 |
01 Feb 12 |
nicklas |
136 |
title="Delete" |
5943 |
01 Feb 12 |
nicklas |
137 |
tooltip="<%=deletePermission ? "Delete this event" : "You do not have permission to event this event"%>" |
5943 |
01 Feb 12 |
nicklas |
138 |
/> |
5943 |
01 Feb 12 |
nicklas |
139 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
140 |
id="btnImport" |
5946 |
03 Feb 12 |
nicklas |
141 |
image="import.png" |
6307 |
15 Aug 13 |
nicklas |
142 |
data-plugin-type="IMPORT" |
5943 |
01 Feb 12 |
nicklas |
143 |
title="Import…" |
5943 |
01 Feb 12 |
nicklas |
144 |
tooltip="Import data" |
5943 |
01 Feb 12 |
nicklas |
145 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
5943 |
01 Feb 12 |
nicklas |
146 |
/> |
5943 |
01 Feb 12 |
nicklas |
147 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
148 |
id="btnExport" |
6307 |
15 Aug 13 |
nicklas |
149 |
image="export.png" |
6307 |
15 Aug 13 |
nicklas |
150 |
data-plugin-type="EXPORT" |
5943 |
01 Feb 12 |
nicklas |
151 |
title="Export…" |
5943 |
01 Feb 12 |
nicklas |
152 |
tooltip="Export data" |
5943 |
01 Feb 12 |
nicklas |
153 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5943 |
01 Feb 12 |
nicklas |
154 |
/> |
5943 |
01 Feb 12 |
nicklas |
155 |
<tbl:button |
6307 |
15 Aug 13 |
nicklas |
156 |
id="btnRunPlugin" |
6307 |
15 Aug 13 |
nicklas |
157 |
image="runplugin.png" |
6307 |
15 Aug 13 |
nicklas |
158 |
data-plugin-type="OTHER" |
5943 |
01 Feb 12 |
nicklas |
159 |
title="Run plugin…" |
5943 |
01 Feb 12 |
nicklas |
160 |
tooltip="Run a plugin" |
5943 |
01 Feb 12 |
nicklas |
161 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5943 |
01 Feb 12 |
nicklas |
162 |
/> |
5943 |
01 Feb 12 |
nicklas |
163 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
164 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5943 |
01 Feb 12 |
nicklas |
165 |
<tbl:button |
5943 |
01 Feb 12 |
nicklas |
166 |
image="help.png" |
6307 |
15 Aug 13 |
nicklas |
167 |
subclass="auto-init" |
6307 |
15 Aug 13 |
nicklas |
168 |
data-auto-init="help" |
6307 |
15 Aug 13 |
nicklas |
169 |
data-help-id="plateevent.view.properties" |
5943 |
01 Feb 12 |
nicklas |
170 |
title="Help…" |
5943 |
01 Feb 12 |
nicklas |
171 |
tooltip="Get help about this page" |
5943 |
01 Feb 12 |
nicklas |
172 |
/> |
5943 |
01 Feb 12 |
nicklas |
173 |
</tbl:toolbar> |
5943 |
01 Feb 12 |
nicklas |
174 |
</td> |
5943 |
01 Feb 12 |
nicklas |
175 |
</tr> |
5943 |
01 Feb 12 |
nicklas |
176 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
177 |
<th>User</th> |
2446 |
29 Jun 06 |
nicklas |
178 |
<td><base:propertyvalue item="<%=event%>" property="user" /></td> |
2446 |
29 Jun 06 |
nicklas |
179 |
</tr> |
2446 |
29 Jun 06 |
nicklas |
180 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
181 |
<th>Event date</th> |
2942 |
22 Nov 06 |
nicklas |
182 |
<td><%=dateFormatter.format(event.getEventDate())%></td> |
1862 |
30 Jan 06 |
nicklas |
183 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
184 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
185 |
<th>Registration date</th> |
2942 |
22 Nov 06 |
nicklas |
186 |
<td><%=dateFormatter.format(event.getEntryDate())%></td> |
1862 |
30 Jan 06 |
nicklas |
187 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
188 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
189 |
<th>Event type</th> |
1862 |
30 Jan 06 |
nicklas |
190 |
<td> |
1862 |
30 Jan 06 |
nicklas |
191 |
<%=currentEventType != null ? currentEventType.getOrdinal() + ". " : ""%> |
2446 |
29 Jun 06 |
nicklas |
192 |
<%=Base.getLinkedName(ID, currentEventType, !readCurrentEventType, true)%> |
1862 |
30 Jan 06 |
nicklas |
193 |
</td> |
1862 |
30 Jan 06 |
nicklas |
194 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
195 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
196 |
<th>Protocol</th> |
2446 |
29 Jun 06 |
nicklas |
197 |
<td><base:propertyvalue item="<%=event%>" property="protocol" /></td> |
1862 |
30 Jan 06 |
nicklas |
198 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
199 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
200 |
<th>Hardware</th> |
2486 |
03 Aug 06 |
martin |
201 |
<td><base:propertyvalue item="<%=event%>" property="hardware" /></td> |
2486 |
03 Aug 06 |
martin |
202 |
</tr> |
2486 |
03 Aug 06 |
martin |
203 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
204 |
<th>Permissions</th> |
5943 |
01 Feb 12 |
nicklas |
205 |
<td><%=PermissionUtil.getFullPermissionNames(event)%></td> |
5943 |
01 Feb 12 |
nicklas |
206 |
</tr> |
5943 |
01 Feb 12 |
nicklas |
207 |
<tr> |
5943 |
01 Feb 12 |
nicklas |
208 |
<th>Comment</th> |
1862 |
30 Jan 06 |
nicklas |
209 |
<td><%=HTML.niceFormat(event.getComment())%></td> |
1862 |
30 Jan 06 |
nicklas |
210 |
</tr> |
1862 |
30 Jan 06 |
nicklas |
211 |
</table> |
5943 |
01 Feb 12 |
nicklas |
212 |
</div> |
5943 |
01 Feb 12 |
nicklas |
213 |
|
5499 |
17 Nov 10 |
nicklas |
214 |
<jsp:include page="../../../common/anytoany/list_anytoany.jsp"> |
5499 |
17 Nov 10 |
nicklas |
215 |
<jsp:param name="ID" value="<%=ID%>" /> |
5499 |
17 Nov 10 |
nicklas |
216 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5499 |
17 Nov 10 |
nicklas |
217 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5499 |
17 Nov 10 |
nicklas |
218 |
<jsp:param name="title" value="Other items related to this event" /> |
5499 |
17 Nov 10 |
nicklas |
219 |
</jsp:include> |
5943 |
01 Feb 12 |
nicklas |
220 |
</t:tab> |
5943 |
01 Feb 12 |
nicklas |
221 |
</t:tabcontrol> |
1862 |
30 Jan 06 |
nicklas |
222 |
</base:body> |
1862 |
30 Jan 06 |
nicklas |
223 |
</base:page> |
1862 |
30 Jan 06 |
nicklas |
224 |
<% |
1862 |
30 Jan 06 |
nicklas |
225 |
} |
1862 |
30 Jan 06 |
nicklas |
226 |
finally |
1862 |
30 Jan 06 |
nicklas |
227 |
{ |
1862 |
30 Jan 06 |
nicklas |
228 |
if (dc != null) dc.close(); |
1862 |
30 Jan 06 |
nicklas |
229 |
} |
1862 |
30 Jan 06 |
nicklas |
230 |
|
1862 |
30 Jan 06 |
nicklas |
231 |
%> |