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 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 ClassLoader cl = ClassLoaderUtils.getDefaultClassLoader();
37
38 clazz = Class.forName("org.kuali.kfs.sys.batch.Step", true, cl);
39 } catch (Exception e) {
40 throw new RuntimeException(e);
41 }
42 STEP_CLASS = clazz;
43 }
44
45
46 @Override
47 public List<ModuleService> getInstalledModuleServices() {
48 return kualiModuleService.getInstalledModuleServices();
49 }
50
51 @Override
52 public ModuleService getModuleService(String moduleId) {
53 return kualiModuleService.getModuleService(moduleId);
54 }
55
56 @Override
57 public ModuleService getModuleServiceByNamespaceCode(String namespaceCode) {
58 return kualiModuleService.getModuleServiceByNamespaceCode(namespaceCode);
59 }
60
61 @Override
62 public boolean isModuleServiceInstalled(String namespaceCode) {
63 return kualiModuleService.isModuleServiceInstalled(namespaceCode);
64 }
65
66 @Override
67 public ModuleService getResponsibleModuleService(Class boClass) {
68 return kualiModuleService.getResponsibleModuleService(boClass);
69 }
70
71 @Override
72 public ModuleService getResponsibleModuleServiceForJob(String jobName) {
73 return kualiModuleService.getResponsibleModuleServiceForJob(jobName);
74 }
75
76 @Override
77 public void setInstalledModuleServices(List<ModuleService> moduleServices) {
78 kualiModuleService.setInstalledModuleServices(moduleServices);
79 }
80
81 @Override
82 public List<String> getDataDictionaryPackages() {
83 return kualiModuleService.getDataDictionaryPackages();
84 }
85
86 @Override
87 public String getNamespaceName(String namespaceCode) {
88 return kualiModuleService.getNamespaceName(namespaceCode);
89 }
90
91 @Override
92 public String getNamespaceCode(Class<?> documentOrStepClass) {
93 if (STEP_CLASS != null && STEP_CLASS.isAssignableFrom(documentOrStepClass)) {
94 return documentOrStepClass.getSimpleName();
95 }
96
97 return kualiModuleService.getNamespaceCode(documentOrStepClass);
98 }
99
100 @Override
101 public String getComponentCode(Class<?> documentOrStepClass) {
102 return kualiModuleService.getComponentCode(documentOrStepClass);
103 }
104
105 public void setKualiModuleService(KualiModuleService kualiModuleService) {
106 this.kualiModuleService = kualiModuleService;
107 }
108 }