5630 |
13 May 11 |
nicklas |
1 |
<%-- $Id$ |
5630 |
13 May 11 |
nicklas |
2 |
------------------------------------------------------------------ |
5630 |
13 May 11 |
nicklas |
Copyright (C) 2011 Nicklas Nordborg |
5630 |
13 May 11 |
nicklas |
4 |
|
5630 |
13 May 11 |
nicklas |
5 |
This file is part of BASE - BioArray Software Environment. |
5630 |
13 May 11 |
nicklas |
6 |
Available at http://base.thep.lu.se/ |
5630 |
13 May 11 |
nicklas |
7 |
|
5630 |
13 May 11 |
nicklas |
8 |
BASE is free software; you can redistribute it and/or |
5630 |
13 May 11 |
nicklas |
9 |
modify it under the terms of the GNU General Public License |
5630 |
13 May 11 |
nicklas |
10 |
as published by the Free Software Foundation; either version 3 |
5630 |
13 May 11 |
nicklas |
11 |
of the License, or (at your option) any later version. |
5630 |
13 May 11 |
nicklas |
12 |
|
5630 |
13 May 11 |
nicklas |
13 |
BASE is distributed in the hope that it will be useful, |
5630 |
13 May 11 |
nicklas |
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5630 |
13 May 11 |
nicklas |
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5630 |
13 May 11 |
nicklas |
16 |
GNU General Public License for more details. |
5630 |
13 May 11 |
nicklas |
17 |
|
5630 |
13 May 11 |
nicklas |
18 |
You should have received a copy of the GNU General Public License |
5630 |
13 May 11 |
nicklas |
19 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
5630 |
13 May 11 |
nicklas |
20 |
------------------------------------------------------------------ |
5630 |
13 May 11 |
nicklas |
21 |
|
5630 |
13 May 11 |
nicklas |
22 |
@author Nicklas |
5630 |
13 May 11 |
nicklas |
23 |
@since 2.0 |
5630 |
13 May 11 |
nicklas |
24 |
--%> |
5630 |
13 May 11 |
nicklas |
25 |
<%@ page pageEncoding="UTF-8" session="false" |
5630 |
13 May 11 |
nicklas |
26 |
import="net.sf.basedb.core.SessionControl" |
5630 |
13 May 11 |
nicklas |
27 |
import="net.sf.basedb.core.DbControl" |
5630 |
13 May 11 |
nicklas |
28 |
import="net.sf.basedb.core.SystemItems" |
5630 |
13 May 11 |
nicklas |
29 |
import="net.sf.basedb.core.Include" |
5630 |
13 May 11 |
nicklas |
30 |
import="net.sf.basedb.core.Item" |
5630 |
13 May 11 |
nicklas |
31 |
import="net.sf.basedb.core.ItemContext" |
5630 |
13 May 11 |
nicklas |
32 |
import="net.sf.basedb.core.ItemQuery" |
5630 |
13 May 11 |
nicklas |
33 |
import="net.sf.basedb.core.ItemResultList" |
5630 |
13 May 11 |
nicklas |
34 |
import="net.sf.basedb.core.Permission" |
5630 |
13 May 11 |
nicklas |
35 |
import="net.sf.basedb.core.ItemSubtype" |
5698 |
15 Aug 11 |
nicklas |
36 |
import="net.sf.basedb.core.DataFileType" |
5713 |
02 Sep 11 |
nicklas |
37 |
import="net.sf.basedb.core.ItemSubtypeFileType" |
5630 |
13 May 11 |
nicklas |
38 |
import="net.sf.basedb.core.PermissionDeniedException" |
5630 |
13 May 11 |
nicklas |
39 |
import="net.sf.basedb.core.PluginDefinition" |
5630 |
13 May 11 |
nicklas |
40 |
import="net.sf.basedb.core.plugin.GuiContext" |
5630 |
13 May 11 |
nicklas |
41 |
import="net.sf.basedb.core.plugin.Plugin" |
5630 |
13 May 11 |
nicklas |
42 |
import="net.sf.basedb.core.query.Orders" |
5630 |
13 May 11 |
nicklas |
43 |
import="net.sf.basedb.core.query.Hql" |
5630 |
13 May 11 |
nicklas |
44 |
import="net.sf.basedb.clients.web.Base" |
5630 |
13 May 11 |
nicklas |
45 |
import="net.sf.basedb.clients.web.PermissionUtil" |
5630 |
13 May 11 |
nicklas |
46 |
import="net.sf.basedb.clients.web.util.HTML" |
5630 |
13 May 11 |
nicklas |
47 |
import="net.sf.basedb.util.Values" |
5630 |
13 May 11 |
nicklas |
48 |
import="net.sf.basedb.util.formatter.Formatter" |
5630 |
13 May 11 |
nicklas |
49 |
import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
5630 |
13 May 11 |
nicklas |
50 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
5630 |
13 May 11 |
nicklas |
51 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
5630 |
13 May 11 |
nicklas |
52 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
53 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
5630 |
13 May 11 |
nicklas |
54 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
5630 |
13 May 11 |
nicklas |
55 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
5630 |
13 May 11 |
nicklas |
56 |
import="java.util.Date" |
5630 |
13 May 11 |
nicklas |
57 |
import="java.util.Map" |
5630 |
13 May 11 |
nicklas |
58 |
%> |
5630 |
13 May 11 |
nicklas |
59 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
5630 |
13 May 11 |
nicklas |
60 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
5630 |
13 May 11 |
nicklas |
61 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
5630 |
13 May 11 |
nicklas |
62 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
5630 |
13 May 11 |
nicklas |
63 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
5630 |
13 May 11 |
nicklas |
64 |
<%! |
5630 |
13 May 11 |
nicklas |
65 |
private static final Item itemType = Item.ITEMSUBTYPE; |
5630 |
13 May 11 |
nicklas |
66 |
private static final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.ITEM); |
5630 |
13 May 11 |
nicklas |
67 |
%> |
5630 |
13 May 11 |
nicklas |
68 |
<% |
5630 |
13 May 11 |
nicklas |
69 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
5630 |
13 May 11 |
nicklas |
70 |
final String ID = sc.getId(); |
5630 |
13 May 11 |
nicklas |
71 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null); |
5630 |
13 May 11 |
nicklas |
72 |
final int itemId = cc.getId(); |
6289 |
05 Jun 13 |
nicklas |
73 |
final String tab = Values.getStringOrNull(request.getParameter("tab")); |
5630 |
13 May 11 |
nicklas |
74 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
75 |
final DbControl dc = sc.newDbControl(":View "+itemType); |
5630 |
13 May 11 |
nicklas |
76 |
try |
5630 |
13 May 11 |
nicklas |
77 |
{ |
5630 |
13 May 11 |
nicklas |
78 |
Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
5630 |
13 May 11 |
nicklas |
79 |
Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
5630 |
13 May 11 |
nicklas |
80 |
|
5630 |
13 May 11 |
nicklas |
81 |
String title = null; |
5630 |
13 May 11 |
nicklas |
82 |
ItemSubtype subtype = ItemSubtype.getById(dc, itemId); |
5630 |
13 May 11 |
nicklas |
83 |
|
5630 |
13 May 11 |
nicklas |
84 |
final boolean usePermission = subtype.hasPermission(Permission.USE); |
5630 |
13 May 11 |
nicklas |
85 |
final boolean writePermission = subtype.hasPermission(Permission.WRITE); |
5630 |
13 May 11 |
nicklas |
86 |
final boolean deletePermission = subtype.hasPermission(Permission.DELETE); |
5630 |
13 May 11 |
nicklas |
87 |
final boolean isRemoved = subtype.isRemoved(); |
5630 |
13 May 11 |
nicklas |
88 |
final boolean isUsed = isRemoved && subtype.isUsed(); |
5630 |
13 May 11 |
nicklas |
89 |
final boolean deletePermanentlyPermission = deletePermission && !isUsed; |
5630 |
13 May 11 |
nicklas |
90 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, subtype); |
7604 |
25 Feb 19 |
nicklas |
91 |
ExtensionsInvoker<ButtonAction> invoker = ToolbarUtil.useExtensions(jspContext); |
5630 |
13 May 11 |
nicklas |
92 |
%> |
6289 |
05 Jun 13 |
nicklas |
93 |
<base:page title="<%=title%>" id="view-page"> |
6289 |
05 Jun 13 |
nicklas |
94 |
<base:head scripts="tabcontrol-2.js,table.js,~subtypes.js" styles="toolbar.css,headertabcontrol.css,path.css,table.css"> |
5630 |
13 May 11 |
nicklas |
95 |
<ext:scripts context="<%=jspContext%>" /> |
5630 |
13 May 11 |
nicklas |
96 |
<ext:stylesheets context="<%=jspContext%>" /> |
5630 |
13 May 11 |
nicklas |
97 |
</base:head> |
5630 |
13 May 11 |
nicklas |
98 |
<base:body> |
5941 |
01 Feb 12 |
nicklas |
99 |
<p:path><p:pathelement |
5941 |
01 Feb 12 |
nicklas |
100 |
title="Item subtypes" href="<%="index.jsp?ID="+ID%>" |
5941 |
01 Feb 12 |
nicklas |
101 |
/><p:pathelement title="<%=HTML.encodeTags(subtype.getName())%>" |
5941 |
01 Feb 12 |
nicklas |
102 |
/></p:path> |
6289 |
05 Jun 13 |
nicklas |
103 |
<div id="page-data" data-item-id="<%=itemId%>"></div> |
5630 |
13 May 11 |
nicklas |
104 |
|
5941 |
01 Feb 12 |
nicklas |
105 |
<t:tabcontrol |
5941 |
01 Feb 12 |
nicklas |
106 |
id="main" |
5941 |
01 Feb 12 |
nicklas |
107 |
subclass="content mastertabcontrol" |
6289 |
05 Jun 13 |
nicklas |
108 |
active="<%=tab%>"> |
5630 |
13 May 11 |
nicklas |
109 |
<t:tab id="properties" title="Properties"> |
5941 |
01 Feb 12 |
nicklas |
110 |
<div> |
5941 |
01 Feb 12 |
nicklas |
111 |
<table class="fullform bottomborder"> |
5941 |
01 Feb 12 |
nicklas |
112 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
113 |
<th class="itemstatus"> |
5630 |
13 May 11 |
nicklas |
114 |
<base:icon |
6289 |
05 Jun 13 |
nicklas |
115 |
id="btnDeletePermanently" |
5946 |
03 Feb 12 |
nicklas |
116 |
image="deleted.png" |
5941 |
01 Feb 12 |
nicklas |
117 |
tooltip="This item has been flagged for deletion. Click to delete it now." |
5941 |
01 Feb 12 |
nicklas |
118 |
enabled="<%=deletePermanentlyPermission %>" |
5941 |
01 Feb 12 |
nicklas |
119 |
visible="<%=isRemoved%>" |
5941 |
01 Feb 12 |
nicklas |
120 |
/> |
6289 |
05 Jun 13 |
nicklas |
121 |
<base:icon |
6289 |
05 Jun 13 |
nicklas |
122 |
id="btnUsingItems" |
6289 |
05 Jun 13 |
nicklas |
123 |
image="used.png" |
5941 |
01 Feb 12 |
nicklas |
124 |
tooltip="This item is used by other items and can't be permanently deleted. Show the items that are using this one" |
5941 |
01 Feb 12 |
nicklas |
125 |
visible="<%=isRemoved && isUsed%>" /> |
5941 |
01 Feb 12 |
nicklas |
126 |
</th> |
5941 |
01 Feb 12 |
nicklas |
127 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
128 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5941 |
01 Feb 12 |
nicklas |
129 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
130 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
131 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
132 |
image="edit.png" |
5941 |
01 Feb 12 |
nicklas |
133 |
title="Edit…" |
5941 |
01 Feb 12 |
nicklas |
134 |
tooltip="<%=writePermission ? "Edit this item subtype" : "You do not have permission to edit this item subtype"%>" |
5941 |
01 Feb 12 |
nicklas |
135 |
/> |
5941 |
01 Feb 12 |
nicklas |
136 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
137 |
id="btnDelete" |
5942 |
01 Feb 12 |
nicklas |
138 |
disabled="<%=!deletePermission%>" |
5946 |
03 Feb 12 |
nicklas |
139 |
image="delete.png" |
5941 |
01 Feb 12 |
nicklas |
140 |
title="Delete" |
5941 |
01 Feb 12 |
nicklas |
141 |
visible="<%=!subtype.isRemoved()%>" |
5941 |
01 Feb 12 |
nicklas |
142 |
tooltip="<%=deletePermission ? "Delete this item subtype" : "You do not have permission to delete this item subtype"%>" |
5941 |
01 Feb 12 |
nicklas |
143 |
/> |
5941 |
01 Feb 12 |
nicklas |
144 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
145 |
id="btnRestore" |
5942 |
01 Feb 12 |
nicklas |
146 |
disabled="<%=!writePermission%>" |
5946 |
03 Feb 12 |
nicklas |
147 |
image="restore.png" |
5941 |
01 Feb 12 |
nicklas |
148 |
title="Restore" |
5941 |
01 Feb 12 |
nicklas |
149 |
visible="<%=subtype.isRemoved()%>" |
5941 |
01 Feb 12 |
nicklas |
150 |
tooltip="<%=writePermission ? "Restore this item subtype" : "You do not have permission to restore this item subtype"%>" |
5941 |
01 Feb 12 |
nicklas |
151 |
/> |
5941 |
01 Feb 12 |
nicklas |
152 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
153 |
id="btnImport" |
6289 |
05 Jun 13 |
nicklas |
154 |
image="import.png" |
6289 |
05 Jun 13 |
nicklas |
155 |
data-plugin-type="IMPORT" |
6289 |
05 Jun 13 |
nicklas |
156 |
title="Import…" |
6289 |
05 Jun 13 |
nicklas |
157 |
tooltip="Import data" |
6289 |
05 Jun 13 |
nicklas |
158 |
visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
6289 |
05 Jun 13 |
nicklas |
159 |
/> |
6289 |
05 Jun 13 |
nicklas |
160 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
161 |
id="btnExport" |
6289 |
05 Jun 13 |
nicklas |
162 |
image="export.png" |
6289 |
05 Jun 13 |
nicklas |
163 |
data-plugin-type="EXPORT" |
5941 |
01 Feb 12 |
nicklas |
164 |
title="Export…" |
5941 |
01 Feb 12 |
nicklas |
165 |
tooltip="Export data" |
5941 |
01 Feb 12 |
nicklas |
166 |
visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
5941 |
01 Feb 12 |
nicklas |
167 |
/> |
5941 |
01 Feb 12 |
nicklas |
168 |
<tbl:button |
6289 |
05 Jun 13 |
nicklas |
169 |
id="btnRunPlugin" |
6289 |
05 Jun 13 |
nicklas |
170 |
image="runplugin.png" |
6289 |
05 Jun 13 |
nicklas |
171 |
data-plugin-type="OTHER" |
5941 |
01 Feb 12 |
nicklas |
172 |
title="Run plugin…" |
5941 |
01 Feb 12 |
nicklas |
173 |
tooltip="Run a plugin" |
5941 |
01 Feb 12 |
nicklas |
174 |
visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
5941 |
01 Feb 12 |
nicklas |
175 |
/> |
5941 |
01 Feb 12 |
nicklas |
176 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
177 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5941 |
01 Feb 12 |
nicklas |
178 |
<tbl:button |
5941 |
01 Feb 12 |
nicklas |
179 |
image="help.png" |
6289 |
05 Jun 13 |
nicklas |
180 |
subclass="auto-init" |
6289 |
05 Jun 13 |
nicklas |
181 |
data-auto-init="help" |
6289 |
05 Jun 13 |
nicklas |
182 |
data-help-id="itemsubtype.view.properties" |
5941 |
01 Feb 12 |
nicklas |
183 |
title="Help…" |
5941 |
01 Feb 12 |
nicklas |
184 |
tooltip="Get help about this page" |
5941 |
01 Feb 12 |
nicklas |
185 |
/> |
5941 |
01 Feb 12 |
nicklas |
186 |
</tbl:toolbar> |
5941 |
01 Feb 12 |
nicklas |
187 |
</td> |
5941 |
01 Feb 12 |
nicklas |
188 |
</tr> |
5630 |
13 May 11 |
nicklas |
189 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
190 |
<th>Name</th> |
5630 |
13 May 11 |
nicklas |
191 |
<td><%=HTML.encodeTags(subtype.getName())%></td> |
5630 |
13 May 11 |
nicklas |
192 |
</tr> |
5630 |
13 May 11 |
nicklas |
193 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
194 |
<th>Main item type</th> |
5630 |
13 May 11 |
nicklas |
195 |
<td><%=subtype.getMainItemType()%></td> |
5630 |
13 May 11 |
nicklas |
196 |
</tr> |
5630 |
13 May 11 |
nicklas |
197 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
198 |
<th>Registered</th> |
5630 |
13 May 11 |
nicklas |
199 |
<td><%=dateFormatter.format(subtype.getEntryDate())%></td> |
5630 |
13 May 11 |
nicklas |
200 |
</tr> |
5630 |
13 May 11 |
nicklas |
201 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
202 |
<th>System ID</th> |
5630 |
13 May 11 |
nicklas |
203 |
<td><%=HTML.encodeTags(subtype.getSystemId())%></td> |
5630 |
13 May 11 |
nicklas |
204 |
</tr> |
5630 |
13 May 11 |
nicklas |
205 |
<tr> |
5983 |
23 Feb 12 |
nicklas |
206 |
<th>Push annotations to parent</th> |
5983 |
23 Feb 12 |
nicklas |
207 |
<td><%=subtype.getPushAnnotations()%></td> |
5983 |
23 Feb 12 |
nicklas |
208 |
</tr> |
5983 |
23 Feb 12 |
nicklas |
209 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
210 |
<th>Permissions</th> |
5941 |
01 Feb 12 |
nicklas |
211 |
<td><%=PermissionUtil.getFullPermissionNames(subtype)%></td> |
5941 |
01 Feb 12 |
nicklas |
212 |
</tr> |
5941 |
01 Feb 12 |
nicklas |
213 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
214 |
<th>Description</th> |
5630 |
13 May 11 |
nicklas |
215 |
<td><%=HTML.niceFormat(subtype.getDescription())%></td> |
5630 |
13 May 11 |
nicklas |
216 |
</tr> |
5631 |
16 May 11 |
nicklas |
217 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
218 |
<th>Related subtypes</th> |
5631 |
16 May 11 |
nicklas |
219 |
<td></td> |
5631 |
16 May 11 |
nicklas |
220 |
</tr> |
5631 |
16 May 11 |
nicklas |
221 |
<% |
5631 |
16 May 11 |
nicklas |
222 |
for (Item relatedItem : ItemSubtype.getRelatedItems(subtype.getMainItemType())) |
5631 |
16 May 11 |
nicklas |
223 |
{ |
5631 |
16 May 11 |
nicklas |
224 |
ItemSubtype related = null; |
5631 |
16 May 11 |
nicklas |
225 |
boolean deniedRelated = false; |
5631 |
16 May 11 |
nicklas |
226 |
try |
5631 |
16 May 11 |
nicklas |
227 |
{ |
5631 |
16 May 11 |
nicklas |
228 |
related = subtype.getRelatedSubtype(relatedItem); |
5631 |
16 May 11 |
nicklas |
229 |
} |
5631 |
16 May 11 |
nicklas |
230 |
catch (PermissionDeniedException ex) |
5631 |
16 May 11 |
nicklas |
231 |
{ |
5631 |
16 May 11 |
nicklas |
232 |
deniedRelated = true; |
5631 |
16 May 11 |
nicklas |
233 |
} |
5631 |
16 May 11 |
nicklas |
234 |
%> |
5631 |
16 May 11 |
nicklas |
235 |
<tr> |
5941 |
01 Feb 12 |
nicklas |
236 |
<th class="subprompt">- <%=relatedItem%></th> |
5631 |
16 May 11 |
nicklas |
237 |
<td><%=Base.getLinkedName(ID, related, deniedRelated, true)%></td> |
5631 |
16 May 11 |
nicklas |
238 |
</tr> |
5631 |
16 May 11 |
nicklas |
239 |
<% |
5631 |
16 May 11 |
nicklas |
240 |
} |
5631 |
16 May 11 |
nicklas |
241 |
%> |
5630 |
13 May 11 |
nicklas |
242 |
</table> |
5941 |
01 Feb 12 |
nicklas |
243 |
</div> |
5630 |
13 May 11 |
nicklas |
244 |
|
5645 |
27 May 11 |
nicklas |
245 |
<% |
5645 |
27 May 11 |
nicklas |
246 |
ItemQuery<ItemSubtype> parentQuery = subtype.getParentSubtypes(); |
5645 |
27 May 11 |
nicklas |
247 |
parentQuery.include(Include.ALL); |
5645 |
27 May 11 |
nicklas |
248 |
parentQuery.order(Orders.asc(Hql.property("name"))); |
5645 |
27 May 11 |
nicklas |
249 |
ItemResultList<ItemSubtype> parents = parentQuery.list(dc); |
5941 |
01 Feb 12 |
nicklas |
250 |
%> |
5941 |
01 Feb 12 |
nicklas |
251 |
<base:section |
5941 |
01 Feb 12 |
nicklas |
252 |
id="parents" |
5941 |
01 Feb 12 |
nicklas |
253 |
title="<%="Subtypes with relation to this subtype (" + parents.size() + ")"%>" |
5941 |
01 Feb 12 |
nicklas |
254 |
context="<%=cc%>" |
5941 |
01 Feb 12 |
nicklas |
255 |
> |
5645 |
27 May 11 |
nicklas |
256 |
<% |
5941 |
01 Feb 12 |
nicklas |
257 |
if (parents.size() == 0) |
5941 |
01 Feb 12 |
nicklas |
258 |
{ |
5941 |
01 Feb 12 |
nicklas |
259 |
%> |
5941 |
01 Feb 12 |
nicklas |
260 |
<div class="messagecontainer note"> |
5941 |
01 Feb 12 |
nicklas |
261 |
There are no subtypes (or, you don't have permission to view them). |
5941 |
01 Feb 12 |
nicklas |
262 |
</div> |
5941 |
01 Feb 12 |
nicklas |
263 |
<% |
5941 |
01 Feb 12 |
nicklas |
264 |
} |
5941 |
01 Feb 12 |
nicklas |
265 |
else |
5941 |
01 Feb 12 |
nicklas |
266 |
{ |
5941 |
01 Feb 12 |
nicklas |
267 |
%> |
5645 |
27 May 11 |
nicklas |
268 |
<tbl:table |
6149 |
25 Sep 12 |
nicklas |
269 |
id="tbl.parents" |
5645 |
27 May 11 |
nicklas |
270 |
columns="all" |
5645 |
27 May 11 |
nicklas |
271 |
> |
5645 |
27 May 11 |
nicklas |
272 |
<tbl:columndef |
5645 |
27 May 11 |
nicklas |
273 |
id="name" |
5645 |
27 May 11 |
nicklas |
274 |
title="Name" |
5645 |
27 May 11 |
nicklas |
275 |
/> |
5645 |
27 May 11 |
nicklas |
276 |
<tbl:columndef |
5645 |
27 May 11 |
nicklas |
277 |
id="mainType" |
5645 |
27 May 11 |
nicklas |
278 |
title="Main item type" |
5645 |
27 May 11 |
nicklas |
279 |
/> |
5645 |
27 May 11 |
nicklas |
280 |
<tbl:columndef |
5645 |
27 May 11 |
nicklas |
281 |
id="description" |
5645 |
27 May 11 |
nicklas |
282 |
title="Description" |
5645 |
27 May 11 |
nicklas |
283 |
/> |
5645 |
27 May 11 |
nicklas |
284 |
<tbl:data> |
5941 |
01 Feb 12 |
nicklas |
285 |
<tbl:headers> |
5941 |
01 Feb 12 |
nicklas |
286 |
<tbl:headerrow> |
5941 |
01 Feb 12 |
nicklas |
287 |
<tbl:columnheaders /> |
5941 |
01 Feb 12 |
nicklas |
288 |
</tbl:headerrow> |
5941 |
01 Feb 12 |
nicklas |
289 |
</tbl:headers> |
5645 |
27 May 11 |
nicklas |
290 |
<tbl:rows> |
5645 |
27 May 11 |
nicklas |
291 |
<% |
5645 |
27 May 11 |
nicklas |
292 |
for (ItemSubtype parent : parents) |
5645 |
27 May 11 |
nicklas |
293 |
{ |
5645 |
27 May 11 |
nicklas |
294 |
%> |
5645 |
27 May 11 |
nicklas |
295 |
<tbl:row> |
5645 |
27 May 11 |
nicklas |
296 |
<tbl:cell column="name"><base:icon |
5946 |
03 Feb 12 |
nicklas |
297 |
image="deleted.png" |
5645 |
27 May 11 |
nicklas |
298 |
tooltip="This item has been scheduled for deletion" |
5645 |
27 May 11 |
nicklas |
299 |
visible="<%=parent.isRemoved()%>" |
5645 |
27 May 11 |
nicklas |
300 |
/><%=Base.getLinkedName(ID, parent, false, true)%></tbl:cell> |
5645 |
27 May 11 |
nicklas |
301 |
<tbl:cell column="mainType"><%=parent.getMainItemType() %></tbl:cell> |
5645 |
27 May 11 |
nicklas |
302 |
<tbl:cell column="description"><%=HTML.encodeTags(parent.getDescription())%></tbl:cell> |
5645 |
27 May 11 |
nicklas |
303 |
</tbl:row> |
5645 |
27 May 11 |
nicklas |
304 |
<% |
5645 |
27 May 11 |
nicklas |
305 |
} |
5645 |
27 May 11 |
nicklas |
306 |
%> |
5645 |
27 May 11 |
nicklas |
307 |
</tbl:rows> |
5645 |
27 May 11 |
nicklas |
308 |
</tbl:data> |
5645 |
27 May 11 |
nicklas |
309 |
</tbl:table> |
5941 |
01 Feb 12 |
nicklas |
310 |
<% |
5941 |
01 Feb 12 |
nicklas |
311 |
} |
5941 |
01 Feb 12 |
nicklas |
312 |
%> |
5941 |
01 Feb 12 |
nicklas |
313 |
</base:section> |
5645 |
27 May 11 |
nicklas |
314 |
|
5698 |
15 Aug 11 |
nicklas |
315 |
<% |
5713 |
02 Sep 11 |
nicklas |
316 |
ItemQuery<ItemSubtypeFileType> fileTypeQuery = subtype.getDataFileTypes(); |
5698 |
15 Aug 11 |
nicklas |
317 |
fileTypeQuery.include(Include.ALL); |
5713 |
02 Sep 11 |
nicklas |
318 |
fileTypeQuery.order(Orders.asc(Hql.property("itemSubtype.name"))); |
5713 |
02 Sep 11 |
nicklas |
319 |
ItemResultList<ItemSubtypeFileType> fileTypes = fileTypeQuery.list(dc); |
5941 |
01 Feb 12 |
nicklas |
320 |
%> |
5941 |
01 Feb 12 |
nicklas |
321 |
<base:section |
5941 |
01 Feb 12 |
nicklas |
322 |
id="fileTypes" |
5941 |
01 Feb 12 |
nicklas |
323 |
title="<%="File types associated with this subtype (" + fileTypes.size() + ")"%>" |
5941 |
01 Feb 12 |
nicklas |
324 |
context="<%=cc%>" |
5941 |
01 Feb 12 |
nicklas |
325 |
> |
5698 |
15 Aug 11 |
nicklas |
326 |
<% |
5941 |
01 Feb 12 |
nicklas |
327 |
if (fileTypes.size() == 0) |
5941 |
01 Feb 12 |
nicklas |
328 |
{ |
5941 |
01 Feb 12 |
nicklas |
329 |
%> |
5941 |
01 Feb 12 |
nicklas |
330 |
<div class="messagecontainer note"> |
5941 |
01 Feb 12 |
nicklas |
331 |
There are no file types (or, you don't have permission to view them). |
5941 |
01 Feb 12 |
nicklas |
332 |
</div> |
5941 |
01 Feb 12 |
nicklas |
333 |
<% |
5941 |
01 Feb 12 |
nicklas |
334 |
} |
5941 |
01 Feb 12 |
nicklas |
335 |
else |
5941 |
01 Feb 12 |
nicklas |
336 |
{ |
5941 |
01 Feb 12 |
nicklas |
337 |
%> |
5698 |
15 Aug 11 |
nicklas |
338 |
<tbl:table |
6149 |
25 Sep 12 |
nicklas |
339 |
id="tbl.fileTypes" |
5698 |
15 Aug 11 |
nicklas |
340 |
columns="all" |
5698 |
15 Aug 11 |
nicklas |
341 |
> |
5698 |
15 Aug 11 |
nicklas |
342 |
<tbl:columndef |
5698 |
15 Aug 11 |
nicklas |
343 |
id="name" |
5698 |
15 Aug 11 |
nicklas |
344 |
title="Name" |
5698 |
15 Aug 11 |
nicklas |
345 |
/> |
5698 |
15 Aug 11 |
nicklas |
346 |
<tbl:columndef |
5698 |
15 Aug 11 |
nicklas |
347 |
id="extension" |
5698 |
15 Aug 11 |
nicklas |
348 |
title="File extension" |
5698 |
15 Aug 11 |
nicklas |
349 |
/> |
5698 |
15 Aug 11 |
nicklas |
350 |
<tbl:columndef |
5713 |
02 Sep 11 |
nicklas |
351 |
id="required" |
5713 |
02 Sep 11 |
nicklas |
352 |
title="Required" |
5713 |
02 Sep 11 |
nicklas |
353 |
/> |
5713 |
02 Sep 11 |
nicklas |
354 |
<tbl:columndef |
5713 |
02 Sep 11 |
nicklas |
355 |
id="multiple" |
5713 |
02 Sep 11 |
nicklas |
356 |
title="Multiple files" |
5713 |
02 Sep 11 |
nicklas |
357 |
/> |
5713 |
02 Sep 11 |
nicklas |
358 |
<tbl:columndef |
5713 |
02 Sep 11 |
nicklas |
359 |
id="genericType" |
5713 |
02 Sep 11 |
nicklas |
360 |
title="Generic type" |
5713 |
02 Sep 11 |
nicklas |
361 |
/> |
5713 |
02 Sep 11 |
nicklas |
362 |
<tbl:columndef |
5698 |
15 Aug 11 |
nicklas |
363 |
id="description" |
5698 |
15 Aug 11 |
nicklas |
364 |
title="Description" |
5698 |
15 Aug 11 |
nicklas |
365 |
/> |
5698 |
15 Aug 11 |
nicklas |
366 |
<tbl:data> |
5941 |
01 Feb 12 |
nicklas |
367 |
<tbl:headers> |
5941 |
01 Feb 12 |
nicklas |
368 |
<tbl:headerrow> |
5941 |
01 Feb 12 |
nicklas |
369 |
<tbl:columnheaders /> |
5941 |
01 Feb 12 |
nicklas |
370 |
</tbl:headerrow> |
5941 |
01 Feb 12 |
nicklas |
371 |
</tbl:headers> |
5698 |
15 Aug 11 |
nicklas |
372 |
<tbl:rows> |
5698 |
15 Aug 11 |
nicklas |
373 |
<% |
5713 |
02 Sep 11 |
nicklas |
374 |
for (ItemSubtypeFileType fileType : fileTypes) |
5698 |
15 Aug 11 |
nicklas |
375 |
{ |
5713 |
02 Sep 11 |
nicklas |
376 |
DataFileType dft = fileType.getDataFileType(); |
5698 |
15 Aug 11 |
nicklas |
377 |
%> |
5698 |
15 Aug 11 |
nicklas |
378 |
<tbl:row> |
5698 |
15 Aug 11 |
nicklas |
379 |
<tbl:cell column="name"><base:icon |
5946 |
03 Feb 12 |
nicklas |
380 |
image="deleted.png" |
5698 |
15 Aug 11 |
nicklas |
381 |
tooltip="This item has been scheduled for deletion" |
5713 |
02 Sep 11 |
nicklas |
382 |
visible="<%=dft.isRemoved()%>" |
5713 |
02 Sep 11 |
nicklas |
383 |
/><%=Base.getLinkedName(ID, dft, false, true)%></tbl:cell> |
5713 |
02 Sep 11 |
nicklas |
384 |
<tbl:cell column="extension"><%=HTML.encodeTags(dft.getExtension()) %></tbl:cell> |
5713 |
02 Sep 11 |
nicklas |
385 |
<tbl:cell column="required"><%=fileType.isRequired() ? "yes" : "no"%></tbl:cell> |
5713 |
02 Sep 11 |
nicklas |
386 |
<tbl:cell column="multiple"><%=fileType.getAllowMultiple() ? "yes" : "no"%></tbl:cell> |
5713 |
02 Sep 11 |
nicklas |
387 |
<tbl:cell column="genericType"><base:propertyvalue item="<%=dft%>" property="genericType" /></tbl:cell> |
5713 |
02 Sep 11 |
nicklas |
388 |
<tbl:cell column="description"><%=HTML.encodeTags(dft.getDescription())%></tbl:cell> |
5698 |
15 Aug 11 |
nicklas |
389 |
</tbl:row> |
5698 |
15 Aug 11 |
nicklas |
390 |
<% |
5698 |
15 Aug 11 |
nicklas |
391 |
} |
5698 |
15 Aug 11 |
nicklas |
392 |
%> |
5698 |
15 Aug 11 |
nicklas |
393 |
</tbl:rows> |
5698 |
15 Aug 11 |
nicklas |
394 |
</tbl:data> |
5698 |
15 Aug 11 |
nicklas |
395 |
</tbl:table> |
5941 |
01 Feb 12 |
nicklas |
396 |
<% |
5941 |
01 Feb 12 |
nicklas |
397 |
} |
5941 |
01 Feb 12 |
nicklas |
398 |
%> |
5941 |
01 Feb 12 |
nicklas |
399 |
</base:section> |
5630 |
13 May 11 |
nicklas |
400 |
<jsp:include page="../../common/anytoany/list_anytoany.jsp"> |
5630 |
13 May 11 |
nicklas |
401 |
<jsp:param name="ID" value="<%=ID%>" /> |
5630 |
13 May 11 |
nicklas |
402 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5630 |
13 May 11 |
nicklas |
403 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5630 |
13 May 11 |
nicklas |
404 |
<jsp:param name="title" value="Other items related to this item subtype" /> |
5630 |
13 May 11 |
nicklas |
405 |
</jsp:include> |
5630 |
13 May 11 |
nicklas |
406 |
</t:tab> |
5941 |
01 Feb 12 |
nicklas |
407 |
</t:tabcontrol> |
5630 |
13 May 11 |
nicklas |
408 |
</base:body> |
5630 |
13 May 11 |
nicklas |
409 |
</base:page> |
5630 |
13 May 11 |
nicklas |
410 |
<% |
5630 |
13 May 11 |
nicklas |
411 |
} |
5630 |
13 May 11 |
nicklas |
412 |
finally |
5630 |
13 May 11 |
nicklas |
413 |
{ |
5630 |
13 May 11 |
nicklas |
414 |
if (dc != null) dc.close(); |
5630 |
13 May 11 |
nicklas |
415 |
} |
5630 |
13 May 11 |
nicklas |
416 |
|
5630 |
13 May 11 |
nicklas |
417 |
%> |