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 4080 daigle
<%
64 4159 daigle
			// get all the properties in this group
65
			Map<Integer, MetaDataProperty> propertyMap =
66
				metadata.getPropertiesInGroup(metaDataGroup.getIndex());
67
			Set<Integer> propertyIndexes = propertyMap.keySet();
68
			// iterate through each property and display appropriately
69
			for (Integer propertyIndex : propertyIndexes) {
70
				MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
71
    			String fieldType = metaDataProperty.getFieldType();
72
    			if (fieldType.equals("select")) {
73
%>
74 4258 daigle
				<div class="form-row">
75
					<img class="question-mark" src="style/images/question-mark.gif"
76
	           		       onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
77
     				<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
78
					<select class="textinput" name="<%= metaDataProperty.getKey() %>">
79 4080 daigle
<%
80 4159 daigle
					Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
81
					Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
82
					for (int i = 0; i < fieldOptionNames.size(); i++) {
83 4080 daigle
%>
84 4258 daigle
						<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
85 4080 daigle
<%
86 4258 daigle
					}
87 4080 daigle
%>
88 4159 daigle
					</select>
89 4258 daigle
				</div>
90
<%
91
					if (metaDataProperty.getDescription() != null) {
92
%>
93
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
94 4159 daigle
<%
95 4258 daigle
					}
96 4159 daigle
				} else if (fieldType.equals("password")) {
97 4080 daigle
%>
98 4258 daigle
				<div class="form-row">
99
					<img class="question-mark" src="style/images/question-mark.gif"
100
	           		     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
101
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
102
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
103 4159 daigle
	           		    	value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
104 4258 daigle
	           		    	type="<%= fieldType %>"/>
105
				</div>
106
<%
107
					if (metaDataProperty.getDescription() != null) {
108
%>
109
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
110 4159 daigle
<%
111 4258 daigle
					}
112 4159 daigle
				} else {
113 4080 daigle
%>
114 4258 daigle
				<div class="form-row">
115
					<img class="question-mark" src="style/images/question-mark.gif"
116
					     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
117
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
118
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
119 4159 daigle
	    			        value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
120 4258 daigle
	           		    	type="<%= fieldType %>	"/>
121
				</div>
122
<%
123
					if (metaDataProperty.getDescription() != null) {
124
%>
125
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
126
<%
127
					}
128 4159 daigle
				}
129
			}
130
		}
131 4080 daigle
	}
132
%>
133
134
  <input type="hidden" name="configureType" value="ldap"/>
135
  <input type="hidden" name="processForm" value="true"/>
136
  <input class="left-button" type="submit" value="Save"/>
137
  <input class="button" type="button" value="Cancel" onClick="forward('./admin')">
138
139
</form>
140
141
</body>
142
</html>