1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.student.enrollment.class2.acal.dto;
16
17 import org.kuali.student.r2.core.acal.dto.AcalEventInfo;
18 import org.kuali.student.r2.common.dto.RichTextInfo;
19 import org.kuali.student.r2.core.constants.AtpServiceConstants;
20
21
22
23
24
25
26 public class AcalEventWrapper extends TimeSetWrapper{
27
28 private AcalEventInfo acalEventInfo;
29 private String eventTypeKey;
30 private String eventTypeName;
31
32 public AcalEventWrapper() {
33 acalEventInfo = new AcalEventInfo();
34 setAllDay(false);
35 setDateRange(true);
36 acalEventInfo.setStateKey(AtpServiceConstants.MILESTONE_DRAFT_STATE_KEY);
37 }
38
39
40
41
42
43
44
45 public AcalEventWrapper(AcalEventInfo acalEventInfo,boolean isCopy){
46 this.setStartDate(acalEventInfo.getStartDate());
47 this.setEndDate(acalEventInfo.getEndDate());
48 this.setAllDay(acalEventInfo.getIsAllDay());
49 this.setDateRange(acalEventInfo.getIsDateRange());
50 this.setEventTypeKey(acalEventInfo.getTypeKey());
51
52 buildDateAndTime();
53
54 if (isCopy){
55 setAcalEventInfo(new AcalEventInfo());
56 RichTextInfo rti = new RichTextInfo();
57 rti.setPlain(getAcalEventInfo().getTypeKey());
58 getAcalEventInfo().setDescr(rti);
59 getAcalEventInfo().setStateKey(AtpServiceConstants.MILESTONE_DRAFT_STATE_KEY);
60 }else{
61 setAcalEventInfo(acalEventInfo);
62 }
63
64 }
65
66 public AcalEventInfo getAcalEventInfo(){
67 return acalEventInfo;
68 }
69
70
71
72
73
74
75 public void setAcalEventInfo(AcalEventInfo acalEventInfo) {
76 this.acalEventInfo = acalEventInfo;
77 }
78
79
80
81
82
83
84 public String getEventTypeKey() {
85 return eventTypeKey;
86 }
87
88
89
90
91
92
93 public void setEventTypeKey(String eventTypeKey) {
94 this.eventTypeKey = eventTypeKey;
95 }
96
97
98
99
100
101
102 public String getEventTypeName() {
103 return eventTypeName;
104 }
105
106
107
108
109
110
111 public void setEventTypeName(String eventTypeName) {
112 this.eventTypeName = eventTypeName;
113 }
114
115
116
117
118
119
120 @SuppressWarnings("unused")
121 public String getStartDateUI(){
122 return formatStartDateUI(acalEventInfo.getStartDate());
123 }
124
125
126
127
128
129
130 @SuppressWarnings("unused")
131 public String getEndDateUI(){
132 return formatEndDateUI(acalEventInfo.getEndDate());
133 }
134
135
136 }