001 /*
002 * Copyright 2006-2011 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
017 package org.kuali.rice.kim.config;
018
019 import org.kuali.rice.core.api.config.module.RunMode;
020 import org.kuali.rice.core.impl.config.module.ModuleConfigurer;
021
022 import java.util.ArrayList;
023 import java.util.List;
024
025 /**
026 * This class handles the Spring based KIM configuration that is part of the Rice Configurer that must
027 * exist in all Rice based systems and clients.
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 */
031 public class KIMConfigurer extends ModuleConfigurer {
032 private static final String KIM_INTERFACE_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/config/KIMInterfaceSpringBeans.xml";
033 private static final String KIM_IMPL_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/config/KIMImplementationSpringBeans.xml";
034 private static final String KIM_KSB_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/config/KIMServiceBusSpringBeans.xml";
035 private static final String KIM_KSB_SOAP_DEFAULT_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/config/KIMServiceBusSOAPDefaultSpringBeans.xml";
036 private static final String KIM_UI_SPRING_BEANS_PATH = "classpath:org/kuali/rice/kim/config/KIMUserInterfaceSpringBeans.xml";
037
038 @Override
039 public List<String> getPrimarySpringFiles() {
040 final List<String> springFileLocations = new ArrayList<String>();
041 springFileLocations.add( KIM_INTERFACE_SPRING_BEANS_PATH );
042 if ( getRunMode().equals( RunMode.LOCAL ) || getRunMode().equals( RunMode.EMBEDDED ) ) {
043 springFileLocations.add(KIM_IMPL_SPRING_BEANS_PATH);
044 }
045 if ( isExposeServicesOnBus() ) {
046 if (isSetSOAPServicesAsDefault()) {
047 springFileLocations.add(KIM_KSB_SOAP_DEFAULT_SPRING_BEANS_PATH);
048 } else {
049 springFileLocations.add(KIM_KSB_SPRING_BEANS_PATH);
050 }
051 }
052 if ( isIncludeUserInterfaceComponents() ) {
053 springFileLocations.add(KIM_UI_SPRING_BEANS_PATH);
054 }
055 return springFileLocations;
056 }
057 }