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: 2008-07-24 13:52:51 -0700 (Thu, 24 Jul 2008) $'
12
 * '$Revision: 4159 $'
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
<%
31
	PropertiesMetaData metadata = (PropertiesMetaData)request.getAttribute("metadata");
32
 	Vector<String> ldapOrganizations = 
33
 		(Vector<String>)request.getAttribute("orgList"); 
34
%>
35

    
36
<html>
37
<head>
38

    
39
<title>Organization Configuration</title>
40
<link rel="stylesheet" type="text/css" 
41
        href="<%= request.getContextPath() %>/admin/admin.css"></link>
42
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/admin/admin.js"></script>
43
<script language="JavaScript" type="text/JavaScript" src="<%= request.getContextPath() %>/help/help.js"></script>
44

    
45
</head>
46
<body>
47
<img src="<%= request.getContextPath() %>/metacat-logo.png" width="100px" align="right"/> 
48
<h2>Organization Configuration</h2>
49
Enter organization specific properties here. 
50
<br class="ldap-header">
51

    
52
<%@ include file="./page-message-section.jsp"%>
53

    
54

    
55
<form method="POST" name="configuration_form" action="<%= request.getContextPath() %>/admin" 
56
                                        onsubmit="return submitForm(this);">
57
<%
58
	if (metadata != null) {
59
		// each group describes a section of properties
60
		Map<Integer, MetaDataGroup> groupMap = metadata.getGroups();
61
		Set<Integer> groupIdSet = groupMap.keySet();
62
		for (Integer groupId : groupIdSet) {
63
			// for this group, display the header (group name)
64
			MetaDataGroup metaDataGroup = (MetaDataGroup)groupMap.get(groupId);
65
%>
66
			<h3><%= metaDataGroup.getName()  %></h3>
67
			<hr class="config-line">
68
<%
69
 			if (metaDataGroup.getComment() != null) {
70
%>
71
  				<div class="heading-comment"><%= metaDataGroup.getComment() %></div>
72
<%
73
 			}
74
%>
75
			<br>
76
<%
77
			for (String orgName : ldapOrganizations) {
78
%>
79
			<table class="config-section">
80
				<tr>
81
				<td class="config-checkbox">
82
	  				<input class="org" type="checkbox" name="<%= orgName %>.cb" onClick="toggleHiddenTable(this, 'hiding-section-<%= orgName %>')"/>
83
	  			</td>
84
	  			<td class="config-checkbox-label">	
85
					<label for="<%= orgName %>.cb"><%=orgName%></label>
86
				</td> 
87
				<td class="config-question-mark">
88
					<img src="style/images/question-mark.gif"
89
							alt="blah"
90
							title="blah"/>
91
				</td>
92
				</tr>
93
			</table>
94
			<table class="config-section-hiding" id="hiding-section-<%= orgName %>">  
95
<%
96
				// get all the properties in this group
97
				Map<Integer, MetaDataProperty> propertyMap = 
98
					metadata.getPropertiesInGroup(metaDataGroup.getIndex());
99
				Set<Integer> orgIndexes = propertyMap.keySet();
100
	  			for (Integer orgIndex : orgIndexes) {
101
	  				MetaDataProperty orgProperty = propertyMap.get(orgIndex);
102
	  				String orgKeyName = orgProperty.getKey() + "." + orgName;
103
%>		
104
				<tr>
105
				<td class="config-property-label" >	
106
	    			<label for="<%= orgKeyName %>" title="<%= orgProperty.getDescription() %>"><%= orgProperty.getLabel() %></label>
107
     			</td>	
108
     			<td class="config-property-input" >
109
					<input name="<%= orgKeyName %>" 
110
						value="<%= request.getAttribute(orgKeyName) %>"	  
111
<% 
112
					if (orgProperty.getFieldType().equals("password")) { 
113
%>           		    	    	           		    	             			
114
	           			type="password"       
115
<%
116
	  				}
117
%>    			
118
	           			alt="List of administrators for this installation in LDAP DN syntax (colon separated)"/>	           		    
119
				</td>
120
				<td class="config-question-mark">
121
					<img src="style/images/question-mark.gif" onClick="helpWindow('<%= request.getContextPath() %>', '<%= orgProperty.getHelpFile() %>')"/>
122
				</td>
123
				</tr>	  
124
<%
125
				if (orgProperty.getDescription() != null) {
126
%>
127
	    	        <tr>
128
	    	        <td></td>
129
	    	        <td class="config-property-description" colspan="2" >
130
						<%= orgProperty.getDescription() %>
131
	    	        </td>
132
<%
133
	    			}
134
	  			}
135
%>
136
      		</table>
137
<%
138
			}
139
		}
140
	}
141
%>
142

    
143
  <input type="hidden" name="configureType" value="organization"/>
144
  <input type="hidden" name="processForm" value="true"/>
145
  <input class="left-button" type="submit" value="Save"/>
146
  <input class="button" type="button" value="Cancel" onClick="forward('./admin')"> 
147

    
148
</form>
149

    
150
</body>
151
</html>
(9-9/12)