Revision 8222
Added by Lauren Walker over 11 years ago
auth-configuration.jsp | ||
---|---|---|
46 | 46 |
<body> |
47 | 47 |
<%@ include file="./header-section.jsp"%> |
48 | 48 |
|
49 |
<img src="<%= request.getContextPath() %>/metacat-logo-darkgray.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 |
if (groupId == 0) { |
|
68 |
continue; |
|
69 |
} |
|
70 |
// for this group, display the header (group name) |
|
71 |
MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId); |
|
72 |
%> |
|
73 |
<h3><%= metaDataGroup.getName() %></h3> |
|
74 |
<%= metaDataGroup.getDescription() %> |
|
75 |
<% |
|
76 |
// get all the properties in this group |
|
77 |
Map<Integer, MetaDataProperty> propertyMap = |
|
78 |
metadata.getPropertiesInGroup(metaDataGroup.getIndex()); |
|
79 |
Set<Integer> propertyIndexes = propertyMap.keySet(); |
|
80 |
// iterate through each property and display appropriately |
|
81 |
for (Integer propertyIndex : propertyIndexes) { |
|
82 |
MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex); |
|
83 |
String fieldType = metaDataProperty.getFieldType(); |
|
84 |
if (metaDataProperty.getIsRequired()) { |
|
85 |
%> |
|
86 |
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"> |
|
87 |
<!-- |
|
88 |
addExclusion("<%= metaDataProperty.getKey() %>"); |
|
89 |
//--> |
|
90 |
</SCRIPT> |
|
91 |
<% |
|
92 |
} |
|
93 |
if (fieldType.equals("select")) { |
|
94 |
%> |
|
95 |
<div class="form-row"> |
|
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 |
<% |
|
49 |
<div class="document"> |
|
50 |
<h2>Authentication Configuration</h2> |
|
51 |
<p>Enter authentication service properties here.</p> |
|
52 |
|
|
53 |
<br class="auth-header"> |
|
54 |
|
|
55 |
<%@ include file="./page-message-section.jsp"%> |
|
56 |
|
|
57 |
|
|
58 |
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin" |
|
59 |
onsubmit="return validateAndSubmitForm(this);"> |
|
60 |
<% |
|
61 |
// metadata holds all group and properties metadata |
|
62 |
PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata"); |
|
63 |
if (metadata != null) { |
|
64 |
// each group describes a section of properties |
|
65 |
Map<Integer, MetaDataGroup> groupMap = metadata.getGroups(); |
|
66 |
Set<Integer> groupIdSet = groupMap.keySet(); |
|
67 |
for (Integer groupId : groupIdSet) { |
|
68 |
if (groupId == 0) { |
|
69 |
continue; |
|
105 | 70 |
} |
106 |
%> |
|
107 |
</select> |
|
108 |
<img class="question-mark" src="style/images/help.png" |
|
109 |
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/> |
|
110 |
</div> |
|
111 |
<% |
|
112 |
if (metaDataProperty.getDescription() != null) { |
|
113 |
%> |
|
114 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
115 |
<% |
|
71 |
// for this group, display the header (group name) |
|
72 |
MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId); |
|
73 |
%> |
|
74 |
<h3><%= metaDataGroup.getName() %></h3> |
|
75 |
<p><%= metaDataGroup.getDescription() %></p> |
|
76 |
<% |
|
77 |
// 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 |
if (metaDataProperty.getIsRequired()) { |
|
86 |
%> |
|
87 |
<SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"> |
|
88 |
<!-- |
|
89 |
addExclusion("<%= metaDataProperty.getKey() %>"); |
|
90 |
//--> |
|
91 |
</SCRIPT> |
|
92 |
<% |
|
93 |
} |
|
94 |
if (fieldType.equals("select")) { |
|
95 |
%> |
|
96 |
<div class="form-row"> |
|
97 |
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div> |
|
98 |
<select class="textinput" name="<%= metaDataProperty.getKey() %>"> |
|
99 |
<% |
|
100 |
Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues(); |
|
101 |
Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames(); |
|
102 |
for (int i = 0; i < fieldOptionNames.size(); i++) { |
|
103 |
%> |
|
104 |
<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %> |
|
105 |
<% |
|
106 |
} |
|
107 |
%> |
|
108 |
</select> |
|
109 |
<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i> |
|
110 |
|
|
111 |
</div> |
|
112 |
<% |
|
113 |
if (metaDataProperty.getDescription() != null) { |
|
114 |
%> |
|
115 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
116 |
<% |
|
117 |
} |
|
118 |
} else if (fieldType.equals("password")) { |
|
119 |
%> |
|
120 |
<div class="form-row"> |
|
121 |
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div> |
|
122 |
<input class="textinput" id="<%= metaDataProperty.getKey() %>" name="<%= metaDataProperty.getKey() %>" |
|
123 |
value="<%= request.getAttribute(metaDataProperty.getKey()) %>" |
|
124 |
type="<%= fieldType %>"/> |
|
125 |
<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i> |
|
126 |
</div> |
|
127 |
<% |
|
128 |
if (metaDataProperty.getDescription() != null) { |
|
129 |
%> |
|
130 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
131 |
<% |
|
132 |
} |
|
133 |
} else { |
|
134 |
%> |
|
135 |
<div class="form-row"> |
|
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 |
<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i> |
|
141 |
</div> |
|
142 |
<% |
|
143 |
if (metaDataProperty.getDescription() != null) { |
|
144 |
%> |
|
145 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
146 |
<% |
|
147 |
} |
|
148 |
} |
|
116 | 149 |
} |
117 |
} else if (fieldType.equals("password")) { |
|
118 |
%> |
|
119 |
<div class="form-row"> |
|
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 |
<img class="question-mark" src="style/images/help.png" |
|
125 |
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/> |
|
126 |
</div> |
|
127 |
<% |
|
128 |
if (metaDataProperty.getDescription() != null) { |
|
129 |
%> |
|
130 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
131 |
<% |
|
132 |
} |
|
133 |
} else { |
|
134 |
%> |
|
135 |
<div class="form-row"> |
|
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 |
<img class="question-mark" src="style/images/help.png" |
|
141 |
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/> |
|
142 |
</div> |
|
143 |
<% |
|
144 |
if (metaDataProperty.getDescription() != null) { |
|
145 |
%> |
|
146 |
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div> |
|
147 |
<% |
|
148 |
} |
|
149 | 150 |
} |
150 | 151 |
} |
151 |
} |
|
152 |
} |
|
153 |
%> |
|
154 |
|
|
155 |
<input type="hidden" name="configureType" value="auth"/> |
|
156 |
<input type="hidden" name="processForm" value="true"/> |
|
157 |
<input class="left-button" type="submit" value="Save"/> |
|
158 |
<input class="button" type="button" value="Cancel" onClick="forward('./admin')"> |
|
159 |
|
|
160 |
</form> |
|
161 |
|
|
152 |
%> |
|
153 |
|
|
154 |
<div class="buttons-wrapper"> |
|
155 |
<input type="hidden" name="configureType" value="auth"/> |
|
156 |
<input type="hidden" name="processForm" value="true"/> |
|
157 |
<input class="button" type="submit" value="Save"/> |
|
158 |
<input class="button" type="button" value="Cancel" onClick="forward('./admin')"> |
|
159 |
</div> |
|
160 |
</form> |
|
161 |
</div> |
|
162 | 162 |
<%@ include file="./footer-section.jsp"%> |
163 | 163 |
|
164 | 164 |
</body> |
Also available in: Unified diff
Matched the admin config pages to the default metacatUI theme. Changed the background image of the docs and config pages to a big cat for some metacat branding.