source: extensions/net.sf.basedb.mev/trunk/resources/launch_export.jsp @ 994

Last change on this file since 994 was 994, checked in by Nicklas Nordborg, 13 years ago

References #162: Upgrade to MeV 4.3

Fixes a problem that prevented the export window to open.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 3.5 KB
Line 
1<%-- $Id: launch_export.jsp 994 2009-03-25 07:46:46Z 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 Jari, Nicklas
25--%>
26<%@ page session="false"
27  import="net.sf.basedb.core.Application"
28  import="net.sf.basedb.core.BioAssaySet"
29  import="net.sf.basedb.core.Experiment"
30  import="net.sf.basedb.core.Directory"
31  import="net.sf.basedb.core.User"
32  import="net.sf.basedb.core.DbControl"
33  import="net.sf.basedb.core.SessionControl"
34  import="net.sf.basedb.core.Path"
35  import="net.sf.basedb.clients.web.Base"
36  import="net.sf.basedb.clients.web.util.HTML"
37  import="net.sf.basedb.clients.web.extensions.ExtensionsControl"
38  import="net.sf.basedb.util.Values"
39%>
40<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
41<%
42final SessionControl sc = Base.getExistingSessionControl(request, true);
43final String ID = sc.getId();
44final int bioAssaySetId = Values.getInt(request.getParameter("bioassayset_id"));
45final String title = "Create MeV TDMS file?";
46DbControl dc = null;
47String defaultPath = "/";
48String defaultFileName = "mev.txt";
49String jobName = "Create MeV TDMS file";
50try
51{
52  dc = sc.newDbControl();
53  BioAssaySet bas = BioAssaySet.getById(dc, bioAssaySetId);
54  defaultFileName = Path.makeSafeFilename(bas.getName() + ".mev.txt", "");
55  jobName += " for " + bas.getName();
56  try
57  {
58    Experiment exp = bas.getExperiment();
59    Directory dir = exp.getDirectory();
60    if (dir == null)
61    {
62      User user = User.getById(dc, sc.getLoggedInUserId());
63      dir = user.getHomeDirectory();
64    }
65    if (dir != null)
66    {
67      defaultPath = dir.getPath().toString() + "/";
68    }
69  }
70  catch (Throwable t)
71  {}
72 
73}
74finally
75{
76  if (dc != null) dc.close();
77}
78%>
79<base:page type="popup" title="<%=title%>">
80<base:head>
81  <script language="JavaScript">
82  function createTDMS()
83  {
84    var url = getRoot()+'common/plugin/index.jsp?ID='+getSessionId();
85    url += '&cmd=NewJob&plugin_class=net.sf.basedb.plugins.BioAssaySetExporter';
86    url += '&item_type=BIOASSAYSET&context_type=ITEM';
87    url += '&job_name=' + encodeURIComponent('<%=jobName%>');
88    url += '&parameter:fileformat=mev.tdms';
89    url += '&parameter:saveAs='+encodeURIComponent('<%=HTML.javaScriptEncode(defaultPath+defaultFileName)%>');
90    url += '&parameter:attachToBioAssaySet=true';
91    Main.openPopup(url, 'CreateTDMSFile2', 740, 540);
92    window.close();
93  }
94  </script>
95</base:head>
96<base:body>
97
98  <base:note type="question" title="<%=title%>">
99  The selected bioassay is not associated with a MeV TDMS file.
100  Do you wish to create one with the BioAssaySetExporter plug-in?
101  <br><br>
102  </base:note>
103  <p>
104    <table align="center">
105    <tr>
106      <td width="50%"><base:button onclick="createTDMS()" title="Yes" /></td>
107      <td width="50%"><base:button onclick="window.close()" title="No" /></td>
108    </tr>
109    </table>
110  </div>
111
112</base:body>
113</base:page>
Note: See TracBrowser for help on using the repository browser.