Changeset 2062


Ignore:
Timestamp:
Oct 14, 2013, 8:54:18 AM (10 years ago)
Author:
Nicklas Nordborg
Message:

References #481 and #501. If 'Flow cell ID' is already known for a flow cell, print it on the lab protocol and pre-fill the registration form.

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

Legend:

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

    r2061 r2062  
    134134      setInnerHTML('flowCellName.'+flowCellNo, flowCellName);       
    135135      setInnerHTML('flowCellDescription.'+flowCellNo, flowCellDescription);       
    136       setInnerHTML('readString.'+flowCellNo, readString);       
     136      setInnerHTML('readString.'+flowCellNo, readString);
     137      setInnerHTML('flowCellId.'+flowCellNo, flowCell.externalId);
    137138      var flowCellLanes = flowCell['lanes'];
    138139      for (laneKey in flowCellLanes)
     
    339340    <tr valign="top" style="border-top: 1px solid #000000;">
    340341      <th style="border-right: 1px solid #000000;">Flow cell ID</th>
    341       <td colspan="2" style="border-right: 1px solid #000000;"></td>
     342      <td colspan="2" style="border-right: 1px solid #000000;"><div id="flowCellId.<%=c%>" ></div></td>
    342343    </tr>
    343344    <tr valign="top" style="border-top: 1px solid #000000;">
  • extensions/net.sf.basedb.reggie/trunk/resources/libprep/flowcell_registration.jsp

    r2060 r2062  
    232232      frm[prefix+'.comments'].value = fc.comments;
    233233      commentsOnChange(prefix+'.comments');
     234      frm[prefix+'.id'].value = fc.externalId;
     235      flowCellIdOnBlur(prefix+'.id');
    234236      index++;
    235237    }
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FlowCellServlet.java

    r2060 r2062  
    2525import net.sf.basedb.core.Hardware;
    2626import net.sf.basedb.core.ItemQuery;
    27 import net.sf.basedb.core.ItemResultList;
    2827import net.sf.basedb.core.ItemSubtype;
    2928import net.sf.basedb.core.PhysicalBioAssay;
     
    143142        {
    144143          fc.loadAnnotations(dc, "ReadString", Annotationtype.READ_STRING, null);
     144          fc.loadAnnotations(dc, "externalId", Annotationtype.FLOWCELL_ID, null);
    145145          fc.setAnnotation("comments", fc.getPhysicalBioAssay().getDescription());
    146146          jsonFlowCells.add(fc.asJSONObject());
     
    170170        for (FlowCell fc: flowCellList)
    171171        {
    172           JSONObject jsonFlowCell = new JSONObject();
    173           jsonFlowCell.put("name", fc.getName());
    174           // Get ReadString annotation
    175172          PhysicalBioAssay physBA = fc.getPhysicalBioAssay();
    176           jsonFlowCell.put("description", physBA.getDescription());
    177           int numLanes = physBA.getSize();
    178           String readString = (String) Annotationtype.READ_STRING.getAnnotationValue(dc, manager, physBA);
    179           jsonFlowCell.put("readString", readString);
     173          fc.setAnnotation("description", physBA.getDescription());
     174          fc.setAnnotation("numLanes", physBA.getSize());
     175          fc.loadAnnotations(dc, "readString", Annotationtype.READ_STRING, null);
     176          fc.loadAnnotations(dc, "externalId", Annotationtype.FLOWCELL_ID, null);
     177         
    180178          // Get flow cell lane info
    181179          JSONObject jsonFlowCellLanes = new JSONObject();
    182           // Note: Lane positions start with 1, not 0
    183           for (int pos = 1; pos <= numLanes; pos++)
     180          for (BioMaterialEventSource eventSource : physBA.getCreationEvent().getEventSources().list(dc))
    184181          {
    185             ItemResultList<Extract> fcExtractList = fc.getPhysicalBioAssay().getExtracts(pos).list(dc);
    186             for (Extract extract: fcExtractList)
    187             {
    188               jsonFlowCellLanes.put(pos, extract.getName());
    189             }
     182            Extract pool = (Extract)eventSource.getBioMaterial();
     183            jsonFlowCellLanes.put(eventSource.getPosition(), pool.getName());
    190184          }
    191           jsonFlowCell.put("numLanes", numLanes);
    192           jsonFlowCell.put("lanes", jsonFlowCellLanes);
    193           //
    194           jsonFlowCellInfo.add(jsonFlowCell);
     185          fc.setAnnotation("lanes", jsonFlowCellLanes);
     186          jsonFlowCellInfo.add(fc.asJSONObject());
    195187        }
    196188        json.put("flowCellInfo", jsonFlowCellInfo);
Note: See TracChangeset for help on using the changeset viewer.