extensions/net.sf.basedb.meludi/trunk/resources/libprep/add_consumables_lot_number_file.jsp

Code
Comments
Other
Rev Date Author Line
3538 13 Oct 15 olle 1 <%@ page
3538 13 Oct 15 olle 2   pageEncoding="UTF-8"
3538 13 Oct 15 olle 3   session="false"
3538 13 Oct 15 olle 4   import="net.sf.basedb.core.User"
3538 13 Oct 15 olle 5   import="net.sf.basedb.core.DbControl"
3538 13 Oct 15 olle 6   import="net.sf.basedb.core.SessionControl"
3538 13 Oct 15 olle 7   import="net.sf.basedb.core.Application"
3538 13 Oct 15 olle 8   import="net.sf.basedb.util.formatter.DateFormatter"
3538 13 Oct 15 olle 9   import="net.sf.basedb.util.formatter.Formatter"
3538 13 Oct 15 olle 10   import="net.sf.basedb.clients.web.Base"  
3538 13 Oct 15 olle 11   import="net.sf.basedb.clients.web.util.HTML"  
3538 13 Oct 15 olle 12   import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
3538 13 Oct 15 olle 13   import="java.util.Date"
3538 13 Oct 15 olle 14 %>
3538 13 Oct 15 olle 15 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
3538 13 Oct 15 olle 16 <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %>
3538 13 Oct 15 olle 17 <%
3538 13 Oct 15 olle 18 final SessionControl sc = Base.getExistingSessionControl(request, true);
3538 13 Oct 15 olle 19 final String ID = sc.getId();
3538 13 Oct 15 olle 20 final float scale = Base.getScale(sc);
3538 13 Oct 15 olle 21 final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.meludi");
3538 13 Oct 15 olle 22 DbControl dc = null;
3538 13 Oct 15 olle 23 try
3538 13 Oct 15 olle 24 {
3538 13 Oct 15 olle 25   dc = sc.newDbControl();
3538 13 Oct 15 olle 26   final User user = User.getById(dc, sc.getLoggedInUserId());
3538 13 Oct 15 olle 27   final Formatter dateFormat = new DateFormatter("yyyyMMdd");
3538 13 Oct 15 olle 28 %>
3538 13 Oct 15 olle 29 <base:page type="default" >
3538 13 Oct 15 olle 30 <base:head 
3538 13 Oct 15 olle 31   scripts="~../meludi-2.js,~add_consumables_lot_number_file.js,~../sampleproc/extraction_utils.js" 
3538 13 Oct 15 olle 32   styles="path.css,~../css/meludi-2.css"
3538 13 Oct 15 olle 33   >
3538 13 Oct 15 olle 34 <style>
3538 13 Oct 15 olle 35 tr.highlight
3538 13 Oct 15 olle 36 {
3538 13 Oct 15 olle 37   border-top-width: 1px;
3538 13 Oct 15 olle 38   border-top-style: dotted;
3538 13 Oct 15 olle 39 }
3538 13 Oct 15 olle 40
3538 13 Oct 15 olle 41 #detailsTable
3538 13 Oct 15 olle 42 {
3538 13 Oct 15 olle 43   width: 100%; 
3538 13 Oct 15 olle 44   border-collapse: collapse;
3538 13 Oct 15 olle 45   border-bottom-width: 1px;
3538 13 Oct 15 olle 46   border-top-width: 1px;
3538 13 Oct 15 olle 47 }
3538 13 Oct 15 olle 48
3538 13 Oct 15 olle 49 #detailsTable td, #detailsTable th
3538 13 Oct 15 olle 50 {
3538 13 Oct 15 olle 51   text-align: center;
3538 13 Oct 15 olle 52   min-width: 5%;
3538 13 Oct 15 olle 53   padding-top: 1px;
3538 13 Oct 15 olle 54   padding-bottom: 1px;
3538 13 Oct 15 olle 55 }
3538 13 Oct 15 olle 56
3538 13 Oct 15 olle 57 #detailsTable .comment
3538 13 Oct 15 olle 58 {
3538 13 Oct 15 olle 59   min-width: 10%;
3538 13 Oct 15 olle 60 }
3538 13 Oct 15 olle 61
3538 13 Oct 15 olle 62 #detailsTable .italic
3538 13 Oct 15 olle 63 {
3538 13 Oct 15 olle 64   font-style: italic;
3538 13 Oct 15 olle 65 }
3538 13 Oct 15 olle 66
3538 13 Oct 15 olle 67 .nondefault
3538 13 Oct 15 olle 68 {
3538 13 Oct 15 olle 69   background: #FFF066;
3538 13 Oct 15 olle 70 }
3538 13 Oct 15 olle 71 .nondefault:after
3538 13 Oct 15 olle 72 {
3538 13 Oct 15 olle 73   content: '›';
3538 13 Oct 15 olle 74 }
3538 13 Oct 15 olle 75 .nondefault:before
3538 13 Oct 15 olle 76 {
3538 13 Oct 15 olle 77   content: '‹';
3538 13 Oct 15 olle 78 }
3538 13 Oct 15 olle 79 span.status
3538 13 Oct 15 olle 80 {
3538 13 Oct 15 olle 81   width: 20px;
3538 13 Oct 15 olle 82   float: right;
3538 13 Oct 15 olle 83 }
3538 13 Oct 15 olle 84 </style>
3538 13 Oct 15 olle 85 </base:head>
3538 13 Oct 15 olle 86 <base:body>
3538 13 Oct 15 olle 87
3538 13 Oct 15 olle 88   <p:path><p:pathelement 
3538 13 Oct 15 olle 89     title="MeLuDi" href="<%="../index.jsp?ID="+ID%>" 
3538 13 Oct 15 olle 90     /><p:pathelement title="Add consumables lot number file" 
3538 13 Oct 15 olle 91     /></p:path>
3538 13 Oct 15 olle 92
3538 13 Oct 15 olle 93   <div class="content">
3538 13 Oct 15 olle 94
3538 13 Oct 15 olle 95 <!--
3538 13 Oct 15 olle 96   <form name="meludi" action="extraction_protocol2.jsp" method="post" target="_blank" id="wizard" class="wizard">
3538 13 Oct 15 olle 97 -->
3538 13 Oct 15 olle 98   <form name="meludi" id="wizard" class="wizard">
3538 13 Oct 15 olle 99     <input type="hidden" name="ID" value="<%=ID%>">
3538 13 Oct 15 olle 100     <input type="hidden" name="hiddenSubmitInfo" value="">
3538 13 Oct 15 olle 101 <!--
3538 13 Oct 15 olle 102     <input type="hidden" name="hiddenNumItems" value="">
3538 13 Oct 15 olle 103     <input type="hidden" name="hiddenCounterBalanceInfoRow" value="">
3538 13 Oct 15 olle 104 -->
3538 13 Oct 15 olle 105
3538 13 Oct 15 olle 106   <div class="step auto-hide" id="step-1">
3538 13 Oct 15 olle 107     <div class="step-no">1</div>
3538 13 Oct 15 olle 108     <div class="step-title">Select the consumables lot number file to process</div>
3538 13 Oct 15 olle 109     <div class="step-content">
3538 13 Oct 15 olle 110   
3538 13 Oct 15 olle 111       <div class="bg-filled-50" style="padding: 2px;">
3538 13 Oct 15 olle 112         A "Consumables lot number" file is a text file with rows of tab/comma/semicolon-separated values,<br>
3538 13 Oct 15 olle 113         where each row contains a specification key in first/second column, followed by data columns.<br>
3538 13 Oct 15 olle 114         The file is parsed, assuming known specification keys at the beginning of each row.<br>
3538 13 Oct 15 olle 115         <br>
3538 13 Oct 15 olle 116         The data is then presented in a table with specification keys in a header row, with data<br>
3538 13 Oct 15 olle 117         for each kit on a single row. (Basically, original rows/columns -> columns/rows.)<br>
3538 13 Oct 15 olle 118       </div>
3538 13 Oct 15 olle 119
3538 13 Oct 15 olle 120       <table class="step-form">
3538 13 Oct 15 olle 121       <tr class="align-top">
3538 13 Oct 15 olle 122         <td class="prompt">Consumables lot no. file</td>
3538 13 Oct 15 olle 123         <td class="input">
3870 22 Apr 16 olle 124           <input type="file" name="consumablesFile" id="consumablesFile" class="required" style="width: 95%;" accept=".csv,.tsv">
3538 13 Oct 15 olle 125         </td>
3538 13 Oct 15 olle 126         <td class="status" id="consumablesFile.status"></td>
3538 13 Oct 15 olle 127         <td class="help">
3538 13 Oct 15 olle 128           <span id="consumablesFile.message" class="message"></span>
3538 13 Oct 15 olle 129           Select a CSV file containing lot numbers for the reagents.
3538 13 Oct 15 olle 130         </td>
3538 13 Oct 15 olle 131       </tr>
3538 13 Oct 15 olle 132       <tr>
3546 16 Oct 15 olle 133         <td class="prompt">Expiration date</td>
3538 13 Oct 15 olle 134         <td class="input">
3546 16 Oct 15 olle 135           <input type="text" name="expirationDate" id="expirationDate"
3538 13 Oct 15 olle 136             value="<%=dateFormat.format(new Date()) %>" 
3538 13 Oct 15 olle 137             class="auto-init" data-auto-init="focus-on-enter" data-next-focus=""
3538 13 Oct 15 olle 138             style="width: 8em;" maxlength="10">
3538 13 Oct 15 olle 139             <base:icon 
3546 16 Oct 15 olle 140               id="expirationDateCalendar"
3538 13 Oct 15 olle 141               subclass="auto-init"
3538 13 Oct 15 olle 142               data-auto-init="calendar"
3546 16 Oct 15 olle 143               data-textarea-id="expirationDate"
3538 13 Oct 15 olle 144               data-date-format="yyyyMMdd"
3546 16 Oct 15 olle 145               data-title="Expiration date"
3538 13 Oct 15 olle 146               image="calendar.png" 
3538 13 Oct 15 olle 147               tooltip="Select a date from a calendar" 
3538 13 Oct 15 olle 148               tabindex="-1"
3538 13 Oct 15 olle 149             />
3538 13 Oct 15 olle 150         </td>
3546 16 Oct 15 olle 151         <td class="status" id="expirationDate.status"></td>
3538 13 Oct 15 olle 152         <td class="help">
3546 16 Oct 15 olle 153           <span id="expirationDate.message" class="message"></span>
3546 16 Oct 15 olle 154           (YYYYMMDD or MMDD) This date is also used in name of optional file to download
3538 13 Oct 15 olle 155         </td>
3538 13 Oct 15 olle 156       </tr>
3538 13 Oct 15 olle 157       </table>
3538 13 Oct 15 olle 158     </div>
3538 13 Oct 15 olle 159   </div>
3538 13 Oct 15 olle 160   
3538 13 Oct 15 olle 161   <!-- 2. Consumables lot number information -->
3538 13 Oct 15 olle 162   <div class="step" id="step-2">
3538 13 Oct 15 olle 163     <div class="step-no">2</div>
3538 13 Oct 15 olle 164     <div class="step-title">Consumables lot number details</div>
3538 13 Oct 15 olle 165     <div class="step-content">
3538 13 Oct 15 olle 166
3538 13 Oct 15 olle 167       <div class="bg-filled-50" id="detailsConsumablesFileName" style="padding: 2px;"></div>
3538 13 Oct 15 olle 168
3538 13 Oct 15 olle 169       <div id="detailsSection"></div>
3538 13 Oct 15 olle 170
3538 13 Oct 15 olle 171       <table class="step-form">
3538 13 Oct 15 olle 172       <tr>
3538 13 Oct 15 olle 173         <td class="prompt">Download reagent lot no. file</td>
3538 13 Oct 15 olle 174         <td class="input">
3538 13 Oct 15 olle 175           <base:button id="downloadReagentLotNoFile" title="Download..."
3538 13 Oct 15 olle 176             image="<%=home + "/images/download.png"%>" style="width:10em;" />
3538 13 Oct 15 olle 177         </td>
3538 13 Oct 15 olle 178         <td class="status" id="downloadReagentLotNoFile.status"></td>
3538 13 Oct 15 olle 179         <td class="help">
3538 13 Oct 15 olle 180           <span id="downloadReagentLotNoFile.message" class="message"></span>
3551 20 Oct 15 olle 181           Download file with current lot numbers for future import/reference, with one row per kit.
3538 13 Oct 15 olle 182         </td>
3538 13 Oct 15 olle 183       </tr>
3538 13 Oct 15 olle 184       </table>
3538 13 Oct 15 olle 185     </div>
3538 13 Oct 15 olle 186   </div>
3538 13 Oct 15 olle 187   
3538 13 Oct 15 olle 188   <div id="wizard-status"></div>
3538 13 Oct 15 olle 189   
3538 13 Oct 15 olle 190   <table class="navigation" id="navigation">
3538 13 Oct 15 olle 191   <tr>
3538 13 Oct 15 olle 192     <td><base:button id="gocancel" title="Cancel" /></td>
3538 13 Oct 15 olle 193     <td><base:button id="gonext" title="Next" image="<%=home+"/images/gonext.png"%>" /></td>
3538 13 Oct 15 olle 194     <td><base:button id="goregister" title="Register" image="<%=home+"/images/import.png"%>"  /></td>
3538 13 Oct 15 olle 195     <td><base:button id="gorestart" title="Restart" image="<%=home+"/images/goback.png"%>" /></td>
3538 13 Oct 15 olle 196 <!--
3538 13 Oct 15 olle 197     <td><base:button id="gocreate" title="Create library reagents report" image="<%=home+"/images/import.png"%>" /></td>
3538 13 Oct 15 olle 198 -->
3538 13 Oct 15 olle 199     <td id="gonext-message" class="message"></td>
3538 13 Oct 15 olle 200   </tr>
3538 13 Oct 15 olle 201   </table>
3538 13 Oct 15 olle 202   
3538 13 Oct 15 olle 203   </form>
3538 13 Oct 15 olle 204
3538 13 Oct 15 olle 205   </div>
3538 13 Oct 15 olle 206   
3538 13 Oct 15 olle 207 </base:body>
3538 13 Oct 15 olle 208 </base:page>
3538 13 Oct 15 olle 209 <%
3538 13 Oct 15 olle 210 }
3538 13 Oct 15 olle 211 finally
3538 13 Oct 15 olle 212 {
3538 13 Oct 15 olle 213   if (dc != null) dc.close();
3538 13 Oct 15 olle 214 }
3538 13 Oct 15 olle 215 %>