Coverage Report - org.kuali.student.enrollment.class2.acal.service.AcademicCalendarInfoLookupableImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
AcademicCalendarInfoLookupableImpl
0%
0/23
0%
0/2
4.5
 
 1  
 package org.kuali.student.enrollment.class2.acal.service;
 2  
 
 3  
 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
 4  
 import org.kuali.rice.krad.lookup.LookupableImpl;
 5  
 import org.kuali.rice.krad.web.form.LookupForm;
 6  
 import org.kuali.student.enrollment.acal.dto.AcademicCalendarInfo;
 7  
 import org.kuali.student.enrollment.acal.service.AcademicCalendarService;
 8  
 import org.kuali.student.r2.common.dto.ContextInfo;
 9  
 import org.kuali.student.r2.common.exceptions.*;
 10  
 
 11  
 import javax.xml.namespace.QName;
 12  
 import java.util.ArrayList;
 13  
 import java.util.List;
 14  
 import java.util.Map;
 15  
 
 16  
 //Core slice class.
 17  
 @Deprecated
 18  0
 public class AcademicCalendarInfoLookupableImpl extends LookupableImpl {
 19  
             public final static String CREDENTIAL_PROGRAM_TYPE_KEY = "credentialProgramTypeKey";
 20  
             public final static String ACADEMIC_CALENDAR_KEY = "key";
 21  
                  private transient AcademicCalendarService academicCalendarService;
 22  
                  
 23  
 
 24  
             @Override
 25  
             protected List<?> getSearchResults(LookupForm lookupForm, Map<String, String> fieldValues, boolean unbounded) {
 26  
                     /*
 27  
                     String credentialProgramTypeKey = fieldValues.get(CREDENTIAL_PROGRAM_TYPE_KEY);
 28  
                     ContextInfo context = ContextInfo.newInstance();
 29  
                     try{
 30  
                             return getAcademicCalendarService().getAcademicCalendarsByCredentialProgramType(credentialProgramTypeKey, context);
 31  
                     }catch (InvalidParameterException ipe){
 32  
                             
 33  
                     }catch (MissingParameterException mpe){
 34  
                             
 35  
                     }catch (OperationFailedException ofe){
 36  
                             
 37  
                     }catch (PermissionDeniedException pde){
 38  
                             
 39  
                     }
 40  
                     return null;
 41  
                     */
 42  0
                     AcademicCalendarInfo academicCalendarInfo = null;
 43  0
                     List<AcademicCalendarInfo> academicCalendarInfoList = new ArrayList<AcademicCalendarInfo>();
 44  
                     
 45  0
                     String academicCalendarKey = fieldValues.get(ACADEMIC_CALENDAR_KEY);
 46  0
                     ContextInfo context = new ContextInfo();
 47  
                     try{
 48  0
                             academicCalendarInfo = getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context);
 49  0
                             academicCalendarInfoList.add(academicCalendarInfo);
 50  0
                             return academicCalendarInfoList;
 51  0
                     }catch (DoesNotExistException dnee){
 52  0
                             System.out.println("call getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context), and get DoesNotExistException:  "+dnee.toString());
 53  0
                     }catch (InvalidParameterException ipe){
 54  0
                         System.out.println("call getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context), and get InvalidParameterException:  "+ipe.toString());
 55  0
                     }catch (MissingParameterException mpe){
 56  0
                 System.out.println("call getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context), and get MissingParameterException:  "+mpe.toString());
 57  0
                     }catch (OperationFailedException ofe){
 58  0
                 System.out.println("call getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context), and get OperationFailedException:  "+ofe.toString());
 59  0
                     }catch (PermissionDeniedException pde){
 60  0
                 System.out.println("call getAcademicCalendarService().getAcademicCalendar(academicCalendarKey, context), and get PermissionDeniedException:  "+pde.toString());
 61  0
                     }
 62  0
                     return null;
 63  
                 
 64  
             }
 65  
             
 66  
             protected AcademicCalendarService getAcademicCalendarService() {
 67  0
                  if(academicCalendarService == null) {
 68  0
                          academicCalendarService = (AcademicCalendarService) GlobalResourceLoader.getService(new QName("http://student.kuali.org/wsdl/acal","AcademicCalendarService"));
 69  
                 }
 70  
 
 71  0
                 return academicCalendarService;
 72  
             }
 73  
 
 74  
         
 75  
 }