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: 2009-01-14 16:06:42 -0800 (Wed, 14 Jan 2009) $'
12
 * '$Revision: 4753 $'
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>Authentication 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
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
39
<!--
40
	createExclusionList();
41
//-->
42
</SCRIPT>
43

    
44

    
45
</head>
46
<body>
47
<%@ include file="./header-section.jsp"%>
48

    
49
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/> 
50
<h2>Authentication Configuration</h2>
51
Enter authentication service properties here. 
52
<br class="auth-header">
53

    
54
<%@ include file="./page-message-section.jsp"%>
55

    
56

    
57
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin" 
58
                                        onsubmit="return validateAndSubmitForm(this);">
59
<% 
60
	// metadata holds all group and properties metadata
61
    PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
62
	if (metadata != null) {
63
		// each group describes a section of properties
64
		Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
65
		Set<Integer> groupIdSet = groupMap.keySet();
66
		for (Integer groupId : groupIdSet) {
67
			// for this group, display the header (group name)
68
			MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
69
%>
70
		<h3><%= metaDataGroup.getName()  %></h3>
71
		<%= metaDataGroup.getDescription()  %>
72
		<hr class="config-line">
73
<%
74
			// get all the properties in this group
75
			Map<Integer, MetaDataProperty> propertyMap = 
76
				metadata.getPropertiesInGroup(metaDataGroup.getIndex());
77
			Set<Integer> propertyIndexes = propertyMap.keySet();
78
			// iterate through each property and display appropriately
79
			for (Integer propertyIndex : propertyIndexes) {
80
				MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
81
    			String fieldType = metaDataProperty.getFieldType(); 
82
    			if (metaDataProperty.getIsRequired()) {
83
%>
84
				<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
85
				<!--
86
					addExclusion("<%= metaDataProperty.getKey() %>");
87
				//-->
88
				</SCRIPT> 		
89
<% 		
90
    			}
91
    			if (fieldType.equals("select")) {
92
%> 
93
				<div class="form-row">
94
					<img class="question-mark" src="style/images/question-mark.gif" 
95
	           		       onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
96
     				<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>	   	
97
					<select class="textinput" name="<%= metaDataProperty.getKey() %>">
98
<%
99
					Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
100
					Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
101
					for (int i = 0; i < fieldOptionNames.size(); i++) {
102
%>
103
						<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
104
<%
105
					}
106
%>
107
					</select>
108
				</div> 
109
<%
110
					if (metaDataProperty.getDescription() != null) {
111
%>
112
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
113
<%		
114
					}
115
				} else if (fieldType.equals("password")) {
116
%>
117
				<div class="form-row">
118
					<img class="question-mark" src="style/images/question-mark.gif"  
119
	           		     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
120
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>	
121
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>" 	             		    	    	           		    	             			
122
	           		    	value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
123
	           		    	type="<%= fieldType %>"/> 
124
				</div> 
125
<%
126
					if (metaDataProperty.getDescription() != null) {
127
%>
128
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
129
<%		
130
					}
131
				} else {
132
%>
133
				<div class="form-row">
134
					<img class="question-mark" src="style/images/question-mark.gif"  
135
					     onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
136
					<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>					
137
					<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>" 
138
	    			        value="<%= request.getAttribute(metaDataProperty.getKey()) %>"	             		    	    	           		    	             			
139
	           		    	type="<%= fieldType %>	"/>	
140
				</div>    		    
141
<%
142
					if (metaDataProperty.getDescription() != null) {
143
%>
144
						<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
145
<%		
146
					}
147
				}
148
			}
149
		}
150
	}
151
%>
152

    
153
  <input type="hidden" name="configureType" value="auth"/>
154
  <input type="hidden" name="processForm" value="true"/>
155
  <input class="left-button" type="submit" value="Save"/>
156
  <input class="button" type="button" value="Cancel" onClick="forward('./admin')"> 
157

    
158
</form>
159

    
160
<%@ include file="./footer-section.jsp"%>
161

    
162
</body>
163
</html>
(4-4/15)