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

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

added a fourth JSP page which will be used to let the user configure mappings from filenames to factor value combinations

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