1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.enrollment.class2.courseoffering.service.impl; |
17 | |
|
18 | |
import org.kuali.rice.krad.inquiry.InquirableImpl; |
19 | |
import org.kuali.student.enrollment.class2.courseoffering.util.CourseOfferingResourceLoader; |
20 | |
import org.kuali.student.enrollment.common.util.ContextBuilder; |
21 | |
import org.kuali.student.enrollment.courseoffering.dto.FormatOfferingInfo; |
22 | |
import org.kuali.student.enrollment.courseoffering.service.CourseOfferingService; |
23 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
24 | |
import org.kuali.student.r2.common.exceptions.*; |
25 | |
|
26 | |
import java.util.Map; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 0 | public class FormatOfferingInfoInquirableImpl extends InquirableImpl { |
34 | |
public final static String FORMAT_OFFERING_ID = "id"; |
35 | |
|
36 | |
@Override |
37 | |
public FormatOfferingInfo retrieveDataObject(Map<String, String> parameters) { |
38 | |
|
39 | |
try { |
40 | 0 | FormatOfferingInfo formatOfferingInfo = getCourseOfferingService().getFormatOffering(parameters.get(FORMAT_OFFERING_ID), getContextInfo()); |
41 | 0 | return formatOfferingInfo; |
42 | 0 | } catch (Exception e) { |
43 | 0 | throw new RuntimeException(e); |
44 | |
} |
45 | |
} |
46 | |
|
47 | |
|
48 | |
public CourseOfferingService getCourseOfferingService() { |
49 | 0 | return CourseOfferingResourceLoader.loadCourseOfferingService(); |
50 | |
} |
51 | |
|
52 | |
public ContextInfo getContextInfo() { |
53 | 0 | return ContextBuilder.loadContextInfo(); |
54 | |
} |
55 | |
} |