Ignore:
Timestamp:
Jan 10, 2008, 6:18:12 PM (13 years ago)
Author:
mbayer
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uk_ac_ebi_Tab2MageImporter/jsp/uk/ac/ebi/nugo/plugins/mappings.jsp

    r530 r531  
    77<%@ page import="uk.ac.ebi.nugo.plugins.*"%>
    88
    9 <jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="session" />
     9<jsp:useBean id="inputDataBean" class="uk.ac.ebi.nugo.plugins.DataBean" scope="application" />
    1010<!-- 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 -->
    1111<jsp:setProperty name="inputDataBean" property="*" />
     
    5151function gatherValues()
    5252{
    53   var fileString = '';
     53  var fileList = '';
     54  var subjectList = '';
     55  var tissueList = '';
    5456  var frm = document.forms['mappings'];
    5557  var numElements = frm.elements.length;
    56   //document.write(numElements);
    57   //document.write("<br />");
    5858  for(var i = 0; i < numElements; i++)
    5959  {
    6060    var value = frm.elements[i].value;
    6161    var id = frm.elements[i].id;
    62 
    63     if(id.match("fileinput"))
     62    if(id.match("fileInput"))
    6463    {
    65       //document.write("id = " + id);
    66       //document.write("<br />");
    67       //document.write("value = " + value);
    68       //document.write("<br />");
    69       fileString += frm.elements[i].value + '\t';
    70     }
    71   }
    72   //document.write('combined output = ' + fileString);
    73   frm.fileStringParam.value = fileString;
    74   //document.write('value of hidden input = ' + frm.fileStringParam.value);
     64      fileList += frm.elements[i].value + '\t';
     65    }
     66    if(id.match("subjectInput"))
     67    {
     68      subjectList += frm.elements[i].value + '\t';
     69    }
     70    if(id.match("tissueInput"))
     71    {
     72      tissueList += frm.elements[i].value + '\t';
     73    }
     74  }
     75  frm.fileList.value = fileList;
     76  frm.subjectList.value = subjectList;
     77  frm.tissueList.value = tissueList;
    7578}
    7679
     
    8891<input type="hidden" name="cmd" value="SetParameters">
    8992<input type="hidden" name="requestId" value="<%=requestId%>">
    90 <input type="hidden" id="fileStringParam" name="parameter:fileStringParam" value""/>
     93<input type="hidden" id="fileList" name="parameter:fileList" value""/>
     94<input type="hidden" id="subjectList" name="parameter:subjectList" value""/>
     95<input type="hidden" id="tissueList" name="parameter:tissueList" value""/>
    9196
    9297<!-- these are the parameters from the previous input pages; need to pick them up individually from the bean here; ugly as hell but can't be done any other way -->
     
    135140<input type="hidden" name="parameter:pooling" value="<%=inputDataBean.getPooling()%>">
    136141<input type="hidden" name="parameter:zipFile" value="<%=request.getParameter("path") %>" id="zipFile">
     142<input type="hidden" name="parameter:subjectNames" value="<%=inputDataBean.getSubjectNames()%>">
     143
    137144
    138145<%
     
    194201 
    195202  dc.close();
     203 
     204  //next get the subjectNames and make up select boxes with these
     205  //they too have to be mapped to filenames
     206  String [] subjectNames = request.getParameter("subjectNames").split("\n");
     207 
     208  //we also need to parse out the tissues string to produce another column of select boxes
     209  String [] tissueNames = request.getParameter("tissues").split("\n");
    196210%>
    197211
     
    201215
    202216The table below holds a list of all possible factor value combinations used in your experiment.
    203 Please select, for each combination, the appropriate file name from the drop down menu.</p><p>
     217Please select, for each combination, the appropriate file, subject and tissue from the drop down menu.</p><p>
    204218
    205219<!-- this table holds the combinations of factor values -->
     
    213227    <!-- file selector header -->
    214228    <td class="header"><h3>File</h3></td>
     229    <td class="header"><h3>Subject</h3></td>
     230    <td class="header"><h3>Tissue</h3></td>
    215231
    216232    <!-- factor names -->
     
    236252    <!-- first we need a cell with a drop down menu where we can select a filename to match the combination of factor values-->
    237253
    238     <td class="input" ><select id="fileinput<%=i %>">
     254    <td class="input" ><select id="fileInput<%=i %>">
    239255      <%
    240256          for (int k = 0; k < fileNamesArr.length; k++)
     
    243259
    244260      <option><%=fileNamesArr[k]%></option>
     261
     262      <%
     263      }
     264      %>
     265    </select></td>
     266   
     267    <!-- next  we need a cell with a drop down menu where we can select a subject name to match the combination of factor values-->
     268
     269    <td class="input" ><select id="subjectInput<%=i %>">
     270      <%
     271          for (int k = 0; k < subjectNames.length; k++)
     272          {
     273      %>
     274
     275      <option><%=subjectNames[k]%></option>
     276
     277      <%
     278      }
     279      %>
     280    </select></td>
     281   
     282    <!-- next  we need a cell with a drop down menu where we can select a tissue name to match the combination of factor values-->
     283
     284    <td class="input" ><select id="tissueInput<%=i %>">
     285      <%
     286          for (int k = 0; k < tissueNames.length; k++)
     287          {
     288      %>
     289
     290      <option><%=tissueNames[k]%></option>
    245291
    246292      <%
Note: See TracChangeset for help on using the changeset viewer.