1 |
4100
|
daigle
|
<%@ page language="java" %>
|
2 |
|
|
<%@ page import="java.util.Vector,edu.ucsb.nceas.metacat.DBVersion,edu.ucsb.nceas.metacat.MetaCatVersion" %>
|
3 |
4080
|
daigle
|
|
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 |
4088
|
daigle
|
MetaCatVersion metacatVersion = (MetaCatVersion)request.getAttribute("metacatVersion");
|
33 |
4080
|
daigle
|
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 |
|
|
|
45 |
|
|
</head>
|
46 |
|
|
<body>
|
47 |
|
|
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
|
48 |
|
|
<h2>Database Install/Upgrade Utility</h2>
|
49 |
|
|
|
50 |
|
|
<%@ include file="page-message-section.jsp"%>
|
51 |
|
|
|
52 |
|
|
<%
|
53 |
|
|
if (databaseVersion != null && databaseVersion.getVersionString().equals("0.0.0")) {
|
54 |
|
|
%>
|
55 |
4156
|
daigle
|
The system has detected that this is a new database. <br><br>
|
56 |
4088
|
daigle
|
Please hit the Continue button to upgrade your database to version: <%= metacatVersion.getVersionString() %>. <br><br>
|
57 |
4080
|
daigle
|
<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>
|
58 |
4156
|
daigle
|
The following scripts will be run:
|
59 |
4080
|
daigle
|
|
60 |
|
|
<ul>
|
61 |
|
|
<%
|
62 |
|
|
for (int i = 0; i < updateScriptList.size(); i++) {
|
63 |
|
|
%>
|
64 |
|
|
<li>
|
65 |
|
|
<%= updateScriptList.elementAt(i) %>
|
66 |
|
|
</li>
|
67 |
|
|
<%
|
68 |
|
|
}
|
69 |
|
|
%>
|
70 |
|
|
</ul>
|
71 |
4089
|
daigle
|
<input class="left-button" type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
72 |
|
|
<input class="button" type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
73 |
4080
|
daigle
|
<%
|
74 |
|
|
} else if (databaseVersion != null) {
|
75 |
|
|
%>
|
76 |
4156
|
daigle
|
The system has detected the following database version: <%= databaseVersion.getVersionString() %> <br><br>
|
77 |
4080
|
daigle
|
Please hit the Continue button to upgrade your database to version: <%= metacatVersion.getVersionString() %> <br>
|
78 |
|
|
<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>
|
79 |
4156
|
daigle
|
The following scripts will be run: <br>
|
80 |
4080
|
daigle
|
<ul>
|
81 |
|
|
<%
|
82 |
|
|
for (int i = 0; i < updateScriptList.size(); i++) {
|
83 |
|
|
%>
|
84 |
|
|
<li>
|
85 |
|
|
<%= updateScriptList.elementAt(i) %>
|
86 |
|
|
</li>
|
87 |
|
|
<%
|
88 |
|
|
}
|
89 |
|
|
%>
|
90 |
|
|
</ul>
|
91 |
4089
|
daigle
|
<input class="left-button" type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
92 |
|
|
<input class="button" type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
93 |
4080
|
daigle
|
<%
|
94 |
|
|
} else {
|
95 |
|
|
%>
|
96 |
4089
|
daigle
|
<input class="left-button" disabled type="button" value="Continue" onClick="forward('./admin?configureType=database&processForm=true')">
|
97 |
|
|
<input class="button" type="button" value="Cancel" onClick="forward('./admin?configureType=configure&processForm=false')">
|
98 |
4080
|
daigle
|
<%
|
99 |
|
|
}
|
100 |
|
|
%>
|
101 |
|
|
|
102 |
|
|
<br clear="right"/>
|
103 |
|
|
|
104 |
|
|
</body>
|
105 |
|
|
</html>
|