Changeset 6695


Ignore:
Timestamp:
Jan 28, 2015, 7:59:57 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

References #1908: Batch inheriting multiple annotations

Added to list pages for samples, extracts, physical bioassays, derived bioassays and array lims.

Location:
trunk/www
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/biomaterials/extracts/extracts.js

    r6576 r6695  
    116116      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    117117      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     118      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    118119      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    119120      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/biomaterials/extracts/index.jsp

    r6312 r6695  
    4646  import="net.sf.basedb.core.MultiPermissions"
    4747  import="net.sf.basedb.core.OwnedItem"
     48  import="net.sf.basedb.core.AnnotatedItem"
    4849  import="net.sf.basedb.core.PermissionDeniedException"
    4950  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    446447    redirect = "../../common/export/index.jsp?ID="+ID+"&cmd=SelectPlugin&item_type="+itemType.name()+"&context_type=LIST&title=Export+extracts";
    447448  }
     449  else if ("InheritAnnotations".equals(cmd))
     450  {
     451    // Change owner of items selected on a list page
     452    dc = sc.newDbControl();
     453    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     454    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     455    for (Integer id : cc.getSelected())
     456    {
     457      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     458    }
     459    dc.close();
     460    cc.setObject("AnnotatedItems", items);
     461    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     462  }
    448463  else if ("ExportItem".equals(cmd))
    449464  {
  • trunk/www/biomaterials/extracts/list_extracts.jsp

    r6690 r6695  
    2424  @version 2.0
    2525--%>
    26 <%@page import="net.sf.basedb.core.MeasuredBioMaterial"%>
    2726<%@ page pageEncoding="UTF-8" session="false"
    2827  import="net.sf.basedb.core.SessionControl"
     
    3635  import="net.sf.basedb.core.BioMaterialEvent"
    3736  import="net.sf.basedb.core.BioWell"
     37  import="net.sf.basedb.core.MeasuredBioMaterial"
    3838  import="net.sf.basedb.core.ItemSubtype"
    3939  import="net.sf.basedb.core.AnnotationType"
     
    559559          title="Place on plate&hellip;"
    560560          tooltip="Place the selected/matching extracts on a bioplate"
     561        />
     562        <tbl:button
     563          id="btnInheritAnnotations"
     564          image="inherit.png"
     565          title="Inherit annotations&hellip;"
     566          tooltip="Batch inherit annotations from parent items"
    561567        />
    562568        <tbl:button
  • trunk/www/biomaterials/samples/index.jsp

    r6312 r6695  
    4343  import="net.sf.basedb.core.MultiPermissions"
    4444  import="net.sf.basedb.core.OwnedItem"
     45  import="net.sf.basedb.core.AnnotatedItem"
    4546  import="net.sf.basedb.core.PermissionDeniedException"
    4647  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    406407    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    407408  }
     409  else if ("InheritAnnotations".equals(cmd))
     410  {
     411    // Change owner of items selected on a list page
     412    dc = sc.newDbControl();
     413    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     414    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     415    for (Integer id : cc.getSelected())
     416    {
     417      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     418    }
     419    dc.close();
     420    cc.setObject("AnnotatedItems", items);
     421    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     422  }
    408423  else if ("ExportItems".equals(cmd))
    409424  {
  • trunk/www/biomaterials/samples/list_samples.jsp

    r6690 r6695  
    525525            title="Place on plate&hellip;"
    526526            tooltip="Place the selected/matching samples on a bioplate"
     527          />
     528          <tbl:button
     529            id="btnInheritAnnotations"
     530            image="inherit.png"
     531            title="Inherit annotations&hellip;"
     532            tooltip="Batch inherit annotations from parent items"
    527533          />
    528534          <tbl:button
  • trunk/www/biomaterials/samples/samples.js

    r6576 r6695  
    109109      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    110110      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     111      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    111112      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    112113      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/common/annotations/batch_inherit.js

    r6694 r6695  
    137137  inherit.save = function()
    138138  {
     139    if (selectedAnnotationTypes.length == 0)
     140    {
     141      Forms.showNotification('btnSelectAnnotationTypes', 'Please select annotation types to inherit!');
     142      return;
     143    }
    139144    var frm = document.forms['annotations'];
    140145    frm.cmd.value = 'BatchInherit';
  • trunk/www/lims/arraybatches/batches.js

    r6400 r6695  
    8888      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    8989      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     90      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    9091      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    9192      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/lims/arraybatches/index.jsp

    r6192 r6695  
    3939  import="net.sf.basedb.core.MultiPermissions"
    4040  import="net.sf.basedb.core.OwnedItem"
     41  import="net.sf.basedb.core.AnnotatedItem"
    4142  import="net.sf.basedb.core.PermissionDeniedException"
    4243  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    282283    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    283284  }
     285  else if ("InheritAnnotations".equals(cmd))
     286  {
     287    // Change owner of items selected on a list page
     288    dc = sc.newDbControl();
     289    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     290    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     291    for (Integer id : cc.getSelected())
     292    {
     293      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     294    }
     295    dc.close();
     296    cc.setObject("AnnotatedItems", items);
     297    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     298  }
    284299  else if ("ExportItems".equals(cmd))
    285300  {
  • trunk/www/lims/arraybatches/list_batches.jsp

    r6690 r6695  
    335335            title="Columns&hellip;"
    336336            tooltip="Show, hide and re-order columns"
     337          />
     338          <tbl:button
     339            id="btnInheritAnnotations"
     340            image="inherit.png"
     341            title="Inherit annotations&hellip;"
     342            tooltip="Batch inherit annotations from parent items"
    337343          />
    338344          <tbl:button
  • trunk/www/lims/arraydesigns/designs.js

    r6400 r6695  
    8080      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    8181      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     82      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    8283      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    8384      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/lims/arraydesigns/index.jsp

    r6312 r6695  
    4646  import="net.sf.basedb.core.MultiPermissions"
    4747  import="net.sf.basedb.core.OwnedItem"
     48  import="net.sf.basedb.core.AnnotatedItem"
    4849  import="net.sf.basedb.core.PermissionDeniedException"
    4950  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    333334    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    334335  }
     336  else if ("InheritAnnotations".equals(cmd))
     337  {
     338    // Change owner of items selected on a list page
     339    dc = sc.newDbControl();
     340    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     341    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     342    for (Integer id : cc.getSelected())
     343    {
     344      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     345    }
     346    dc.close();
     347    cc.setObject("AnnotatedItems", items);
     348    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     349  }
    335350  else if ("ExportItems".equals(cmd))
    336351  {
  • trunk/www/lims/arraydesigns/list_designs.jsp

    r6690 r6695  
    434434            title="Columns&hellip;"
    435435            tooltip="Show, hide and re-order columns"
     436          />
     437          <tbl:button
     438            id="btnInheritAnnotations"
     439            image="inherit.png"
     440            title="Inherit annotations&hellip;"
     441            tooltip="Batch inherit annotations from parent items"
    436442          />
    437443          <tbl:button
  • trunk/www/lims/arrayslides/index.jsp

    r6192 r6695  
    1 <%@page import="net.sf.basedb.core.InvalidDataException"%>
    21<%-- $Id$
    32  ------------------------------------------------------------------
     
    4039  import="net.sf.basedb.core.MultiPermissions"
    4140  import="net.sf.basedb.core.OwnedItem"
     41  import="net.sf.basedb.core.AnnotatedItem"
     42  import="net.sf.basedb.core.InvalidDataException"
    4243  import="net.sf.basedb.core.PermissionDeniedException"
    4344  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    331332    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    332333  }
     334  else if ("InheritAnnotations".equals(cmd))
     335  {
     336    // Change owner of items selected on a list page
     337    dc = sc.newDbControl();
     338    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     339    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     340    for (Integer id : cc.getSelected())
     341    {
     342      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     343    }
     344    dc.close();
     345    cc.setObject("AnnotatedItems", items);
     346    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     347  }
    333348  else if ("ExportItems".equals(cmd))
    334349  {
  • trunk/www/lims/arrayslides/list_slides.jsp

    r6690 r6695  
    351351            title="Columns&hellip;"
    352352            tooltip="Show, hide and re-order columns"
     353          />
     354          <tbl:button
     355            id="btnInheritAnnotations"
     356            image="inherit.png"
     357            title="Inherit annotations&hellip;"
     358            tooltip="Batch inherit annotations from parent items"
    353359          />
    354360          <tbl:button
  • trunk/www/lims/arrayslides/slides.js

    r6389 r6695  
    8181      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    8282      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     83      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    8384      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    8485      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/views/derivedbioassays/bioassays.js

    r6400 r6695  
    112112      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    113113      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     114      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    114115      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    115116      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/views/derivedbioassays/index.jsp

    r6314 r6695  
    3838  import="net.sf.basedb.core.User"
    3939  import="net.sf.basedb.core.OwnedItem"
     40  import="net.sf.basedb.core.AnnotatedItem"
    4041  import="net.sf.basedb.core.ItemQuery"
    4142  import="net.sf.basedb.core.ItemResultIterator"
     
    401402    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    402403  }
     404  else if ("InheritAnnotations".equals(cmd))
     405  {
     406    // Change owner of items selected on a list page
     407    dc = sc.newDbControl();
     408    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     409    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     410    for (Integer id : cc.getSelected())
     411    {
     412      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     413    }
     414    dc.close();
     415    cc.setObject("AnnotatedItems", items);
     416    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     417  }
    403418  else if ("ExportItems".equals(cmd))
    404419  {
  • trunk/www/views/derivedbioassays/list_bioassays.jsp

    r6690 r6695  
    419419            title="Columns&hellip;"
    420420            tooltip="Show, hide and re-order columns"
     421          />
     422          <tbl:button
     423            id="btnInheritAnnotations"
     424            image="inherit.png"
     425            title="Inherit annotations&hellip;"
     426            tooltip="Batch inherit annotations from parent items"
    421427          />
    422428          <tbl:button
  • trunk/www/views/physicalbioassays/bioassays.js

    r6576 r6695  
    105105      Buttons.addClickHandler('btnSetOwner', Buttons.setOwnerOfItems, tableAttributes);
    106106      Buttons.addClickHandler('btnColumns', Buttons.configureColumns, tableAttributes);
     107      Buttons.addClickHandler('btnInheritAnnotations', Buttons.inheritAnnotations, tableAttributes);
    107108      Buttons.addClickHandler('btnExport', Buttons.runListPlugin, tableAttributes);
    108109      Buttons.addClickHandler('btnImport', Buttons.runListPlugin, tableAttributes);
  • trunk/www/views/physicalbioassays/index.jsp

    r6314 r6695  
    4444  import="net.sf.basedb.core.MultiPermissions"
    4545  import="net.sf.basedb.core.OwnedItem"
     46  import="net.sf.basedb.core.AnnotatedItem"
    4647  import="net.sf.basedb.core.PermissionDeniedException"
    4748  import="net.sf.basedb.core.ItemAlreadyExistsException"
     
    362363    redirect = "../../common/ownership/ownership.jsp?ID="+ID+"&item_type="+itemType.name();
    363364  }
     365  else if ("InheritAnnotations".equals(cmd))
     366  {
     367    // Change owner of items selected on a list page
     368    dc = sc.newDbControl();
     369    ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, pageContext, defaultContext);
     370    Set<AnnotatedItem> items = new HashSet<AnnotatedItem>();
     371    for (Integer id : cc.getSelected())
     372    {
     373      if (id != null) items.add((AnnotatedItem)itemType.getById(dc, id));
     374    }
     375    dc.close();
     376    cc.setObject("AnnotatedItems", items);
     377    redirect = "../../common/annotations/batch_inherit.jsp?ID="+ID+"&item_type="+itemType.name();
     378  }
    364379  else if ("ExportItems".equals(cmd))
    365380  {
  • trunk/www/views/physicalbioassays/list_bioassays.jsp

    r6690 r6695  
    400400            title="Columns&hellip;"
    401401            tooltip="Show, hide and re-order columns"
     402          />
     403          <tbl:button
     404            id="btnInheritAnnotations"
     405            image="inherit.png"
     406            title="Inherit annotations&hellip;"
     407            tooltip="Batch inherit annotations from parent items"
    402408          />
    403409          <tbl:button
Note: See TracChangeset for help on using the changeset viewer.