1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krad.service.impl; |
17 | |
|
18 | |
import org.kuali.rice.core.api.util.ClassLoaderUtils; |
19 | |
import org.kuali.rice.krad.service.KualiModuleService; |
20 | |
import org.kuali.rice.krad.service.ModuleService; |
21 | |
|
22 | |
import java.util.List; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | 0 | public class KFSModuleServiceImpl implements KualiModuleService { |
28 | |
|
29 | |
|
30 | |
private KualiModuleService kualiModuleService; |
31 | |
|
32 | |
private static final Class<?> STEP_CLASS; |
33 | |
static { |
34 | |
Class<?> clazz; |
35 | |
try { |
36 | 0 | ClassLoader cl = ClassLoaderUtils.getDefaultClassLoader(); |
37 | |
|
38 | 0 | clazz = Class.forName("org.kuali.kfs.sys.batch.Step", true, cl); |
39 | 0 | } catch (Exception e) { |
40 | 0 | throw new RuntimeException(e); |
41 | 0 | } |
42 | 0 | STEP_CLASS = clazz; |
43 | 0 | } |
44 | |
|
45 | |
|
46 | |
@Override |
47 | |
public List<ModuleService> getInstalledModuleServices() { |
48 | 0 | return kualiModuleService.getInstalledModuleServices(); |
49 | |
} |
50 | |
|
51 | |
@Override |
52 | |
public ModuleService getModuleService(String moduleId) { |
53 | 0 | return kualiModuleService.getModuleService(moduleId); |
54 | |
} |
55 | |
|
56 | |
@Override |
57 | |
public ModuleService getModuleServiceByNamespaceCode(String namespaceCode) { |
58 | 0 | return kualiModuleService.getModuleServiceByNamespaceCode(namespaceCode); |
59 | |
} |
60 | |
|
61 | |
@Override |
62 | |
public boolean isModuleServiceInstalled(String namespaceCode) { |
63 | 0 | return kualiModuleService.isModuleServiceInstalled(namespaceCode); |
64 | |
} |
65 | |
|
66 | |
@Override |
67 | |
public ModuleService getResponsibleModuleService(Class boClass) { |
68 | 0 | return kualiModuleService.getResponsibleModuleService(boClass); |
69 | |
} |
70 | |
|
71 | |
@Override |
72 | |
public ModuleService getResponsibleModuleServiceForJob(String jobName) { |
73 | 0 | return kualiModuleService.getResponsibleModuleServiceForJob(jobName); |
74 | |
} |
75 | |
|
76 | |
@Override |
77 | |
public void setInstalledModuleServices(List<ModuleService> moduleServices) { |
78 | 0 | kualiModuleService.setInstalledModuleServices(moduleServices); |
79 | 0 | } |
80 | |
|
81 | |
@Override |
82 | |
public List<String> getDataDictionaryPackages() { |
83 | 0 | return kualiModuleService.getDataDictionaryPackages(); |
84 | |
} |
85 | |
|
86 | |
@Override |
87 | |
public String getNamespaceName(String namespaceCode) { |
88 | 0 | return kualiModuleService.getNamespaceName(namespaceCode); |
89 | |
} |
90 | |
|
91 | |
@Override |
92 | |
public String getNamespaceCode(Class<?> documentOrStepClass) { |
93 | 0 | if (STEP_CLASS != null && STEP_CLASS.isAssignableFrom(documentOrStepClass)) { |
94 | 0 | return documentOrStepClass.getSimpleName(); |
95 | |
} |
96 | |
|
97 | 0 | return kualiModuleService.getNamespaceCode(documentOrStepClass); |
98 | |
} |
99 | |
|
100 | |
@Override |
101 | |
public String getComponentCode(Class<?> documentOrStepClass) { |
102 | 0 | return kualiModuleService.getComponentCode(documentOrStepClass); |
103 | |
} |
104 | |
|
105 | |
public void setKualiModuleService(KualiModuleService kualiModuleService) { |
106 | 0 | this.kualiModuleService = kualiModuleService; |
107 | 0 | } |
108 | |
} |