source: trunk/www/admin/plugindefinitions/auto_install_result.jsp @ 4936

Last change on this file since 4936 was 4936, checked in by Martin Svensson, 14 years ago

Fixes #1313 Autoinstaller wizzard should detect and display changed plug-ins

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.1 KB
Line 
1<%-- $Id $
2  ------------------------------------------------------------------
3  Copyright (C) 2008 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 3
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 BASE. If not, see <http://www.gnu.org/licenses/>.
20  ------------------------------------------------------------------
21
22  @author Nicklas
23  @version 2.9.1
24--%>
25
26<%@ page session="false"
27  import="net.sf.basedb.core.Application"
28  import="net.sf.basedb.core.DbControl"
29  import="net.sf.basedb.core.Item"
30  import="net.sf.basedb.core.ItemContext" 
31  import="net.sf.basedb.core.SessionControl"
32  import="net.sf.basedb.util.PluginInfo"
33  import="net.sf.basedb.util.error.ThrowableUtil"
34  import="net.sf.basedb.clients.web.Base"
35  import="java.util.Map"
36%>
37<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
38<%@ taglib prefix="tbl" uri="/WEB-INF/table.tld" %>
39<%
40final Item itemType = Item.PLUGINDEFINITION;
41final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
42final ItemContext cc = Base.getAndSetCurrentContext(sc, itemType, null, null);
43final String ID = sc.getId();
44final float scale = Base.getScale(sc);
45
46Map<PluginInfo, Throwable> installationResult = 
47  (Map<PluginInfo, Throwable>)sc.getSessionSetting("pluginwizard.installationresult");
48sc.setSessionSetting("pluginwizard.installationresult", null);
49if (installationResult == null)
50{
51  response.sendRedirect("../../common/close_popup.jsp?refresh_opener=1&wait=0");
52  return;
53}
54int numPlugins = installationResult.size();
55int numFailed = 0;
56for (Throwable t : installationResult.values())
57{
58  if (t != null) numFailed++;
59}
60int numOk = numPlugins-numFailed;
61   
62String title = numFailed == 0 ? numPlugins + " plug-ins installed sucessfully" :
63  numFailed + " plug-in(s) of " + numPlugins + " could not be completely installed";
64  %>
65  <base:page type="popup" title="<%=title%>">
66  <base:head styles="table.css">
67  </base:head>
68  <base:body>
69
70    <h3 class="docked"><%=title%></h3>
71    <div class="boxed" style="height: <%=(int)(scale*370)+"px;"%>">
72      <tbl:table 
73        id="installation"
74        clazz="itemlist"
75      >
76      <tbl:columndef 
77        id="plugin"
78        title="Plug-in"
79      />
80      <tbl:columndef 
81        id="version"
82        title="Version"
83      />
84      <tbl:columndef 
85        id="result"
86        title="Result"
87      />
88      <tbl:data>
89        <tbl:columns>
90        </tbl:columns>
91        <tbl:rows>
92          <%
93          int i = 0;
94          for (Map.Entry<PluginInfo, Throwable> entry : installationResult.entrySet())
95          {
96            i++;
97            PluginInfo info = entry.getKey();
98            Throwable t = entry.getValue();
99            boolean failed = t != null;
100            if (t != null && t.getCause() != null) t = t.getCause();
101            %>
102            <tbl:row>
103              <tbl:cell column="plugin"><%=info.getAbout().getName()%></tbl:cell>
104              <tbl:cell column="version"><%=info.getAbout().getVersion()%></tbl:cell>
105              <tbl:cell column="result" visible="<%=failed%>">
106                <span class="link" 
107                  title="Click to show/hide complete stacktrace"
108                  onclick="Main.showHide('stacktrace.<%=i%>')">
109                    <base:icon image="error.gif" /><%=t.getMessage() %></span>
110                <div id="stacktrace.<%=i%>" class="stacktrace" 
111                  style="background: inherit; display: none;"><%=ThrowableUtil.stackTraceToString(t)%></div>
112              </tbl:cell>
113              <tbl:cell column="result" visible="<%=!failed%>">
114                <base:icon image="ok.gif"/>Installed sucessfully
115              </tbl:cell>
116            </tbl:row>
117            <%
118          }
119          %>
120        </tbl:rows>
121      </tbl:data>
122      </tbl:table>
123    </div>
124    <table align="center">
125    <tr>
126      <td><base:button onclick="window.close();" title="Ok" /></td>
127    </tr>
128    </table>
129  </base:body>
130  </base:page>
131  <%
132 %>
133 
Note: See TracBrowser for help on using the repository browser.