1 | |
package org.kuali.student.enrollment.class2.courseoffering.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.enrollment.class2.courseoffering.util.CourseOfferingConstants; |
6 | |
import org.kuali.student.enrollment.class2.courseoffering.util.CourseOfferingResourceLoader; |
7 | |
import org.kuali.student.enrollment.common.util.ContextBuilder; |
8 | |
import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService; |
9 | |
import org.kuali.student.enrollment.courseoffering.dto.CourseOfferingInfo; |
10 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
11 | |
|
12 | |
import javax.xml.namespace.QName; |
13 | |
import java.util.Map; |
14 | |
|
15 | |
|
16 | 0 | public class CourseOfferingInfoInquirableImpl extends InquirableImpl { |
17 | |
private transient CourseOfferingService courseOfferingService; |
18 | 0 | private ContextInfo contextInfo = null; |
19 | |
|
20 | |
@Override |
21 | |
public CourseOfferingInfo retrieveDataObject(Map<String, String> parameters) { |
22 | |
try { |
23 | 0 | CourseOfferingInfo courseOfferingInfo = getCourseOfferingService().getCourseOffering(parameters.get(CourseOfferingConstants.COURSEOFFERING_ID), getContextInfo()); |
24 | 0 | return courseOfferingInfo; |
25 | 0 | } catch (Exception e) { |
26 | 0 | throw new RuntimeException(e); |
27 | |
} |
28 | |
} |
29 | |
|
30 | |
public CourseOfferingService getCourseOfferingService() { |
31 | 0 | if(courseOfferingService == null) |
32 | 0 | courseOfferingService= CourseOfferingResourceLoader.loadCourseOfferingService(); |
33 | 0 | return courseOfferingService; |
34 | |
} |
35 | |
|
36 | |
public ContextInfo getContextInfo() { |
37 | 0 | if (contextInfo == null){ |
38 | 0 | contextInfo = ContextBuilder.loadContextInfo(); |
39 | |
} |
40 | 0 | return contextInfo; |
41 | |
} |
42 | |
} |