1 | <%@ page |
---|
2 | pageEncoding="UTF-8" |
---|
3 | session="false" |
---|
4 | import="net.sf.basedb.core.User" |
---|
5 | import="net.sf.basedb.core.DbControl" |
---|
6 | import="net.sf.basedb.core.SessionControl" |
---|
7 | import="net.sf.basedb.core.Application" |
---|
8 | import="net.sf.basedb.clients.web.Base" |
---|
9 | import="net.sf.basedb.clients.web.extensions.ExtensionsControl" |
---|
10 | %> |
---|
11 | <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
---|
12 | <%@ taglib prefix="p" uri="/WEB-INF/path.tld" %> |
---|
13 | <% |
---|
14 | final SessionControl sc = Base.getExistingSessionControl(request, true); |
---|
15 | final String ID = sc.getId(); |
---|
16 | final float scale = Base.getScale(sc); |
---|
17 | final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie"); |
---|
18 | DbControl dc = null; |
---|
19 | try |
---|
20 | { |
---|
21 | dc = sc.newDbControl(); |
---|
22 | final User user = User.getById(dc, sc.getLoggedInUserId()); |
---|
23 | %> |
---|
24 | <base:page type="default" > |
---|
25 | <base:head scripts="ajax.js" styles="path.css"> |
---|
26 | <link rel="stylesheet" type="text/css" href="../css/reggie.css"> |
---|
27 | <script language="JavaScript" src="../reggie.js" type="text/javascript" charset="UTF-8"></script> |
---|
28 | |
---|
29 | <script language="JavaScript"> |
---|
30 | var debug = false; |
---|
31 | var currentStep = 1; |
---|
32 | |
---|
33 | function init() |
---|
34 | { |
---|
35 | var frm = document.forms['reggie']; |
---|
36 | var bioplates = getMRnaBioPlates(); |
---|
37 | |
---|
38 | var plates = frm.bioplate; |
---|
39 | if (bioplates != null && bioplates.length > 0) |
---|
40 | { |
---|
41 | for (var i=0; i < bioplates.length; i++) |
---|
42 | { |
---|
43 | var bioplate = bioplates[i]; |
---|
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); |
---|
50 | option.bioplate = bioplate; |
---|
51 | plates.options[plates.length] = option; |
---|
52 | } |
---|
53 | bioplateIsValid = true; |
---|
54 | Main.show('gocreate'); |
---|
55 | bioPlateOnChange(); |
---|
56 | loadStratageneConc(); |
---|
57 | } |
---|
58 | else |
---|
59 | { |
---|
60 | var msg = 'No mRNA bioplates available for processing.'; |
---|
61 | setFatalError(msg); |
---|
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; |
---|
79 | } |
---|
80 | |
---|
81 | function getMRnaBioPlates() |
---|
82 | { |
---|
83 | var frm = document.forms['reggie']; |
---|
84 | |
---|
85 | var request = Ajax.getXmlHttpRequest(); |
---|
86 | try |
---|
87 | { |
---|
88 | showLoadingAnimation('Loading histology work lists...'); |
---|
89 | var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedPlates&plateType=MRNA'; |
---|
90 | request.open("GET", url, false); |
---|
91 | request.send(null); |
---|
92 | } |
---|
93 | finally |
---|
94 | { |
---|
95 | hideLoadingAnimation(); |
---|
96 | } |
---|
97 | |
---|
98 | if (debug) Main.debug(request.responseText); |
---|
99 | var response = JSON.parse(request.responseText); |
---|
100 | if (response.status != 'ok') |
---|
101 | { |
---|
102 | setFatalError(response.message); |
---|
103 | return false; |
---|
104 | } |
---|
105 | return response.bioplates; |
---|
106 | } |
---|
107 | |
---|
108 | function viewProtocol(type) |
---|
109 | { |
---|
110 | saveStratageneConc(); |
---|
111 | |
---|
112 | var frm = document.forms['reggie']; |
---|
113 | if (frm.bioplate && !frm.bioplate.disabled) |
---|
114 | { |
---|
115 | frm.view.value = type; |
---|
116 | frm.submit(); |
---|
117 | } |
---|
118 | } |
---|
119 | |
---|
120 | function goExport(exporter) |
---|
121 | { |
---|
122 | var frm = document.forms['reggie']; |
---|
123 | if (frm.bioplate && !frm.bioplate.disabled) |
---|
124 | { |
---|
125 | alert('Not implemented'); |
---|
126 | } |
---|
127 | } |
---|
128 | |
---|
129 | function bioPlateOnChange() |
---|
130 | { |
---|
131 | var frm = document.forms['reggie']; |
---|
132 | var bioplate = frm.bioplate[frm.bioplate.selectedIndex].bioplate; |
---|
133 | setInnerHTML('comments', formatText(bioplate.comments)); |
---|
134 | frm.poolSchema.value = bioplate.poolSchema; |
---|
135 | } |
---|
136 | |
---|
137 | function saveStratageneConc() |
---|
138 | { |
---|
139 | if (!window.localStorage) return; |
---|
140 | |
---|
141 | var frm = document.forms['reggie']; |
---|
142 | var stratageneInfo = new Object(); |
---|
143 | stratageneInfo.conc = frm.stratageneConc.value; |
---|
144 | window.localStorage.setItem('reggie.stratagene-info', JSON.stringify(stratageneInfo)); |
---|
145 | } |
---|
146 | |
---|
147 | function loadStratageneConc() |
---|
148 | { |
---|
149 | if (!window.localStorage) return; |
---|
150 | var frm = document.forms['reggie']; |
---|
151 | |
---|
152 | var stratageneInfo = JSON.parse(window.localStorage.getItem('reggie.stratagene-info')); |
---|
153 | if (stratageneInfo) |
---|
154 | { |
---|
155 | frm.stratageneConc.value = stratageneInfo.conc; |
---|
156 | } |
---|
157 | } |
---|
158 | </script> |
---|
159 | |
---|
160 | </base:head> |
---|
161 | <base:body onload="init()"> |
---|
162 | |
---|
163 | <p:path><p:pathelement |
---|
164 | title="Reggie" href="<%="../index.jsp?ID="+ID%>" |
---|
165 | /><p:pathelement title="Lab protocols for mRNA and cDNA preparation" |
---|
166 | /></p:path> |
---|
167 | |
---|
168 | <div class="content"> |
---|
169 | <% |
---|
170 | if (sc.getActiveProjectId() == 0) |
---|
171 | { |
---|
172 | %> |
---|
173 | <div class="messagecontainer note" style="width: 950px; margin-left: 20px; margin-bottom: 20px; margin-right: 0px; font-weight: bold; color: #cc0000;"> |
---|
174 | No project has been selected. You may proceed with the registration but |
---|
175 | created items will not be shared. |
---|
176 | </div> |
---|
177 | <% |
---|
178 | } |
---|
179 | %> |
---|
180 | |
---|
181 | <form name="reggie" onsubmit="return false;" action="mrna_protocol2.jsp" method="post" target="_blank"> |
---|
182 | <input type="hidden" name="ID" value="<%=ID%>"> |
---|
183 | <input type="hidden" name="view" value="list"> |
---|
184 | <input type="hidden" name="poolSchema" value="5by24"> |
---|
185 | |
---|
186 | <table class="stepform"> |
---|
187 | <tr> |
---|
188 | <td rowspan="3" class="stepno">1</td> |
---|
189 | <td class="steptitle">Select mRNA bioplate</td> |
---|
190 | </tr> |
---|
191 | <tr> |
---|
192 | <td class="stepfields"> |
---|
193 | <table> |
---|
194 | <tr valign="top"> |
---|
195 | <td class="prompt">mRNA bioplate</td> |
---|
196 | <td class="input"><select style="width:90%" |
---|
197 | name="bioplate" id="bioplate" onchange="bioPlateOnChange()"></select> |
---|
198 | </td> |
---|
199 | <td class="status" id="bioplate.status"></td> |
---|
200 | <td class="help" rowspan="2"><span id="bioplate.message" class="message" style="display: none;"></span> |
---|
201 | Select an existing mRNA bioplate. The list contain all mRNA bioplates that |
---|
202 | has not yet been processed (determined by the absence of a 'creation' date). |
---|
203 | </td> |
---|
204 | </tr> |
---|
205 | <tr valign="top"> |
---|
206 | <td class="subprompt">-comments</td> |
---|
207 | <td class="input" id="comments" style="font-style: italic; background: #E8E8E8; padding: 2px 5px 2px 5px;"></td> |
---|
208 | <td class="status" id="comments.status"></td> |
---|
209 | </tr> |
---|
210 | <tr valign="top"> |
---|
211 | <td class="prompt">Stratagene conc.</td> |
---|
212 | <td class="input"> |
---|
213 | <input type="text" name="stratageneConc" |
---|
214 | style="width: 10em;" maxlength="8" |
---|
215 | onkeypress="return Numbers.numberOnly(event)" |
---|
216 | > (ng/µl) |
---|
217 | </td> |
---|
218 | <td class="status" id="stratagene.status"></td> |
---|
219 | <td class="help"><span id="stratagene.message" class="message" style="display: none;"></span> |
---|
220 | If the current Stratagene concentration is given, the wizard will calculate volumes |
---|
221 | to use automatically. |
---|
222 | </td> |
---|
223 | </tr> |
---|
224 | <tr valign="top"> |
---|
225 | <td class="prompt">Lab protocols</td> |
---|
226 | <td class="input" id="protocol" style="white-space: nowrap; line-height: 1.5em;"> |
---|
227 | <span class="link" onclick="viewProtocol('list')"><img src="../images/listview.png"> List layout</span><br> |
---|
228 | <span class="link" onclick="viewProtocol('plate')"><img src="../images/plateview.png"> Plate layout</span><br> |
---|
229 | </td> |
---|
230 | <td class="status" id="protocol.status"></td> |
---|
231 | <td class="help"><span id="protocol.message" class="message" style="display: none;"></span> |
---|
232 | The 'list layout' generates a table with one row for each well on the work plate. |
---|
233 | The 'plate layout' generates a grid with wells arranged according to row and column coordinates. |
---|
234 | </td> |
---|
235 | </tr> |
---|
236 | </table> |
---|
237 | </td> |
---|
238 | </tr> |
---|
239 | </table> |
---|
240 | |
---|
241 | <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> |
---|
242 | |
---|
243 | <div class="messagecontainer error" id="errorMessage" style="display: none; width: 950px; margin-left: 20px; margin-bottom: 0px;"></div> |
---|
244 | |
---|
245 | <div id="done" class="success" style="display: none; width: 950px; margin-left: 20px; margin-top: 20px;"></div> |
---|
246 | |
---|
247 | </form> |
---|
248 | </div> |
---|
249 | |
---|
250 | </base:body> |
---|
251 | </base:page> |
---|
252 | <% |
---|
253 | } |
---|
254 | finally |
---|
255 | { |
---|
256 | if (dc != null) dc.close(); |
---|
257 | } |
---|
258 | %> |
---|