Changeset 1762
- Timestamp:
- Dec 3, 2012, 12:27:11 PM (10 years ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/ticket-422
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/ticket-422/resources/index.jsp
r1759 r1762 290 290 <ul> 291 291 <li><a href="libprep/select_rna.jsp?ID=<%=ID%>">Create new mRNA plate</a> 292 <li><a href="libprep/mrna_protocol.jsp?ID=<%=ID%>">Lab protocol and files for mRNA and cDNA preparation</a>293 <li><a href="libprep/mrna_registration.jsp?ID=<%=ID%>"> Import mRNAquality control results</a>294 <li><a href=" ?ID=<%=ID%>">cDNA registration</a>292 <li><a href="libprep/mrna_protocol.jsp?ID=<%=ID%>">Lab protocols and files for mRNA and cDNA preparation</a> 293 <li><a href="libprep/mrna_registration.jsp?ID=<%=ID%>">mRNA registration and quality control results</a> 294 <li><a href="libprep/cdna_registration.jsp?ID=<%=ID%>">cDNA registration</a> 295 295 </ul> 296 296 </dd> -
extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/mrna_registration.jsp
r1758 r1762 86 86 { 87 87 showLoadingAnimation('Loading histology work lists...'); 88 var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessed MRnaPlates';88 var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA'; 89 89 request.open("GET", url, false); 90 90 request.send(null); -
extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/dao/ReactionPlate.java
r1758 r1762 11 11 import net.sf.basedb.core.BioPlate; 12 12 import net.sf.basedb.core.BioPlateEvent; 13 import net.sf.basedb.core.BioPlateEventType; 13 14 import net.sf.basedb.core.BioPlateType; 14 15 import net.sf.basedb.core.BioWell; … … 22 23 import net.sf.basedb.core.MeasuredBioMaterial; 23 24 import net.sf.basedb.core.PlateGeometry; 25 import net.sf.basedb.core.SystemItems; 24 26 import net.sf.basedb.core.Type; 25 27 import net.sf.basedb.core.query.Expressions; … … 276 278 @since 2.x 277 279 */ 278 public List<BioPlateEvent> findEvents(DbControl dc, String role)280 public List<BioPlateEvent> findEvents(DbControl dc, String eventType, String role) 279 281 { 280 282 ItemQuery<BioPlateEvent> query = getItem().getEvents(); 283 if (eventType != null) 284 { 285 int eventTypeId = SystemItems.getId(eventType); 286 if (eventTypeId != 0) 287 { 288 // Restrict on event type 289 query.restrict(Restrictions.eq(Hql.property("eventType"), Expressions.integer(eventTypeId))); 290 } 291 292 } 281 293 if (role != null) 282 294 { -
extensions/net.sf.basedb.reggie/branches/ticket-422/src/net/sf/basedb/reggie/servlet/MRnaServlet.java
r1760 r1762 89 89 json.put("name", bioPlateType.generateNextName(dc, 1)); 90 90 } 91 else if ("GetUnprocessedMRnaPlates".equals(cmd)) 92 { 93 dc = sc.newDbControl(); 91 else if ("GetUnprocessedPlates".equals(cmd)) 92 { 93 dc = sc.newDbControl(); 94 BioplateType plateType = BioplateType.getByCName(req.getParameter("plateType")); 94 95 95 96 ItemQuery<BioPlate> query = BioPlate.getQuery(); 96 97 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 97 98 query.restrict(Restrictions.eq(Hql.property("eventDate"), null)); 98 BioplateType.MRNA.addFilter(dc, query, true);99 plateType.addFilter(dc, query, true); 99 100 query.order(Orders.desc(Hql.property("id"))); 100 101 … … 366 367 367 368 // Find the creation event for the mRNA plate 368 List<BioPlateEvent> events = mrnaReactionPlate.findEvents(dc, "destination");369 List<BioPlateEvent> events = mrnaReactionPlate.findEvents(dc, BioPlateEventType.CREATE_BIOMATERIAL, "destination"); 369 370 if (events.size() > 1) 370 371 { … … 447 448 448 449 jsonMessages.add("Prepared child cDNA plate '" + cdnaPlateName + "' for future processing"); 450 451 dc.commit(); 452 } 453 else if ("ImportCDnaResults".equals(cmd)) 454 { 455 JSONObject jsonReq = (JSONObject)new JSONParser().parse(req.getReader()); 456 457 Number bioPlateId = (Number)jsonReq.get("bioplate"); 458 Number cdnaProtocolId = (Number)jsonReq.get("cdnaProtocol"); 459 460 dc = sc.newDbControl(); 461 462 // Load cDNA plate and the creation event 463 ReactionPlate cdnaReactionPlate = ReactionPlate.getById(dc, bioPlateId.intValue(), BioplateType.CDNA); 464 BioPlate cdnaPlate = cdnaReactionPlate.getBioPlate(); 465 466 // Find the creation event for the cDNA plate 467 List<BioPlateEvent> events = cdnaReactionPlate.findEvents(dc, BioPlateEventType.CREATE_BIOMATERIAL, "child"); 468 if (events.size() > 1) 469 { 470 throw new InvalidDataException("Found > 1 creation event for cDNA plate: " + cdnaReactionPlate.getName()); 471 } 472 // ...it may not exist if a plate has been created with a batch import... 473 BioPlateEvent cdnaPlateCreationEvent = events.size() == 0 ? null : events.get(0); 474 475 // Set creation date and protocol 476 Date cdnaDate = Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("cdnaDate")); 477 cdnaPlate.setEventDate(cdnaDate); 478 Protocol cdnaProtocol = cdnaProtocolId == null ? null : Protocol.getById(dc, cdnaProtocolId.intValue()); 479 if (cdnaPlateCreationEvent != null) 480 { 481 // This automatically propagated to all mRNA items on the plate 482 cdnaPlateCreationEvent.setEventDate(cdnaDate); 483 cdnaPlateCreationEvent.setProtocol(cdnaProtocol); 484 } 485 486 // Operator is an annotation 487 String operator = Values.getStringOrNull((String)jsonReq.get("cdnaOperator")); 488 Annotationtype.QC_OPERATOR.setAnnotationValue(dc, cdnaPlate, operator); 489 490 491 // Comment about the plate 492 cdnaPlate.setDescription((String)jsonReq.get("comment")); 493 494 jsonMessages.add("cDNA plate registered: " + cdnaPlate.getName()); 449 495 450 496 dc.commit();
Note: See TracChangeset
for help on using the changeset viewer.