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 4557 daigle
<%@ include file="./header-section.jsp"%>
41
42 4080 daigle
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
43
<h2>LDAP Configuration</h2>
44
Enter authentication service properties here.
45
<br class="ldap-header">
46
47
<%@ include file="./page-message-section.jsp"%>
48
49
50
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
51 4544 daigle
                                        onsubmit="return validateAndSubmitForm(this);">
52 4159 daigle
<%
53
	// metadata holds all group and properties metadata
54
    PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
55
	if (metadata != null) {
56
		// each group describes a section of properties
57
		Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
58
		Set<Integer> groupIdSet = groupMap.keySet();
59
		for (Integer groupId : groupIdSet) {
60
			// for this group, display the header (group name)
61
			MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
62 4080 daigle
%>
63 4159 daigle
		<h3><%= metaDataGroup.getName()  %></h3>
64
		<hr class="config-line">
65 4080 daigle
<%
66 4159 daigle
			// get all the properties in this group
67
			Map<Integer, MetaDataProperty> propertyMap =
68
				metadata.getPropertiesInGroup(metaDataGroup.getIndex());
69
			Set<Integer> propertyIndexes = propertyMap.keySet();
70
			// iterate through each property and display appropriately
71
			for (Integer propertyIndex : propertyIndexes) {
72
				MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
73
    			String fieldType = metaDataProperty.getFieldType();
74
    			if (fieldType.equals("select")) {
75
%>
76 4258 daigle
				<div class="form-row">
77
					<img class="question-mark" src="style/images/question-mark.gif"
78
	           		       onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
79
     				<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
80
					<select class="textinput" 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 4258 daigle
						<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
87 4080 daigle
<%
88 4258 daigle
					}
89 4080 daigle
%>
90 4159 daigle
					</select>
91 4258 daigle
				</div>
92
<%
93
					if (metaDataProperty.getDescription() != null) {
94
%>
95
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
96 4159 daigle
<%
97 4258 daigle
					}
98 4159 daigle
				} else if (fieldType.equals("password")) {
99 4080 daigle
%>
100 4258 daigle
				<div class="form-row">
101
					<img class="question-mark" src="style/images/question-mark.gif"
102
	           		     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
103
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
104
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
105 4159 daigle
	           		    	value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
106 4258 daigle
	           		    	type="<%= fieldType %>"/>
107
				</div>
108
<%
109
					if (metaDataProperty.getDescription() != null) {
110
%>
111
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
112 4159 daigle
<%
113 4258 daigle
					}
114 4159 daigle
				} else {
115 4080 daigle
%>
116 4258 daigle
				<div class="form-row">
117
					<img class="question-mark" src="style/images/question-mark.gif"
118
					     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
119
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
120
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
121 4159 daigle
	    			        value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
122 4258 daigle
	           		    	type="<%= fieldType %>	"/>
123
				</div>
124
<%
125
					if (metaDataProperty.getDescription() != null) {
126
%>
127
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
128
<%
129
					}
130 4159 daigle
				}
131
			}
132
		}
133 4080 daigle
	}
134
%>
135
136
  <input type="hidden" name="configureType" value="ldap"/>
137
  <input type="hidden" name="processForm" value="true"/>
138
  <input class="left-button" type="submit" value="Save"/>
139
  <input class="button" type="button" value="Cancel" onClick="forward('./admin')">
140
141
</form>
142
143 4557 daigle
<%@ include file="./footer-section.jsp"%>
144
145 4080 daigle
</body>
146
</html>