| 1 | |
package org.kuali.student.enrollment.class2.acal.dto; |
| 2 | |
|
| 3 | |
import org.kuali.student.enrollment.acal.dto.AcalEventInfo; |
| 4 | |
import org.kuali.student.r2.common.dto.RichTextInfo; |
| 5 | |
import org.kuali.student.r2.common.util.constants.AtpServiceConstants; |
| 6 | |
|
| 7 | |
public class AcalEventWrapper extends TimeSetWrapper{ |
| 8 | |
|
| 9 | |
private AcalEventInfo acalEventInfo; |
| 10 | |
private String eventTypeKey; |
| 11 | |
private String eventTypeName; |
| 12 | |
|
| 13 | 0 | public AcalEventWrapper() { |
| 14 | 0 | acalEventInfo = new AcalEventInfo(); |
| 15 | 0 | setAllDay(false); |
| 16 | 0 | setDateRange(true); |
| 17 | 0 | acalEventInfo.setStateKey(AtpServiceConstants.MILESTONE_DRAFT_STATE_KEY); |
| 18 | 0 | } |
| 19 | |
|
| 20 | 0 | public AcalEventWrapper(AcalEventInfo acalEventInfo,boolean isCopy){ |
| 21 | 0 | this.setStartDate(acalEventInfo.getStartDate()); |
| 22 | 0 | this.setEndDate(acalEventInfo.getEndDate()); |
| 23 | 0 | this.setAllDay(acalEventInfo.getIsAllDay()); |
| 24 | 0 | this.setDateRange(acalEventInfo.getIsDateRange()); |
| 25 | 0 | this.setEventTypeKey(acalEventInfo.getTypeKey()); |
| 26 | |
|
| 27 | 0 | buildDateAndTime(); |
| 28 | |
|
| 29 | 0 | if (isCopy){ |
| 30 | 0 | setAcalEventInfo(new AcalEventInfo()); |
| 31 | 0 | RichTextInfo rti = new RichTextInfo(); |
| 32 | 0 | rti.setPlain(getAcalEventInfo().getTypeKey()); |
| 33 | 0 | getAcalEventInfo().setDescr(rti); |
| 34 | 0 | getAcalEventInfo().setStateKey(AtpServiceConstants.MILESTONE_DRAFT_STATE_KEY); |
| 35 | 0 | }else{ |
| 36 | 0 | setAcalEventInfo(acalEventInfo); |
| 37 | |
} |
| 38 | |
|
| 39 | 0 | } |
| 40 | |
|
| 41 | |
public AcalEventInfo getAcalEventInfo(){ |
| 42 | 0 | return acalEventInfo; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public void setAcalEventInfo(AcalEventInfo acalEventInfo) { |
| 46 | 0 | this.acalEventInfo = acalEventInfo; |
| 47 | 0 | } |
| 48 | |
|
| 49 | |
public String getEventTypeKey() { |
| 50 | 0 | return eventTypeKey; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public void setEventTypeKey(String eventTypeKey) { |
| 54 | 0 | this.eventTypeKey = eventTypeKey; |
| 55 | 0 | } |
| 56 | |
|
| 57 | |
public String getEventTypeName() { |
| 58 | 0 | return eventTypeName; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public void setEventTypeName(String eventTypeName) { |
| 62 | 0 | this.eventTypeName = eventTypeName; |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
|
| 66 | |
public String getStartDateUI(){ |
| 67 | 0 | return formatStartDateUI(acalEventInfo.getStartDate()); |
| 68 | |
} |
| 69 | |
|
| 70 | |
|
| 71 | |
public String getEndDateUI(){ |
| 72 | 0 | return formatEndDateUI(acalEventInfo.getEndDate()); |
| 73 | |
} |
| 74 | |
|
| 75 | |
|
| 76 | |
} |