2894 |
10 Nov 06 |
nicklas |
1 |
<%-- $Id$ |
2894 |
10 Nov 06 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2006 Nicklas Nordborg |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Martin Svensson |
2894 |
10 Nov 06 |
nicklas |
5 |
|
2894 |
10 Nov 06 |
nicklas |
6 |
This file is part of BASE - BioArray Software Environment. |
2894 |
10 Nov 06 |
nicklas |
7 |
Available at http://base.thep.lu.se/ |
2894 |
10 Nov 06 |
nicklas |
8 |
|
2894 |
10 Nov 06 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
2894 |
10 Nov 06 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
2894 |
10 Nov 06 |
nicklas |
12 |
of the License, or (at your option) any later version. |
2894 |
10 Nov 06 |
nicklas |
13 |
|
2894 |
10 Nov 06 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
2894 |
10 Nov 06 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2894 |
10 Nov 06 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2894 |
10 Nov 06 |
nicklas |
17 |
GNU General Public License for more details. |
2894 |
10 Nov 06 |
nicklas |
18 |
|
2894 |
10 Nov 06 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4511 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
2894 |
10 Nov 06 |
nicklas |
21 |
------------------------------------------------------------------ |
2894 |
10 Nov 06 |
nicklas |
22 |
|
2894 |
10 Nov 06 |
nicklas |
23 |
@author Nicklas |
2894 |
10 Nov 06 |
nicklas |
24 |
@version 2.0 |
2894 |
10 Nov 06 |
nicklas |
25 |
--%> |
5426 |
24 Sep 10 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
2894 |
10 Nov 06 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl" |
2894 |
10 Nov 06 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
2894 |
10 Nov 06 |
nicklas |
29 |
import="net.sf.basedb.core.SystemItems" |
2894 |
10 Nov 06 |
nicklas |
30 |
import="net.sf.basedb.core.BasicItem" |
2894 |
10 Nov 06 |
nicklas |
31 |
import="net.sf.basedb.core.Removable" |
2894 |
10 Nov 06 |
nicklas |
32 |
import="net.sf.basedb.core.Shareable" |
2894 |
10 Nov 06 |
nicklas |
33 |
import="net.sf.basedb.core.Nameable" |
7110 |
15 Mar 16 |
nicklas |
34 |
import="net.sf.basedb.core.Annotation" |
2894 |
10 Nov 06 |
nicklas |
35 |
import="net.sf.basedb.core.File" |
2894 |
10 Nov 06 |
nicklas |
36 |
import="net.sf.basedb.core.Directory" |
3548 |
04 Jul 07 |
martin |
37 |
import="net.sf.basedb.core.Group" |
2894 |
10 Nov 06 |
nicklas |
38 |
import="net.sf.basedb.core.Item" |
2894 |
10 Nov 06 |
nicklas |
39 |
import="net.sf.basedb.core.ItemProxy" |
2894 |
10 Nov 06 |
nicklas |
40 |
import="net.sf.basedb.core.ItemContext" |
3548 |
04 Jul 07 |
martin |
41 |
import="net.sf.basedb.core.ItemResultIterator" |
3548 |
04 Jul 07 |
martin |
42 |
import="net.sf.basedb.core.MultiPermissions" |
2894 |
10 Nov 06 |
nicklas |
43 |
import="net.sf.basedb.core.Permission" |
3548 |
04 Jul 07 |
martin |
44 |
import="net.sf.basedb.core.Project" |
2894 |
10 Nov 06 |
nicklas |
45 |
import="net.sf.basedb.core.Session" |
2894 |
10 Nov 06 |
nicklas |
46 |
import="net.sf.basedb.core.User" |
2894 |
10 Nov 06 |
nicklas |
47 |
import="net.sf.basedb.core.Client" |
2894 |
10 Nov 06 |
nicklas |
48 |
import="net.sf.basedb.core.PermissionDeniedException" |
2894 |
10 Nov 06 |
nicklas |
49 |
import="net.sf.basedb.core.PluginDefinition" |
2894 |
10 Nov 06 |
nicklas |
50 |
import="net.sf.basedb.core.plugin.GuiContext" |
2894 |
10 Nov 06 |
nicklas |
51 |
import="net.sf.basedb.core.plugin.Plugin" |
3548 |
04 Jul 07 |
martin |
52 |
import="net.sf.basedb.core.SharedItem" |
2894 |
10 Nov 06 |
nicklas |
53 |
import="net.sf.basedb.clients.web.Base" |
2894 |
10 Nov 06 |
nicklas |
54 |
import="net.sf.basedb.clients.web.PermissionUtil" |
2894 |
10 Nov 06 |
nicklas |
55 |
import="net.sf.basedb.clients.web.util.HTML" |
2894 |
10 Nov 06 |
nicklas |
56 |
import="net.sf.basedb.util.Values" |
4887 |
06 Apr 09 |
nicklas |
57 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4887 |
06 Apr 09 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4887 |
06 Apr 09 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
60 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
4887 |
06 Apr 09 |
nicklas |
61 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
4887 |
06 Apr 09 |
nicklas |
62 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
3548 |
04 Jul 07 |
martin |
63 |
import="java.util.Collections" |
2894 |
10 Nov 06 |
nicklas |
64 |
import="java.util.Date" |
2894 |
10 Nov 06 |
nicklas |
65 |
import="java.util.Map" |
2894 |
10 Nov 06 |
nicklas |
66 |
import="java.util.Set" |
2894 |
10 Nov 06 |
nicklas |
67 |
import="java.util.List" |
2894 |
10 Nov 06 |
nicklas |
68 |
%> |
2894 |
10 Nov 06 |
nicklas |
69 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2894 |
10 Nov 06 |
nicklas |
70 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
2894 |
10 Nov 06 |
nicklas |
71 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
2894 |
10 Nov 06 |
nicklas |
72 |
<%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
4887 |
06 Apr 09 |
nicklas |
73 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
2894 |
10 Nov 06 |
nicklas |
74 |
<% |
2894 |
10 Nov 06 |
nicklas |
75 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
2894 |
10 Nov 06 |
nicklas |
76 |
final String ID = sc.getId(); |
2894 |
10 Nov 06 |
nicklas |
77 |
final int itemId = Values.getInt(request.getParameter("item_id")); |
2894 |
10 Nov 06 |
nicklas |
78 |
final Item itemType = Item.valueOf(request.getParameter("item_type")); |
5938 |
27 Jan 12 |
nicklas |
79 |
final ItemContext cc = sc.getCurrentContext(Item.SYSTEM, "trashcan"); |
7954 |
12 May 21 |
nicklas |
80 |
final DbControl dc = sc.newDbControl(":View "+itemType+" in trashcan"); |
2894 |
10 Nov 06 |
nicklas |
81 |
try |
2894 |
10 Nov 06 |
nicklas |
82 |
{ |
2894 |
10 Nov 06 |
nicklas |
83 |
BasicItem item = itemType.getById(dc, itemId); |
2894 |
10 Nov 06 |
nicklas |
84 |
Set<ItemProxy> usingItems = item.getUsingItems(); |
2894 |
10 Nov 06 |
nicklas |
85 |
final boolean isUsed = usingItems != null && usingItems.size() > 0; |
2894 |
10 Nov 06 |
nicklas |
86 |
final boolean writePermission = item.hasPermission(Permission.WRITE); |
2894 |
10 Nov 06 |
nicklas |
87 |
final boolean deletePermission = item.hasPermission(Permission.DELETE); |
2894 |
10 Nov 06 |
nicklas |
88 |
final boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
2894 |
10 Nov 06 |
nicklas |
89 |
final Shareable shareable = item instanceof Shareable ? (Shareable)item : null; |
2894 |
10 Nov 06 |
nicklas |
90 |
final boolean isShared = shareable != null && shareable.isShared(); |
2894 |
10 Nov 06 |
nicklas |
91 |
final Removable removable = item instanceof Removable ? (Removable)item : null; |
2894 |
10 Nov 06 |
nicklas |
92 |
final boolean isRemoved = removable != null && removable.isRemoved(); |
2894 |
10 Nov 06 |
nicklas |
93 |
String name = ""; |
2894 |
10 Nov 06 |
nicklas |
94 |
String description = ""; |
2894 |
10 Nov 06 |
nicklas |
95 |
if (item instanceof File) |
2894 |
10 Nov 06 |
nicklas |
96 |
{ |
2894 |
10 Nov 06 |
nicklas |
97 |
File file = (File)item; |
2894 |
10 Nov 06 |
nicklas |
98 |
name = file.getPath().toString(); |
2894 |
10 Nov 06 |
nicklas |
99 |
description = file.getDescription(); |
2894 |
10 Nov 06 |
nicklas |
100 |
} |
2894 |
10 Nov 06 |
nicklas |
101 |
else if (item instanceof Directory) |
2894 |
10 Nov 06 |
nicklas |
102 |
{ |
2894 |
10 Nov 06 |
nicklas |
103 |
Directory dir = (Directory)item; |
2894 |
10 Nov 06 |
nicklas |
104 |
name = dir.getPath().toString(); |
2894 |
10 Nov 06 |
nicklas |
105 |
description = dir.getDescription(); |
2894 |
10 Nov 06 |
nicklas |
106 |
} |
2894 |
10 Nov 06 |
nicklas |
107 |
else if (item instanceof Nameable) |
2894 |
10 Nov 06 |
nicklas |
108 |
{ |
2894 |
10 Nov 06 |
nicklas |
109 |
Nameable nameable = (Nameable)item; |
2894 |
10 Nov 06 |
nicklas |
110 |
name = nameable.getName(); |
2894 |
10 Nov 06 |
nicklas |
111 |
description = nameable.getDescription(); |
2894 |
10 Nov 06 |
nicklas |
112 |
} |
2894 |
10 Nov 06 |
nicklas |
113 |
else |
2894 |
10 Nov 06 |
nicklas |
114 |
{ |
2894 |
10 Nov 06 |
nicklas |
115 |
name = item.toString(); |
2894 |
10 Nov 06 |
nicklas |
116 |
} |
2894 |
10 Nov 06 |
nicklas |
117 |
String link = Base.getLink(ID, HTML.encodeTags(name), item.getType(), itemId, writePermission); |
4887 |
06 Apr 09 |
nicklas |
118 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, null, item); |
7605 |
26 Feb 19 |
nicklas |
119 |
ExtensionsInvoker<ButtonAction> invoker = ExtensionsControl.useExtensions(jspContext, |
4887 |
06 Apr 09 |
nicklas |
120 |
"net.sf.basedb.clients.web.toolbar.item.all", |
4887 |
06 Apr 09 |
nicklas |
121 |
"net.sf.basedb.clients.web.toolbar.item.trashcan"); |
2894 |
10 Nov 06 |
nicklas |
122 |
%> |
6311 |
23 Aug 13 |
nicklas |
123 |
<base:page title="<%="Trashcan - " + HTML.encodeTags(name) %>" id="view-page"> |
6311 |
23 Aug 13 |
nicklas |
124 |
<base:head scripts="tabcontrol-2.js,table.js,~trash.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
4887 |
06 Apr 09 |
nicklas |
125 |
<ext:scripts context="<%=jspContext%>" /> |
4887 |
06 Apr 09 |
nicklas |
126 |
<ext:stylesheets context="<%=jspContext%>" /> |
2894 |
10 Nov 06 |
nicklas |
127 |
</base:head> |
2894 |
10 Nov 06 |
nicklas |
128 |
<base:body> |
5938 |
27 Jan 12 |
nicklas |
129 |
<p:path><p:pathelement title="Trashcan" href="<%="index.jsp?ID="+ID%>" |
5938 |
27 Jan 12 |
nicklas |
130 |
/><p:pathelement title="<%=itemType.toString() + ": " + HTML.encodeTags(name)%>" |
5938 |
27 Jan 12 |
nicklas |
131 |
/></p:path> |
6311 |
23 Aug 13 |
nicklas |
132 |
<div id="page-data" data-item-id="<%=itemId%>" data-item-type="<%=itemType.name()%>"></div> |
2894 |
10 Nov 06 |
nicklas |
133 |
|
5938 |
27 Jan 12 |
nicklas |
134 |
<t:tabcontrol id="main" subclass="content mastertabcontrol"> |
2894 |
10 Nov 06 |
nicklas |
135 |
<t:tab id="properties" title="Properties"> |
5938 |
27 Jan 12 |
nicklas |
136 |
<div> |
5938 |
27 Jan 12 |
nicklas |
137 |
<table class="fullform bottomborder"> |
5938 |
27 Jan 12 |
nicklas |
138 |
<tr> |
5938 |
27 Jan 12 |
nicklas |
139 |
<th class="itemstatus"> |
5938 |
27 Jan 12 |
nicklas |
140 |
<base:icon |
5946 |
03 Feb 12 |
nicklas |
141 |
image="shared.png" |
5938 |
27 Jan 12 |
nicklas |
142 |
visible="<%=isShared%>" |
5938 |
27 Jan 12 |
nicklas |
143 |
tooltip="This item is shared to other users, groups and/or projects" |
5938 |
27 Jan 12 |
nicklas |
144 |
/> |
5938 |
27 Jan 12 |
nicklas |
145 |
<base:icon |
5946 |
03 Feb 12 |
nicklas |
146 |
image="deleted.png" |
5938 |
27 Jan 12 |
nicklas |
147 |
tooltip="This item has been flagged for deletion." |
5938 |
27 Jan 12 |
nicklas |
148 |
visible="<%=isRemoved%>" |
5938 |
27 Jan 12 |
nicklas |
149 |
/> |
6311 |
23 Aug 13 |
nicklas |
150 |
<base:icon |
6311 |
23 Aug 13 |
nicklas |
151 |
image="used.png" |
6311 |
23 Aug 13 |
nicklas |
152 |
tooltip="This item is used by other items and can't be permanently deleted." |
5938 |
27 Jan 12 |
nicklas |
153 |
visible="<%=isUsed%>" /> |
5938 |
27 Jan 12 |
nicklas |
154 |
</th> |
5938 |
27 Jan 12 |
nicklas |
155 |
<td style="padding: 0px;"> |
6605 |
18 Nov 14 |
nicklas |
156 |
<tbl:toolbar subclass="bottomborder bg-filled-50"> |
5938 |
27 Jan 12 |
nicklas |
157 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
158 |
id="btnEdit" |
5942 |
01 Feb 12 |
nicklas |
159 |
disabled="<%=!writePermission%>" |
5945 |
02 Feb 12 |
nicklas |
160 |
image="edit.png" |
5938 |
27 Jan 12 |
nicklas |
161 |
title="Edit…" |
5938 |
27 Jan 12 |
nicklas |
162 |
tooltip="<%=writePermission ? "Edit this item" : "You do not have permission to edit this item"%>" |
5938 |
27 Jan 12 |
nicklas |
163 |
/> |
5938 |
27 Jan 12 |
nicklas |
164 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
165 |
id="btnDeleteItem" |
5942 |
01 Feb 12 |
nicklas |
166 |
disabled="<%=!deletePermission%>" |
5945 |
02 Feb 12 |
nicklas |
167 |
image="delete_permanently.png" |
5938 |
27 Jan 12 |
nicklas |
168 |
title="Delete permanently…" |
5938 |
27 Jan 12 |
nicklas |
169 |
visible="<%=!isUsed%>" |
5938 |
27 Jan 12 |
nicklas |
170 |
tooltip="<%=deletePermission ? "Permanently delete this item" : "You do not have permission to delete this item"%>" |
5938 |
27 Jan 12 |
nicklas |
171 |
/> |
5938 |
27 Jan 12 |
nicklas |
172 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
173 |
id="btnRestore" |
5942 |
01 Feb 12 |
nicklas |
174 |
disabled="<%=!writePermission%>" |
5946 |
03 Feb 12 |
nicklas |
175 |
image="restore.png" |
5938 |
27 Jan 12 |
nicklas |
176 |
title="Restore" |
5938 |
27 Jan 12 |
nicklas |
177 |
visible="<%=isRemoved%>" |
5938 |
27 Jan 12 |
nicklas |
178 |
tooltip="<%=writePermission ? "Restore this item" : "You do not have permission to restore this item"%>" |
5938 |
27 Jan 12 |
nicklas |
179 |
/> |
6311 |
23 Aug 13 |
nicklas |
180 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
181 |
id="btnShare" |
5942 |
01 Feb 12 |
nicklas |
182 |
disabled="<%=!sharePermission%>" |
5945 |
02 Feb 12 |
nicklas |
183 |
image="share.png" |
5938 |
27 Jan 12 |
nicklas |
184 |
title="Share…" |
5938 |
27 Jan 12 |
nicklas |
185 |
visible="<%=shareable != null%>" |
5938 |
27 Jan 12 |
nicklas |
186 |
tooltip="<%=sharePermission ? "Share this item to other user, groups and projects" : "You do not have permission to share this scan"%>" |
5938 |
27 Jan 12 |
nicklas |
187 |
/> |
5938 |
27 Jan 12 |
nicklas |
188 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
189 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5938 |
27 Jan 12 |
nicklas |
190 |
<tbl:button |
5938 |
27 Jan 12 |
nicklas |
191 |
image="help.png" |
6311 |
23 Aug 13 |
nicklas |
192 |
subclass="auto-init" |
6311 |
23 Aug 13 |
nicklas |
193 |
data-auto-init="help" |
6311 |
23 Aug 13 |
nicklas |
194 |
data-help-id="trash.view.properties" |
5938 |
27 Jan 12 |
nicklas |
195 |
title="Help…" |
5938 |
27 Jan 12 |
nicklas |
196 |
tooltip="Get help about this page" |
5938 |
27 Jan 12 |
nicklas |
197 |
/> |
5938 |
27 Jan 12 |
nicklas |
198 |
</tbl:toolbar> |
5938 |
27 Jan 12 |
nicklas |
199 |
</td> |
5938 |
27 Jan 12 |
nicklas |
200 |
</tr> |
2894 |
10 Nov 06 |
nicklas |
201 |
<tr> |
5938 |
27 Jan 12 |
nicklas |
202 |
<th>Type</th> |
2894 |
10 Nov 06 |
nicklas |
203 |
<td><%=itemType.toString()%></td> |
2894 |
10 Nov 06 |
nicklas |
204 |
</tr> |
2894 |
10 Nov 06 |
nicklas |
205 |
<tr> |
5938 |
27 Jan 12 |
nicklas |
206 |
<th>Name</th> |
2894 |
10 Nov 06 |
nicklas |
207 |
<td><%=link%></td> |
2894 |
10 Nov 06 |
nicklas |
208 |
</tr> |
2894 |
10 Nov 06 |
nicklas |
209 |
<tr> |
5938 |
27 Jan 12 |
nicklas |
210 |
<th>Description</th> |
2894 |
10 Nov 06 |
nicklas |
211 |
<td><%=HTML.niceFormat(description)%></td> |
2894 |
10 Nov 06 |
nicklas |
212 |
</tr> |
2894 |
10 Nov 06 |
nicklas |
213 |
</table> |
5938 |
27 Jan 12 |
nicklas |
214 |
</div> |
2894 |
10 Nov 06 |
nicklas |
215 |
|
2894 |
10 Nov 06 |
nicklas |
216 |
<% |
2894 |
10 Nov 06 |
nicklas |
217 |
if (isUsed) |
2894 |
10 Nov 06 |
nicklas |
218 |
{ |
2894 |
10 Nov 06 |
nicklas |
219 |
%> |
5938 |
27 Jan 12 |
nicklas |
220 |
<base:section |
5938 |
27 Jan 12 |
nicklas |
221 |
id="useditems" |
5938 |
27 Jan 12 |
nicklas |
222 |
title="<%="Items using " + HTML.encodeTags(name) + " (" + usingItems.size() + ")"%>" |
5938 |
27 Jan 12 |
nicklas |
223 |
context="<%=cc %>" |
5938 |
27 Jan 12 |
nicklas |
224 |
> |
7110 |
15 Mar 16 |
nicklas |
225 |
<tbl:toolbar subclass="leftborder topborder rightborder bg-filled-50"> |
5938 |
27 Jan 12 |
nicklas |
226 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
227 |
id="btnDeleteItems" |
5946 |
03 Feb 12 |
nicklas |
228 |
image="delete.png" |
5938 |
27 Jan 12 |
nicklas |
229 |
title="Delete" |
5938 |
27 Jan 12 |
nicklas |
230 |
tooltip="Mark the selected items for deletion" |
5938 |
27 Jan 12 |
nicklas |
231 |
/> |
5938 |
27 Jan 12 |
nicklas |
232 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
233 |
id="btnRestoreItems" |
6311 |
23 Aug 13 |
nicklas |
234 |
image="restore.png" |
5938 |
27 Jan 12 |
nicklas |
235 |
title="Restore" |
5938 |
27 Jan 12 |
nicklas |
236 |
tooltip="Restore the selected item" |
5938 |
27 Jan 12 |
nicklas |
237 |
/> |
5938 |
27 Jan 12 |
nicklas |
238 |
</tbl:toolbar> |
5938 |
27 Jan 12 |
nicklas |
239 |
<tbl:table |
5938 |
27 Jan 12 |
nicklas |
240 |
id="usingItems" |
5938 |
27 Jan 12 |
nicklas |
241 |
columns="all" |
6311 |
23 Aug 13 |
nicklas |
242 |
action="index.jsp" |
6311 |
23 Aug 13 |
nicklas |
243 |
sc="<%=sc%>" |
5938 |
27 Jan 12 |
nicklas |
244 |
> |
5938 |
27 Jan 12 |
nicklas |
245 |
<tbl:hidden |
5938 |
27 Jan 12 |
nicklas |
246 |
name="item_type" |
5938 |
27 Jan 12 |
nicklas |
247 |
value="<%=itemType.name()%>" |
5938 |
27 Jan 12 |
nicklas |
248 |
/> |
5938 |
27 Jan 12 |
nicklas |
249 |
<tbl:hidden |
5938 |
27 Jan 12 |
nicklas |
250 |
name="item_id" |
5938 |
27 Jan 12 |
nicklas |
251 |
value="<%=String.valueOf(itemId)%>" |
5938 |
27 Jan 12 |
nicklas |
252 |
/> |
5938 |
27 Jan 12 |
nicklas |
253 |
<tbl:columndef |
5938 |
27 Jan 12 |
nicklas |
254 |
id="name" |
5938 |
27 Jan 12 |
nicklas |
255 |
title="Name/ID" |
5938 |
27 Jan 12 |
nicklas |
256 |
/> |
5938 |
27 Jan 12 |
nicklas |
257 |
<tbl:columndef |
5938 |
27 Jan 12 |
nicklas |
258 |
id="type" |
5938 |
27 Jan 12 |
nicklas |
259 |
title="Type" |
5938 |
27 Jan 12 |
nicklas |
260 |
/> |
5938 |
27 Jan 12 |
nicklas |
261 |
<tbl:columndef |
5938 |
27 Jan 12 |
nicklas |
262 |
id="description" |
5938 |
27 Jan 12 |
nicklas |
263 |
title="Description" |
5938 |
27 Jan 12 |
nicklas |
264 |
/> |
5938 |
27 Jan 12 |
nicklas |
265 |
<tbl:data> |
5938 |
27 Jan 12 |
nicklas |
266 |
<tbl:headers> |
5938 |
27 Jan 12 |
nicklas |
267 |
<tbl:headerrow> |
5938 |
27 Jan 12 |
nicklas |
268 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
269 |
clazz="index" |
5938 |
27 Jan 12 |
nicklas |
270 |
> </tbl:header> |
5938 |
27 Jan 12 |
nicklas |
271 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
272 |
clazz="check" |
5938 |
27 Jan 12 |
nicklas |
273 |
><base:icon |
6834 |
08 Apr 15 |
nicklas |
274 |
subclass="link table-check" |
5946 |
03 Feb 12 |
nicklas |
275 |
image="check_uncheck.png" |
6834 |
08 Apr 15 |
nicklas |
276 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
6221 |
10 Jan 13 |
nicklas |
277 |
data-regexp="item:" |
6221 |
10 Jan 13 |
nicklas |
278 |
style="align: left;" |
5938 |
27 Jan 12 |
nicklas |
279 |
/></tbl:header> |
5938 |
27 Jan 12 |
nicklas |
280 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
281 |
clazz="icons" |
5938 |
27 Jan 12 |
nicklas |
282 |
> </tbl:header> |
5938 |
27 Jan 12 |
nicklas |
283 |
<tbl:columnheaders /> |
5938 |
27 Jan 12 |
nicklas |
284 |
</tbl:headerrow> |
5938 |
27 Jan 12 |
nicklas |
285 |
</tbl:headers> |
5938 |
27 Jan 12 |
nicklas |
286 |
<tbl:rows> |
5938 |
27 Jan 12 |
nicklas |
287 |
<% |
5938 |
27 Jan 12 |
nicklas |
288 |
int index = 0; |
5938 |
27 Jan 12 |
nicklas |
289 |
for (ItemProxy proxy : usingItems) |
2894 |
10 Nov 06 |
nicklas |
290 |
{ |
5938 |
27 Jan 12 |
nicklas |
291 |
index++; |
5938 |
27 Jan 12 |
nicklas |
292 |
boolean denied = false; |
5938 |
27 Jan 12 |
nicklas |
293 |
boolean writePermissionOnUsedBy = false; |
5938 |
27 Jan 12 |
nicklas |
294 |
boolean usedByIsRemoved = false; |
5938 |
27 Jan 12 |
nicklas |
295 |
boolean usedByRemovable = false; |
5938 |
27 Jan 12 |
nicklas |
296 |
boolean usedByIsUsed = false; |
5938 |
27 Jan 12 |
nicklas |
297 |
BasicItem usedBy = null; |
5938 |
27 Jan 12 |
nicklas |
298 |
String usedByName = String.valueOf(proxy.getId()); |
7110 |
15 Mar 16 |
nicklas |
299 |
String usedByType = proxy.getType().toString(); |
5938 |
27 Jan 12 |
nicklas |
300 |
String usedByDescription = ""; |
5938 |
27 Jan 12 |
nicklas |
301 |
try |
2898 |
13 Nov 06 |
nicklas |
302 |
{ |
5938 |
27 Jan 12 |
nicklas |
303 |
usedBy = proxy.getItem(dc); |
7110 |
15 Mar 16 |
nicklas |
304 |
|
7110 |
15 Mar 16 |
nicklas |
305 |
if (usedBy instanceof Annotation) |
7110 |
15 Mar 16 |
nicklas |
306 |
{ |
7110 |
15 Mar 16 |
nicklas |
307 |
// Load the item that this annotation belongs to |
7110 |
15 Mar 16 |
nicklas |
308 |
Annotation a = (Annotation)usedBy; |
7110 |
15 Mar 16 |
nicklas |
309 |
usedBy = (BasicItem)a.getAnnotationSet().getItem(dc); |
7110 |
15 Mar 16 |
nicklas |
310 |
usedByType += " on " + usedBy.getType().toString(); |
7110 |
15 Mar 16 |
nicklas |
311 |
} |
7110 |
15 Mar 16 |
nicklas |
312 |
|
5938 |
27 Jan 12 |
nicklas |
313 |
writePermissionOnUsedBy = usedBy.hasPermission(Permission.WRITE); |
5938 |
27 Jan 12 |
nicklas |
314 |
usedByIsUsed = usedBy.isUsed(); |
5938 |
27 Jan 12 |
nicklas |
315 |
if (usedBy instanceof Removable) |
5938 |
27 Jan 12 |
nicklas |
316 |
{ |
5938 |
27 Jan 12 |
nicklas |
317 |
usedByRemovable = true; |
5938 |
27 Jan 12 |
nicklas |
318 |
usedByIsRemoved = ((Removable)usedBy).isRemoved(); |
5938 |
27 Jan 12 |
nicklas |
319 |
} |
5938 |
27 Jan 12 |
nicklas |
320 |
if (usedBy instanceof File) |
5938 |
27 Jan 12 |
nicklas |
321 |
{ |
5938 |
27 Jan 12 |
nicklas |
322 |
File file = (File)usedBy; |
5938 |
27 Jan 12 |
nicklas |
323 |
usedByName = file.getPath().toString(); |
5938 |
27 Jan 12 |
nicklas |
324 |
usedByDescription = file.getDescription(); |
5938 |
27 Jan 12 |
nicklas |
325 |
} |
5938 |
27 Jan 12 |
nicklas |
326 |
else if (usedBy instanceof Directory) |
5938 |
27 Jan 12 |
nicklas |
327 |
{ |
5938 |
27 Jan 12 |
nicklas |
328 |
Directory dir = (Directory)usedBy; |
5938 |
27 Jan 12 |
nicklas |
329 |
usedByName = dir.getPath().toString(); |
5938 |
27 Jan 12 |
nicklas |
330 |
usedByDescription = dir.getDescription(); |
5938 |
27 Jan 12 |
nicklas |
331 |
} |
5938 |
27 Jan 12 |
nicklas |
332 |
else if (usedBy instanceof Nameable) |
5938 |
27 Jan 12 |
nicklas |
333 |
{ |
5938 |
27 Jan 12 |
nicklas |
334 |
Nameable nameable = (Nameable)usedBy; |
5938 |
27 Jan 12 |
nicklas |
335 |
usedByName = nameable.getName(); |
5938 |
27 Jan 12 |
nicklas |
336 |
usedByDescription = nameable.getDescription(); |
5938 |
27 Jan 12 |
nicklas |
337 |
} |
5938 |
27 Jan 12 |
nicklas |
338 |
else |
5938 |
27 Jan 12 |
nicklas |
339 |
{ |
5938 |
27 Jan 12 |
nicklas |
340 |
usedByName = usedBy.toString(); |
5938 |
27 Jan 12 |
nicklas |
341 |
} |
2898 |
13 Nov 06 |
nicklas |
342 |
} |
5938 |
27 Jan 12 |
nicklas |
343 |
catch (PermissionDeniedException ex) |
2894 |
10 Nov 06 |
nicklas |
344 |
{ |
5938 |
27 Jan 12 |
nicklas |
345 |
denied = true; |
2894 |
10 Nov 06 |
nicklas |
346 |
} |
5938 |
27 Jan 12 |
nicklas |
347 |
%> |
5938 |
27 Jan 12 |
nicklas |
348 |
<tbl:row> |
5938 |
27 Jan 12 |
nicklas |
349 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
350 |
clazz="index" |
5938 |
27 Jan 12 |
nicklas |
351 |
><%=index%></tbl:header> |
5938 |
27 Jan 12 |
nicklas |
352 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
353 |
clazz="check" |
5938 |
27 Jan 12 |
nicklas |
354 |
><% |
5938 |
27 Jan 12 |
nicklas |
355 |
if (usedByRemovable) |
5938 |
27 Jan 12 |
nicklas |
356 |
{ |
5938 |
27 Jan 12 |
nicklas |
357 |
%><input |
5938 |
27 Jan 12 |
nicklas |
358 |
type="checkbox" |
7110 |
15 Mar 16 |
nicklas |
359 |
name="item:<%=usedBy.getType().name()%>" |
7110 |
15 Mar 16 |
nicklas |
360 |
value="<%=usedBy.getId()%>" |
5938 |
27 Jan 12 |
nicklas |
361 |
><% |
5938 |
27 Jan 12 |
nicklas |
362 |
} |
5938 |
27 Jan 12 |
nicklas |
363 |
%></tbl:header> |
5938 |
27 Jan 12 |
nicklas |
364 |
<tbl:header |
5938 |
27 Jan 12 |
nicklas |
365 |
clazz="icons" |
5938 |
27 Jan 12 |
nicklas |
366 |
><base:icon |
5946 |
03 Feb 12 |
nicklas |
367 |
image="deleted.png" |
5938 |
27 Jan 12 |
nicklas |
368 |
tooltip="This item has been scheduled for deletion" |
5938 |
27 Jan 12 |
nicklas |
369 |
visible="<%=usedByIsRemoved%>" |
5938 |
27 Jan 12 |
nicklas |
370 |
/> |
5938 |
27 Jan 12 |
nicklas |
371 |
<base:icon |
6311 |
23 Aug 13 |
nicklas |
372 |
subclass="link auto-init" |
6311 |
23 Aug 13 |
nicklas |
373 |
data-auto-init="show-using-items" |
7110 |
15 Mar 16 |
nicklas |
374 |
data-item-type="<%=usedBy.getType().name() %>" |
7110 |
15 Mar 16 |
nicklas |
375 |
data-item-id="<%=usedBy.getId() %>" |
5946 |
03 Feb 12 |
nicklas |
376 |
image="used.png" |
5938 |
27 Jan 12 |
nicklas |
377 |
tooltip="This item is used by other items" |
5938 |
27 Jan 12 |
nicklas |
378 |
visible="<%=usedByIsRemoved && usedByIsUsed%>" |
5938 |
27 Jan 12 |
nicklas |
379 |
/> </tbl:header> |
7110 |
15 Mar 16 |
nicklas |
380 |
<tbl:cell column="name"><%=Base.getLink(ID, HTML.encodeTags(usedByName), usedBy.getType(), usedBy.getId(), writePermissionOnUsedBy)%> |
7110 |
15 Mar 16 |
nicklas |
381 |
<base:icon image="edit.png" subclass="link auto-init" |
7110 |
15 Mar 16 |
nicklas |
382 |
data-auto-init="item-link" |
7110 |
15 Mar 16 |
nicklas |
383 |
data-item-type="<%=proxy.getType().name()%>" |
7110 |
15 Mar 16 |
nicklas |
384 |
data-item-id="<%=proxy.getId() %>" |
7110 |
15 Mar 16 |
nicklas |
385 |
tooltip="Modify the values of this annotation" |
7110 |
15 Mar 16 |
nicklas |
386 |
visible="<%=proxy.getType() == Item.ANNOTATION %>" |
7110 |
15 Mar 16 |
nicklas |
387 |
style="float: right;" |
7110 |
15 Mar 16 |
nicklas |
388 |
/> |
7110 |
15 Mar 16 |
nicklas |
389 |
|
7110 |
15 Mar 16 |
nicklas |
390 |
</tbl:cell> |
7110 |
15 Mar 16 |
nicklas |
391 |
<tbl:cell column="type"><%=usedByType%></tbl:cell> |
5938 |
27 Jan 12 |
nicklas |
392 |
<tbl:cell column="description"><%=HTML.niceFormat(usedByDescription)%></tbl:cell> |
5938 |
27 Jan 12 |
nicklas |
393 |
</tbl:row> |
5938 |
27 Jan 12 |
nicklas |
394 |
<% |
2894 |
10 Nov 06 |
nicklas |
395 |
} |
2894 |
10 Nov 06 |
nicklas |
396 |
%> |
5938 |
27 Jan 12 |
nicklas |
397 |
</tbl:rows> |
5938 |
27 Jan 12 |
nicklas |
398 |
</tbl:data> |
5938 |
27 Jan 12 |
nicklas |
399 |
</tbl:table> |
5938 |
27 Jan 12 |
nicklas |
400 |
</base:section> |
2894 |
10 Nov 06 |
nicklas |
401 |
<% |
2894 |
10 Nov 06 |
nicklas |
402 |
} |
3548 |
04 Jul 07 |
martin |
403 |
if (item instanceof SharedItem) |
3548 |
04 Jul 07 |
martin |
404 |
{ |
5938 |
27 Jan 12 |
nicklas |
405 |
%> |
5938 |
27 Jan 12 |
nicklas |
406 |
<jsp:include page="../../common/share/list_share.jsp"> |
5938 |
27 Jan 12 |
nicklas |
407 |
<jsp:param name="ID" value="<%=ID%>" /> |
5938 |
27 Jan 12 |
nicklas |
408 |
<jsp:param name="item_type" value="<%=itemType.name()%>" /> |
5938 |
27 Jan 12 |
nicklas |
409 |
<jsp:param name="item_id" value="<%=itemId%>" /> |
5938 |
27 Jan 12 |
nicklas |
410 |
<jsp:param name="title" value="Shared to" /> |
5938 |
27 Jan 12 |
nicklas |
411 |
</jsp:include> |
5938 |
27 Jan 12 |
nicklas |
412 |
<% |
3548 |
04 Jul 07 |
martin |
413 |
} |
2894 |
10 Nov 06 |
nicklas |
414 |
%> |
2894 |
10 Nov 06 |
nicklas |
415 |
|
2894 |
10 Nov 06 |
nicklas |
416 |
</t:tab> |
2894 |
10 Nov 06 |
nicklas |
417 |
</t:tabcontrol> |
2894 |
10 Nov 06 |
nicklas |
418 |
|
2894 |
10 Nov 06 |
nicklas |
419 |
</base:body> |
2894 |
10 Nov 06 |
nicklas |
420 |
</base:page> |
2894 |
10 Nov 06 |
nicklas |
421 |
<% |
2894 |
10 Nov 06 |
nicklas |
422 |
} |
2894 |
10 Nov 06 |
nicklas |
423 |
finally |
2894 |
10 Nov 06 |
nicklas |
424 |
{ |
2894 |
10 Nov 06 |
nicklas |
425 |
if (dc != null) dc.commit(); |
2894 |
10 Nov 06 |
nicklas |
426 |
} |
2894 |
10 Nov 06 |
nicklas |
427 |
|
2894 |
10 Nov 06 |
nicklas |
428 |
%> |