source: branches/2.2.2/www/common/import/no_fileformat.jsp @ 3185

Last change on this file since 3185 was 3185, checked in by Jari Häkkinen, 16 years ago

Fixes #508.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.9 KB
Line 
1<%-- $Id: no_fileformat.jsp 3185 2007-03-12 19:12:40Z jari $
2  ------------------------------------------------------------------
3  Copyright (C) Authors contributing to this file.
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  @version 2.0
26--%>
27<%@ page session="false"
28  import="net.sf.basedb.core.SessionControl"
29  import="net.sf.basedb.core.DbControl"
30  import="net.sf.basedb.core.Item"
31  import="net.sf.basedb.core.Permission"
32  import="net.sf.basedb.core.PluginConfiguration"
33  import="net.sf.basedb.core.PluginType"
34  import="net.sf.basedb.core.ItemContext"
35  import="net.sf.basedb.core.PropertyFilter"
36  import="net.sf.basedb.core.Operator"
37  import="net.sf.basedb.core.Type"
38  import="net.sf.basedb.core.ItemQuery"
39  import="net.sf.basedb.core.ItemResultList"
40  import="net.sf.basedb.core.Include"
41  import="net.sf.basedb.core.File"
42  import="net.sf.basedb.core.Job"
43  import="net.sf.basedb.core.Location"
44  import="net.sf.basedb.core.query.Hql"
45  import="net.sf.basedb.core.query.Expressions"
46  import="net.sf.basedb.core.query.Restrictions"
47  import="net.sf.basedb.core.query.Orders"
48  import="net.sf.basedb.core.plugin.GuiContext"
49  import="net.sf.basedb.core.plugin.Plugin"
50  import="net.sf.basedb.core.plugin.AutoDetectingImporter"
51  import="net.sf.basedb.clients.web.Base"
52  import="net.sf.basedb.clients.web.util.HTML"
53  import="net.sf.basedb.util.Values"
54%>
55<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
56<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %>
57
58<%
59final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
60final String ID = sc.getId();
61final int fileId = Values.getInt(request.getParameter("file_id"));
62final Item itemType = Item.valueOf(request.getParameter("item_type"));
63final String subContext = Values.getString(request.getParameter("subcontext"), "");
64final GuiContext.Type contextType = GuiContext.Type.valueOf(request.getParameter("context_type"));
65final GuiContext context = new GuiContext(itemType, contextType);
66final DbControl dc = sc.newDbControl();
67
68final ItemContext pluginContext = sc.getCurrentContext(Item.PLUGINDEFINITION);
69pluginContext.setPropertyFilter(new PropertyFilter(
70  "mainType", Operator.EQ, String.valueOf(Plugin.MainType.IMPORT.getValue()), Type.INT));
71pluginContext.setPropertyFilter(new PropertyFilter(
72  "guiContexts.itemType", Operator.EQ, String.valueOf(itemType.getValue()), Type.INT));
73try
74{
75  File file = File.getById(dc, fileId);
76  %>
77  <base:page type="popup" title="No matching file format">
78  <base:head>
79    <script language="JavaScript">
80    function addFileFormat()
81    {
82      Main.viewOrEditItem('<%=ID%>', 'PLUGINCONFIGURATION', 0, true);
83    }
84    function tryAgain()
85    {
86      location.reload();
87    }
88    </script>
89  </base:head>
90  <base:body>
91    <form name="import" action="index.jsp" method="get" onsubmit="return false;">
92    <input type="hidden" name="ID" value="<%=ID%>">
93    <input type="hidden" name="cmd" value="AutoDetect">
94    <input type="hidden" name="item_type" value="<%=itemType.name()%>">
95    <input type="hidden" name="subcontext" value="<%=subContext%>">
96    <input type="hidden" name="context_type" value="<%=contextType.name()%>">
97    <input type="hidden" name="title" value="<%=HTML.encodeTags(request.getParameter("title"))%>">
98    <input type="hidden" name="job_name" value="<%=HTML.encodeTags(request.getParameter("job_name"))%>">
99    <input type="hidden" name="job_description" value="<%=HTML.encodeTags(request.getParameter("job_description"))%>">
100    <input type="hidden" name="plugindefinition_id" value="<%=request.getParameter("plugindefinition_id")%>">
101    <input type="hidden" name="file_id" value="<%=fileId%>">
102
103    </form>
104   
105      <base:note type="info" title="No matching file format">
106      <br>
107      No file format that matches the file <b><%=file.getPath().toString()%></b> could be found.
108      <br><br>
109      </base:note>
110 
111    <br>
112    <base:buttongroup align="center">
113      <base:button onclick="addFileFormat()" 
114        image="new.gif" title="Add file format&hellip;" 
115        visible="<%=sc.hasPermission(Permission.CREATE, Item.PLUGINCONFIGURATION)%>"/>
116      <base:button onclick="tryAgain();" image="refresh.gif" title="Try again" />
117      <base:button onclick="window.close();" title="Cancel" />
118    </base:buttongroup>
119
120  </base:body>
121  </base:page>
122  <%
123}
124finally
125{
126  if (dc != null) dc.close();
127}
128%>
129
Note: See TracBrowser for help on using the repository browser.