source: extensions/net.sf.basedb.reggie/branches/ticket-422/resources/libprep/mrna_protocol.jsp @ 1745

Last change on this file since 1745 was 1745, checked in by Nicklas Nordborg, 10 years ago

References #425: Generate a lab protocol for RNA -> cDNA processing

Two variants of the protocol can be created. One with a list layout and aone with a plate layout.

File size: 5.1 KB
Line 
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<%
14final SessionControl sc = Base.getExistingSessionControl(request, true);
15final String ID = sc.getId();
16final float scale = Base.getScale(sc);
17final String home = ExtensionsControl.getHomeUrl("net.sf.basedb.reggie");
18DbControl dc = null;
19try
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">
30var debug = true;
31var currentStep = 1;
32
33function 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 option = new Option(bioplate.name, bioplate.id);
45      plates.options[plates.length] = option;
46    }
47    bioplateIsValid = true;
48    Main.show('gocreate');
49  }
50  else
51  {
52    var msg = 'No mRNA bioplates available for processing.';
53    setFatalError(msg);
54  }
55}
56
57function getMRnaBioPlates()
58{
59  var frm = document.forms['reggie']; 
60 
61  var request = Ajax.getXmlHttpRequest();
62  try
63  {
64    showLoadingAnimation('Loading histology work lists...');
65    var url = '../MRna.servlet?ID=<%=ID%>&cmd=GetUnprocessedMRnaPlates';   
66    request.open("GET", url, false); 
67    request.send(null);
68  }
69  finally
70  {
71    hideLoadingAnimation();
72  }
73 
74  if (debug) Main.debug(request.responseText);
75  var response = JSON.parse(request.responseText); 
76  if (response.status != 'ok')
77  {
78    setFatalError(response.message);
79    return false;
80  }
81  return response.bioplates;
82}
83
84function viewProtocol(type)
85{
86  var frm = document.forms['reggie'];
87  if (frm.bioplate && !frm.bioplate.disabled)
88  {
89    frm.view.value = type;
90    frm.submit();
91   
92  }
93}
94</script>
95
96</base:head>
97<base:body onload="init()">
98
99  <p:path><p:pathelement 
100    title="Reggie" href="<%="../index.jsp?ID="+ID%>" 
101    /><p:pathelement title="Lab tracking protocol for mRNA and cDNA preparation" 
102    /></p:path>
103
104  <div class="content">
105  <%
106  if (sc.getActiveProjectId() == 0)
107  {
108    %>
109    <div class="messagecontainer note" style="width: 950px; margin-left: 20px; margin-bottom: 20px; margin-right: 0px; font-weight: bold; color: #cc0000;">
110      No project has been selected. You may proceed with the registration but
111      created items will not be shared.
112    </div>
113    <%
114  }
115  %>
116
117  <form name="reggie" onsubmit="return false;" action="mrna_protocol2.jsp" method="post" target="_new">
118  <input type="hidden" name="ID" value="<%=ID%>">
119  <input type="hidden" name="view" value="list">
120 
121  <table class="stepform">
122  <tr>
123    <td rowspan="3" class="stepno">1</td>
124    <td class="steptitle">Select mRNA bioplate</td>
125  </tr>
126  <tr>
127    <td class="stepfields">
128      <table>
129      <tr valign="top">
130        <td class="prompt">mRNA bioplate</td>
131        <td class="input"><select style="width:90%" 
132            name="bioplate" id="bioplate"></select>
133        </td>
134        <td class="status" id="bioplate.status"></td>
135        <td class="help"><span id="bioplate.message" class="message" style="display: none;"></span>
136          Select an existing mRNA bioplate. The list contain all mRNA bioplates that
137          has not yet been processed (determined by the absence of a 'creation' date).
138        </td>
139      </tr>
140      <tr valign="top">
141        <td class="prompt">Create protocol</td>
142        <td class="input" id="protocol" style="white-space: nowrap; line-height: 1.5em;">
143          <span class="link" onclick="viewProtocol('list')"><img src="../images/listview.png">&nbsp;List layout</span><br>
144          <span class="link" onclick="viewProtocol('plate')"><img src="../images/plateview.png">&nbsp;Plate layout</span><br>
145        </td>
146        <td class="status" id="protocol.status"></td>
147        <td class="help"><span id="protocol.message" class="message" style="display: none;"></span>
148          The 'list layout' generates a table with one row for each well on the work plate.
149          The 'plate layout' generates a grid with wells arranged according to row and column coordinates.
150        </td>
151      </tr>
152      </table>
153    </td>
154  </tr>
155  </table>
156 
157  <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>
158 
159  <div class="messagecontainer error" id="errorMessage" style="display: none; width: 950px; margin-left: 20px; margin-bottom: 0px;"></div>
160 
161  <div id="done" class="success" style="display: none; width: 950px; margin-left: 20px; margin-top: 20px;"></div>
162 
163  </form>
164  </div>
165 
166</base:body>
167</base:page>
168<%
169}
170finally
171{
172  if (dc != null) dc.close();
173}
174%>
Note: See TracBrowser for help on using the repository browser.