001 /**
002 * Copyright 2005-2012 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.location.impl.config;
017
018 import org.kuali.rice.core.api.config.module.RunMode;
019 import org.kuali.rice.core.framework.config.module.ModuleConfigurer;
020 import org.kuali.rice.location.api.LocationConstants;
021
022 import java.util.ArrayList;
023 import java.util.Arrays;
024 import java.util.List;
025
026 /**
027 * Allows for configuring a client to the "location" module in Kuali Rice.
028 *
029 * <p>The LocationConfigurer supports two run modes:
030 * <ol>
031 * <li>REMOTE - loads the client which interacts remotely with the location services</li>
032 * <li>LOCAL - loads the location service implementations and web components locally</li>
033 * </ol>
034 * </p>
035 *
036 * <p>Client applications should generally only use "remote" run mode (which is the default).</p>
037 *
038 * @author Kuali Rice Team (rice.collab@kuali.org)
039 */
040 public class LocationConfigurer extends ModuleConfigurer {
041
042 public LocationConfigurer() {
043 super(LocationConstants.Namespaces.MODULE_NAME);
044 setValidRunModes(Arrays.asList(RunMode.REMOTE, RunMode.LOCAL));
045 }
046
047 @Override
048 public List<String> getPrimarySpringFiles() {
049 List<String> springFileLocations = new ArrayList<String>();
050 if (RunMode.REMOTE == getRunMode()) {
051 springFileLocations.add(getDefaultConfigPackagePath() + "LocationRemoteSpringBeans.xml");
052 } else if (RunMode.LOCAL == getRunMode()) {
053 springFileLocations.add(getDefaultConfigPackagePath() + "LocationLocalSpringBeans.xml");
054 }
055 return springFileLocations;
056 }
057
058
059 }