Project

General

Profile

1
<%@ page    language="java" import="java.util.Enumeration,java.util.Iterator,java.util.Set,java.util.Map,edu.ucsb.nceas.utilities.OptionsMetadata" %>
2
<% 
3
/**
4
 *  '$RCSfile$'
5
 *    Copyright: 2006 Regents of the University of California and the
6
 *               National Center for Ecological Analysis and Synthesis
7
 *  For Details: http://www.nceas.ucsb.edu/
8
 *
9
 *   '$Author: jones $'
10
 *     '$Date: 2006-11-23 00:32:01 -0800 (Thu, 23 Nov 2006) $'
11
 * '$Revision: 3099 $'
12
 * 
13
 * This program is free software; you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation; either version 2 of the License, or
16
 * (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
 */
27
%>
28
<html>
29
<head>
30
<title>Metacat Configuration</title>
31
<style language="Javascript">
32
body {
33
    font-family: Arial, sans-serif;
34
    font-size: 12pt;
35
    margin-left: 30px;
36
    margin-right: 30px;
37
    width: 700px;
38
}
39

    
40
.section {
41
    font-size: 16pt;
42
    font-weight: bold;
43
    border-bottom: solid #dddddd 1px;
44
}
45
label,input {
46
	display: block;
47
	width: 400px;
48
	float: left;
49
	margin-bottom: 10px;
50
}
51

    
52
label {
53
	text-align: right;
54
	width: 250px;
55
	padding-right: 20px;
56
}
57

    
58
br {
59
	clear: left;
60
}
61

    
62
input[type="submit"] {
63
    width: 50px;
64
}
65
</style>
66
</head>
67
<body>
68
<p><img src="metacat-logo.png" width="100px" align="right"/> 
69
<h2>Metacat Configuration</h2>
70
</p>
71

    
72
<p>Welcome to MetaCat!</p>
73
<p>This installation of Metacat needs to be configured before it can
74
   function properly. Please fill out the required information and you'll be
75
   up and running.
76
</p>
77
<br clear="right"/>
78

    
79
<form method="POST" action="<%= request.getContextPath() %>/metacat">
80
<% 
81
    OptionsMetadata metadata = (OptionsMetadata)request.getAttribute("metadata");
82
	if (metadata != null) {
83
        Set groups = metadata.getGroups();
84
        Iterator iter = groups.iterator();
85
   		while (iter.hasNext()) {
86
       		String groupName = (String)iter.next();
87
%>
88
			<p class="section"><%= groupName  %></p>
89
<%
90
			Map keys = metadata.getKeysInGroup(groupName);
91
			Iterator optionsList = keys.values().iterator();
92
			while (optionsList.hasNext()) {
93
    			String name = (String)optionsList.next();
94
    			if (!name.equals("configured")) {
95
%>
96
     				<label for="<%= name %>" title="<%= metadata.getOptionDescription(name) %>"><%= metadata.getOptionLabel(name) %></label>
97
	    			<input id="<%= name %>" name="<%= name %>" 
98
	           			value="<%= request.getAttribute(name) %>"
99
	           			<% if (name.equals("password")) { %>
100
	           				type="password"
101
	           			<% } else { %>
102
	           				type="text" 
103
	           			<% } %>
104
	           			alt="<%= metadata.getOptionDescription(name) %>"
105
	           			/><br/>
106
<%
107
    			}
108
			}
109
   		}
110
   	}
111
%>
112

    
113
			<input type="hidden" name="action" value="configure"/>
114
			<p><input type="submit" value="Save"/></p>
115

    
116
</form>
117

    
118
</body>
119
</html>
(4-4/27)