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