1 | <%-- $Id: list_members.jsp 6701 2015-01-30 13:14:46Z nicklas $ |
---|
2 | ------------------------------------------------------------------ |
---|
3 | Copyright (C) 2008 Nicklas Nordborg |
---|
4 | |
---|
5 | This file is part of BASE - BioArray Software Environment. |
---|
6 | Available at http://base.thep.lu.se/ |
---|
7 | |
---|
8 | BASE is free software; you can redistribute it and/or modify it |
---|
9 | under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 3 of the License, or |
---|
11 | (at your option) any later version. |
---|
12 | |
---|
13 | BASE is distributed in the hope that it will be useful, but |
---|
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | General Public License for more details. |
---|
17 | |
---|
18 | You should have received a copy of the GNU General Public License |
---|
19 | along with BASE. If not, see <http://www.gnu.org/licenses/>. |
---|
20 | ------------------------------------------------------------------ |
---|
21 | |
---|
22 | @author Nicklas |
---|
23 | @version 2.10 |
---|
24 | --%> |
---|
25 | <%@ page pageEncoding="UTF-8" session="false" |
---|
26 | import="net.sf.basedb.core.SessionControl" |
---|
27 | import="net.sf.basedb.core.DbControl" |
---|
28 | import="net.sf.basedb.core.SystemItems" |
---|
29 | import="net.sf.basedb.core.Item" |
---|
30 | import="net.sf.basedb.core.ItemContext" |
---|
31 | import="net.sf.basedb.core.ItemQuery" |
---|
32 | import="net.sf.basedb.core.ItemResultList" |
---|
33 | import="net.sf.basedb.core.ItemResultIterator" |
---|
34 | import="net.sf.basedb.core.BioMaterialList" |
---|
35 | import="net.sf.basedb.core.BioMaterial" |
---|
36 | import="net.sf.basedb.core.Extract" |
---|
37 | import="net.sf.basedb.core.Sample" |
---|
38 | import="net.sf.basedb.core.BioSource" |
---|
39 | import="net.sf.basedb.core.BioMaterialEvent" |
---|
40 | import="net.sf.basedb.core.MeasuredBioMaterial" |
---|
41 | import="net.sf.basedb.core.PhysicalBioAssay" |
---|
42 | import="net.sf.basedb.core.BioWell" |
---|
43 | import="net.sf.basedb.core.AnnotationSet" |
---|
44 | import="net.sf.basedb.core.Annotation" |
---|
45 | import="net.sf.basedb.core.AnnotationType" |
---|
46 | import="net.sf.basedb.core.ItemSubtype" |
---|
47 | import="net.sf.basedb.core.PluginDefinition" |
---|
48 | import="net.sf.basedb.core.Permission" |
---|
49 | import="net.sf.basedb.core.Nameable" |
---|
50 | import="net.sf.basedb.core.Quantity" |
---|
51 | import="net.sf.basedb.core.Unit" |
---|
52 | import="net.sf.basedb.core.PlateGeometry" |
---|
53 | import="net.sf.basedb.core.PermissionDeniedException" |
---|
54 | import="net.sf.basedb.core.query.Orders" |
---|
55 | import="net.sf.basedb.core.query.Hql" |
---|
56 | import="net.sf.basedb.core.query.Restrictions" |
---|
57 | import="net.sf.basedb.core.plugin.GuiContext" |
---|
58 | import="net.sf.basedb.core.plugin.Plugin" |
---|
59 | import="net.sf.basedb.core.snapshot.AnnotationLoaderUtil" |
---|
60 | import="net.sf.basedb.core.snapshot.AnnotationTypeFilter" |
---|
61 | import="net.sf.basedb.core.snapshot.AnnotationSnapshot" |
---|
62 | import="net.sf.basedb.core.snapshot.AnnotationSetSnapshot" |
---|
63 | import="net.sf.basedb.core.snapshot.SnapshotManager" |
---|
64 | import="net.sf.basedb.util.Enumeration" |
---|
65 | import="net.sf.basedb.util.ShareableUtil" |
---|
66 | import="net.sf.basedb.util.units.UnitUtil" |
---|
67 | import="net.sf.basedb.clients.web.PermissionUtil" |
---|
68 | import="net.sf.basedb.clients.web.Base" |
---|
69 | import="net.sf.basedb.clients.web.ModeInfo" |
---|
70 | import="net.sf.basedb.clients.web.util.HTML" |
---|
71 | import="net.sf.basedb.util.Values" |
---|
72 | import="net.sf.basedb.util.formatter.Formatter" |
---|
73 | import="net.sf.basedb.util.formatter.WellCoordinateFormatter" |
---|
74 | import="net.sf.basedb.clients.web.formatter.FormatterFactory" |
---|
75 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
76 | import="net.sf.basedb.clients.web.extensions.JspContext" |
---|
77 | import="net.sf.basedb.clients.web.extensions.renderer.PrefixSuffixRenderer" |
---|
78 | import="net.sf.basedb.clients.web.extensions.toolbar.ToolbarUtil" |
---|
79 | import="net.sf.basedb.clients.web.extensions.list.ListColumnUtil" |
---|
80 | import="net.sf.basedb.util.extensions.ExtensionsInvoker" |
---|
81 | import="java.util.Date" |
---|
82 | import="java.util.Map" |
---|
83 | import="java.util.List" |
---|
84 | import="java.util.Iterator" |
---|
85 | import="java.util.ArrayList" |
---|
86 | %> |
---|
87 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
88 | <%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %> |
---|
89 | <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
---|
90 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
91 | <%@ taglib prefix="ext" uri="/WEB-INF/extensions.tld" %> |
---|
92 | <% |
---|
93 | final int bioMaterialListId = Values.getInt(request.getParameter("list_id")); |
---|
94 | final SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, Item.BIOMATERIALLIST); |
---|
95 | final String ID = sc.getId(); |
---|
96 | final ModeInfo mode = ModeInfo.get(request.getParameter("mode")); |
---|
97 | final String callback = request.getParameter("callback"); |
---|
98 | final String title = mode.generateTitle("member", "members"); |
---|
99 | final DbControl dc = sc.newDbControl(); |
---|
100 | |
---|
101 | ItemResultIterator<? extends BioMaterial> members = null; |
---|
102 | List<AnnotationLoaderUtil> annotationLoaders = new ArrayList<AnnotationLoaderUtil>(); |
---|
103 | try |
---|
104 | { |
---|
105 | final BioMaterialList list = BioMaterialList.getById(dc, bioMaterialListId); |
---|
106 | final Item itemType = list.getMemberType(); |
---|
107 | |
---|
108 | final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST, "listmembers."+list.getId()); |
---|
109 | final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, "listmembers."+list.getId(), null, null); |
---|
110 | |
---|
111 | |
---|
112 | final boolean addPermission = list.hasPermission(Permission.WRITE); |
---|
113 | final boolean removePermission = addPermission; |
---|
114 | |
---|
115 | // Parent samples |
---|
116 | final ItemQuery<Sample> parentSamplesQuery = Sample.getQuery(); |
---|
117 | parentSamplesQuery.join(Hql.innerJoin("childCreationEvents", "cce")); |
---|
118 | parentSamplesQuery.join(Hql.innerJoin("cce", "event", "evt")); |
---|
119 | parentSamplesQuery.restrict(Restrictions.eq(Hql.alias("evt"), Hql.entityParameter("creationEvent", Item.BIOMATERIALEVENT))); |
---|
120 | parentSamplesQuery.order(Orders.asc(Hql.property("name"))); |
---|
121 | parentSamplesQuery.include(cc.getInclude()); |
---|
122 | |
---|
123 | // Parent extracts |
---|
124 | final ItemQuery<Extract> parentExtractsQuery = Extract.getQuery(); |
---|
125 | parentExtractsQuery.join(Hql.innerJoin("childCreationEvents", "cce")); |
---|
126 | parentExtractsQuery.join(Hql.innerJoin("cce", "event", "evt")); |
---|
127 | parentExtractsQuery.restrict(Restrictions.eq(Hql.alias("evt"), Hql.entityParameter("creationEvent", Item.BIOMATERIALEVENT))); |
---|
128 | parentExtractsQuery.order(Orders.asc(Hql.property("name"))); |
---|
129 | parentExtractsQuery.include(cc.getInclude()); |
---|
130 | |
---|
131 | // Child samples |
---|
132 | final ItemQuery<Sample> childSamplesQuery = Sample.getQuery(); |
---|
133 | childSamplesQuery.order(Orders.asc(Hql.property("name"))); |
---|
134 | childSamplesQuery.include(cc.getInclude()); |
---|
135 | if (itemType == Item.BIOSOURCE) |
---|
136 | { |
---|
137 | childSamplesQuery.restrict(Restrictions.eq(Hql.property("parent"), Hql.entityParameter("parent", Item.BIOSOURCE))); |
---|
138 | } |
---|
139 | else |
---|
140 | { |
---|
141 | childSamplesQuery.join(Hql.innerJoin("creationEvent", "ce")); |
---|
142 | childSamplesQuery.join(Hql.innerJoin("ce", "sources", "src")); |
---|
143 | childSamplesQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("parent", Item.SAMPLE))); |
---|
144 | } |
---|
145 | |
---|
146 | // Child extracts |
---|
147 | final ItemQuery<Extract> childExtractsQuery = Extract.getQuery(); |
---|
148 | childExtractsQuery.include(cc.getInclude()); |
---|
149 | childExtractsQuery.order(Orders.asc(Hql.property("name"))); |
---|
150 | if (itemType == Item.SAMPLE) |
---|
151 | { |
---|
152 | childExtractsQuery.restrict(Restrictions.eq(Hql.property("parent"), Hql.entityParameter("parent", Item.SAMPLE))); |
---|
153 | } |
---|
154 | else |
---|
155 | { |
---|
156 | childExtractsQuery.join(Hql.innerJoin("creationEvent", "ce")); |
---|
157 | childExtractsQuery.join(Hql.innerJoin("ce", "sources", "src")); |
---|
158 | childExtractsQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("parent", Item.EXTRACT))); |
---|
159 | } |
---|
160 | |
---|
161 | // Child bioassays |
---|
162 | final ItemQuery<PhysicalBioAssay> bioAssayQuery = PhysicalBioAssay.getQuery(); |
---|
163 | bioAssayQuery.join(Hql.innerJoin("creationEvent", "ce")); |
---|
164 | bioAssayQuery.join(Hql.innerJoin("ce", "sources", "src")); |
---|
165 | bioAssayQuery.restrict(Restrictions.eq(Hql.property("src", "bioMaterial"), Hql.entityParameter("extract", Item.EXTRACT))); |
---|
166 | bioAssayQuery.order(Orders.asc(Hql.property("name"))); |
---|
167 | bioAssayQuery.include(cc.getInclude()); |
---|
168 | |
---|
169 | Unit microGram = UnitUtil.getUnit(dc, Quantity.MASS, "µg"); |
---|
170 | final Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext); |
---|
171 | final ItemQuery<AnnotationType> annotationTypeQuery = Base.getAnnotationTypesQuery(itemType); |
---|
172 | SnapshotManager manager = new SnapshotManager(); |
---|
173 | for (AnnotationType at : annotationTypeQuery.list(dc)) |
---|
174 | { |
---|
175 | annotationLoaders.add(new AnnotationLoaderUtil(dc, manager, at)); |
---|
176 | } |
---|
177 | final ItemQuery<ItemSubtype> subtypesQuery = Base.getSubtypesQuery(itemType); |
---|
178 | try |
---|
179 | { |
---|
180 | final ItemQuery<? extends BioMaterial> query = list.getMemberBioMaterials(); |
---|
181 | cc.configureQuery(dc, query, true); |
---|
182 | members = query.iterate(dc); |
---|
183 | } |
---|
184 | catch (Throwable t) |
---|
185 | { |
---|
186 | cc.setMessage(t.getMessage()); |
---|
187 | t.printStackTrace(); |
---|
188 | } |
---|
189 | int numListed = 0; |
---|
190 | Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc); |
---|
191 | Formatter<Number> numericFormatter = FormatterFactory.getNumberFormatter(sc); |
---|
192 | WellCoordinateFormatter rowFormatter = new WellCoordinateFormatter(true); |
---|
193 | WellCoordinateFormatter columnFormatter = new WellCoordinateFormatter(false); |
---|
194 | |
---|
195 | Enumeration<String, String> wellRows = new Enumeration<String, String>(); |
---|
196 | ItemQuery<PlateGeometry> geometryQuery = PlateGeometry.getQuery(); |
---|
197 | geometryQuery.order(Orders.desc(Hql.property("rows"))); |
---|
198 | ItemResultIterator<PlateGeometry> result = geometryQuery.iterate(dc); |
---|
199 | int maxRows = result.next().getRows(); |
---|
200 | for (int r = 0; r < maxRows && r < 256; r++) |
---|
201 | { |
---|
202 | wellRows.add(Integer.toString(r), rowFormatter.format(r)); |
---|
203 | } |
---|
204 | |
---|
205 | Enumeration<String, String> wellColumns = new Enumeration<String, String>(); |
---|
206 | ItemQuery<PlateGeometry> columnsGeometryQuery = PlateGeometry.getQuery(); |
---|
207 | columnsGeometryQuery.order(Orders.desc(Hql.property("columns"))); |
---|
208 | ItemResultIterator<PlateGeometry> columnsResult = columnsGeometryQuery.iterate(dc); |
---|
209 | int maxColumns = columnsResult.next().getColumns(); |
---|
210 | for (int c = 0; c < maxColumns && c < 256; c++) |
---|
211 | { |
---|
212 | wellColumns.add(Integer.toString(c), columnFormatter.format(c)); |
---|
213 | } |
---|
214 | |
---|
215 | JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, list); |
---|
216 | ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext); |
---|
217 | ExtensionsInvoker columnsInvoker = ListColumnUtil.useExtensions(jspContext); |
---|
218 | %> |
---|
219 | <base:page title="<%=title%>" type="<%=mode.getPageType()%>"> |
---|
220 | <base:head scripts="table.js,tabcontrol-2.js,~members.js" styles="table.css,toolbar.css,headertabcontrol.css,path.css"> |
---|
221 | <ext:scripts context="<%=jspContext%>" /> |
---|
222 | <ext:stylesheets context="<%=jspContext%>" /> |
---|
223 | </base:head> |
---|
224 | |
---|
225 | <base:body> |
---|
226 | <p:path><p:pathelement |
---|
227 | title="Biomaterial lists" href="<%="../index.jsp?ID="+ID%>" |
---|
228 | /><p:pathelement title="<%=HTML.encodeTags(list.getName())%>" |
---|
229 | /></p:path> |
---|
230 | <div id="page-data" class="datacontainer" |
---|
231 | data-item-type="<%=itemType.name()%>" |
---|
232 | ></div> |
---|
233 | <t:tabcontrol |
---|
234 | id="main" |
---|
235 | subclass="content mastertabcontrol" |
---|
236 | active="members"> |
---|
237 | <t:tab id="properties" title="Properties" /> |
---|
238 | |
---|
239 | <t:tab id="members" title="Members"> |
---|
240 | |
---|
241 | <tbl:table |
---|
242 | id="members" |
---|
243 | columns="<%=cc.getSetting("columns")%>" |
---|
244 | sortby="<%=cc.getSortProperty()%>" |
---|
245 | direction="<%=cc.getSortDirection()%>" |
---|
246 | action="index.jsp" |
---|
247 | sc="<%=sc%>" |
---|
248 | item="<%=itemType%>" |
---|
249 | filterrows="<%=cc.getFilterRows()%>" |
---|
250 | subcontext="<%="listmembers."+list.getId()%>" |
---|
251 | subclass="fulltable" |
---|
252 | > |
---|
253 | <tbl:hidden |
---|
254 | name="mode" |
---|
255 | value="<%=mode.getName()%>" |
---|
256 | /> |
---|
257 | <tbl:hidden |
---|
258 | name="callback" |
---|
259 | value="<%=callback%>" |
---|
260 | skip="<%=callback == null%>" |
---|
261 | /> |
---|
262 | <tbl:hidden |
---|
263 | name="list_id" |
---|
264 | value="<%=String.valueOf(bioMaterialListId)%>" |
---|
265 | /> |
---|
266 | <tbl:columndef |
---|
267 | id="name" |
---|
268 | property="name" |
---|
269 | datatype="string" |
---|
270 | title="Name" |
---|
271 | sortable="true" |
---|
272 | filterable="true" |
---|
273 | exportable="true" |
---|
274 | show="always" |
---|
275 | /> |
---|
276 | <tbl:columndef |
---|
277 | id="itemSubtype" |
---|
278 | property="itemSubtype" |
---|
279 | sortproperty="itemSubtype.name" |
---|
280 | exportproperty="itemSubtype.name:string" |
---|
281 | datatype="int" |
---|
282 | enumeration="<%=Enumeration.fromItems(subtypesQuery.list(dc), "-none-")%>" |
---|
283 | title="Type" |
---|
284 | sortable="true" |
---|
285 | filterable="true" |
---|
286 | exportable="true" |
---|
287 | /> |
---|
288 | <tbl:columndef |
---|
289 | id="id" |
---|
290 | clazz="uniquecol" |
---|
291 | property="id" |
---|
292 | datatype="int" |
---|
293 | title="ID" |
---|
294 | sortable="true" |
---|
295 | filterable="true" |
---|
296 | exportable="true" |
---|
297 | /> |
---|
298 | <tbl:columndef |
---|
299 | id="externalId" |
---|
300 | property="externalId" |
---|
301 | datatype="string" |
---|
302 | title="External id" |
---|
303 | sortable="true" |
---|
304 | filterable="true" |
---|
305 | exportable="true" |
---|
306 | /> |
---|
307 | <tbl:columndef |
---|
308 | id="owner" |
---|
309 | property="owner.name" |
---|
310 | datatype="string" |
---|
311 | title="Owner" |
---|
312 | sortable="true" |
---|
313 | filterable="true" |
---|
314 | exportable="true" |
---|
315 | /> |
---|
316 | <tbl:columndef |
---|
317 | id="description" |
---|
318 | property="description" |
---|
319 | datatype="string" |
---|
320 | title="Description" |
---|
321 | sortable="true" |
---|
322 | filterable="true" |
---|
323 | exportable="true" |
---|
324 | /> |
---|
325 | <% |
---|
326 | if (itemType == Item.BIOSOURCE) |
---|
327 | { |
---|
328 | %> |
---|
329 | <tbl:columndef |
---|
330 | id="entryDate" |
---|
331 | property="entryDate" |
---|
332 | datatype="date" |
---|
333 | title="Registered" |
---|
334 | sortable="true" |
---|
335 | filterable="true" |
---|
336 | exportable="true" |
---|
337 | formatter="<%=dateFormatter%>" |
---|
338 | /> |
---|
339 | <tbl:columndef |
---|
340 | id="children" |
---|
341 | title="Child samples" |
---|
342 | property="&children(name)" |
---|
343 | datatype="string" |
---|
344 | filterable="true" |
---|
345 | exportable="true" |
---|
346 | /> |
---|
347 | <% |
---|
348 | } |
---|
349 | if (itemType == Item.SAMPLE || itemType == Item.EXTRACT) |
---|
350 | { |
---|
351 | %> |
---|
352 | <tbl:columndef |
---|
353 | id="originalQuantity" |
---|
354 | property="originalQuantity" |
---|
355 | datatype="float" |
---|
356 | title="Original quantity (µg)" |
---|
357 | sortable="true" |
---|
358 | filterable="true" |
---|
359 | exportable="true" |
---|
360 | unit="<%=microGram%>" |
---|
361 | formatter="<%=numericFormatter%>" |
---|
362 | /> |
---|
363 | <tbl:columndef |
---|
364 | id="remainingQuantity" |
---|
365 | property="remainingQuantity" |
---|
366 | datatype="float" |
---|
367 | title="Remaining quantity (µg)" |
---|
368 | sortable="true" |
---|
369 | filterable="true" |
---|
370 | exportable="true" |
---|
371 | unit="<%=microGram%>" |
---|
372 | formatter="<%=numericFormatter%>" |
---|
373 | /> |
---|
374 | <tbl:columndef |
---|
375 | id="protocol" |
---|
376 | property="creationEvent.protocol" |
---|
377 | sortproperty="creationEvent.protocol.name" |
---|
378 | filterproperty="creationEvent.protocol.name" |
---|
379 | exportproperty="creationEvent.protocol.name" |
---|
380 | datatype="string" |
---|
381 | title="Protocol" |
---|
382 | sortable="true" |
---|
383 | filterable="true" |
---|
384 | exportable="true" |
---|
385 | /> |
---|
386 | <tbl:columndef |
---|
387 | id="eventDate" |
---|
388 | property="creationEvent.eventDate" |
---|
389 | datatype="date" |
---|
390 | title="Created" |
---|
391 | sortable="true" |
---|
392 | filterable="true" |
---|
393 | exportable="true" |
---|
394 | formatter="<%=dateFormatter%>" |
---|
395 | /> |
---|
396 | <tbl:columndef |
---|
397 | id="entryDate" |
---|
398 | property="creationEvent.entryDate" |
---|
399 | datatype="date" |
---|
400 | title="Registered" |
---|
401 | sortable="true" |
---|
402 | filterable="true" |
---|
403 | exportable="true" |
---|
404 | formatter="<%=dateFormatter%>" |
---|
405 | /> |
---|
406 | <% |
---|
407 | Enumeration<String, String> parentTypes = new Enumeration<String, String>(); |
---|
408 | parentTypes.add("", "-none-"); |
---|
409 | if (itemType == Item.SAMPLE) |
---|
410 | { |
---|
411 | parentTypes.add(Integer.toString(Item.BIOSOURCE.getValue()), Item.BIOSOURCE.toString()); |
---|
412 | } |
---|
413 | parentTypes.add(Integer.toString(Item.SAMPLE.getValue()), Item.SAMPLE.toString()); |
---|
414 | if (itemType == Item.EXTRACT) |
---|
415 | { |
---|
416 | parentTypes.add(Integer.toString(Item.EXTRACT.getValue()), Item.EXTRACT.toString()); |
---|
417 | } |
---|
418 | %> |
---|
419 | <tbl:columndef |
---|
420 | id="parentType" |
---|
421 | title="Parent type" |
---|
422 | property="parentType" |
---|
423 | enumeration="<%=parentTypes%>" |
---|
424 | datatype="int" |
---|
425 | filterable="true" |
---|
426 | exportable="true" |
---|
427 | sortable="true" |
---|
428 | /> |
---|
429 | <tbl:columndef |
---|
430 | id="parents" |
---|
431 | title="Parent items" |
---|
432 | property="&creationEvent.sources(bioMaterial.name)" |
---|
433 | sortproperty="parent.name" |
---|
434 | datatype="string" |
---|
435 | filterable="true" |
---|
436 | exportable="true" |
---|
437 | sortable="true" |
---|
438 | /> |
---|
439 | <% |
---|
440 | if (itemType == Item.SAMPLE) |
---|
441 | { |
---|
442 | %> |
---|
443 | <tbl:columndef |
---|
444 | id="children" |
---|
445 | title="Child samples" |
---|
446 | property="&childCreationEvents(event.bioMaterial.name)" |
---|
447 | datatype="string" |
---|
448 | filterable="true" |
---|
449 | exportable="true" |
---|
450 | /> |
---|
451 | <tbl:columndef |
---|
452 | id="extracts" |
---|
453 | title="Child extracts" |
---|
454 | property="&children(name)" |
---|
455 | datatype="string" |
---|
456 | filterable="true" |
---|
457 | exportable="true" |
---|
458 | /> |
---|
459 | <% |
---|
460 | } |
---|
461 | else |
---|
462 | { |
---|
463 | %> |
---|
464 | <tbl:columndef |
---|
465 | id="children" |
---|
466 | title="Child extracts" |
---|
467 | property="&childCreationEvents(event.bioMaterial.name)" |
---|
468 | datatype="string" |
---|
469 | filterable="true" |
---|
470 | exportable="true" |
---|
471 | /> |
---|
472 | <tbl:columndef |
---|
473 | id="physicalBioAssays" |
---|
474 | title="Physical bioassays" |
---|
475 | property="&childCreationEvents(event.physicalBioAssay.name)" |
---|
476 | datatype="string" |
---|
477 | filterable="true" |
---|
478 | exportable="true" |
---|
479 | /> |
---|
480 | <tbl:columndef |
---|
481 | id="tag" |
---|
482 | property="tag.name" |
---|
483 | datatype="string" |
---|
484 | title="Tag" |
---|
485 | sortable="true" |
---|
486 | filterable="true" |
---|
487 | exportable="true" |
---|
488 | /> |
---|
489 | <% |
---|
490 | } |
---|
491 | %> |
---|
492 | <tbl:columndef |
---|
493 | id="bioPlate" |
---|
494 | property="bioWell.bioPlate.name" |
---|
495 | sortproperty="bioWell.bioPlate.name" |
---|
496 | filterproperty="bioWell.bioPlate.name" |
---|
497 | exportproperty="bioWell.bioPlate.name" |
---|
498 | datatype="string" |
---|
499 | title="Bioplate" |
---|
500 | sortable="true" |
---|
501 | filterable="true" |
---|
502 | exportable="true" |
---|
503 | /> |
---|
504 | <tbl:columndef |
---|
505 | id="bioWellRow" |
---|
506 | property="bioWell.row" |
---|
507 | sortproperty="bioWell.row" |
---|
508 | datatype="int" |
---|
509 | title="Biowell row" |
---|
510 | filterable="true" |
---|
511 | enumeration="<%=wellRows%>" |
---|
512 | exportable="true" |
---|
513 | sortable="true" |
---|
514 | formatter="<%=rowFormatter%>" |
---|
515 | /> |
---|
516 | <tbl:columndef |
---|
517 | id="bioWellColumn" |
---|
518 | property="bioWell.column" |
---|
519 | sortproperty="bioWell.column" |
---|
520 | datatype="int" |
---|
521 | title="Biowell column" |
---|
522 | filterable="true" |
---|
523 | enumeration="<%=wellColumns%>" |
---|
524 | exportable="true" |
---|
525 | sortable="true" |
---|
526 | formatter="<%=columnFormatter%>" |
---|
527 | /> |
---|
528 | <% |
---|
529 | } |
---|
530 | %> |
---|
531 | <% |
---|
532 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
533 | { |
---|
534 | AnnotationType at = loader.getAnnotationType(); |
---|
535 | Enumeration<String, String> annotationEnum = null; |
---|
536 | Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); |
---|
537 | if (at.isEnumeration()) |
---|
538 | { |
---|
539 | annotationEnum = new Enumeration<String, String>(); |
---|
540 | List<?> values = at.getValues(); |
---|
541 | for (Object value : values) |
---|
542 | { |
---|
543 | String encoded = formatter.format(value); |
---|
544 | annotationEnum.add(encoded, encoded); |
---|
545 | } |
---|
546 | } |
---|
547 | %> |
---|
548 | <tbl:columndef |
---|
549 | id="<%="at"+at.getId()%>" |
---|
550 | title="<%=HTML.encodeTags(at.getName())+" [A]"%>" |
---|
551 | property="<%="#"+at.getId()%>" |
---|
552 | annotation="true" |
---|
553 | datatype="<%=at.getValueType().getStringValue()%>" |
---|
554 | enumeration="<%=annotationEnum%>" |
---|
555 | smartenum="<%=at.getDisplayAsList() %>" |
---|
556 | sortable="<%=at.getMultiplicity() == 1%>" |
---|
557 | filterable="true" |
---|
558 | exportable="true" |
---|
559 | formatter="<%=formatter%>" |
---|
560 | unit="<%=at.getDefaultUnit()%>" |
---|
561 | /> |
---|
562 | <% |
---|
563 | } |
---|
564 | %> |
---|
565 | <tbl:columndef |
---|
566 | id="permission" |
---|
567 | title="Permission" |
---|
568 | /> |
---|
569 | <tbl:columndef |
---|
570 | id="sharedTo" |
---|
571 | title="Shared to" |
---|
572 | filterable="true" |
---|
573 | filterproperty="!sharedTo.name" |
---|
574 | datatype="string" |
---|
575 | /> |
---|
576 | <tbl:columndef |
---|
577 | id="xt-columns" |
---|
578 | extensions="<%=columnsInvoker%>" |
---|
579 | jspcontext="<%=jspContext%>" |
---|
580 | /> |
---|
581 | <div class="panelgroup bg-filled-50 bottomborder"> |
---|
582 | <tbl:toolbar |
---|
583 | subclass="bottomborder" |
---|
584 | visible="<%=mode.hasToolbar()%>" |
---|
585 | > |
---|
586 | <tbl:button |
---|
587 | id="btnAddMembers" |
---|
588 | disabled="<%=addPermission ? false : true%>" |
---|
589 | image="add.png" |
---|
590 | title="Add…" |
---|
591 | tooltip="<%=addPermission ? "Add more biomaterials to this list" : "You do not have permission to add biomaterial" %>" |
---|
592 | /> |
---|
593 | <tbl:button |
---|
594 | id="btnRemoveMembers" |
---|
595 | disabled="<%=removePermission ? false : true%>" |
---|
596 | image="remove.png" |
---|
597 | title="Remove…" |
---|
598 | tooltip="<%=removePermission ? "Remove the selected items from this list" : "You do not have permission to remove items" %>" |
---|
599 | /> |
---|
600 | <tbl:button |
---|
601 | id="btnDeleteItems" |
---|
602 | image="delete.png" |
---|
603 | title="Delete" |
---|
604 | tooltip="Delete the selected items" |
---|
605 | /> |
---|
606 | <tbl:button |
---|
607 | id="btnRestoreItems" |
---|
608 | image="restore.png" |
---|
609 | title="Restore" |
---|
610 | tooltip="Restore the selected (deleted) items" |
---|
611 | /> |
---|
612 | <tbl:button |
---|
613 | id="btnShareItems" |
---|
614 | image="share.png" |
---|
615 | title="Share…" |
---|
616 | tooltip="Share the selected items" |
---|
617 | /> |
---|
618 | <tbl:button |
---|
619 | id="btnSetOwner" |
---|
620 | image="take_ownership.png" |
---|
621 | title="Set owner…" |
---|
622 | tooltip="Change owner of the selected items" |
---|
623 | /> |
---|
624 | <tbl:button |
---|
625 | id="btnColumns" |
---|
626 | image="columns.png" |
---|
627 | title="Columns…" |
---|
628 | tooltip="Show, hide and re-order columns" |
---|
629 | /> |
---|
630 | <tbl:button |
---|
631 | id="btnPlaceOnPlate" |
---|
632 | image="place_on_plate.png" |
---|
633 | title="Place on plate…" |
---|
634 | tooltip="Place the selected/matching biomaterial on a bioplate" |
---|
635 | visible="<%=itemType != Item.BIOSOURCE%>" |
---|
636 | /> |
---|
637 | <tbl:button |
---|
638 | id="btnImport" |
---|
639 | data-plugin-type="IMPORT" |
---|
640 | image="import.png" |
---|
641 | title="Import…" |
---|
642 | tooltip="Import data" |
---|
643 | visible="<%=pluginCount.containsKey(Plugin.MainType.IMPORT)%>" |
---|
644 | /> |
---|
645 | <tbl:button |
---|
646 | id="btnExport" |
---|
647 | data-plugin-type="EXPORT" |
---|
648 | image="export.png" |
---|
649 | title="Export…" |
---|
650 | tooltip="Export data" |
---|
651 | visible="<%=pluginCount.containsKey(Plugin.MainType.EXPORT)%>" |
---|
652 | /> |
---|
653 | <tbl:button |
---|
654 | id="btnRunPlugin" |
---|
655 | data-plugin-type="OTHER" |
---|
656 | image="runplugin.png" |
---|
657 | title="Run plugin…" |
---|
658 | tooltip="Run a plugin" |
---|
659 | visible="<%=pluginCount.containsKey(Plugin.MainType.OTHER)%>" |
---|
660 | /> |
---|
661 | <ext:render extensions="<%=invoker%>" context="<%=jspContext%>" |
---|
662 | wrapper="<%=new PrefixSuffixRenderer(jspContext, "<td>", "</td>") %>"/> |
---|
663 | </tbl:toolbar> |
---|
664 | <tbl:panel> |
---|
665 | <tbl:presetselector /> |
---|
666 | <tbl:navigator |
---|
667 | page="<%=cc.getPage()%>" |
---|
668 | rowsperpage="<%=cc.getRowsPerPage()%>" |
---|
669 | totalrows="<%=members == null ? 0 : members.getTotalCount()%>" |
---|
670 | visible="<%=mode.hasNavigator()%>" |
---|
671 | /> |
---|
672 | </tbl:panel> |
---|
673 | </div> |
---|
674 | <tbl:data> |
---|
675 | <tbl:headers> |
---|
676 | <tbl:headerrow> |
---|
677 | <tbl:header colspan="3" /> |
---|
678 | <tbl:columnheaders /> |
---|
679 | </tbl:headerrow> |
---|
680 | <% |
---|
681 | int numFilters = cc.getNumPropertyFilters(); |
---|
682 | int numRows = cc.getFilterRows(); |
---|
683 | for (int filterNo = 0; filterNo < numRows; filterNo++) |
---|
684 | { |
---|
685 | boolean lastRow = filterNo == numRows-1; |
---|
686 | %> |
---|
687 | <tbl:headerrow> |
---|
688 | <tbl:header subclass="index" /> |
---|
689 | <tbl:header |
---|
690 | subclass="check" |
---|
691 | visible="<%=mode.hasCheck()%>" |
---|
692 | ><base:icon |
---|
693 | id="check.uncheck" |
---|
694 | image="check_uncheck.png" |
---|
695 | tooltip="Check/uncheck all" |
---|
696 | visible="<%=lastRow%>" |
---|
697 | /></tbl:header> |
---|
698 | <tbl:header |
---|
699 | subclass="check" |
---|
700 | visible="<%=mode.hasRadio()%>" |
---|
701 | /> |
---|
702 | <tbl:header |
---|
703 | subclass="icons" |
---|
704 | visible="<%=mode.hasIcons()%>" |
---|
705 | > |
---|
706 | <base:icon |
---|
707 | subclass="link table-filter-row-action" |
---|
708 | image="add.png" |
---|
709 | tooltip="Add extra filter row" |
---|
710 | visible="<%=lastRow%>" |
---|
711 | /><base:icon |
---|
712 | subclass="link table-filter-row-action" |
---|
713 | image="remove.png" |
---|
714 | tooltip="Remove this filter row" |
---|
715 | visible="<%=numRows > 1 || numFilters > 0 %>" |
---|
716 | data-remove-row="<%=filterNo%>" |
---|
717 | /> |
---|
718 | </tbl:header> |
---|
719 | <tbl:propertyfilter row="<%=filterNo%>" /> |
---|
720 | </tbl:headerrow> |
---|
721 | <% |
---|
722 | } |
---|
723 | %> |
---|
724 | </tbl:headers> |
---|
725 | <tbl:rows> |
---|
726 | <% |
---|
727 | if (cc.getMessage() != null) |
---|
728 | { |
---|
729 | %> |
---|
730 | <tbl:panel subclass="bg-filled-50"> |
---|
731 | <div class="messagecontainer error"><%=cc.getMessage()%></div> |
---|
732 | </tbl:panel> |
---|
733 | <% |
---|
734 | cc.setMessage(null); |
---|
735 | } |
---|
736 | int index = cc.getPage()*cc.getRowsPerPage(); |
---|
737 | int selectedItemId = cc.getId(); |
---|
738 | if (members != null) |
---|
739 | { |
---|
740 | while (members.hasNext()) |
---|
741 | { |
---|
742 | BioMaterial item = members.next(); |
---|
743 | int itemId = item.getId(); |
---|
744 | boolean sharePermission = item.hasPermission(Permission.SET_PERMISSION); |
---|
745 | boolean writePermission = item.hasPermission(Permission.WRITE); |
---|
746 | |
---|
747 | MeasuredBioMaterial mbm = null; |
---|
748 | BioMaterialEvent creationEvent = null; |
---|
749 | Item parentType = null; |
---|
750 | |
---|
751 | if (item instanceof MeasuredBioMaterial) |
---|
752 | { |
---|
753 | mbm = (MeasuredBioMaterial)item; |
---|
754 | creationEvent = mbm.getCreationEvent(); |
---|
755 | parentType = mbm.getParentType(); |
---|
756 | } |
---|
757 | |
---|
758 | boolean deletePermission = item.hasPermission(Permission.DELETE); |
---|
759 | String name = HTML.encodeTags(item.getName()); |
---|
760 | String tooltip = mode.isSelectionMode() ? |
---|
761 | "Select this item" : "View this item" + (writePermission ? " (use CTRL, ALT or SHIFT to edit)" : ""); |
---|
762 | index++; |
---|
763 | numListed++; |
---|
764 | %> |
---|
765 | <tbl:row> |
---|
766 | <tbl:header |
---|
767 | clazz="index" |
---|
768 | ><%=index%></tbl:header> |
---|
769 | <tbl:header |
---|
770 | clazz="check" |
---|
771 | visible="<%=mode.hasCheck()%>" |
---|
772 | ><input |
---|
773 | type="checkbox" |
---|
774 | name="<%=itemId%>" |
---|
775 | value="<%=itemId%>" |
---|
776 | title="<%=name%>" |
---|
777 | <%=cc.getSelected().contains(itemId) ? "checked" : ""%> |
---|
778 | ></tbl:header> |
---|
779 | <tbl:header |
---|
780 | clazz="check" |
---|
781 | visible="<%=mode.hasRadio()%>" |
---|
782 | ><input |
---|
783 | type="radio" |
---|
784 | name="item_id" |
---|
785 | value="<%=itemId%>" |
---|
786 | title="<%=name%>" |
---|
787 | <%=selectedItemId == itemId ? "checked" : ""%> |
---|
788 | ></tbl:header> |
---|
789 | <tbl:header |
---|
790 | clazz="icons" |
---|
791 | visible="<%=mode.hasIcons()%>" |
---|
792 | ><base:icon |
---|
793 | image="deleted.png" |
---|
794 | id="<%="delete."+itemId %>" |
---|
795 | subclass="<%=deletePermission ? "table-delete-item" : null %>" |
---|
796 | data-item-id="<%=itemId%>" |
---|
797 | tooltip="This item has been scheduled for deletion" |
---|
798 | visible="<%=item.isRemoved()%>" |
---|
799 | /><base:icon |
---|
800 | image="shared.png" |
---|
801 | id="<%="share."+itemId %>" |
---|
802 | subclass="<%=sharePermission ? "table-share-item" : null %>" |
---|
803 | data-item-id="<%=itemId%>" |
---|
804 | tooltip="This item is shared to other users, groups and/or projects" |
---|
805 | visible="<%=item.isShared()%>" |
---|
806 | /> </tbl:header> |
---|
807 | <tbl:cell column="name"><div |
---|
808 | class="link table-item" |
---|
809 | data-item-id="<%=itemId%>" |
---|
810 | data-no-edit="<%=writePermission ? 0 : 1 %>" |
---|
811 | tabindex="0" |
---|
812 | title="<%=tooltip%>"><%=name%></div></tbl:cell> |
---|
813 | <tbl:cell column="id"><%=item.getId()%></tbl:cell> |
---|
814 | <tbl:cell column="itemSubtype"><base:propertyvalue |
---|
815 | item="<%=item%>" |
---|
816 | property="itemSubtype" |
---|
817 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
818 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
819 | /></tbl:cell> |
---|
820 | <tbl:cell column="externalId"><%=HTML.encodeTags(item.getExternalId())%></tbl:cell> |
---|
821 | <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> |
---|
822 | <tbl:cell column="owner" |
---|
823 | ><base:propertyvalue |
---|
824 | item="<%=item%>" |
---|
825 | property="owner" |
---|
826 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
827 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
828 | /></tbl:cell> |
---|
829 | <% |
---|
830 | if (itemType == Item.BIOSOURCE) |
---|
831 | { |
---|
832 | %> |
---|
833 | <tbl:cell column="entryDate" value="<%=((BioSource)item).getEntryDate()%>" /> |
---|
834 | <% |
---|
835 | } |
---|
836 | if (mbm != null) |
---|
837 | { |
---|
838 | %> |
---|
839 | <tbl:cell column="originalQuantity" value="<%=mbm.getOriginalQuantity()%>" /> |
---|
840 | <tbl:cell column="remainingQuantity" value="<%=mbm.getRemainingQuantity()%>" /> |
---|
841 | <tbl:cell column="protocol" |
---|
842 | ><base:propertyvalue |
---|
843 | item="<%=creationEvent%>" |
---|
844 | property="protocol" |
---|
845 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
846 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
847 | /></tbl:cell> |
---|
848 | <% |
---|
849 | BioWell well = null; |
---|
850 | boolean readBioWell = true; |
---|
851 | try |
---|
852 | { |
---|
853 | well = mbm.getBioWell(); |
---|
854 | } |
---|
855 | catch(PermissionDeniedException e) |
---|
856 | { |
---|
857 | readBioWell = false; |
---|
858 | } |
---|
859 | if (!readBioWell) |
---|
860 | { |
---|
861 | %> |
---|
862 | <tbl:cell column="bioWellRow"><i>- denied -</i> </tbl:cell> |
---|
863 | <tbl:cell column="bioWellColumn"><i>- denied -</i> </tbl:cell> |
---|
864 | <tbl:cell column="bioPlate"><i>- denied -</i> </tbl:cell> |
---|
865 | <% |
---|
866 | } |
---|
867 | else if (well == null) |
---|
868 | { |
---|
869 | %> |
---|
870 | <tbl:cell column="bioWellRow"><i>- none -</i> </tbl:cell> |
---|
871 | <tbl:cell column="bioWellColumn"><i>- none -</i> </tbl:cell> |
---|
872 | <tbl:cell column="bioPlate"><i>- none -</i> </tbl:cell> |
---|
873 | <% |
---|
874 | |
---|
875 | } |
---|
876 | else |
---|
877 | { |
---|
878 | %> |
---|
879 | <tbl:cell column="bioWellRow"> |
---|
880 | <tbl:cellvalue value="<%=well.getRow()%>"/> |
---|
881 | </tbl:cell> |
---|
882 | <tbl:cell column="bioWellColumn"> |
---|
883 | <tbl:cellvalue value="<%=well.getColumn()%>"/> |
---|
884 | </tbl:cell> |
---|
885 | <tbl:cell column="bioPlate"><%=Base.getLinkedName(ID, well.getPlate(), false, true)%></tbl:cell> |
---|
886 | <% |
---|
887 | } |
---|
888 | %> |
---|
889 | <tbl:cell column="eventDate" value="<%=creationEvent.getEventDate()%>" /> |
---|
890 | <tbl:cell column="entryDate" value="<%=creationEvent.getEntryDate()%>" /> |
---|
891 | <tbl:cell column="parentType"><%=parentType == null ? "" : parentType.toString() %></tbl:cell> |
---|
892 | |
---|
893 | <tbl:cell column="parents"> |
---|
894 | <% |
---|
895 | if (mbm.hasSingleParent() || parentType == null) |
---|
896 | { |
---|
897 | %> |
---|
898 | <base:propertyvalue item="<%=item%>" property="parent"/> |
---|
899 | <% |
---|
900 | } |
---|
901 | else |
---|
902 | { |
---|
903 | String separator = ""; |
---|
904 | ItemQuery<MeasuredBioMaterial> parentsQuery = (ItemQuery<MeasuredBioMaterial>)(parentType == Item.SAMPLE ? parentSamplesQuery : parentExtractsQuery); |
---|
905 | parentsQuery.setEntityParameter("creationEvent", creationEvent); |
---|
906 | for (MeasuredBioMaterial s : parentsQuery.list(dc)) |
---|
907 | { |
---|
908 | out.write(separator); |
---|
909 | if (mode.hasPropertyLink()) |
---|
910 | { |
---|
911 | out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink())); |
---|
912 | } |
---|
913 | else |
---|
914 | { |
---|
915 | out.write(HTML.encodeTags(s.getName())); |
---|
916 | } |
---|
917 | separator = ", "; |
---|
918 | } |
---|
919 | } |
---|
920 | %> |
---|
921 | <%=parentType != null ? "<span class=\"itemsubtype\">(" + parentType + ")</span>" : "" %> |
---|
922 | </tbl:cell> |
---|
923 | <% |
---|
924 | } |
---|
925 | %> |
---|
926 | <tbl:cell column="tag" |
---|
927 | ><base:propertyvalue |
---|
928 | item="<%=item%>" |
---|
929 | property="tag" |
---|
930 | enableEditLink="<%=mode.hasEditLink()%>" |
---|
931 | enablePropertyLink="<%=mode.hasPropertyLink()%>" |
---|
932 | /></tbl:cell> |
---|
933 | <tbl:cell column="children"> |
---|
934 | <% |
---|
935 | String separator = ""; |
---|
936 | ItemQuery<MeasuredBioMaterial> childQuery = (ItemQuery<MeasuredBioMaterial>)(itemType == Item.EXTRACT ? childExtractsQuery : childSamplesQuery); |
---|
937 | childQuery.setEntityParameter("parent", item); |
---|
938 | for (MeasuredBioMaterial s : childQuery.list(dc)) |
---|
939 | { |
---|
940 | out.write(separator); |
---|
941 | if (mode.hasPropertyLink()) |
---|
942 | { |
---|
943 | out.write(Base.getLinkedName(ID, s, false, mode.hasEditLink())); |
---|
944 | } |
---|
945 | else |
---|
946 | { |
---|
947 | out.write(HTML.encodeTags(s.getName())); |
---|
948 | } |
---|
949 | separator = ", "; |
---|
950 | } |
---|
951 | %> |
---|
952 | </tbl:cell> |
---|
953 | <tbl:cell column="extracts"> |
---|
954 | <% |
---|
955 | childExtractsQuery.setEntityParameter("parent", item); |
---|
956 | try |
---|
957 | { |
---|
958 | String separator = ""; |
---|
959 | for(Extract e : childExtractsQuery.list(dc)) |
---|
960 | { |
---|
961 | out.write(separator); |
---|
962 | if (mode.hasPropertyLink()) |
---|
963 | { |
---|
964 | out.write(Base.getLinkedName(ID, e, false, mode.hasEditLink())); |
---|
965 | } |
---|
966 | else |
---|
967 | { |
---|
968 | out.write(HTML.encodeTags(e.getName())); |
---|
969 | } |
---|
970 | separator = ", "; |
---|
971 | } |
---|
972 | } |
---|
973 | catch (Throwable t) |
---|
974 | { |
---|
975 | %> |
---|
976 | <div class="error"><%=t.getMessage()%></div> |
---|
977 | <% |
---|
978 | } |
---|
979 | %> |
---|
980 | </tbl:cell> |
---|
981 | <tbl:cell column="physicalBioAssays"> |
---|
982 | <% |
---|
983 | try |
---|
984 | { |
---|
985 | bioAssayQuery.setEntityParameter("extract", item); |
---|
986 | String separator = ""; |
---|
987 | for (PhysicalBioAssay pba : bioAssayQuery.list(dc)) |
---|
988 | { |
---|
989 | out.write(separator); |
---|
990 | if (mode.hasPropertyLink()) |
---|
991 | { |
---|
992 | out.write(Base.getLinkedName(ID, pba, false, mode.hasEditLink())); |
---|
993 | } |
---|
994 | else |
---|
995 | { |
---|
996 | out.write(HTML.encodeTags(pba.getName())); |
---|
997 | } |
---|
998 | separator = ", "; |
---|
999 | } |
---|
1000 | } |
---|
1001 | catch (Throwable t) |
---|
1002 | { |
---|
1003 | %> |
---|
1004 | <div class="error"><%=t.getMessage()%></div> |
---|
1005 | <% |
---|
1006 | } |
---|
1007 | %> |
---|
1008 | </tbl:cell> |
---|
1009 | <% |
---|
1010 | if (item.isAnnotated()) |
---|
1011 | { |
---|
1012 | AnnotationSetSnapshot snapshot = manager.getSnapshot(dc, item.getAnnotationSet().getId()); |
---|
1013 | for (AnnotationLoaderUtil loader : annotationLoaders) |
---|
1014 | { |
---|
1015 | if (loader.find(snapshot)) |
---|
1016 | { |
---|
1017 | %> |
---|
1018 | <tbl:cell |
---|
1019 | column="<%="at"+loader.getId()%>" |
---|
1020 | ><tbl:cellvalue |
---|
1021 | list="<%=loader.getValues()%>" |
---|
1022 | suffix="<%=loader.getUnitSymbol()%>" |
---|
1023 | /></tbl:cell> |
---|
1024 | <% |
---|
1025 | } |
---|
1026 | } |
---|
1027 | } |
---|
1028 | %> |
---|
1029 | <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell> |
---|
1030 | <tbl:cell column="sharedTo"> |
---|
1031 | <% |
---|
1032 | Iterator<Nameable> sharees = ShareableUtil.getSharedTo(dc, item).iterator(); |
---|
1033 | while(sharees.hasNext()) |
---|
1034 | { |
---|
1035 | Nameable n = sharees.next(); |
---|
1036 | if (mode.hasPropertyLink()) |
---|
1037 | { |
---|
1038 | out.write(Base.getLinkedName(ID, n, false, mode.hasEditLink())); |
---|
1039 | } |
---|
1040 | else |
---|
1041 | { |
---|
1042 | out.write(HTML.encodeTags(n.getName())); |
---|
1043 | } |
---|
1044 | out.write(sharees.hasNext() ? ", " : ""); |
---|
1045 | } |
---|
1046 | %> |
---|
1047 | </tbl:cell> |
---|
1048 | <tbl:xt-cells dc="<%=dc%>" item="<%=item%>"> |
---|
1049 | <tbl:cell column="xt-columns" /> |
---|
1050 | </tbl:xt-cells> |
---|
1051 | </tbl:row> |
---|
1052 | <% |
---|
1053 | } |
---|
1054 | } |
---|
1055 | if (numListed == 0) |
---|
1056 | { |
---|
1057 | %> |
---|
1058 | <tbl:panel subclass="bg-filled-50"> |
---|
1059 | <div class="messagecontainer note"> |
---|
1060 | <%=members == null || members.getTotalCount() == 0 ? "No members were found" : "No members on this page. Please select another page!" %> |
---|
1061 | </div> |
---|
1062 | </tbl:panel> |
---|
1063 | <% |
---|
1064 | } |
---|
1065 | %> |
---|
1066 | </tbl:rows> |
---|
1067 | </tbl:data> |
---|
1068 | </tbl:table> |
---|
1069 | </t:tab> |
---|
1070 | <t:tab id="overview" title="Overview" |
---|
1071 | tooltip="Display a tree overview of related items" /> |
---|
1072 | </t:tabcontrol> |
---|
1073 | |
---|
1074 | <base:buttongroup subclass="dialogbuttons"> |
---|
1075 | <base:button id="btnOk" title="Ok" visible="<%=mode.hasOkButton()%>" /> |
---|
1076 | <base:button id="close" title="Cancel" visible="<%=mode.hasCancelButton()%>" /> |
---|
1077 | <base:button id="close" title="Close" visible="<%=mode.hasCloseButton()%>" /> |
---|
1078 | </base:buttongroup> |
---|
1079 | |
---|
1080 | |
---|
1081 | </base:body> |
---|
1082 | </base:page> |
---|
1083 | <% |
---|
1084 | } |
---|
1085 | finally |
---|
1086 | { |
---|
1087 | if (members != null) members.close(); |
---|
1088 | if (dc != null) dc.close(); |
---|
1089 | } |
---|
1090 | %> |
---|