Changeset 4539 for trunk/www/biomaterials/samples/view_sample.jsp
- Timestamp:
- Sep 18, 2008, 5:16:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/samples/view_sample.jsp
r4510 r4539 38 38 import="net.sf.basedb.core.User" 39 39 import="net.sf.basedb.core.Group" 40 import="net.sf.basedb.core.ItemProxy" 40 41 import="net.sf.basedb.core.ItemQuery" 41 42 import="net.sf.basedb.core.ItemResultIterator" … … 56 57 import="net.sf.basedb.util.formatter.Formatter" 57 58 import="net.sf.basedb.clients.web.formatter.FormatterFactory" 59 import="java.util.ArrayList" 58 60 import="java.util.Collections" 59 61 import="java.util.Date" … … 369 371 <% 370 372 } 373 374 // Samples this item is pooled in. 375 Set<ItemProxy> childSet = sample.getUsingItems(); 376 List<Sample> childSamples = new ArrayList<Sample>(); 377 for (ItemProxy itemProxy : childSet) 378 { 379 if (Item.SAMPLE.equals(itemProxy.getType())) 380 { 381 childSamples.add((Sample)itemProxy.getItem(dc)); 382 } 383 } 384 if (childSamples.size() == 0) 385 { 386 %> 387 <h4>Pooled in extracts</h4> 388 No samples have been pooled from this sample 389 (or, you don't have permission to view them). 390 <% 391 } 392 else 393 { 394 %> 395 <h4 class="docked">Pooled in samples</h4> 396 <tbl:table 397 id="poolChilds" 398 clazz="itemlist" 399 columns="all" 400 > 401 <tbl:columndef 402 id="name" 403 title="Name" 404 /> 405 <tbl:columndef 406 id="quantity" 407 title="Original quantity (µg)" 408 /> 409 <tbl:columndef 410 id="parents" 411 title="Used samples[quantity]" 412 /> 413 <tbl:columndef 414 id="description" 415 title="Description" 416 /> 417 <tbl:data> 418 <tbl:columns></tbl:columns> 419 <tbl:rows> 420 <% 421 for (Sample s : childSamples) 422 { 423 BioMaterialEvent poolEvent = s.getCreationEvent(); 424 ItemQuery<Sample> samplesQuery = (ItemQuery<Sample>)poolEvent.getSources(); 425 samplesQuery.include(Include.ALL); 426 samplesQuery.order(Orders.asc(Hql.property("name"))); 427 ItemResultList<Sample> parentSamples = samplesQuery.list(dc); 428 %> 429 <tbl:row> 430 <tbl:cell column="name"> 431 <base:icon 432 image="deleted.gif" 433 tooltip="This item has been scheduled for deletion" 434 visible="<%=s.isRemoved()%>" 435 /> 436 <%=Base.getLinkedName(ID, s, false, true)%> 437 </tbl:cell> 438 <tbl:cell column="quantity"><%=Values.formatNumber(s.getOriginalQuantity(), 2)%></tbl:cell> 439 <tbl:cell column="parents"> 440 <% 441 String separator = ""; 442 for (Sample parent : parentSamples) 443 { 444 out.write(separator); 445 if (parent.equals(sample)) 446 out.write(HTML.encodeTags(parent.getName())); 447 else 448 out.write(Base.getLinkedName(ID, parent, false, true)); 449 out.write("[" + Values.formatNumber(poolEvent.getUsedQuantity(parent), 2) + "µg]"); 450 separator = ", "; 451 } 452 %> 453 </tbl:cell> 454 <tbl:cell column="description"><%=HTML.encodeTags(s.getDescription())%></tbl:cell> 455 </tbl:row> 456 <% 457 } 458 %> 459 </tbl:rows> 460 </tbl:data> 461 </tbl:table> 462 <% 463 } 464 465 // Extracts created from this sample 371 466 ItemQuery<Extract> extractQuery = sample.getExtracts(); 372 467 extractQuery.include(Include.ALL);
Note: See TracChangeset
for help on using the changeset viewer.