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

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

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

Should have been included as part of [1544].

File size: 4.7 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 = true;
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 url = getRoot() + 'biomaterials/bioplates/index.jsp?ID=<%=ID%>';
60    var msg = 'Could not find any bioplates to export.';
61    msg += 'Tip! You can run the exporter for any bioplate from the regular bioplate view under';
62    msg += ' <a href="'+url+'">Biomaterial LIMS › Bioplates</a>.';
63    setFatalError(msg);
64  }
65
66}
67
68
69function getActiveRnaQcBioPlates()
70{
71  var frm = document.forms['reggie'];
72 
73  var request = Ajax.getXmlHttpRequest();
74  var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=GetActiveRnaQcBioPlates&numFreeWells=0&bioPlateType=CALIPER_RNAQC';   
75  request.open("GET", url, false);
76  request.send(null);
77
78  if (debug) Main.debug(request.responseText);
79  var response = JSON.parse(request.responseText); 
80  if (response.status != 'ok')
81  {
82    setFatalError(response.message);
83    return false;
84  }
85 
86  rnaQcBioPlates = response.plates;
87 
88}
89
90
91function goExport()
92{
93  var frm = document.forms['reggie'];
94  var bioPlateId = frm.bioPlates[frm.bioPlates.selectedIndex].value;
95  var url = 'RnaQc.servlet?ID=<%=ID%>&cmd=ExportSampleNamesForCaliper&bioPlateId='+bioPlateId;
96  window.location = url;
97}
98
99</script>
100
101
102</base:head>
103<base:body onload="init()">
104
105  <p:path><p:pathelement 
106    title="Reggie" href="<%="index.jsp?ID="+ID%>" 
107    /><p:pathelement title="RNA quality control - Export Caliper sample names" 
108    /></p:path>
109
110  <div class="content">
111  <%
112  if (sc.getActiveProjectId() == 0)
113  {
114    %>
115    <div class="messagecontainer note" style="width: 800px; margin-left: 20px; margin-bottom: 20px; margin-right: 0px; font-weight: bold; color: #cc0000;">
116      No project has been selected. You may proceed with the export but
117      you may not be able to see all items.
118    </div>
119    <%
120  }
121  %>
122
123  <form name="reggie" onsubmit="return false;">
124 
125  <!-- 1. Select bioplate -->
126  <table border="0" cellspacing="0" cellpadding="0" class="stepform">
127  <tr>
128    <td rowspan="2" class="stepno">1</td>
129    <td class="steptitle">Select bioplate</td>
130  </tr>
131  <tr>
132    <td class="stepfields">
133      <table border="0" cellspacing="0" cellpadding="0" width="100%">
134      <tr valign="top">
135        <td class="prompt">Active bioplates</td>
136        <td class="input">
137          <select style="width:90%" name="bioPlates" id="bioPlates" onkeypress='doOnTab(event, goNextAuto)'></select>
138        </td>
139        <td class="status" id="bioplates.status"></td>
140        <td class="help"><span id="bioplates.message" class="message" style="display: none;"></span>
141          Select the bioplate to export sample names from.
142        </td>
143      </tr>
144      </table>
145    </td>
146  </tr>
147  </table>
148 
149 
150  <div class="messagecontainer error" id="errorMessage" style="display: none; width: 800px; margin-left: 20px; margin-bottom: 0px;"></div>
151 
152  <div id="done" class="success" style="display: none; width: 800px; margin-left: 20px; margin-top: 20px;"></div>
153 
154  <table style="margin-left: 20px; margin-top: 10px;" class="navigation">
155    <tr>
156      <td><base:button id="goexport" title="Export" image="<%=home+"/images/export.png"%>" onclick="goExport()"/></td>
157      <td id="gonext.message" class="message"></td>
158    </tr>
159  </table>
160  </form>
161  </div>
162 
163</base:body>
164</base:page>
165<%
166}
167finally
168{
169  if (dc != null) dc.close();
170}
171%>
Note: See TracBrowser for help on using the repository browser.