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

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

had to add in ability for user to configure subject names and tissues against filenames and factors too - this implemented in UI now
also restructured code in writer class and test class

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="application" />
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" method="post">
121<input type="hidden" name="ID" value="<%=ID%>">
122<input type="hidden"name="requestId" value="<%=requestId%>"> 
123
124<h1>Tab2MAGE Importer -- Your Protocols</h1>
125Page 2 of 4
126<p>
127<table cellpadding="10">
128
129  <tr>
130    <td class="header">
131    <h3>Protocol name</h3>
132    </td>
133    <td class="header">
134    <h3>Protocol Text</h3>
135    <p>The full text of the protocol.
136    </td>
137    <td class="header">
138    <h3>Parameters</h3>
139    <p>A list of parameters for this protocol, separated by semicolons, in the format 'name(units)'.
140    Each parameter name must be unique within this form.<br /><br />
141    Leave blank if the protocol is unparameterized.</p>
142    </td>
143  </tr>
144
145  <tr>
146    <td class="boldText">Treatment</td>
147    <td class="input"><textarea rows="8" cols="35" name="treatmentProtocol">my treatment protocol text </textarea></td>
148    <td class="input_topaligned"><textarea rows="3" cols="35" name="treatmentProtocolParams">param1</textarea></td>
149  </tr>
150
151  <tr>
152    <td class="boldText">Extraction</td>
153    <td class="input"><textarea rows="8" cols="35" name="extractionProtocol"> my extraction protocol text  </textarea></td>
154    <td class="input_topaligned"><textarea rows="3" cols="35" name="extractionProtocolParams">param2</textarea></td>
155  </tr>
156
157  <tr>
158    <td class="boldText">Labeling</td>
159    <td class="input"><textarea rows="8" cols="35" name="labelingProtocol"> my labeling protocol text  </textarea></td>
160    <td class="input_topaligned"><textarea rows="3" cols="35" name="labelingProtocolParams">param3</textarea></td>
161  </tr>
162
163  <tr>
164    <td class="boldText">Hybridization</td>
165    <td class="input"><textarea rows="8" cols="35" name="hybridizationProtocol">my hybs protocol text   </textarea></td>
166    <td class="input_topaligned"><textarea rows="3" cols="35" name="hybridizationProtocolParams">param4</textarea></td>
167  </tr>
168
169  <tr>
170    <td class="boldText">Scanning</td>
171    <td class="input"><textarea rows="8" cols="35"name="scanningProtocol"> my scanning protocol text </textarea></td>
172    <td class="input_topaligned"><textarea rows="3" cols="35" name="scanningProtocolParams"> param5</textarea></td>
173  </tr>
174
175</table>
176
177<p>
178  <table align="center" class="noBorder" cellspacing="5"  cellpadding="5">
179  <tr class="noBorder">
180    <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>
181    <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>
182  </table>
183
184</form>
185
186</body>
187</html>
188
Note: See TracBrowser for help on using the repository browser.