Project

General

Profile

1
<%@ page language="java"%>
2
<%@ page import="java.util.Set,java.util.Map,java.util.Vector,edu.ucsb.nceas.utilities.*" %>
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: daigle $'
11
 *     '$Date: 2008-07-29 10:31:02 -0700 (Tue, 29 Jul 2008) $'
12
 * '$Revision: 4176 $'
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
<% 
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
%>
61
		<h3><%= metaDataGroup.getName()  %></h3>
62
		<hr class="config-line">
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> fieldOptionValues = metaDataProperty.getFieldOptionValues();
83
					Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
84
					for (int i = 0; i < fieldOptionNames.size(); i++) {
85
%>
86
					<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
87
<%
88
				}
89
%>
90
					</select>
91
				</td>
92
				<td class="config-question-mark">
93
					<img src="style/images/question-mark.gif" 
94
	           		       alt="<%= metaDataProperty.getDescription() %>" 
95
	           		       onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
96
				</td>
97
			</tr>
98

    
99
<%		
100
				} else if (fieldType.equals("password")) {
101
%>
102
			<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
	           		     alt="<%= metaDataProperty.getDescription() %>" 
115
	           		     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
116
				</td>
117
			</tr>
118
<%		
119
				} else {
120
%>
121
			<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
					<img src="style/images/question-mark.gif" 
133
						 alt="<%= metaDataProperty.getDescription() %>" 
134
					     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
135
				</td>
136
 			</tr>
137
<%   			
138
				}
139
    			
140
    			if (metaDataProperty.getDescription() != null) {
141
%>
142
			<tr>
143
    	        <td></td>
144
    	        <td class="config-property-description" colspan="2" >
145
					<%= metaDataProperty.getDescription() %>
146
    	        </td>
147
			</tr>
148
<%
149
    			}
150
			}
151
%>
152

    
153
			</table>
154
<%
155
		}
156
	}
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>
(6-6/12)