1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kns.datadictionary.spring; |
18 | |
|
19 | |
import org.kuali.rice.core.api.config.ConfigurationException; |
20 | |
import org.kuali.rice.kns.service.DataDictionaryService; |
21 | |
import org.kuali.rice.kns.service.KNSServiceLocatorWeb; |
22 | |
import org.springframework.beans.factory.InitializingBean; |
23 | |
|
24 | |
import java.util.List; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
public class DataDictionaryLocationConfigurer implements InitializingBean { |
32 | |
|
33 | |
private List<String> dataDictionaryPackages; |
34 | |
|
35 | |
private DataDictionaryService dataDictionaryService; |
36 | |
|
37 | 0 | public DataDictionaryLocationConfigurer(DataDictionaryService dataDictionaryService){ |
38 | 0 | this.dataDictionaryService = dataDictionaryService; |
39 | 0 | } |
40 | |
|
41 | |
public void afterPropertiesSet() throws Exception { |
42 | 0 | if (dataDictionaryPackages == null || dataDictionaryPackages.isEmpty()) { |
43 | 0 | throw new ConfigurationException("datatDictionaryPackages empty when initializing DataDictionaryLocation bean."); |
44 | |
} |
45 | 0 | if(dataDictionaryService!=null) |
46 | 0 | dataDictionaryService.addDataDictionaryLocations(getDataDictionaryPackages()); |
47 | |
else |
48 | 0 | KNSServiceLocatorWeb.getDataDictionaryService().addDataDictionaryLocations(getDataDictionaryPackages()); |
49 | 0 | } |
50 | |
|
51 | |
public List<String> getDataDictionaryPackages() { |
52 | 0 | return dataDictionaryPackages; |
53 | |
} |
54 | |
|
55 | |
public void setDataDictionaryPackages(List<String> dataDictionaryPackages) { |
56 | 0 | this.dataDictionaryPackages = dataDictionaryPackages; |
57 | 0 | } |
58 | |
|
59 | |
} |