Changeset 1986


Ignore:
Timestamp:
May 21, 2013, 2:34:28 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

References #473: Register library processing results

Show warning if trying to register a library plate without any quality control PDF files attached to it. Registration is still possible.

Added "manual select" functionality for registering quality control PDF:s to a library plate. This allows a PDF file to be attached to a plate at any time.

Location:
extensions/net.sf.basedb.reggie/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/lib_registration.jsp

    r1968 r1986  
    4949    {
    5050      var bioplate = bioplates[i];
    51       var option = new Option(bioplate.name, bioplate.id);
    52       option.comments = bioplate.comments;
     51      var warning = bioplate.numFiles == 0 ? ' ( ! )' : '';
     52      var option = new Option(bioplate.name + warning, bioplate.id);
     53      option.bioplate = bioplate;
    5354      plates.options[plates.length] = option;
    5455    }
     
    214215{
    215216  var frm = document.forms['reggie'];
     217  var selectedPlate = frm.bioplate[frm.bioplate.selectedIndex].bioplate;
     218  if (selectedPlate.numFiles == 0)
     219  {
     220    setInputStatus('bioplate', 'No quality control PDF has been registered for this plate', 'warning');
     221  }
     222  else
     223  {
     224    setInputStatus('bioplate', '', 'valid');
     225  }
    216226}
    217227
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/libqc_registration.jsp

    r1931 r1986  
    3232var currentStep = 1;
    3333
     34var bioplateIsValid = false;
    3435var pdfQcIsValid = false;
    3536var qcDateIsValid = false;
     
    5354      plates.options[plates.length] = option;
    5455    }
    55     bioplateIsValid = true;
    56     setInputStatus('bioplate', '', 'valid');
    57     bioPlateOnChange();
    58   }
    59   else
    60   {
    61     var msg = 'No Library bioplates available for processing.';
    62     setFatalError(msg);
    63     return;
    64   }
    65 
    66   // All is ok
     56  }
     57
    6758  frm.bioplate.focus();
     59  bioPlateOnChange();
    6860}
    6961
     
    115107function gotoStep2()
    116108{
     109  if (!bioplateIsValid) return;
    117110  var frm = document.forms['reggie'];
    118111  frm.bioplate.disabled = true;
     
    131124{
    132125  var frm = document.forms['reggie'];
     126  bioplateIsValid = false;
     127
     128  if (frm.bioplate.length == 0)
     129  {
     130    setInputStatus('bioplate', 'No Library plate available for processing.', 'invalid');
     131    return;
     132  }
     133 
     134  bioplateIsValid = true;
     135  setInputStatus('bioplate', '', 'valid');
    133136}
    134137
     
    294297}
    295298
     299function selectLibPlate()
     300{
     301  var frm = document.forms['reggie'];
     302  if (frm.bioplate.disabled) return;
     303   
     304  var url = getRoot() + 'biomaterials/bioplates/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setLibPlateCallback';
     305  url += '&tmpfilter:STRING:bioPlateType.name=Library+plate';
     306  Main.openPopup(url, 'SelectLibPlate', 1000, 700);
     307}
     308function setLibPlateCallback(id, name)
     309{
     310  var frm = document.forms['reggie'];
     311  var plateList = frm.bioplate;
     312  for (var i = 0; i < plateList.length; i++)
     313  {
     314    if (plateList[i].value == id)
     315    {
     316      plateList[i].selected = true;
     317      return;
     318    }
     319  }
     320 
     321  var option = new Option(name, id, true, true);
     322  plateList[plateList.length] = option;
     323  bioPlateOnChange();
     324}
    296325
    297326</script>
     
    334363        <td class="input"><select class="required" style="width:90%;"
    335364            name="bioplate" id="bioplate" onchange="bioPlateOnChange()"></select>
     365           
     366          <base:buttongroup style="margin-top: 0.5em;">
     367            <base:button title="Select manually&hellip;" onclick="selectLibPlate()" id="btnSelectLibPlate" />
     368          </base:buttongroup>
    336369        </td>
    337370        <td class="status" id="bioplate.status"></td>
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/LibPrepServlet.java

    r1984 r1986  
    3434import net.sf.basedb.core.File;
    3535import net.sf.basedb.core.InvalidDataException;
     36import net.sf.basedb.core.Item;
    3637import net.sf.basedb.core.ItemQuery;
    3738import net.sf.basedb.core.ItemSubtype;
     
    4445import net.sf.basedb.core.plugin.ParameterValues;
    4546import net.sf.basedb.core.query.Annotations;
     47import net.sf.basedb.core.query.Expressions;
    4648import net.sf.basedb.core.query.Hql;
    4749import net.sf.basedb.core.query.Orders;
     
    183185        for (BioPlate plate : plates)
    184186        {
     187          ItemQuery<AnyToAny> fileQuery = AnyToAny.getLinksFrom(plate);
     188          Restrictions.eq(Hql.property("toType"), Expressions.integer(Item.FILE.getValue()));
     189          long fileCount = fileQuery.count(dc);
     190
    185191          JSONObject jsonPlate = new JSONObject();
    186192          jsonPlate.put("id", plate.getId());
    187193          jsonPlate.put("name", plate.getName());
    188194          jsonPlate.put("comments", plate.getDescription());
     195          jsonPlate.put("numFiles", fileCount);
    189196          jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, plate));
    190197          jsonPlate.put("barcodeVariant", Annotationtype.BARCODE_VARIANT.getAnnotationValue(dc, plate));
Note: See TracChangeset for help on using the changeset viewer.