Coverage Report - org.kuali.student.enrollment.class2.grading.service.impl.GradeCourseOfferringLookupHelperServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
GradeCourseOfferringLookupHelperServiceImpl
0%
0/25
0%
0/4
8
 
 1  
 package org.kuali.student.enrollment.class2.grading.service.impl;
 2  
 
 3  
 /*
 4  
  * Copyright 2007 The Kuali Foundation
 5  
  *
 6  
  * Licensed under the Educational Community License, Version 1.0 (the "License");
 7  
  * you may not use this file except in compliance with the License.
 8  
  * You may obtain a copy of the License at
 9  
  *
 10  
  * http://www.opensource.org/licenses/ecl1.php
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 
 19  
 import org.apache.commons.lang.StringUtils;
 20  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 21  
 import org.kuali.rice.kns.uif.service.impl.LookupViewHelperServiceImpl;
 22  
 import org.kuali.rice.kns.util.GlobalVariables;
 23  
 import org.kuali.student.enrollment.class2.grading.service.GradeCourseOfferringLookupHelperService;
 24  
 import org.kuali.student.enrollment.class2.grading.util.GradingConstants;
 25  
 import org.kuali.student.enrollment.courseoffering.dto.CourseOfferingInfo;
 26  
 import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService;
 27  
 import org.kuali.student.enrollment.grading.dto.GradeRosterInfo;
 28  
 import org.kuali.student.enrollment.grading.service.GradingService;
 29  
 import org.kuali.student.r2.common.dto.ContextInfo;
 30  
 import org.kuali.student.r2.common.exceptions.*;
 31  
 
 32  
 import javax.xml.namespace.QName;
 33  
 import java.util.ArrayList;
 34  
 import java.util.List;
 35  
 import java.util.Map;
 36  
 
 37  0
 public class GradeCourseOfferringLookupHelperServiceImpl extends LookupViewHelperServiceImpl implements GradeCourseOfferringLookupHelperService {
 38  
 
 39  
     @Override
 40  
     protected List<?> getSearchResultsWithBounding(Map<String, String> fieldValues, boolean unbounded) {
 41  
 
 42  0
         ContextInfo context = ContextInfo.newInstance();
 43  
 
 44  0
         String termKey = fieldValues.get("termKey");
 45  
 
 46  0
         String currentUser = GlobalVariables.getUserSession().getPrincipalId();
 47  0
         List<CourseOfferingInfo> courseOfferingInfoList = new ArrayList();
 48  
 
 49  0
         GradingService gradingService = (GradingService) GlobalResourceLoader.getService(new QName(GradingConstants.GRADING_SERVICE_URL, GradingConstants.GRADING_SERVICE_NAME));
 50  0
         CourseOfferingService courseOfferingService = (CourseOfferingService)GlobalResourceLoader.getService(new QName("http://student.kuali.org/wsdl/courseOffering", "CourseOfferingMockService"));
 51  
         try {
 52  0
             List<GradeRosterInfo> gradeRosterInfoList = gradingService.getGradeRostersByGraderAndTerm(currentUser, termKey, context);
 53  0
             if (gradeRosterInfoList != null){
 54  0
                 List<String> courseOfferingIds = new ArrayList();
 55  0
                 for (GradeRosterInfo gradeInfo : gradeRosterInfoList){
 56  0
                      courseOfferingIds.add(gradeInfo.getCourseOfferingId());
 57  
                 }
 58  0
                 courseOfferingInfoList = courseOfferingService.getCourseOfferingsByIdList(courseOfferingIds, context);
 59  
             }
 60  
 
 61  0
         } catch (DoesNotExistException e) {
 62  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 63  0
         } catch (InvalidParameterException e) {
 64  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 65  0
         } catch (MissingParameterException e) {
 66  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 67  0
         } catch (OperationFailedException e) {
 68  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 69  0
         } catch (PermissionDeniedException e) {
 70  0
             e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
 71  0
         }
 72  
 
 73  0
         return courseOfferingInfoList;
 74  
     }
 75  
 }