source: extensions/net.sf.basedb.reggie/trunk/resources/rnaqc_plate_export.jsp @ 1550

Last change on this file since 1550 was 1550, checked in by Nicklas Nordborg, 11 years ago

References #365: Export bioplate information to a file that can be used by the Caliper machine

Export HiSense? setting in the "User comment" field. Can be moved to be part of the name if that is better, but then the importer also need to be updated since the sample names in the Caliper output files are affected.

Otherwise, the exporter should now be fully working.

File size: 4.9 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  <%
28  if (Application.getMajorVersion() == 3 && Application.getMinorVersion() == 0)
29  {
30    %>
31    <link rel="stylesheet" type="text/css" href="css/base30.css">
32    <%
33  }
34  %>
35  <script language="JavaScript" src="reggie.js" type="text/javascript" charset="UTF-8"></script>
36 
37 
38<script language="JavaScript">
39var debug = false;
40var rnaQcBioPlates = null
41
42function init()
43{
44  var frm = document.forms['reggie'];
45
46  getActiveRnaQcBioPlates();
47  for (var i = 0; i < rnaQcBioPlates.length; i++)
48  {
49    var plate = rnaQcBioPlates[i];
50    if (plate.usedWells > 0)
51    {
52     
53      frm.bioPlates[frm.bioPlates.length] = new Option(plate.name + ' -- ' + plate.usedWells + ' used wells', plate.id);
54    }
55  }
56 
57  if (frm.bioPlates.length == 0)
58  {
59    var msg = 'Could not find any bioplates to export.';
60    setFatalError(msg);
61  }
62}
63
64
65function getActiveRnaQcBioPlates()
66{
67  var frm = document.forms['reggie'];
68 
69  var request = Ajax.getXmlHttpRequest();
70  var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=GetActiveRnaQcBioPlates&numFreeWells=0&bioPlateType=CALIPER_RNAQC';   
71  request.open("GET", url, false);
72  request.send(null);
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 
82  rnaQcBioPlates = response.plates;
83}
84
85
86function goExport()
87{
88  var frm = document.forms['reggie'];
89  var bioPlateId = frm.bioPlates[frm.bioPlates.selectedIndex].value;
90  var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=ExportSampleNamesForCaliper&bioPlateId='+bioPlateId;
91  window.location = url;
92}
93
94</script>
95
96
97</base:head>
98<base:body onload="init()">
99
100  <p:path><p:pathelement 
101    title="Reggie" href="<%="index.jsp?ID="+ID%>" 
102    /><p:pathelement title="RNA quality control - Export Caliper sample names" 
103    /></p:path>
104
105  <div class="content">
106  <%
107  if (sc.getActiveProjectId() == 0)
108  {
109    %>
110    <div class="messagecontainer note" style="width: 800px; margin-left: 20px; margin-bottom: 20px; margin-right: 0px; font-weight: bold; color: #cc0000;">
111      No project has been selected. You may proceed with the export but
112      you may not be able to see all items.
113    </div>
114    <%
115  }
116  %>
117
118  <form name="reggie" onsubmit="return false;">
119 
120  <!-- 1. Select bioplate -->
121  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
122  <tr>
123    <td rowspan="2" class="stepno">1</td>
124    <td class="steptitle">Select bioplate</td>
125  </tr>
126  <tr>
127    <td class="stepfields">
128      <table border="0" cellspacing="0" cellpadding="0" width="100%">
129      <tr valign="top">
130        <td class="prompt">Active bioplates</td>
131        <td class="input">
132          <select style="width:90%" name="bioPlates" id="bioPlates" onkeypress='doOnTab(event, goNextAuto)'></select>
133        </td>
134        <td class="status" id="bioplates.status"></td>
135        <td class="help"><span id="bioplates.message" class="message" style="display: none;"></span>
136          Select the bioplate to export sample names from.
137          <p>
138          The list contain RNAQC bioplates without quality score data (determined by
139          absence of QCRunDate annotation).
140          <p>
141          Tip! You can run the exporter for any bioplate as a regular plug-in by selecting
142          a bioplate from the list at <a 
143          href="<%=request.getContextPath()%>/biomaterials/bioplates/index.jsp?ID=<%=ID%>"
144          >Biomaterial LIMS › Bioplates</a> and then use the <b>Export</b> button.
145        </td>
146      </tr>
147      </table>
148    </td>
149  </tr>
150  </table>
151 
152 
153  <div class="messagecontainer error" id="errorMessage" style="display: none; width: 800px; margin-left: 20px; margin-bottom: 0px;"></div>
154 
155  <div id="done" class="success" style="display: none; width: 800px; margin-left: 20px; margin-top: 20px;"></div>
156 
157  <table style="margin-left: 20px; margin-top: 10px;" class="navigation">
158    <tr>
159      <td><base:button id="goexport" title="Export" image="<%=home+"/images/export.png"%>" onclick="goExport()"/></td>
160      <td id="gonext.message" class="message"></td>
161    </tr>
162  </table>
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.