Changeset 6212
- Timestamp:
- Apr 14, 2021, 2:44:22 PM (2 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/batch/import-external-specimen.js
r6211 r6212 54 54 html += '<th>FASTQ files</th>'; 55 55 html += '<th class="icon"></th>' 56 html += '<th class="dottedleft"></th>'; 57 html += '<th class="dottedleft">Import</th>'; 56 html += '<th class="valid dottedleft" colspan="2">Import</th>'; 58 57 html += '</tr>'; 59 58 html += '</thead>'; … … 77 76 html += '<td>'+(Strings.encodeTags(item.itemType) || '-')+'</td>'; 78 77 html += '<td class="dottedleft">'+(Strings.encodeTags(item.name) || '-')+'</td>'; 79 html += '<td class="dottedleft" >';78 html += '<td class="dottedleft" style="white-space: nowrap;">'; 80 79 if (jsonFile) 81 80 { … … 84 83 } 85 84 html += '</td>'; 86 html += '<td class="fastq" >';85 html += '<td class="fastq" style="white-space: nowrap;">'; 87 86 if (jsonFile && jsonFile.fastq) 88 87 { … … 91 90 var fq = jsonFile.fastq[fqNo]; 92 91 html += Strings.encodeTags(fq.name); 92 html += ' <span class="file-data">(' 93 93 if (fq.size > 0) 94 94 { 95 html += '; ' +Numbers.formatBytes(fq.size)+'; '+Reggie.reformatDate(fq.lastModified);95 html += Numbers.formatBytes(fq.size)+'; '+Reggie.reformatDate(fq.lastModified); 96 96 } 97 97 else 98 98 { 99 html += ' (missing)';99 html += 'missing'; 100 100 } 101 html += ' <br>';101 html += ')</span><br>'; 102 102 } 103 103 } … … 106 106 if (icon) html+= '<img src="../images/'+icon+'">'; 107 107 html += '</td>'; 108 html += '<td class="valid dottedleft">'; 108 html += '<td class="import dottedleft">'; 109 if (canImport) 110 { 111 html += '<input type="checkbox" id="import.'+itemNo+'" checked>'; 112 } 113 html += '</td>'; 114 html += '<td class="valid">'; 109 115 var startNo = 1; 110 116 if (jsonFile && jsonFile.errors) … … 128 134 startNo += jsonFile.warnings.length; 129 135 } 130 html += '</td>'; 131 html += '<td class="dottedleft">'; 132 html += '<input type="checkbox" id="import.'+itemNo+'" '+(canImport?'checked':'disabled')+'>'; 136 if (canImport && startNo == 1) 137 { 138 html += 'Import'; 139 } 133 140 html += '</td>'; 134 141 html += '</tr>'; … … 168 175 for (var itemNo = 0; itemNo < importItems.length; itemNo++) 169 176 { 170 if (frm['import.'+itemNo].checked) return; 177 var chk = frm['import.'+itemNo]; 178 if (chk && chk.checked) return; 171 179 } 172 180 Wizard.showGoNextConfirmation(false, 'Please select at least one item!'); … … 281 289 var frm = document.forms['reggie']; 282 290 var submitInfo = {}; 291 submitInfo.operator = frm.operator.value; 283 292 284 293 var items = []; … … 286 295 for (var itemNo = 0; itemNo < importItems.length; itemNo++) 287 296 { 288 if (frm['import.'+itemNo].checked) 297 var chk = frm['import.'+itemNo]; 298 if (chk && chk.checked) 289 299 { 290 300 var item = importItems[itemNo] -
extensions/net.sf.basedb.reggie/trunk/resources/batch/import-external-specimen.jsp
r6211 r6212 49 49 } 50 50 51 #importItemsTable th 52 { 53 padding: 4px; 54 } 55 51 56 #importItemsTable td 52 57 { … … 60 65 } 61 66 62 #importItemsTable td.icon 67 #importItemsTable td.icon, #importItemsTable td.import 63 68 { 64 69 width: 20px; … … 69 74 { 70 75 text-align: left; 76 } 77 78 .file-data 79 { 80 font-style: italic; 81 opacity: 0.5; 71 82 } 72 83 … … 94 105 <div class="step" id="step-2"> 95 106 <div class="step-no">2</div> 96 <div class="step-title"> FASTQ import options</div>107 <div class="step-title">Import options</div> 97 108 <div class="step-content"> 98 109 99 110 <table class="step-form"> 100 111 <tbody> 112 <tr> 113 <td class="prompt">Operator</td> 114 <td class="input"> 115 <select name="operator" id="operator"> 116 <option value="CMD">CMD 117 <option value="">- Use JSON - 118 </option> 119 </td> 120 <td class="status" id="operator.status"></td> 121 <td class="help"> 122 <span id="operator.message" class="message"></span> 123 The external operator. If the <i>Use JSON</i> option is selected 124 the operator information is taken from the JSON file. 125 </td> 126 </tr> 127 </tbody> 128 <tbody> 129 <tr class="section-header"> 130 <td colspan="4">FASTQ Import</td> 131 </tr> 101 132 <tr> 102 133 <td class="subprompt">Auto-analyze</td> -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/DnaInfo.java
r6207 r6212 32 32 PlateCoordinate tmp = section.getRequiredEntry("Qiacube position", PlateWellValidator.QIACUBE); 33 33 if (tmp != null) qiacubePos = 6*tmp.getColumn()+tmp.getRow()+1; 34 operator = section.get RequiredEntry("Qiacube operator");34 operator = section.getOptionalEntry("Qiacube operator", null); 35 35 36 36 // TODO - qiacube run number -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/FlowCellInfo.java
r6209 r6212 53 53 size = section.getRequiredEntry("Size", IntValidator.FLOWCELL_SIZE_2_OR_4); 54 54 sequencingCycles = section.getRequiredEntry("SequencingCycles", PatternValidator.SEQUENCING_CYCLES); 55 operator = section.get RequiredEntry("Operator");55 operator = section.getOptionalEntry("Operator", null); 56 56 } 57 57 valid = section != null && !section.hasError(); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/FlowThroughInfo.java
r6207 r6212 31 31 PlateCoordinate tmp = section.getRequiredEntry("Qiacube position", PlateWellValidator.QIACUBE); 32 32 if (tmp != null) qiacubePos = 6*tmp.getColumn()+tmp.getRow()+1; 33 operator = section.get RequiredEntry("Qiacube operator");33 operator = section.getOptionalEntry("Qiacube operator", null); 34 34 35 35 // TODO - qiacube run number -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/JsonFile.java
r6210 r6212 80 80 private final List<String> debugMessages; 81 81 82 private String operator; 83 82 84 private String rawData; 83 85 private JSONObject json; … … 203 205 204 206 /** 207 Override the "Operator" (and similar) information in the JSON file 208 with the value specified here. This can be called before 209 or after parsing the JSON file. 210 */ 211 public void setOperator(String operator) 212 { 213 this.operator = operator; 214 if (dnaInfo != null) dnaInfo.operator = operator; 215 if (rnaInfo != null) rnaInfo.operator = operator; 216 if (flowThroughInfo != null) flowThroughInfo.operator = operator; 217 if (libInfo != null) libInfo.operator = operator; 218 if (poolInfo != null) poolInfo.operator = operator; 219 if (flowCellInfo != null) flowCellInfo.operator = operator; 220 if (seqRunInfo != null) seqRunInfo.operator = operator; 221 } 222 223 /** 205 224 Download and parse the JSON file from the remote server. 206 225 */ … … 243 262 demuxInfo = new DemuxInfo(getRequiredSection("DemuxedSequences"), seqRunInfo, flowCellInfo); 244 263 mergeInfo = new MergeInfo(getRequiredSection("MergedSequences")); 264 265 if (operator != null) setOperator(operator); 245 266 } 246 267 catch (Exception ex) -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/JsonSection.java
r6201 r6212 87 87 88 88 /** 89 Get a required entry from the JSON file. 90 No other validation is performed. 89 Get an optional entry from the JSON file. A validator is 90 optional, but if a validator is given it will be called 91 also for null values. 91 92 */ 92 93 @SuppressWarnings("unchecked") 93 public <T > T getRequiredEntry(String key)94 public <T, F> T getOptionalEntry(String key, ValueValidator<F, T> validator) 94 95 { 95 T val = (T)json.get(key); 96 if (val == null) 96 Object val = json.get(key); 97 T result = null; 98 if (validator != null) 97 99 { 98 addErrorMessage("Missing entry in JSON: "+section+"."+key); 100 if (val != null && !validator.getExpectedClass().isInstance(val)) 101 { 102 addErrorMessage("Invalid entry in JSON: "+section+"."+key+"="+val+ 103 " (expected "+validator.getExpectedClass().getSimpleName()+", got " + val.getClass().getSimpleName()+")"); 104 } 105 else 106 { 107 try 108 { 109 result = validator.isValid(file.dc(), (F)val, this, section+"."+key); 110 } 111 catch (Exception ex) 112 { 113 addErrorMessage("Invalid entry in JSON: "+section+"."+key+"="+val+" ("+ex.getMessage()+")"); 114 } 115 } 99 116 } 100 return val; 117 else 118 { 119 result = (T)val; 120 } 121 return result; 101 122 } 102 123 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/LibraryInfo.java
r6206 r6212 67 67 libMolarity = section.getRequiredEntry("Library molarity", FloatValidator.POSITIVE); 68 68 qubitConc = section.getRequiredEntry("Qubit concentration (ng/ul)", FloatValidator.POSITIVE); 69 operator = section.get RequiredEntry("Operator");69 operator = section.getOptionalEntry("Operator", null); 70 70 71 71 barcode = section.getRequiredEntry("Barcode", BarcodeValidator.INSTANCE); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/PoolInfo.java
r6206 r6212 47 47 } 48 48 poolDate = section.getRequiredEntry("Date", DateValidator.YYYY_MM_DD.warnIfFutureOrOlder(365)); 49 operator = section.get RequiredEntry("Operator");49 operator = section.getOptionalEntry("Operator", null); 50 50 } 51 51 valid = section != null && !section.hasError(); -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/RnaInfo.java
r6207 r6212 33 33 PlateCoordinate tmp = section.getRequiredEntry("Qiacube position", PlateWellValidator.QIACUBE); 34 34 if (tmp != null) qiacubePos = 6*tmp.getColumn()+tmp.getRow()+1; 35 operator = section.get RequiredEntry("Qiacube operator");35 operator = section.getOptionalEntry("Qiacube operator", null); 36 36 37 37 // TODO - qiacube run number -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/cmd/SequencingRunInfo.java
r6206 r6212 51 51 startDate = section.getRequiredEntry("StartDate", DateValidator.YYMMDD.warnIfFutureOrOlder(365)); 52 52 endDate = section.getRequiredEntry("EndDate", DateValidator.YYMMDD_HH_MM_SS.warnIfFutureOrOlder(startDate)); 53 operator = section.get RequiredEntry("Operator");53 operator = section.getOptionalEntry("Operator", null); 54 54 if (flowCellInfo.flowCell != null) 55 55 { -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/FutureSpecimenServlet.java
r6211 r6212 47 47 import net.sf.basedb.reggie.plugins.FutureSpecimenImporter.ImportedItems; 48 48 import net.sf.basedb.reggie.plugins.cmd.JsonFile; 49 import net.sf.basedb.util.Values; 49 50 import net.sf.basedb.util.error.ThrowableUtil; 50 51 … … 196 197 JSONArray jsonItems = (JSONArray)jsonReq.get("items"); 197 198 JSONObject jsonAutoAnalyze = (JSONObject)jsonReq.get("autoAnalyze"); 199 String operator = Values.getStringOrNull((String)jsonReq.get("operator")); 198 200 199 201 OpenGridCluster cluster = null; … … 242 244 JsonFile jsonFile = new JsonFile(dc, (String)jsonItem.get("jsonFile")); 243 245 jsonFile.downloadAndParse(dc, gatewaySession, gatewayRoot); 246 if (operator != null) jsonFile.setOperator(operator); 244 247 245 248 Sample specimen = Sample.getById(dc, itemId.intValue()); … … 276 279 277 280 jsonMessages.addAll(prefix("[Warning]["+jsonFile.getName()+"] ", jsonFile.getWarningMessages())); 278 // 281 //jsonMessages.addAll(prefix("[Debug]["+jsonFile.getName()+"] ", jsonFile.getDebugMessages())); 279 282 } 280 283
Note: See TracChangeset
for help on using the changeset viewer.