Changeset 5045
- Timestamp:
- Aug 12, 2009, 9:42:51 AM (13 years ago)
- Location:
- trunk/www
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/filemanager/files/view_file.jsp
r4889 r5045 31 31 import="net.sf.basedb.core.Item" 32 32 import="net.sf.basedb.core.ItemContext" 33 import="net.sf.basedb.core.ItemResult Iterator"33 import="net.sf.basedb.core.ItemResultList" 34 34 import="net.sf.basedb.core.Permission" 35 35 import="net.sf.basedb.core.File" … … 426 426 // Tables with users/groups/projects that this item is shared to 427 427 MultiPermissions mp = new MultiPermissions(Collections.singleton(file)); 428 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 429 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 430 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 428 ItemResultList<User> users = mp.getUsers().list(dc); 429 ItemResultList<Group> groups = mp.getGroups().list(dc); 430 ItemResultList<Project> projects = mp.getProjects().list(dc); 431 int totalShare = users.size() + groups.size() + projects.size(); 431 432 432 if ( users.hasNext() || groups.hasNext() || projects.hasNext())433 if (totalShare > 0) 433 434 { 434 435 %> 435 <h4 class="docked">Shared to</h4> 436 <tbl:table 437 id="itemsSharedTo" 438 clazz="itemlist" 439 columns="all" 440 > 441 <tbl:columndef 442 id="itemType" 443 title="Item type" 444 /> 445 <tbl:columndef 446 id="name" 447 title="Name" 448 /> 449 <tbl:columndef 450 id="permissions" 451 title="Permissions" 452 /> 453 <tbl:data> 454 <tbl:columns> 455 </tbl:columns> 456 <tbl:rows> 457 <% 458 while(projects.hasNext()) 459 { 460 Project project = projects.next(); 461 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 462 %> 463 <tbl:row> 464 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 465 <tbl:cell column="name"><base:icon 466 image="deleted.gif" 467 tooltip="This item has been scheduled for deletion" 468 visible="<%=project.isRemoved()%>" 469 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 470 <tbl:cell column="permissions"> 471 <%=PermissionUtil.translatePermissionsToString(permissions)%> 472 </tbl:cell> 473 </tbl:row> 436 <base:section 437 id="sharedTo" 438 title="<%="Shared to (" + totalShare + ")"%>" 439 context="<%=cc%>" 440 > 441 <tbl:table 442 id="itemsSharedTo" 443 clazz="itemlist" 444 columns="all" 445 > 446 <tbl:columndef 447 id="itemType" 448 title="Item type" 449 /> 450 <tbl:columndef 451 id="name" 452 title="Name" 453 /> 454 <tbl:columndef 455 id="permissions" 456 title="Permissions" 457 /> 458 <tbl:data> 459 <tbl:columns> 460 </tbl:columns> 461 <tbl:rows> 474 462 <% 475 } 476 while(groups.hasNext()) 477 { 478 Group group = groups.next(); 479 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 463 for (Project project : projects) 464 { 465 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 466 %> 467 <tbl:row> 468 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 469 <tbl:cell column="name"><base:icon 470 image="deleted.gif" 471 tooltip="This item has been scheduled for deletion" 472 visible="<%=project.isRemoved()%>" 473 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 474 <tbl:cell column="permissions"> 475 <%=PermissionUtil.translatePermissionsToString(permissions)%> 476 </tbl:cell> 477 </tbl:row> 478 <% 479 } 480 for (Group group : groups) 481 { 482 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 483 %> 484 <tbl:row> 485 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 486 <tbl:cell column="name"><base:icon 487 image="deleted.gif" 488 tooltip="This item has been scheduled for deletion" 489 visible="<%=group.isRemoved()%>" 490 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 491 <tbl:cell column="permissions"> 492 <%=PermissionUtil.translatePermissionsToString(permissions)%> 493 </tbl:cell> 494 </tbl:row> 495 <% 496 } 497 for (User user : users) 498 { 499 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 500 %> 501 <tbl:row> 502 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 503 <tbl:cell column="name"><base:icon 504 image="deleted.gif" 505 tooltip="This item has been scheduled for deletion" 506 visible="<%=user.isRemoved()%>" 507 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 508 <tbl:cell column="permissions"> 509 <%=PermissionUtil.translatePermissionsToString(permissions)%> 510 </tbl:cell> 511 </tbl:row> 512 <% 513 } 480 514 %> 481 <tbl:row> 482 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 483 <tbl:cell column="name"><base:icon 484 image="deleted.gif" 485 tooltip="This item has been scheduled for deletion" 486 visible="<%=group.isRemoved()%>" 487 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 488 <tbl:cell column="permissions"> 489 <%=PermissionUtil.translatePermissionsToString(permissions)%> 490 </tbl:cell> 491 </tbl:row> 492 <% 493 } 494 while (users.hasNext()) 495 { 496 User user = users.next(); 497 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 498 %> 499 <tbl:row> 500 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 501 <tbl:cell column="name"><base:icon 502 image="deleted.gif" 503 tooltip="This item has been scheduled for deletion" 504 visible="<%=user.isRemoved()%>" 505 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 506 <tbl:cell column="permissions"> 507 <%=PermissionUtil.translatePermissionsToString(permissions)%> 508 </tbl:cell> 509 </tbl:row> 510 <% 511 } 512 %> 513 </tbl:rows> 514 </tbl:data> 515 </tbl:table> 515 </tbl:rows> 516 </tbl:data> 517 </tbl:table> 518 </base:section> 516 519 <% 517 520 } -
trunk/www/my_base/projects/view_project.jsp
r4889 r5045 275 275 </tr> 276 276 </table> 277 <% 278 // Query to retrieve child groups 279 ItemQuery<Group> groupQuery = project.getGroups(); 280 groupQuery.include(Include.ALL); 281 groupQuery.order(Orders.asc(Hql.property("name"))); 282 ItemResultList<Group> groups = groupQuery.list(dc); 277 283 278 <h4 class="docked">Members</h4> 284 // Query to retrieve user members 285 ItemQuery<User> userQuery = project.getUsers(); 286 userQuery.include(Include.ALL); 287 userQuery.order(Orders.asc(Hql.property("name"))); 288 ItemResultList<User> users = userQuery.list(dc); 289 %> 290 <base:section 291 id="membersSection" 292 title="<%="Members (" + (groups.size() + users.size()) + ")"%>" 293 context="<%=cc%>" 294 > 295 <tbl:table 296 id="members" 297 clazz="itemlist" 298 columns="all" 299 > 300 <tbl:columndef 301 id="type" 302 title="User/Group" 303 /> 304 <tbl:columndef 305 id="name" 306 title="Name" 307 /> 308 <tbl:columndef 309 id="permissions" 310 title="Permissions" 311 /> 312 <tbl:data> 313 <tbl:columns /> 314 <tbl:rows> 315 <% 316 for (Group group : groups) 317 { 318 Set<Permission> permissions = project.getPermissions(group); 319 %> 320 <tbl:row> 321 <tbl:cell column="type">Group</tbl:cell> 322 <tbl:cell column="name"><base:icon 323 image="deleted.gif" 324 tooltip="This item has been scheduled for deletion" 325 visible="<%=group.isRemoved()%>" 326 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 327 <tbl:cell column="permissions"><%=permissions.toString().replaceAll("\\[|\\]", "")%></tbl:cell> 328 </tbl:row> 329 <% 330 } 331 for (User user : users) 332 { 333 Set<Permission> permissions = project.getPermissions(user); 334 %> 335 <tbl:row> 336 <tbl:cell column="type">User</tbl:cell> 337 <tbl:cell column="name"><base:icon 338 image="deleted.gif" 339 tooltip="This item has been scheduled for deletion" 340 visible="<%=user.isRemoved()%>" 341 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 342 <tbl:cell column="permissions"><%=permissions.toString().replaceAll("\\[|\\]", "")%></tbl:cell> 343 </tbl:row> 344 <% 345 } 346 %> 347 </tbl:rows> 348 </tbl:data> 349 </tbl:table> 350 </base:section> 279 351 280 <tbl:table 281 id="members" 282 clazz="itemlist" 283 columns="all" 352 <base:section 353 id="defaultSection" 354 title="<%="Defaults (" + Project.Default.values().length + ")"%>" 355 context="<%=cc%>" 356 > 357 <tbl:table 358 id="defaults" 359 clazz="itemlist" 360 columns="all" 284 361 > 285 362 <tbl:columndef 286 id=" type"287 title=" User/Group"363 id="setting" 364 title="Setting" 288 365 /> 289 366 <tbl:columndef 290 id="name" 291 title="Name" 292 /> 293 <tbl:columndef 294 id="permissions" 295 title="Permissions" 367 id="value" 368 title="Value" 296 369 /> 297 370 <tbl:data> 298 371 <tbl:columns /> 299 <tbl:rows> 300 <% 301 // Query to retrieve child groups 302 ItemQuery<Group> groupQuery = project.getGroups(); 303 groupQuery.include(Include.ALL); 304 groupQuery.order(Orders.asc(Hql.property("name"))); 305 ItemResultList<Group> groups = groupQuery.list(dc); 306 for (Group group : groups) 307 { 308 Set<Permission> permissions = project.getPermissions(group); 372 <tbl:rows> 373 <% 374 // Check each Default if it has any value 375 for (Project.Default d : Project.Default.values()) 376 { 377 boolean readDefaultValue = true; 378 String defaultName = d.getShortName(); 379 String value = null; 380 if (d.getItemType() != null) 381 { 382 BasicItem item = null; 383 try 384 { 385 item = project.getDefaultItem(dc, d); 386 if (item != null) 387 { 388 value = item instanceof Nameable ? Base.getLinkedName(ID, (Nameable)item, false, true) : item.toString(); 389 } 390 } 391 catch (PermissionDeniedException ex) 392 { 393 readDefaultValue = false; 394 value = "<i>- denied -</i>"; 395 } 396 } 397 else if (d.equals(Project.Default.RAW_DATA_TYPE)) 398 { 399 RawDataType rdt = project.getDefaultRawDataType(); 400 value = rdt != null ? rdt.getName() : null; 401 } 402 if (value != null) 403 { 404 %> 405 <tbl:row> 406 <tbl:cell column="setting"><%=defaultName%></tbl:cell> 407 <tbl:cell column="value"><%=value%></tbl:cell> 408 </tbl:row> 409 <% 410 } 411 } 309 412 %> 310 <tbl:row> 311 <tbl:cell column="type">Group</tbl:cell> 312 <tbl:cell column="name"><base:icon 313 image="deleted.gif" 314 tooltip="This item has been scheduled for deletion" 315 visible="<%=group.isRemoved()%>" 316 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 317 <tbl:cell column="permissions"><%=permissions.toString().replaceAll("\\[|\\]", "")%></tbl:cell> 318 </tbl:row> 319 <% 320 } 321 322 // Query to retrieve user members 323 ItemQuery<User> userQuery = project.getUsers(); 324 userQuery.include(Include.ALL); 325 userQuery.order(Orders.asc(Hql.property("name"))); 326 ItemResultList<User> users = userQuery.list(dc); 327 for (User user : users) 328 { 329 Set<Permission> permissions = project.getPermissions(user); 330 %> 331 <tbl:row> 332 <tbl:cell column="type">User</tbl:cell> 333 <tbl:cell column="name"><base:icon 334 image="deleted.gif" 335 tooltip="This item has been scheduled for deletion" 336 visible="<%=user.isRemoved()%>" 337 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 338 <tbl:cell column="permissions"><%=permissions.toString().replaceAll("\\[|\\]", "")%></tbl:cell> 339 </tbl:row> 340 <% 341 } 342 %> 343 </tbl:rows> 344 </tbl:data> 345 </tbl:table> 346 347 <h4 class="docked">Defaults</h4> 348 <tbl:table 349 id="defaults" 350 clazz="itemlist" 351 columns="all" 352 > 353 <tbl:columndef 354 id="setting" 355 title="Setting" 356 /> 357 <tbl:columndef 358 id="value" 359 title="Value" 360 /> 361 <tbl:data> 362 <tbl:columns /> 363 <tbl:rows> 364 <% 365 // Check each Default if it has any value 366 for (Project.Default d : Project.Default.values()) 367 { 368 boolean readDefaultValue = true; 369 String defaultName = d.getShortName(); 370 String value = null; 371 if (d.getItemType() != null) 372 { 373 BasicItem item = null; 374 try 375 { 376 item = project.getDefaultItem(dc, d); 377 if (item != null) 378 { 379 value = item instanceof Nameable ? Base.getLinkedName(ID, (Nameable)item, false, true) : item.toString(); 380 } 381 } 382 catch (PermissionDeniedException ex) 383 { 384 readDefaultValue = false; 385 value = "<i>- denied -</i>"; 386 } 387 } 388 else if (d.equals(Project.Default.RAW_DATA_TYPE)) 389 { 390 RawDataType rdt = project.getDefaultRawDataType(); 391 value = rdt != null ? rdt.getName() : null; 392 } 393 if (value != null) 394 { 395 %> 396 <tbl:row> 397 <tbl:cell column="setting"><%=defaultName%></tbl:cell> 398 <tbl:cell column="value"><%=value%></tbl:cell> 399 </tbl:row> 400 <% 401 } 402 } 403 %> 404 </tbl:rows> 405 </tbl:data> 406 </tbl:table> 413 </tbl:rows> 414 </tbl:data> 415 </tbl:table> 416 </base:section> 407 417 </div> 408 418 </t:tab> -
trunk/www/views/experiments/bioassays/view_bioassay.jsp
r4889 r5045 222 222 { 223 223 %> 224 <h4 class="docked">Raw bioassays</h4> 225 <tbl:table 226 id="rawBioAssays" 227 clazz="itemlist" 228 columns="all" 224 <base:section 225 id="rawBioAssaySection" 226 title="<%="Raw bioassays (" + rawBioAssays.size() + ")"%>" 227 context="<%=cc%>" 229 228 > 230 <tbl:columndef 231 id="name" 232 title="Name" 233 /> 234 <tbl:columndef 235 id="spots" 236 title="Spots" 237 /> 238 <tbl:columndef 239 id="description" 240 title="Description" 241 /> 242 <% 243 ItemQuery<AnnotationType> efQuery = experiment.getExperimentalFactors(); 244 efQuery.include(Include.ALL); 245 efQuery.order(Orders.asc(Hql.property("name"))); 246 ItemResultList<AnnotationType> experimentalFactors = efQuery.list(dc); 247 for (AnnotationType at : experimentalFactors) 248 { 249 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 250 %> 229 <tbl:table 230 id="rawBioAssays" 231 clazz="itemlist" 232 columns="all" 233 > 234 <tbl:columndef 235 id="name" 236 title="Name" 237 /> 251 238 <tbl:columndef 252 id="<%="at"+at.getId()%>" 253 title="<%=HTML.encodeTags(at.getName())%>" 254 formatter="<%=formatter%>" 239 id="spots" 240 title="Spots" 241 /> 242 <tbl:columndef 243 id="description" 244 title="Description" 255 245 /> 256 246 <% 257 } 258 %> 259 <tbl:data> 260 <tbl:columns> 261 </tbl:columns> 262 <tbl:rows> 263 <% 264 for (RawBioAssay item : rawBioAssays) 247 ItemQuery<AnnotationType> efQuery = experiment.getExperimentalFactors(); 248 efQuery.include(Include.ALL); 249 efQuery.order(Orders.asc(Hql.property("name"))); 250 ItemResultList<AnnotationType> experimentalFactors = efQuery.list(dc); 251 for (AnnotationType at : experimentalFactors) 265 252 { 253 Formatter formatter = FormatterFactory.getTypeFormatter(sc, at.getValueType()); 266 254 %> 267 <tbl:row> 268 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 269 <tbl:cell column="spots"><%=item.getSpots()%></tbl:cell> 270 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 271 <% 272 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 273 for (AnnotationType at : experimentalFactors) 274 { 275 String value = "<i>- none -</i>"; 276 List<Annotation> all = as == null ? null : as.findAnnotations(dc, at, true); 277 Map<Annotatable, List> factorValues = new HashMap<Annotatable, List>(); 278 if (all != null && all.size() > 0) 255 <tbl:columndef 256 id="<%="at"+at.getId()%>" 257 title="<%=HTML.encodeTags(at.getName())%>" 258 formatter="<%=formatter%>" 259 /> 260 <% 261 } 262 %> 263 <tbl:data> 264 <tbl:columns> 265 </tbl:columns> 266 <tbl:rows> 267 <% 268 for (RawBioAssay item : rawBioAssays) 269 { 270 %> 271 <tbl:row> 272 <tbl:cell column="name"><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 273 <tbl:cell column="spots"><%=item.getSpots()%></tbl:cell> 274 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 275 <% 276 AnnotationSet as = item.isAnnotated() ? item.getAnnotationSet() : null; 277 for (AnnotationType at : experimentalFactors) 279 278 { 280 for (Annotation a : all) 279 String value = "<i>- none -</i>"; 280 List<Annotation> all = as == null ? null : as.findAnnotations(dc, at, true); 281 Map<Annotatable, List> factorValues = new HashMap<Annotatable, List>(); 282 if (all != null && all.size() > 0) 281 283 { 282 List values = a.getValues(); 283 Annotatable aItem = null; 284 try 284 for (Annotation a : all) 285 285 { 286 aItem = a.getAnnotationSet().getItem(); 287 } 288 catch (Throwable t) 289 {} 290 List toAdd = factorValues.get(aItem); 291 if (toAdd == null) 292 { 293 toAdd = new LinkedList(); 294 factorValues.put(aItem, toAdd); 295 } 296 toAdd.addAll(values); 297 } 298 } 299 %> 300 <tbl:cell column="<%="at"+at.getId()%>" 301 > 302 <% 303 for (Map.Entry<Annotatable, List> entry : factorValues.entrySet()) 304 { 305 Annotatable aItem = entry.getKey(); 306 List values = entry.getValue(); 307 %> 308 <tbl:cellvalue list="<%=values%>" /> 309 <% 310 if (aItem != null && aItem.hasPermission(Permission.WRITE)) 311 { 312 %>: <base:icon image="edit.gif" 313 onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"',"+aItem.getId()+","+at.getId()+")"%>" 314 tooltip="Modify the values of this experimental factor" /> 315 <% 286 List values = a.getValues(); 287 Annotatable aItem = null; 288 try 289 { 290 aItem = a.getAnnotationSet().getItem(); 291 } 292 catch (Throwable t) 293 {} 294 List toAdd = factorValues.get(aItem); 295 if (toAdd == null) 296 { 297 toAdd = new LinkedList(); 298 factorValues.put(aItem, toAdd); 299 } 300 toAdd.addAll(values); 316 301 } 317 302 } 318 303 %> 319 </tbl:cell> 320 <% 321 } 322 %> 323 </tbl:row> 324 <% 325 } 326 %> 327 </tbl:rows> 328 </tbl:data> 329 </tbl:table> 304 <tbl:cell column="<%="at"+at.getId()%>" 305 > 306 <% 307 for (Map.Entry<Annotatable, List> entry : factorValues.entrySet()) 308 { 309 Annotatable aItem = entry.getKey(); 310 List values = entry.getValue(); 311 %> 312 <tbl:cellvalue list="<%=values%>" /> 313 <% 314 if (aItem != null && aItem.hasPermission(Permission.WRITE)) 315 { 316 %>: <base:icon image="edit.gif" 317 onclick="<%="editInheritedAnnotation('"+aItem.getType().name()+"',"+aItem.getId()+","+at.getId()+")"%>" 318 tooltip="Modify the values of this experimental factor" /> 319 <% 320 } 321 } 322 %> 323 </tbl:cell> 324 <% 325 } 326 %> 327 </tbl:row> 328 <% 329 } 330 %> 331 </tbl:rows> 332 </tbl:data> 333 </tbl:table> 334 </base:section> 330 335 <% 331 336 } -
trunk/www/views/formulas/view_formula.jsp
r4918 r5045 31 31 import="net.sf.basedb.core.Item" 32 32 import="net.sf.basedb.core.ItemContext" 33 import="net.sf.basedb.core.ItemResult Iterator"33 import="net.sf.basedb.core.ItemResultList" 34 34 import="net.sf.basedb.core.MultiPermissions" 35 35 import="net.sf.basedb.core.Permission" … … 322 322 // Tables with users/groups/projects that this item is shared to 323 323 MultiPermissions mp = new MultiPermissions(Collections.singleton(formula)); 324 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 325 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 326 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 324 ItemResultList<User> users = mp.getUsers().list(dc); 325 ItemResultList<Group> groups = mp.getGroups().list(dc); 326 ItemResultList<Project> projects = mp.getProjects().list(dc); 327 int totalShare = users.size() + groups.size() + projects.size(); 327 328 328 if ( users.hasNext() || groups.hasNext() || projects.hasNext())329 if (totalShare > 0) 329 330 { 330 331 %> 331 <h4 class="docked">Shared to</h4> 332 <tbl:table 333 id="itemsSharedTo" 334 clazz="itemlist" 335 columns="all" 336 > 337 <tbl:columndef 338 id="itemType" 339 title="Item type" 340 /> 341 <tbl:columndef 342 id="name" 343 title="Name" 344 /> 345 <tbl:columndef 346 id="permissions" 347 title="Permissions" 348 /> 349 <tbl:data> 350 <tbl:columns> 351 </tbl:columns> 352 <tbl:rows> 353 <% 354 while(projects.hasNext()) 355 { 356 Project project = projects.next(); 357 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 358 %> 359 <tbl:row> 360 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 361 <tbl:cell column="name"><base:icon 362 image="deleted.gif" 363 tooltip="This item has been scheduled for deletion" 364 visible="<%=project.isRemoved()%>" 365 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 366 <tbl:cell column="permissions"> 367 <%=PermissionUtil.translatePermissionsToString(permissions)%> 368 </tbl:cell> 369 </tbl:row> 332 <base:section 333 id="sharedTo" 334 title="<%="Shared to (" + totalShare + ")"%>" 335 context="<%=cc%>" 336 > 337 <tbl:table 338 id="itemsSharedTo" 339 clazz="itemlist" 340 columns="all" 341 > 342 <tbl:columndef 343 id="itemType" 344 title="Item type" 345 /> 346 <tbl:columndef 347 id="name" 348 title="Name" 349 /> 350 <tbl:columndef 351 id="permissions" 352 title="Permissions" 353 /> 354 <tbl:data> 355 <tbl:columns> 356 </tbl:columns> 357 <tbl:rows> 370 358 <% 371 } 372 while(groups.hasNext()) 373 { 374 Group group = groups.next(); 375 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 359 for (Project project : projects) 360 { 361 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 362 %> 363 <tbl:row> 364 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 365 <tbl:cell column="name"><base:icon 366 image="deleted.gif" 367 tooltip="This item has been scheduled for deletion" 368 visible="<%=project.isRemoved()%>" 369 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 370 <tbl:cell column="permissions"> 371 <%=PermissionUtil.translatePermissionsToString(permissions)%> 372 </tbl:cell> 373 </tbl:row> 374 <% 375 } 376 for (Group group : groups) 377 { 378 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 379 %> 380 <tbl:row> 381 <tbl:cell column="itemType"><%=group.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="<%=group.isRemoved()%>" 386 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 387 <tbl:cell column="permissions"> 388 <%=PermissionUtil.translatePermissionsToString(permissions)%> 389 </tbl:cell> 390 </tbl:row> 391 <% 392 } 393 for (User user : users) 394 { 395 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 396 %> 397 <tbl:row> 398 <tbl:cell column="itemType"><%=user.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="<%=user.isRemoved()%>" 403 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 404 <tbl:cell column="permissions"> 405 <%=PermissionUtil.translatePermissionsToString(permissions)%> 406 </tbl:cell> 407 </tbl:row> 408 <% 409 } 376 410 %> 377 <tbl:row> 378 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 379 <tbl:cell column="name"><base:icon 380 image="deleted.gif" 381 tooltip="This item has been scheduled for deletion" 382 visible="<%=group.isRemoved()%>" 383 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 384 <tbl:cell column="permissions"> 385 <%=PermissionUtil.translatePermissionsToString(permissions)%> 386 </tbl:cell> 387 </tbl:row> 388 <% 389 } 390 while (users.hasNext()) 391 { 392 User user = users.next(); 393 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 394 %> 395 <tbl:row> 396 <tbl:cell column="itemType"><%=user.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="<%=user.isRemoved()%>" 401 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 402 <tbl:cell column="permissions"> 403 <%=PermissionUtil.translatePermissionsToString(permissions)%> 404 </tbl:cell> 405 </tbl:row> 406 <% 407 } 408 %> 409 </tbl:rows> 410 </tbl:data> 411 </tbl:table> 411 </tbl:rows> 412 </tbl:data> 413 </tbl:table> 414 </base:section> 412 415 <% 413 416 } -
trunk/www/views/hybridizations/view_hybridization.jsp
r4889 r5045 46 46 import="net.sf.basedb.core.ItemQuery" 47 47 import="net.sf.basedb.core.Include" 48 import="net.sf.basedb.core.ItemResult Iterator"48 import="net.sf.basedb.core.ItemResultList" 49 49 import="net.sf.basedb.core.ItemResultList" 50 50 import="net.sf.basedb.core.PermissionDeniedException" … … 336 336 { 337 337 %> 338 <h4 class="docked">Labeled extracts</h4> 339 <tbl:table 340 id="labeledextracts" 341 clazz="itemlist" 342 columns="all" 338 <base:section 339 id="labeledExtractSection" 340 title="<%="Labeled extracts (" + labeledExtracts.size() + ")"%>" 341 context="<%=cc%>" 343 342 > 344 <tbl:columndef 345 id="arrayNum" 346 title="Array" 347 show="<%=hyb.getNumArrays() > 1 ? "always" : "never"%>" 348 /> 349 <tbl:columndef 350 id="name" 351 title="Name" 352 /> 353 <tbl:columndef 354 id="label" 355 title="Label" 356 /> 357 <tbl:columndef 358 id="quantity" 359 title="Used quantity (µg)" 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 (LabeledExtract item : labeledExtracts) 371 { 343 <tbl:table 344 id="labeledextracts" 345 clazz="itemlist" 346 columns="all" 347 > 348 <tbl:columndef 349 id="arrayNum" 350 title="Array" 351 show="<%=hyb.getNumArrays() > 1 ? "always" : "never"%>" 352 /> 353 <tbl:columndef 354 id="name" 355 title="Name" 356 /> 357 <tbl:columndef 358 id="label" 359 title="Label" 360 /> 361 <tbl:columndef 362 id="quantity" 363 title="Used quantity (µg)" 364 /> 365 <tbl:columndef 366 id="description" 367 title="Description" 368 /> 369 <tbl:data> 370 <tbl:columns> 371 </tbl:columns> 372 <tbl:rows> 373 <% 374 for (LabeledExtract item : labeledExtracts) 375 { 376 %> 377 <tbl:row> 378 <tbl:cell column="arrayNum"><%=creationEvent.getSourceGroup(item)%></tbl:cell> 379 <tbl:cell column="name"><base:icon 380 image="deleted.gif" 381 tooltip="This item has been scheduled for deletion" 382 visible="<%=item.isRemoved()%>" 383 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 384 <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="label" /></tbl:cell> 385 <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell> 386 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 387 </tbl:row> 388 <% 389 } 372 390 %> 373 <tbl:row> 374 <tbl:cell column="arrayNum"><%=creationEvent.getSourceGroup(item)%></tbl:cell> 375 <tbl:cell column="name"><base:icon 376 image="deleted.gif" 377 tooltip="This item has been scheduled for deletion" 378 visible="<%=item.isRemoved()%>" 379 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 380 <tbl:cell column="label"><base:propertyvalue item="<%=item%>" property="label" /></tbl:cell> 381 <tbl:cell column="quantity"><%=Values.formatNumber(creationEvent.getUsedQuantity(item), 2)%></tbl:cell> 382 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 383 </tbl:row> 384 <% 385 } 386 %> 387 </tbl:rows> 388 </tbl:data> 389 </tbl:table> 391 </tbl:rows> 392 </tbl:data> 393 </tbl:table> 394 </base:section> 390 395 <% 391 396 } … … 408 413 { 409 414 %> 410 <h4 class="docked">Scans</h4> 411 <tbl:table 412 id="scans" 413 clazz="itemlist" 414 columns="all" 415 <base:section 416 id="scanSection" 417 title="<%="Scans (" + scans.size() + ")"%>" 418 context="<%=cc%>" 415 419 > 416 <tbl:columndef 417 id="name" 418 title="Name" 419 /> 420 <tbl:columndef 421 id="scanner" 422 title="Scanner" 423 /> 424 425 <tbl:columndef 426 id="description" 427 title="Description" 428 /> 429 <tbl:data> 430 <tbl:columns> 431 </tbl:columns> 432 <tbl:rows> 433 <% 434 for (Scan item : scans) 435 { 436 %> 437 <tbl:row> 438 <tbl:cell column="name"><base:icon 439 image="deleted.gif" 440 tooltip="This item has been scheduled for deletion" 441 visible="<%=item.isRemoved()%>" 442 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 443 <tbl:cell column="scanner"><base:propertyvalue item="<%=item%>" property="scanner" /></tbl:cell> 444 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 445 </tbl:row> 446 <% 447 } 448 %> 449 </tbl:rows> 450 </tbl:data> 451 </tbl:table> 452 <% 453 } 454 455 // Tables with users/groups/projects that this item is shared to 456 MultiPermissions mp = new MultiPermissions(Collections.singleton(hyb)); 457 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 458 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 459 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 460 461 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 462 { 463 %> 464 <h4 class="docked">Shared to</h4> 465 <tbl:table 466 id="itemsSharedTo" 467 clazz="itemlist" 468 columns="all" 469 > 470 <tbl:columndef 471 id="itemType" 472 title="Item type" 473 /> 420 <tbl:table 421 id="scans" 422 clazz="itemlist" 423 columns="all" 424 > 474 425 <tbl:columndef 475 426 id="name" … … 477 428 /> 478 429 <tbl:columndef 479 id="permissions" 480 title="Permissions" 430 id="scanner" 431 title="Scanner" 432 /> 433 434 <tbl:columndef 435 id="description" 436 title="Description" 481 437 /> 482 438 <tbl:data> … … 485 441 <tbl:rows> 486 442 <% 487 while(projects.hasNext())443 for (Scan item : scans) 488 444 { 489 Project project = projects.next(); 490 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 491 %> 445 %> 492 446 <tbl:row> 493 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>494 447 <tbl:cell column="name"><base:icon 495 image="deleted.gif" 496 tooltip="This item has been scheduled for deletion" 497 visible="<%=project.isRemoved()%>" 498 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 499 <tbl:cell column="permissions"> 500 <%=PermissionUtil.translatePermissionsToString(permissions)%> 501 </tbl:cell> 502 </tbl:row> 503 <% 504 } 505 while(groups.hasNext()) 506 { 507 Group group = groups.next(); 508 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 509 %> 510 <tbl:row> 511 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 512 <tbl:cell column="name"><base:icon 513 image="deleted.gif" 514 tooltip="This item has been scheduled for deletion" 515 visible="<%=group.isRemoved()%>" 516 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 517 <tbl:cell column="permissions"> 518 <%=PermissionUtil.translatePermissionsToString(permissions)%> 519 </tbl:cell> 520 </tbl:row> 521 <% 522 } 523 while (users.hasNext()) 524 { 525 User user = users.next(); 526 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 527 %> 528 <tbl:row> 529 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 530 <tbl:cell column="name"><base:icon 531 image="deleted.gif" 532 tooltip="This item has been scheduled for deletion" 533 visible="<%=user.isRemoved()%>" 534 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 535 <tbl:cell column="permissions"> 536 <%=PermissionUtil.translatePermissionsToString(permissions)%> 537 </tbl:cell> 448 image="deleted.gif" 449 tooltip="This item has been scheduled for deletion" 450 visible="<%=item.isRemoved()%>" 451 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 452 <tbl:cell column="scanner"><base:propertyvalue item="<%=item%>" property="scanner" /></tbl:cell> 453 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 538 454 </tbl:row> 539 455 <% … … 542 458 </tbl:rows> 543 459 </tbl:data> 544 </tbl:table> 460 </tbl:table> 461 </base:section> 462 <% 463 } 464 465 // Tables with users/groups/projects that this item is shared to 466 MultiPermissions mp = new MultiPermissions(Collections.singleton(hyb)); 467 ItemResultList<User> users = mp.getUsers().list(dc); 468 ItemResultList<Group> groups = mp.getGroups().list(dc); 469 ItemResultList<Project> projects = mp.getProjects().list(dc); 470 int totalShare = users.size() + groups.size() + projects.size(); 471 472 if (totalShare > 0) 473 { 474 %> 475 <base:section 476 id="sharedTo" 477 title="<%="Shared to (" + totalShare + ")"%>" 478 context="<%=cc%>" 479 > 480 <tbl:table 481 id="itemsSharedTo" 482 clazz="itemlist" 483 columns="all" 484 > 485 <tbl:columndef 486 id="itemType" 487 title="Item type" 488 /> 489 <tbl:columndef 490 id="name" 491 title="Name" 492 /> 493 <tbl:columndef 494 id="permissions" 495 title="Permissions" 496 /> 497 <tbl:data> 498 <tbl:columns> 499 </tbl:columns> 500 <tbl:rows> 501 <% 502 for (Project project : projects) 503 { 504 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 505 %> 506 <tbl:row> 507 <tbl:cell column="itemType"><%=project.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="<%=project.isRemoved()%>" 512 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 513 <tbl:cell column="permissions"> 514 <%=PermissionUtil.translatePermissionsToString(permissions)%> 515 </tbl:cell> 516 </tbl:row> 517 <% 518 } 519 for (Group group : groups) 520 { 521 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 522 %> 523 <tbl:row> 524 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 525 <tbl:cell column="name"><base:icon 526 image="deleted.gif" 527 tooltip="This item has been scheduled for deletion" 528 visible="<%=group.isRemoved()%>" 529 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 530 <tbl:cell column="permissions"> 531 <%=PermissionUtil.translatePermissionsToString(permissions)%> 532 </tbl:cell> 533 </tbl:row> 534 <% 535 } 536 for (User user : users) 537 { 538 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 539 %> 540 <tbl:row> 541 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 542 <tbl:cell column="name"><base:icon 543 image="deleted.gif" 544 tooltip="This item has been scheduled for deletion" 545 visible="<%=user.isRemoved()%>" 546 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 547 <tbl:cell column="permissions"> 548 <%=PermissionUtil.translatePermissionsToString(permissions)%> 549 </tbl:cell> 550 </tbl:row> 551 <% 552 } 553 %> 554 </tbl:rows> 555 </tbl:data> 556 </tbl:table> 557 </base:section> 545 558 <% 546 559 } -
trunk/www/views/reporterlists/view_reporterlist.jsp
r4879 r5045 31 31 import="net.sf.basedb.core.Item" 32 32 import="net.sf.basedb.core.ItemContext" 33 import="net.sf.basedb.core.ItemResult Iterator"33 import="net.sf.basedb.core.ItemResultList" 34 34 import="net.sf.basedb.core.Permission" 35 35 import="net.sf.basedb.core.ReporterList" … … 311 311 // Tables with users/groups/projects that this item is shared to 312 312 MultiPermissions mp = new MultiPermissions(Collections.singleton(reporterList)); 313 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 314 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 315 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 313 ItemResultList<User> users = mp.getUsers().list(dc); 314 ItemResultList<Group> groups = mp.getGroups().list(dc); 315 ItemResultList<Project> projects = mp.getProjects().list(dc); 316 int totalShare = users.size() + groups.size() + projects.size(); 316 317 317 if ( users.hasNext() || groups.hasNext() || projects.hasNext())318 if (totalShare > 0) 318 319 { 319 320 %> 320 <h4 class="docked">Shared to</h4> 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> 342 <% 343 while(projects.hasNext()) 344 { 345 Project project = projects.next(); 346 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 347 %> 348 <tbl:row> 349 <tbl:cell column="itemType"><%=project.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="<%=project.isRemoved()%>" 354 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 355 <tbl:cell column="permissions"> 356 <%=PermissionUtil.translatePermissionsToString(permissions)%> 357 </tbl:cell> 358 </tbl:row> 321 <base:section 322 id="sharedTo" 323 title="<%="Shared to (" + totalShare + ")"%>" 324 context="<%=cc%>" 325 > 326 <tbl:table 327 id="itemsSharedTo" 328 clazz="itemlist" 329 columns="all" 330 > 331 <tbl:columndef 332 id="itemType" 333 title="Item type" 334 /> 335 <tbl:columndef 336 id="name" 337 title="Name" 338 /> 339 <tbl:columndef 340 id="permissions" 341 title="Permissions" 342 /> 343 <tbl:data> 344 <tbl:columns> 345 </tbl:columns> 346 <tbl:rows> 359 347 <% 360 } 361 while(groups.hasNext()) 362 { 363 Group group = groups.next(); 364 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 348 for (Project project : projects) 349 { 350 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 351 %> 352 <tbl:row> 353 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 354 <tbl:cell column="name"><base:icon 355 image="deleted.gif" 356 tooltip="This item has been scheduled for deletion" 357 visible="<%=project.isRemoved()%>" 358 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 359 <tbl:cell column="permissions"> 360 <%=PermissionUtil.translatePermissionsToString(permissions)%> 361 </tbl:cell> 362 </tbl:row> 363 <% 364 } 365 for (Group group : groups) 366 { 367 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 368 %> 369 <tbl:row> 370 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 371 <tbl:cell column="name"><base:icon 372 image="deleted.gif" 373 tooltip="This item has been scheduled for deletion" 374 visible="<%=group.isRemoved()%>" 375 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 376 <tbl:cell column="permissions"> 377 <%=PermissionUtil.translatePermissionsToString(permissions)%> 378 </tbl:cell> 379 </tbl:row> 380 <% 381 } 382 for (User user : users) 383 { 384 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 385 %> 386 <tbl:row> 387 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 388 <tbl:cell column="name"><base:icon 389 image="deleted.gif" 390 tooltip="This item has been scheduled for deletion" 391 visible="<%=user.isRemoved()%>" 392 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 393 <tbl:cell column="permissions"> 394 <%=PermissionUtil.translatePermissionsToString(permissions)%> 395 </tbl:cell> 396 </tbl:row> 397 <% 398 } 365 399 %> 366 <tbl:row> 367 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 368 <tbl:cell column="name"><base:icon 369 image="deleted.gif" 370 tooltip="This item has been scheduled for deletion" 371 visible="<%=group.isRemoved()%>" 372 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 373 <tbl:cell column="permissions"> 374 <%=PermissionUtil.translatePermissionsToString(permissions)%> 375 </tbl:cell> 376 </tbl:row> 377 <% 378 } 379 while (users.hasNext()) 380 { 381 User user = users.next(); 382 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 383 %> 384 <tbl:row> 385 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 386 <tbl:cell column="name"><base:icon 387 image="deleted.gif" 388 tooltip="This item has been scheduled for deletion" 389 visible="<%=user.isRemoved()%>" 390 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 391 <tbl:cell column="permissions"> 392 <%=PermissionUtil.translatePermissionsToString(permissions)%> 393 </tbl:cell> 394 </tbl:row> 395 <% 396 } 397 %> 398 </tbl:rows> 399 </tbl:data> 400 </tbl:table> 400 </tbl:rows> 401 </tbl:data> 402 </tbl:table> 403 </base:section> 401 404 <% 402 405 } -
trunk/www/views/reporters/view_reporter.jsp
r4889 r5045 210 210 </tr> 211 211 </table> 212 213 <h4>Extended properties</h4> 214 <table class="form" cellspacing=0> 215 <% 216 List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData"); 217 if (reporterProperties != null) 218 { 219 boolean needsTr = true; 220 for (ExtendedProperty ep : reporterProperties) 212 <% 213 List<ExtendedProperty> reporterProperties = ExtendedProperties.getProperties("ReporterData"); 214 %> 215 <base:section 216 id="extendedProperties" 217 title="<%="Extended properties (" + reporterProperties.size() + ")"%>" 218 context="<%=cc%>" 219 > 220 <table class="form" cellspacing=0> 221 <% 222 if (reporterProperties != null) 221 223 { 222 String name = ep.getName(); 223 Formatter f = FormatterFactory.getExtendedPropertyFormatter(sc, ep); 224 String value = f.format(reporter.getExtended(name)); 224 boolean needsTr = true; 225 for (ExtendedProperty ep : reporterProperties) 226 { 227 String name = ep.getName(); 228 Formatter f = FormatterFactory.getExtendedPropertyFormatter(sc, ep); 229 String value = f.format(reporter.getExtended(name)); 230 %> 231 <%=needsTr ? "<tr valign=\"top\">" : "" %> 232 <td class="prompt"><%=HTML.encodeTags(ep.getTitle())%></td> 233 <td><%=value%></td> 234 <td> </td> 235 <%=needsTr ? "" : "</tr>"%> 236 <% 237 needsTr = !needsTr; 238 } 225 239 %> 226 <%=needsTr ? "<tr valign=\"top\">" : "" %> 227 <td class="prompt"><%=HTML.encodeTags(ep.getTitle())%></td> 228 <td><%=value%></td> 229 <td> </td> 230 <%=needsTr ? "" : "</tr>"%> 240 <%=needsTr ? "" : "</tr>"%> 231 241 <% 232 needsTr = !needsTr;233 242 } 234 243 %> 235 <%=needsTr ? "" : "</tr>"%> 236 <% 237 } 238 %> 239 </table> 244 </table> 245 </base:section> 240 246 </div> 241 247 -
trunk/www/views/scans/view_scan.jsp
r4889 r5045 41 41 import="net.sf.basedb.core.Group" 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" … … 328 327 { 329 328 %> 330 <h4 class="docked">Raw bioassays</h4> 331 <tbl:table 332 id="rawBioAssays" 333 clazz="itemlist" 334 columns="all" 329 <base:section 330 id="rawBioAssaySection" 331 title="<%="Raw bioassays (" + raw.size() + ")"%>" 332 context="<%=cc%>" 335 333 > 336 <tbl:columndef 337 id="name" 338 title="Name" 339 /> 340 <tbl:columndef 341 id="type" 342 title="Type" 343 /> 344 <tbl:columndef 345 id="arrayNum" 346 title="Array index" 347 /> 348 <tbl:columndef 349 id="software" 350 title="Software" 351 /> 352 <tbl:columndef 353 id="data" 354 title="Data" 355 /> 356 <tbl:columndef 357 id="arrayDesign" 358 title="Array design" 359 /> 360 <tbl:columndef 361 id="description" 362 title="Description" 363 /> 364 <tbl:data> 365 <tbl:columns> 366 </tbl:columns> 367 <tbl:rows> 368 <% 369 for (RawBioAssay item : raw) 370 { 371 %> 372 <tbl:row> 373 <tbl:cell column="name"><base:icon 374 image="deleted.gif" 375 tooltip="This item has been scheduled for deletion" 376 visible="<%=item.isRemoved()%>" 377 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 378 <tbl:cell column="type"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell> 379 <tbl:cell column="arrayNum"><%=item.getArrayNum()%></tbl:cell> 380 <tbl:cell column="software"><base:propertyvalue item="<%=item%>" property="software" /></tbl:cell> 381 <tbl:cell column="data"><%=item.hasData() ? "yes (" + item.getSpots() + " spots)" : "no"%></tbl:cell> 382 <tbl:cell column="arrayDesign"><base:propertyvalue item="<%=item%>" property="arrayDesign" /></tbl:cell> 383 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 384 </tbl:row> 385 <% 386 } 387 %> 388 </tbl:rows> 389 </tbl:data> 390 </tbl:table> 391 <% 392 } 393 394 // Tables with users/groups/projects that this item is shared to 395 MultiPermissions mp = new MultiPermissions(Collections.singleton(scan)); 396 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 397 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 398 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 399 400 if (users.hasNext() || groups.hasNext() || projects.hasNext()) 401 { 402 %> 403 <h4 class="docked">Shared to</h4> 404 <tbl:table 405 id="itemsSharedTo" 406 clazz="itemlist" 407 columns="all" 408 > 409 <tbl:columndef 410 id="itemType" 411 title="Item type" 412 /> 334 <tbl:table 335 id="rawBioAssays" 336 clazz="itemlist" 337 columns="all" 338 > 413 339 <tbl:columndef 414 340 id="name" 415 341 title="Name" 416 342 /> 343 <tbl:columndef 344 id="type" 345 title="Type" 346 /> 417 347 <tbl:columndef 418 id="permissions" 419 title="Permissions" 348 id="arrayNum" 349 title="Array index" 350 /> 351 <tbl:columndef 352 id="software" 353 title="Software" 354 /> 355 <tbl:columndef 356 id="data" 357 title="Data" 358 /> 359 <tbl:columndef 360 id="arrayDesign" 361 title="Array design" 362 /> 363 <tbl:columndef 364 id="description" 365 title="Description" 420 366 /> 421 367 <tbl:data> … … 424 370 <tbl:rows> 425 371 <% 426 while(projects.hasNext())372 for (RawBioAssay item : raw) 427 373 { 428 Project project = projects.next(); 429 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 430 %> 374 %> 431 375 <tbl:row> 432 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>433 376 <tbl:cell column="name"><base:icon 434 image="deleted.gif" 435 tooltip="This item has been scheduled for deletion" 436 visible="<%=project.isRemoved()%>" 437 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 438 <tbl:cell column="permissions"> 439 <%=PermissionUtil.translatePermissionsToString(permissions)%> 440 </tbl:cell> 441 </tbl:row> 442 <% 443 } 444 while(groups.hasNext()) 445 { 446 Group group = groups.next(); 447 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 448 %> 449 <tbl:row> 450 <tbl:cell column="itemType"><%=group.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="<%=group.isRemoved()%>" 455 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 456 <tbl:cell column="permissions"> 457 <%=PermissionUtil.translatePermissionsToString(permissions)%> 458 </tbl:cell> 459 </tbl:row> 460 <% 461 } 462 while (users.hasNext()) 463 { 464 User user = users.next(); 465 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 466 %> 467 <tbl:row> 468 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 469 <tbl:cell column="name"><base:icon 470 image="deleted.gif" 471 tooltip="This item has been scheduled for deletion" 472 visible="<%=user.isRemoved()%>" 473 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 474 <tbl:cell column="permissions"> 475 <%=PermissionUtil.translatePermissionsToString(permissions)%> 476 </tbl:cell> 377 image="deleted.gif" 378 tooltip="This item has been scheduled for deletion" 379 visible="<%=item.isRemoved()%>" 380 /><%=Base.getLinkedName(ID, item, false, true)%></tbl:cell> 381 <tbl:cell column="type"><%=HTML.encodeTags(item.getRawDataType().getName())%></tbl:cell> 382 <tbl:cell column="arrayNum"><%=item.getArrayNum()%></tbl:cell> 383 <tbl:cell column="software"><base:propertyvalue item="<%=item%>" property="software" /></tbl:cell> 384 <tbl:cell column="data"><%=item.hasData() ? "yes (" + item.getSpots() + " spots)" : "no"%></tbl:cell> 385 <tbl:cell column="arrayDesign"><base:propertyvalue item="<%=item%>" property="arrayDesign" /></tbl:cell> 386 <tbl:cell column="description"><%=HTML.encodeTags(item.getDescription())%></tbl:cell> 477 387 </tbl:row> 478 388 <% … … 481 391 </tbl:rows> 482 392 </tbl:data> 483 </tbl:table> 393 </tbl:table> 394 </base:section> 395 <% 396 } 397 398 // Tables with users/groups/projects that this item is shared to 399 MultiPermissions mp = new MultiPermissions(Collections.singleton(scan)); 400 ItemResultList<User> users = mp.getUsers().list(dc); 401 ItemResultList<Group> groups = mp.getGroups().list(dc); 402 ItemResultList<Project> projects = mp.getProjects().list(dc); 403 int totalShare = users.size() + groups.size() + projects.size(); 404 405 if (totalShare > 0) 406 { 407 %> 408 <base:section 409 id="sharedTo" 410 title="<%="Shared to (" + totalShare + ")"%>" 411 context="<%=cc%>" 412 > 413 <tbl:table 414 id="itemsSharedTo" 415 clazz="itemlist" 416 columns="all" 417 > 418 <tbl:columndef 419 id="itemType" 420 title="Item type" 421 /> 422 <tbl:columndef 423 id="name" 424 title="Name" 425 /> 426 <tbl:columndef 427 id="permissions" 428 title="Permissions" 429 /> 430 <tbl:data> 431 <tbl:columns> 432 </tbl:columns> 433 <tbl:rows> 434 <% 435 for (Project project : projects) 436 { 437 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 438 %> 439 <tbl:row> 440 <tbl:cell column="itemType"><%=project.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="<%=project.isRemoved()%>" 445 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 446 <tbl:cell column="permissions"> 447 <%=PermissionUtil.translatePermissionsToString(permissions)%> 448 </tbl:cell> 449 </tbl:row> 450 <% 451 } 452 for (Group group : groups) 453 { 454 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 455 %> 456 <tbl:row> 457 <tbl:cell column="itemType"><%=group.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="<%=group.isRemoved()%>" 462 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 463 <tbl:cell column="permissions"> 464 <%=PermissionUtil.translatePermissionsToString(permissions)%> 465 </tbl:cell> 466 </tbl:row> 467 <% 468 } 469 for (User user : users) 470 { 471 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 472 %> 473 <tbl:row> 474 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 475 <tbl:cell column="name"><base:icon 476 image="deleted.gif" 477 tooltip="This item has been scheduled for deletion" 478 visible="<%=user.isRemoved()%>" 479 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 480 <tbl:cell column="permissions"> 481 <%=PermissionUtil.translatePermissionsToString(permissions)%> 482 </tbl:cell> 483 </tbl:row> 484 <% 485 } 486 %> 487 </tbl:rows> 488 </tbl:data> 489 </tbl:table> 490 </base:section> 484 491 <% 485 492 }
Note: See TracChangeset
for help on using the changeset viewer.