Changeset 7003


Ignore:
Timestamp:
Nov 6, 2015, 2:08:14 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1960 and #1958: Inherit annotations from Hardware, Software and Protocol

Fixed in the items listed and added Kit:s to the list of items to inherit from.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/ArrayBatch.java

    r7002 r7003  
    139139   
    140140    addAnnotatableParents(getDbControl(), annotatable,
    141       data.getArrayDesign()
     141      data.getArrayDesign(),
     142      data.getProtocol(),
     143      data.getPrintRobot()
    142144    );
    143145    return annotatable;
  • trunk/src/core/net/sf/basedb/core/BioPlate.java

    r6874 r7003  
    3232
    3333import java.util.Date;
     34import java.util.HashSet;
    3435import java.util.Set;
    3536
     
    148149 
    149150  /**
    150     Gets parent plates, always returns null
     151    Get the freezer.
    151152   */
    152153  @Override
     
    154155    throws BaseException
    155156  {
    156     return null;
     157    Set<Annotatable> annotatable = new HashSet<Annotatable>();
     158    BioPlateData data = getData();
     159   
     160    addAnnotatableParents(getDbControl(), annotatable,
     161      data.getFreezer()
     162    );
     163    return annotatable;
    157164  }
    158165
  • trunk/src/core/net/sf/basedb/core/DerivedBioAssay.java

    r7002 r7003  
    377377      data.getExtract(),
    378378      data.getHardware(),
    379       data.getSoftware()
     379      data.getSoftware(),
     380      data.getProtocol(),
     381      data.getKit()
    380382    );
    381383   
  • trunk/src/core/net/sf/basedb/core/Extract.java

    r6992 r7003  
    374374  {
    375375    Set<Annotatable> annotatable = super.getAnnotatableParents();
    376     try
    377     {
    378       if (getData().getTag() != null) annotatable.add(getTag());
    379     }
    380     catch (PermissionDeniedException ex)
    381     {}
     376    ExtractData data = getData();
     377    addAnnotatableParents(getDbControl(), annotatable,
     378      data.getTag()
     379    );
    382380    return annotatable;
    383381  }
  • trunk/src/core/net/sf/basedb/core/MeasuredBioMaterial.java

    r7002 r7003  
    3232import java.util.WeakHashMap;
    3333
     34import net.sf.basedb.core.data.BioMaterialEventData;
    3435import net.sf.basedb.core.data.BioPlateData;
    3536import net.sf.basedb.core.data.BioPlateTypeData;
     
    214215  {
    215216    Set<Annotatable> annotatable = super.getAnnotatableParents();
     217    DbControl dc = getDbControl();
    216218   
    217219    MeasuredBioMaterialData data = getData();
    218     DbControl dc = getDbControl();
    219 
     220    BioMaterialEvent event = getCreationEvent();
     221    BioMaterialEventData eventData = event.getData();
     222
     223    addAnnotatableParents(dc, annotatable,
     224      eventData.getHardware(),
     225      eventData.getProtocol(),
     226      eventData.getKit()
     227    );
     228   
    220229    if (data.getBioWell() != null)
    221230    {
     
    231240    {
    232241      // Multiple parent items
    233       ItemQuery<? extends BioMaterial> query = getCreationEvent().getSources();
     242      ItemQuery<? extends BioMaterial> query = event.getSources();
    234243      query.include(Include.ALL);
    235244      if (parents != null && parents.size() > 0)
  • trunk/src/core/net/sf/basedb/core/PhysicalBioAssay.java

    r7002 r7003  
    338338    addAnnotatableParents(dc, annotatable,
    339339      data.getArraySlide(),
    340       eventData.getHardware()
     340      eventData.getHardware(),
     341      eventData.getProtocol(),
     342      eventData.getKit()
    341343    );
    342344
  • trunk/src/core/net/sf/basedb/core/RawBioAssay.java

    r7002 r7003  
    247247      data.getParentBioAssay(),
    248248      data.getParentExtract(),
    249       data.getSoftware()
     249      data.getSoftware(),
     250      data.getProtocol()
    250251    );
    251252    return annotatable;
  • trunk/www/biomaterials/bioplates/bioplates.js

    r6944 r7003  
    4040     
    4141      // Tab validation
    42       TabControl.addTabActivateListener('settings.annotations', Annotations.onSwitchToAnnotationsTab);
     42      TabControl.addTabActivateListener('settings.annotations', bioplates.loadAnnotationsFrame);
    4343      TabControl.addTabValidator('settings.info', bioplates.validateBioPlate);
    4444
     
    125125  }
    126126
     127  bioplates.loadAnnotationsFrame = function()
     128  {
     129    Annotations.autoLoadEditFrame(null, null, bioplates.getParents());
     130  }
     131 
     132  bioplates.getParents = function()
     133  {
     134    var frm = document.forms['bioplate'];
     135    var parents = new Array();
     136    var storageId = Math.abs(parseInt(frm.storage_id.value));
     137    if (storageId > 0) parents[parents.length] = 'HARDWARE:'+storageId;
     138    return parents;
     139  }
     140
    127141 
    128142  bioplates.viewWells = function()
  • trunk/www/biomaterials/extracts/extracts.js

    r7001 r7003  
    291291  {
    292292    var frm = document.forms['extract'];
    293     var url = '../tags/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone';
    294293    var url = '&resetTemporary=1';
    295294    url += ItemSubtype.createRelatedFilter('subtype_id', 'TAG');
  • trunk/www/biomaterials/samples/samples.js

    r7001 r7003  
    291291      }
    292292    }
     293    var protocolId = Math.abs(parseInt(frm.protocol_id.value));
     294    if (protocolId > 0) parents[parents.length] = 'PROTOCOL:'+protocolId;
     295    var kitId = Math.abs(parseInt(frm.kit_id.value));
     296    if (kitId > 0) parents[parents.length] = 'KIT:'+kitId;
     297
    293298    return parents;
    294299  }
  • trunk/www/common/annotations/inherit.jsp

    r7000 r7003  
    221221  // Parent items may have been submitted by caller
    222222  String[] parents = request.getParameterValues("parents");
    223   parents = null;
    224223  // Each parameter is ITEMTYPE:ID:ID:...
    225224  if (parents != null)
  • trunk/www/lims/arraybatches/batches.js

    r7001 r7003  
    176176      if (arrayDesignId > 0) parents[parents.length] = 'ARRAYDESIGN:'+arrayDesignId;
    177177    }
     178    var protocolId = Math.abs(parseInt(frm.protocol_id.value));
     179    if (protocolId > 0) parents[parents.length] = 'PROTOCOL:'+protocolId;
     180    var printRobotId = Math.abs(parseInt(frm.printrobot_id.value));
     181    if (printRobotId > 0) parents[parents.length] = 'HARDWARE:'+printRobotId;
    178182    return parents;
    179183  }
  • trunk/www/views/derivedbioassays/bioassays.js

    r7001 r7003  
    249249    var softwareId = Math.abs(parseInt(frm.software_id.value));
    250250    if (softwareId > 0) parents[parents.length] = 'SOFTWARE:'+softwareId;
     251    var kitId = Math.abs(parseInt(frm.kit_id.value));
     252    if (kitId > 0) parents[parents.length] = 'KIT:'+kitId;
    251253    return parents;
    252254  }
  • trunk/www/views/physicalbioassays/bioassays.js

    r7001 r7003  
    207207    var hardwareId = Math.abs(parseInt(frm.hardware_id.value));
    208208    if (hardwareId > 0) parents[parents.length] = 'HARDWARE:'+hardwareId;
     209    var protocolId = Math.abs(parseInt(frm.protocol_id.value));
     210    if (protocolId > 0) parents[parents.length] = 'PROTOCOL:'+protocolId;
     211    var kitId = Math.abs(parseInt(frm.kit_id.value));
     212    if (kitId > 0) parents[parents.length] = 'KIT:'+kitId;
    209213
    210214    var ids = Link.getIdsInList(frm.extracts, 'EXTRACT');
  • trunk/www/views/rawbioassays/bioassays.js

    r7001 r7003  
    204204    var softwareId = Math.abs(parseInt(frm.software_id.value));
    205205    if (softwareId > 0) parents[parents.length] = 'SOFTWARE:'+softwareId;
     206    var protocolId = Math.abs(parseInt(frm.protocol_id.value));
     207    if (protocolId > 0) parents[parents.length] = 'PROTOCOL:'+protocolId;
    206208    if (frm.arraydesign_id)
    207209    {
Note: See TracChangeset for help on using the changeset viewer.