Project

General

Profile

1 4080 daigle
<%@ page language="java" import="java.util.Collection,java.util.Set,java.util.TreeSet,java.util.Map,java.util.Vector" %>
2
<%@ page language="java" import="edu.ucsb.nceas.utilities.PropertiesMetaData,edu.ucsb.nceas.utilities.MetaDataGroup,edu.ucsb.nceas.utilities.MetaDataProperty" %>
3
<%
4
/**
5
 *  '$RCSfile$'
6
 *    Copyright: 2008 Regents of the University of California and the
7
 *               National Center for Ecological Analysis and Synthesis
8
 *  For Details: http://www.nceas.ucsb.edu/
9
 *
10
 *   '$Author$'
11
 *     '$Date$'
12
 * '$Revision$'
13
 *
14
 * This program is free software; you can redistribute it and/or modify
15
 * it under the terms of the GNU General Public License as published by
16
 * the Free Software Foundation; either version 2 of the License, or
17
 * (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 * GNU General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU General Public License
25
 * along with this program; if not, write to the Free Software
26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27
 */
28
%>
29
30
<html>
31
<head>
32
33
<title>Metacat Properties Configuration</title>
34
<link rel="stylesheet" type="text/css"
35
        href="<%= request.getContextPath() %>/admin/admin.css"></link>
36
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/admin/admin.js"></script>
37
38
</head>
39
<body>
40
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
41
<h2>MetaCat Properties Configuration</h2>
42
43
<p>Enter MetaCat System properties here.  All Fields must be filled in before saving.
44
</p>
45
<br clear="right"/>
46
47
<%@ include file="page-message-section.jsp"%>
48
49
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
50
                                        onsubmit="return submitForm(this);">
51
<%
52
	// metadata holds all group and properties metadata
53
    PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
54
	if (metadata != null) {
55
		// each group describes a section of properties
56
		Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
57
		Set<Integer> groupIdSet = groupMap.keySet();
58
		for (Integer groupId : groupIdSet) {
59
			// for this group, display the header (group name)
60
			MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
61
%>
62
			<p class="section"><%= metaDataGroup.getName()  %></p>
63
			<table class="config-section">
64
<%
65
			// get all the properties in this group
66
			Map<Integer, MetaDataProperty> propertyMap =
67
				metadata.getPropertiesInGroup(metaDataGroup.getIndex());
68
			Set<Integer> propertyIndexes = propertyMap.keySet();
69
			// iterate through each property and display appropriately
70
			for (Integer propertyIndex : propertyIndexes) {
71
				MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
72
    			String fieldType = metaDataProperty.getFieldType();
73
    			if (fieldType.equals("select")) {
74
%>
75
			<tr>
76
				<td class="config-property-label">
77
     				<label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
78
     			</td>
79
     			<td class="config-property-input" >
80
					<select name="<%= metaDataProperty.getKey() %>">
81
<%
82
					Vector<String> fieldOptions = metaDataProperty.getFieldOptions();
83
					for (String optionName : fieldOptions) {
84
%>
85
					<option value="<%= optionName %>"> <%= optionName %>
86
<%
87
				}
88
%>
89
					</select>
90
				</td>
91
				<td class="config-question-mark">
92
					<img src="style/images/question-mark.gif"
93
	           		       alt="<%= metaDataProperty.getDescription() %>"
94
	           		       title="<%= metaDataProperty.getDescription() %>"/>
95
				</td>
96
			</tr>
97
98
<%
99
				} else if (fieldType.equals("password")) {
100
%>
101
			<tr>
102
				<td class="config-property-label">
103
					<label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
104
     			</td>
105
     			<td class="config-property-input" >
106
					<input id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
107
	           		    	type="<%= fieldType %>"
108
	           		    	alt="<%= metaDataProperty.getDescription() %>"/>
109
				</td>
110
				<td class="config-question-mark">
111
					<img src="style/images/question-mark.gif"
112
	           		       alt="<%= metaDataProperty.getDescription() %>"
113
	           		       title="<%= metaDataProperty.getDescription() %>"/>
114
				</td>
115
			</tr>
116
<%
117
				} else {
118
%>
119
			<tr>
120
				<td class="config-property-label">
121
					<label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
122
     			</td>
123
     			<td class="config-property-input" >
124
					<input id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
125
	    			        value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
126
	           		    	type="<%= fieldType %>	"
127
	           		    	alt="<%= metaDataProperty.getDescription() %>"/>
128
	           	</td>
129
				<td class="config-question-mark">
130
					<img class=question-mark src="style/images/question-mark.gif" onClick="helpWindow('ldap_url_help.html')"/>
131
				</td>
132
133
<%
134
				}
135
			}
136
%>
137
138
			</table>
139
<%
140
		}
141
	}
142
%>
143
144
			<input type="hidden" name="configureType" value="properties"/>
145
			<input type="hidden" name="processForm" value="true"/>
146
			<input class=left-button type="submit" value="Save"/>
147
			<input class=button type="button" value="Cancel" onClick="forward('./admin')">
148
149
</form>
150
151
</body>
152
</html>