1 |
4100
|
daigle
|
<%@ page language="java" %>
|
2 |
|
|
<%@ page import="java.util.Set,java.util.Map,java.util.Vector,edu.ucsb.nceas.utilities.PropertiesMetaData" %>
|
3 |
|
|
<%@ page import="edu.ucsb.nceas.utilities.MetaDataGroup,edu.ucsb.nceas.utilities.MetaDataProperty" %>
|
4 |
4080
|
daigle
|
<%
|
5 |
|
|
/**
|
6 |
|
|
* '$RCSfile$'
|
7 |
|
|
* Copyright: 2008 Regents of the University of California and the
|
8 |
|
|
* National Center for Ecological Analysis and Synthesis
|
9 |
|
|
* For Details: http://www.nceas.ucsb.edu/
|
10 |
|
|
*
|
11 |
|
|
* '$Author$'
|
12 |
|
|
* '$Date$'
|
13 |
|
|
* '$Revision$'
|
14 |
|
|
*
|
15 |
|
|
* This program is free software; you can redistribute it and/or modify
|
16 |
|
|
* it under the terms of the GNU General Public License as published by
|
17 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
18 |
|
|
* (at your option) any later version.
|
19 |
|
|
*
|
20 |
|
|
* This program is distributed in the hope that it will be useful,
|
21 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
|
|
* GNU General Public License for more details.
|
24 |
|
|
*
|
25 |
|
|
* You should have received a copy of the GNU General Public License
|
26 |
|
|
* along with this program; if not, write to the Free Software
|
27 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
28 |
|
|
*/
|
29 |
|
|
%>
|
30 |
|
|
|
31 |
|
|
<html>
|
32 |
|
|
<head>
|
33 |
|
|
|
34 |
|
|
<title>Metacat Properties Configuration</title>
|
35 |
|
|
<link rel="stylesheet" type="text/css"
|
36 |
|
|
href="<%= request.getContextPath() %>/admin/admin.css"></link>
|
37 |
|
|
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/admin/admin.js"></script>
|
38 |
|
|
|
39 |
|
|
</head>
|
40 |
|
|
<body>
|
41 |
4557
|
daigle
|
<%@ include file="./header-section.jsp"%>
|
42 |
|
|
|
43 |
4080
|
daigle
|
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/>
|
44 |
4557
|
daigle
|
<h2>Metacat Properties Configuration</h2>
|
45 |
4080
|
daigle
|
|
46 |
4557
|
daigle
|
<p>Enter Metacat System properties here. All Fields must be filled in before saving.
|
47 |
4080
|
daigle
|
</p>
|
48 |
|
|
<br clear="right"/>
|
49 |
|
|
|
50 |
|
|
<%@ include file="page-message-section.jsp"%>
|
51 |
|
|
|
52 |
|
|
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin"
|
53 |
|
|
onsubmit="return submitForm(this);">
|
54 |
|
|
<%
|
55 |
|
|
// metadata holds all group and properties metadata
|
56 |
|
|
PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
|
57 |
|
|
if (metadata != null) {
|
58 |
|
|
// each group describes a section of properties
|
59 |
|
|
Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
|
60 |
|
|
Set<Integer> groupIdSet = groupMap.keySet();
|
61 |
5028
|
daigle
|
|
62 |
|
|
|
63 |
4080
|
daigle
|
for (Integer groupId : groupIdSet) {
|
64 |
|
|
// for this group, display the header (group name)
|
65 |
|
|
MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
|
66 |
5028
|
daigle
|
if (groupId == 0) {
|
67 |
|
|
// get all the properties in this group
|
68 |
|
|
Map<Integer, MetaDataProperty> propertyMap =
|
69 |
|
|
metadata.getPropertiesInGroup(metaDataGroup.getIndex());
|
70 |
|
|
Set<Integer> propertyIndexes = propertyMap.keySet();
|
71 |
|
|
// iterate through each property and display appropriately
|
72 |
|
|
for (Integer propertyIndex : propertyIndexes) {
|
73 |
|
|
MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
|
74 |
|
|
String fieldType = metaDataProperty.getFieldType();
|
75 |
|
|
if (fieldType.equals("hidden")) {
|
76 |
4080
|
daigle
|
%>
|
77 |
5028
|
daigle
|
<input type="hidden"
|
78 |
|
|
name="<%= metaDataProperty.getKey() %>"
|
79 |
|
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"/>
|
80 |
|
|
<%
|
81 |
|
|
}
|
82 |
|
|
}
|
83 |
|
|
} else {
|
84 |
|
|
%>
|
85 |
4100
|
daigle
|
<h3><%= metaDataGroup.getName() %></h3>
|
86 |
4157
|
daigle
|
<hr class="config-line">
|
87 |
4080
|
daigle
|
<%
|
88 |
|
|
// get all the properties in this group
|
89 |
|
|
Map<Integer, MetaDataProperty> propertyMap =
|
90 |
|
|
metadata.getPropertiesInGroup(metaDataGroup.getIndex());
|
91 |
|
|
Set<Integer> propertyIndexes = propertyMap.keySet();
|
92 |
|
|
// iterate through each property and display appropriately
|
93 |
|
|
for (Integer propertyIndex : propertyIndexes) {
|
94 |
|
|
MetaDataProperty metaDataProperty = propertyMap.get(propertyIndex);
|
95 |
|
|
String fieldType = metaDataProperty.getFieldType();
|
96 |
|
|
if (fieldType.equals("select")) {
|
97 |
|
|
%>
|
98 |
4258
|
daigle
|
<div class="form-row">
|
99 |
7424
|
leinfelder
|
<img class="question-mark" src="style/images/help.png"
|
100 |
4258
|
daigle
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
101 |
|
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>"><%= metaDataProperty.getLabel() %></label></div>
|
102 |
|
|
<select class="textinput" name="<%= metaDataProperty.getKey() %>">
|
103 |
4080
|
daigle
|
<%
|
104 |
4100
|
daigle
|
Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
|
105 |
|
|
Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
|
106 |
|
|
for (int i = 0; i < fieldOptionNames.size(); i++) {
|
107 |
4080
|
daigle
|
%>
|
108 |
4402
|
daigle
|
<option value="<%= fieldOptionValues.elementAt(i) %>"
|
109 |
4080
|
daigle
|
<%
|
110 |
4402
|
daigle
|
if (fieldOptionValues.elementAt(i).equals(request.getAttribute(metaDataProperty.getKey()))) {
|
111 |
|
|
%>
|
112 |
|
|
selected="yes"
|
113 |
|
|
<%
|
114 |
|
|
}
|
115 |
|
|
%>
|
116 |
|
|
> <%= fieldOptionNames.elementAt(i) %>
|
117 |
|
|
<%
|
118 |
4080
|
daigle
|
}
|
119 |
|
|
%>
|
120 |
|
|
</select>
|
121 |
4258
|
daigle
|
</div>
|
122 |
4080
|
daigle
|
<%
|
123 |
|
|
} else if (fieldType.equals("password")) {
|
124 |
|
|
%>
|
125 |
4258
|
daigle
|
<div class="form-row">
|
126 |
7424
|
leinfelder
|
<img class="question-mark" src="style/images/help.png"
|
127 |
4258
|
daigle
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
128 |
|
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>" ><%= metaDataProperty.getLabel() %></label></div>
|
129 |
|
|
<input class="textinput" id="<%= metaDataProperty.getKey() %>"
|
130 |
|
|
name="<%= metaDataProperty.getKey() %>"
|
131 |
4153
|
daigle
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
|
132 |
4258
|
daigle
|
type="<%= fieldType %>"/>
|
133 |
|
|
</div>
|
134 |
|
|
<%
|
135 |
6864
|
leinfelder
|
} else if (fieldType.equals("hidden")) {
|
136 |
|
|
%>
|
137 |
|
|
<input id="<%= metaDataProperty.getKey() %>"
|
138 |
|
|
name="<%= metaDataProperty.getKey() %>"
|
139 |
|
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
|
140 |
|
|
type="<%= fieldType %>"/>
|
141 |
|
|
<%
|
142 |
4080
|
daigle
|
} else {
|
143 |
|
|
%>
|
144 |
4258
|
daigle
|
<div class="form-row">
|
145 |
|
|
<img class="question-mark" class=question-mark
|
146 |
7424
|
leinfelder
|
src="style/images/help.png"
|
147 |
4176
|
daigle
|
onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"/>
|
148 |
4258
|
daigle
|
<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %> "><%= metaDataProperty.getLabel() %></label> </div>
|
149 |
|
|
<input class="textinput" id="<%= metaDataProperty.getKey() %>"
|
150 |
|
|
name="<%= metaDataProperty.getKey() %>"
|
151 |
|
|
value="<%= request.getAttribute(metaDataProperty.getKey()) %>"
|
152 |
|
|
type="<%= fieldType %> "/>
|
153 |
|
|
</div>
|
154 |
4080
|
daigle
|
<%
|
155 |
|
|
}
|
156 |
4157
|
daigle
|
|
157 |
6864
|
leinfelder
|
if (metaDataProperty.getDescription() != null && metaDataProperty.getDescription().trim().length() > 0 ) {
|
158 |
4157
|
daigle
|
%>
|
159 |
4258
|
daigle
|
|
160 |
|
|
<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
|
161 |
4157
|
daigle
|
<%
|
162 |
|
|
}
|
163 |
4080
|
daigle
|
}
|
164 |
5028
|
daigle
|
}
|
165 |
4080
|
daigle
|
}
|
166 |
5028
|
daigle
|
|
167 |
4080
|
daigle
|
}
|
168 |
|
|
%>
|
169 |
|
|
|
170 |
|
|
<input type="hidden" name="configureType" value="properties"/>
|
171 |
|
|
<input type="hidden" name="processForm" value="true"/>
|
172 |
|
|
<input class=left-button type="submit" value="Save"/>
|
173 |
|
|
<input class=button type="button" value="Cancel" onClick="forward('./admin')">
|
174 |
|
|
|
175 |
|
|
</form>
|
176 |
|
|
|
177 |
4557
|
daigle
|
<%@ include file="./footer-section.jsp"%>
|
178 |
|
|
|
179 |
4080
|
daigle
|
</body>
|
180 |
|
|
</html>
|