Project

General

Profile

1 4100 daigle
<%@ page language="java"%>
2
<%@ page import="java.util.Set,java.util.Map,java.util.Vector,edu.ucsb.nceas.utilities.*" %>
3 4080 daigle
<%
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>LDAP 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>LDAP Configuration</h2>
42
Enter authentication service properties here.
43
<br class="ldap-header">
44
45
<%@ include file="./page-message-section.jsp"%>
46
47
48
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
49
                                        onsubmit="return submitForm(this);">
50 4159 daigle
<%
51
	// metadata holds all group and properties metadata
52
    PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
53
	if (metadata != null) {
54
		// each group describes a section of properties
55
		Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
56
		Set<Integer> groupIdSet = groupMap.keySet();
57
		for (Integer groupId : groupIdSet) {
58
			// for this group, display the header (group name)
59
			MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
60 4080 daigle
%>
61 4159 daigle
		<h3><%= metaDataGroup.getName()  %></h3>
62
		<hr class="config-line">
63
		<table class="config-section">
64 4080 daigle
<%
65 4159 daigle
			// 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 4080 daigle
<%
82 4159 daigle
					Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
83
					Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
84
					for (int i = 0; i < fieldOptionNames.size(); i++) {
85 4080 daigle
%>
86 4159 daigle
					<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
87 4080 daigle
<%
88 4159 daigle
				}
89 4080 daigle
%>
90 4159 daigle
					</select>
91
				</td>
92
				<td class="config-question-mark">
93
					<img src="style/images/question-mark.gif"
94
	           		       alt="<%= metaDataProperty.getDescription() %>"
95 4176 daigle
	           		       onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
96 4159 daigle
				</td>
97
			</tr>
98
99
<%
100
				} else if (fieldType.equals("password")) {
101 4080 daigle
%>
102 4159 daigle
			<tr>
103
				<td class="config-property-label">
104
					<label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
105
     			</td>
106
     			<td class="config-property-input" >
107
					<input id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
108
	           		    	value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
109
	           		    	type="<%= fieldType %>"
110
	           		    	alt="<%= metaDataProperty.getDescription() %>"/>
111
				</td>
112
				<td class="config-question-mark">
113
					<img src="style/images/question-mark.gif"
114 4176 daigle
	           		     alt="<%= metaDataProperty.getDescription() %>"
115
	           		     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
116 4159 daigle
				</td>
117
			</tr>
118
<%
119
				} else {
120 4080 daigle
%>
121 4159 daigle
			<tr>
122
				<td class="config-property-label">
123
					<label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
124
     			</td>
125
     			<td class="config-property-input" >
126
					<input id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
127
	    			        value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
128
	           		    	type="<%= fieldType %>	"
129
	           		    	alt="<%= metaDataProperty.getDescription() %>"/>
130
	           	</td>
131
				<td class="config-question-mark">
132 4176 daigle
					<img src="style/images/question-mark.gif"
133
						 alt="<%= metaDataProperty.getDescription() %>"
134
					     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
135 4159 daigle
				</td>
136
 			</tr>
137
<%
138
				}
139
140
    			if (metaDataProperty.getDescription() != null) {
141 4080 daigle
%>
142 4159 daigle
			<tr>
143
    	        <td></td>
144
    	        <td class="config-property-description" colspan="2" >
145
					<%= metaDataProperty.getDescription() %>
146
    	        </td>
147
			</tr>
148 4080 daigle
<%
149 4159 daigle
    			}
150
			}
151 4080 daigle
%>
152 4159 daigle
153
			</table>
154 4080 daigle
<%
155 4159 daigle
		}
156 4080 daigle
	}
157
%>
158
159
  <input type="hidden" name="configureType" value="ldap"/>
160
  <input type="hidden" name="processForm" value="true"/>
161
  <input class="left-button" type="submit" value="Save"/>
162
  <input class="button" type="button" value="Cancel" onClick="forward('./admin')">
163
164
</form>
165
166
</body>
167
</html>