Index: src/edu/ucsb/nceas/metacat/admin/OrganizationAdmin.java
===================================================================
--- src/edu/ucsb/nceas/metacat/admin/OrganizationAdmin.java	(revision 4701)
+++ src/edu/ucsb/nceas/metacat/admin/OrganizationAdmin.java	(nonexistent)
@@ -1,249 +0,0 @@
-/**
- *  '$RCSfile$'
- *    Purpose: A Class that implements organization configuration methods
- *  Copyright: 2008 Regents of the University of California and the
- *             National Center for Ecological Analysis and Synthesis
- *    Authors: Michael Daigle
- *
- *   '$Author$'
- *     '$Date$'
- * '$Revision$'
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-package edu.ucsb.nceas.metacat.admin;
-
-import java.io.IOException;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.log4j.Logger;
-
-import edu.ucsb.nceas.metacat.service.PropertyService;
-import edu.ucsb.nceas.metacat.util.OrganizationUtil;
-import edu.ucsb.nceas.metacat.util.RequestUtil;
-import edu.ucsb.nceas.metacat.util.UtilException;
-import edu.ucsb.nceas.utilities.FileUtil;
-import edu.ucsb.nceas.utilities.GeneralPropertyException;
-import edu.ucsb.nceas.utilities.PropertiesMetaData;
-import edu.ucsb.nceas.utilities.PropertyNotFoundException;
-import edu.ucsb.nceas.utilities.SortedProperties;
-
-/**
- * Control the display of the organization configuration page and the processing
- * of the configuration values.
- */
-public class OrganizationAdmin extends MetaCatAdmin {
-
-	private static OrganizationAdmin organizationAdmin = null;
-	private static Logger logMetacat = Logger.getLogger(OrganizationAdmin.class);
-
-	/**
-	 * private constructor since this is a singleton
-	 */
-	private OrganizationAdmin() {}
-
-	/**
-	 * Get the single instance of the MetaCatConfig.
-	 * 
-	 * @return the single instance of MetaCatConfig
-	 */
-	public static OrganizationAdmin getInstance() {
-		if (organizationAdmin == null) {
-			organizationAdmin = new OrganizationAdmin();
-		}
-		return organizationAdmin;
-	}
-	
-	/**
-	 * Handle configuration of the Organization properties
-	 * 
-	 * @param request
-	 *            the http request information
-	 * @param response
-	 *            the http response to be sent back to the client
-	 */
-	public void configureOrganization(HttpServletRequest request,
-			HttpServletResponse response) throws AdminException {
-
-		String processForm = request.getParameter("processForm");
-		String formErrors = (String) request.getAttribute("formErrors");
-
-		if (processForm == null || !processForm.equals("true") || formErrors != null) {
-			// The servlet configuration parameters have not been set, or there
-			// were form errors on the last attempt to configure, so redirect to
-			// the web form for configuring metacat
-			
-			try {
-				// Load the properties metadata file so that the JSP page can
-				// use
-				// the metadata to construct the editing form
-				PropertiesMetaData metadata = PropertyService.getOrgMetaData();
-				request.setAttribute("metadata", metadata);
-				request.setAttribute("groupMap", metadata.getGroups());
-				
-				request.setAttribute("orgList", OrganizationUtil.getOrganizations());
-
-				// add the list of organization options and their values to the request
-				Vector<String> propertyNames = 
-					PropertyService.getPropertyNamesByGroup("organization");
-				for (String name : propertyNames) {
-					request.setAttribute(name, PropertyService.getProperty(name));
-				} 
-
-				// Check for any backup properties and apply them to the request.
-				// These are properties from previous configurations. They keep
-				// the user from having to re-enter all values when upgrading.
-				// If this is a first time install, getBackupProperties will return
-				// null.
-				SortedProperties backupProperties = PropertyService.getOrgBackupProperties();
-				if (backupProperties != null) {
-					Vector<String> backupKeys = backupProperties.getPropertyNames();
-					for (String key : backupKeys) {
-						String value = backupProperties.getProperty(key);
-						if (value != null) {
-							request.setAttribute(key, value);
-						}
-					}
-				}
-				// Forward the request to the JSP page
-				RequestUtil.forwardRequest(request, response,
-						"/admin/organization-configuration.jsp");
-			} catch (PropertyNotFoundException pnfe) {
-				throw new AdminException("Problem getting property while initializing "
-						+ "organization properties page: " + pnfe.getMessage());
-			} catch (UtilException ue) {
-				throw new AdminException("Utility problem while " 
-						+ "initializing organization properties page: " + ue.getMessage());
-			} catch (IOException ioe) {
-				throw new AdminException("IO problem while initializing "
-						+ "organization properties page:" + ioe.getMessage());
-			} catch (ServletException se) {
-				throw new AdminException("problem forwarding request while " 
-						+ "initializing organization properties page: " + se.getMessage());
-			}
-		} else {
-			// The configuration form is being submitted and needs to be
-			// processed.
-			Vector<String> processingSuccess = new Vector<String>();
-			Vector<String> processingErrors = new Vector<String>();
-			Vector<String> validationErrors = new Vector<String>();
-
-			try {
-				// For each property, check if it is changed and save it
-				PropertiesMetaData orgMetaData = 
-					PropertyService.getOrgMetaData();
-
-				Set<String> orgKeys = orgMetaData.getKeys();
-				for (String orgName : OrganizationUtil.getOrganizations()) {
-					for (String key : orgKeys) {
-						PropertyService.checkAndSetProperty(request, key + "." + orgName);
-					}
-				}
-
-				// we need to write the options from memory to the properties
-				// file
-				PropertyService.persistProperties();
-
-				// Validate that the options provided are legitimate. Note that
-				// we've allowed them to persist their entries. As of this point
-				// there is no other easy way to go back to the configure form
-				// and preserve their entries.
-				validationErrors.addAll(validateOptions(request));
-
-				// Try to create data file and backup directories if
-				// necessary.
-				String backupDir = PropertyService.getBackupDir();
-				try {
-					FileUtil.createDirectory(backupDir);
-				} catch (IOException ioe) {
-					String errorString = "Could not create directory: " + backupDir
-							+ " : " + ioe.getMessage();
-					logMetacat.error(errorString);
-					validationErrors.add(errorString);
-				}
-
-				// Write out the configurable properties to a backup file
-				// outside the install directory.  Note that we allow them to
-				// do this even if they have validation errors.  They will
-				// need to go back and fix the errors before they can run metacat.
-				PropertyService.persistOrgBackupProperties(request.getSession()
-						.getServletContext());
-			
-			} catch (GeneralPropertyException gpe) {
-				String errorMessage = "Problem getting or setting property while "
-					+ "processing organization properties page: " + gpe.getMessage();
-				logMetacat.error(errorMessage);
-				processingErrors.add(errorMessage);
-			} catch (UtilException ue) {
-				String errorMessage = "Error in utilities while: " 
-						+ "processing organization properties page: " + ue.getMessage();
-				logMetacat.error(errorMessage);
-				processingErrors.add(errorMessage);
-			}
-			
-			try {
-				if (validationErrors.size() > 0 || processingErrors.size() > 0) {
-					RequestUtil.clearRequestMessages(request);
-					RequestUtil.setRequestFormErrors(request, validationErrors);
-					RequestUtil.setRequestErrors(request, processingErrors);
-					RequestUtil.forwardRequest(request, response, "/admin");
-				} else {
-					// Now that the options have been set, change the
-					// 'organizationsConfigured' option to 'true'
-					PropertyService.setProperty("configutil.organizationsConfigured",
-							PropertyService.CONFIGURED);
-					
-					// Reload the main metacat configuration page
-					processingSuccess.add("Organizations successfully configured");
-					RequestUtil.clearRequestMessages(request);
-					RequestUtil.setRequestSuccess(request, processingSuccess);
-					RequestUtil.forwardRequest(request, response,
-							"/admin?configureType=configure&processForm=false");
-				}
-			} catch (ServletException se) {
-				throw new AdminException("problem forwarding request while "
-						+ "processing organization properties page: " + se.getMessage());
-			} catch (IOException ioe) {
-				throw new AdminException("IO problem while processing organization "
-						+ "properties page: " + ioe.getMessage());
-			} catch (GeneralPropertyException gpe) {
-				String errorMessage = "Problem getting or setting property while "
-					+ "processing organization properties page: " + gpe.getMessage();
-				logMetacat.error(errorMessage);
-				processingErrors.add(errorMessage);
-			}
-		}
-	}
-	
-	/**
-	 * Validate the most important configuration options submitted by the user.
-	 * 
-	 * @return a vector holding error message for any fields that fail
-	 *         validation.
-	 */
-	protected Vector<String> validateOptions(HttpServletRequest request) {
-		Vector<String> errorVector = new Vector<String>();
-
-		//TODO MCD validate options.
-
-		return errorVector;
-	}
-}
\ No newline at end of file

Property changes on: src/edu/ucsb/nceas/metacat/admin/OrganizationAdmin.java
___________________________________________________________________
Deleted: svn:eol-style
## -1 +0,0 ##
-native
\ No newline at end of property
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Deleted: svn:keywords
## -1 +0,0 ##
-Author Date Id Revision
\ No newline at end of property
