source: branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp @ 527

Last change on this file since 527 was 527, checked in by mbayer, 14 years ago

have added a cartesian product algorithm that compute

File size: 7.1 KB
Line 
1<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2  pageEncoding="ISO-8859-1"%>
3<%@ page import="java.util.*"%>
4<%@ page import="net.sf.basedb.core.*"%>
5<%@ page import="net.sf.basedb.clients.web.*"%>
6<%@ page import="net.sf.basedb.util.*"%>
7<%@ page import="uk.ac.ebi.nugo.plugins.*"%>
8
9<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean"
10  scope="application" />
11<!-- 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 -->
12<jsp:setProperty name="inputDataBean" property="*" />
13
14<%
15  final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
16  final String ID = sc.getId();
17  final String requestID = request.getParameter("requestId");
18%>
19
20<html>
21
22<head>
23
24<link rel="stylesheet" type="text/css"
25  href="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/styles.css" />
26<link rel="stylesheet" type="text/css"
27  href="/base/include/styles/main.css">
28<link rel="stylesheet" type="text/css"
29  href="/base/include/styles/size_m.css">
30
31<script language="JavaScript"
32  src="<%= request.getContextPath()%>/include/scripts/main.js"
33  type="text/javascript"></script>
34<script language="JavaScript" type="text/javascript">
35  //submits form
36  function submit()
37  {
38    document.mappings.submit();
39  }
40    function getRoot()
41    {
42      return '/base/';
43    }
44    function getScale()
45    {
46      return 1.0;
47    }
48</script>
49
50</head>
51
52<body>
53
54<%
55  //first extract the factor names and the possible values
56  String expFactors = inputDataBean.getExpFactors();
57  String[] rawFactors = expFactors.split("\n");
58
59  String[][] factorValues = new String[rawFactors.length][];
60  String[] factorNames = new String[rawFactors.length];
61
62  for (int i = 0; i < rawFactors.length; i++)
63  {
64    //extract the factor name
65    String factorName = rawFactors[i].substring(0, rawFactors[i].indexOf("("));
66    factorNames[i] = factorName;
67    //extract the possible values from between the parentheses
68    String allValues = rawFactors[i].substring(rawFactors[i].indexOf("(") + 1, rawFactors[i].indexOf(")"));
69    String[] values = allValues.split(",");
70    factorValues[i] = values;
71  }
72
73  String[][] products = CartesianProduct.getCartesianProduct(factorValues);
74%>
75
76<form name="mappings"
77  action="<%= request.getContextPath()%>/plugins/uk/ac/ebi/nugo/plugins/mappings.jsp"
78  method="post"><input type="hidden" name="ID" value="<%=ID%>">
79<input type="hidden" name="cmd" value="SetParameters"> <input
80  type="hidden" name="requestID" value="<%=requestID%>"> <!-- these are the parameters from the input pages; need to pick them up individually from the bean here; ugly as hell but can't be done any other way -->
81
82<!-- inputs from experiment.jsp page --> <input type="hidden"
83  name="parameter:domain" value="<%=inputDataBean.getDomain()%>">
84<input type="hidden" name="parameter:accession"
85  value="<%=inputDataBean.getAccession()%>"> <input type="hidden"
86  name="parameter:qualityControl"
87  value="<%=inputDataBean.getQualityControl()%>"> <input
88  type="hidden" name="parameter:experimentalDesign"
89  value="<%=inputDataBean.getExperimentalDesign()%>"> <input
90  type="hidden" name="parameter:experimentName"
91  value="<%=inputDataBean.getExperimentName()%>"> <input
92  type="hidden" name="parameter:description"
93  value="<%=inputDataBean.getDescription()%>"> <input
94  type="hidden" name="parameter:releaseDate"
95  value="<%=inputDataBean.getReleaseDate()%>"> <input
96  type="hidden" name="parameter:submissionDate"
97  value="<%=inputDataBean.getSubmissionDate()%>"> <input
98  type="hidden" name="parameter:submitter"
99  value="<%=inputDataBean.getSubmitter()%>"> <input type="hidden"
100  name="parameter:organization"
101  value="<%=inputDataBean.getOrganization()%>"> <input
102  type="hidden" name="parameter:publicationTitle"
103  value="<%=inputDataBean.getPublicationTitle()%>"> <input
104  type="hidden" name="parameter:authors"
105  value="<%=inputDataBean.getAuthors()%>"> <input type="hidden"
106  name="parameter:journal" value="<%=inputDataBean.getJournal()%>">
107<input type="hidden" name="parameter:volume"
108  value="<%=inputDataBean.getVolume()%>"> <input type="hidden"
109  name="parameter:issue" value="<%=inputDataBean.getIssue()%>"> <input
110  type="hidden" name="parameter:pages"
111  value="<%=inputDataBean.getPages()%>"> <input type="hidden"
112  name="parameter:year" value="<%=inputDataBean.getYear()%>"> <input
113  type="hidden" name="parameter:pubmedId"
114  value="<%=inputDataBean.getPubmedId()%>"> <input type="hidden"
115  name="parameter:experimentId"
116  value="<%=inputDataBean.getExperimentId()%>"> <!-- inputs from protocols.jsp page -->
117<input type="hidden" name="parameter:treatmentProtocol"
118  value="<%=inputDataBean.getTreatmentProtocol()%>"> <input
119  type="hidden" name="parameter:extractionProtocol"
120  value="<%=inputDataBean.getExtractionProtocol()%>"> <input
121  type="hidden" name="parameter:labelingProtocol"
122  value="<%=inputDataBean.getLabelingProtocol()%>"> <input
123  type="hidden" name="parameter:hybridizationProtocol"
124  value="<%=inputDataBean.getHybridizationProtocol()%>"> <input
125  type="hidden" name="parameter:scanningProtocol"
126  value="<%=inputDataBean.getScanningProtocol()%>"> <input
127  type="hidden" name="parameter:treatmentProtocolParams"
128  value="<%=inputDataBean.getTreatmentProtocolParams()%>"> <input
129  type="hidden" name="parameter:extractionProtocolParams"
130  value="<%=inputDataBean.getExtractionProtocolParams()%>"> <input
131  type="hidden" name="parameter:labelingProtocolParams"
132  value="<%=inputDataBean.getLabelingProtocolParams()%>"> <input
133  type="hidden" name="parameter:hybridizationProtocolParams"
134  value="<%=inputDataBean.getHybridizationProtocolParams()%>"> <input
135  type="hidden" name="parameter:scanningProtocolParams"
136  value="<%=inputDataBean.getScanningProtocolParams()%>"> <!-- inputs from hybridizations.jsp page -->
137<input type="hidden" name="parameter:platform"
138  value="<%=inputDataBean.getPlatform()%>"> <input type="hidden"
139  name="parameter:organism" value="<%=inputDataBean.getOrganism()%>">
140<input type="hidden" name="parameter:numDesigns"
141  value="<%=inputDataBean.getNumDesigns()%>"> <input
142  type="hidden" name="parameter:dyeSwap"
143  value="<%=inputDataBean.getDyeSwap()%>"> <input type="hidden"
144  name="parameter:refSample" value="<%=inputDataBean.getRefSample()%>">
145<input type="hidden" name="parameter:numTreatmentGroups"
146  value="<%=inputDataBean.getNumTreatmentGroups()%>"> <input
147  type="hidden" name="parameter:expFactors"
148  value="<%=inputDataBean.getExpFactors()%>"> <input
149  type="hidden" name="parameter:numReplicates"
150  value="<%=inputDataBean.getNumReplicates()%>"> <input
151  type="hidden" name="parameter:tissues"
152  value="<%=inputDataBean.getTissues()%>"> <input type="hidden"
153  name="parameter:pooling" value="<%=inputDataBean.getPooling()%>">
154
155<input type="hidden" name="file_id"
156  value="<%=(String)request.getAttribute("file_id") %>"> <input
157  type="hidden" name="parameter:zipFile"
158  value="<%=(String)request.getAttribute("path") %>" id="zipFile">
159
160<table>
161
162
163  <%
164    for (int i = 0; i < products.length; i++)
165    {
166  %>
167
168  <tr>
169
170    <%
171        for (int j = 0; j < products[i].length; j++)
172        {
173    %>
174    <td><%=products[i][j]%></td>
175    <%
176    }
177    %>
178
179
180  </tr>
181
182  <%
183  }
184  %>
185
186</table>
187</body>
188</html>
Note: See TracBrowser for help on using the repository browser.