Project

General

Profile

1
<%@ page language="java" %>
2
<%@ page import="java.util.Set,java.util.HashMap,java.util.Map,java.util.SortedMap,java.util.Vector" %>
3
<%@ page import="edu.ucsb.nceas.utilities.PropertiesMetaData" %>
4
<%@ page import="edu.ucsb.nceas.utilities.MetaDataGroup,edu.ucsb.nceas.utilities.MetaDataProperty" %>
5
<% 
6
/**
7
 *  '$RCSfile$'
8
 *    Copyright: 2008 Regents of the University of California and the
9
 *               National Center for Ecological Analysis and Synthesis
10
 *  For Details: http://www.nceas.ucsb.edu/
11
 *
12
 *   '$Author: walker $'
13
 *     '$Date: 2013-09-23 11:48:43 -0700 (Mon, 23 Sep 2013) $'
14
 * '$Revision: 8263 $'
15
 * 
16
 * This program is free software; you can redistribute it and/or modify
17
 * it under the terms of the GNU General Public License as published by
18
 * the Free Software Foundation; either version 2 of the License, or
19
 * (at your option) any later version.
20
 *
21
 * This program is distributed in the hope that it will be useful,
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 * GNU General Public License for more details.
25
 *
26
 * You should have received a copy of the GNU General Public License
27
 * along with this program; if not, write to the Free Software
28
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
 */
30
%>
31

    
32
<%
33
 	Vector<String> skinNames = (Vector<String>)request.getAttribute("skinNameList"); 
34
	String defaultStyle = (String)request.getAttribute("defaultStyle");
35
%>
36

    
37
<html>
38
<head>
39

    
40
<title>Skins Configuration</title>
41
<%@ include file="./head-section.jsp"%>
42
</head>
43
<body>
44
<%@ include file="./header-section.jsp"%>
45

    
46
<div class="document"> 
47
	<h2>Skins Configuration</h2>
48
	
49
	<%@ include file="./page-message-section.jsp"%>
50
	
51
	<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin" 
52
	                                        onsubmit="return validate_form();">
53
	
54
	
55
	<h3>Skins Configuration</h3>
56
	<div class="heading-comment message-text">
57
		NOTE: Metacat v2.2.0 includes a new mechanism for customizing the look and feel of your  
58
		Metacat deployment. MetacatUI themes can be deployed separately from the Metacat server
59
		allowing easier independent user interface customization. See the Metacat documentation 
60
		for more information on using this feature.	
61
	</div>
62
	<br/>
63
	<div class="heading-comment">
64
		Choose and configure the skins that will be available in this instance of Metacat
65
	</div>
66
	<br/>
67
	
68
	<%
69
		HashMap<String, HashMap<String, String>> allSkinProperties = 
70
			(HashMap<String, HashMap<String, String>>)request.getAttribute("skinProperties");
71
		HashMap<String, PropertiesMetaData> allMetaData = 
72
			(HashMap<String, PropertiesMetaData>)request.getAttribute("metadataMap");
73
	
74
		for (String skinName : skinNames) {
75
	%>
76
		<div class="form-row">
77
			<input class="checkradio" type="checkbox" 
78
	<%
79
			if (skinName.equals(defaultStyle)) {
80
	%>
81
				checked="yes"
82
	<%
83
			} 
84
	%>
85
				name="<%= skinName %>.cb" id="<%= skinName %>.cb"onClick="toggleHiddenTable(this, 'hiding-section-<%= skinName %>')"/>
86
			<label class="checkradio-label" for="<%= skinName %>.cb %>"><%= skinName %></label>
87
	<%
88
			if (skinName.equals(defaultStyle)) {
89
	%>		
90
				<div class="checkradio-label-inline" id="hiding-default-<%= skinName %>"> (default)</div>	
91
	<%
92
			} else {
93
	%>		
94
				<div class="checkradio-label-inline" style="display: none;" id="hiding-default-<%= skinName %>"> (default)</div>	
95
	<%
96
			} 
97
	%>
98
		</div>
99
		<div class="hiding-section" 
100
	<%
101
			if (skinName.equals(defaultStyle)) {
102
	%>
103
					style="display: block;"
104
	<%
105
			} 
106
	%>	
107
		id="hiding-section-<%= skinName %>">
108
	<%
109
			HashMap<String, String> skinProperties = allSkinProperties.get(skinName);
110
			PropertiesMetaData metaData = (PropertiesMetaData)allMetaData.get(skinName);
111
			Map<Integer, MetaDataGroup> metaDataGroups = metaData.getGroups();
112
			Set<Integer> groupKeys = metaDataGroups.keySet();
113
			for (Integer groupkey : groupKeys) {
114
				if (groupkey == 0) {
115
					continue;
116
				}
117
				SortedMap<Integer, MetaDataProperty> propertyMap = metaData.getPropertiesInGroup(groupkey);
118
				Set<Integer> propertyKeys = propertyMap.keySet();
119
	%>
120
						<input class="checkradio" type="radio" 
121
	<%
122
				if (skinName.equals(defaultStyle)) {
123
	%>
124
						checked
125
	<%
126
				} 
127
	%>
128
						name="application.default-style" id="<%= skinName %>-radio" value="<%= skinName %>" onChange="toggleHiddenDefaultText('default-flag', '<%= skinName %>')"/>
129
						<label class="checkradio-label" for="<%= skinName %>-radio"> Make  &quot;<%= skinName %>&quot; default </label>
130
	<%
131
				for (Integer propertyKey : propertyKeys) {
132
	%>		
133
	<%		
134
					MetaDataProperty metaDataProperty = propertyMap.get(propertyKey);							
135
					String fieldType = metaDataProperty.getFieldType(); 
136
					if (fieldType.equals("select")) {
137
	%>
138
					<div class="form-row"> 
139
						<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>  		
140
						<select class="textinput" name="<%= skinName %>.<%= metaDataProperty.getKey() %>">
141
	
142
	<%
143
						Vector<String> fieldOptionNames = metaDataProperty.getFieldOptionNames();
144
						Vector<String> fieldOptionValues = metaDataProperty.getFieldOptionValues();
145
						for (int i = 0; i < fieldOptionNames.size(); i++) {
146
	%>
147
							<option value="<%= fieldOptionValues.elementAt(i) %>"> <%= fieldOptionNames.elementAt(i) %>
148
	<%
149
						}
150
	%>
151
						</select>
152
						<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')""></i>
153
					</div>
154
	<%
155
						if (metaDataProperty.getDescription() != null) {
156
	%>
157
							<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
158
	<%		
159
						}   	
160
					} else if (fieldType.equals("password")) {
161
	%>	
162
					<div class="form-row">
163
						<div class="textinput-label"><label for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label></div>
164
						<input class="textinput" id="<%= skinName %>.<%= metaDataProperty.getKey() %>" name="<%= skinName %>.<%= metaDataProperty.getKey() %>" 	             		    	    	           		    	             			
165
								type="<%= fieldType %>"/> 
166
						<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i>
167
					</div>
168
	<%
169
						if (metaDataProperty.getDescription() != null) {
170
	%>
171
							<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
172
	<%		
173
						}   		
174
					} else if (fieldType.equals("checkbox")) {
175
	%>
176
					<div class="form-row">
177
						<input class="checkradio" id="<%= skinName %>.<%= metaDataProperty.getKey() %>" name="<%= skinName %>.<%= metaDataProperty.getKey() %>" 	             		    	    	           		    	             			
178
							   type="<%= fieldType %>"
179
	<%
180
						if (skinProperties.get(metaDataProperty.getKey()).equals("true")) {
181
	%>
182
								checked="yes"
183
	<%		
184
						}   
185
	%>
186
							   /> 
187
						<label class="checkradio-label" for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
188
						<i class="icon-question-sign" alt="<%= metaDataProperty.getDescription() %>" 
189
							 onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i>
190
					</div>
191
	<%
192
						if (metaDataProperty.getDescription() != null) {
193
	%>
194
							<div class="checkradio-description">[<%= metaDataProperty.getDescription() %>]</div>
195
	<%		
196
						}
197
					} else {
198
	%>
199
					<div class="form-row">
200
						<label class="textinput-label" for="<%= metaDataProperty.getKey() %>" title="<%= metaDataProperty.getDescription() %>"><%= metaDataProperty.getLabel() %></label>
201
						<input class="textinput" id="<%= skinName %>.<%= metaDataProperty.getKey() %>" name="<%= skinName %>.<%= metaDataProperty.getKey() %>" 
202
								value="<%= skinProperties.get(metaDataProperty.getKey()) %>"	             		    	    	           		    	             			
203
								type="<%= fieldType %>"/>	
204
						<i class="icon-question-sign" onClick="helpWindow('<%= request.getContextPath() %>','<%= metaDataProperty.getHelpFile() %>')"></i>
205
					</div>  
206
	<%
207
						if (metaDataProperty.getDescription() != null) {
208
	%>
209
							<div class="textinput-description">[<%= metaDataProperty.getDescription() %>]</div>
210
	<%		
211
						}         		      			
212
					}									
213
				}
214
			}
215
	
216
	%>
217
		</div>
218
	<%
219
		}
220
	%>
221
	<div class="buttons-wrapper">
222
		<input type="hidden" name="configureType" value="skins"/>
223
		<input type="hidden" name="processForm" value="true"/>
224
		<input class="button" type="submit" value="Save"/>
225
		<input class="button" type="button" value="Cancel" onClick="forward('./admin')"> 
226
	</div>
227
	</form>
228
</div>
229

    
230
<%@ include file="./footer-section.jsp"%>
231

    
232
</body>
233
</html>
(19-19/19)