Project

General

Profile

« Previous | Next » 

Revision 8532

Added by Jing Tao over 10 years ago

Add code to persist the properties in the group 3.

View differences:

src/edu/ucsb/nceas/metacat/admin/AuthAdmin.java
54 54

  
55 55
	private static AuthAdmin authAdmin = null;
56 56
	private static Logger logMetacat = Logger.getLogger(AuthAdmin.class);
57

  
57
	private static final String AUTHCLASSKEY = "auth.class";
58
	public static final String FILECLASS = "edu.ucsb.nceas.metacat.authentication.AuthFile";
59
    public static final String LDAPCLASS = "edu.ucsb.nceas.metacat.AuthLdap";
58 60
	/**
59 61
	 * private constructor since this is a singleton
60 62
	 */
......
161 163
							globalPropertyKey);
162 164
				}
163 165
				
164
				// process the fields for the global options (group 1)
165
				SortedMap<Integer, MetaDataProperty> authClientPropertyMap = authMetaData
166
				//String authClassName = request.getParameter(AUTHCLASSKEY);
167
				//System.out.println("the auth class name from the request is "+authClassName);
168
				// process the fields for the file-based options (group 2)
169
				SortedMap<Integer, MetaDataProperty> filePropertyMap = authMetaData
166 170
						.getPropertiesInGroup(2);
167
				Set<Integer> authClientPropertyIndexes = authClientPropertyMap.keySet();
168
				for (Integer authClientPropertyIndex : authClientPropertyIndexes) {
169
					String authClientPropertyKey = authClientPropertyMap.get(
170
							authClientPropertyIndex).getKey();
171
				Set<Integer> filePropertyIndexes = filePropertyMap.keySet();
172
				for (Integer filePropertyIndex : filePropertyIndexes) {
173
					String filePropertyKey = filePropertyMap.get(
174
							filePropertyIndex).getKey();
171 175
					PropertyService.checkAndSetProperty(request,
172
							authClientPropertyKey);
176
							filePropertyKey);
173 177
				}
178
				
179
				// process the fields for the ldap-based options (group 3)
180
                SortedMap<Integer, MetaDataProperty> ldapPropertyMap = authMetaData
181
                        .getPropertiesInGroup(3);
182
                Set<Integer> ldapPropertyIndexes = ldapPropertyMap.keySet();
183
                for (Integer ldapPropertyIndex : ldapPropertyIndexes) {
184
                    String ldapPropertyKey = ldapPropertyMap.get(
185
                            ldapPropertyIndex).getKey();
186
                    PropertyService.checkAndSetProperty(request,
187
                            ldapPropertyKey);
188
                }
174 189

  
175 190
				// we need to write the options from memory to the properties
176 191
				// file

Also available in: Unified diff