Changeset 5040
- Timestamp:
- Aug 10, 2009, 4:31:20 PM (13 years ago)
- Location:
- trunk/www/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/admin/jobagents/view_agent.jsp
r4886 r5040 66 66 import="java.util.Date" 67 67 import="java.util.Collections" 68 import="java.util.List" 69 68 70 %> 69 71 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> … … 334 336 { 335 337 %> 336 <h4 class="docked">Installed plugins</h4> 337 <tbl:table 338 <base:section 338 339 id="plugins" 339 clazz="itemlist"340 co lumns="all"340 title="<%="Plugins (" + plugins.size() + ")"%>" 341 context="<%=cc%>" 341 342 > 342 <tbl:columndef343 id="plugin"344 title="Plugin"345 />346 <tbl:columndef347 id="jarPath"348 title="JAR path"349 />350 <tbl:columndef351 id="trusted"352 title="Trusted"353 />354 <tbl:columndef355 id="maxMemory"356 title="Max memory"357 />358 <tbl:columndef359 id="priorityBoost"360 title="Priority boost"361 />362 <tbl:columndef363 id="configure"364 title=""365 />366 <tbl:data>367 <tbl:column s>368 </tbl:columns>369 <tbl:rows>370 <%371 for (JobAgentSettings settings : plugins)372 {373 PluginDefinition plugin = null;374 NameablePluginAdaptor nameableProxy = null;375 boolean readPlugin = true;376 try343 <tbl:table 344 id="plugins" 345 clazz="itemlist" 346 columns="all" 347 > 348 <tbl:columndef 349 id="plugin" 350 title="Plugin" 351 /> 352 <tbl:columndef 353 id="jarPath" 354 title="JAR path" 355 /> 356 <tbl:columndef 357 id="trusted" 358 title="Trusted" 359 /> 360 <tbl:columndef 361 id="maxMemory" 362 title="Max memory" 363 /> 364 <tbl:columndef 365 id="priorityBoost" 366 title="Priority boost" 367 /> 368 <tbl:columndef 369 id="configure" 370 title="" 371 /> 372 <tbl:data> 373 <tbl:columns> 374 </tbl:columns> 375 <tbl:rows> 376 <% 377 for (JobAgentSettings settings : plugins) 377 378 { 378 plugin = settings.getPluginDefinition(); 379 nameableProxy = new NameablePluginAdaptor(plugin); 379 PluginDefinition plugin = null; 380 NameablePluginAdaptor nameableProxy = null; 381 boolean readPlugin = true; 382 try 383 { 384 plugin = settings.getPluginDefinition(); 385 nameableProxy = new NameablePluginAdaptor(plugin); 386 } 387 catch (PermissionDeniedException ex) 388 { 389 readPlugin = false; 390 } 391 Long maxMemory = settings.getEffectiveMaxMemory(); 392 String jarPath = settings.getEffectiveJarPath(); 393 %> 394 <tbl:row> 395 <tbl:cell column="plugin"><base:icon 396 image="deleted.gif" 397 tooltip="This item has been scheduled for deletion" 398 visible="<%=plugin != null && plugin.isRemoved()%>" 399 /><%=Base.getLinkedName(ID, nameableProxy, !readPlugin, true)%></tbl:cell> 400 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 401 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> 402 <tbl:cell column="maxMemory"><%=maxMemory == null ? "<i>- not specified -</i>" : Values.formatBytes(maxMemory)%></tbl:cell> 403 <tbl:cell column="priorityBoost"><%=settings.getPriorityBoost()%></tbl:cell> 404 <tbl:cell column="configure"> 405 <% 406 if (writePermission && plugin != null) 407 { 408 %> 409 <base:icon image="runplugin.gif" 410 onclick="<%="configurePlugin(" + plugin.getId() + ")"%>" 411 tooltip="Configure the settings for this plugin on the job agent "/> 412 <% 413 } 414 %> 415 </tbl:cell> 416 </tbl:row> 417 <% 380 418 } 381 catch (PermissionDeniedException ex)382 {383 readPlugin = false;384 }385 Long maxMemory = settings.getEffectiveMaxMemory();386 String jarPath = settings.getEffectiveJarPath();387 419 %> 388 <tbl:row> 389 <tbl:cell column="plugin"><base:icon 390 image="deleted.gif" 391 tooltip="This item has been scheduled for deletion" 392 visible="<%=plugin != null && plugin.isRemoved()%>" 393 /><%=Base.getLinkedName(ID, nameableProxy, !readPlugin, true)%></tbl:cell> 394 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 395 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> 396 <tbl:cell column="maxMemory"><%=maxMemory == null ? "<i>- not specified -</i>" : Values.formatBytes(maxMemory)%></tbl:cell> 397 <tbl:cell column="priorityBoost"><%=settings.getPriorityBoost()%></tbl:cell> 398 <tbl:cell column="configure"> 399 <% 400 if (writePermission && plugin != null) 401 { 402 %> 403 <base:icon image="runplugin.gif" 404 onclick="<%="configurePlugin(" + plugin.getId() + ")"%>" 405 tooltip="Configure the settings for this plugin on the job agent "/> 406 <% 407 } 408 %> 409 </tbl:cell> 410 </tbl:row> 411 <% 412 } 413 %> 414 </tbl:rows> 415 </tbl:data> 416 </tbl:table> 420 </tbl:rows> 421 </tbl:data> 422 </tbl:table> 423 </base:section> 417 424 <% 418 425 } … … 442 449 { 443 450 %> 444 <h4 class="docked">Executing jobs</h4> 445 <tbl:table 446 id="jobs" 447 clazz="itemlist" 448 columns="all" 451 <base:section 452 id="executingJobs" 453 title="<%="Executing jobs (" + jobs.size() + ")"%>" 454 context="<%cc%>" 449 455 > 450 <tbl:columndef 451 id="job" 452 title="Job" 453 /> 454 <tbl:columndef 455 id="plugin" 456 title="Plugin" 457 /> 458 <tbl:columndef 459 id="slot" 460 title="Used slot" 461 /> 462 <tbl:columndef 463 id="started" 464 title="Started" 465 /> 466 <tbl:columndef 467 id="percentComplete" 468 title="Percent complete" 469 /> 470 <tbl:columndef 471 id="owner" 472 title="Owner" 473 /> 474 <tbl:data> 475 <tbl:columns> 476 </tbl:columns> 477 <tbl:rows> 478 <% 479 for (JobInfo jobInfo : jobs) 480 { 481 Job job = null; 482 boolean readJob = true; 483 try 456 <tbl:table 457 id="jobs" 458 clazz="itemlist" 459 columns="all" 460 > 461 <tbl:columndef 462 id="job" 463 title="Job" 464 /> 465 <tbl:columndef 466 id="plugin" 467 title="Plugin" 468 /> 469 <tbl:columndef 470 id="slot" 471 title="Used slot" 472 /> 473 <tbl:columndef 474 id="started" 475 title="Started" 476 /> 477 <tbl:columndef 478 id="percentComplete" 479 title="Percent complete" 480 /> 481 <tbl:columndef 482 id="owner" 483 title="Owner" 484 /> 485 <tbl:data> 486 <tbl:columns> 487 </tbl:columns> 488 <tbl:rows> 489 <% 490 for (JobInfo jobInfo : jobs) 484 491 { 485 job = Job.getById(dc, jobInfo.getJobId()); 486 } 487 catch (Throwable t) 488 { 489 readJob = false; 492 Job job = null; 493 boolean readJob = true; 494 try 495 { 496 job = Job.getById(dc, jobInfo.getJobId()); 497 } 498 catch (Throwable t) 499 { 500 readJob = false; 501 } 502 %> 503 <tbl:row> 504 <tbl:cell column="job"><%=Base.getLinkedName(ID, job, !readJob, true) %></tbl:cell> 505 <tbl:cell column="plugin"><base:propertyvalue item="<%=job%>" property="pluginDefinition"/></tbl:cell> 506 <tbl:cell column="started"><%=job == null ? "" : dateFormatter.format(job.getStarted())%></tbl:cell> 507 <tbl:cell column="slot"><%=jobInfo.getSlot() == null ? "" : jobInfo.getSlot().toString()%></tbl:cell> 508 <tbl:cell column="percentComplete"> 509 <% 510 if (job != null) 511 { 512 %> 513 <table border=0 cellspacing=0 cellpadding=0> 514 <tr> 515 <td width="100"> 516 <table width="100" class="progressbar" border=0 cellspacing=0 cellpadding=0> 517 <tr> 518 <% 519 int percent = job.getPercentComplete(); 520 if (percent > 0) 521 { 522 %> 523 <td width="<%=percent%>%" class="done"> </td> 524 <% 525 } 526 if (percent < 100) 527 { 528 %> 529 <td width="<%=100-percent%>%" class="remain"> </td> 530 <% 531 } 532 %> 533 </tr> 534 </table> 535 </td> 536 <td> <%=percent%>%</td> 537 </tr> 538 </table> 539 <% 540 } 541 %> 542 </tbl:cell> 543 <tbl:cell column="owner"><base:propertyvalue item="<%=job%>" property="owner" /></tbl:cell> 544 </tbl:row> 545 <% 490 546 } 491 547 %> 492 <tbl:row> 493 <tbl:cell column="job"><%=Base.getLinkedName(ID, job, !readJob, true) %></tbl:cell> 494 <tbl:cell column="plugin"><base:propertyvalue item="<%=job%>" property="pluginDefinition"/></tbl:cell> 495 <tbl:cell column="started"><%=job == null ? "" : dateFormatter.format(job.getStarted())%></tbl:cell> 496 <tbl:cell column="slot"><%=jobInfo.getSlot() == null ? "" : jobInfo.getSlot().toString()%></tbl:cell> 497 <tbl:cell column="percentComplete"> 498 <% 499 if (job != null) 500 { 501 %> 502 <table border=0 cellspacing=0 cellpadding=0> 503 <tr> 504 <td width="100"> 505 <table width="100" class="progressbar" border=0 cellspacing=0 cellpadding=0> 506 <tr> 507 <% 508 int percent = job.getPercentComplete(); 509 if (percent > 0) 510 { 511 %> 512 <td width="<%=percent%>%" class="done"> </td> 513 <% 514 } 515 if (percent < 100) 516 { 517 %> 518 <td width="<%=100-percent%>%" class="remain"> </td> 519 <% 520 } 521 %> 522 </tr> 523 </table> 524 </td> 525 <td> <%=percent%>%</td> 526 </tr> 527 </table> 528 <% 529 } 530 %> 531 </tbl:cell> 532 <tbl:cell column="owner"><base:propertyvalue item="<%=job%>" property="owner" /></tbl:cell> 533 </tbl:row> 534 <% 535 } 536 %> 537 </tbl:rows> 538 </tbl:data> 539 </tbl:table> 548 </tbl:rows> 549 </tbl:data> 550 </tbl:table> 551 </base:section> 540 552 <% 541 553 } … … 543 555 // Tables with users/groups/projects that this item is shared to 544 556 MultiPermissions mp = new MultiPermissions(Collections.singleton(agent)); 545 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 546 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 547 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 557 List<User> users = mp.getUsers().list(dc); 558 List<Group> groups = mp.getGroups().list(dc); 559 List<Project> projects = mp.getProjects().list(dc); 560 int totalShare = users.size() + groups.size() + projects.size(); 548 561 549 if ( users.hasNext() || groups.hasNext() || projects.hasNext())562 if (totalShare > 0) 550 563 { 551 564 %> 552 <h4 class="docked">Shared to</h4> 553 <tbl:table 554 id="itemsSharedTo" 555 clazz="itemlist" 556 columns="all" 557 > 558 <tbl:columndef 559 id="itemType" 560 title="Item type" 561 /> 562 <tbl:columndef 563 id="name" 564 title="Name" 565 /> 566 <tbl:columndef 567 id="permissions" 568 title="Permissions" 569 /> 570 <tbl:data> 571 <tbl:columns> 572 </tbl:columns> 573 <tbl:rows> 574 <% 575 while(projects.hasNext()) 576 { 577 Project project = projects.next(); 578 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 579 %> 580 <tbl:row> 581 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 582 <tbl:cell column="name"><base:icon 583 image="deleted.gif" 584 tooltip="This item has been scheduled for deletion" 585 visible="<%=project.isRemoved()%>" 586 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 587 <tbl:cell column="permissions"> 588 <%=PermissionUtil.translatePermissionsToString(permissions)%> 589 </tbl:cell> 590 </tbl:row> 565 <base:section 566 id="sharedTo" 567 title="<%="Shared to (" + totalShare + ")"%>" 568 context="<%=cc%>" 569 > 570 <tbl:table 571 id="itemsSharedTo" 572 clazz="itemlist" 573 columns="all" 574 > 575 <tbl:columndef 576 id="itemType" 577 title="Item type" 578 /> 579 <tbl:columndef 580 id="name" 581 title="Name" 582 /> 583 <tbl:columndef 584 id="permissions" 585 title="Permissions" 586 /> 587 <tbl:data> 588 <tbl:columns> 589 </tbl:columns> 590 <tbl:rows> 591 591 <% 592 } 593 while(groups.hasNext()) 594 { 595 Group group = groups.next(); 596 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 592 for (Project project : projects) 593 { 594 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 595 %> 596 <tbl:row> 597 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 598 <tbl:cell column="name"><base:icon 599 image="deleted.gif" 600 tooltip="This item has been scheduled for deletion" 601 visible="<%=project.isRemoved()%>" 602 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 603 <tbl:cell column="permissions"> 604 <%=PermissionUtil.translatePermissionsToString(permissions)%> 605 </tbl:cell> 606 </tbl:row> 607 <% 608 } 609 for (Group group : groups) 610 { 611 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 612 %> 613 <tbl:row> 614 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 615 <tbl:cell column="name"><base:icon 616 image="deleted.gif" 617 tooltip="This item has been scheduled for deletion" 618 visible="<%=group.isRemoved()%>" 619 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 620 <tbl:cell column="permissions"> 621 <%=PermissionUtil.translatePermissionsToString(permissions)%> 622 </tbl:cell> 623 </tbl:row> 624 <% 625 } 626 for (User user : users) 627 { 628 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 629 %> 630 <tbl:row> 631 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 632 <tbl:cell column="name"><base:icon 633 image="deleted.gif" 634 tooltip="This item has been scheduled for deletion" 635 visible="<%=user.isRemoved()%>" 636 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 637 <tbl:cell column="permissions"> 638 <%=PermissionUtil.translatePermissionsToString(permissions)%> 639 </tbl:cell> 640 </tbl:row> 641 <% 642 } 597 643 %> 598 <tbl:row> 599 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 600 <tbl:cell column="name"><base:icon 601 image="deleted.gif" 602 tooltip="This item has been scheduled for deletion" 603 visible="<%=group.isRemoved()%>" 604 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 605 <tbl:cell column="permissions"> 606 <%=PermissionUtil.translatePermissionsToString(permissions)%> 607 </tbl:cell> 608 </tbl:row> 609 <% 610 } 611 while (users.hasNext()) 612 { 613 User user = users.next(); 614 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 615 %> 616 <tbl:row> 617 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 618 <tbl:cell column="name"><base:icon 619 image="deleted.gif" 620 tooltip="This item has been scheduled for deletion" 621 visible="<%=user.isRemoved()%>" 622 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 623 <tbl:cell column="permissions"> 624 <%=PermissionUtil.translatePermissionsToString(permissions)%> 625 </tbl:cell> 626 </tbl:row> 627 <% 628 } 629 %> 630 </tbl:rows> 631 </tbl:data> 632 </tbl:table> 644 </tbl:rows> 645 </tbl:data> 646 </tbl:table> 647 </base:section> 633 648 <% 634 649 } -
trunk/www/admin/pluginconfigurations/view_configuration.jsp
r4889 r5040 1 1 <%-- $Id$ 2 2 ------------------------------------------------------------------ 3 Copyright (C) 2006 Jari H äkkinen, Nicklas Nordborg, Martin Svensson3 Copyright (C) 2006 Jari H�kkinen, Nicklas Nordborg, Martin Svensson 4 4 Copyright (C) 2007 Martin Svensson 5 5 … … 318 318 // Tables with users/groups/projects that this item is shared to 319 319 MultiPermissions mp = new MultiPermissions(Collections.singleton(configuration)); 320 ItemResultIterator<User> users = mp.getUsers().iterate(dc); 321 ItemResultIterator<Group> groups = mp.getGroups().iterate(dc); 322 ItemResultIterator<Project> projects = mp.getProjects().iterate(dc); 320 List<User> users = mp.getUsers().list(dc); 321 List<Group> groups = mp.getGroups().list(dc); 322 List<Project> projects = mp.getProjects().list(dc); 323 int totalShare = users.size() + groups.size() + projects.size(); 323 324 324 if ( users.hasNext() || groups.hasNext() || projects.hasNext())325 if (totalShare > 0) 325 326 { 326 327 %> 327 <h4 class="docked">Shared to</h4> 328 <tbl:table 329 id="itemsSharedTo" 330 clazz="itemlist" 331 columns="all" 332 > 333 <tbl:columndef 334 id="itemType" 335 title="Item type" 336 /> 337 <tbl:columndef 338 id="name" 339 title="Name" 340 /> 341 <tbl:columndef 342 id="permissions" 343 title="Permissions" 344 /> 345 <tbl:data> 346 <tbl:columns> 347 </tbl:columns> 348 <tbl:rows> 349 <% 350 while(projects.hasNext()) 351 { 352 Project project = projects.next(); 353 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 354 %> 355 <tbl:row> 356 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 357 <tbl:cell column="name"><base:icon 358 image="deleted.gif" 359 tooltip="This item has been scheduled for deletion" 360 visible="<%=project.isRemoved()%>" 361 /><%=Base.getLinkedName(ID, project, false, true)%></tbl:cell> 362 <tbl:cell column="permissions"> 363 <%=PermissionUtil.translatePermissionsToString(permissions)%> 364 </tbl:cell> 365 </tbl:row> 328 <base:section 329 id="sharedTo" 330 title="<%="Shared to (" + totalShare + ")"%>" 331 context="<%=cc%>" 332 > 333 <tbl:table 334 id="itemsSharedTo" 335 clazz="itemlist" 336 columns="all" 337 > 338 <tbl:columndef 339 id="itemType" 340 title="Item type" 341 /> 342 <tbl:columndef 343 id="name" 344 title="Name" 345 /> 346 <tbl:columndef 347 id="permissions" 348 title="Permissions" 349 /> 350 <tbl:data> 351 <tbl:columns> 352 </tbl:columns> 353 <tbl:rows> 366 354 <% 367 } 368 while(groups.hasNext()) 369 { 370 Group group = groups.next(); 371 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 355 for (Project project : projects) 356 { 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> 370 <% 371 } 372 for (Group group : groups) 373 { 374 Set<Permission> permissions = mp.getPermissions(group).values().iterator().next(); 375 %> 376 <tbl:row> 377 <tbl:cell column="itemType"><%=group.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="<%=group.isRemoved()%>" 382 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 383 <tbl:cell column="permissions"> 384 <%=PermissionUtil.translatePermissionsToString(permissions)%> 385 </tbl:cell> 386 </tbl:row> 387 <% 388 } 389 for (User user : users) 390 { 391 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 392 %> 393 <tbl:row> 394 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 395 <tbl:cell column="name"><base:icon 396 image="deleted.gif" 397 tooltip="This item has been scheduled for deletion" 398 visible="<%=user.isRemoved()%>" 399 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 400 <tbl:cell column="permissions"> 401 <%=PermissionUtil.translatePermissionsToString(permissions)%> 402 </tbl:cell> 403 </tbl:row> 404 <% 405 } 372 406 %> 373 <tbl:row> 374 <tbl:cell column="itemType"><%=group.getType()%></tbl:cell> 375 <tbl:cell column="name"><base:icon 376 image="deleted.gif" 377 tooltip="This item has been scheduled for deletion" 378 visible="<%=group.isRemoved()%>" 379 /><%=Base.getLinkedName(ID, group, false, true)%></tbl:cell> 380 <tbl:cell column="permissions"> 381 <%=PermissionUtil.translatePermissionsToString(permissions)%> 382 </tbl:cell> 383 </tbl:row> 384 <% 385 } 386 while (users.hasNext()) 387 { 388 User user = users.next(); 389 Set<Permission> permissions = mp.getPermissions(user).values().iterator().next(); 390 %> 391 <tbl:row> 392 <tbl:cell column="itemType"><%=user.getType()%></tbl:cell> 393 <tbl:cell column="name"><base:icon 394 image="deleted.gif" 395 tooltip="This item has been scheduled for deletion" 396 visible="<%=user.isRemoved()%>" 397 /><%=Base.getLinkedName(ID, user, false, true)%></tbl:cell> 398 <tbl:cell column="permissions"> 399 <%=PermissionUtil.translatePermissionsToString(permissions)%> 400 </tbl:cell> 401 </tbl:row> 402 <% 403 } 404 %> 405 </tbl:rows> 406 </tbl:data> 407 </tbl:table> 407 </tbl:rows> 408 </tbl:data> 409 </tbl:table> 410 </base:section> 408 411 <% 409 412 } -
trunk/www/admin/plugindefinitions/view_plugin.jsp
r4889 r5040 1 1 <%-- $Id$ 2 2 ------------------------------------------------------------------ 3 Copyright (C) 2006 Jari H äkkinen, Nicklas Nordborg, Martin Svensson3 Copyright (C) 2006 Jari H�kkinen, Nicklas Nordborg, Martin Svensson 4 4 Copyright (C) 2007 Johan Enell, Martin Svensson 5 5 … … 406 406 { 407 407 %> 408 <h4 class="docked">Configurations</h4> 409 <tbl:table 408 <base:section 410 409 id="configurations" 411 clazz="itemlist"412 co lumns="all"410 title="<%="Configurations (" + configurations.size() + ")" %>" 411 context="<%=cc%>" 413 412 > 414 <tbl:columndef 415 id="name" 416 title="Name" 417 /> 418 <tbl:columndef 419 id="description" 420 title="Description" 421 /> 422 <tbl:columndef 423 id="configure" 424 title="Configure" 425 show="<%=plugin.supportsConfigurations() ? "always" : "never" %>" 426 /> 427 <tbl:data> 428 <tbl:columns> 429 </tbl:columns> 430 <tbl:rows> 431 <% 432 for (PluginConfiguration pc : configurations) 433 { 413 <tbl:table 414 id="configurations" 415 clazz="itemlist" 416 columns="all" 417 > 418 <tbl:columndef 419 id="name" 420 title="Name" 421 /> 422 <tbl:columndef 423 id="description" 424 title="Description" 425 /> 426 <tbl:columndef 427 id="configure" 428 title="Configure" 429 show="<%=plugin.supportsConfigurations() ? "always" : "never" %>" 430 /> 431 <tbl:data> 432 <tbl:columns> 433 </tbl:columns> 434 <tbl:rows> 435 <% 436 for (PluginConfiguration pc : configurations) 437 { 438 %> 439 <tbl:row> 440 <tbl:cell column="name"><base:icon 441 image="deleted.gif" 442 tooltip="This item has been scheduled for deletion" 443 visible="<%=pc.isRemoved()%>" 444 /><%=Base.getLinkedName(ID, pc, false, true)%></tbl:cell> 445 <tbl:cell column="description"><%=HTML.encodeTags(pc.getDescription())%></tbl:cell> 446 <tbl:cell column="configure"> 447 <% 448 if (pc.hasPermission(Permission.WRITE)) 449 { 450 %> 451 <base:icon image="runplugin.gif" 452 onclick="<%="configurePlugin(" + pc.getId() + ")"%>" 453 tooltip="Configure this plugin "/> 454 <% 455 } 456 %> 457 </tbl:cell> 458 </tbl:row> 459 <% 460 } 434 461 %> 435 <tbl:row> 436 <tbl:cell column="name"><base:icon 437 image="deleted.gif" 438 tooltip="This item has been scheduled for deletion" 439 visible="<%=pc.isRemoved()%>" 440 /><%=Base.getLinkedName(ID, pc, false, true)%></tbl:cell> 441 <tbl:cell column="description"><%=HTML.encodeTags(pc.getDescription())%></tbl:cell> 442 <tbl:cell column="configure"> 443 <% 444 if (pc.hasPermission(Permission.WRITE)) 445 { 446 %> 447 <base:icon image="runplugin.gif" 448 onclick="<%="configurePlugin(" + pc.getId() + ")"%>" 449 tooltip="Configure this plugin "/> 450 <% 451 } 452 %> 453 </tbl:cell> 454 </tbl:row> 455 <% 456 } 457 %> 458 </tbl:rows> 459 </tbl:data> 460 </tbl:table> 462 </tbl:rows> 463 </tbl:data> 464 </tbl:table> 465 </base:section> 461 466 <% 462 467 } … … 481 486 { 482 487 %> 483 <h4 class="docked">Installed on job agents</h4> 484 <tbl:table 485 id="agents" 486 clazz="itemlist" 487 columns="all" 488 > 489 <tbl:columndef 490 id="name" 491 title="Name" 492 /> 493 <tbl:columndef 494 id="server" 495 title="Server" 496 /> 497 <tbl:columndef 498 id="info" 499 title="CPU/Memory" 500 /> 501 <tbl:columndef 502 id="jarPath" 503 title="JAR path" 504 /> 505 <tbl:columndef 506 id="maxMemory" 507 title="Max memory" 508 /> 509 <tbl:columndef 510 id="trusted" 511 title="Trusted" 512 /> 513 <tbl:columndef 514 id="priorityBoost" 515 title="Priority boost" 516 /> 517 <tbl:columndef 518 id="configure" 519 title="" 520 /> 521 <tbl:data> 522 <tbl:columns> 523 </tbl:columns> 524 <tbl:rows> 525 <% 526 for (JobAgent agent : agents) 527 { 528 String server = agent.getServer(); 529 Integer port = agent.getPort(); 530 JobAgentSettings settings = agent.getSettings(plugin, false); 531 Long maxMemory = settings.getEffectiveMaxMemory(); 532 String jarPath = settings.getEffectiveJarPath(); 533 %> 534 <tbl:row> 535 <tbl:cell column="name"><base:icon 536 image="deleted.gif" 537 tooltip="This item has been scheduled for deletion" 538 visible="<%=agent.isRemoved()%>" 539 /><%=Base.getLinkedName(ID, agent, false, true)%></tbl:cell> 540 <tbl:cell column="server"><%=server == null || port == null ? "" : server + ":" + port%></tbl:cell> 541 <tbl:cell column="info"> 542 CPU usage: <%=agent.getCpuUsage() == null ? "<i>- unknown -</i>" : agent.getCpuUsage()+"%" %><br> 543 Total memory: <%=agent.getTotalMemory() == null ? "<i>- unknown -</i>" : Values.formatBytes(agent.getTotalMemory()) %><br> 544 Used memory: <%=agent.getUsedMemory() == null ? "<i>- unknown -</i>" : Values.formatBytes(agent.getUsedMemory()) %> 545 </tbl:cell> 546 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 547 <tbl:cell column="maxMemory"><%=maxMemory == null ? "<i>- not specified -</i>" : Values.formatBytes(maxMemory)%></tbl:cell> 548 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> 549 <tbl:cell column="priorityBoost"><%=settings.getPriorityBoost()%></tbl:cell> 550 <tbl:cell column="configure"> 551 <% 552 if (agent.hasPermission(Permission.WRITE)) 553 { 554 %> 555 <base:icon image="runplugin.gif" 556 onclick="<%="configureAgent(" + agent.getId() + ")"%>" 557 tooltip="Configure the settings for this plugin on the job agent "/> 558 <% 559 } 560 %> 561 </tbl:cell> 562 </tbl:row> 563 <% 564 } 565 %> 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(plugin)); 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 /> 488 <base:section 489 id="jobagents" 490 title="<%="Installed on job agents (" + agents.size() + ")" %>" 491 context="<%=cc%>" 492 > 493 <tbl:table 494 id="agents" 495 clazz="itemlist" 496 columns="all" 497 > 591 498 <tbl:columndef 592 499 id="name" … … 594 501 /> 595 502 <tbl:columndef 596 id="permissions" 597 title="Permissions" 503 id="server" 504 title="Server" 505 /> 506 <tbl:columndef 507 id="info" 508 title="CPU/Memory" 509 /> 510 <tbl:columndef 511 id="jarPath" 512 title="JAR path" 513 /> 514 <tbl:columndef 515 id="maxMemory" 516 title="Max memory" 517 /> 518 <tbl:columndef 519 id="trusted" 520 title="Trusted" 521 /> 522 <tbl:columndef 523 id="priorityBoost" 524 title="Priority boost" 525 /> 526 <tbl:columndef 527 id="configure" 528 title="" 598 529 /> 599 530 <tbl:data> … … 602 533 <tbl:rows> 603 534 <% 604 while(projects.hasNext())535 for (JobAgent agent : agents) 605 536 { 606 Project project = projects.next(); 607 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 608 %> 537 String server = agent.getServer(); 538 Integer port = agent.getPort(); 539 JobAgentSettings settings = agent.getSettings(plugin, false); 540 Long maxMemory = settings.getEffectiveMaxMemory(); 541 String jarPath = settings.getEffectiveJarPath(); 542 %> 609 543 <tbl:row> 610 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell>611 544 <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)%> 545 image="deleted.gif" 546 tooltip="This item has been scheduled for deletion" 547 visible="<%=agent.isRemoved()%>" 548 /><%=Base.getLinkedName(ID, agent, false, true)%></tbl:cell> 549 <tbl:cell column="server"><%=server == null || port == null ? "" : server + ":" + port%></tbl:cell> 550 <tbl:cell column="info"> 551 CPU usage: <%=agent.getCpuUsage() == null ? "<i>- unknown -</i>" : agent.getCpuUsage()+"%" %><br> 552 Total memory: <%=agent.getTotalMemory() == null ? "<i>- unknown -</i>" : Values.formatBytes(agent.getTotalMemory()) %><br> 553 Used memory: <%=agent.getUsedMemory() == null ? "<i>- unknown -</i>" : Values.formatBytes(agent.getUsedMemory()) %> 618 554 </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)%> 555 <tbl:cell column="jarPath"><%=jarPath == null ? "<i>- internal -</i>" : HTML.encodeTags(jarPath)%></tbl:cell> 556 <tbl:cell column="maxMemory"><%=maxMemory == null ? "<i>- not specified -</i>" : Values.formatBytes(maxMemory)%></tbl:cell> 557 <tbl:cell column="trusted"><%=settings.isEffectivelyTrusted()%></tbl:cell> 558 <tbl:cell column="priorityBoost"><%=settings.getPriorityBoost()%></tbl:cell> 559 <tbl:cell column="configure"> 560 <% 561 if (agent.hasPermission(Permission.WRITE)) 562 { 563 %> 564 <base:icon image="runplugin.gif" 565 onclick="<%="configureAgent(" + agent.getId() + ")"%>" 566 tooltip="Configure the settings for this plugin on the job agent "/> 567 <% 568 } 569 %> 654 570 </tbl:cell> 655 571 </tbl:row> … … 659 575 </tbl:rows> 660 576 </tbl:data> 661 </tbl:table> 577 </tbl:table> 578 </base:section> 579 <% 580 } 581 582 // Tables with users/groups/projects that this item is shared to 583 MultiPermissions mp = new MultiPermissions(Collections.singleton(plugin)); 584 List<User> users = mp.getUsers().list(dc); 585 List<Group> groups = mp.getGroups().list(dc); 586 List<Project> projects = mp.getProjects().list(dc); 587 int totalShare = users.size() + groups.size() + projects.size(); 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> 617 <% 618 for (Project project : projects) 619 { 620 Set<Permission> permissions = mp.getPermissions(project).values().iterator().next(); 621 %> 622 <tbl:row> 623 <tbl:cell column="itemType"><%=project.getType()%></tbl:cell> 624 <tbl:cell column="name"><base:icon 625 image="deleted.gif" 626 tooltip="This item has been scheduled for deletion" 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> 666 </tbl:row> 667 <% 668 } 669 %> 670 </tbl:rows> 671 </tbl:data> 672 </tbl:table> 673 </base:section> 662 674 <% 663 675 } … … 672 684 %> 673 685 <br> 674 <h4>Permissions</h4> 675 <table class="form" cellspacing="0"> 676 <tr> 677 <td class="prompt">Using permissions</td> 678 <td><%=usePermissions ? "yes" : "no"%></td> 679 </tr> 680 </table> 681 686 <base:section 687 id="permissions" 688 title="<%="Permissions (using permissions: " + (usePermissions ? "yes" : "no") + ")" %>" 689 context="<%=cc%>" 690 > 682 691 <div class="itemlist"> 683 692 <div class="data"> 684 <table border="0" cellspacing="0" cellpadding="0"> 685 <tr> 686 <% 687 Map<String, List<Item>> permissionGroups = PermissionUtil.getPermissionGroups(); 688 689 for (String name : permissionGroups.keySet()) 690 { 691 %> 692 <th class="columnheader" colspan="2"><b><%=name%></b></th> 693 <table border="0" cellspacing="0" cellpadding="0"> 694 <tr> 693 695 <% 694 } 695 %> 696 </tr> 697 <% 698 int newItems = 0; 699 int index = 0; 700 int i = 0; 701 do 702 { 703 newItems = 0; 704 StringBuilder sb = new StringBuilder(); 705 sb.append("<tr valign=\"top\""); 706 sb.append(" class=\"").append(i == 1 ? "oddrow" : "evenrow").append("\""); 707 sb.append(">"); 696 Map<String, List<Item>> permissionGroups = PermissionUtil.getPermissionGroups(); 697 708 698 for (String name : permissionGroups.keySet()) 709 699 { 710 List<Item> items = permissionGroups.get(name); 711 if (items.size() > index) 700 %> 701 <th class="columnheader" colspan="2"><b><%=name%></b></th> 702 <% 703 } 704 %> 705 </tr> 706 <% 707 int newItems = 0; 708 int index = 0; 709 int i = 0; 710 do 711 { 712 newItems = 0; 713 StringBuilder sb = new StringBuilder(); 714 sb.append("<tr valign=\"top\""); 715 sb.append(" class=\"").append(i == 1 ? "oddrow" : "evenrow").append("\""); 716 sb.append(">"); 717 for (String name : permissionGroups.keySet()) 712 718 { 713 newItems++; 714 Item item = items.get(index); 715 int keyId = SystemItems.getRoleKeyId(item); 716 RoleKey key = RoleKey.getById(dc, keyId); 717 718 sb.append("<td class=\"cell\"><b>").append(key.getName()).append("</b></td>"); 719 sb.append("<td class=\"cell\">"); 720 721 if (keyId != 0) 722 { 723 Set<Permission> granted = plugin.getGranted(key); 724 Set<Permission> denied = plugin.getDenied(key); 725 sb.append(getShortPermissions(item, granted, denied)); 719 List<Item> items = permissionGroups.get(name); 720 if (items.size() > index) 721 { 722 newItems++; 723 Item item = items.get(index); 724 int keyId = SystemItems.getRoleKeyId(item); 725 RoleKey key = RoleKey.getById(dc, keyId); 726 727 sb.append("<td class=\"cell\"><b>").append(key.getName()).append("</b></td>"); 728 sb.append("<td class=\"cell\">"); 729 730 if (keyId != 0) 731 { 732 Set<Permission> granted = plugin.getGranted(key); 733 Set<Permission> denied = plugin.getDenied(key); 734 sb.append(getShortPermissions(item, granted, denied)); 735 } 736 else 737 { 738 sb.append("(undefined key)"); 739 } 740 sb.append("</td>"); 726 741 } 727 742 else 728 743 { 729 sb.append(" (undefined key)");744 sb.append("<td class=\"cell\" colspan=\"2\"> </td>"); 730 745 } 731 sb.append("</td>");732 746 } 733 else747 if (newItems > 0) 734 748 { 735 sb.append("<td class=\"cell\" colspan=\"2\"> </td>"); 749 %> 750 <%=sb.toString()%> 751 <% 736 752 } 737 } 738 if (newItems > 0) 739 { 740 %> 741 <%=sb.toString()%> 742 <% 743 } 744 i = 1 - i; 745 index++; 746 } while (newItems > 0); 747 %> 748 <tr class="panel"> 749 <td colspan="99" class="panel"> 750 Capital letters = Permission is always granted, Small letters = Permission is only granted if logged in user 751 has that permission<br> 752 <b>C/c</b> = Create, <b>R/r</b> = Read, <b>U/u</b> = Use, 753 <b>W/w</b> = Write, <b>D/d</b> = Delete, <b>O/o</b> = Change owner, 754 <b>P/p</b> = Change permissions 755 </td> 756 </tr> 757 </table> 753 i = 1 - i; 754 index++; 755 } while (newItems > 0); 756 %> 757 <tr class="panel"> 758 <td colspan="99" class="panel"> 759 Capital letters = Permission is always granted, Small letters = Permission is only granted if logged in user 760 has that permission<br> 761 <b>C/c</b> = Create, <b>R/r</b> = Read, <b>U/u</b> = Use, 762 <b>W/w</b> = Write, <b>D/d</b> = Delete, <b>O/o</b> = Change owner, 763 <b>P/p</b> = Change permissions 764 </td> 765 </tr> 766 </table> 758 767 </div> 759 768 </div> 769 </base:section> 760 770 761 771 </div> -
trunk/www/admin/plugintypes/view_plugintype.jsp
r4889 r5040 1 1 <%-- $Id$ 2 2 ------------------------------------------------------------------ 3 Copyright (C) 2006 Jari H äkkinen, Nicklas Nordborg, Martin Svensson3 Copyright (C) 2006 Jari H�kkinen, Nicklas Nordborg, Martin Svensson 4 4 5 5 This file is part of BASE - BioArray Software Environment. … … 247 247 { 248 248 %> 249 <h4 class="docked">Plugins</h4> 250 <tbl:table 249 <base:section 251 250 id="plugins" 252 clazz="itemlist" 253 columns="all" 254 > 255 <tbl:columndef 256 id="name" 257 title="Name" 258 /> 259 <tbl:columndef 260 id="class" 261 title="Class" 262 /> 263 <tbl:columndef 264 id="description" 265 title="Description" 266 /> 267 <tbl:data> 268 <tbl:columns> 269 </tbl:columns> 270 <tbl:rows> 271 <% 272 for (PluginDefinition plugin : plugins) 273 { 251 title="<%="Plugins (" + plugins.size() + ")"%>" 252 context="<%=cc%>" 253 > 254 <tbl:table 255 id="plugins" 256 clazz="itemlist" 257 columns="all" 258 > 259 <tbl:columndef 260 id="name" 261 title="Name" 262 /> 263 <tbl:columndef 264 id="class" 265 title="Class" 266 /> 267 <tbl:columndef 268 id="description" 269 title="Description" 270 /> 271 <tbl:data> 272 <tbl:columns> 273 </tbl:columns> 274 <tbl:rows> 275 <% 276 for (PluginDefinition plugin : plugins) 277 { 278 %> 279 <tbl:row> 280 <tbl:cell column="name"><base:icon 281 image="deleted.gif" 282 tooltip="This item has been scheduled for deletion" 283 visible="<%=plugin.isRemoved()%>" 284 /><%=Base.getLinkedName(ID, new NameablePluginAdaptor(plugin), false, true)%></tbl:cell> 285 <tbl:cell column="class"><%=HTML.encodeTags(plugin.getClassName())%></tbl:cell> 286 <tbl:cell column="description"><%=HTML.encodeTags(plugin.getDescription())%></tbl:cell> 287 </tbl:row> 288 <% 289 } 274 290 %> 275 <tbl:row> 276 <tbl:cell column="name"><base:icon 277 image="deleted.gif" 278 tooltip="This item has been scheduled for deletion" 279 visible="<%=plugin.isRemoved()%>" 280 /><%=Base.getLinkedName(ID, new NameablePluginAdaptor(plugin), false, true)%></tbl:cell> 281 <tbl:cell column="class"><%=HTML.encodeTags(plugin.getClassName())%></tbl:cell> 282 <tbl:cell column="description"><%=HTML.encodeTags(plugin.getDescription())%></tbl:cell> 283 </tbl:row> 284 <% 285 } 286 %> 287 </tbl:rows> 288 </tbl:data> 289 </tbl:table> 291 </tbl:rows> 292 </tbl:data> 293 </tbl:table> 294 </base:section> 290 295 <% 291 296 }
Note: See TracChangeset
for help on using the changeset viewer.