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

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

Fixes #203: Change source files to UTF-8

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