1 | |
package org.kuali.student.enrollment.class2.acal.service.assembler; |
2 | |
|
3 | |
import org.kuali.student.enrollment.acal.dto.AcalEventInfo; |
4 | |
import org.kuali.student.r2.common.assembler.AssemblyException; |
5 | |
import org.kuali.student.r2.common.assembler.DTOAssembler; |
6 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
7 | |
import org.kuali.student.r2.core.atp.dto.MilestoneInfo; |
8 | |
import org.kuali.student.r2.core.atp.service.AtpService; |
9 | |
|
10 | 0 | public class AcalEventAssembler implements DTOAssembler<AcalEventInfo, MilestoneInfo> { |
11 | |
|
12 | |
private AtpService atpService; |
13 | |
|
14 | |
@Override |
15 | |
public AcalEventInfo assemble(MilestoneInfo milestoneInfo, ContextInfo context) throws AssemblyException { |
16 | |
|
17 | 0 | if (milestoneInfo == null) { |
18 | 0 | return null; |
19 | |
} |
20 | |
|
21 | 0 | AcalEventInfo acalEventInfo = new AcalEventInfo(); |
22 | 0 | acalEventInfo.setId(milestoneInfo.getId()); |
23 | 0 | acalEventInfo.setName(milestoneInfo.getName()); |
24 | 0 | acalEventInfo.setDescr(milestoneInfo.getDescr()); |
25 | |
|
26 | 0 | acalEventInfo.setStartDate(milestoneInfo.getStartDate()); |
27 | 0 | acalEventInfo.setEndDate(milestoneInfo.getEndDate()); |
28 | 0 | acalEventInfo.setIsAllDay(milestoneInfo.getIsAllDay()); |
29 | 0 | acalEventInfo.setIsDateRange(milestoneInfo.getIsDateRange()); |
30 | |
|
31 | 0 | acalEventInfo.setStateKey(milestoneInfo.getStateKey()); |
32 | 0 | acalEventInfo.setTypeKey(milestoneInfo.getTypeKey()); |
33 | |
|
34 | 0 | acalEventInfo.setMeta(milestoneInfo.getMeta()); |
35 | 0 | acalEventInfo.setAttributes(milestoneInfo.getAttributes()); |
36 | |
|
37 | 0 | return acalEventInfo; |
38 | |
} |
39 | |
|
40 | |
@Override |
41 | |
public MilestoneInfo disassemble(AcalEventInfo acalEventInfo, ContextInfo context) throws AssemblyException { |
42 | |
|
43 | 0 | if (acalEventInfo == null) { |
44 | 0 | return null; |
45 | |
} |
46 | |
|
47 | 0 | MilestoneInfo msInfo = new MilestoneInfo(); |
48 | |
|
49 | 0 | msInfo.setId(acalEventInfo.getId()); |
50 | 0 | msInfo.setName(acalEventInfo.getName()); |
51 | 0 | msInfo.setDescr(acalEventInfo.getDescr()); |
52 | |
|
53 | 0 | msInfo.setStartDate(acalEventInfo.getStartDate()); |
54 | 0 | msInfo.setEndDate(acalEventInfo.getEndDate()); |
55 | 0 | msInfo.setIsAllDay(acalEventInfo.getIsAllDay()); |
56 | 0 | msInfo.setIsDateRange(acalEventInfo.getIsDateRange()); |
57 | 0 | msInfo.setIsRelative(false); |
58 | |
|
59 | 0 | msInfo.setStateKey(acalEventInfo.getStateKey()); |
60 | 0 | msInfo.setTypeKey(acalEventInfo.getTypeKey()); |
61 | |
|
62 | 0 | msInfo.setMeta(acalEventInfo.getMeta()); |
63 | 0 | msInfo.setAttributes(acalEventInfo.getAttributes()); |
64 | |
|
65 | 0 | return msInfo; |
66 | |
} |
67 | |
|
68 | |
public AtpService getAtpService() { |
69 | 0 | return atpService; |
70 | |
} |
71 | |
|
72 | |
public void setAtpService(AtpService atpService) { |
73 | 0 | this.atpService = atpService; |
74 | 0 | } |
75 | |
} |