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