2011 |
17 Feb 06 |
nicklas |
1 |
<%-- $Id$ |
2011 |
17 Feb 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
2011 |
17 Feb 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/ |
2011 |
17 Feb 06 |
nicklas |
7 |
|
2011 |
17 Feb 06 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
2011 |
17 Feb 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 |
2011 |
17 Feb 06 |
nicklas |
11 |
of the License, or (at your option) any later version. |
2011 |
17 Feb 06 |
nicklas |
12 |
|
2011 |
17 Feb 06 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
2011 |
17 Feb 06 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2011 |
17 Feb 06 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2011 |
17 Feb 06 |
nicklas |
16 |
GNU General Public License for more details. |
2011 |
17 Feb 06 |
nicklas |
17 |
|
2011 |
17 Feb 06 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
2011 |
17 Feb 06 |
nicklas |
20 |
------------------------------------------------------------------ |
2011 |
17 Feb 06 |
nicklas |
21 |
|
2011 |
17 Feb 06 |
nicklas |
22 |
@author Nicklas |
2011 |
17 Feb 06 |
nicklas |
23 |
@version 2.0 |
2011 |
17 Feb 06 |
nicklas |
24 |
--%> |
5426 |
24 Sep 10 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
2011 |
17 Feb 06 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
2011 |
17 Feb 06 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
2011 |
17 Feb 06 |
nicklas |
28 |
import="net.sf.basedb.core.SystemItems" |
2011 |
17 Feb 06 |
nicklas |
29 |
import="net.sf.basedb.core.Item" |
2011 |
17 Feb 06 |
nicklas |
30 |
import="net.sf.basedb.core.ItemContext" |
2011 |
17 Feb 06 |
nicklas |
31 |
import="net.sf.basedb.core.Permission" |
2011 |
17 Feb 06 |
nicklas |
32 |
import="net.sf.basedb.core.QuotaType" |
2011 |
17 Feb 06 |
nicklas |
33 |
import="net.sf.basedb.core.PermissionDeniedException" |
2011 |
17 Feb 06 |
nicklas |
34 |
import="net.sf.basedb.core.PluginDefinition" |
2011 |
17 Feb 06 |
nicklas |
35 |
import="net.sf.basedb.core.plugin.GuiContext" |
2011 |
17 Feb 06 |
nicklas |
36 |
import="net.sf.basedb.core.plugin.Plugin" |
2011 |
17 Feb 06 |
nicklas |
37 |
import="net.sf.basedb.clients.web.Base" |
2386 |
15 Jun 06 |
martin |
38 |
import="net.sf.basedb.clients.web.PermissionUtil" |
2011 |
17 Feb 06 |
nicklas |
39 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
40 |
import="net.sf.basedb.util.Values" |
4698 |
10 Dec 08 |
nicklas |
41 |
import="net.sf.basedb.util.formatter.Formatter" |
4698 |
10 Dec 08 |
nicklas |
42 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
4886 |
03 Apr 09 |
nicklas |
43 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4886 |
03 Apr 09 |
nicklas |
44 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4886 |
03 Apr 09 |
nicklas |
45 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
46 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
4886 |
03 Apr 09 |
nicklas |
47 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
4886 |
03 Apr 09 |
nicklas |
48 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
4698 |
10 Dec 08 |
nicklas |
49 |
import="java.util.Date" |
2011 |
17 Feb 06 |
nicklas |
50 |
import="java.util.Map" |
2011 |
17 Feb 06 |
nicklas |
51 |
%> |
2011 |
17 Feb 06 |
nicklas |
52 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2011 |
17 Feb 06 |
nicklas |
53 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
2011 |
17 Feb 06 |
nicklas |
54 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
2011 |
17 Feb 06 |
nicklas |
55 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
4886 |
03 Apr 09 |
nicklas |
56 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
2011 |
17 Feb 06 |
nicklas |
57 |
<%! |
2011 |
17 Feb 06 |
nicklas |
58 |
private static final Item itemType = Item.QUOTATYPE; |
2011 |
17 Feb 06 |
nicklas |
59 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
2011 |
17 Feb 06 |
nicklas |
60 |
%> |
2011 |
17 Feb 06 |
nicklas |
61 |
<% |
2011 |
17 Feb 06 |
nicklas |
62 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
2011 |
17 Feb 06 |
nicklas |
63 |
final String ID = sc.getId(); |
2011 |
17 Feb 06 |
nicklas |
64 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
2011 |
17 Feb 06 |
nicklas |
65 |
final int itemId = cc.getId(); |
6289 |
05 Jun 13 |
nicklas |
66 |
final String tab = Values.getStringOrNull(request.getParameter("tab")); |
2011 |
17 Feb 06 |
nicklas |
67 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
68 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
2011 |
17 Feb 06 |
nicklas |
69 |
try |
2011 |
17 Feb 06 |
nicklas |
70 |
{ |
4698 |
10 Dec 08 |
nicklas |
71 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
2011 |
17 Feb 06 |
nicklas |
72 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
2011 |
17 Feb 06 |
nicklas |
73 |
|
2011 |
17 Feb 06 |
nicklas |
74 |
String title = null; |
2011 |
17 Feb 06 |
nicklas |
75 |
QuotaType quotaType = QuotaType.getById(dc, itemId); |
2011 |
17 Feb 06 |
nicklas |
76 |
|
2011 |
17 Feb 06 |
nicklas |
77 |
final boolean writePermission = quotaType.hasPermission(Permission.WRITE); |
4886 |
03 Apr 09 |
nicklas |
78 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, quotaType); |
7604 |
25 Feb 19 |
nicklas |
79 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
2011 |
17 Feb 06 |
nicklas |
80 |
%> |
6289 |
05 Jun 13 |
nicklas |
81 |
<base:page title="<%=title%>" id="view-page"> |
6289 |
05 Jun 13 |
nicklas |
82 |
<base:head scripts="tabcontrol-2.js,table.js,~quotatypes.js" styles="toolbar.css,headertabcontrol.css,path.css,table.css"> |
4886 |
03 Apr 09 |
nicklas |
83 |
<ext:scripts context="<%=jspContext%>" /> |
4886 |
03 Apr 09 |
nicklas |
84 |
<ext:stylesheets context="<%=jspContext%>" /> |
2011 |
17 Feb 06 |
nicklas |
85 |
</base:head> |
2011 |
17 Feb 06 |
nicklas |
86 |
<base:body> |
5941 |
01 Feb 12 |
nicklas |
87 |
<p:path><p:pathelement |
5941 |
01 Feb 12 |
nicklas |
88 |
title="Quota types" href="<%="index.jsp?ID="+ID%>" |
5941 |
01 Feb 12 |
nicklas |
89 |
/><p:pathelement title="<%=HTML.encodeTags(quotaType.getName())%>" |
5941 |
01 Feb 12 |
nicklas |
90 |
/></p:path> |
6289 |
05 Jun 13 |
nicklas |
91 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
2011 |
17 Feb 06 |
nicklas |
92 |
|
5941 |
01 Feb 12 |
nicklas |
93 |
<t:tabcontrol |
5941 |
01 Feb 12 |
nicklas |
94 |
id="main" |
5941 |
01 Feb 12 |
nicklas |
95 |
subclass="content mastertabcontrol" |
5941 |
01 Feb 12 |
nicklas |
96 |
active="properties"> |
2011 |
17 Feb 06 |
nicklas |
97 |
<t:tab id="properties" title="Properties"> |
5941 |
01 Feb 12 |
nicklas |
98 |
<div> |
5941 |
01 Feb 12 |
nicklas |
99 |
<table class="fullform bottomborder"> |
2011 |
17 Feb 06 |
nicklas |
100 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
101 |
<th class="itemstatus"></th> |
5941 |
01 Feb 12 |
nicklas |
102 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
103 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5941 |
01 Feb 12 |
nicklas |
104 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
105 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
106 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
107 |
image="edit.png" |
5941 |
01 Feb 12 |
nicklas |
108 |
title="Edit…" |
5941 |
01 Feb 12 |
nicklas |
109 |
tooltip="<%=writePermission ? "Edit this quota type" : "You do not have permission to edit this quota type"%>" |
5941 |
01 Feb 12 |
nicklas |
110 |
/> |
5941 |
01 Feb 12 |
nicklas |
111 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
112 |
id="btnExport" |
6289 |
05 Jun 13 |
nicklas |
113 |
image="export.png" |
6289 |
05 Jun 13 |
nicklas |
114 |
data-plugin-type="EXPORT" |
5941 |
01 Feb 12 |
nicklas |
115 |
title="Export…" |
5941 |
01 Feb 12 |
nicklas |
116 |
tooltip="Export data" |
5941 |
01 Feb 12 |
nicklas |
117 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5941 |
01 Feb 12 |
nicklas |
118 |
/> |
5941 |
01 Feb 12 |
nicklas |
119 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
120 |
id="btnRunPlugin" |
6289 |
05 Jun 13 |
nicklas |
121 |
image="runplugin.png" |
6289 |
05 Jun 13 |
nicklas |
122 |
data-plugin-type="OTHER" |
5941 |
01 Feb 12 |
nicklas |
123 |
title="Run plugin…" |
5941 |
01 Feb 12 |
nicklas |
124 |
tooltip="Run a plugin" |
5941 |
01 Feb 12 |
nicklas |
125 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5941 |
01 Feb 12 |
nicklas |
126 |
/> |
5941 |
01 Feb 12 |
nicklas |
127 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
128 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5941 |
01 Feb 12 |
nicklas |
129 |
<tbl:button |
5941 |
01 Feb 12 |
nicklas |
130 |
image="help.png" |
6289 |
05 Jun 13 |
nicklas |
131 |
subclass="auto-init" |
6289 |
05 Jun 13 |
nicklas |
132 |
data-auto-init="help" |
6289 |
05 Jun 13 |
nicklas |
133 |
data-help-id="quotatype.view.properties" |
5941 |
01 Feb 12 |
nicklas |
134 |
title="Help…" |
5941 |
01 Feb 12 |
nicklas |
135 |
tooltip="Get help about this page" |
5941 |
01 Feb 12 |
nicklas |
136 |
/> |
5941 |
01 Feb 12 |
nicklas |
137 |
</tbl:toolbar> |
5941 |
01 Feb 12 |
nicklas |
138 |
</td> |
5941 |
01 Feb 12 |
nicklas |
139 |
</tr> |
5941 |
01 Feb 12 |
nicklas |
140 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
141 |
<th>Name</th> |
2011 |
17 Feb 06 |
nicklas |
142 |
<td><%=HTML.encodeTags(quotaType.getName())%></td> |
2011 |
17 Feb 06 |
nicklas |
143 |
</tr> |
2011 |
17 Feb 06 |
nicklas |
144 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
145 |
<th>Registered</th> |
4698 |
10 Dec 08 |
nicklas |
146 |
<td><%=dateFormatter.format(quotaType.getEntryDate())%></td> |
4698 |
10 Dec 08 |
nicklas |
147 |
</tr> |
4698 |
10 Dec 08 |
nicklas |
148 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
149 |
<th>System ID</th> |
2011 |
17 Feb 06 |
nicklas |
150 |
<td><%=HTML.encodeTags(quotaType.getSystemId())%></td> |
2011 |
17 Feb 06 |
nicklas |
151 |
</tr> |
2011 |
17 Feb 06 |
nicklas |
152 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
153 |
<th>Permissions</th> |
5941 |
01 Feb 12 |
nicklas |
154 |
<td><%=PermissionUtil.getFullPermissionNames(quotaType)%></td> |
5941 |
01 Feb 12 |
nicklas |
155 |
</tr> |
5941 |
01 Feb 12 |
nicklas |
156 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
157 |
<th>Description</th> |
2011 |
17 Feb 06 |
nicklas |
158 |
<td><%=HTML.niceFormat(quotaType.getDescription())%></td> |
2011 |
17 Feb 06 |
nicklas |
159 |
</tr> |
2011 |
17 Feb 06 |
nicklas |
160 |
</table> |
5941 |
01 Feb 12 |
nicklas |
161 |
</div> |
5511 |
19 Nov 10 |
nicklas |
162 |
<jsp:include page="../../common/anytoany/list_anytoany.jsp"> |
5511 |
19 Nov 10 |
nicklas |
163 |
<jsp:param name="ID" value="<%=ID%>" /> |
5511 |
19 Nov 10 |
nicklas |
164 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5511 |
19 Nov 10 |
nicklas |
165 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5511 |
19 Nov 10 |
nicklas |
166 |
<jsp:param name="title" value="Other items related to this quota type" /> |
5511 |
19 Nov 10 |
nicklas |
167 |
</jsp:include> |
2011 |
17 Feb 06 |
nicklas |
168 |
|
2011 |
17 Feb 06 |
nicklas |
169 |
</t:tab> |
2011 |
17 Feb 06 |
nicklas |
170 |
</t:tabcontrol> |
2011 |
17 Feb 06 |
nicklas |
171 |
|
2011 |
17 Feb 06 |
nicklas |
172 |
</base:body> |
2011 |
17 Feb 06 |
nicklas |
173 |
</base:page> |
2011 |
17 Feb 06 |
nicklas |
174 |
<% |
2011 |
17 Feb 06 |
nicklas |
175 |
} |
2011 |
17 Feb 06 |
nicklas |
176 |
finally |
2011 |
17 Feb 06 |
nicklas |
177 |
{ |
2011 |
17 Feb 06 |
nicklas |
178 |
if (dc != null) dc.close(); |
2011 |
17 Feb 06 |
nicklas |
179 |
} |
2011 |
17 Feb 06 |
nicklas |
180 |
|
2011 |
17 Feb 06 |
nicklas |
181 |
%> |