1 | |
package org.kuali.student.enrollment.class2.courseoffering.service.transformer; |
2 | |
|
3 | |
import org.kuali.student.enrollment.courseoffering.dto.ActivityOfferingInfo; |
4 | |
import org.kuali.student.enrollment.courseoffering.dto.OfferingInstructorInfo; |
5 | |
import org.kuali.student.enrollment.lpr.dto.LprInfo; |
6 | |
import org.kuali.student.enrollment.lui.dto.LuiInfo; |
7 | |
|
8 | 0 | public class ActivityOfferingTransformer { |
9 | |
public void lui2Activity(ActivityOfferingInfo ao, LuiInfo lui) { |
10 | 0 | ao.setId(lui.getId()); |
11 | 0 | ao.setMeta(lui.getMeta()); |
12 | 0 | ao.setStateKey(lui.getStateKey()); |
13 | 0 | ao.setTypeKey(lui.getTypeKey()); |
14 | 0 | ao.setDescr(lui.getDescr()); |
15 | 0 | ao.setAttributes(lui.getAttributes()); |
16 | 0 | ao.setActivityId(lui.getCluId()); |
17 | 0 | ao.setTermId(lui.getAtpId()); |
18 | 0 | ao.setMinimumEnrollment(lui.getMinimumEnrollment()); |
19 | 0 | ao.setMaximumEnrollment(lui.getMaximumEnrollment()); |
20 | 0 | } |
21 | |
|
22 | |
public void activity2Lui (ActivityOfferingInfo ao, LuiInfo lui) { |
23 | 0 | lui.setId(ao.getId()); |
24 | 0 | lui.setTypeKey(ao.getTypeKey()); |
25 | 0 | lui.setStateKey(ao.getStateKey()); |
26 | 0 | lui.setDescr(ao.getDescr()); |
27 | 0 | lui.setMeta(ao.getMeta()); |
28 | 0 | lui.setAttributes(ao.getAttributes()); |
29 | 0 | lui.setCluId(ao.getActivityId()); |
30 | 0 | lui.setAtpId(ao.getTermId()); |
31 | 0 | lui.setMinimumEnrollment(ao.getMinimumEnrollment()); |
32 | 0 | lui.setMaximumEnrollment(ao.getMaximumEnrollment()); |
33 | 0 | } |
34 | |
|
35 | |
public OfferingInstructorInfo transformInstructorForActivityOffering(LprInfo lpr) { |
36 | 0 | OfferingInstructorInfo instructor = new OfferingInstructorInfo(); |
37 | 0 | instructor.setPersonId(lpr.getPersonId()); |
38 | 0 | if (lpr.getCommitmentPercent() != null) { |
39 | 0 | instructor.setPercentageEffort(Float.parseFloat(lpr.getCommitmentPercent())); |
40 | |
} else { |
41 | 0 | instructor.setPercentageEffort(null); |
42 | |
} |
43 | 0 | instructor.setId(lpr.getId()); |
44 | 0 | instructor.setTypeKey(lpr.getTypeKey()); |
45 | 0 | instructor.setStateKey(lpr.getStateKey()); |
46 | 0 | return instructor; |
47 | |
|
48 | |
} |
49 | |
} |