Coverage Report - org.kuali.student.enrollment.class2.courseoffering.service.impl.EnrollmentFeeInquirableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
EnrollmentFeeInquirableImpl
0%
0/24
0%
0/8
2
 
 1  
 /**
 2  
  * Copyright 2012 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 package org.kuali.student.enrollment.class2.courseoffering.service.impl;
 16  
 
 17  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 18  
 import org.kuali.rice.krad.inquiry.InquirableImpl;
 19  
 import org.kuali.rice.krad.util.GlobalVariables;
 20  
 import org.kuali.student.enrollment.class2.courseoffering.util.CourseOfferingResourceLoader;
 21  
 import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService;
 22  
 import org.kuali.student.r2.common.dto.ContextInfo;
 23  
 import org.kuali.student.r2.common.dto.LocaleInfo;
 24  
 import org.kuali.student.r2.common.util.constants.FeeServiceConstants;
 25  
 import org.kuali.student.r2.core.fee.dto.EnrollmentFeeInfo;
 26  
 import org.kuali.student.r2.core.fee.service.FeeService;
 27  
 
 28  
 import javax.xml.namespace.QName;
 29  
 import java.util.Locale;
 30  
 import java.util.Map;
 31  
 
 32  
 /**
 33  
  * This class //TODO ...
 34  
  *
 35  
  * @author Kuali Student Team
 36  
  */
 37  0
 public class EnrollmentFeeInquirableImpl extends InquirableImpl {
 38  
 
 39  
     private FeeService feeService;
 40  
     private ContextInfo contextInfo;
 41  
 
 42  
     @Override
 43  
     public EnrollmentFeeInfo retrieveDataObject(Map<String, String> parameters) {
 44  
 
 45  0
         EnrollmentFeeInfo efiRet = null;
 46  
 
 47  
         try {
 48  0
             String id = parameters.get("id");
 49  
 
 50  0
             if(id != null && !"".equals(id)){
 51  0
                 efiRet = getFeeService().getFee(id,getContextInfo() );
 52  
             }
 53  0
         } catch (Exception e) {
 54  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 55  0
         }
 56  0
         return efiRet;
 57  
     }
 58  
 
 59  
     public FeeService getFeeService() {
 60  0
         if (feeService == null) {
 61  0
             this.feeService = (FeeService) GlobalResourceLoader.getService(new QName(FeeServiceConstants.NAMESPACE, FeeServiceConstants.SERVICE_NAME_LOCAL_PART));
 62  
         }
 63  0
         return this.feeService;
 64  
     }
 65  
 
 66  
     public void setFeeService(FeeService feeService) {
 67  0
         this.feeService = feeService;
 68  0
     }
 69  
 
 70  
     public CourseOfferingService getCourseOfferingService() {
 71  0
         return CourseOfferingResourceLoader.loadCourseOfferingService();
 72  
     }
 73  
 
 74  
     public ContextInfo getContextInfo() {
 75  0
         if (null == contextInfo) {
 76  0
             contextInfo = new ContextInfo();
 77  0
             contextInfo.setAuthenticatedPrincipalId(GlobalVariables.getUserSession().getPrincipalId());
 78  0
             contextInfo.setPrincipalId(GlobalVariables.getUserSession().getPrincipalId());
 79  0
             LocaleInfo localeInfo = new LocaleInfo();
 80  0
             localeInfo.setLocaleLanguage(Locale.getDefault().getLanguage());
 81  0
             localeInfo.setLocaleRegion(Locale.getDefault().getCountry());
 82  0
             contextInfo.setLocale(localeInfo);
 83  
         }
 84  0
         return contextInfo;
 85  
     }
 86  
 
 87  
 
 88  
 }
 89