1 |
4080
|
daigle
|
<%@ page language="java" import="java.util.Vector,edu.ucsb.nceas.metacat.admin.DBAdmin,edu.ucsb.nceas.metacat.service.PropertyService" %>
|
2 |
|
|
<%@ page language="java" import="edu.ucsb.nceas.metacat.DBVersion,edu.ucsb.nceas.metacat.MetaCatVersion" %>
|
3 |
|
|
|
4 |
|
|
<%
|
5 |
|
|
/**
|
6 |
|
|
* '$RCSfile$'
|
7 |
|
|
* Copyright: 2008 Regents of the University of California and the
|
8 |
|
|
* National Center for Ecological Analysis and Synthesis
|
9 |
|
|
* For Details: http://www.nceas.ucsb.edu/
|
10 |
|
|
*
|
11 |
|
|
* '$Author$'
|
12 |
|
|
* '$Date$'
|
13 |
|
|
* '$Revision$'
|
14 |
|
|
*
|
15 |
|
|
* This program is free software; you can redistribute it and/or modify
|
16 |
|
|
* it under the terms of the GNU General Public License as published by
|
17 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
18 |
|
|
* (at your option) any later version.
|
19 |
|
|
*
|
20 |
|
|
* This program is distributed in the hope that it will be useful,
|
21 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
|
|
* GNU General Public License for more details.
|
24 |
|
|
*
|
25 |
|
|
* You should have received a copy of the GNU General Public License
|
26 |
|
|
* along with this program; if not, write to the Free Software
|
27 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
|
|
*/
|
29 |
|
|
%>
|
30 |
|
|
|
31 |
|
|
<%
|
32 |
|
|
MetaCatVersion metacatVersion = (MetaCatVersion)request.getAttribute("metaCatVersion");
|
33 |
|
|
DBVersion databaseVersion = (DBVersion)request.getAttribute("databaseVersion");
|
34 |
|
|
Vector<String> updateScriptList = (Vector<String> )request.getAttribute("updateScriptList");
|
35 |
|
|
%>
|
36 |
|
|
|
37 |
|
|
<html>
|
38 |
|
|
<head>
|
39 |
|
|
|
40 |
|
|
<title>Database Install/Upgrade Utility</title>
|
41 |
|
|
<link rel="stylesheet" type="text/css"
|
42 |
|
|
href="<%= request.getContextPath() %>/admin/admin.css"></link>
|
43 |
|
|
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/admin/admin.js"></script>
|
44 |
|
|
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/help/help.js"></script>
|
45 |
|
|
|
46 |
|
|
</head>
|
47 |
|
|
<body>
|
48 |
|
|
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
|
49 |
|
|
<h2>Database Install/Upgrade Utility</h2>
|
50 |
|
|
|
51 |
|
|
<%@ include file="page-message-section.jsp"%>
|
52 |
|
|
|
53 |
|
|
<%
|
54 |
|
|
if (databaseVersion != null && databaseVersion.getVersionString().equals("0.0.0")) {
|
55 |
|
|
%>
|
56 |
|
|
<p>The system has detected that this is a new database. <br><br>
|
57 |
|
|
Please hit the Continue button to upgrade your database to version: <%= metacatVersion %>. <br><br>
|
58 |
|
|
<div class=warning>Warning: this will reinitialize your database. If this is not a new database, hit the Cancel button and contact support at blah@blah.com </div><br><br>
|
59 |
|
|
The following scripts will be run: </p>
|
60 |
|
|
|
61 |
|
|
<ul>
|
62 |
|
|
<%
|
63 |
|
|
for (int i = 0; i < updateScriptList.size(); i++) {
|
64 |
|
|
%>
|
65 |
|
|
<li>
|
66 |
|
|
<%= updateScriptList.elementAt(i) %>
|
67 |
|
|
</li>
|
68 |
|
|
<%
|
69 |
|
|
}
|
70 |
|
|
%>
|
71 |
|
|
</ul>
|
72 |
|
|
<input class=button type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
73 |
|
|
<input class=button type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
74 |
|
|
<%
|
75 |
|
|
} else if (databaseVersion != null) {
|
76 |
|
|
%>
|
77 |
|
|
<p>The system has detected the following database version: <%= databaseVersion.getVersionString() %> <br><br>
|
78 |
|
|
Please hit the Continue button to upgrade your database to version: <%= metacatVersion.getVersionString() %> <br>
|
79 |
|
|
<div class=warning>Warning: this will update your database. If the detected versions do not seem correct, hit the Cancel button and contact support at blah@blah.com </div><br><br>
|
80 |
|
|
The following scripts will be run: </p> <br>
|
81 |
|
|
<ul>
|
82 |
|
|
<%
|
83 |
|
|
for (int i = 0; i < updateScriptList.size(); i++) {
|
84 |
|
|
%>
|
85 |
|
|
<li>
|
86 |
|
|
<%= updateScriptList.elementAt(i) %>
|
87 |
|
|
</li>
|
88 |
|
|
<%
|
89 |
|
|
}
|
90 |
|
|
%>
|
91 |
|
|
</ul>
|
92 |
|
|
<input class=button type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
93 |
|
|
<input class=button type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
94 |
|
|
<%
|
95 |
|
|
} else {
|
96 |
|
|
%>
|
97 |
|
|
<input class=button disabled type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
98 |
|
|
<input class=button type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
99 |
|
|
<%
|
100 |
|
|
}
|
101 |
|
|
%>
|
102 |
|
|
|
103 |
|
|
<br clear="right"/>
|
104 |
|
|
|
105 |
|
|
</body>
|
106 |
|
|
</html>
|