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 |
4583
|
daigle
|
<title>Authentication Configuration</title>
|
34 |
4080
|
daigle
|
<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 |
4753
|
daigle
|
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
|
39 |
|
|
<!--
|
40 |
|
|
createExclusionList();
|
41 |
|
|
//-->
|
42 |
|
|
</SCRIPT>
|
43 |
|
|
|
44 |
|
|
|
45 |
4080
|
daigle
|
</head>
|
46 |
|
|
<body>
|
47 |
4557
|
daigle
|
<%@ include file="./header-section.jsp"%>
|
48 |
|
|
|
49 |
4080
|
daigle
|
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
|
50 |
4583
|
daigle
|
<h2>Authentication Configuration</h2>
|
51 |
4080
|
daigle
|
Enter authentication service properties here.
|
52 |
4583
|
daigle
|
<br class="auth-header">
|
53 |
4080
|
daigle
|
|
54 |
|
|
<%@ include file="./page-message-section.jsp"%>
|
55 |
|
|
|
56 |
|
|
|
57 |
|
|
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
|
58 |
4544
|
daigle
|
onsubmit="return validateAndSubmitForm(this);">
|
59 |
4159
|
daigle
|
<%
|
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 |
5028
|
daigle
|
if (groupId == 0) {
|
68 |
|
|
continue;
|
69 |
|
|
}
|
70 |
4159
|
daigle
|
// for this group, display the header (group name)
|
71 |
|
|
MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
|
72 |
4080
|
daigle
|
%>
|
73 |
4159
|
daigle
|
<h3><%= metaDataGroup.getName() %></h3>
|
74 |
4753
|
daigle
|
<%= metaDataGroup.getDescription() %>
|
75 |
4159
|
daigle
|
<hr class="config-line">
|
76 |
4080
|
daigle
|
<%
|
77 |
4159
|
daigle
|
// get all the properties in this group
|
78 |
|
|
Map<Integer, MetaDataProperty> propertyMap =
|
79 |
|
|
metadata.getPropertiesInGroup(metaDataGroup.getIndex());
|
80 |
|
|
Set<Integer> propertyIndexes = propertyMap.keySet();
|
81 |
|
|
// iterate through each property and display appropriately
|
82 |
|
|
for (Integer propertyIndex : propertyIndexes) {
|
83 |
|
|
MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
|
84 |
|
|
String fieldType = metaDataProperty.getFieldType();
|
85 |
4753
|
daigle
|
if (metaDataProperty.getIsRequired()) {
|
86 |
|
|
%>
|
87 |
|
|
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT">
|
88 |
|
|
<!--
|
89 |
|
|
addExclusion("<%= metaDataProperty.getKey() %>");
|
90 |
|
|
//-->
|
91 |
|
|
</SCRIPT>
|
92 |
|
|
<%
|
93 |
|
|
}
|
94 |
4159
|
daigle
|
if (fieldType.equals("select")) {
|
95 |
|
|
%>
|
96 |
4258
|
daigle
|
<div class="form-row">
|
97 |
|
|
<img class="question-mark" src="style/images/question-mark.gif"
|
98 |
|
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
99 |
|
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
|
100 |
|
|
<select class="textinput" name="<%= metaDataProperty.getKey() %>">
|
101 |
4080
|
daigle
|
<%
|
102 |
4159
|
daigle
|
Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
|
103 |
|
|
Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
|
104 |
|
|
for (int i = 0; i < fieldOptionNames.size(); i++) {
|
105 |
4080
|
daigle
|
%>
|
106 |
4258
|
daigle
|
<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
|
107 |
4080
|
daigle
|
<%
|
108 |
4258
|
daigle
|
}
|
109 |
4080
|
daigle
|
%>
|
110 |
4159
|
daigle
|
</select>
|
111 |
4258
|
daigle
|
</div>
|
112 |
|
|
<%
|
113 |
|
|
if (metaDataProperty.getDescription() != null) {
|
114 |
|
|
%>
|
115 |
|
|
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
|
116 |
4159
|
daigle
|
<%
|
117 |
4258
|
daigle
|
}
|
118 |
4159
|
daigle
|
} else if (fieldType.equals("password")) {
|
119 |
4080
|
daigle
|
%>
|
120 |
4258
|
daigle
|
<div class="form-row">
|
121 |
|
|
<img class="question-mark" src="style/images/question-mark.gif"
|
122 |
|
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
123 |
|
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
|
124 |
|
|
<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
|
125 |
4159
|
daigle
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
|
126 |
4258
|
daigle
|
type="<%= fieldType %>"/>
|
127 |
|
|
</div>
|
128 |
|
|
<%
|
129 |
|
|
if (metaDataProperty.getDescription() != null) {
|
130 |
|
|
%>
|
131 |
|
|
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
|
132 |
4159
|
daigle
|
<%
|
133 |
4258
|
daigle
|
}
|
134 |
4159
|
daigle
|
} else {
|
135 |
4080
|
daigle
|
%>
|
136 |
4258
|
daigle
|
<div class="form-row">
|
137 |
|
|
<img class="question-mark" src="style/images/question-mark.gif"
|
138 |
|
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
139 |
|
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
|
140 |
|
|
<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>"
|
141 |
4159
|
daigle
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
|
142 |
4258
|
daigle
|
type="<%= fieldType %> "/>
|
143 |
|
|
</div>
|
144 |
|
|
<%
|
145 |
|
|
if (metaDataProperty.getDescription() != null) {
|
146 |
|
|
%>
|
147 |
|
|
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
|
148 |
|
|
<%
|
149 |
|
|
}
|
150 |
4159
|
daigle
|
}
|
151 |
|
|
}
|
152 |
|
|
}
|
153 |
4080
|
daigle
|
}
|
154 |
|
|
%>
|
155 |
|
|
|
156 |
4583
|
daigle
|
<input type="hidden" name="configureType" value="auth"/>
|
157 |
4080
|
daigle
|
<input type="hidden" name="processForm" value="true"/>
|
158 |
|
|
<input class="left-button" type="submit" value="Save"/>
|
159 |
|
|
<input class="button" type="button" value="Cancel" onClick="forward('./admin')">
|
160 |
|
|
|
161 |
|
|
</form>
|
162 |
|
|
|
163 |
4557
|
daigle
|
<%@ include file="./footer-section.jsp"%>
|
164 |
|
|
|
165 |
4080
|
daigle
|
</body>
|
166 |
|
|
</html>
|