source: extensions/net.sf.basedb.genepattern/trunk/resources/visualizer_parameters.jsp @ 1134

Last change on this file since 1134 was 1134, checked in by Nicklas Nordborg, 12 years ago

References #234: Proof-of-concept: run a selected GenePattern? visualization module from BASE

The process is now a bit more generic. In theory it should be possible to run any visualizer module. Got rid of hard-coded urls to servers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.4 KB
Line 
1<%-- $Id: visualizer_parameters.jsp 1134 2009-06-22 12:00:26Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2009 Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 2
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA  02111-1307, USA.
22  ------------------------------------------------------------------
23
24  @author Nicklas
25--%>
26<%@ page
27  pageEncoding="UTF-8"
28  session="false"
29  import="net.sf.basedb.core.SessionControl"
30  import="net.sf.basedb.core.PluginParameter"
31  import="net.sf.basedb.core.ParameterType"
32  import="net.sf.basedb.core.FileParameterType"
33  import="net.sf.basedb.util.Enumeration"
34  import="net.sf.basedb.clients.web.Base"
35  import="net.sf.basedb.clients.web.util.HTML"
36  import="java.util.List"
37%>
38<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
39<%
40final SessionControl sc = Base.getExistingSessionControl(request, true);
41final String ID = sc.getId();
42
43final List<PluginParameter> moduleParameters = 
44  (List<PluginParameter>)request.getAttribute("moduleParameters");
45final String module = request.getParameter("module");
46final String server = request.getParameter("server");
47%>
48<base:page type="popup" title="<%=HTML.encodeTags(module)%>">
49<base:head>
50<script language="JavaScript">
51  var lastFileInputName;
52  function browseOnClick(inputName)
53  {
54    var frm = document.forms['visualizer'];
55    var url = getRoot() + 'filemanager/index.jsp?ID=<%=ID%>&cmd=SelectOne&callback=setFileCallback';
56    lastFileInputName = inputName;
57    Main.openPopup(url, 'SelectFile', 1000, 700);
58  }
59  function setFileCallback(fileId, path, inputName)
60  {
61    var frm = document.forms['visualizer'];
62    if (!inputName) inputName = lastFileInputName;
63    frm[inputName].value = path;
64  }
65  function doVisualize()
66  {
67    var frm = document.forms['visualizer'];
68    frm.submit();
69  }
70</script>
71</base:head>
72<base:body>
73
74  <form action="Visualizer.servlet" method="post" name="visualizer">
75  <input type="hidden" name="ID" value="<%=ID%>">
76  <input type="hidden" name="cmd" value="RunVisualizerApplet">
77  <input type="hidden" name="server" value="<%=server%>">
78  <input type="hidden" name="module" value="<%=module%>">
79
80  <h3 class="docked"><%=HTML.encodeTags(module)%></h3>
81  <div class="boxedbottom">
82  <table class="form">
83  <%
84  for (PluginParameter pp : moduleParameters)
85  {
86    ParameterType pType = pp.getParameterType();
87    String pName = pp.getName();
88    boolean required = pType.getNotNull();
89    Object defaultValue = pp.getDefaultValue();
90    if (defaultValue == null) defaultValue = "";
91    %>
92    <tr>
93      <td class="prompt"><%=HTML.encodeTags(pp.getLabel())%></td>
94      <td>
95      <%
96      if (pType.isEnumeration())
97      {
98        Enumeration<String, String> options = pType.getEnumeration();
99        %>
100        <select name="<%=pName%>" title="<%=HTML.encodeTags(pp.getDescription())%>">
101        <%
102        for (int i = 0; i < options.size(); ++i)
103        {
104          %>
105          <option value="<%=HTML.encodeTags(options.getKey(i))%>"><%=HTML.encodeTags(options.getValue(i))%>
106          <%
107        }
108        %>
109        </select>
110        <%
111      }
112      else if (pType instanceof FileParameterType)
113      {
114        %>
115        <table border="0" cellspacing="0" cellpadding="0">
116        <tr>
117        <td><input type="text" class="text <%=required ? "required" : ""%>" 
118          name="<%=pName%>" size="50" value="<%=defaultValue%>"
119          title="<%=HTML.encodeTags(pp.getDescription())%>">&nbsp;</td>
120        <td><base:button 
121          title="Browse&hellip;"
122          onclick="<%="browseOnClick('"+pName+"')"%>"
123          />
124        </td>
125        </tr>
126        </table>
127        <%
128      }
129      else
130      {
131        %>
132        Unsupported parameter type. Please report this issue to the developers.
133        <%
134      }
135      %>
136      </td>
137    </tr>
138    <%
139  }
140  %>
141  </table>
142  </div>
143
144  </form>
145 
146    <table align="center">
147    <tr>
148      <td width="50%"><base:button onclick="doVisualize();" title="Next" /></td>
149      <td width="50%"><base:button onclick="window.close();" title="Cancel" /></td>
150    </tr>
151    </table>
152
153</base:body>
154</base:page>
Note: See TracBrowser for help on using the repository browser.