001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.location.impl.config;
017
018import org.kuali.rice.core.api.config.module.RunMode;
019import org.kuali.rice.core.framework.config.module.ModuleConfigurer;
020import org.kuali.rice.location.api.LocationConstants;
021
022import java.util.ArrayList;
023import java.util.Arrays;
024import 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 */
040public 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}