Changeset 2504
- Timestamp:
- Jun 13, 2014, 8:12:34 AM (9 years ago)
- Location:
- extensions/net.sf.basedb.reggie/branches/2.15-stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/branches/2.15-stable/resources/index.jsp
r2322 r2504 67 67 var debug = false; 68 68 var myPermissions = {}; 69 var allCounts = {}; 69 70 70 71 function init() … … 187 188 url = 'MRna.servlet?ID=<%=ID%>&cmd=CountRnaWithoutMRna'; 188 189 } 189 else if (what == 'mrna-plates') 190 { 191 url = 'MRna.servlet?ID=<%=ID%>&cmd=CountUnprocessedPlates&plateType=MRNA'; 190 else if (what == 'undiluted-mrna-plates') 191 { 192 url = 'MRna.servlet?ID=<%=ID%>&cmd=CountUndilutedMRNAPlates'; 193 } 194 else if (what == 'diluted-mrna-plates') 195 { 196 url = 'MRna.servlet?ID=<%=ID%>&cmd=CountDilutedMRNAPlates'; 192 197 } 193 198 else if (what == 'cdna-plates') … … 322 327 var count = error ? -1 : response.count; 323 328 setCount('count.rna-without-mrna', count, 'RNA', msg); 324 startCounting('mrna-plates'); 325 } 326 else if (currentCount == 'mrna-plates') 329 startCounting('undiluted-mrna-plates'); 330 } 331 else if (currentCount == 'undiluted-mrna-plates') 332 { 333 var msg = error || 'Number of mRNA plates waiting for dilution'; 334 var count = error ? -1 : response.count; 335 setCount('count.undiluted-mrna-plates', count, 'mRNA plates', msg); 336 startCounting('diluted-mrna-plates'); 337 } 338 else if (currentCount == 'diluted-mrna-plates') 327 339 { 328 340 var msg = error || 'Number of mRNA plates waiting for registration'; 329 341 var count = error ? -1 : response.count; 330 setCount('count. mrna-plates.1', count, 'mRNA plates', msg);331 setCount('count.mrna-plates .2', count, 'mRNA plates', msg);342 setCount('count.diluted-mrna-plates', count, 'mRNA plates', msg); 343 setCount('count.mrna-plates', count + allCounts['count.undiluted-mrna-plates'], 'mRNA plates', 'Number of mRNA plates waiting for processing'); 332 344 startCounting('cdna-plates'); 333 345 } … … 410 422 function setCount(id, count, unit, msg) 411 423 { 424 allCounts[id] = count; 412 425 var div = document.getElementById(id); 413 426 div.title = msg; … … 618 631 619 632 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/mrna_protocol.jsp?ID=<%=ID%>" 620 >Lab protocols for mRNA and cDNA preparation</span> <span class="counter" id="count.mrna-plates.1" title="Counting..."><img src="images/loading-small.gif"></span> 621 633 >Lab protocols for mRNA and cDNA preparation</span> <span class="counter" id="count.mrna-plates" title="Counting..."><img src="images/loading-small.gif"></span> 634 635 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/rna_dilution_registration.jsp?ID=<%=ID%>" 636 >RNA dilution registration</span> <span class="counter" id="count.undiluted-mrna-plates" title="Counting..."><img src="images/loading-small.gif"></span> 637 622 638 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/mrna_registration.jsp?ID=<%=ID%>" 623 >mRNA registration and quality control results</span> <span class="counter" id="count. mrna-plates.2" title="Counting..."><img src="images/loading-small.gif"></span>639 >mRNA registration and quality control results</span> <span class="counter" id="count.diluted-mrna-plates" title="Counting..."><img src="images/loading-small.gif"></span> 624 640 625 641 <li><span class="require-permission" data-role="LibraryPrep" data-link="libprep/cdna_registration.jsp?ID=<%=ID%>" -
extensions/net.sf.basedb.reggie/branches/2.15-stable/resources/libprep/mrna_protocol.jsp
r1927 r2504 42 42 { 43 43 var bioplate = bioplates[i]; 44 var option = new Option(bioplate.name, bioplate.id); 44 var name = bioplate.name; 45 if (bioplate.DilutionDate) 46 { 47 name += ' (diluted ' + formatDate(bioplate.DilutionDate) + ')'; 48 } 49 var option = new Option(name, bioplate.id); 45 50 option.bioplate = bioplate; 46 51 plates.options[plates.length] = option; … … 56 61 setFatalError(msg); 57 62 } 63 } 64 65 function formatDate(value) 66 { 67 if (!value) return ''; 68 if (value.length == 8) 69 { 70 // YYYYMMDD 71 value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2); 72 } 73 else if (value.length == 13) 74 { 75 // YYYYMMDD HHMM 76 value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2) + ' ' + value.substr(9, 2) + ':' + value.substr(11, 2); 77 } 78 return value; 58 79 } 59 80 -
extensions/net.sf.basedb.reggie/branches/2.15-stable/resources/libprep/mrna_protocol2.jsp
r2216 r2504 91 91 } 92 92 93 var plate = response.plate; 94 if (plate.DilutionDate) 95 { 96 setInnerHTML('dilution-date', formatDate(plate.DilutionDate)); 97 setInnerHTML('dilution-operator', plate.DilutionOperator); 98 } 99 93 100 var list = response.mrna; 94 101 // Find QUANTITY_REGULAR = lowest used value … … 115 122 } 116 123 %> 124 Main.show('protocol'); 125 } 126 127 function formatDate(value) 128 { 129 if (!value) return ''; 130 if (value.length == 8) 131 { 132 // YYYYMMDD 133 value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2); 134 } 135 else if (value.length == 13) 136 { 137 // YYYYMMDD HHMM 138 value = value.substr(0, 4) + '-' + value.substr(4, 2) + '-' + value.substr(6, 2) + ' ' + value.substr(9, 2) + ':' + value.substr(11, 2); 139 } 140 return value; 117 141 } 118 142 … … 534 558 <h1>Lab protocol for mRNA and cDNA preparation <span class="reggie">Reggie <%=reggie.getAbout().getVersion() %></span></h1> 535 559 560 <div class="loading" id="loading" style="display: none;"><table><tr><td><img src="../images/loading.gif"></td><td id="loading.msg">Please wait...</td></tr></table></div> 561 <div class="messagecontainer error" id="errorMessage" style="display: none;"></div> 562 563 <div id="protocol" style="display: none;"> 536 564 <table style="width: 100%;" class="protocolheader"> 537 565 <tr style="border-bottom: 1px solid #000000;"> … … 545 573 <td rowspan="5" colspan="2" style="width: 50%; border-right: 1px solid #000000;"><%=HTML.niceFormat(plate.getDescription()) %></td> 546 574 <td style="border-right: 1px solid #000000;">Dilution</td> 547 <td style="border-right: 1px solid #000000;" ></td>548 <td ></td>575 <td style="border-right: 1px solid #000000;" id="dilution-date"></td> 576 <td id="dilution-operator"></td> 549 577 </tr> 550 578 <tr style="border-top: 1px solid #CCCCCC;"> … … 570 598 </table> 571 599 572 <div class="loading" id="loading" style="display: none;"><table><tr><td><img src="../images/loading.gif"></td><td id="loading.msg">Please wait...</td></tr></table></div>573 <div class="messagecontainer error" id="errorMessage" style="display: none;"></div>574 600 <% 575 601 if (view.equals("list")) … … 690 716 <i>Low quantity = The remaining quantity is too low for the RNA to be re-processed one more time</i> 691 717 </div> 718 </div> 692 719 </body> 693 720 </html> -
extensions/net.sf.basedb.reggie/branches/2.15-stable/resources/libprep/mrna_registration.jsp
r2073 r2504 100 100 { 101 101 showLoadingAnimation('Loading histology work lists...'); 102 var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA ';102 var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA&onlyDiluted=1'; 103 103 request.open("GET", url, false); 104 104 request.send(null); … … 153 153 } 154 154 155 frm. dilutionDate.focus();155 frm.purificationDate.focus(); 156 156 } 157 157 … … 308 308 if (!pdfIsValid || !commentsIsValid) return false; 309 309 310 if (dateIsValid['dilutionDate'] == false) return false;311 310 if (dateIsValid['purificationDate'] == false) return false; 312 311 if (dateIsValid['fragmentationDate'] == false) return false; … … 339 338 frm['pdf.path'].disabled = true; 340 339 Main.addClass(document.getElementById('btnPdf'), 'disabled'); 341 frm.dilutionDate.disabled = true;342 frm.dilutionOperator.disabled = true;343 340 frm.purificationDate.disabled = true; 344 341 frm.purificationOperator.disabled = true; … … 355 352 submitInfo.failed = document.getElementById('outcomeSuccess').checked ? false : true; 356 353 submitInfo.pdf = pdfId; 357 submitInfo.dilutionDate = frm.dilutionDate.value;358 submitInfo.dilutionOperator = frm.dilutionOperator.value;359 354 submitInfo.purificationDate = frm.purificationDate.value; 360 355 submitInfo.purificationOperator = frm.purificationOperator.value; … … 457 452 <td class="help"><span id="bioplate.message" class="message" style="display: none;"></span> 458 453 Select an existing mRNA bioplate. The list contain all mRNA bioplates that 459 has not yet been processed (determined by the absence of a 'creation' date). 454 has been diluted, but not yet registered as completed (determined by the absence of a 455 'creation' date). 460 456 </td> 461 457 </tr> … … 495 491 <td><b>Operator</b></td> 496 492 <td class="status"></td> 497 <td class="help" rowspan=" 5">493 <td class="help" rowspan="4"> 498 494 <span id="mrnaDate.message" class="message" style="display: none;"></span> 499 495 Enter date and operator for each step in the mRNA preparation. 500 496 (YYYYMMDD or MMDD) 501 497 </td> 502 </tr>503 <tr>504 <td class="subprompt">Dilution</td>505 <td>506 <input type="text" name="dilutionDate" maxlength="10" style="width: 8em;"507 onblur="dateOnChange('dilutionDate')" onkeypress="focusOnEnter(event, 'dilutionOperator')">508 <base:icon509 onclick="Dates.selectDate('Dilution date', 'reggie', 'dilutionDate', 'setDate', 'yyyyMMdd')"510 image="calendar.png"511 tooltip="Select a date from a calendar"512 tabindex="-1"513 />514 </td>515 <td>516 <input type="text" name="dilutionOperator" value="<%=HTML.encodeTags(user.getName()) %>"517 style="width: 95%;" maxlength="255" onkeypress="focusOnEnter(event, 'purificationDate')">518 </td>519 <td class="status" id="dilutionDate.status"></td>520 498 </tr> 521 499 <tr> -
extensions/net.sf.basedb.reggie/branches/2.15-stable/src/net/sf/basedb/reggie/servlet/MRnaServlet.java
r2161 r2504 123 123 json.put("count", count); 124 124 } 125 else if ("CountUndilutedMRNAPlates".equals(cmd)) 126 { 127 dc = sc.newDbControl(); 128 BioplateType plateType = BioplateType.MRNA; 129 130 // Find plates of the given 'plate type' without 'dilution date' and no 'destroyed' flag set 131 ItemQuery<BioPlate> query = BioPlate.getQuery(); 132 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 133 // Must not have a DILUTION_DATE annotation 134 query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd")); 135 query.restrict(Restrictions.eq(Hql.alias("dd"), null)); 136 plateType.addFilter(dc, query, true); 137 query.setCacheResult(true); 138 long count = query.count(dc); 139 json.put("count", count); 140 } 141 else if ("CountDilutedMRNAPlates".equals(cmd)) 142 { 143 dc = sc.newDbControl(); 144 BioplateType plateType = BioplateType.MRNA; 145 146 // Find plates of the given 'plate type' with 'dilution date', but no 'create date' and no 'destroyed' flag set 147 ItemQuery<BioPlate> query = BioPlate.getQuery(); 148 query.setIncludes(Reggie.INCLUDE_IN_CURRENT_PROJECT); 149 // Must have a DILUTION_DATE annotation 150 query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd")); 151 query.restrict(Restrictions.neq(Hql.alias("dd"), null)); 152 query.restrict(Restrictions.eq(Hql.property("eventDate"), null)); 153 plateType.addFilter(dc, query, true); 154 query.setCacheResult(true); 155 long count = query.count(dc); 156 json.put("count", count); 157 } 125 158 else if ("GetUnprocessedPlates".equals(cmd)) 126 159 { … … 133 166 query.restrict(Restrictions.eq(Hql.property("eventDate"), null)); 134 167 plateType.addFilter(dc, query, true); 168 169 if (req.getParameter("onlyDiluted") != null) 170 { 171 // Must have a DILUTION_DATE annotation 172 query.join(Annotations.leftJoin(null, Annotationtype.DILUTION_DATE.load(dc), "dd")); 173 query.restrict(Restrictions.neq(Hql.alias("dd"), null)); 174 } 175 135 176 query.order(Orders.desc(Hql.property("id"))); 136 177 … … 143 184 jsonPlate.put("name", plate.getName()); 144 185 jsonPlate.put("comments", plate.getDescription()); 186 if (plateType == BioplateType.MRNA) 187 { 188 jsonPlate.put("DilutionDate", Reggie.CONVERTER_DATE_TO_STRING.convert((Date)Annotationtype.DILUTION_DATE.getAnnotationValue(dc, plate))); 189 jsonPlate.put("DilutionOperator", Annotationtype.DILUTION_OPERATOR.getAnnotationValue(dc, plate)); 190 } 145 191 jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, plate)); 146 192 jsonPlates.add(jsonPlate); … … 199 245 BioPlate mRnaPlate = BioPlate.getById(dc, mRnaPlateId); 200 246 247 JSONObject jsonPlate = new JSONObject(); 248 jsonPlate.put("id", mRnaPlate.getId()); 249 jsonPlate.put("name", mRnaPlate.getName()); 250 jsonPlate.put("comments", mRnaPlate.getDescription()); 251 jsonPlate.put("DilutionDate", Reggie.CONVERTER_DATE_TO_STRING.convert((Date)Annotationtype.DILUTION_DATE.getAnnotationValue(dc, mRnaPlate))); 252 jsonPlate.put("DilutionOperator", Annotationtype.DILUTION_OPERATOR.getAnnotationValue(dc, mRnaPlate)); 253 jsonPlate.put("poolSchema", Annotationtype.POOL_SCHEMA.getAnnotationValue(dc, mRnaPlate)); 254 201 255 ItemQuery<Extract> query = Extract.getQuery(); 202 256 query.join(Hql.innerJoin(null, "bioWell", "bw", true)); … … 241 295 242 296 json.put("mrna", jsonMRna); 297 json.put("plate", jsonPlate); 243 298 } 244 299 … … 606 661 607 662 // Dates and operators 608 Annotationtype.DILUTION_DATE.setAnnotationValue(dc, mrnaPlate, Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("dilutionDate")));609 Annotationtype.DILUTION_OPERATOR.setAnnotationValue(dc, mrnaPlate, Values.getStringOrNull((String)jsonReq.get("dilutionOperator")));610 663 Annotationtype.PURIFICATION_DATE.setAnnotationValue(dc, mrnaPlate, Reggie.CONVERTER_STRING_TO_DATE.convert((String)jsonReq.get("purificationDate"))); 611 664 Annotationtype.PURIFICATION_OPERATOR.setAnnotationValue(dc, mrnaPlate, Values.getStringOrNull((String)jsonReq.get("purificationOperator")));
Note: See TracChangeset
for help on using the changeset viewer.