1 | <%-- $Id: view_hybridization.jsp 5064 2009-08-19 12:09:14Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
---|
4 | Copyright (C) 2007 Martin Svensson |
---|
5 | |
---|
6 | This file is part of BASE - BioArray Software Environment. |
---|
7 | Available at http://base.thep.lu.se/ |
---|
8 | |
---|
9 | BASE is free software; you can redistribute it and/or |
---|
10 | modify it under the terms of the GNU General Public License |
---|
11 | as published by the Free Software Foundation; either version 3 |
---|
12 | of the License, or (at your option) any later version. |
---|
13 | |
---|
14 | BASE is distributed in the hope that it will be useful, |
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | GNU General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU General Public License |
---|
20 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | ------------------------------------------------------------------ |
---|
22 | |
---|
23 | @author Nicklas |
---|
24 | @version 2.0 |
---|
25 | --%> |
---|
26 | <%@ page session="false" |
---|
27 | import="net.sf.basedb.core.SessionControl" |
---|
28 | import="net.sf.basedb.core.DbControl" |
---|
29 | import="net.sf.basedb.core.SystemItems" |
---|
30 | import="net.sf.basedb.core.Item" |
---|
31 | import="net.sf.basedb.core.ItemContext" |
---|
32 | import="net.sf.basedb.core.Permission" |
---|
33 | import="net.sf.basedb.core.AnnotationType" |
---|
34 | import="net.sf.basedb.core.AnnotationSet" |
---|
35 | import="net.sf.basedb.core.Hybridization" |
---|
36 | import="net.sf.basedb.core.ArraySlide" |
---|
37 | import="net.sf.basedb.core.BioMaterialEvent" |
---|
38 | import="net.sf.basedb.core.Protocol" |
---|
39 | import="net.sf.basedb.core.Scan" |
---|
40 | import="net.sf.basedb.core.Group" |
---|
41 | import="net.sf.basedb.core.Hardware" |
---|
42 | import="net.sf.basedb.core.User" |
---|
43 | import="net.sf.basedb.core.LabeledExtract" |
---|
44 | import="net.sf.basedb.core.Label" |
---|
45 | import="net.sf.basedb.core.MultiPermissions" |
---|
46 | import="net.sf.basedb.core.ItemQuery" |
---|
47 | import="net.sf.basedb.core.Include" |
---|
48 | import="net.sf.basedb.core.ItemResultList" |
---|
49 | import="net.sf.basedb.core.ItemResultList" |
---|
50 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
51 | import="net.sf.basedb.core.PluginDefinition" |
---|
52 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
53 | import="net.sf.basedb.core.plugin.Plugin" |
---|
54 | import="net.sf.basedb.core.Project" |
---|
55 | import="net.sf.basedb.core.query.Orders" |
---|
56 | import="net.sf.basedb.core.query.Hql" |
---|
57 | import="net.sf.basedb.clients.web.Base" |
---|
58 | import="net.sf.basedb.clients.web.ChangeHistoryUtil" |
---|
59 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
60 | import="net.sf.basedb.clients.web.util.HTML" |
---|
61 | import="net.sf.basedb.util.Values" |
---|
62 | import="net.sf.basedb.util.formatter.Formatter" |
---|
63 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
64 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
65 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
66 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
67 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
68 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
69 | import="java.util.Collections" |
---|
70 | import="java.util.Date" |
---|
71 | import="java.util.Map" |
---|
72 | import="java.util.Set" |
---|
73 | import="java.util.List" |
---|
74 | %> |
---|
75 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
76 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
77 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
78 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
79 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
80 | <%! |
---|
81 | private static final Item itemType = Item.HYBRIDIZATION; |
---|
82 | private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
---|
83 | %> |
---|
84 | <% |
---|
85 | final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
---|
86 | final String ID = sc.getId(); |
---|
87 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
---|
88 | final int itemId = cc.getId(); |
---|
89 | final String tab = Values.getString(request.getParameter("tab"), "properties"); |
---|
90 | final float scale = Base.getScale(sc); |
---|
91 | final DbControl dc = sc.newDbControl(); |
---|
92 | try |
---|
93 | { |
---|
94 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
95 | Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
96 | |
---|
97 | String title = null; |
---|
98 | Hybridization hyb = Hybridization.getById(dc, itemId); |
---|
99 | BioMaterialEvent creationEvent = hyb.getCreationEvent(); |
---|
100 | |
---|
101 | final boolean usePermission = hyb.hasPermission(Permission.USE); |
---|
102 | final boolean writePermission = hyb.hasPermission(Permission.WRITE); |
---|
103 | final boolean deletePermission = hyb.hasPermission(Permission.DELETE); |
---|
104 | final boolean sharePermission = hyb.hasPermission(Permission.SET_PERMISSION); |
---|
105 | final boolean setOwnerPermission = hyb.hasPermission(Permission.SET_OWNER); |
---|
106 | final boolean isRemoved = hyb.isRemoved(); |
---|
107 | final boolean isUsed = isRemoved && hyb.isUsed(); |
---|
108 | final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
---|
109 | final boolean isOwner = hyb.isOwner(); |
---|
110 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, hyb); |
---|
111 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
112 | %> |
---|
113 | <base:page title="<%=title%>"> |
---|
114 | <base:head scripts="table.js,tabcontrol.js" styles="toolbar.css,table.css,headertabcontrol.css,path.css"> |
---|
115 | <ext:scripts context="<%=jspContext%>" /> |
---|
116 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
117 | <script language="JavaScript"> |
---|
118 | function editItem() |
---|
119 | { |
---|
120 | Main.viewOrEditItem('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>, true); |
---|
121 | } |
---|
122 | function shareItem() |
---|
123 | { |
---|
124 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=ShareItem&item_id=<%=itemId%>', 'ShareHybridization', 600, 400); |
---|
125 | } |
---|
126 | function deleteItem() |
---|
127 | { |
---|
128 | location.replace('index.jsp?ID=<%=ID%>&cmd=DeleteItem&item_id=<%=itemId%>'); |
---|
129 | } |
---|
130 | function restoreItem() |
---|
131 | { |
---|
132 | location.replace('index.jsp?ID=<%=ID%>&cmd=RestoreItem&item_id=<%=itemId%>'); |
---|
133 | } |
---|
134 | function deleteItemPermanently() |
---|
135 | { |
---|
136 | Main.deleteItemPermanently('<%=ID%>', true, '<%=itemType.name()%>', <%=itemId%>, '&callback=itemDeleted'); |
---|
137 | } |
---|
138 | function itemDeleted() |
---|
139 | { |
---|
140 | Main.listItems('<%=ID%>', '<%=itemType.name()%>'); |
---|
141 | } |
---|
142 | function showUsingItems() |
---|
143 | { |
---|
144 | Main.showUsingItems('<%=ID%>', '<%=itemType.name()%>', <%=itemId%>); |
---|
145 | } |
---|
146 | function setOwner() |
---|
147 | { |
---|
148 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd=SetOwnerOfItem&item_id=<%=itemId%>', 'SetOwnerOfItem', 450, 150); |
---|
149 | } |
---|
150 | function runPlugin(cmd) |
---|
151 | { |
---|
152 | Main.openPopup('index.jsp?ID=<%=ID%>&cmd='+cmd+'&item_id=<%=itemId%>', 'RunPlugin'+cmd, 740, 540); |
---|
153 | } |
---|
154 | function newScan() |
---|
155 | { |
---|
156 | Main.viewOrEditItem('<%=ID%>', 'SCAN', 0, true, '&hybridization_id=<%=itemId%>'); |
---|
157 | } |
---|
158 | function switchTab(tabControlId, tabId) |
---|
159 | { |
---|
160 | if (TabControl.isActive(tabControlId, tabId)) return; |
---|
161 | if ((tabId == 'overview' || tabId == 'history') && tabId != '<%=tab%>') |
---|
162 | { |
---|
163 | location.href = 'index.jsp?ID=<%=ID%>&cmd=ViewItem&item_id=<%=itemId%>&tab='+tabId; |
---|
164 | } |
---|
165 | else |
---|
166 | { |
---|
167 | TabControl.setActiveTab(tabControlId, tabId); |
---|
168 | } |
---|
169 | } |
---|
170 | |
---|
171 | </script> |
---|
172 | </base:head> |
---|
173 | <base:body> |
---|
174 | <p> |
---|
175 | <p:path> |
---|
176 | <p:pathelement title="Hybridizations" href="<%="index.jsp?ID="+ID%>" /> |
---|
177 | <p:pathelement title="<%=HTML.encodeTags(hyb.getName())%>" /> |
---|
178 | </p:path> |
---|
179 | <t:tabcontrol id="main" active="<%=tab%>" switch="switchTab" remember="false"> |
---|
180 | <t:tab id="properties" title="Properties"> |
---|
181 | |
---|
182 | <tbl:toolbar |
---|
183 | > |
---|
184 | <tbl:button |
---|
185 | disabled="<%=writePermission ? false : true%>" |
---|
186 | image="<%=writePermission ? "edit.gif" : "edit_disabled.gif"%>" |
---|
187 | onclick="editItem()" |
---|
188 | title="Edit…" |
---|
189 | tooltip="<%=writePermission ? "Edit this hybridization" : "You do not have permission to edit this hybridization"%>" |
---|
190 | /> |
---|
191 | <tbl:button |
---|
192 | disabled="<%=deletePermission ? false : true%>" |
---|
193 | image="<%=deletePermission ? "delete.gif" : "delete_disabled.gif"%>" |
---|
194 | onclick="deleteItem()" |
---|
195 | title="Delete" |
---|
196 | visible="<%=!hyb.isRemoved()%>" |
---|
197 | tooltip="<%=deletePermission ? "Delete this hybridization" : "You do not have permission to delete this hybridization"%>" |
---|
198 | /> |
---|
199 | <tbl:button |
---|
200 | disabled="<%=writePermission ? false : true%>" |
---|
201 | image="<%=writePermission ? "restore.gif" : "restore_disabled.gif"%>" |
---|
202 | onclick="restoreItem()" |
---|
203 | title="Restore" |
---|
204 | visible="<%=hyb.isRemoved()%>" |
---|
205 | tooltip="<%=writePermission ? "Restore this hybridization" : "You do not have permission to restore this hybridization"%>" |
---|
206 | /> |
---|
207 | <tbl:button |
---|
208 | disabled="<%=sharePermission ? false : true%>" |
---|
209 | image="<%=sharePermission ? "share.gif" : "share_disabled.gif"%>" |
---|
210 | onclick="shareItem()" |
---|
211 | title="Share…" |
---|
212 | tooltip="<%=sharePermission ? "Share this hybridization to other user, groups and projects" : "You do not have permission to share this hybridization"%>" |
---|
213 | /> |
---|
214 | <tbl:button |
---|
215 | disabled="<%=setOwnerPermission ? false : true%>" |
---|
216 | image="<%=setOwnerPermission ? "take_ownership.png" : "take_ownership_disabled.png"%>" |
---|
217 | onclick="setOwner()" |
---|
218 | title="Set owner…" |
---|
219 | tooltip="<%=setOwnerPermission ? "Change owner of this item" : "You do not have permission to change ownership of this item"%>" |
---|
220 | /> |
---|
221 | <tbl:button |
---|
222 | image="add.png" |
---|
223 | onclick="newScan()" |
---|
224 | title="New scan…" |
---|
225 | tooltip="Create a new scan from this hybridization" |
---|
226 | visible="<%=sc.hasPermission(Permission.CREATE, Item.SCAN) && usePermission%>" |
---|
227 | /> |
---|
228 | <tbl:button |
---|
229 | image="import.gif" |
---|
230 | onclick="runPlugin('ImportItem')" |
---|
231 | title="Import…" |
---|
232 | tooltip="Import data" |
---|
233 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
234 | /> |
---|
235 | <tbl:button |
---|
236 | image="export.gif" |
---|
237 | onclick="runPlugin('ExportItem')" |
---|
238 | title="Export…" |
---|
239 | tooltip="Export data" |
---|
240 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
241 | /> |
---|
242 | <tbl:button |
---|
243 | image="runplugin.gif" |
---|
244 | onclick="runPlugin('RunPlugin')" |
---|
245 | title="Run plugin…" |
---|
246 | tooltip="Run a plugin" |
---|
247 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
248 | /> |
---|
249 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
250 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
251 | <tbl:button |
---|
252 | image="help.gif" |
---|
253 | onclick="<%="Main.openHelp('" + ID +"', 'hybridization.view.properties')"%>" |
---|
254 | title="Help…" |
---|
255 | tooltip="Get help about this page" |
---|
256 | /> |
---|
257 | </tbl:toolbar> |
---|
258 | <div class="boxedbottom"> |
---|
259 | <div class="itemstatus">Permissions on this item: <i><%=PermissionUtil.getFullPermissionNames(hyb)%></i></div> |
---|
260 | <% |
---|
261 | if (hyb.isRemoved() || hyb.isShared()) |
---|
262 | { |
---|
263 | %> |
---|
264 | <div class="itemstatus"> |
---|
265 | <base:icon |
---|
266 | image="<%=deletePermanentlyPermission ? "deleted.gif" : "deleted_disabled.gif"%>" |
---|
267 | onclick="<%=deletePermanentlyPermission ? "deleteItemPermanently()" : null%>" |
---|
268 | tooltip="<%=deletePermanentlyPermission ? "Permanently delete this item" : null%>" |
---|
269 | visible="<%=isRemoved%>"> This item has been flagged for deletion<br></base:icon> |
---|
270 | <base:icon image="used.gif" |
---|
271 | onclick="showUsingItems()" |
---|
272 | tooltip="Show the items that are using this one" |
---|
273 | visible="<%=isUsed%>"> This item is used by other items and can't be permanently deleted<br></base:icon> |
---|
274 | <base:icon image="shared.gif" |
---|
275 | visible="<%=hyb.isShared()%>"> This item is shared to other users, groups and/or projects</base:icon> |
---|
276 | </div> |
---|
277 | <% |
---|
278 | } |
---|
279 | %> |
---|
280 | <table class="form" cellspacing="0"> |
---|
281 | <tr> |
---|
282 | <td class="prompt">Name</td> |
---|
283 | <td><%=HTML.encodeTags(hyb.getName())%></td> |
---|
284 | </tr> |
---|
285 | <tr> |
---|
286 | <td class="prompt">Arrays</td> |
---|
287 | <td><%=hyb.getNumArrays()%></td> |
---|
288 | </tr> |
---|
289 | <tr> |
---|
290 | <td class="prompt">Array slide</td> |
---|
291 | <td><base:propertyvalue item="<%=hyb%>" property="arraySlide" /></td> |
---|
292 | </tr> |
---|
293 | <tr> |
---|
294 | <td class="subprompt">-barcode</td> |
---|
295 | <td><base:propertyvalue item="<%=hyb%>" property="arraySlide.barcode" /></td> |
---|
296 | </tr> |
---|
297 | <tr> |
---|
298 | <td class="prompt">Created</td> |
---|
299 | <td><%=dateFormatter.format(creationEvent.getEventDate())%></td> |
---|
300 | </tr> |
---|
301 | <tr> |
---|
302 | <td class="prompt">Registered</td> |
---|
303 | <td><%=dateFormatter.format(creationEvent.getEntryDate())%></td> |
---|
304 | </tr> |
---|
305 | <tr> |
---|
306 | <td class="prompt">Protocol</td> |
---|
307 | <td><base:propertyvalue item="<%=creationEvent%>" property="protocol" /></td> |
---|
308 | </tr> |
---|
309 | <tr> |
---|
310 | <td class="prompt">Hardware</td> |
---|
311 | <td><base:propertyvalue item="<%=creationEvent%>" property="hardware" /></td> |
---|
312 | </tr> |
---|
313 | <tr> |
---|
314 | <td class="prompt">Owner</td> |
---|
315 | <td><base:propertyvalue item="<%=hyb%>" property="owner" /></td> |
---|
316 | </tr> |
---|
317 | <tr> |
---|
318 | <td class="prompt">Description</td> |
---|
319 | <td><%=HTML.niceFormat(hyb.getDescription())%></td> |
---|
320 | </tr> |
---|
321 | </table> |
---|
322 | |
---|
323 | <% |
---|
324 | ItemQuery<LabeledExtract> labeledExtractsQuery = (ItemQuery<LabeledExtract>)creationEvent.getSources(); |
---|
325 | labeledExtractsQuery.include(Include.ALL); |
---|
326 | labeledExtractsQuery.order(Orders.asc(Hql.property("name"))); |
---|
327 | ItemResultList<LabeledExtract> labeledExtracts = labeledExtractsQuery.list(dc); |
---|
328 | if (labeledExtracts.size() == 0) |
---|
329 | { |
---|
330 | %> |
---|
331 | <h4>Labeled extracts</h4> |
---|
332 | No labeled extracts has been added to this hybridization |
---|
333 | (or, you don't have permission to view them). |
---|
334 | <% |
---|
335 | } |
---|
336 | else |
---|
337 | { |
---|
338 | %> |
---|
339 | <base:section |
---|
340 | id="labeledExtractSection" |
---|
341 | title="<%="Labeled extracts (" + labeledExtracts.size() + ")"%>" |
---|
342 | context="<%=cc%>" |
---|
343 | > |
---|
344 | <tbl:table |
---|
345 | id="labeledextracts" |
---|
346 | clazz="itemlist" |
---|
347 | columns="all" |
---|
348 | > |
---|
349 | <tbl:columndef |
---|
350 | id="arrayNum" |
---|
351 | title="Array" |
---|
352 | show="<%=hyb.getNumArrays() > 1 ? "always" : "never"%>" |
---|
353 | /> |
---|
354 | <tbl:columndef |
---|
355 | id="name" |
---|
356 | title="Name" |
---|
357 | /> |
---|
358 | <tbl:columndef |
---|
359 | id="label" |
---|
360 | title="Label" |
---|
361 | /> |
---|
362 | <tbl:columndef |
---|
363 | id="quantity" |
---|
364 | title="Used quantity (µg)" |
---|
365 | /> |
---|
366 | <tbl:columndef |
---|
367 | id="description" |
---|
368 | title="Description" |
---|
369 | /> |
---|
370 | <tbl:data> |
---|
371 | <tbl:columns> |
---|
372 | </tbl:columns> |
---|
373 | <tbl:rows> |
---|
374 | <% |
---|
375 | for (LabeledExtract item : labeledExtracts) |
---|
376 | { |
---|
377 | %> |
---|
378 | <tbl:row> |
---|
379 | <tbl:cell column="arrayNum"><%=creationEvent.getSourceGroup(item)%></tbl:cell> |
---|
380 | <tbl:cell column="name"><base:icon |
---|
381 | image="deleted.gif" |
---|
382 | tooltip="This item has been scheduled for deletion" |
---|
383 | visible="<%=item.isRemoved()%>" |
---|
384 | /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> |
---|
385 | <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="label" /></tbl:cell> |
---|
386 | <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell> |
---|
387 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
388 | </tbl:row> |
---|
389 | <% |
---|
390 | } |
---|
391 | %> |
---|
392 | </tbl:rows> |
---|
393 | </tbl:data> |
---|
394 | </tbl:table> |
---|
395 | </base:section> |
---|
396 | <% |
---|
397 | } |
---|
398 | %> |
---|
399 | |
---|
400 | <% |
---|
401 | ItemQuery<Scan> scanQuery = (ItemQuery<Scan>)hyb.getScans(); |
---|
402 | scanQuery.include(Include.ALL); |
---|
403 | scanQuery.order(Orders.asc(Hql.property("name"))); |
---|
404 | ItemResultList<Scan> scans = scanQuery.list(dc); |
---|
405 | if (scans.size() == 0) |
---|
406 | { |
---|
407 | %> |
---|
408 | <h4>Scans</h4> |
---|
409 | No scans has been created from this hybridization |
---|
410 | (or, you don't have permission to view them). |
---|
411 | <% |
---|
412 | } |
---|
413 | else |
---|
414 | { |
---|
415 | %> |
---|
416 | <base:section |
---|
417 | id="scanSection" |
---|
418 | title="<%="Scans (" + scans.size() + ")"%>" |
---|
419 | context="<%=cc%>" |
---|
420 | > |
---|
421 | <tbl:table |
---|
422 | id="scans" |
---|
423 | clazz="itemlist" |
---|
424 | columns="all" |
---|
425 | > |
---|
426 | <tbl:columndef |
---|
427 | id="name" |
---|
428 | title="Name" |
---|
429 | /> |
---|
430 | <tbl:columndef |
---|
431 | id="scanner" |
---|
432 | title="Scanner" |
---|
433 | /> |
---|
434 | |
---|
435 | <tbl:columndef |
---|
436 | id="description" |
---|
437 | title="Description" |
---|
438 | /> |
---|
439 | <tbl:data> |
---|
440 | <tbl:columns> |
---|
441 | </tbl:columns> |
---|
442 | <tbl:rows> |
---|
443 | <% |
---|
444 | for (Scan item : scans) |
---|
445 | { |
---|
446 | %> |
---|
447 | <tbl:row> |
---|
448 | <tbl:cell column="name"><base:icon |
---|
449 | image="deleted.gif" |
---|
450 | tooltip="This item has been scheduled for deletion" |
---|
451 | visible="<%=item.isRemoved()%>" |
---|
452 | /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> |
---|
453 | <tbl:cell column="scanner"><base:propertyvalue item="<%=item%>" property="scanner" /></tbl:cell> |
---|
454 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
455 | </tbl:row> |
---|
456 | <% |
---|
457 | } |
---|
458 | %> |
---|
459 | </tbl:rows> |
---|
460 | </tbl:data> |
---|
461 | </tbl:table> |
---|
462 | </base:section> |
---|
463 | <% |
---|
464 | } |
---|
465 | |
---|
466 | // Tables with users/groups/projects that this item is shared to |
---|
467 | MultiPermissions mp = new MultiPermissions(Collections.singleton(hyb)); |
---|
468 | ItemResultList<User> users = mp.getUsers().list(dc); |
---|
469 | ItemResultList<Group> groups = mp.getGroups().list(dc); |
---|
470 | ItemResultList<Project> projects = mp.getProjects().list(dc); |
---|
471 | int totalShare = users.size() + groups.size() + projects.size(); |
---|
472 | |
---|
473 | if (totalShare > 0) |
---|
474 | { |
---|
475 | %> |
---|
476 | <base:section |
---|
477 | id="sharedTo" |
---|
478 | title="<%="Shared to (" + totalShare + ")"%>" |
---|
479 | context="<%=cc%>" |
---|
480 | > |
---|
481 | <tbl:table |
---|
482 | id="itemsSharedTo" |
---|
483 | clazz="itemlist" |
---|
484 | columns="all" |
---|
485 | > |
---|
486 | <tbl:columndef |
---|
487 | id="itemType" |
---|
488 | title="Item type" |
---|
489 | /> |
---|
490 | <tbl:columndef |
---|
491 | id="name" |
---|
492 | title="Name" |
---|
493 | /> |
---|
494 | <tbl:columndef |
---|
495 | id="permissions" |
---|
496 | title="Permissions" |
---|
497 | /> |
---|
498 | <tbl:data> |
---|
499 | <tbl:columns> |
---|
500 | </tbl:columns> |
---|
501 | <tbl:rows> |
---|
502 | <% |
---|
503 | for (Project project : projects) |
---|
504 | { |
---|
505 | Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); |
---|
506 | %> |
---|
507 | <tbl:row> |
---|
508 | <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> |
---|
509 | <tbl:cell column="name"><base:icon |
---|
510 | image="deleted.gif" |
---|
511 | tooltip="This item has been scheduled for deletion" |
---|
512 | visible="<%=project.isRemoved()%>" |
---|
513 | /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> |
---|
514 | <tbl:cell column="permissions"> |
---|
515 | <%=PermissionUtil.translatePermissionsToString(permissions)%> |
---|
516 | </tbl:cell> |
---|
517 | </tbl:row> |
---|
518 | <% |
---|
519 | } |
---|
520 | for (Group group : groups) |
---|
521 | { |
---|
522 | Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); |
---|
523 | %> |
---|
524 | <tbl:row> |
---|
525 | <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> |
---|
526 | <tbl:cell column="name"><base:icon |
---|
527 | image="deleted.gif" |
---|
528 | tooltip="This item has been scheduled for deletion" |
---|
529 | visible="<%=group.isRemoved()%>" |
---|
530 | /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> |
---|
531 | <tbl:cell column="permissions"> |
---|
532 | <%=PermissionUtil.translatePermissionsToString(permissions)%> |
---|
533 | </tbl:cell> |
---|
534 | </tbl:row> |
---|
535 | <% |
---|
536 | } |
---|
537 | for (User user : users) |
---|
538 | { |
---|
539 | Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); |
---|
540 | %> |
---|
541 | <tbl:row> |
---|
542 | <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> |
---|
543 | <tbl:cell column="name"><base:icon |
---|
544 | image="deleted.gif" |
---|
545 | tooltip="This item has been scheduled for deletion" |
---|
546 | visible="<%=user.isRemoved()%>" |
---|
547 | /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> |
---|
548 | <tbl:cell column="permissions"> |
---|
549 | <%=PermissionUtil.translatePermissionsToString(permissions)%> |
---|
550 | </tbl:cell> |
---|
551 | </tbl:row> |
---|
552 | <% |
---|
553 | } |
---|
554 | %> |
---|
555 | </tbl:rows> |
---|
556 | </tbl:data> |
---|
557 | </tbl:table> |
---|
558 | </base:section> |
---|
559 | <% |
---|
560 | } |
---|
561 | else |
---|
562 | { |
---|
563 | %> |
---|
564 | <h4>Shared to</h4> |
---|
565 | This hybridization is not shared |
---|
566 | (or, you don't have permission to view the ones it is shared to). |
---|
567 | <% |
---|
568 | } |
---|
569 | %> |
---|
570 | |
---|
571 | </div> |
---|
572 | </t:tab> |
---|
573 | |
---|
574 | <t:tab id="annotations" title="Annotations & parameters" |
---|
575 | tooltip="View annotation values and protocol parameters"> |
---|
576 | <div class="boxed"> |
---|
577 | <jsp:include page="../../common/annotations/list_annotations.jsp"> |
---|
578 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
579 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
580 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
581 | </jsp:include> |
---|
582 | </div> |
---|
583 | </t:tab> |
---|
584 | |
---|
585 | <t:tab id="overview" title="Overview" |
---|
586 | tooltip="Display a tree overview of related items"> |
---|
587 | <% |
---|
588 | if ("overview".equals(tab)) |
---|
589 | { |
---|
590 | %> |
---|
591 | <jsp:include page="../../common/overview/overview.jsp"> |
---|
592 | <jsp:param name="item_type" value="<%=itemType.name()%>" /> |
---|
593 | <jsp:param name="item_id" value="<%=itemId%>" /> |
---|
594 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
595 | </jsp:include> |
---|
596 | <% |
---|
597 | } |
---|
598 | %> |
---|
599 | </t:tab> |
---|
600 | <t:tab id="history" title="Change history" |
---|
601 | tooltip="Displays a log of all modifications made to this item" |
---|
602 | visible="<%=ChangeHistoryUtil.showChangeHistoryTab(sc)%>"> |
---|
603 | <% |
---|
604 | if ("history".equals(tab)) |
---|
605 | { |
---|
606 | %> |
---|
607 | <jsp:include page="../../common/history/frameset.jsp"> |
---|
608 | <jsp:param name="source_type" value="<%=itemType.name()%>" /> |
---|
609 | <jsp:param name="source_id" value="<%=itemId%>" /> |
---|
610 | <jsp:param name="ID" value="<%=ID%>" /> |
---|
611 | </jsp:include> |
---|
612 | <% |
---|
613 | } |
---|
614 | %> |
---|
615 | </t:tab> |
---|
616 | </t:tabcontrol> |
---|
617 | |
---|
618 | </base:body> |
---|
619 | </base:page> |
---|
620 | <% |
---|
621 | } |
---|
622 | finally |
---|
623 | { |
---|
624 | if (dc != null) dc.close(); |
---|
625 | } |
---|
626 | |
---|
627 | %> |
---|