Package org.xwiki.contrib.moccacalendar
Class EventInstance
- java.lang.Object
-
- org.xwiki.contrib.moccacalendar.EventInstance
-
public class EventInstance extends Object
Data container describing an actual event. This might be either a single event or an instance of a recurrent event. For recurrent events the generators must set the startDate and endDate for the event; the rest can be figured out by the calendar service.- Since:
- 2.7
- Version:
- $Id: $
-
-
Constructor Summary
Constructors Constructor Description EventInstance()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBackgroundColor()Color for the background when displaying this event (as RGB string).StringgetDescription()The longer description of the event, as plain text.StringgetDescriptionHtml()The longer description of the event, as HTML markup text.org.joda.time.DateTimegetEndDate()The date when the event ends.org.joda.time.DateTimegetEndDateExclusive()A date after the event has ended.org.xwiki.model.reference.DocumentReferencegetEventDocRef()A reference to the document describing the event.org.joda.time.DateTimegetOriginalStartDate()The date when the event would have started if not modified.StringgetSource()The informal name of the source this event is coming from.org.joda.time.DateTimegetStartDate()The date when the event starts.StringgetTextColor()The font color to be used to render this event in the calendar overview (as RGB string).StringgetTitle()The title of the event.booleanisAllDay()A flag if the event last a full day (or several full days).booleanisModifiable()Indicate if this event is modifiable.booleanisMovable()Indicate if this event is movable, i.e.booleanisRecurrent()A flag if this event instance is part of a recurrent event or not.voidsetAllDay(boolean allDay)Set the flag if the event lasts all day.voidsetBackgroundColor(String backgroundColor)Set the background color.voidsetDescription(String description)Set the longer description of the event.voidsetDescriptionHtml(String descriptionHtml)Set the longer description as HTML.voidsetEndDate(org.joda.time.DateTime endDate)Set the end date for the event.voidsetEndDateExclusive(org.joda.time.DateTime endDateExclusive)Set a date after the event has ended.voidsetEventDocRef(org.xwiki.model.reference.DocumentReference eventDocRef)Set the reference to the document describing the event.voidsetModifiable(boolean modifiable)Set the indicator if this event is modifiable.voidsetMovable(boolean movable)Set the indicator if this event is movable.voidsetOriginalStartDate(org.joda.time.DateTime originalStartDate)Set the date when the event would have started if not modified.voidsetRecurrent(boolean recurrent)Set the recurrency flag.voidsetSource(String source)Set the name of the source which has created this event.voidsetStartDate(org.joda.time.DateTime startDate)Set the start date of the event.voidsetTextColor(String textColor)Set the font color to be used when displaying the event.voidsetTitle(String title)Set the title of the event.
-
-
-
Method Detail
-
getEventDocRef
public org.xwiki.model.reference.DocumentReference getEventDocRef()
A reference to the document describing the event.- Returns:
- the document reference for the event
-
setEventDocRef
public void setEventDocRef(org.xwiki.model.reference.DocumentReference eventDocRef)
Set the reference to the document describing the event.- Parameters:
eventDocRef- a document reference
-
getStartDate
public org.joda.time.DateTime getStartDate()
The date when the event starts.- Returns:
- the date when the event starts
-
setStartDate
public void setStartDate(org.joda.time.DateTime startDate)
Set the start date of the event. This value must be set by event generators.- Parameters:
startDate- a (jodatime) date. The time part should be 00:00 for all day events
-
getOriginalStartDate
public org.joda.time.DateTime getOriginalStartDate()
The date when the event would have started if not modified. This can be null if the event is not modified.- Returns:
- the date when the event would have started if not modified.
-
setOriginalStartDate
public void setOriginalStartDate(org.joda.time.DateTime originalStartDate)
Set the date when the event would have started if not modified.- Parameters:
originalStartDate- a (jodatime) date. The time part should be 00:00 for all day events
-
getEndDate
public org.joda.time.DateTime getEndDate()
The date when the event ends.- Returns:
- the date when the event ends
-
setEndDate
public void setEndDate(org.joda.time.DateTime endDate)
Set the end date for the event. This value must be set by event generators.- Parameters:
endDate- a (jodatime) date. The time part should be 00:00 for all-day events
-
getEndDateExclusive
public org.joda.time.DateTime getEndDateExclusive()
A date after the event has ended.- Returns:
- a (jodatime) date
-
setEndDateExclusive
public void setEndDateExclusive(org.joda.time.DateTime endDateExclusive)
Set a date after the event has ended. This should be the start of the next day after the event for all-day events.- Parameters:
endDateExclusive- a date after the event
-
isAllDay
public boolean isAllDay()
A flag if the event last a full day (or several full days). This information can be figured out by thegetStartDate()andgetEndDate()and is only provided here for convenience.- Returns:
- true if the event lasts all day
-
setAllDay
public void setAllDay(boolean allDay)
Set the flag if the event lasts all day.- Parameters:
allDay- .
-
isRecurrent
public boolean isRecurrent()
A flag if this event instance is part of a recurrent event or not.- Returns:
- true if the event instance is member of recurrent series of events
-
setRecurrent
public void setRecurrent(boolean recurrent)
Set the recurrency flag.- Parameters:
recurrent- .
-
getTitle
public String getTitle()
The title of the event.- Returns:
- the title to be displayed in the overview
-
setTitle
public void setTitle(String title)
Set the title of the event.- Parameters:
title- should not be null or empty
-
getDescription
public String getDescription()
The longer description of the event, as plain text.- Returns:
- the description of the event without HTML markup
-
setDescription
public void setDescription(String description)
Set the longer description of the event.- Parameters:
description- the description of the event without HTML markup.
-
getDescriptionHtml
public String getDescriptionHtml()
The longer description of the event, as HTML markup text.- Returns:
- the description as HTML
-
setDescriptionHtml
public void setDescriptionHtml(String descriptionHtml)
Set the longer description as HTML.- Parameters:
descriptionHtml- the description as HTML.
-
getTextColor
public String getTextColor()
The font color to be used to render this event in the calendar overview (as RGB string).- Returns:
- a color as RGB string
-
setTextColor
public void setTextColor(String textColor)
Set the font color to be used when displaying the event.- Parameters:
textColor- a color as RGB string.
-
getBackgroundColor
public String getBackgroundColor()
Color for the background when displaying this event (as RGB string).- Returns:
- a color as RGB string
-
setBackgroundColor
public void setBackgroundColor(String backgroundColor)
Set the background color.- Parameters:
backgroundColor- a color as RGB string.
-
getSource
public String getSource()
The informal name of the source this event is coming from. The default value is null, which means it is created by the event calendar itself.- Returns:
- the source name, possibly null.
-
setSource
public void setSource(String source)
Set the name of the source which has created this event.- Parameters:
source- the source name
-
isModifiable
public boolean isModifiable()
Indicate if this event is modifiable. This does not include any rights check, just signaling if the event source supports storing modifications to this event- Returns:
- true if modifiable
-
setModifiable
public void setModifiable(boolean modifiable)
Set the indicator if this event is modifiable. This should be called only by the event source- Parameters:
modifiable- true if modifiable
-
isMovable
public boolean isMovable()
Indicate if this event is movable, i.e. start and end date can be updated. This does not include any rights check, just signaling if the event source supports storing date changes to this event- Returns:
- true if movable
-
setMovable
public void setMovable(boolean movable)
Set the indicator if this event is movable. This should be called only by the event source- Parameters:
movable- true if movable
-
-