Changeset 5044
- Timestamp:
- Aug 11, 2009, 4:35:03 PM (13 years ago)
- Location:
- trunk/www
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/biomaterials/bioplates/view_bioplate.jsp
r4889 r5044 39 39 import="net.sf.basedb.core.ItemQuery" 40 40 import="net.sf.basedb.core.Include" 41 import="net.sf.basedb.core.ItemResultIterator"42 41 import="net.sf.basedb.core.ItemResultList" 43 42 import="net.sf.basedb.core.MultiPermissions" … … 288 287 // Tables with users/groups/projects that this item is shared to 289 288 MultiPermissions mp = new MultiPermissions(Collections.singleton(bioplate)); 290 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 291 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 292 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 289 ItemResultList<User> users = mp.getUsers().list(dc); 290 ItemResultList<Group> groups = mp.getGroups().list(dc); 291 ItemResultList<Project> projects = mp.getProjects().list(dc); 292 int totalShare = users.size() + groups.size() + projects.size(); 293 293 294 if ( users.hasNext() || groups.hasNext() || projects.hasNext())294 if (totalShare > 0) 295 295 { 296 296 %> 297 <h4 class="docked">Shared to</h4> 298 <tbl:table 299 id="itemsSharedTo" 300 clazz="itemlist" 301 columns="all" 302 > 303 <tbl:columndef 304 id="itemType" 305 title="Item type" 306 /> 307 <tbl:columndef 308 id="name" 309 title="Name" 310 /> 311 <tbl:columndef 312 id="permissions" 313 title="Permissions" 314 /> 315 <tbl:data> 316 <tbl:columns> 317 </tbl:columns> 318 <tbl:rows> 319 <% 320 while(projects.hasNext()) 321 { 322 Project project = projects.next(); 323 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 324 %> 325 <tbl:row> 326 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 327 <tbl:cell column="name"><base:icon 328 image="deleted.gif" 329 tooltip="This item has been scheduled for deletion" 330 visible="<%=project.isRemoved()%>" 331 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 332 <tbl:cell column="permissions"> 333 <%=PermissionUtil.translatePermissionsToString(permissions)%> 334 </tbl:cell> 335 </tbl:row> 297 <base:section 298 id="sharedTo" 299 title="<%="Shared to (" + totalShare + ")"%>" 300 context="<%=cc%>" 301 > 302 <tbl:table 303 id="itemsSharedTo" 304 clazz="itemlist" 305 columns="all" 306 > 307 <tbl:columndef 308 id="itemType" 309 title="Item type" 310 /> 311 <tbl:columndef 312 id="name" 313 title="Name" 314 /> 315 <tbl:columndef 316 id="permissions" 317 title="Permissions" 318 /> 319 <tbl:data> 320 <tbl:columns> 321 </tbl:columns> 322 <tbl:rows> 336 323 <% 337 } 338 while(groups.hasNext()) 339 { 340 Group group = groups.next(); 341 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 324 for (Project project : projects) 325 { 326 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 327 %> 328 <tbl:row> 329 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 330 <tbl:cell column="name"><base:icon 331 image="deleted.gif" 332 tooltip="This item has been scheduled for deletion" 333 visible="<%=project.isRemoved()%>" 334 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 335 <tbl:cell column="permissions"> 336 <%=PermissionUtil.translatePermissionsToString(permissions)%> 337 </tbl:cell> 338 </tbl:row> 339 <% 340 } 341 for (Group group : groups) 342 { 343 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 344 %> 345 <tbl:row> 346 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 347 <tbl:cell column="name"><base:icon 348 image="deleted.gif" 349 tooltip="This item has been scheduled for deletion" 350 visible="<%=group.isRemoved()%>" 351 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 352 <tbl:cell column="permissions"> 353 <%=PermissionUtil.translatePermissionsToString(permissions)%> 354 </tbl:cell> 355 </tbl:row> 356 <% 357 } 358 for (User user : users) 359 { 360 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 361 %> 362 <tbl:row> 363 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 364 <tbl:cell column="name"><base:icon 365 image="deleted.gif" 366 tooltip="This item has been scheduled for deletion" 367 visible="<%=user.isRemoved()%>" 368 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 369 <tbl:cell column="permissions"> 370 <%=PermissionUtil.translatePermissionsToString(permissions)%> 371 </tbl:cell> 372 </tbl:row> 373 <% 374 } 342 375 %> 343 <tbl:row> 344 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 345 <tbl:cell column="name"><base:icon 346 image="deleted.gif" 347 tooltip="This item has been scheduled for deletion" 348 visible="<%=group.isRemoved()%>" 349 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 350 <tbl:cell column="permissions"> 351 <%=PermissionUtil.translatePermissionsToString(permissions)%> 352 </tbl:cell> 353 </tbl:row> 354 <% 355 } 356 while (users.hasNext()) 357 { 358 User user = users.next(); 359 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 360 %> 361 <tbl:row> 362 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 363 <tbl:cell column="name"><base:icon 364 image="deleted.gif" 365 tooltip="This item has been scheduled for deletion" 366 visible="<%=user.isRemoved()%>" 367 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 368 <tbl:cell column="permissions"> 369 <%=PermissionUtil.translatePermissionsToString(permissions)%> 370 </tbl:cell> 371 </tbl:row> 372 <% 373 } 374 %> 375 </tbl:rows> 376 </tbl:data> 377 </tbl:table> 376 </tbl:rows> 377 </tbl:data> 378 </tbl:table> 379 </base:section> 378 380 <% 379 381 } -
trunk/www/biomaterials/biosources/view_biosource.jsp
r4889 r5044 40 40 import="net.sf.basedb.core.ItemQuery" 41 41 import="net.sf.basedb.core.ItemResultList" 42 import="net.sf.basedb.core.ItemResultIterator"43 42 import="net.sf.basedb.core.PermissionDeniedException" 44 43 import="net.sf.basedb.core.PluginDefinition" … … 311 310 { 312 311 %> 313 <h4 class="docked">Samples</h4> 314 <tbl:table 315 id="samples" 316 clazz="itemlist" 317 columns="all" 312 <base:section 313 id="sampleSection" 314 title="<%="Samples (" + samples.size() + ")"%>" 315 context="<%=cc%>" 318 316 > 319 <tbl:columndef 320 id="name" 321 title="Name" 322 /> 323 <tbl:columndef 324 id="description" 325 title="Description" 326 /> 327 <tbl:data> 328 <tbl:columns> 329 </tbl:columns> 330 <tbl:rows> 331 <% 332 for (Sample item : samples) 333 { 334 %> 335 <tbl:row> 336 <tbl:cell column="name"><base:icon 337 image="deleted.gif" 338 tooltip="This item has been scheduled for deletion" 339 visible="<%=item.isRemoved()%>" 340 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 341 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 342 </tbl:row> 343 <% 344 } 345 %> 346 </tbl:rows> 347 </tbl:data> 348 </tbl:table> 349 <% 350 } 351 352 // Tables with users/groups/projects that this item is shared to 353 MultiPermissions mp = new MultiPermissions(Collections.singleton(bioSource)); 354 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 355 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 356 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 357 358 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 359 { 360 %> 361 <h4 class="docked">Shared to</h4> 362 <tbl:table 363 id="itemsSharedTo" 364 clazz="itemlist" 365 columns="all" 366 > 367 <tbl:columndef 368 id="itemType" 369 title="Item type" 370 /> 317 <tbl:table 318 id="samples" 319 clazz="itemlist" 320 columns="all" 321 > 371 322 <tbl:columndef 372 323 id="name" … … 374 325 /> 375 326 <tbl:columndef 376 id=" permissions"377 title=" Permissions"327 id="description" 328 title="Description" 378 329 /> 379 330 <tbl:data> … … 382 333 <tbl:rows> 383 334 <% 384 while(projects.hasNext())335 for (Sample item : samples) 385 336 { 386 Project project = projects.next(); 387 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 388 %> 337 %> 389 338 <tbl:row> 390 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>391 339 <tbl:cell column="name"><base:icon 392 image="deleted.gif" 393 tooltip="This item has been scheduled for deletion" 394 visible="<%=project.isRemoved()%>" 395 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 396 <tbl:cell column="permissions"> 397 <%=PermissionUtil.translatePermissionsToString(permissions)%> 398 </tbl:cell> 399 </tbl:row> 400 <% 401 } 402 while(groups.hasNext()) 403 { 404 Group group = groups.next(); 405 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 406 %> 407 <tbl:row> 408 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 409 <tbl:cell column="name"><base:icon 410 image="deleted.gif" 411 tooltip="This item has been scheduled for deletion" 412 visible="<%=group.isRemoved()%>" 413 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 414 <tbl:cell column="permissions"> 415 <%=PermissionUtil.translatePermissionsToString(permissions)%> 416 </tbl:cell> 417 </tbl:row> 418 <% 419 } 420 while (users.hasNext()) 421 { 422 User user = users.next(); 423 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 424 %> 425 <tbl:row> 426 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 427 <tbl:cell column="name"><base:icon 428 image="deleted.gif" 429 tooltip="This item has been scheduled for deletion" 430 visible="<%=user.isRemoved()%>" 431 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 432 <tbl:cell column="permissions"> 433 <%=PermissionUtil.translatePermissionsToString(permissions)%> 434 </tbl:cell> 340 image="deleted.gif" 341 tooltip="This item has been scheduled for deletion" 342 visible="<%=item.isRemoved()%>" 343 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 344 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 435 345 </tbl:row> 436 346 <% … … 439 349 </tbl:rows> 440 350 </tbl:data> 441 </tbl:table> 351 </tbl:table> 352 </base:section> 353 <% 354 } 355 356 // Tables with users/groups/projects that this item is shared to 357 MultiPermissions mp = new MultiPermissions(Collections.singleton(bioSource)); 358 ItemResultList<User> users = mp.getUsers().list(dc); 359 ItemResultList<Group> groups = mp.getGroups().list(dc); 360 ItemResultList<Project> projects = mp.getProjects().list(dc); 361 int totalShare = users.size() + groups.size() + projects.size(); 362 363 if (totalShare > 0) 364 { 365 %> 366 <base:section 367 id="sharedTo" 368 title="<%="Shared to (" + totalShare + ")"%>" 369 context="<%=cc%>" 370 > 371 <tbl:table 372 id="itemsSharedTo" 373 clazz="itemlist" 374 columns="all" 375 > 376 <tbl:columndef 377 id="itemType" 378 title="Item type" 379 /> 380 <tbl:columndef 381 id="name" 382 title="Name" 383 /> 384 <tbl:columndef 385 id="permissions" 386 title="Permissions" 387 /> 388 <tbl:data> 389 <tbl:columns> 390 </tbl:columns> 391 <tbl:rows> 392 <% 393 for (Project project : projects) 394 { 395 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 396 %> 397 <tbl:row> 398 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 399 <tbl:cell column="name"><base:icon 400 image="deleted.gif" 401 tooltip="This item has been scheduled for deletion" 402 visible="<%=project.isRemoved()%>" 403 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 404 <tbl:cell column="permissions"> 405 <%=PermissionUtil.translatePermissionsToString(permissions)%> 406 </tbl:cell> 407 </tbl:row> 408 <% 409 } 410 for (Group group : groups) 411 { 412 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 413 %> 414 <tbl:row> 415 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 416 <tbl:cell column="name"><base:icon 417 image="deleted.gif" 418 tooltip="This item has been scheduled for deletion" 419 visible="<%=group.isRemoved()%>" 420 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 421 <tbl:cell column="permissions"> 422 <%=PermissionUtil.translatePermissionsToString(permissions)%> 423 </tbl:cell> 424 </tbl:row> 425 <% 426 } 427 for (User user : users) 428 { 429 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 430 %> 431 <tbl:row> 432 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 433 <tbl:cell column="name"><base:icon 434 image="deleted.gif" 435 tooltip="This item has been scheduled for deletion" 436 visible="<%=user.isRemoved()%>" 437 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 438 <tbl:cell column="permissions"> 439 <%=PermissionUtil.translatePermissionsToString(permissions)%> 440 </tbl:cell> 441 </tbl:row> 442 <% 443 } 444 %> 445 </tbl:rows> 446 </tbl:data> 447 </tbl:table> 448 </base:section> 442 449 <% 443 450 } -
trunk/www/biomaterials/extracts/view_extract.jsp
r4889 r5044 32 32 import="net.sf.basedb.core.ItemContext" 33 33 import="net.sf.basedb.core.ItemProxy" 34 import="net.sf.basedb.core.ItemResultIterator"35 34 import="net.sf.basedb.core.Permission" 36 35 import="net.sf.basedb.core.Extract" … … 438 437 { 439 438 %> 440 <h4 class="docked">Pooled in extracts</h4> 441 <tbl:table 442 id="poolChilds" 443 clazz="itemlist" 444 columns="all" 439 <base:section 440 id="pooledSection" 441 title="<%="Pooled in extracts (" + poolingEvents.size() + ")"%>" 442 context="<%=cc%>" 445 443 > 446 <tbl:columndef 447 id="name" 448 title="Name" 449 /> 450 <tbl:columndef 451 id="quantity" 452 title="Original quantity (µg)" 453 /> 454 <tbl:columndef 455 id="parents" 456 title="Used extracts[quantity]" 457 /> 458 <tbl:columndef 459 id="description" 460 title="Description" 461 /> 462 <tbl:data> 463 <tbl:columns></tbl:columns> 464 <tbl:rows> 465 <% 466 for (BioMaterialEvent poolEvt : poolingEvents) 467 { 468 ItemQuery<Extract> extractsQuery = (ItemQuery<Extract>)poolEvt.getSources(); 469 Extract child = (Extract)poolEvt.getBioMaterial(); 470 extractsQuery.include(Include.ALL); 471 extractsQuery.order(Orders.asc(Hql.property("name"))); 472 ItemResultList<Extract> parentExtracts = extractsQuery.list(dc); 473 %> 474 <tbl:row> 475 <tbl:cell column="name"> 476 <base:icon 477 image="deleted.gif" 478 tooltip="This item has been scheduled for deletion" 479 visible="<%=child.isRemoved()%>" 480 /> 481 <%=Base.getLinkedName(ID, child, false, true)%> 482 </tbl:cell> 483 <tbl:cell column="quantity"><%=Values.formatNumber(child.getOriginalQuantity(), 2)%></tbl:cell> 484 <tbl:cell column="parents"> 444 <tbl:table 445 id="poolChilds" 446 clazz="itemlist" 447 columns="all" 448 > 449 <tbl:columndef 450 id="name" 451 title="Name" 452 /> 453 <tbl:columndef 454 id="quantity" 455 title="Original quantity (µg)" 456 /> 457 <tbl:columndef 458 id="parents" 459 title="Used extracts[quantity]" 460 /> 461 <tbl:columndef 462 id="description" 463 title="Description" 464 /> 465 <tbl:data> 466 <tbl:columns></tbl:columns> 467 <tbl:rows> 468 <% 469 for (BioMaterialEvent poolEvt : poolingEvents) 470 { 471 ItemQuery<Extract> extractsQuery = (ItemQuery<Extract>)poolEvt.getSources(); 472 Extract child = (Extract)poolEvt.getBioMaterial(); 473 extractsQuery.include(Include.ALL); 474 extractsQuery.order(Orders.asc(Hql.property("name"))); 475 ItemResultList<Extract> parentExtracts = extractsQuery.list(dc); 476 %> 477 <tbl:row> 478 <tbl:cell column="name"> 479 <base:icon 480 image="deleted.gif" 481 tooltip="This item has been scheduled for deletion" 482 visible="<%=child.isRemoved()%>" 483 /> 484 <%=Base.getLinkedName(ID, child, false, true)%> 485 </tbl:cell> 486 <tbl:cell column="quantity"><%=Values.formatNumber(child.getOriginalQuantity(), 2)%></tbl:cell> 487 <tbl:cell column="parents"> 488 <% 489 String separator = ""; 490 for (Extract parent : parentExtracts) 491 { 492 out.write(separator); 493 if (parent.equals(extract)) 494 out.write(HTML.encodeTags(parent.getName())); 495 else 496 out.write(Base.getLinkedName(ID, parent, false, true)); 497 out.write("[" + Values.formatNumber(poolEvt.getUsedQuantity(parent), 2) + "µg]"); 498 separator = ", "; 499 } 500 %> 501 </tbl:cell> 502 <tbl:cell column="description"><%=HTML.encodeTags(child.getDescription())%></tbl:cell> 503 </tbl:row> 485 504 <% 486 String separator = ""; 487 for (Extract parent : parentExtracts) 488 { 489 out.write(separator); 490 if (parent.equals(extract)) 491 out.write(HTML.encodeTags(parent.getName())); 492 else 493 out.write(Base.getLinkedName(ID, parent, false, true)); 494 out.write("[" + Values.formatNumber(poolEvt.getUsedQuantity(parent), 2) + "µg]"); 495 separator = ", "; 496 } 497 %> 498 </tbl:cell> 499 <tbl:cell column="description"><%=HTML.encodeTags(child.getDescription())%></tbl:cell> 500 </tbl:row> 501 <% 502 } 503 %> 504 </tbl:rows> 505 </tbl:data> 506 </tbl:table> 505 } 506 %> 507 </tbl:rows> 508 </tbl:data> 509 </tbl:table> 510 </base:section> 507 511 <% 508 512 } … … 526 530 { 527 531 %> 528 <h4 class="docked">Labeled extracts</h4> 529 <tbl:table 530 id="labeledextracts" 531 clazz="itemlist" 532 columns="all" 532 <base:section 533 id="labeledExtractSection" 534 title="<%="Labeled extracts (" + labeledExtracts.size() + ")"%>" 535 context="<%=cc%>" 533 536 > 534 <tbl:columndef 535 id="name" 536 title="Name" 537 /> 538 <tbl:columndef 539 id="quantity" 540 title="Used quantity (µg)" 541 /> 542 <tbl:columndef 543 id="description" 544 title="Description" 545 /> 546 <tbl:data> 547 <tbl:columns></tbl:columns> 548 <tbl:rows> 537 <tbl:table 538 id="labeledextracts" 539 clazz="itemlist" 540 columns="all" 541 > 542 <tbl:columndef 543 id="name" 544 title="Name" 545 /> 546 <tbl:columndef 547 id="quantity" 548 title="Used quantity (µg)" 549 /> 550 <tbl:columndef 551 id="description" 552 title="Description" 553 /> 554 <tbl:data> 555 <tbl:columns></tbl:columns> 556 <tbl:rows> 557 <% 558 for (LabeledExtract lbe : labeledExtracts) 559 { 560 %> 561 <tbl:row> 562 <tbl:cell column="name"><base:icon 563 image="deleted.gif" 564 tooltip="This item has been scheduled for deletion" 565 visible="<%=lbe.isRemoved()%>" 566 /><%=Base.getLinkedName(ID, lbe, false, true)%></tbl:cell> 567 <tbl:cell column="quantity"><%=Values.formatNumber(lbe.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell> 568 <tbl:cell column="description"><%=HTML.encodeTags(lbe.getDescription())%></tbl:cell> 569 </tbl:row> 570 <% 571 } 572 %> 573 </tbl:rows> 574 </tbl:data> 575 </tbl:table> 576 </base:section> 577 <% 578 } 579 580 MultiPermissions mp = new MultiPermissions(Collections.singleton(extract)); 581 ItemResultList<User> users = mp.getUsers().list(dc); 582 ItemResultList<Group> groups = mp.getGroups().list(dc); 583 ItemResultList<Project> projects = mp.getProjects().list(dc); 584 int totalShare = users.size() + groups.size() + projects.size(); 585 586 if (totalShare > 0) 587 { 588 %> 589 <base:section 590 id="sharedTo" 591 title="<%="Shared to (" + totalShare + ")"%>" 592 context="<%=cc%>" 593 > 594 <tbl:table 595 id="itemsSharedTo" 596 clazz="itemlist" 597 columns="all" 598 > 599 <tbl:columndef 600 id="itemType" 601 title="Item type" 602 /> 603 <tbl:columndef 604 id="name" 605 title="Name" 606 /> 607 <tbl:columndef 608 id="permissions" 609 title="Permissions" 610 /> 611 <tbl:data> 612 <tbl:columns> 613 </tbl:columns> 614 <tbl:rows> 549 615 <% 550 for ( LabeledExtract lbe : labeledExtracts)616 for (Project project : projects) 551 617 { 552 %> 618 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 619 %> 553 620 <tbl:row> 621 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 554 622 <tbl:cell column="name"><base:icon 555 623 image="deleted.gif" 556 624 tooltip="This item has been scheduled for deletion" 557 visible="<%=lbe.isRemoved()%>" 558 /><%=Base.getLinkedName(ID, lbe, false, true)%></tbl:cell> 559 <tbl:cell column="quantity"><%=Values.formatNumber(lbe.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell> 560 <tbl:cell column="description"><%=HTML.encodeTags(lbe.getDescription())%></tbl:cell> 625 visible="<%=project.isRemoved()%>" 626 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 627 <tbl:cell column="permissions"> 628 <%=PermissionUtil.translatePermissionsToString(permissions)%> 629 </tbl:cell> 630 </tbl:row> 631 <% 632 } 633 for (Group group : groups) 634 { 635 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 636 %> 637 <tbl:row> 638 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 639 <tbl:cell column="name"><base:icon 640 image="deleted.gif" 641 tooltip="This item has been scheduled for deletion" 642 visible="<%=group.isRemoved()%>" 643 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 644 <tbl:cell column="permissions"> 645 <%=PermissionUtil.translatePermissionsToString(permissions)%> 646 </tbl:cell> 647 </tbl:row> 648 <% 649 } 650 for (User user : users) 651 { 652 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 653 %> 654 <tbl:row> 655 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 656 <tbl:cell column="name"><base:icon 657 image="deleted.gif" 658 tooltip="This item has been scheduled for deletion" 659 visible="<%=user.isRemoved()%>" 660 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 661 <tbl:cell column="permissions"> 662 <%=PermissionUtil.translatePermissionsToString(permissions)%> 663 </tbl:cell> 561 664 </tbl:row> 562 665 <% 563 666 } 564 667 %> 565 </tbl:rows> 566 </tbl:data> 567 </tbl:table> 568 <% 569 } 570 571 MultiPermissions mp = new MultiPermissions(Collections.singleton(extract)); 572 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 573 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 574 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 575 576 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 577 { 578 %> 579 <h4 class="docked">Shared to</h4> 580 <tbl:table 581 id="itemsSharedTo" 582 clazz="itemlist" 583 columns="all" 584 > 585 <tbl:columndef 586 id="itemType" 587 title="Item type" 588 /> 589 <tbl:columndef 590 id="name" 591 title="Name" 592 /> 593 <tbl:columndef 594 id="permissions" 595 title="Permissions" 596 /> 597 <tbl:data> 598 <tbl:columns> 599 </tbl:columns> 600 <tbl:rows> 601 <% 602 while(projects.hasNext()) 603 { 604 Project project = projects.next(); 605 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 606 %> 607 <tbl:row> 608 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 609 <tbl:cell column="name"><base:icon 610 image="deleted.gif" 611 tooltip="This item has been scheduled for deletion" 612 visible="<%=project.isRemoved()%>" 613 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 614 <tbl:cell column="permissions"> 615 <%=PermissionUtil.translatePermissionsToString(permissions)%> 616 </tbl:cell> 617 </tbl:row> 618 <% 619 } 620 while(groups.hasNext()) 621 { 622 Group group = groups.next(); 623 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 624 %> 625 <tbl:row> 626 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 627 <tbl:cell column="name"><base:icon 628 image="deleted.gif" 629 tooltip="This item has been scheduled for deletion" 630 visible="<%=group.isRemoved()%>" 631 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 632 <tbl:cell column="permissions"> 633 <%=PermissionUtil.translatePermissionsToString(permissions)%> 634 </tbl:cell> 635 </tbl:row> 636 <% 637 } 638 while (users.hasNext()) 639 { 640 User user = users.next(); 641 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 642 %> 643 <tbl:row> 644 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 645 <tbl:cell column="name"><base:icon 646 image="deleted.gif" 647 tooltip="This item has been scheduled for deletion" 648 visible="<%=user.isRemoved()%>" 649 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 650 <tbl:cell column="permissions"> 651 <%=PermissionUtil.translatePermissionsToString(permissions)%> 652 </tbl:cell> 653 </tbl:row> 654 <% 655 } 656 %> 657 </tbl:rows> 658 </tbl:data> 659 </tbl:table> 668 </tbl:rows> 669 </tbl:data> 670 </tbl:table> 671 </base:section> 660 672 <% 661 673 } -
trunk/www/biomaterials/labeledextracts/view_labeledextract.jsp
r4889 r5044 42 42 import="net.sf.basedb.core.ItemProxy" 43 43 import="net.sf.basedb.core.ItemQuery" 44 import="net.sf.basedb.core.ItemResultIterator"45 44 import="net.sf.basedb.core.ItemResultList" 46 45 import="net.sf.basedb.core.Include" … … 442 441 { 443 442 %> 444 <h4 class="docked">Pooled in labeled extracts</h4> 445 <tbl:table 446 id="poolChilds" 447 clazz="itemlist" 448 columns="all" 443 <base:section 444 id="pooledSection" 445 title="<%="Pooled in labeled extracts (" + poolingEvents.size() + ")"%>" 446 context="<%=cc%>" 449 447 > 450 <tbl:columndef 451 id="name" 452 title="Name" 453 /> 454 <tbl:columndef 455 id="quantity" 456 title="Original quantity (µg)" 457 /> 458 <tbl:columndef 459 id="parents" 460 title="Used labeled extracts [quantity]" 461 /> 462 <tbl:columndef 463 id="description" 464 title="Description" 465 /> 466 <tbl:data> 467 <tbl:columns></tbl:columns> 468 <tbl:rows> 469 <% 470 for (BioMaterialEvent poolEvt : poolingEvents) 471 { 472 LabeledExtract ch = (LabeledExtract)poolEvt.getBioMaterial(); 473 ItemQuery<LabeledExtract> extractsQuery = (ItemQuery<LabeledExtract>)poolEvt.getSources(); 474 extractsQuery.include(Include.ALL); 475 extractsQuery.order(Orders.asc(Hql.property("name"))); 476 ItemResultList<LabeledExtract> parentExtracts = extractsQuery.list(dc); 477 %> 478 <tbl:row> 479 <tbl:cell column="name"> 480 <base:icon 481 image="deleted.gif" 482 tooltip="This item has been scheduled for deletion" 483 visible="<%=ch.isRemoved() %>" 484 /> 485 <%=Base.getLinkedName(ID, ch, false, true)%> 486 </tbl:cell> 487 <tbl:cell column="quantity"><%=Values.formatNumber(ch.getOriginalQuantity(), 2)%></tbl:cell> 488 <tbl:cell column="parents"> 448 <tbl:table 449 id="poolChilds" 450 clazz="itemlist" 451 columns="all" 452 > 453 <tbl:columndef 454 id="name" 455 title="Name" 456 /> 457 <tbl:columndef 458 id="quantity" 459 title="Original quantity (µg)" 460 /> 461 <tbl:columndef 462 id="parents" 463 title="Used labeled extracts [quantity]" 464 /> 465 <tbl:columndef 466 id="description" 467 title="Description" 468 /> 469 <tbl:data> 470 <tbl:columns></tbl:columns> 471 <tbl:rows> 472 <% 473 for (BioMaterialEvent poolEvt : poolingEvents) 474 { 475 LabeledExtract ch = (LabeledExtract)poolEvt.getBioMaterial(); 476 ItemQuery<LabeledExtract> extractsQuery = (ItemQuery<LabeledExtract>)poolEvt.getSources(); 477 extractsQuery.include(Include.ALL); 478 extractsQuery.order(Orders.asc(Hql.property("name"))); 479 ItemResultList<LabeledExtract> parentExtracts = extractsQuery.list(dc); 480 %> 481 <tbl:row> 482 <tbl:cell column="name"> 483 <base:icon 484 image="deleted.gif" 485 tooltip="This item has been scheduled for deletion" 486 visible="<%=ch.isRemoved() %>" 487 /> 488 <%=Base.getLinkedName(ID, ch, false, true)%> 489 </tbl:cell> 490 <tbl:cell column="quantity"><%=Values.formatNumber(ch.getOriginalQuantity(), 2)%></tbl:cell> 491 <tbl:cell column="parents"> 492 <% 493 String separator = ""; 494 for (LabeledExtract parent : parentExtracts) 495 { 496 out.write(separator); 497 if (parent.equals(extract)) 498 out.write(HTML.encodeTags(parent.getName())); 499 else 500 out.write(Base.getLinkedName(ID, parent, false, true)); 501 out.write("[" + Values.formatNumber(poolEvt.getUsedQuantity(parent), 2) + "µg]"); 502 separator = ", "; 503 } 504 %> 505 </tbl:cell> 506 <tbl:cell column="description"><%=HTML.encodeTags(ch.getDescription())%></tbl:cell> 507 </tbl:row> 489 508 <% 490 String separator = ""; 491 for (LabeledExtract parent : parentExtracts) 492 { 493 out.write(separator); 494 if (parent.equals(extract)) 495 out.write(HTML.encodeTags(parent.getName())); 496 else 497 out.write(Base.getLinkedName(ID, parent, false, true)); 498 out.write("[" + Values.formatNumber(poolEvt.getUsedQuantity(parent), 2) + "µg]"); 499 separator = ", "; 500 } 501 %> 502 </tbl:cell> 503 <tbl:cell column="description"><%=HTML.encodeTags(ch.getDescription())%></tbl:cell> 504 </tbl:row> 505 <% 506 } 507 %> 508 </tbl:rows> 509 </tbl:data> 510 </tbl:table> 509 } 510 %> 511 </tbl:rows> 512 </tbl:data> 513 </tbl:table> 514 </base:section> 511 515 <% 512 516 } … … 527 531 { 528 532 %> 529 <h4 class="docked">Hybridizations</h4> 530 <tbl:table 531 id="hybridizations" 532 clazz="itemlist" 533 columns="all" 533 <base:section 534 id="hybridizationSection" 535 title="<%="Hybridizations (" + hybridizations.size() + ")"%>" 536 context="<%=cc%>" 534 537 > 535 <tbl:columndef 536 id="name" 537 title="Name" 538 /> 539 <tbl:columndef 540 id="quantity" 541 title="Used quantity (µg)" 542 /> 543 <tbl:columndef 544 id="description" 545 title="Description" 546 /> 547 <tbl:data> 548 <tbl:columns></tbl:columns> 549 <tbl:rows> 538 <tbl:table 539 id="hybridizations" 540 clazz="itemlist" 541 columns="all" 542 > 543 <tbl:columndef 544 id="name" 545 title="Name" 546 /> 547 <tbl:columndef 548 id="quantity" 549 title="Used quantity (µg)" 550 /> 551 <tbl:columndef 552 id="description" 553 title="Description" 554 /> 555 <tbl:data> 556 <tbl:columns></tbl:columns> 557 <tbl:rows> 558 <% 559 for (Hybridization hyb : hybridizations) 560 { 561 %> 562 <tbl:row> 563 <tbl:cell column="name"><base:icon 564 image="deleted.gif" 565 tooltip="This item has been scheduled for deletion" 566 visible="<%=hyb.isRemoved()%>" 567 /><%=Base.getLinkedName(ID, hyb, false, true)%></tbl:cell> 568 <tbl:cell column="quantity"><%=Values.formatNumber(hyb.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell> 569 <tbl:cell column="description"><%=HTML.encodeTags(hyb.getDescription())%></tbl:cell> 570 </tbl:row> 571 <% 572 } 573 %> 574 </tbl:rows> 575 </tbl:data> 576 </tbl:table> 577 </base:section> 578 <% 579 } 580 581 // Tables with users/groups/projects that this item is shared to 582 MultiPermissions mp = new MultiPermissions(Collections.singleton(extract)); 583 ItemResultList<User> users = mp.getUsers().list(dc); 584 ItemResultList<Group> groups = mp.getGroups().list(dc); 585 ItemResultList<Project> projects = mp.getProjects().list(dc); 586 int totalShare = users.size() + groups.size() + projects.size(); 587 588 if (totalShare > 0) 589 { 590 %> 591 <base:section 592 id="sharedTo" 593 title="<%="Shared to (" + totalShare + ")"%>" 594 context="<%=cc%>" 595 > 596 <tbl:table 597 id="itemsSharedTo" 598 clazz="itemlist" 599 columns="all" 600 > 601 <tbl:columndef 602 id="itemType" 603 title="Item type" 604 /> 605 <tbl:columndef 606 id="name" 607 title="Name" 608 /> 609 <tbl:columndef 610 id="permissions" 611 title="Permissions" 612 /> 613 <tbl:data> 614 <tbl:columns> 615 </tbl:columns> 616 <tbl:rows> 550 617 <% 551 for ( Hybridization hyb : hybridizations)618 for (Project project : projects) 552 619 { 553 %> 620 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 621 %> 554 622 <tbl:row> 623 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 555 624 <tbl:cell column="name"><base:icon 556 625 image="deleted.gif" 557 626 tooltip="This item has been scheduled for deletion" 558 visible="<%=hyb.isRemoved()%>" 559 /><%=Base.getLinkedName(ID, hyb, false, true)%></tbl:cell> 560 <tbl:cell column="quantity"><%=Values.formatNumber(hyb.getCreationEvent().getUsedQuantity(extract), 2)%></tbl:cell> 561 <tbl:cell column="description"><%=HTML.encodeTags(hyb.getDescription())%></tbl:cell> 627 visible="<%=project.isRemoved()%>" 628 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 629 <tbl:cell column="permissions"> 630 <%=PermissionUtil.translatePermissionsToString(permissions)%> 631 </tbl:cell> 632 </tbl:row> 633 <% 634 } 635 for (Group group : groups) 636 { 637 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 638 %> 639 <tbl:row> 640 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 641 <tbl:cell column="name"><base:icon 642 image="deleted.gif" 643 tooltip="This item has been scheduled for deletion" 644 visible="<%=group.isRemoved()%>" 645 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 646 <tbl:cell column="permissions"> 647 <%=PermissionUtil.translatePermissionsToString(permissions)%> 648 </tbl:cell> 649 </tbl:row> 650 <% 651 } 652 for (User user : users) 653 { 654 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 655 %> 656 <tbl:row> 657 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 658 <tbl:cell column="name"><base:icon 659 image="deleted.gif" 660 tooltip="This item has been scheduled for deletion" 661 visible="<%=user.isRemoved()%>" 662 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 663 <tbl:cell column="permissions"> 664 <%=PermissionUtil.translatePermissionsToString(permissions)%> 665 </tbl:cell> 562 666 </tbl:row> 563 667 <% 564 668 } 565 669 %> 566 </tbl:rows> 567 </tbl:data> 568 </tbl:table> 569 <% 570 } 571 572 // Tables with users/groups/projects that this item is shared to 573 MultiPermissions mp = new MultiPermissions(Collections.singleton(extract)); 574 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 575 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 576 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 577 578 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 579 { 580 %> 581 <h4 class="docked">Shared to</h4> 582 <tbl:table 583 id="itemsSharedTo" 584 clazz="itemlist" 585 columns="all" 586 > 587 <tbl:columndef 588 id="itemType" 589 title="Item type" 590 /> 591 <tbl:columndef 592 id="name" 593 title="Name" 594 /> 595 <tbl:columndef 596 id="permissions" 597 title="Permissions" 598 /> 599 <tbl:data> 600 <tbl:columns> 601 </tbl:columns> 602 <tbl:rows> 603 <% 604 while(projects.hasNext()) 605 { 606 Project project = projects.next(); 607 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 608 %> 609 <tbl:row> 610 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 611 <tbl:cell column="name"><base:icon 612 image="deleted.gif" 613 tooltip="This item has been scheduled for deletion" 614 visible="<%=project.isRemoved()%>" 615 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 616 <tbl:cell column="permissions"> 617 <%=PermissionUtil.translatePermissionsToString(permissions)%> 618 </tbl:cell> 619 </tbl:row> 620 <% 621 } 622 while(groups.hasNext()) 623 { 624 Group group = groups.next(); 625 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 626 %> 627 <tbl:row> 628 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 629 <tbl:cell column="name"><base:icon 630 image="deleted.gif" 631 tooltip="This item has been scheduled for deletion" 632 visible="<%=group.isRemoved()%>" 633 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 634 <tbl:cell column="permissions"> 635 <%=PermissionUtil.translatePermissionsToString(permissions)%> 636 </tbl:cell> 637 </tbl:row> 638 <% 639 } 640 while (users.hasNext()) 641 { 642 User user = users.next(); 643 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 644 %> 645 <tbl:row> 646 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 647 <tbl:cell column="name"><base:icon 648 image="deleted.gif" 649 tooltip="This item has been scheduled for deletion" 650 visible="<%=user.isRemoved()%>" 651 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 652 <tbl:cell column="permissions"> 653 <%=PermissionUtil.translatePermissionsToString(permissions)%> 654 </tbl:cell> 655 </tbl:row> 656 <% 657 } 658 %> 659 </tbl:rows> 660 </tbl:data> 661 </tbl:table> 670 </tbl:rows> 671 </tbl:data> 672 </tbl:table> 673 </base:section> 662 674 <% 663 675 } -
trunk/www/biomaterials/labels/view_label.jsp
r4889 r5044 33 33 import="net.sf.basedb.core.ItemContext" 34 34 import="net.sf.basedb.core.ItemQuery" 35 import="net.sf.basedb.core.ItemResultIterator"36 35 import="net.sf.basedb.core.ItemResultList" 37 36 import="net.sf.basedb.core.Permission" … … 275 274 // Tables with users/groups/projects that this item is shared to 276 275 MultiPermissions mp = new MultiPermissions(Collections.singleton(label)); 277 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 278 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 279 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 276 ItemResultList<User> users = mp.getUsers().list(dc); 277 ItemResultList<Group> groups = mp.getGroups().list(dc); 278 ItemResultList<Project> projects = mp.getProjects().list(dc); 279 int totalShare = users.size() + groups.size() + projects.size(); 280 280 281 if ( users.hasNext() || groups.hasNext() || projects.hasNext())281 if (totalShare > 0) 282 282 { 283 283 %> 284 <h4 class="docked">Shared to</h4> 285 <tbl:table 286 id="itemsSharedTo" 287 clazz="itemlist" 288 columns="all" 289 > 290 <tbl:columndef 291 id="itemType" 292 title="Item type" 293 /> 294 <tbl:columndef 295 id="name" 296 title="Name" 297 /> 298 <tbl:columndef 299 id="permissions" 300 title="Permissions" 301 /> 302 <tbl:data> 303 <tbl:columns> 304 </tbl:columns> 305 <tbl:rows> 306 <% 307 while(projects.hasNext()) 308 { 309 Project project = projects.next(); 310 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 311 %> 312 <tbl:row> 313 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 314 <tbl:cell column="name"><base:icon 315 image="deleted.gif" 316 tooltip="This item has been scheduled for deletion" 317 visible="<%=project.isRemoved()%>" 318 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 319 <tbl:cell column="permissions"> 320 <%=PermissionUtil.translatePermissionsToString(permissions)%> 321 </tbl:cell> 322 </tbl:row> 284 <base:section 285 id="sharedTo" 286 title="<%="Shared to (" + totalShare + ")"%>" 287 context="<%=cc%>" 288 > 289 <tbl:table 290 id="itemsSharedTo" 291 clazz="itemlist" 292 columns="all" 293 > 294 <tbl:columndef 295 id="itemType" 296 title="Item type" 297 /> 298 <tbl:columndef 299 id="name" 300 title="Name" 301 /> 302 <tbl:columndef 303 id="permissions" 304 title="Permissions" 305 /> 306 <tbl:data> 307 <tbl:columns> 308 </tbl:columns> 309 <tbl:rows> 323 310 <% 324 } 325 while(groups.hasNext()) 326 { 327 Group group = groups.next(); 328 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 311 for (Project project : projects) 312 { 313 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 314 %> 315 <tbl:row> 316 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 317 <tbl:cell column="name"><base:icon 318 image="deleted.gif" 319 tooltip="This item has been scheduled for deletion" 320 visible="<%=project.isRemoved()%>" 321 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 322 <tbl:cell column="permissions"> 323 <%=PermissionUtil.translatePermissionsToString(permissions)%> 324 </tbl:cell> 325 </tbl:row> 326 <% 327 } 328 for (Group group : groups) 329 { 330 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 331 %> 332 <tbl:row> 333 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 334 <tbl:cell column="name"><base:icon 335 image="deleted.gif" 336 tooltip="This item has been scheduled for deletion" 337 visible="<%=group.isRemoved()%>" 338 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 339 <tbl:cell column="permissions"> 340 <%=PermissionUtil.translatePermissionsToString(permissions)%> 341 </tbl:cell> 342 </tbl:row> 343 <% 344 } 345 for (User user : users) 346 { 347 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 348 %> 349 <tbl:row> 350 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 351 <tbl:cell column="name"><base:icon 352 image="deleted.gif" 353 tooltip="This item has been scheduled for deletion" 354 visible="<%=user.isRemoved()%>" 355 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 356 <tbl:cell column="permissions"> 357 <%=PermissionUtil.translatePermissionsToString(permissions)%> 358 </tbl:cell> 359 </tbl:row> 360 <% 361 } 329 362 %> 330 <tbl:row> 331 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 332 <tbl:cell column="name"><base:icon 333 image="deleted.gif" 334 tooltip="This item has been scheduled for deletion" 335 visible="<%=group.isRemoved()%>" 336 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 337 <tbl:cell column="permissions"> 338 <%=PermissionUtil.translatePermissionsToString(permissions)%> 339 </tbl:cell> 340 </tbl:row> 341 <% 342 } 343 while (users.hasNext()) 344 { 345 User user = users.next(); 346 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 347 %> 348 <tbl:row> 349 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 350 <tbl:cell column="name"><base:icon 351 image="deleted.gif" 352 tooltip="This item has been scheduled for deletion" 353 visible="<%=user.isRemoved()%>" 354 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 355 <tbl:cell column="permissions"> 356 <%=PermissionUtil.translatePermissionsToString(permissions)%> 357 </tbl:cell> 358 </tbl:row> 359 <% 360 } 361 %> 362 </tbl:rows> 363 </tbl:data> 364 </tbl:table> 363 </tbl:rows> 364 </tbl:data> 365 </tbl:table> 366 </base:section> 365 367 <% 366 368 } -
trunk/www/biomaterials/lists/view_list.jsp
r4882 r5044 32 32 import="net.sf.basedb.core.ItemContext" 33 33 import="net.sf.basedb.core.ItemQuery" 34 import="net.sf.basedb.core.ItemResultIterator"35 34 import="net.sf.basedb.core.ItemResultList" 36 35 import="net.sf.basedb.core.Permission" … … 307 306 // Tables with users/groups/projects that this item is shared to 308 307 MultiPermissions mp = new MultiPermissions(Collections.singleton(list)); 309 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 310 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 311 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 308 ItemResultList<User> users = mp.getUsers().list(dc); 309 ItemResultList<Group> groups = mp.getGroups().list(dc); 310 ItemResultList<Project> projects = mp.getProjects().list(dc); 311 int totalShare = users.size() + groups.size() + projects.size(); 312 312 313 if ( users.hasNext() || groups.hasNext() || projects.hasNext())313 if (totalShare > 0) 314 314 { 315 315 %> 316 <h4 class="docked">Shared to</h4> 317 <tbl:table 318 id="itemsSharedTo" 319 clazz="itemlist" 320 columns="all" 321 > 322 <tbl:columndef 323 id="itemType" 324 title="Item type" 325 /> 326 <tbl:columndef 327 id="name" 328 title="Name" 329 /> 330 <tbl:columndef 331 id="permissions" 332 title="Permissions" 333 /> 334 <tbl:data> 335 <tbl:columns> 336 </tbl:columns> 337 <tbl:rows> 338 <% 339 while(projects.hasNext()) 340 { 341 Project project = projects.next(); 342 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 343 %> 344 <tbl:row> 345 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 346 <tbl:cell column="name"><base:icon 347 image="deleted.gif" 348 tooltip="This item has been scheduled for deletion" 349 visible="<%=project.isRemoved()%>" 350 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 351 <tbl:cell column="permissions"> 352 <%=PermissionUtil.translatePermissionsToString(permissions)%> 353 </tbl:cell> 354 </tbl:row> 316 <base:section 317 id="sharedTo" 318 title="<%="Shared to (" + totalShare + ")"%>" 319 context="<%=cc%>" 320 > 321 <tbl:table 322 id="itemsSharedTo" 323 clazz="itemlist" 324 columns="all" 325 > 326 <tbl:columndef 327 id="itemType" 328 title="Item type" 329 /> 330 <tbl:columndef 331 id="name" 332 title="Name" 333 /> 334 <tbl:columndef 335 id="permissions" 336 title="Permissions" 337 /> 338 <tbl:data> 339 <tbl:columns> 340 </tbl:columns> 341 <tbl:rows> 355 342 <% 356 } 357 while(groups.hasNext()) 358 { 359 Group group = groups.next(); 360 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 343 for (Project project : projects) 344 { 345 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 346 %> 347 <tbl:row> 348 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 349 <tbl:cell column="name"><base:icon 350 image="deleted.gif" 351 tooltip="This item has been scheduled for deletion" 352 visible="<%=project.isRemoved()%>" 353 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 354 <tbl:cell column="permissions"> 355 <%=PermissionUtil.translatePermissionsToString(permissions)%> 356 </tbl:cell> 357 </tbl:row> 358 <% 359 } 360 for (Group group : groups) 361 { 362 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 363 %> 364 <tbl:row> 365 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 366 <tbl:cell column="name"><base:icon 367 image="deleted.gif" 368 tooltip="This item has been scheduled for deletion" 369 visible="<%=group.isRemoved()%>" 370 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 371 <tbl:cell column="permissions"> 372 <%=PermissionUtil.translatePermissionsToString(permissions)%> 373 </tbl:cell> 374 </tbl:row> 375 <% 376 } 377 for (User user : users) 378 { 379 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 380 %> 381 <tbl:row> 382 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 383 <tbl:cell column="name"><base:icon 384 image="deleted.gif" 385 tooltip="This item has been scheduled for deletion" 386 visible="<%=user.isRemoved()%>" 387 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 388 <tbl:cell column="permissions"> 389 <%=PermissionUtil.translatePermissionsToString(permissions)%> 390 </tbl:cell> 391 </tbl:row> 392 <% 393 } 361 394 %> 362 <tbl:row> 363 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 364 <tbl:cell column="name"><base:icon 365 image="deleted.gif" 366 tooltip="This item has been scheduled for deletion" 367 visible="<%=group.isRemoved()%>" 368 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 369 <tbl:cell column="permissions"> 370 <%=PermissionUtil.translatePermissionsToString(permissions)%> 371 </tbl:cell> 372 </tbl:row> 373 <% 374 } 375 while (users.hasNext()) 376 { 377 User user = users.next(); 378 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 379 %> 380 <tbl:row> 381 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 382 <tbl:cell column="name"><base:icon 383 image="deleted.gif" 384 tooltip="This item has been scheduled for deletion" 385 visible="<%=user.isRemoved()%>" 386 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 387 <tbl:cell column="permissions"> 388 <%=PermissionUtil.translatePermissionsToString(permissions)%> 389 </tbl:cell> 390 </tbl:row> 391 <% 392 } 393 %> 394 </tbl:rows> 395 </tbl:data> 396 </tbl:table> 395 </tbl:rows> 396 </tbl:data> 397 </tbl:table> 398 </base:section> 397 399 <% 398 400 } -
trunk/www/biomaterials/samples/view_sample.jsp
r4889 r5044 41 41 import="net.sf.basedb.core.ItemProxy" 42 42 import="net.sf.basedb.core.ItemQuery" 43 import="net.sf.basedb.core.ItemResultIterator"44 43 import="net.sf.basedb.core.ItemResultList" 45 44 import="net.sf.basedb.core.Include" … … 423 422 { 424 423 %> 425 <h4 class="docked">Pooled in samples</h4> 426 <tbl:table 427 id="poolChilds" 428 clazz="itemlist" 429 columns="all" 424 <base:section 425 id="pooledSection" 426 title="<%="Pooled in samples (" + poolingEvents.size() + ")"%>" 427 context="<%=cc%>" 430 428 > 431 <tbl:columndef 432 id="name" 433 title="Name" 434 /> 435 <tbl:columndef 436 id="quantity" 437 title="Original quantity (µg)" 438 /> 439 <tbl:columndef 440 id="parents" 441 title="Used samples[quantity]" 442 /> 443 <tbl:columndef 444 id="description" 445 title="Description" 446 /> 447 <tbl:data> 448 <tbl:columns></tbl:columns> 449 <tbl:rows> 450 <% 451 for (BioMaterialEvent poolingEvt : poolingEvents) 452 { 453 Sample child = (Sample)poolingEvt.getBioMaterial(); 454 ItemQuery<Sample> samplesQuery = (ItemQuery<Sample>)poolingEvt.getSources(); 455 samplesQuery.include(Include.ALL); 456 samplesQuery.order(Orders.asc(Hql.property("name"))); 457 ItemResultList<Sample> parentSamples = samplesQuery.list(dc); 458 %> 459 <tbl:row> 460 <tbl:cell column="name"> 461 <base:icon 462 image="deleted.gif" 463 tooltip="This item has been scheduled for deletion" 464 visible="<%=child.isRemoved()%>" 465 /> 466 <%=Base.getLinkedName(ID, child, false, true)%> 467 </tbl:cell> 468 <tbl:cell column="quantity"><%=Values.formatNumber(child.getOriginalQuantity(), 2)%></tbl:cell> 469 <tbl:cell column="parents"> 429 <tbl:table 430 id="poolChilds" 431 clazz="itemlist" 432 columns="all" 433 > 434 <tbl:columndef 435 id="name" 436 title="Name" 437 /> 438 <tbl:columndef 439 id="quantity" 440 title="Original quantity (µg)" 441 /> 442 <tbl:columndef 443 id="parents" 444 title="Used samples[quantity]" 445 /> 446 <tbl:columndef 447 id="description" 448 title="Description" 449 /> 450 <tbl:data> 451 <tbl:columns></tbl:columns> 452 <tbl:rows> 453 <% 454 for (BioMaterialEvent poolingEvt : poolingEvents) 455 { 456 Sample child = (Sample)poolingEvt.getBioMaterial(); 457 ItemQuery<Sample> samplesQuery = (ItemQuery<Sample>)poolingEvt.getSources(); 458 samplesQuery.include(Include.ALL); 459 samplesQuery.order(Orders.asc(Hql.property("name"))); 460 ItemResultList<Sample> parentSamples = samplesQuery.list(dc); 461 %> 462 <tbl:row> 463 <tbl:cell column="name"> 464 <base:icon 465 image="deleted.gif" 466 tooltip="This item has been scheduled for deletion" 467 visible="<%=child.isRemoved()%>" 468 /> 469 <%=Base.getLinkedName(ID, child, false, true)%> 470 </tbl:cell> 471 <tbl:cell column="quantity"><%=Values.formatNumber(child.getOriginalQuantity(), 2)%></tbl:cell> 472 <tbl:cell column="parents"> 473 <% 474 String separator = ""; 475 for (Sample parent : parentSamples) 476 { 477 out.write(separator); 478 if (parent.equals(sample)) 479 out.write(HTML.encodeTags(parent.getName())); 480 else 481 out.write(Base.getLinkedName(ID, parent, false, true)); 482 out.write("[" + Values.formatNumber(poolingEvt.getUsedQuantity(parent), 2) + "µg]"); 483 separator = ", "; 484 } 485 %> 486 </tbl:cell> 487 <tbl:cell column="description"><%=HTML.encodeTags(child.getDescription())%></tbl:cell> 488 </tbl:row> 470 489 <% 471 String separator = ""; 472 for (Sample parent : parentSamples) 473 { 474 out.write(separator); 475 if (parent.equals(sample)) 476 out.write(HTML.encodeTags(parent.getName())); 477 else 478 out.write(Base.getLinkedName(ID, parent, false, true)); 479 out.write("[" + Values.formatNumber(poolingEvt.getUsedQuantity(parent), 2) + "µg]"); 480 separator = ", "; 481 } 482 %> 483 </tbl:cell> 484 <tbl:cell column="description"><%=HTML.encodeTags(child.getDescription())%></tbl:cell> 485 </tbl:row> 486 <% 487 } 488 %> 489 </tbl:rows> 490 </tbl:data> 491 </tbl:table> 490 } 491 %> 492 </tbl:rows> 493 </tbl:data> 494 </tbl:table> 495 </base:section> 492 496 <% 493 497 } … … 509 513 { 510 514 %> 511 <h4 class="docked">Extracts</h4> 512 <tbl:table 513 id="extracts" 514 clazz="itemlist" 515 columns="all" 515 <base:section 516 id="extractSection" 517 title="<%="Extracts (" + extracts.size() + ")"%>" 518 context="<%=cc%>" 516 519 > 517 <tbl:columndef 518 id="name" 519 title="Name" 520 /> 521 <tbl:columndef 522 id="quantity" 523 title="Used quantity (µg)" 524 /> 525 <tbl:columndef 526 id="description" 527 title="Description" 528 /> 529 <tbl:data> 530 <tbl:columns></tbl:columns> 531 <tbl:rows> 520 <tbl:table 521 id="extracts" 522 clazz="itemlist" 523 columns="all" 524 > 525 <tbl:columndef 526 id="name" 527 title="Name" 528 /> 529 <tbl:columndef 530 id="quantity" 531 title="Used quantity (µg)" 532 /> 533 <tbl:columndef 534 id="description" 535 title="Description" 536 /> 537 <tbl:data> 538 <tbl:columns></tbl:columns> 539 <tbl:rows> 540 <% 541 for (Extract e : extracts) 542 { 543 %> 544 <tbl:row> 545 <tbl:cell column="name"><base:icon 546 image="deleted.gif" 547 tooltip="This item has been scheduled for deletion" 548 visible="<%=e.isRemoved()%>" 549 /><%=Base.getLinkedName(ID, e, false, true)%></tbl:cell> 550 <tbl:cell column="quantity"><%=Values.formatNumber(e.getCreationEvent().getUsedQuantity(sample), 2)%></tbl:cell> 551 <tbl:cell column="description"><%=HTML.encodeTags(e.getDescription())%></tbl:cell> 552 </tbl:row> 553 <% 554 } 555 %> 556 </tbl:rows> 557 </tbl:data> 558 </tbl:table> 559 </base:section> 560 <% 561 } 562 563 // Tables with users/groups/projects that this item is shared to 564 MultiPermissions mp = new MultiPermissions(Collections.singleton(sample)); 565 ItemResultList<User> users = mp.getUsers().list(dc); 566 ItemResultList<Group> groups = mp.getGroups().list(dc); 567 ItemResultList<Project> projects = mp.getProjects().list(dc); 568 int totalShare = users.size() + groups.size() + projects.size(); 569 570 if (totalShare > 0) 571 { 572 %> 573 <base:section 574 id="sharedTo" 575 title="<%="Shared to (" + totalShare + ")"%>" 576 context="<%=cc%>" 577 > 578 <tbl:table 579 id="itemsSharedTo" 580 clazz="itemlist" 581 columns="all" 582 > 583 <tbl:columndef 584 id="itemType" 585 title="Item type" 586 /> 587 <tbl:columndef 588 id="name" 589 title="Name" 590 /> 591 <tbl:columndef 592 id="permissions" 593 title="Permissions" 594 /> 595 <tbl:data> 596 <tbl:columns> 597 </tbl:columns> 598 <tbl:rows> 532 599 <% 533 for ( Extract e : extracts)600 for (Project project : projects) 534 601 { 602 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 603 %> 604 <tbl:row> 605 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 606 <tbl:cell column="name"><base:icon 607 image="deleted.gif" 608 tooltip="This item has been scheduled for deletion" 609 visible="<%=project.isRemoved()%>" 610 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 611 <tbl:cell column="permissions"> 612 <%=PermissionUtil.translatePermissionsToString(permissions)%> 613 </tbl:cell> 614 </tbl:row> 615 <% 616 } 617 for (Group group : groups) 618 { 619 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 535 620 %> 536 <tbl:row> 621 <tbl:row> 622 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 537 623 <tbl:cell column="name"><base:icon 538 image="deleted.gif" 539 tooltip="This item has been scheduled for deletion" 540 visible="<%=e.isRemoved()%>" 541 /><%=Base.getLinkedName(ID, e, false, true)%></tbl:cell> 542 <tbl:cell column="quantity"><%=Values.formatNumber(e.getCreationEvent().getUsedQuantity(sample), 2)%></tbl:cell> 543 <tbl:cell column="description"><%=HTML.encodeTags(e.getDescription())%></tbl:cell> 624 image="deleted.gif" 625 tooltip="This item has been scheduled for deletion" 626 visible="<%=group.isRemoved()%>" 627 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 628 <tbl:cell column="permissions"> 629 <%=PermissionUtil.translatePermissionsToString(permissions)%> 630 </tbl:cell> 631 </tbl:row> 632 <% 633 } 634 for (User user : users) 635 { 636 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 637 %> 638 <tbl:row> 639 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 640 <tbl:cell column="name"><base:icon 641 image="deleted.gif" 642 tooltip="This item has been scheduled for deletion" 643 visible="<%=user.isRemoved()%>" 644 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 645 <tbl:cell column="permissions"> 646 <%=PermissionUtil.translatePermissionsToString(permissions)%> 647 </tbl:cell> 544 648 </tbl:row> 545 649 <% 546 650 } 547 651 %> 548 </tbl:rows> 549 </tbl:data> 550 </tbl:table> 551 <% 552 } 553 554 // Tables with users/groups/projects that this item is shared to 555 MultiPermissions mp = new MultiPermissions(Collections.singleton(sample)); 556 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 557 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 558 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 559 560 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 561 { 562 %> 563 <h4 class="docked">Shared to</h4> 564 <tbl:table 565 id="itemsSharedTo" 566 clazz="itemlist" 567 columns="all" 568 > 569 <tbl:columndef 570 id="itemType" 571 title="Item type" 572 /> 573 <tbl:columndef 574 id="name" 575 title="Name" 576 /> 577 <tbl:columndef 578 id="permissions" 579 title="Permissions" 580 /> 581 <tbl:data> 582 <tbl:columns> 583 </tbl:columns> 584 <tbl:rows> 585 <% 586 while(projects.hasNext()) 587 { 588 Project project = projects.next(); 589 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 590 %> 591 <tbl:row> 592 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 593 <tbl:cell column="name"><base:icon 594 image="deleted.gif" 595 tooltip="This item has been scheduled for deletion" 596 visible="<%=project.isRemoved()%>" 597 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 598 <tbl:cell column="permissions"> 599 <%=PermissionUtil.translatePermissionsToString(permissions)%> 600 </tbl:cell> 601 </tbl:row> 602 <% 603 } 604 while(groups.hasNext()) 605 { 606 Group group = groups.next(); 607 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 608 %> 609 <tbl:row> 610 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 611 <tbl:cell column="name"><base:icon 612 image="deleted.gif" 613 tooltip="This item has been scheduled for deletion" 614 visible="<%=group.isRemoved()%>" 615 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 616 <tbl:cell column="permissions"> 617 <%=PermissionUtil.translatePermissionsToString(permissions)%> 618 </tbl:cell> 619 </tbl:row> 620 <% 621 } 622 while (users.hasNext()) 623 { 624 User user = users.next(); 625 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 626 %> 627 <tbl:row> 628 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 629 <tbl:cell column="name"><base:icon 630 image="deleted.gif" 631 tooltip="This item has been scheduled for deletion" 632 visible="<%=user.isRemoved()%>" 633 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 634 <tbl:cell column="permissions"> 635 <%=PermissionUtil.translatePermissionsToString(permissions)%> 636 </tbl:cell> 637 </tbl:row> 638 <% 639 } 640 %> 641 </tbl:rows> 642 </tbl:data> 643 </tbl:table> 652 </tbl:rows> 653 </tbl:data> 654 </tbl:table> 655 </base:section> 644 656 <% 645 657 } -
trunk/www/common/annotations/list_annotations.jsp
r4889 r5044 140 140 %> 141 141 <%=message == null ? "" : message%> 142 <h4 class="docked">Primary annotations</h4> 143 <tbl:table 144 id="annotations" 145 clazz="itemlist" 146 columns="all" 142 <base:section 143 id="primaryAnnotations" 144 title="<%="Primary annotations (" + annotationTypes.size() + ")"%>" 147 145 > 148 <tbl:columndef149 id="annotation"150 title="Annotation"151 />152 <tbl:columndef153 id="values"154 title="Values"155 />156 <tbl:columndef157 id="description"158 title="Description"159 />160 <tbl:data>161 <tbl:columns>162 </tbl:columns>163 <tbl:rows>164 <%165 for (AnnotationType at : annotationTypes)166 {167 Annotation a = as != null && as.hasAnnotation(at) ? as.getAnnotation(at) : null;168 List<?> values = null;169 Formatter formatter = null;170 if (a != null)171 {172 values = a.getValues(null);173 formatter = FormatterFactory.getAnnotationFormatter(sc, a, null);174 }175 if (values != null || !at.isRemoved())176 {177 %>178 <tbl:row>179 <tbl:cell column="annotation"><base:icon180 image="deleted.gif"181 tooltip="This item has been scheduled for deletion"182 visible="<%=at.isRemoved()%>"183 /><%=Base.getLinkedName(ID, at, false, true)%></tbl:cell>184 <tbl:cell column="values"><%=values == null || values.size() == 0 ? "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%>185 <%186 if (writePermission)187 {188 %>: <base:icon image="edit.gif"189 onclick="<%="editAnnotation("+at.getId()+")"%>"190 tooltip="Modify the values of this annotation" />191 <%192 }193 %>194 </tbl:cell>195 <tbl:cell column="description"><%=HTML.encodeTags(at.getDescription())%></tbl:cell>196 </tbl:row>197 <%198 }199 }200 %>201 </tbl:rows>202 </tbl:data>203 </tbl:table>204 <br>205 <%206 }207 if (protocolParameters != null )208 {209 if (protocolParameters.size() == 0)210 {211 %>212 <h4>Protocol parameters</h4>213 No protocol parameters has been defined for the protocol214 <%=Base.getLinkedName(ID, protocol, !readProtocol, true)%>215 (or you don't have permission to view them).216 <%217 }218 else219 {220 %>221 <h4 class="docked">Protocol parameters for:222 <%=Base.getLinkedName(ID, protocol, !readProtocol, true)%></h4>223 146 <tbl:table 224 id=" parameters"147 id="annotations" 225 148 clazz="itemlist" 226 149 columns="all" 227 150 > 228 151 <tbl:columndef 229 id=" parameter"230 title=" Parameter"152 id="annotation" 153 title="Annotation" 231 154 /> 232 155 <tbl:columndef … … 243 166 <tbl:rows> 244 167 <% 245 for (AnnotationType at : protocolParameters)168 for (AnnotationType at : annotationTypes) 246 169 { 247 170 Annotation a = as != null && as.hasAnnotation(at) ? as.getAnnotation(at) : null; 171 List<?> values = null; 248 172 Formatter formatter = null; 249 List<?> values = null;250 173 if (a != null) 251 174 { … … 255 178 if (values != null || !at.isRemoved()) 256 179 { 257 180 %> 258 181 <tbl:row> 259 <tbl:cell column=" parameter"><base:icon182 <tbl:cell column="annotation"><base:icon 260 183 image="deleted.gif" 261 184 tooltip="This item has been scheduled for deletion" 262 185 visible="<%=at.isRemoved()%>" 263 186 /><%=Base.getLinkedName(ID, at, false, true)%></tbl:cell> 264 <tbl:cell column="values"> 265 <%=values == null || values.size() == 0 ? "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 266 <% 187 <tbl:cell column="values"><%=values == null || values.size() == 0 ? "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 188 <% 267 189 if (writePermission) 268 190 { 269 191 %>: <base:icon image="edit.gif" 270 192 onclick="<%="editAnnotation("+at.getId()+")"%>" 271 tooltip="Modify the values of this protocol parameter" />193 tooltip="Modify the values of this annotation" /> 272 194 <% 273 195 } … … 284 206 </tbl:table> 285 207 <br> 208 </base:section> 209 <% 210 } 211 if (protocolParameters != null ) 212 { 213 if (protocolParameters.size() == 0) 214 { 215 %> 216 <h4>Protocol parameters</h4> 217 No protocol parameters has been defined for the protocol 218 <%=Base.getLinkedName(ID, protocol, !readProtocol, true)%> 219 (or you don't have permission to view them). 220 <% 221 } 222 else 223 { 224 %> 225 <base:section 226 id="parameterSection" 227 title="<%="Protocol parameters for: " + 228 Base.getLinkedName(ID, protocol, !readProtocol, true) + " (" + protocolParameters.size() + ")"%>" 229 > 230 <tbl:table 231 id="parameters" 232 clazz="itemlist" 233 columns="all" 234 > 235 <tbl:columndef 236 id="parameter" 237 title="Parameter" 238 /> 239 <tbl:columndef 240 id="values" 241 title="Values" 242 /> 243 <tbl:columndef 244 id="description" 245 title="Description" 246 /> 247 <tbl:data> 248 <tbl:columns> 249 </tbl:columns> 250 <tbl:rows> 251 <% 252 for (AnnotationType at : protocolParameters) 253 { 254 Annotation a = as != null && as.hasAnnotation(at) ? as.getAnnotation(at) : null; 255 Formatter formatter = null; 256 List<?> values = null; 257 if (a != null) 258 { 259 values = a.getValues(null); 260 formatter = FormatterFactory.getAnnotationFormatter(sc, a, null); 261 } 262 if (values != null || !at.isRemoved()) 263 { 264 %> 265 <tbl:row> 266 <tbl:cell column="parameter"><base:icon 267 image="deleted.gif" 268 tooltip="This item has been scheduled for deletion" 269 visible="<%=at.isRemoved()%>" 270 /><%=Base.getLinkedName(ID, at, false, true)%></tbl:cell> 271 <tbl:cell column="values"> 272 <%=values == null || values.size() == 0 ? "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 273 <% 274 if (writePermission) 275 { 276 %>: <base:icon image="edit.gif" 277 onclick="<%="editAnnotation("+at.getId()+")"%>" 278 tooltip="Modify the values of this protocol parameter" /> 279 <% 280 } 281 %> 282 </tbl:cell> 283 <tbl:cell column="description"><%=HTML.encodeTags(at.getDescription())%></tbl:cell> 284 </tbl:row> 285 <% 286 } 287 } 288 %> 289 </tbl:rows> 290 </tbl:data> 291 </tbl:table> 292 <br> 293 </base:section> 286 294 <% 287 295 } … … 302 310 { 303 311 %> 304 <h4 class="docked">Inherited annotations and protocol parameters</h4> 305 <tbl:table 306 id="inheritedAnnotations" 307 clazz="itemlist" 308 columns="all" 312 <base:section 313 id="inherited" 314 title="<%="Inherited annotations and protocol parameters (" + inheritedAnnotations + ")"%>" 309 315 > 310 <tbl:columndef 311 id="annotation" 312 title="Annotation" 313 /> 314 <tbl:columndef 315 id="item" 316 title="From item" 317 /> 318 <tbl:columndef 319 id="values" 320 title="Values" 321 /> 322 <tbl:columndef 323 id="description" 324 title="Description" 325 /> 326 <tbl:data> 327 <tbl:columns> 328 </tbl:columns> 329 <tbl:rows> 330 <% 331 String denied = "<i>- denied -</i>"; 332 for (Annotation a : inheritedAnnotations) 333 { 334 AnnotationType at = null; 335 int annotationTypeId = 0; 336 String name = denied; 337 String description = ""; 338 boolean writeInherited = false; 339 String icon = "joust/annotation.gif"; 340 Formatter formatter = FormatterFactory.getAnnotationFormatter(sc, a, null); 341 try 316 <tbl:table 317 id="inheritedAnnotations" 318 clazz="itemlist" 319 columns="all" 320 > 321 <tbl:columndef 322 id="annotation" 323 title="Annotation" 324 /> 325 <tbl:columndef 326 id="item" 327 title="From item" 328 /> 329 <tbl:columndef 330 id="values" 331 title="Values" 332 /> 333 <tbl:columndef 334 id="description" 335 title="Description" 336 /> 337 <tbl:data> 338 <tbl:columns> 339 </tbl:columns> 340 <tbl:rows> 341 <% 342 String denied = "<i>- denied -</i>"; 343 for (Annotation a : inheritedAnnotations) 342 344 { 343 at = a.getAnnotationType(); 344 annotationTypeId = at.getId(); 345 name = HTML.encodeTags(at.getName()); 346 if (at.isRemoved()) 345 AnnotationType at = null; 346 int annotationTypeId = 0; 347 String name = denied; 348 String description = ""; 349 boolean writeInherited = false; 350 String icon = "joust/annotation.gif"; 351 Formatter formatter = FormatterFactory.getAnnotationFormatter(sc, a, null); 352 try 347 353 { 348 icon = "deleted.gif"; 354 at = a.getAnnotationType(); 355 annotationTypeId = at.getId(); 356 name = HTML.encodeTags(at.getName()); 357 if (at.isRemoved()) 358 { 359 icon = "deleted.gif"; 360 } 361 else if (at.isProtocolParameter()) 362 { 363 icon = "parameter.gif"; 364 } 365 description = HTML.encodeTags(at.getDescription()); 349 366 } 350 else if (at.isProtocolParameter()) 367 catch (PermissionDeniedException ex) 368 {} 369 Nameable aItem = null; 370 try 351 371 { 352 icon = "parameter.gif"; 372 aItem = (Nameable)a.getAnnotationSet().getItem(); 373 writeInherited = aItem.hasPermission(Permission.WRITE); 353 374 } 354 description = HTML.encodeTags(at.getDescription()); 375 catch (PermissionDeniedException ex) 376 {} 377 List<?> values = a.getValues(null); 378 %> 379 <tbl:row> 380 <tbl:cell column="annotation"><base:icon image="<%=icon%>" /> <%=Base.getLinkedName(ID, at, at == null, true)%></tbl:cell> 381 <tbl:cell column="item"><%=Base.getLinkedName(ID, aItem, aItem == null, true)%><%=aItem != null ? " ["+aItem.getType()+"]" : ""%></tbl:cell> 382 <tbl:cell column="values"> 383 <%=values == null || values.size() == 0 ? 384 "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 385 <% 386 if (writeInherited && aItem != null) 387 { 388 %>: <base:icon image="edit.gif" 389 onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"', "+aItem.getId()+", "+at.getId()+")"%>" 390 tooltip="Modify the values of this annotation" /> 391 <% 392 } 393 %> 394 </tbl:cell> 395 <tbl:cell column="description"><%=description%></tbl:cell> 396 </tbl:row> 397 <% 355 398 } 356 catch (PermissionDeniedException ex)357 {}358 Nameable aItem = null;359 try360 {361 aItem = (Nameable)a.getAnnotationSet().getItem();362 writeInherited = aItem.hasPermission(Permission.WRITE);363 }364 catch (PermissionDeniedException ex)365 {}366 List<?> values = a.getValues(null);367 399 %> 368 <tbl:row> 369 <tbl:cell column="annotation"><base:icon image="<%=icon%>" /> <%=Base.getLinkedName(ID, at, at == null, true)%></tbl:cell> 370 <tbl:cell column="item"><%=Base.getLinkedName(ID, aItem, aItem == null, true)%><%=aItem != null ? " ["+aItem.getType()+"]" : ""%></tbl:cell> 371 <tbl:cell column="values"> 372 <%=values == null || values.size() == 0 ? 373 "<i>- no values -</i>" : Values.getString(values, ", ", true, formatter)%> 374 <% 375 if (writeInherited && aItem != null) 376 { 377 %>: <base:icon image="edit.gif" 378 onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"', "+aItem.getId()+", "+at.getId()+")"%>" 379 tooltip="Modify the values of this annotation" /> 380 <% 381 } 382 %> 383 </tbl:cell> 384 <tbl:cell column="description"><%=description%></tbl:cell> 385 </tbl:row> 386 <% 387 } 388 %> 389 </tbl:rows> 390 </tbl:data> 391 </tbl:table> 400 </tbl:rows> 401 </tbl:data> 402 </tbl:table> 403 </base:section> 392 404 <base:icon image="joust/annotation.gif" /> = Annotation, 393 405 <base:icon image="parameter.gif" /> = Protocol parameter -
trunk/www/lims/arraybatches/view_batch.jsp
r4889 r5044 42 42 import="net.sf.basedb.core.ItemQuery" 43 43 import="net.sf.basedb.core.Include" 44 import="net.sf.basedb.core.ItemResult Iterator"44 import="net.sf.basedb.core.ItemResultList" 45 45 import="net.sf.basedb.core.ItemResultList" 46 46 import="net.sf.basedb.core.MultiPermissions" … … 330 330 { 331 331 %> 332 <h4 class="docked">Array slides</h4> 333 <tbl:table 334 id="batches" 335 clazz="itemlist" 336 columns="all" 332 <base:section 333 id="batchSection" 334 title="<%="Array slides (" + slides.size() + ")"%>" 335 context="<%=cc %>" 337 336 > 338 <tbl:columndef 339 id="name" 340 title="Name" 341 /> 342 <tbl:columndef 343 id="hybridization" 344 title="Hybridization" 345 /> 346 <tbl:columndef 347 id="description" 348 title="Description" 349 /> 350 <tbl:data> 351 <tbl:columns> 352 </tbl:columns> 353 <tbl:rows> 354 <% 355 for (ArraySlide item : slides) 356 { 357 %> 358 <tbl:row> 359 <tbl:cell column="name"><base:icon 360 image="deleted.gif" 361 tooltip="This item has been scheduled for deletion" 362 visible="<%=item.isRemoved()%>" 363 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 364 <tbl:cell column="hybridization"><base:propertyvalue item="<%=item%>" property="hybridization" /></tbl:cell> 365 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 366 </tbl:row> 367 <% 368 } 369 %> 370 </tbl:rows> 371 </tbl:data> 372 </tbl:table> 373 <% 374 } 375 376 // Tables with users/groups/projects that this item is shared to 377 MultiPermissions mp = new MultiPermissions(Collections.singleton(batch)); 378 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 379 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 380 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 381 382 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 383 { 384 %> 385 <h4 class="docked">Shared to</h4> 386 <tbl:table 387 id="itemsSharedTo" 388 clazz="itemlist" 389 columns="all" 390 > 391 <tbl:columndef 392 id="itemType" 393 title="Item type" 394 /> 337 <tbl:table 338 id="batches" 339 clazz="itemlist" 340 columns="all" 341 > 395 342 <tbl:columndef 396 343 id="name" 397 344 title="Name" 398 345 /> 346 <tbl:columndef 347 id="hybridization" 348 title="Hybridization" 349 /> 399 350 <tbl:columndef 400 id=" permissions"401 title=" Permissions"351 id="description" 352 title="Description" 402 353 /> 403 354 <tbl:data> … … 406 357 <tbl:rows> 407 358 <% 408 while(projects.hasNext())359 for (ArraySlide item : slides) 409 360 { 410 Project project = projects.next(); 411 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 412 %> 361 %> 413 362 <tbl:row> 414 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>415 363 <tbl:cell column="name"><base:icon 416 image="deleted.gif" 417 tooltip="This item has been scheduled for deletion" 418 visible="<%=project.isRemoved()%>" 419 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 420 <tbl:cell column="permissions"> 421 <%=PermissionUtil.translatePermissionsToString(permissions)%> 422 </tbl:cell> 423 </tbl:row> 424 <% 425 } 426 while(groups.hasNext()) 427 { 428 Group group = groups.next(); 429 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 430 %> 431 <tbl:row> 432 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 433 <tbl:cell column="name"><base:icon 434 image="deleted.gif" 435 tooltip="This item has been scheduled for deletion" 436 visible="<%=group.isRemoved()%>" 437 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 438 <tbl:cell column="permissions"> 439 <%=PermissionUtil.translatePermissionsToString(permissions)%> 440 </tbl:cell> 441 </tbl:row> 442 <% 443 } 444 while (users.hasNext()) 445 { 446 User user = users.next(); 447 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 448 %> 449 <tbl:row> 450 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 451 <tbl:cell column="name"><base:icon 452 image="deleted.gif" 453 tooltip="This item has been scheduled for deletion" 454 visible="<%=user.isRemoved()%>" 455 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 456 <tbl:cell column="permissions"> 457 <%=PermissionUtil.translatePermissionsToString(permissions)%> 458 </tbl:cell> 364 image="deleted.gif" 365 tooltip="This item has been scheduled for deletion" 366 visible="<%=item.isRemoved()%>" 367 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 368 <tbl:cell column="hybridization"><base:propertyvalue item="<%=item%>" property="hybridization" /></tbl:cell> 369 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 459 370 </tbl:row> 460 371 <% … … 463 374 </tbl:rows> 464 375 </tbl:data> 465 </tbl:table> 376 </tbl:table> 377 </base:section> 378 <% 379 } 380 381 // Tables with users/groups/projects that this item is shared to 382 MultiPermissions mp = new MultiPermissions(Collections.singleton(batch)); 383 ItemResultList<User> users = mp.getUsers().list(dc); 384 ItemResultList<Group> groups = mp.getGroups().list(dc); 385 ItemResultList<Project> projects = mp.getProjects().list(dc); 386 int totalShare = users.size() + groups.size() + projects.size(); 387 388 if (totalShare > 0) 389 { 390 %> 391 <base:section 392 id="sharedTo" 393 title="<%="Shared to (" + totalShare + ")"%>" 394 context="<%=cc%>" 395 > 396 <tbl:table 397 id="itemsSharedTo" 398 clazz="itemlist" 399 columns="all" 400 > 401 <tbl:columndef 402 id="itemType" 403 title="Item type" 404 /> 405 <tbl:columndef 406 id="name" 407 title="Name" 408 /> 409 <tbl:columndef 410 id="permissions" 411 title="Permissions" 412 /> 413 <tbl:data> 414 <tbl:columns> 415 </tbl:columns> 416 <tbl:rows> 417 <% 418 for (Project project : projects) 419 { 420 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 421 %> 422 <tbl:row> 423 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 424 <tbl:cell column="name"><base:icon 425 image="deleted.gif" 426 tooltip="This item has been scheduled for deletion" 427 visible="<%=project.isRemoved()%>" 428 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 429 <tbl:cell column="permissions"> 430 <%=PermissionUtil.translatePermissionsToString(permissions)%> 431 </tbl:cell> 432 </tbl:row> 433 <% 434 } 435 for (Group group : groups) 436 { 437 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 438 %> 439 <tbl:row> 440 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 441 <tbl:cell column="name"><base:icon 442 image="deleted.gif" 443 tooltip="This item has been scheduled for deletion" 444 visible="<%=group.isRemoved()%>" 445 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 446 <tbl:cell column="permissions"> 447 <%=PermissionUtil.translatePermissionsToString(permissions)%> 448 </tbl:cell> 449 </tbl:row> 450 <% 451 } 452 for (User user : users) 453 { 454 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 455 %> 456 <tbl:row> 457 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 458 <tbl:cell column="name"><base:icon 459 image="deleted.gif" 460 tooltip="This item has been scheduled for deletion" 461 visible="<%=user.isRemoved()%>" 462 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 463 <tbl:cell column="permissions"> 464 <%=PermissionUtil.translatePermissionsToString(permissions)%> 465 </tbl:cell> 466 </tbl:row> 467 <% 468 } 469 %> 470 </tbl:rows> 471 </tbl:data> 472 </tbl:table> 473 </base:section> 466 474 <% 467 475 } -
trunk/www/lims/arrayslides/view_slide.jsp
r4889 r5044 41 41 import="net.sf.basedb.core.ItemQuery" 42 42 import="net.sf.basedb.core.Include" 43 import="net.sf.basedb.core.ItemResult Iterator"43 import="net.sf.basedb.core.ItemResultList" 44 44 import="net.sf.basedb.core.ItemResultList" 45 45 import="net.sf.basedb.core.MultiPermissions" … … 303 303 // Tables with users/groups/projects that this item is shared to 304 304 MultiPermissions mp = new MultiPermissions(Collections.singleton(slide)); 305 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 306 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 307 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 305 ItemResultList<User> users = mp.getUsers().list(dc); 306 ItemResultList<Group> groups = mp.getGroups().list(dc); 307 ItemResultList<Project> projects = mp.getProjects().list(dc); 308 int totalShare = users.size() + groups.size() + projects.size(); 308 309 309 if ( users.hasNext() || groups.hasNext() || projects.hasNext())310 if (totalShare > 0) 310 311 { 311 312 %> 312 <h4 class="docked">Shared to</h4> 313 <tbl:table 314 id="itemsSharedTo" 315 clazz="itemlist" 316 columns="all" 317 > 318 <tbl:columndef 319 id="itemType" 320 title="Item type" 321 /> 322 <tbl:columndef 323 id="name" 324 title="Name" 325 /> 326 <tbl:columndef 327 id="permissions" 328 title="Permissions" 329 /> 330 <tbl:data> 331 <tbl:columns> 332 </tbl:columns> 333 <tbl:rows> 334 <% 335 while(projects.hasNext()) 336 { 337 Project project = projects.next(); 338 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 339 %> 340 <tbl:row> 341 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 342 <tbl:cell column="name"><base:icon 343 image="deleted.gif" 344 tooltip="This item has been scheduled for deletion" 345 visible="<%=project.isRemoved()%>" 346 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 347 <tbl:cell column="permissions"> 348 <%=PermissionUtil.translatePermissionsToString(permissions)%> 349 </tbl:cell> 350 </tbl:row> 313 <base:section 314 id="sharedTo" 315 title="<%="Shared to (" + totalShare + ")"%>" 316 context="<%=cc%>" 317 > 318 <tbl:table 319 id="itemsSharedTo" 320 clazz="itemlist" 321 columns="all" 322 > 323 <tbl:columndef 324 id="itemType" 325 title="Item type" 326 /> 327 <tbl:columndef 328 id="name" 329 title="Name" 330 /> 331 <tbl:columndef 332 id="permissions" 333 title="Permissions" 334 /> 335 <tbl:data> 336 <tbl:columns> 337 </tbl:columns> 338 <tbl:rows> 351 339 <% 352 } 353 while(groups.hasNext()) 354 { 355 Group group = groups.next(); 356 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 340 for (Project project : projects) 341 { 342 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 343 %> 344 <tbl:row> 345 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 346 <tbl:cell column="name"><base:icon 347 image="deleted.gif" 348 tooltip="This item has been scheduled for deletion" 349 visible="<%=project.isRemoved()%>" 350 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 351 <tbl:cell column="permissions"> 352 <%=PermissionUtil.translatePermissionsToString(permissions)%> 353 </tbl:cell> 354 </tbl:row> 355 <% 356 } 357 for (Group group : groups) 358 { 359 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 360 %> 361 <tbl:row> 362 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 363 <tbl:cell column="name"><base:icon 364 image="deleted.gif" 365 tooltip="This item has been scheduled for deletion" 366 visible="<%=group.isRemoved()%>" 367 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 368 <tbl:cell column="permissions"> 369 <%=PermissionUtil.translatePermissionsToString(permissions)%> 370 </tbl:cell> 371 </tbl:row> 372 <% 373 } 374 for (User user : users) 375 { 376 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 377 %> 378 <tbl:row> 379 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 380 <tbl:cell column="name"><base:icon 381 image="deleted.gif" 382 tooltip="This item has been scheduled for deletion" 383 visible="<%=user.isRemoved()%>" 384 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 385 <tbl:cell column="permissions"> 386 <%=PermissionUtil.translatePermissionsToString(permissions)%> 387 </tbl:cell> 388 </tbl:row> 389 <% 390 } 357 391 %> 358 <tbl:row> 359 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 360 <tbl:cell column="name"><base:icon 361 image="deleted.gif" 362 tooltip="This item has been scheduled for deletion" 363 visible="<%=group.isRemoved()%>" 364 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 365 <tbl:cell column="permissions"> 366 <%=PermissionUtil.translatePermissionsToString(permissions)%> 367 </tbl:cell> 368 </tbl:row> 369 <% 370 } 371 while (users.hasNext()) 372 { 373 User user = users.next(); 374 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 375 %> 376 <tbl:row> 377 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 378 <tbl:cell column="name"><base:icon 379 image="deleted.gif" 380 tooltip="This item has been scheduled for deletion" 381 visible="<%=user.isRemoved()%>" 382 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 383 <tbl:cell column="permissions"> 384 <%=PermissionUtil.translatePermissionsToString(permissions)%> 385 </tbl:cell> 386 </tbl:row> 387 <% 388 } 389 %> 390 </tbl:rows> 391 </tbl:data> 392 </tbl:table> 392 </tbl:rows> 393 </tbl:data> 394 </tbl:table> 395 </base:section> 393 396 <% 394 397 } -
trunk/www/lims/geometries/view_geometry.jsp
r4889 r5044 261 261 { 262 262 %> 263 <h4 class="docked">Plate types</h4> 264 <tbl:table 265 id="plateTypes" 266 clazz="itemlist" 267 columns="all" 263 <base:section 264 id="types" 265 title="<%="Plate types (" + plateTypes.size() + ")"%>" 266 context="<%=cc%>" 268 267 > 269 <tbl:columndef 270 id="name" 271 title="Name" 272 /> 273 <tbl:columndef 274 id="description" 275 title="Description" 276 /> 277 <tbl:data> 278 <tbl:columns> 279 </tbl:columns> 280 <tbl:rows> 281 <% 282 for (PlateType item : plateTypes) 283 { 268 <tbl:table 269 id="plateTypes" 270 clazz="itemlist" 271 columns="all" 272 > 273 <tbl:columndef 274 id="name" 275 title="Name" 276 /> 277 <tbl:columndef 278 id="description" 279 title="Description" 280 /> 281 <tbl:data> 282 <tbl:columns> 283 </tbl:columns> 284 <tbl:rows> 285 <% 286 for (PlateType item : plateTypes) 287 { 288 %> 289 <tbl:row> 290 <tbl:cell column="name"><base:icon 291 image="deleted.gif" 292 tooltip="This item has been scheduled for deletion" 293 visible="<%=item.isRemoved()%>" 294 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 295 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 296 </tbl:row> 297 <% 298 } 284 299 %> 285 <tbl:row> 286 <tbl:cell column="name"><base:icon 287 image="deleted.gif" 288 tooltip="This item has been scheduled for deletion" 289 visible="<%=item.isRemoved()%>" 290 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 291 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 292 </tbl:row> 293 <% 294 } 295 %> 296 </tbl:rows> 297 </tbl:data> 298 </tbl:table> 300 </tbl:rows> 301 </tbl:data> 302 </tbl:table> 303 </base:section> 299 304 <% 300 305 } -
trunk/www/lims/platemappings/view_mapping.jsp
r4889 r5044 36 36 import="net.sf.basedb.core.User" 37 37 import="net.sf.basedb.core.ItemQuery" 38 import="net.sf.basedb.core.Include" 39 import="net.sf.basedb.core.ItemResultIterator" 38 import="net.sf.basedb.core.Include" 40 39 import="net.sf.basedb.core.ItemResultList" 41 40 import="net.sf.basedb.core.MultiPermissions" … … 294 293 // Tables with users/groups/projects that this item is shared to 295 294 MultiPermissions mp = new MultiPermissions(Collections.singleton(mapping)); 296 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 297 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 298 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 295 ItemResultList<User> users = mp.getUsers().list(dc); 296 ItemResultList<Group> groups = mp.getGroups().list(dc); 297 ItemResultList<Project> projects = mp.getProjects().list(dc); 298 int totalShare = users.size() + groups.size() + projects.size(); 299 299 300 if ( users.hasNext() || groups.hasNext() || projects.hasNext())300 if (totalShare > 0) 301 301 { 302 302 %> 303 <h4 class="docked">Shared to</h4> 304 <tbl:table 305 id="itemsSharedTo" 306 clazz="itemlist" 307 columns="all" 308 > 309 <tbl:columndef 310 id="itemType" 311 title="Item type" 312 /> 313 <tbl:columndef 314 id="name" 315 title="Name" 316 /> 317 <tbl:columndef 318 id="permissions" 319 title="Permissions" 320 /> 321 <tbl:data> 322 <tbl:columns> 323 </tbl:columns> 324 <tbl:rows> 325 <% 326 while(projects.hasNext()) 327 { 328 Project project = projects.next(); 329 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 330 %> 331 <tbl:row> 332 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 333 <tbl:cell column="name"><base:icon 334 image="deleted.gif" 335 tooltip="This item has been scheduled for deletion" 336 visible="<%=project.isRemoved()%>" 337 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 338 <tbl:cell column="permissions"> 339 <%=PermissionUtil.translatePermissionsToString(permissions)%> 340 </tbl:cell> 341 </tbl:row> 303 <base:section 304 id="sharedTo" 305 title="<%="Shared to (" + totalShare + ")"%>" 306 context="<%=cc %>" 307 > 308 <tbl:table 309 id="itemsSharedTo" 310 clazz="itemlist" 311 columns="all" 312 > 313 <tbl:columndef 314 id="itemType" 315 title="Item type" 316 /> 317 <tbl:columndef 318 id="name" 319 title="Name" 320 /> 321 <tbl:columndef 322 id="permissions" 323 title="Permissions" 324 /> 325 <tbl:data> 326 <tbl:columns> 327 </tbl:columns> 328 <tbl:rows> 342 329 <% 343 } 344 while(groups.hasNext()) 345 { 346 Group group = groups.next(); 347 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 330 for (Project project : projects) 331 { 332 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 333 %> 334 <tbl:row> 335 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 336 <tbl:cell column="name"><base:icon 337 image="deleted.gif" 338 tooltip="This item has been scheduled for deletion" 339 visible="<%=project.isRemoved()%>" 340 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 341 <tbl:cell column="permissions"> 342 <%=PermissionUtil.translatePermissionsToString(permissions)%> 343 </tbl:cell> 344 </tbl:row> 345 <% 346 } 347 for (Group group : groups) 348 { 349 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 350 %> 351 <tbl:row> 352 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 353 <tbl:cell column="name"><base:icon 354 image="deleted.gif" 355 tooltip="This item has been scheduled for deletion" 356 visible="<%=group.isRemoved()%>" 357 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 358 <tbl:cell column="permissions"> 359 <%=PermissionUtil.translatePermissionsToString(permissions)%> 360 </tbl:cell> 361 </tbl:row> 362 <% 363 } 364 for (User user : users) 365 { 366 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 367 %> 368 <tbl:row> 369 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 370 <tbl:cell column="name"><base:icon 371 image="deleted.gif" 372 tooltip="This item has been scheduled for deletion" 373 visible="<%=user.isRemoved()%>" 374 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 375 <tbl:cell column="permissions"> 376 <%=PermissionUtil.translatePermissionsToString(permissions)%> 377 </tbl:cell> 378 </tbl:row> 379 <% 380 } 348 381 %> 349 <tbl:row> 350 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 351 <tbl:cell column="name"><base:icon 352 image="deleted.gif" 353 tooltip="This item has been scheduled for deletion" 354 visible="<%=group.isRemoved()%>" 355 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 356 <tbl:cell column="permissions"> 357 <%=PermissionUtil.translatePermissionsToString(permissions)%> 358 </tbl:cell> 359 </tbl:row> 360 <% 361 } 362 while (users.hasNext()) 363 { 364 User user = users.next(); 365 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 366 %> 367 <tbl:row> 368 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 369 <tbl:cell column="name"><base:icon 370 image="deleted.gif" 371 tooltip="This item has been scheduled for deletion" 372 visible="<%=user.isRemoved()%>" 373 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 374 <tbl:cell column="permissions"> 375 <%=PermissionUtil.translatePermissionsToString(permissions)%> 376 </tbl:cell> 377 </tbl:row> 378 <% 379 } 380 %> 381 </tbl:rows> 382 </tbl:data> 383 </tbl:table> 382 </tbl:rows> 383 </tbl:data> 384 </tbl:table> 385 </base:section> 384 386 <% 385 387 } -
trunk/www/lims/plates/view_plate.jsp
r4889 r5044 341 341 { 342 342 %> 343 <h4 class="docked">Parent plates</h4> 344 <tbl:table 345 id="parentplates" 346 clazz="itemlist" 347 columns="all" 343 <base:section 344 id="parents" 345 title="<%="Parent plates (" + parentPlates.size() + ")"%>" 346 context="<%=cc%>" 348 347 > 349 <tbl:columndef 350 id="name" 351 title="Name" 352 /> 353 <tbl:columndef 354 id="index" 355 title="Index" 356 /> 357 <tbl:columndef 358 id="description" 359 title="Description" 360 /> 361 <tbl:data> 362 <tbl:columns> 363 </tbl:columns> 364 <tbl:rows> 365 <% 366 for (Plate item : parentPlates) 367 { 348 <tbl:table 349 id="parentplates" 350 clazz="itemlist" 351 columns="all" 352 > 353 <tbl:columndef 354 id="name" 355 title="Name" 356 /> 357 <tbl:columndef 358 id="index" 359 title="Index" 360 /> 361 <tbl:columndef 362 id="description" 363 title="Description" 364 /> 365 <tbl:data> 366 <tbl:columns> 367 </tbl:columns> 368 <tbl:rows> 369 <% 370 for (Plate item : parentPlates) 371 { 372 %> 373 <tbl:row> 374 <tbl:cell column="name"><base:icon 375 image="deleted.gif" 376 tooltip="This item has been scheduled for deletion" 377 visible="<%=item.isRemoved()%>" 378 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 379 <tbl:cell column="index"><%=plate.getSourceIndex(item)+1%></tbl:cell> 380 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 381 </tbl:row> 382 <% 383 } 368 384 %> 369 <tbl:row> 370 <tbl:cell column="name"><base:icon 371 image="deleted.gif" 372 tooltip="This item has been scheduled for deletion" 373 visible="<%=item.isRemoved()%>" 374 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 375 <tbl:cell column="index"><%=plate.getSourceIndex(item)+1%></tbl:cell> 376 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 377 </tbl:row> 378 <% 379 } 380 %> 381 </tbl:rows> 382 </tbl:data> 383 </tbl:table> 385 </tbl:rows> 386 </tbl:data> 387 </tbl:table> 388 </base:section> 384 389 <% 385 390 } … … 400 405 { 401 406 %> 402 <h4 class="docked">Child plates</h4> 403 <tbl:table 404 id="childplates" 405 clazz="itemlist" 406 columns="all" 407 <base:section 408 id="children" 409 title="<%="Child plates (" + childPlates.size() + ")"%>" 410 context="<%=cc%>" 407 411 > 408 <tbl:columndef 409 id="name" 410 title="Name" 411 /> 412 <tbl:columndef 413 id="mapping" 414 title="Mapping" 415 /> 416 <tbl:columndef 417 id="index" 418 title="Index" 419 /> 420 <tbl:columndef 421 id="description" 422 title="Description" 423 /> 424 <tbl:data> 425 <tbl:columns> 426 </tbl:columns> 427 <tbl:rows> 428 <% 429 for (Plate item : childPlates) 430 { 431 %> 432 <tbl:row> 433 <tbl:cell column="name"><base:icon 434 image="deleted.gif" 435 tooltip="This item has been scheduled for deletion" 436 visible="<%=item.isRemoved()%>" 437 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 438 <tbl:cell column="mapping"><base:propertyvalue item="<%=item%>" property="plateMapping" /></tbl:cell> 439 <tbl:cell column="index"><%=item.getSourceIndex(plate) + 1%></tbl:cell> 440 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 441 </tbl:row> 442 <% 443 } 444 %> 445 </tbl:rows> 446 </tbl:data> 447 </tbl:table> 448 <% 449 } 450 451 // Tables with users/groups/projects that this item is shared to 452 MultiPermissions mp = new MultiPermissions(Collections.singleton(plate)); 453 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 454 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 455 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 456 457 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 458 { 459 %> 460 <h4 class="docked">Shared to</h4> 461 <tbl:table 462 id="itemsSharedTo" 463 clazz="itemlist" 464 columns="all" 465 > 466 <tbl:columndef 467 id="itemType" 468 title="Item type" 469 /> 412 <tbl:table 413 id="childplates" 414 clazz="itemlist" 415 columns="all" 416 > 470 417 <tbl:columndef 471 418 id="name" 472 419 title="Name" 473 420 /> 421 <tbl:columndef 422 id="mapping" 423 title="Mapping" 424 /> 474 425 <tbl:columndef 475 id="permissions" 476 title="Permissions" 426 id="index" 427 title="Index" 428 /> 429 <tbl:columndef 430 id="description" 431 title="Description" 477 432 /> 478 433 <tbl:data> … … 481 436 <tbl:rows> 482 437 <% 483 while(projects.hasNext())438 for (Plate item : childPlates) 484 439 { 485 Project project = projects.next(); 486 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 487 %> 440 %> 488 441 <tbl:row> 489 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>490 442 <tbl:cell column="name"><base:icon 491 image="deleted.gif" 492 tooltip="This item has been scheduled for deletion" 493 visible="<%=project.isRemoved()%>" 494 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 495 <tbl:cell column="permissions"> 496 <%=PermissionUtil.translatePermissionsToString(permissions)%> 497 </tbl:cell> 498 </tbl:row> 499 <% 500 } 501 while(groups.hasNext()) 502 { 503 Group group = groups.next(); 504 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 505 %> 506 <tbl:row> 507 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 508 <tbl:cell column="name"><base:icon 509 image="deleted.gif" 510 tooltip="This item has been scheduled for deletion" 511 visible="<%=group.isRemoved()%>" 512 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 513 <tbl:cell column="permissions"> 514 <%=PermissionUtil.translatePermissionsToString(permissions)%> 515 </tbl:cell> 516 </tbl:row> 517 <% 518 } 519 while (users.hasNext()) 520 { 521 User user = users.next(); 522 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 523 %> 524 <tbl:row> 525 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 526 <tbl:cell column="name"><base:icon 527 image="deleted.gif" 528 tooltip="This item has been scheduled for deletion" 529 visible="<%=user.isRemoved()%>" 530 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 531 <tbl:cell column="permissions"> 532 <%=PermissionUtil.translatePermissionsToString(permissions)%> 533 </tbl:cell> 443 image="deleted.gif" 444 tooltip="This item has been scheduled for deletion" 445 visible="<%=item.isRemoved()%>" 446 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 447 <tbl:cell column="mapping"><base:propertyvalue item="<%=item%>" property="plateMapping" /></tbl:cell> 448 <tbl:cell column="index"><%=item.getSourceIndex(plate) + 1%></tbl:cell> 449 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 534 450 </tbl:row> 535 451 <% … … 538 454 </tbl:rows> 539 455 </tbl:data> 540 </tbl:table> 456 </tbl:table> 457 </base:section> 458 <% 459 } 460 461 // Tables with users/groups/projects that this item is shared to 462 MultiPermissions mp = new MultiPermissions(Collections.singleton(plate)); 463 ItemResultList<User> users = mp.getUsers().list(dc); 464 ItemResultList<Group> groups = mp.getGroups().list(dc); 465 ItemResultList<Project> projects = mp.getProjects().list(dc); 466 int totalShare = users.size() + groups.size() + projects.size(); 467 468 if (totalShare > 0) 469 { 470 %> 471 <base:section 472 id="sharedTo" 473 title="<%="Shared to (" + totalShare + ")"%>" 474 context="<%=cc%>" 475 > 476 <tbl:table 477 id="itemsSharedTo" 478 clazz="itemlist" 479 columns="all" 480 > 481 <tbl:columndef 482 id="itemType" 483 title="Item type" 484 /> 485 <tbl:columndef 486 id="name" 487 title="Name" 488 /> 489 <tbl:columndef 490 id="permissions" 491 title="Permissions" 492 /> 493 <tbl:data> 494 <tbl:columns> 495 </tbl:columns> 496 <tbl:rows> 497 <% 498 for (Project project : projects) 499 { 500 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 501 %> 502 <tbl:row> 503 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 504 <tbl:cell column="name"><base:icon 505 image="deleted.gif" 506 tooltip="This item has been scheduled for deletion" 507 visible="<%=project.isRemoved()%>" 508 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 509 <tbl:cell column="permissions"> 510 <%=PermissionUtil.translatePermissionsToString(permissions)%> 511 </tbl:cell> 512 </tbl:row> 513 <% 514 } 515 for (Group group : groups) 516 { 517 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 518 %> 519 <tbl:row> 520 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 521 <tbl:cell column="name"><base:icon 522 image="deleted.gif" 523 tooltip="This item has been scheduled for deletion" 524 visible="<%=group.isRemoved()%>" 525 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 526 <tbl:cell column="permissions"> 527 <%=PermissionUtil.translatePermissionsToString(permissions)%> 528 </tbl:cell> 529 </tbl:row> 530 <% 531 } 532 for (User user : users) 533 { 534 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 535 %> 536 <tbl:row> 537 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 538 <tbl:cell column="name"><base:icon 539 image="deleted.gif" 540 tooltip="This item has been scheduled for deletion" 541 visible="<%=user.isRemoved()%>" 542 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 543 <tbl:cell column="permissions"> 544 <%=PermissionUtil.translatePermissionsToString(permissions)%> 545 </tbl:cell> 546 </tbl:row> 547 <% 548 } 549 %> 550 </tbl:rows> 551 </tbl:data> 552 </tbl:table> 553 </base:section> 541 554 <% 542 555 } -
trunk/www/lims/platetypes/view_platetype.jsp
r4889 r5044 37 37 import="net.sf.basedb.core.User" 38 38 import="net.sf.basedb.core.ItemQuery" 39 import="net.sf.basedb.core.Include" 40 import="net.sf.basedb.core.ItemResultIterator" 39 import="net.sf.basedb.core.Include" 41 40 import="net.sf.basedb.core.ItemResultList" 42 41 import="net.sf.basedb.core.MultiPermissions" … … 299 298 { 300 299 %> 301 <h4 class="docked">Plates</h4> 302 <tbl:table 303 id="plateTypes" 304 clazz="itemlist" 305 columns="all" 300 <base:section 301 id="plates" 302 title="<%="Plates (" + plates.size() + ")"%>" 303 context="<%=cc%>" 306 304 > 307 <tbl:columndef 308 id="name" 309 title="Name" 310 /> 311 <tbl:columndef 312 id="barcode" 313 title="Barcode" 314 /> 315 <tbl:columndef 316 id="destroyed" 317 title="Destroyed" 318 /> 319 <tbl:columndef 320 id="description" 321 title="Description" 322 /> 323 <tbl:data> 324 <tbl:columns> 325 </tbl:columns> 326 <tbl:rows> 327 <% 328 for (Plate item : plates) 329 { 330 %> 331 <tbl:row> 332 <tbl:cell column="name"><base:icon 333 image="deleted.gif" 334 tooltip="This item has been scheduled for deletion" 335 visible="<%=item.isRemoved()%>" 336 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 337 <tbl:cell column="barcode"><%=HTML.encodeTags(item.getBarcode())%></tbl:cell> 338 <tbl:cell column="destroyed"><%=item.isDestroyed() ? "yes" : "no" %></tbl:cell> 339 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 340 </tbl:row> 341 <% 342 } 343 %> 344 </tbl:rows> 345 </tbl:data> 346 </tbl:table> 347 <% 348 } 349 350 // Tables with users/groups/projects that this item is shared to 351 MultiPermissions mp = new MultiPermissions(Collections.singleton(plateType)); 352 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 353 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 354 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 355 356 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 357 { 358 %> 359 <h4 class="docked">Shared to</h4> 360 <tbl:table 361 id="itemsSharedTo" 362 clazz="itemlist" 363 columns="all" 364 > 365 <tbl:columndef 366 id="itemType" 367 title="Item type" 368 /> 305 <tbl:table 306 id="plateTypes" 307 clazz="itemlist" 308 columns="all" 309 > 369 310 <tbl:columndef 370 311 id="name" … … 372 313 /> 373 314 <tbl:columndef 374 id="permissions" 375 title="Permissions" 315 id="barcode" 316 title="Barcode" 317 /> 318 <tbl:columndef 319 id="destroyed" 320 title="Destroyed" 321 /> 322 <tbl:columndef 323 id="description" 324 title="Description" 376 325 /> 377 326 <tbl:data> … … 380 329 <tbl:rows> 381 330 <% 382 while(projects.hasNext())331 for (Plate item : plates) 383 332 { 384 Project project = projects.next(); 385 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 386 %> 333 %> 387 334 <tbl:row> 388 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>389 335 <tbl:cell column="name"><base:icon 390 image="deleted.gif" 391 tooltip="This item has been scheduled for deletion" 392 visible="<%=project.isRemoved()%>" 393 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 394 <tbl:cell column="permissions"> 395 <%=PermissionUtil.translatePermissionsToString(permissions)%> 396 </tbl:cell> 397 </tbl:row> 398 <% 399 } 400 while(groups.hasNext()) 401 { 402 Group group = groups.next(); 403 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 404 %> 405 <tbl:row> 406 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 407 <tbl:cell column="name"><base:icon 408 image="deleted.gif" 409 tooltip="This item has been scheduled for deletion" 410 visible="<%=group.isRemoved()%>" 411 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 412 <tbl:cell column="permissions"> 413 <%=PermissionUtil.translatePermissionsToString(permissions)%> 414 </tbl:cell> 415 </tbl:row> 416 <% 417 } 418 while (users.hasNext()) 419 { 420 User user = users.next(); 421 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 422 %> 423 <tbl:row> 424 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 425 <tbl:cell column="name"><base:icon 426 image="deleted.gif" 427 tooltip="This item has been scheduled for deletion" 428 visible="<%=user.isRemoved()%>" 429 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 430 <tbl:cell column="permissions"> 431 <%=PermissionUtil.translatePermissionsToString(permissions)%> 432 </tbl:cell> 336 image="deleted.gif" 337 tooltip="This item has been scheduled for deletion" 338 visible="<%=item.isRemoved()%>" 339 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 340 <tbl:cell column="barcode"><%=HTML.encodeTags(item.getBarcode())%></tbl:cell> 341 <tbl:cell column="destroyed"><%=item.isDestroyed() ? "yes" : "no" %></tbl:cell> 342 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 433 343 </tbl:row> 434 344 <% … … 437 347 </tbl:rows> 438 348 </tbl:data> 439 </tbl:table> 349 </tbl:table> 350 </base:section> 351 <% 352 } 353 354 // Tables with users/groups/projects that this item is shared to 355 MultiPermissions mp = new MultiPermissions(Collections.singleton(plateType)); 356 ItemResultList<User> users = mp.getUsers().list(dc); 357 ItemResultList<Group> groups = mp.getGroups().list(dc); 358 ItemResultList<Project> projects = mp.getProjects().list(dc); 359 int totalShare = users.size() + groups.size() + projects.size(); 360 361 if (totalShare > 0) 362 { 363 %> 364 <base:section 365 id="sharedTo" 366 title="<%="Shared to (" + totalShare + ")"%>" 367 context="<%=cc%>" 368 > 369 <tbl:table 370 id="itemsSharedTo" 371 clazz="itemlist" 372 columns="all" 373 > 374 <tbl:columndef 375 id="itemType" 376 title="Item type" 377 /> 378 <tbl:columndef 379 id="name" 380 title="Name" 381 /> 382 <tbl:columndef 383 id="permissions" 384 title="Permissions" 385 /> 386 <tbl:data> 387 <tbl:columns> 388 </tbl:columns> 389 <tbl:rows> 390 <% 391 for (Project project : projects) 392 { 393 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 394 %> 395 <tbl:row> 396 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 397 <tbl:cell column="name"><base:icon 398 image="deleted.gif" 399 tooltip="This item has been scheduled for deletion" 400 visible="<%=project.isRemoved()%>" 401 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 402 <tbl:cell column="permissions"> 403 <%=PermissionUtil.translatePermissionsToString(permissions)%> 404 </tbl:cell> 405 </tbl:row> 406 <% 407 } 408 for (Group group : groups) 409 { 410 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 411 %> 412 <tbl:row> 413 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 414 <tbl:cell column="name"><base:icon 415 image="deleted.gif" 416 tooltip="This item has been scheduled for deletion" 417 visible="<%=group.isRemoved()%>" 418 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 419 <tbl:cell column="permissions"> 420 <%=PermissionUtil.translatePermissionsToString(permissions)%> 421 </tbl:cell> 422 </tbl:row> 423 <% 424 } 425 for (User user : users) 426 { 427 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 428 %> 429 <tbl:row> 430 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 431 <tbl:cell column="name"><base:icon 432 image="deleted.gif" 433 tooltip="This item has been scheduled for deletion" 434 visible="<%=user.isRemoved()%>" 435 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 436 <tbl:cell column="permissions"> 437 <%=PermissionUtil.translatePermissionsToString(permissions)%> 438 </tbl:cell> 439 </tbl:row> 440 <% 441 } 442 %> 443 </tbl:rows> 444 </tbl:data> 445 </tbl:table> 446 </base:section> 440 447 <% 441 448 }
Note: See TracChangeset
for help on using the changeset viewer.