View Javadoc

1   package org.kuali.student.enrollment.class2.acal.service.impl;
2   
3   import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
4   import org.kuali.rice.krad.inquiry.InquirableImpl;
5   import org.kuali.student.r2.core.acal.dto.TermInfo;
6   import org.kuali.student.r2.core.acal.service.AcademicCalendarService;
7   import org.kuali.student.r2.common.dto.ContextInfo;
8   
9   import javax.xml.namespace.QName;
10  import java.util.Map;
11  
12  /**
13   * Created with IntelliJ IDEA.
14   * User: localadmin
15   * Date: 6/19/12
16   * Time: 3:28 PM
17   * To change this template use File | Settings | File Templates.
18   */
19  
20  
21  
22  public class AcademicTermInfoInquirableImpl  extends InquirableImpl {
23  
24      private AcademicCalendarService academicCalendarService;
25  
26      @Override
27      public TermInfo retrieveDataObject(Map<String, String> parameters) {
28          TermInfo termInfo = null;
29  
30          String termKey = parameters.get("id");
31          ContextInfo context = new ContextInfo();
32          try{
33              termInfo = getAcademicCalendarService().getTerm(termKey, context);
34              //List<KeyDateInfo> keyDateInfoList = getAcademicCalendarService().getKeyDatesForTerm(termKey, context);
35              return termInfo;
36          }catch (Exception e){
37              e.printStackTrace();
38          }
39  
40          return null;
41  
42      }
43  
44      protected AcademicCalendarService getAcademicCalendarService() {
45          if(academicCalendarService == null) {
46              academicCalendarService = (AcademicCalendarService) GlobalResourceLoader.getService(new QName("http://student.kuali.org/wsdl/acal", "AcademicCalendarService"));
47          }
48          return academicCalendarService;
49      }
50  
51  }