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