www/common/export/index.jsp

Code
Comments
Other
Rev Date Author Line
1876 01 Feb 06 nicklas 1 <%-- $Id$
1876 01 Feb 06 nicklas 2   ------------------------------------------------------------------
5425 23 Sep 10 nicklas 3   Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
1876 01 Feb 06 nicklas 4
2304 22 May 06 jari 5   This file is part of BASE - BioArray Software Environment.
2304 22 May 06 jari 6   Available at http://base.thep.lu.se/
1876 01 Feb 06 nicklas 7
1876 01 Feb 06 nicklas 8   BASE is free software; you can redistribute it and/or
1876 01 Feb 06 nicklas 9   modify it under the terms of the GNU General Public License
4476 05 Sep 08 jari 10   as published by the Free Software Foundation; either version 3
1876 01 Feb 06 nicklas 11   of the License, or (at your option) any later version.
1876 01 Feb 06 nicklas 12
1876 01 Feb 06 nicklas 13   BASE is distributed in the hope that it will be useful,
1876 01 Feb 06 nicklas 14   but WITHOUT ANY WARRANTY; without even the implied warranty of
1876 01 Feb 06 nicklas 15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1876 01 Feb 06 nicklas 16   GNU General Public License for more details.
1876 01 Feb 06 nicklas 17
1876 01 Feb 06 nicklas 18   You should have received a copy of the GNU General Public License
4510 11 Sep 08 jari 19   along with BASE. If not, see <http://www.gnu.org/licenses/>.
1876 01 Feb 06 nicklas 20   ------------------------------------------------------------------
1876 01 Feb 06 nicklas 21
1876 01 Feb 06 nicklas 22   @author Nicklas
1876 01 Feb 06 nicklas 23   @version 2.0
1876 01 Feb 06 nicklas 24 --%>
5426 24 Sep 10 nicklas 25 <%@ page pageEncoding="UTF-8" session="false"
1876 01 Feb 06 nicklas 26   import="net.sf.basedb.core.SessionControl"
1876 01 Feb 06 nicklas 27   import="net.sf.basedb.core.DbControl"
1876 01 Feb 06 nicklas 28   import="net.sf.basedb.core.Item"
1876 01 Feb 06 nicklas 29   import="net.sf.basedb.core.File"
1876 01 Feb 06 nicklas 30   import="net.sf.basedb.core.Job"
1876 01 Feb 06 nicklas 31   import="net.sf.basedb.core.Path"
1876 01 Feb 06 nicklas 32   import="net.sf.basedb.core.BaseException"
1876 01 Feb 06 nicklas 33   import="net.sf.basedb.core.PluginDefinition"
1876 01 Feb 06 nicklas 34   import="net.sf.basedb.core.PluginConfiguration"
1876 01 Feb 06 nicklas 35   import="net.sf.basedb.core.PluginConfigurationRequest"
1876 01 Feb 06 nicklas 36   import="net.sf.basedb.core.PluginExecutionRequest"
1876 01 Feb 06 nicklas 37   import="net.sf.basedb.core.PluginResponse"
1876 01 Feb 06 nicklas 38   import="net.sf.basedb.core.ItemQuery"
1876 01 Feb 06 nicklas 39   import="net.sf.basedb.core.ItemResultList"
1876 01 Feb 06 nicklas 40   import="net.sf.basedb.core.Include"
1876 01 Feb 06 nicklas 41   import="net.sf.basedb.core.query.Hql"
1876 01 Feb 06 nicklas 42   import="net.sf.basedb.core.query.Expressions"
1876 01 Feb 06 nicklas 43   import="net.sf.basedb.core.query.Restrictions"
1876 01 Feb 06 nicklas 44   import="net.sf.basedb.core.query.Orders"
1876 01 Feb 06 nicklas 45   import="net.sf.basedb.core.plugin.Response"
1876 01 Feb 06 nicklas 46   import="net.sf.basedb.core.plugin.GuiContext"
1876 01 Feb 06 nicklas 47   import="net.sf.basedb.core.plugin.Plugin"
1876 01 Feb 06 nicklas 48   import="net.sf.basedb.core.plugin.InteractivePlugin"
1876 01 Feb 06 nicklas 49   import="net.sf.basedb.util.AutoDetectFileFormat"
1876 01 Feb 06 nicklas 50   import="net.sf.basedb.clients.web.Base"
1876 01 Feb 06 nicklas 51   import="net.sf.basedb.clients.web.WebException"
2753 20 Oct 06 nicklas 52   import="net.sf.basedb.util.Values"
1876 01 Feb 06 nicklas 53   import="net.sf.basedb.clients.web.util.HTML"
1876 01 Feb 06 nicklas 54   import="java.util.List"
1876 01 Feb 06 nicklas 55   import="java.util.LinkedList"
1876 01 Feb 06 nicklas 56   import="java.util.Map"
1876 01 Feb 06 nicklas 57   import="java.util.HashMap"
1876 01 Feb 06 nicklas 58 %>
1876 01 Feb 06 nicklas 59 <%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
1876 01 Feb 06 nicklas 60 <%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
1876 01 Feb 06 nicklas 61
1876 01 Feb 06 nicklas 62 <%
1876 01 Feb 06 nicklas 63 final String root = request.getContextPath()+"/";
1876 01 Feb 06 nicklas 64 final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
1876 01 Feb 06 nicklas 65 final String ID = sc.getId();
1876 01 Feb 06 nicklas 66 final String cmd = request.getParameter("cmd");
1876 01 Feb 06 nicklas 67 final Item itemType = Item.valueOf(request.getParameter("item_type"));
1945 09 Feb 06 nicklas 68 final String subContext = Values.getString(request.getParameter("subcontext"), ""); 
1876 01 Feb 06 nicklas 69 final GuiContext.Type contextType = GuiContext.Type.valueOf(request.getParameter("context_type"));
2868 07 Nov 06 nicklas 70 final GuiContext context = new GuiContext(itemType, contextType, subContext);
1876 01 Feb 06 nicklas 71
1876 01 Feb 06 nicklas 72 String forward = null;
1876 01 Feb 06 nicklas 73 String message = null;
1876 01 Feb 06 nicklas 74 String redirect = null;
1876 01 Feb 06 nicklas 75 try
1876 01 Feb 06 nicklas 76 {
1876 01 Feb 06 nicklas 77   if ("SelectPlugin".equals(cmd))
1876 01 Feb 06 nicklas 78   {
1876 01 Feb 06 nicklas 79     redirect = "../plugin/index.jsp?ID="+ID+
1876 01 Feb 06 nicklas 80       "&cmd=SelectPlugin&main_type=EXPORT"+
1876 01 Feb 06 nicklas 81       "&item_type="+itemType.name()+
7201 17 Oct 16 nicklas 82       "&subcontext="+HTML.urlEncode(subContext)+
1876 01 Feb 06 nicklas 83       "&context_type="+contextType.name()+
1876 01 Feb 06 nicklas 84       "&title="+HTML.urlEncode(request.getParameter("title"));
1876 01 Feb 06 nicklas 85   }
1876 01 Feb 06 nicklas 86   else
1876 01 Feb 06 nicklas 87   {
1876 01 Feb 06 nicklas 88     throw new WebException("popup", "Invalid command", "The command {1} is not recognised as a valid command.", cmd);
1876 01 Feb 06 nicklas 89   }
1876 01 Feb 06 nicklas 90
1876 01 Feb 06 nicklas 91 }
1876 01 Feb 06 nicklas 92 finally
1876 01 Feb 06 nicklas 93 {
7954 12 May 21 nicklas 94   
1876 01 Feb 06 nicklas 95 }
1876 01 Feb 06 nicklas 96
1876 01 Feb 06 nicklas 97 if (forward != null)
1876 01 Feb 06 nicklas 98 {
6192 31 Oct 12 nicklas 99   sc.setSessionSetting("alert-message", message);
1876 01 Feb 06 nicklas 100   pageContext.forward(forward);
1876 01 Feb 06 nicklas 101 }
1876 01 Feb 06 nicklas 102 else if (redirect != null)
1876 01 Feb 06 nicklas 103 {
6192 31 Oct 12 nicklas 104   sc.setSessionSetting("alert-message", message);
1876 01 Feb 06 nicklas 105   response.sendRedirect(redirect);
1876 01 Feb 06 nicklas 106 }
1876 01 Feb 06 nicklas 107 else if (message == null)
1876 01 Feb 06 nicklas 108 {
1876 01 Feb 06 nicklas 109   response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&wait=0");
1876 01 Feb 06 nicklas 110 }
1876 01 Feb 06 nicklas 111 else
1876 01 Feb 06 nicklas 112 {
1876 01 Feb 06 nicklas 113   response.sendRedirect(root + "common/close_popup.jsp?refresh_opener=1&message="+HTML.urlEncode(message));
1876 01 Feb 06 nicklas 114 }
1876 01 Feb 06 nicklas 115 %>
1876 01 Feb 06 nicklas 116