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.inquiry.InquirableImpl;
5 import org.kuali.student.enrollment.acal.dto.TermInfo;
6 import org.kuali.student.enrollment.acal.service.AcademicCalendarService;
7 import org.kuali.student.r2.common.dto.ContextInfo;
8 import org.kuali.student.r2.common.exceptions.*;
9
10 import javax.xml.namespace.QName;
11 import java.util.Map;
12
13
14 @Deprecated
15 public class TermInfoInquiryViewHelperServiceImpl extends InquirableImpl {
16 public final static String TERM_TYPE_KEY = "typeKey";
17 public final static String TERM_KEY = "key";
18 private transient AcademicCalendarService academicCalendarService;
19
20 @Override
21 public TermInfo retrieveDataObject(Map<String, String> parameters) {
22 TermInfo termInfo = null;
23
24 String termKey = parameters.get(TERM_KEY);
25 ContextInfo context = new ContextInfo();
26 try{
27 termInfo = getAcademicCalendarService().getTerm(termKey, context);
28 return termInfo;
29 }catch (DoesNotExistException dnee){
30
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
43 }
44
45 protected AcademicCalendarService getAcademicCalendarService() {
46 if(academicCalendarService == null) {
47 academicCalendarService = (AcademicCalendarService) GlobalResourceLoader.getService(new QName("http://student.kuali.org/wsdl/acal","AcademicCalendarService"));
48 }
49 return academicCalendarService;
50 }
51
52 }