Coverage Report - org.kuali.rice.krad.service.impl.KFSModuleServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
KFSModuleServiceImpl
0%
0/24
0%
0/4
1.25
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
  * Module service that adds support for the kfs Step class.
 26  
  */
 27  0
 public class KFSModuleServiceImpl implements KualiModuleService {
 28  
 
 29  
     //inject with the rice service
 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  
             //once this is pushed into kfs should not use class token directly
 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  
 }