001/**
002 * Copyright 2005-2018 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.xml.spring;
017
018import java.util.List;
019
020import org.kuali.common.util.properties.Location;
021import org.kuali.common.util.properties.PropertiesLocationService;
022import org.kuali.common.util.properties.spring.PropertiesLocationServiceConfig;
023import org.springframework.beans.factory.annotation.Autowired;
024import org.springframework.context.annotation.Bean;
025import org.springframework.context.annotation.Configuration;
026import org.springframework.context.annotation.Import;
027
028import com.google.common.collect.ImmutableList;
029import com.google.common.collect.Lists;
030
031/**
032 * Defines the property locations for the workflow XML ingestion process.
033 *
034 * @author Kuali Rice Team (rice.collab@kuali.org)
035 */
036@Configuration
037@Import({ PropertiesLocationServiceConfig.class })
038public class IngestXmlPropertyLocationsConfig {
039
040    /**
041     * The property file locator.
042     */
043        @Autowired
044        PropertiesLocationService service;
045
046    /**
047     * Returns a list of locations of Rice properties to run the workflow XML ingestion process.
048     *
049     * @return a list of locations of Rice properties to run the workflow XML ingestion process
050     */
051        @Bean
052        public ImmutableList<Location> riceIngestXmlPropertyLocations() {
053                List<Location> locations = Lists.newArrayList();
054
055                locations.add(service.getLocation(RiceXmlProperties.DB.getResource()));
056
057                return ImmutableList.copyOf(locations);
058        }
059
060}