source: branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/protocols.jsp @ 550

Last change on this file since 550 was 550, checked in by mbayer, 13 years ago

have restructured the code completely that writes the hybs section

File size: 6.8 KB
Line 
1<%@ page import="net.sf.basedb.core.*"%>
2<%@ page import="net.sf.basedb.clients.web.*"%>
3<%@ page import="net.sf.basedb.util.*"%>
4<%@ page import="java.util.*"%>
5<%@ page import="java.lang.*"%>
6
7<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
8<!-- submits the form data back to the bean assuming that each form element is matched to a variable in the bean by the same name -->
9<jsp:setProperty name="inputDataBean" property="*" />
10
11
12<html>
13
14<head>
15
16<link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
17<link rel="stylesheet" type="text/css" href="/base/include/styles/main.css">
18<link rel="stylesheet" type="text/css" href="/base/include/styles/size_m.css">
19
20<script language="JavaScript" type="text/javascript">
21  //submits form
22  function submit()
23  {
24    document.protocols.submit();
25  }
26</script>
27
28</head>
29
30<body>
31
32
33<%
34final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
35final String ID = sc.getId();
36final String requestId = request.getParameter("requestId");
37
38
39//here we also need to deal with the multiple select inputs from the previous page
40//their selected values need to be extracted from the request and concatenated into a single String
41
42//first deal with quality control input
43String[] items = request.getParameterValues("qualityControl");
44StringBuilder qualControl = new StringBuilder();
45for(int i = 0; i< items.length; i++)
46{
47    qualControl.append(items[i] );
48    //last one does not get a comma
49    if(i!=items.length-1)
50    {
51    qualControl.append(",");
52    }
53}
54//store this in the bean
55inputDataBean.setQualityControl(qualControl.toString());
56
57//next deal with the experiment design type
58//this is slightly more complex as we are dealing with six separate list boxes and we need to combine all their inputs
59StringBuilder experimentalDesign = new StringBuilder();
60
61String [] biologicalPropertyItems = request.getParameterValues("biologicalProperty");
62if(biologicalPropertyItems !=null)
63{
64  for(int i = 0; i< biologicalPropertyItems.length; i++)
65  {
66    experimentalDesign.append(biologicalPropertyItems[i] +",");
67  }
68}
69
70String [] bioMolecularAnnotationItems = request.getParameterValues("bioMolecularAnnotation");
71if(bioMolecularAnnotationItems !=null)
72{
73  for(int i = 0; i<bioMolecularAnnotationItems.length; i++)
74  {
75    experimentalDesign.append(bioMolecularAnnotationItems[i] +",");
76  }
77}
78
79String [] epidemiologicalDesignItems = request.getParameterValues("epidemiologicalDesign");
80if(epidemiologicalDesignItems !=null)
81{
82  for(int i = 0; i< epidemiologicalDesignItems.length; i++)
83  {
84    experimentalDesign.append(epidemiologicalDesignItems[i] +",");
85  }
86}
87
88String [] methodologicalDesignItems = request.getParameterValues("methodologicalDesign");
89if(methodologicalDesignItems !=null)
90{
91  for(int i = 0; i< methodologicalDesignItems.length; i++)
92  {
93    experimentalDesign.append(methodologicalDesignItems[i] +",");
94  }
95}
96
97String [] perturbationalDesignItems = request.getParameterValues("perturbationalDesign");
98if(perturbationalDesignItems !=null)
99{
100  for(int i = 0; i< perturbationalDesignItems.length; i++)
101  {
102    experimentalDesign.append(perturbationalDesignItems[i] +",");
103  }
104}
105
106String [] technologicalDesignItems = request.getParameterValues("technologicalDesign");
107if(technologicalDesignItems !=null)
108{
109  for(int i = 0; i< technologicalDesignItems.length; i++)
110  {
111    experimentalDesign.append(technologicalDesignItems[i]+",");
112  }
113}
114
115//store the combined String in the bean
116inputDataBean.setExperimentalDesign(experimentalDesign.toString());
117
118 %>
119
120<form name="protocols" action="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/hybridizations.jsp?ID=<%=ID%>" method="post">
121<input type="hidden" name="ID" value="<%=ID%>">
122<input type="hidden"name="requestId" value="<%=requestId%>"> 
123
124<h2>Tab2MAGE Import Wizard -- Your Protocols</h2>
125<p>
126<table cellpadding="10">
127
128  <tr>
129    <td class="header">
130    <h3>Protocol name</h3>
131    </td>
132    <td class="header">
133    <h3>Protocol Text</h3>
134    <p>The full text of the protocol.
135    </td>
136    <td class="header">
137    <h3>Parameters</h3>
138    <p>A list of parameters for this protocol, separated by semicolons, in the format 'name(units)'.
139    Each parameter name must be unique within this form.<br /><br />
140    Leave blank if the protocol is unparameterized.</p>
141    </td>
142  </tr>
143
144  <tr>
145    <td class="boldText">Treatment</td>
146    <td class="input"><textarea rows="8" cols="35" name="treatmentProtocol">treatment protocol text</textarea></td>
147    <td class="input_topaligned"><textarea rows="3" cols="35" name="treatmentProtocolParams">medium;CO2;antibiotics</textarea></td>
148  </tr>
149
150  <tr>
151    <td class="boldText">Extraction</td>
152    <td class="input"><textarea rows="8" cols="35" name="extractionProtocol">extraction protocol text</textarea></td>
153    <td class="input_topaligned"><textarea rows="3" cols="35" name="extractionProtocolParams"></textarea></td>
154  </tr>
155
156  <tr>
157    <td class="boldText">Labeling</td>
158    <td class="input"><textarea rows="8" cols="35" name="labelingProtocol">labeling protocol text  </textarea></td>
159    <td class="input_topaligned"><textarea rows="3" cols="35" name="labelingProtocolParams"></textarea></td>
160  </tr>
161
162  <tr>
163    <td class="boldText">Hybridization</td>
164    <td class="input"><textarea rows="8" cols="35" name="hybridizationProtocol">hybs protocol text   </textarea></td>
165    <td class="input_topaligned"><textarea rows="3" cols="35" name="hybridizationProtocolParams">temperature(degree_C) ; duration(hr)</textarea></td>
166  </tr>
167
168  <tr>
169    <td class="boldText">Scanning</td>
170    <td class="input"><textarea rows="8" cols="35"name="scanningProtocol">scanning protocol text </textarea></td>
171    <td class="input_topaligned"><textarea rows="3" cols="35" name="scanningProtocolParams"></textarea></td>
172  </tr>
173
174</table>
175
176<p>
177  <table align="center" class="noBorder" cellspacing="5"  cellpadding="5">
178  <tr class="noBorder">
179    <td id="next" width="50%" style="border-style: none;"><div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';" onclick="submit()"><div class="buttons_inner"><table  class="noBorder" cellspacing="0" cellpadding="0"><tr  class="noBorder"><td style="border-style: none;"><img src="/base/images/gonext.gif" border="0"></td><td style="border-style: none;">Next</td></tr></table></div></div></td>
180    <td id="close" width="50%" style="border-style: none;"><div class="buttons" onmouseover="this.className='buttons_hover';" onmouseout="this.className='buttons';" onclick="window.close()"><div class="buttons_inner"><table  class="noBorder" cellspacing="0" cellpadding="0"><tr  class="noBorder"><td style="border-style: none;"><img src="/base/images/cancel.gif" border="0"></td><td style="border-style: none;">Cancel</td></tr></table></div></div></td>  </tr>
181  </table>
182
183</form>
184
185</body>
186</html>
187
Note: See TracBrowser for help on using the repository browser.