Coverage Report - org.kuali.student.enrollment.class2.courseoffering.service.impl.FormatOfferingInfoLookupableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
FormatOfferingInfoLookupableImpl
0%
0/21
0%
0/4
5
 
 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  
  */
 16  
 package org.kuali.student.enrollment.class2.courseoffering.service.impl;
 17  
 
 18  
 import org.kuali.rice.krad.lookup.LookupableImpl;
 19  
 import org.kuali.rice.krad.web.form.LookupForm;
 20  
 import org.kuali.student.enrollment.class2.courseoffering.util.CourseOfferingResourceLoader;
 21  
 import org.kuali.student.enrollment.common.util.ContextBuilder;
 22  
 import org.kuali.student.enrollment.courseoffering.dto.FormatOfferingInfo;
 23  
 import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService;
 24  
 import org.kuali.student.r2.common.dto.ContextInfo;
 25  
 import org.kuali.student.r2.common.exceptions.*;
 26  
 
 27  
 import java.util.ArrayList;
 28  
 import java.util.List;
 29  
 import java.util.Map;
 30  
 
 31  
 /**
 32  
  * This class //TODO ...
 33  
  *
 34  
  * @author Kuali Student Team
 35  
  */
 36  0
 public class FormatOfferingInfoLookupableImpl extends LookupableImpl {
 37  
     public final static String COURSE_OFFER_ID = "courseOfferingId";
 38  
     private transient CourseOfferingService courseOfferingService;
 39  0
     private ContextInfo contextInfo = null;
 40  
 
 41  
     @Override
 42  
     protected List<?> getSearchResults(LookupForm lookupForm, Map<String, String> fieldValues, boolean unbounded) {
 43  
         List<FormatOfferingInfo> formatOfferingInfos;
 44  
 
 45  
         try {
 46  0
             formatOfferingInfos = getCourseOfferingService().getFormatOfferingsByCourseOffering(fieldValues.get(COURSE_OFFER_ID), getContextInfo());
 47  0
         } catch (DoesNotExistException e) {
 48  0
             throw new RuntimeException(e);
 49  0
         } catch (InvalidParameterException e) {
 50  0
             throw new RuntimeException(e);
 51  0
         } catch (MissingParameterException e) {
 52  0
             throw new RuntimeException(e);
 53  0
         } catch (OperationFailedException e) {
 54  0
             throw new RuntimeException(e);
 55  0
         } catch (PermissionDeniedException e) {
 56  0
             throw new RuntimeException(e);
 57  0
         }
 58  
 
 59  0
         return formatOfferingInfos;
 60  
     }
 61  
 
 62  
     public CourseOfferingService getCourseOfferingService() {
 63  0
         if(courseOfferingService == null)
 64  0
             courseOfferingService= CourseOfferingResourceLoader.loadCourseOfferingService();
 65  0
         return courseOfferingService;
 66  
     }
 67  
 
 68  
     public ContextInfo getContextInfo() {
 69  0
         if (contextInfo == null){
 70  0
             contextInfo =  ContextBuilder.loadContextInfo();
 71  
         }
 72  0
         return contextInfo;
 73  
     }
 74  
 }