2213 |
04 May 06 |
nicklas |
1 |
<%-- $Id$ |
2213 |
04 May 06 |
nicklas |
2 |
------------------------------------------------------------------ |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2007 Johan Enell, Nicklas Nordborg, Martin Svensson |
2213 |
04 May 06 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
2213 |
04 May 06 |
nicklas |
8 |
|
2213 |
04 May 06 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
2213 |
04 May 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 |
2213 |
04 May 06 |
nicklas |
12 |
of the License, or (at your option) any later version. |
2213 |
04 May 06 |
nicklas |
13 |
|
2213 |
04 May 06 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
2213 |
04 May 06 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
2213 |
04 May 06 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2213 |
04 May 06 |
nicklas |
17 |
GNU General Public License for more details. |
2213 |
04 May 06 |
nicklas |
18 |
|
2213 |
04 May 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/>. |
2213 |
04 May 06 |
nicklas |
21 |
------------------------------------------------------------------ |
2213 |
04 May 06 |
nicklas |
22 |
|
2213 |
04 May 06 |
nicklas |
23 |
@author Nicklas |
2213 |
04 May 06 |
nicklas |
24 |
@version 2.0 |
2213 |
04 May 06 |
nicklas |
25 |
--%> |
7943 |
04 May 21 |
nicklas |
26 |
<%@page import="net.sf.basedb.clients.web.ModeInfo"%> |
5426 |
24 Sep 10 |
nicklas |
27 |
<%@ page pageEncoding="UTF-8" session="false" |
2213 |
04 May 06 |
nicklas |
28 |
import="net.sf.basedb.core.SessionControl" |
2213 |
04 May 06 |
nicklas |
29 |
import="net.sf.basedb.core.DbControl" |
2213 |
04 May 06 |
nicklas |
30 |
import="net.sf.basedb.core.Trashcan" |
2213 |
04 May 06 |
nicklas |
31 |
import="net.sf.basedb.core.Item" |
2213 |
04 May 06 |
nicklas |
32 |
import="net.sf.basedb.core.ItemContext" |
2213 |
04 May 06 |
nicklas |
33 |
import="net.sf.basedb.core.Permission" |
2213 |
04 May 06 |
nicklas |
34 |
import="net.sf.basedb.core.BasicItem" |
2213 |
04 May 06 |
nicklas |
35 |
import="net.sf.basedb.core.Removable" |
2213 |
04 May 06 |
nicklas |
36 |
import="net.sf.basedb.core.Nameable" |
7016 |
18 Nov 15 |
nicklas |
37 |
import="net.sf.basedb.core.Ownable" |
7018 |
18 Nov 15 |
nicklas |
38 |
import="net.sf.basedb.core.Shareable" |
7018 |
18 Nov 15 |
nicklas |
39 |
import="net.sf.basedb.core.SharedItem" |
2213 |
04 May 06 |
nicklas |
40 |
import="net.sf.basedb.core.File" |
2213 |
04 May 06 |
nicklas |
41 |
import="net.sf.basedb.core.Directory" |
7016 |
18 Nov 15 |
nicklas |
42 |
import="net.sf.basedb.core.User" |
2213 |
04 May 06 |
nicklas |
43 |
import="net.sf.basedb.core.Metadata" |
7016 |
18 Nov 15 |
nicklas |
44 |
import="net.sf.basedb.core.ItemNotFoundException" |
7016 |
18 Nov 15 |
nicklas |
45 |
import="net.sf.basedb.core.PermissionDeniedException" |
7018 |
18 Nov 15 |
nicklas |
46 |
import="net.sf.basedb.core.ItemQuery" |
7018 |
18 Nov 15 |
nicklas |
47 |
import="net.sf.basedb.core.query.EntityQuery" |
2213 |
04 May 06 |
nicklas |
48 |
import="net.sf.basedb.core.query.ResultList" |
7018 |
18 Nov 15 |
nicklas |
49 |
import="net.sf.basedb.core.query.Restriction" |
7018 |
18 Nov 15 |
nicklas |
50 |
import="net.sf.basedb.core.query.Restrictions" |
7032 |
03 Dec 15 |
nicklas |
51 |
import="net.sf.basedb.core.query.ReturnClassFilter" |
2213 |
04 May 06 |
nicklas |
52 |
import="net.sf.basedb.util.Enumeration" |
7018 |
18 Nov 15 |
nicklas |
53 |
import="net.sf.basedb.util.ShareableUtil" |
7018 |
18 Nov 15 |
nicklas |
54 |
import="net.sf.basedb.util.filter.Filter" |
2213 |
04 May 06 |
nicklas |
55 |
import="net.sf.basedb.clients.web.Base" |
2213 |
04 May 06 |
nicklas |
56 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
57 |
import="net.sf.basedb.util.Values" |
4887 |
06 Apr 09 |
nicklas |
58 |
import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
4887 |
06 Apr 09 |
nicklas |
59 |
import="net.sf.basedb.clients.web.extensions.JspContext" |
4887 |
06 Apr 09 |
nicklas |
60 |
import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
7604 |
25 Feb 19 |
nicklas |
61 |
import="net.sf.basedb.clients.web.extensions.toolbar.ButtonAction" |
4887 |
06 Apr 09 |
nicklas |
62 |
import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
7604 |
25 Feb 19 |
nicklas |
63 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnAction" |
6040 |
30 Mar 12 |
nicklas |
64 |
import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
4887 |
06 Apr 09 |
nicklas |
65 |
import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
7018 |
18 Nov 15 |
nicklas |
66 |
import="java.util.Iterator" |
4347 |
18 Jun 08 |
nicklas |
67 |
import="java.util.Set" |
4347 |
18 Jun 08 |
nicklas |
68 |
import="java.util.HashSet" |
2213 |
04 May 06 |
nicklas |
69 |
%> |
2213 |
04 May 06 |
nicklas |
70 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
2213 |
04 May 06 |
nicklas |
71 |
<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
4887 |
06 Apr 09 |
nicklas |
72 |
<%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
2213 |
04 May 06 |
nicklas |
73 |
<%! |
2213 |
04 May 06 |
nicklas |
74 |
private static final Item itemType = Item.SYSTEM; |
2213 |
04 May 06 |
nicklas |
75 |
private static final String subContext = "trashcan"; |
2213 |
04 May 06 |
nicklas |
76 |
|
2213 |
04 May 06 |
nicklas |
77 |
private static final Enumeration<String, String> items = new Enumeration<String, String>(); |
2213 |
04 May 06 |
nicklas |
78 |
static |
2213 |
04 May 06 |
nicklas |
79 |
{ |
2213 |
04 May 06 |
nicklas |
80 |
for (Item item : Metadata.getRemovableItems()) |
2213 |
04 May 06 |
nicklas |
81 |
{ |
2213 |
04 May 06 |
nicklas |
82 |
items.add(item.name(), item.toString()); |
2213 |
04 May 06 |
nicklas |
83 |
} |
2213 |
04 May 06 |
nicklas |
84 |
} |
2213 |
04 May 06 |
nicklas |
85 |
%> |
2213 |
04 May 06 |
nicklas |
86 |
<% |
2213 |
04 May 06 |
nicklas |
87 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
2213 |
04 May 06 |
nicklas |
88 |
final String ID = sc.getId(); |
2213 |
04 May 06 |
nicklas |
89 |
final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, subContext, null, null); |
7943 |
04 May 21 |
nicklas |
90 |
final ModeInfo mode = ModeInfo.DEFAULT; |
2213 |
04 May 06 |
nicklas |
91 |
|
7954 |
12 May 21 |
nicklas |
92 |
final DbControl dc = sc.newDbControl(":List items in trashcan"); |
2213 |
04 May 06 |
nicklas |
93 |
ResultList<Removable> trash = null; |
2213 |
04 May 06 |
nicklas |
94 |
try |
2213 |
04 May 06 |
nicklas |
95 |
{ |
2510 |
10 Aug 06 |
nicklas |
96 |
long totalCount = 0; |
7018 |
18 Nov 15 |
nicklas |
97 |
final ItemQuery<User> userQuery = User.getQuery(); |
2213 |
04 May 06 |
nicklas |
98 |
try |
2213 |
04 May 06 |
nicklas |
99 |
{ |
2213 |
04 May 06 |
nicklas |
100 |
String filterItem = cc.getPropertyValue("type"); |
4347 |
18 Jun 08 |
nicklas |
101 |
Set<Item> itemTypes = null; |
4347 |
18 Jun 08 |
nicklas |
102 |
if (filterItem != null) |
4347 |
18 Jun 08 |
nicklas |
103 |
{ |
4347 |
18 Jun 08 |
nicklas |
104 |
itemTypes = new HashSet<Item>(); |
4347 |
18 Jun 08 |
nicklas |
105 |
for (String name : filterItem.split("\\|")) |
4347 |
18 Jun 08 |
nicklas |
106 |
{ |
4347 |
18 Jun 08 |
nicklas |
107 |
itemTypes.add(Item.valueOf(name)); |
4347 |
18 Jun 08 |
nicklas |
108 |
} |
4347 |
18 Jun 08 |
nicklas |
109 |
} |
7018 |
18 Nov 15 |
nicklas |
110 |
Restriction id = cc.getFilterRestriction("id", dc, null); |
7018 |
18 Nov 15 |
nicklas |
111 |
Restriction removedBy = cc.getFilterRestriction("removedBy", dc, null); |
7018 |
18 Nov 15 |
nicklas |
112 |
Restriction name = Restrictions.conditionalRestriction(new ReturnClassFilter(Nameable.class), |
7034 |
04 Dec 15 |
nicklas |
113 |
cc.getFilterRestriction("name", dc, null), null, true); |
7018 |
18 Nov 15 |
nicklas |
114 |
Restriction description = Restrictions.conditionalRestriction(new ReturnClassFilter(Nameable.class), |
7034 |
04 Dec 15 |
nicklas |
115 |
cc.getFilterRestriction("description", dc, null), null, true); |
7018 |
18 Nov 15 |
nicklas |
116 |
Restriction owner = Restrictions.conditionalRestriction(new ReturnClassFilter(Ownable.class), |
7034 |
04 Dec 15 |
nicklas |
117 |
cc.getFilterRestriction("owner", dc, null), null, true); |
7018 |
18 Nov 15 |
nicklas |
118 |
Restriction sharedTo = Restrictions.conditionalRestriction(new ReturnClassFilter(Shareable.class), |
7034 |
04 Dec 15 |
nicklas |
119 |
cc.getFilterRestriction("!sharedTo.name", dc, null), null, true); |
7018 |
18 Nov 15 |
nicklas |
120 |
Restriction restriction = Restrictions.nullSafeAnd(id, removedBy, name, description, owner, sharedTo); |
7018 |
18 Nov 15 |
nicklas |
121 |
|
7018 |
18 Nov 15 |
nicklas |
122 |
trash = Trashcan.getItems(dc, itemTypes, cc.getPage() * cc.getRowsPerPage(), cc.getRowsPerPage(), restriction); |
2510 |
10 Aug 06 |
nicklas |
123 |
totalCount = trash.getTotalCount(); |
2213 |
04 May 06 |
nicklas |
124 |
} |
2213 |
04 May 06 |
nicklas |
125 |
catch (Throwable t) |
2213 |
04 May 06 |
nicklas |
126 |
{ |
2213 |
04 May 06 |
nicklas |
127 |
cc.setMessage(t.getMessage()); |
2213 |
04 May 06 |
nicklas |
128 |
} |
2213 |
04 May 06 |
nicklas |
129 |
int numListed = 0; |
4887 |
06 Apr 09 |
nicklas |
130 |
JspContext jspContext = ExtensionsControl.createContext(dc, pageContext); |
7605 |
26 Feb 19 |
nicklas |
131 |
ExtensionsInvoker<ButtonAction> invoker = ExtensionsControl.useExtensions(jspContext, |
4887 |
06 Apr 09 |
nicklas |
132 |
"net.sf.basedb.clients.web.toolbar.list.all", |
4887 |
06 Apr 09 |
nicklas |
133 |
"net.sf.basedb.clients.web.toolbar.list.trashcan"); |
7605 |
26 Feb 19 |
nicklas |
134 |
ExtensionsInvoker<ListColumnAction<BasicItem,?>> columnsInvoker = ExtensionsControl.useExtensions(jspContext, |
6040 |
30 Mar 12 |
nicklas |
135 |
"net.sf.basedb.clients.web.listcolumn.trashcan"); |
2213 |
04 May 06 |
nicklas |
136 |
%> |
6311 |
23 Aug 13 |
nicklas |
137 |
<base:page title="Trashcan" id="list-page"> |
6311 |
23 Aug 13 |
nicklas |
138 |
<base:head scripts="table.js,~trash.js" styles="table.css,toolbar.css"> |
4887 |
06 Apr 09 |
nicklas |
139 |
<ext:scripts context="<%=jspContext%>" /> |
4887 |
06 Apr 09 |
nicklas |
140 |
<ext:stylesheets context="<%=jspContext%>" /> |
2213 |
04 May 06 |
nicklas |
141 |
</base:head> |
2213 |
04 May 06 |
nicklas |
142 |
|
2213 |
04 May 06 |
nicklas |
143 |
<base:body> |
5952 |
10 Feb 12 |
nicklas |
144 |
<h1>Trashcan</h1> |
5952 |
10 Feb 12 |
nicklas |
145 |
<div class="content"> |
2213 |
04 May 06 |
nicklas |
146 |
<tbl:table |
2213 |
04 May 06 |
nicklas |
147 |
id="trashcan" |
2213 |
04 May 06 |
nicklas |
148 |
columns="<%=cc.getSetting("columns")%>" |
2213 |
04 May 06 |
nicklas |
149 |
action="index.jsp" |
2213 |
04 May 06 |
nicklas |
150 |
sc="<%=sc%>" |
2213 |
04 May 06 |
nicklas |
151 |
item="<%=itemType%>" |
2213 |
04 May 06 |
nicklas |
152 |
subcontext="<%=subContext%>" |
5952 |
10 Feb 12 |
nicklas |
153 |
subclass="fulltable" |
7851 |
14 Oct 20 |
nicklas |
154 |
data-no-linkeditem-columns="1" |
7982 |
14 Jun 21 |
nicklas |
155 |
stickyheaders="<%=cc.getSetting("columns.sticky", "name")%>" |
2213 |
04 May 06 |
nicklas |
156 |
> |
2213 |
04 May 06 |
nicklas |
157 |
<tbl:columndef |
2213 |
04 May 06 |
nicklas |
158 |
id="type" |
2213 |
04 May 06 |
nicklas |
159 |
property="type" |
2213 |
04 May 06 |
nicklas |
160 |
datatype="string" |
2213 |
04 May 06 |
nicklas |
161 |
title="Item type" |
2213 |
04 May 06 |
nicklas |
162 |
enumeration="<%=items%>" |
2213 |
04 May 06 |
nicklas |
163 |
filterable="true" |
2213 |
04 May 06 |
nicklas |
164 |
show="always" |
2213 |
04 May 06 |
nicklas |
165 |
/> |
2213 |
04 May 06 |
nicklas |
166 |
<tbl:columndef |
2213 |
04 May 06 |
nicklas |
167 |
id="name" |
2213 |
04 May 06 |
nicklas |
168 |
title="Name" |
2213 |
04 May 06 |
nicklas |
169 |
show="always" |
7018 |
18 Nov 15 |
nicklas |
170 |
filterable="true" |
7018 |
18 Nov 15 |
nicklas |
171 |
filterproperty="name" |
7018 |
18 Nov 15 |
nicklas |
172 |
datatype="string" |
2213 |
04 May 06 |
nicklas |
173 |
/> |
5839 |
01 Nov 11 |
nicklas |
174 |
<tbl:columndef |
4333 |
16 Jun 08 |
martin |
175 |
id="id" |
5839 |
01 Nov 11 |
nicklas |
176 |
property="id" |
4333 |
16 Jun 08 |
martin |
177 |
datatype="int" |
4333 |
16 Jun 08 |
martin |
178 |
title="ID" |
4333 |
16 Jun 08 |
martin |
179 |
exportable="true" |
7018 |
18 Nov 15 |
nicklas |
180 |
filterable="true" |
4333 |
16 Jun 08 |
martin |
181 |
/> |
7018 |
18 Nov 15 |
nicklas |
182 |
<% |
7018 |
18 Nov 15 |
nicklas |
183 |
Enumeration<String, String> users = new Enumeration<String, String>(); |
7018 |
18 Nov 15 |
nicklas |
184 |
for (User u : userQuery.list(dc)) |
7018 |
18 Nov 15 |
nicklas |
185 |
{ |
7018 |
18 Nov 15 |
nicklas |
186 |
users.add(Integer.toString(u.getId()), HTML.encodeTags(u.getName())); |
7018 |
18 Nov 15 |
nicklas |
187 |
} |
7018 |
18 Nov 15 |
nicklas |
188 |
%> |
2213 |
04 May 06 |
nicklas |
189 |
<tbl:columndef |
7016 |
18 Nov 15 |
nicklas |
190 |
id="owner" |
7016 |
18 Nov 15 |
nicklas |
191 |
title="Owner" |
7018 |
18 Nov 15 |
nicklas |
192 |
property="owner" |
7018 |
18 Nov 15 |
nicklas |
193 |
datatype="int" |
7018 |
18 Nov 15 |
nicklas |
194 |
filterable="true" |
7018 |
18 Nov 15 |
nicklas |
195 |
enumeration="<%=users%>" |
7016 |
18 Nov 15 |
nicklas |
196 |
/> |
7016 |
18 Nov 15 |
nicklas |
197 |
<tbl:columndef |
7016 |
18 Nov 15 |
nicklas |
198 |
id="removedBy" |
7016 |
18 Nov 15 |
nicklas |
199 |
title="Removed by" |
7018 |
18 Nov 15 |
nicklas |
200 |
property="removedBy" |
7018 |
18 Nov 15 |
nicklas |
201 |
datatype="int" |
7018 |
18 Nov 15 |
nicklas |
202 |
filterable="true" |
7018 |
18 Nov 15 |
nicklas |
203 |
enumeration="<%=users%>" |
7016 |
18 Nov 15 |
nicklas |
204 |
/> |
7016 |
18 Nov 15 |
nicklas |
205 |
<tbl:columndef |
2213 |
04 May 06 |
nicklas |
206 |
id="description" |
2213 |
04 May 06 |
nicklas |
207 |
title="Description" |
7018 |
18 Nov 15 |
nicklas |
208 |
property="description" |
7018 |
18 Nov 15 |
nicklas |
209 |
filterable="true" |
7018 |
18 Nov 15 |
nicklas |
210 |
datatype="string" |
2213 |
04 May 06 |
nicklas |
211 |
/> |
7018 |
18 Nov 15 |
nicklas |
212 |
<tbl:columndef |
7018 |
18 Nov 15 |
nicklas |
213 |
id="sharedTo" |
7018 |
18 Nov 15 |
nicklas |
214 |
title="Shared to" |
7018 |
18 Nov 15 |
nicklas |
215 |
filterable="true" |
7018 |
18 Nov 15 |
nicklas |
216 |
filterproperty="!sharedTo.name" |
7018 |
18 Nov 15 |
nicklas |
217 |
datatype="string" |
7018 |
18 Nov 15 |
nicklas |
218 |
/> |
6040 |
30 Mar 12 |
nicklas |
219 |
<tbl:columndef |
6040 |
30 Mar 12 |
nicklas |
220 |
id="xt-columns" |
6040 |
30 Mar 12 |
nicklas |
221 |
extensions="<%=columnsInvoker%>" |
6040 |
30 Mar 12 |
nicklas |
222 |
jspcontext="<%=jspContext%>" |
6040 |
30 Mar 12 |
nicklas |
223 |
/> |
6604 |
18 Nov 14 |
nicklas |
224 |
<div class="panelgroup bg-filled-50 bottomborder"> |
5952 |
10 Feb 12 |
nicklas |
225 |
<tbl:toolbar subclass="bottomborder"> |
5952 |
10 Feb 12 |
nicklas |
226 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
227 |
id="btnDeleteAllItems" |
5952 |
10 Feb 12 |
nicklas |
228 |
image="deleteall.png" |
5952 |
10 Feb 12 |
nicklas |
229 |
title="Empty trash…" |
5952 |
10 Feb 12 |
nicklas |
230 |
tooltip="Delete all items from the trashcan" |
5952 |
10 Feb 12 |
nicklas |
231 |
disabled="<%=totalCount <= 0%>" |
5952 |
10 Feb 12 |
nicklas |
232 |
/> |
5952 |
10 Feb 12 |
nicklas |
233 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
234 |
id="btnDeleteItems" |
5952 |
10 Feb 12 |
nicklas |
235 |
image="delete_permanently.png" |
5952 |
10 Feb 12 |
nicklas |
236 |
title="Delete permanently…" |
5952 |
10 Feb 12 |
nicklas |
237 |
tooltip="Delete the selected items permanently" |
5952 |
10 Feb 12 |
nicklas |
238 |
disabled="<%=totalCount <= 0%>" |
5952 |
10 Feb 12 |
nicklas |
239 |
/> |
5952 |
10 Feb 12 |
nicklas |
240 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
241 |
id="btnRestoreItems" |
5952 |
10 Feb 12 |
nicklas |
242 |
image="restore.png" |
5952 |
10 Feb 12 |
nicklas |
243 |
title="Restore" |
5952 |
10 Feb 12 |
nicklas |
244 |
tooltip="Restore the selected items" |
5952 |
10 Feb 12 |
nicklas |
245 |
disabled="<%=totalCount <= 0%>" |
5952 |
10 Feb 12 |
nicklas |
246 |
/> |
5952 |
10 Feb 12 |
nicklas |
247 |
<tbl:button |
6311 |
23 Aug 13 |
nicklas |
248 |
id="btnColumns" |
5952 |
10 Feb 12 |
nicklas |
249 |
image="columns.png" |
5952 |
10 Feb 12 |
nicklas |
250 |
title="Columns…" |
5952 |
10 Feb 12 |
nicklas |
251 |
tooltip="Show, hide and re-order columns" |
5952 |
10 Feb 12 |
nicklas |
252 |
/> |
5952 |
10 Feb 12 |
nicklas |
253 |
<ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
7604 |
25 Feb 19 |
nicklas |
254 |
wrapper="<%=new PrefixSuffixRenderer<ButtonAction>(jspContext, "<td>", "</td>") %>"/> |
5952 |
10 Feb 12 |
nicklas |
255 |
</tbl:toolbar> |
5952 |
10 Feb 12 |
nicklas |
256 |
<tbl:panel> |
6182 |
23 Oct 12 |
nicklas |
257 |
<tbl:presetselector /> |
5952 |
10 Feb 12 |
nicklas |
258 |
<tbl:navigator |
5952 |
10 Feb 12 |
nicklas |
259 |
page="<%=cc.getPage()%>" |
5952 |
10 Feb 12 |
nicklas |
260 |
rowsperpage="<%=cc.getRowsPerPage()%>" |
5952 |
10 Feb 12 |
nicklas |
261 |
totalrows="<%=trash == null ? 0 : trash.getTotalCount()%>" |
5952 |
10 Feb 12 |
nicklas |
262 |
/> |
5952 |
10 Feb 12 |
nicklas |
263 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
264 |
</div> |
2213 |
04 May 06 |
nicklas |
265 |
<tbl:data> |
5948 |
08 Feb 12 |
nicklas |
266 |
<tbl:headers> |
5948 |
08 Feb 12 |
nicklas |
267 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
268 |
<tbl:header clazz="row-index bg-filled-100" /> |
5948 |
08 Feb 12 |
nicklas |
269 |
<tbl:columnheaders /> |
5948 |
08 Feb 12 |
nicklas |
270 |
</tbl:headerrow> |
5948 |
08 Feb 12 |
nicklas |
271 |
<tbl:headerrow> |
7943 |
04 May 21 |
nicklas |
272 |
<tbl:header subclass="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
273 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
274 |
<div class="index"></div> |
7943 |
04 May 21 |
nicklas |
275 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
276 |
<base:icon |
7943 |
04 May 21 |
nicklas |
277 |
subclass="link table-check" |
7943 |
04 May 21 |
nicklas |
278 |
image="check_uncheck.png" |
7943 |
04 May 21 |
nicklas |
279 |
tooltip="Toggle all (use CTRL, ALT or SHIFT to check/uncheck)" |
7943 |
04 May 21 |
nicklas |
280 |
data-regexp="item:" |
7943 |
04 May 21 |
nicklas |
281 |
/> |
7943 |
04 May 21 |
nicklas |
282 |
</div> |
7943 |
04 May 21 |
nicklas |
283 |
<div class="icons"></div> |
7943 |
04 May 21 |
nicklas |
284 |
</div> |
7943 |
04 May 21 |
nicklas |
285 |
</tbl:header> |
5948 |
08 Feb 12 |
nicklas |
286 |
<tbl:propertyfilter /> |
5948 |
08 Feb 12 |
nicklas |
287 |
</tbl:headerrow> |
7913 |
22 Feb 21 |
nicklas |
288 |
<tbl:columnsubtitles /> |
5948 |
08 Feb 12 |
nicklas |
289 |
</tbl:headers> |
5948 |
08 Feb 12 |
nicklas |
290 |
<tbl:rows> |
2213 |
04 May 06 |
nicklas |
291 |
<% |
5952 |
10 Feb 12 |
nicklas |
292 |
if (cc.getMessage() != null) |
5952 |
10 Feb 12 |
nicklas |
293 |
{ |
5952 |
10 Feb 12 |
nicklas |
294 |
%> |
6604 |
18 Nov 14 |
nicklas |
295 |
<tbl:panel subclass="bg-filled-50"> |
5952 |
10 Feb 12 |
nicklas |
296 |
<div class="messagecontainer error"><%=cc.getMessage()%></div> |
5952 |
10 Feb 12 |
nicklas |
297 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
298 |
<% |
5952 |
10 Feb 12 |
nicklas |
299 |
cc.setMessage(null); |
5952 |
10 Feb 12 |
nicklas |
300 |
} |
2213 |
04 May 06 |
nicklas |
301 |
int index = cc.getPage()*cc.getRowsPerPage(); |
2213 |
04 May 06 |
nicklas |
302 |
if (trash != null) |
2213 |
04 May 06 |
nicklas |
303 |
{ |
2213 |
04 May 06 |
nicklas |
304 |
for (Removable item : trash) |
2213 |
04 May 06 |
nicklas |
305 |
{ |
2213 |
04 May 06 |
nicklas |
306 |
BasicItem basicItem = (BasicItem)item; |
2213 |
04 May 06 |
nicklas |
307 |
boolean isUsed = basicItem.isUsed(); |
2213 |
04 May 06 |
nicklas |
308 |
int itemId = item.getId(); |
2213 |
04 May 06 |
nicklas |
309 |
String name = ""; |
2213 |
04 May 06 |
nicklas |
310 |
String description = ""; |
2213 |
04 May 06 |
nicklas |
311 |
if (item instanceof File) |
2213 |
04 May 06 |
nicklas |
312 |
{ |
2213 |
04 May 06 |
nicklas |
313 |
File file = (File)item; |
2213 |
04 May 06 |
nicklas |
314 |
name = file.getPath().toString(); |
2213 |
04 May 06 |
nicklas |
315 |
description = file.getDescription(); |
2213 |
04 May 06 |
nicklas |
316 |
} |
2213 |
04 May 06 |
nicklas |
317 |
else if (item instanceof Directory) |
2213 |
04 May 06 |
nicklas |
318 |
{ |
2213 |
04 May 06 |
nicklas |
319 |
Directory dir = (Directory)item; |
2213 |
04 May 06 |
nicklas |
320 |
name = dir.getPath().toString(); |
2213 |
04 May 06 |
nicklas |
321 |
description = dir.getDescription(); |
2213 |
04 May 06 |
nicklas |
322 |
} |
2213 |
04 May 06 |
nicklas |
323 |
else if (item instanceof Nameable) |
2213 |
04 May 06 |
nicklas |
324 |
{ |
2213 |
04 May 06 |
nicklas |
325 |
Nameable nameable = (Nameable)item; |
2213 |
04 May 06 |
nicklas |
326 |
name = nameable.getName(); |
2213 |
04 May 06 |
nicklas |
327 |
description = nameable.getDescription(); |
2213 |
04 May 06 |
nicklas |
328 |
} |
2213 |
04 May 06 |
nicklas |
329 |
else |
2213 |
04 May 06 |
nicklas |
330 |
{ |
2213 |
04 May 06 |
nicklas |
331 |
name = item.toString(); |
2213 |
04 May 06 |
nicklas |
332 |
} |
2216 |
05 May 06 |
nicklas |
333 |
String link = Base.getLink(ID, HTML.encodeTags(name), item.getType(), itemId, true); |
2213 |
04 May 06 |
nicklas |
334 |
index++; |
2213 |
04 May 06 |
nicklas |
335 |
numListed++; |
2213 |
04 May 06 |
nicklas |
336 |
%> |
2213 |
04 May 06 |
nicklas |
337 |
<tbl:row> |
7943 |
04 May 21 |
nicklas |
338 |
<tbl:header clazz="row-index bg-filled-100"> |
7943 |
04 May 21 |
nicklas |
339 |
<div class="index-<%=mode.getName()%>"> |
7943 |
04 May 21 |
nicklas |
340 |
<div class="index <%=index>999?"index-smaller":""%>"><%=index%></div> |
7943 |
04 May 21 |
nicklas |
341 |
<div class="check"> |
7943 |
04 May 21 |
nicklas |
342 |
<base:input |
7943 |
04 May 21 |
nicklas |
343 |
type="checkbox" |
7943 |
04 May 21 |
nicklas |
344 |
name="<%="item:"+item.getType().name()%>" |
7943 |
04 May 21 |
nicklas |
345 |
value="<%=itemId%>" |
7943 |
04 May 21 |
nicklas |
346 |
/> |
7943 |
04 May 21 |
nicklas |
347 |
</div> |
7943 |
04 May 21 |
nicklas |
348 |
<div class="icons"> |
7943 |
04 May 21 |
nicklas |
349 |
<base:icon |
7943 |
04 May 21 |
nicklas |
350 |
subclass="link auto-init" |
7943 |
04 May 21 |
nicklas |
351 |
data-auto-init="show-using-items" |
7943 |
04 May 21 |
nicklas |
352 |
data-item-type="<%=item.getType().name() %>" |
7943 |
04 May 21 |
nicklas |
353 |
data-item-id="<%=itemId %>" |
7943 |
04 May 21 |
nicklas |
354 |
image="used.png" |
7943 |
04 May 21 |
nicklas |
355 |
tooltip="This item is used by other items and cannot be deleted" |
7943 |
04 May 21 |
nicklas |
356 |
visible="<%=isUsed%>" |
7943 |
04 May 21 |
nicklas |
357 |
/> |
7943 |
04 May 21 |
nicklas |
358 |
</div> |
7943 |
04 May 21 |
nicklas |
359 |
</div> |
7943 |
04 May 21 |
nicklas |
360 |
</tbl:header> |
2213 |
04 May 06 |
nicklas |
361 |
<tbl:cell column="type"><%=item.getType()%></tbl:cell> |
2216 |
05 May 06 |
nicklas |
362 |
<tbl:cell column="name"><%=link%></tbl:cell> |
4333 |
16 Jun 08 |
martin |
363 |
<tbl:cell column="id"><%=item.getId()%></tbl:cell> |
7016 |
18 Nov 15 |
nicklas |
364 |
<tbl:cell column="removedBy"><% |
7016 |
18 Nov 15 |
nicklas |
365 |
User removedBy = null; |
7016 |
18 Nov 15 |
nicklas |
366 |
boolean deniedRemovedBy = false; |
7016 |
18 Nov 15 |
nicklas |
367 |
try |
7016 |
18 Nov 15 |
nicklas |
368 |
{ |
7016 |
18 Nov 15 |
nicklas |
369 |
removedBy = item.getRemovedBy(); |
7016 |
18 Nov 15 |
nicklas |
370 |
} |
7016 |
18 Nov 15 |
nicklas |
371 |
catch (PermissionDeniedException ex) |
7016 |
18 Nov 15 |
nicklas |
372 |
{ |
7016 |
18 Nov 15 |
nicklas |
373 |
deniedRemovedBy = true; |
7016 |
18 Nov 15 |
nicklas |
374 |
} |
7016 |
18 Nov 15 |
nicklas |
375 |
catch (ItemNotFoundException ex) |
7016 |
18 Nov 15 |
nicklas |
376 |
{} |
7016 |
18 Nov 15 |
nicklas |
377 |
out.write(Base.getLinkedName(ID, removedBy, deniedRemovedBy, true)); |
7016 |
18 Nov 15 |
nicklas |
378 |
%></tbl:cell> |
7016 |
18 Nov 15 |
nicklas |
379 |
<tbl:cell column="owner"><% |
7016 |
18 Nov 15 |
nicklas |
380 |
if (item instanceof Ownable) |
7016 |
18 Nov 15 |
nicklas |
381 |
{ |
7016 |
18 Nov 15 |
nicklas |
382 |
User owner = null; |
7016 |
18 Nov 15 |
nicklas |
383 |
boolean deniedOwner = false; |
7016 |
18 Nov 15 |
nicklas |
384 |
try |
7016 |
18 Nov 15 |
nicklas |
385 |
{ |
7016 |
18 Nov 15 |
nicklas |
386 |
owner = ((Ownable)item).getOwner(); |
7016 |
18 Nov 15 |
nicklas |
387 |
} |
7016 |
18 Nov 15 |
nicklas |
388 |
catch (PermissionDeniedException ex) |
7016 |
18 Nov 15 |
nicklas |
389 |
{ |
7016 |
18 Nov 15 |
nicklas |
390 |
deniedOwner = true; |
7016 |
18 Nov 15 |
nicklas |
391 |
} |
7016 |
18 Nov 15 |
nicklas |
392 |
out.write(Base.getLinkedName(ID, owner, deniedOwner, true)); |
7016 |
18 Nov 15 |
nicklas |
393 |
} |
7016 |
18 Nov 15 |
nicklas |
394 |
%></tbl:cell> |
7018 |
18 Nov 15 |
nicklas |
395 |
<tbl:cell column="sharedTo"><% |
7018 |
18 Nov 15 |
nicklas |
396 |
if (item instanceof SharedItem) |
7018 |
18 Nov 15 |
nicklas |
397 |
{ |
7018 |
18 Nov 15 |
nicklas |
398 |
Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, (SharedItem)item).iterator(); |
7018 |
18 Nov 15 |
nicklas |
399 |
while(sharees.hasNext()) |
7018 |
18 Nov 15 |
nicklas |
400 |
{ |
7018 |
18 Nov 15 |
nicklas |
401 |
Nameable n = sharees.next(); |
7018 |
18 Nov 15 |
nicklas |
402 |
out.write(Base.getLinkedName(ID, n, false, true)); |
7018 |
18 Nov 15 |
nicklas |
403 |
out.write(sharees.hasNext() ? ", " : ""); |
7018 |
18 Nov 15 |
nicklas |
404 |
} |
7018 |
18 Nov 15 |
nicklas |
405 |
} |
7018 |
18 Nov 15 |
nicklas |
406 |
%></tbl:cell> |
2213 |
04 May 06 |
nicklas |
407 |
<tbl:cell column="description"><%=HTML.encodeTags(description)%></tbl:cell> |
6040 |
30 Mar 12 |
nicklas |
408 |
<tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
6040 |
30 Mar 12 |
nicklas |
409 |
<tbl:cell column="xt-columns" /> |
6040 |
30 Mar 12 |
nicklas |
410 |
</tbl:xt-cells> |
2213 |
04 May 06 |
nicklas |
411 |
</tbl:row> |
2213 |
04 May 06 |
nicklas |
412 |
<% |
2213 |
04 May 06 |
nicklas |
413 |
} |
2213 |
04 May 06 |
nicklas |
414 |
} |
5952 |
10 Feb 12 |
nicklas |
415 |
if (numListed == 0) |
5952 |
10 Feb 12 |
nicklas |
416 |
{ |
5952 |
10 Feb 12 |
nicklas |
417 |
%> |
6604 |
18 Nov 14 |
nicklas |
418 |
<tbl:panel subclass="bg-filled-50"> |
5952 |
10 Feb 12 |
nicklas |
419 |
<div class="messagecontainer note"> |
5952 |
10 Feb 12 |
nicklas |
420 |
<%=trash == null || trash.size() == 0 ? "No items were found" : "No items on this page. Please select another page!" %> |
5952 |
10 Feb 12 |
nicklas |
421 |
</div> |
5952 |
10 Feb 12 |
nicklas |
422 |
</tbl:panel> |
5952 |
10 Feb 12 |
nicklas |
423 |
<% |
5952 |
10 Feb 12 |
nicklas |
424 |
} |
2213 |
04 May 06 |
nicklas |
425 |
%> |
5952 |
10 Feb 12 |
nicklas |
426 |
</tbl:rows> |
2213 |
04 May 06 |
nicklas |
427 |
</tbl:data> |
2213 |
04 May 06 |
nicklas |
428 |
</tbl:table> |
5952 |
10 Feb 12 |
nicklas |
429 |
</div> |
5951 |
09 Feb 12 |
nicklas |
430 |
|
2213 |
04 May 06 |
nicklas |
431 |
</base:body> |
2213 |
04 May 06 |
nicklas |
432 |
</base:page> |
2213 |
04 May 06 |
nicklas |
433 |
<% |
2213 |
04 May 06 |
nicklas |
434 |
} |
2213 |
04 May 06 |
nicklas |
435 |
finally |
2213 |
04 May 06 |
nicklas |
436 |
{ |
2213 |
04 May 06 |
nicklas |
437 |
if (dc != null) dc.close(); |
2213 |
04 May 06 |
nicklas |
438 |
} |
3675 |
16 Aug 07 |
jari |
439 |
%> |