com.silverpeas.calendar
Class CalendarEvent

java.lang.Object
  extended by com.silverpeas.calendar.CalendarEvent
All Implemented Interfaces:
Serializable

@DateRange(startDate="startDate",
           endDate="endDate")
public class CalendarEvent
extends Object
implements Serializable

The event in a calendar. An event in the calendar is described by a starting and an ending date and a name. The start and end dates in an event must be in the same type (either a date or a datable).

See Also:
Serialized Form

Method Summary
static
<T extends Datable<?>>
CalendarEvent
anEventAt(T startDate)
          Creates a new calendar event starting and ending at the specified date.
static
<T extends Datable<?>>
CalendarEvent
anEventAt(T startDate, T endDate)
          Creates a new calendar event starting at the specified start date and ending at the specified end date.
 CalendarEvent endingAt(Datable<?> endDate)
          Sets an end date to this event.
 CalendarEvent from(SilverpeasContent content)
           
 String getAccessLevel()
          Gets the classification of this event.
 CalendarEventAttendees getAttendees()
          Gets the attendees to this event.
 CalendarEventCategories getCategories()
          Gets the categories to which this event belongs.
 String getDescription()
          Gets a description about this event.
 Datable<?> getEndDate()
          Gets the date at which this event ends.
 String getId()
           
 String getLocation()
          Gets the location where this event should occur.
 int getPriority()
          Gets the priority of this event.
 CalendarEventRecurrence getRecurrence()
          Gets the recurrence of this recurring event.
 Datable<?> getStartDate()
          Gets the date at which this event should starts
 String getTitle()
          Gets the title of this event.
 URL getUrl()
          Sets an URL of a resource describing or representing this event.
 CalendarEvent identifiedBy(String appId, String eventId)
           
 boolean isOnAllDay()
          Is this event occurring on all the day(s)?
 boolean isRecurring()
          Is this event a recurring one?
 CalendarEvent recur(CalendarEventRecurrence recurrence)
          Recurs this event with the specified event recurrence.
 CalendarEvent startingAt(Datable<?> startDate)
          Modifies the start date of this event.
 CalendarEvent withAccessLevel(String accessLevel)
          Specifies the access level to this event.
 CalendarEvent withDescription(String description)
          Sets a description ot this event.
 CalendarEvent withLocation(String location)
          Sets a location where this event should occur.
 CalendarEvent withPriority(int priority)
          Sets a priority to this event.
 CalendarEvent withTitle(String title)
          Sets a title to this event.
 CalendarEvent withUrl(URL url)
          Gets the URL of a resource describing or representing this event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

anEventAt

public static <T extends Datable<?>> CalendarEvent anEventAt(T startDate)
Creates a new calendar event starting and ending at the specified date.

Parameters:
startDate - the start date of the event.
Returns:
a calendar event.

anEventAt

public static <T extends Datable<?>> CalendarEvent anEventAt(T startDate,
                                                             T endDate)
Creates a new calendar event starting at the specified start date and ending at the specified end date.

Parameters:
startDate - the start date of the event. The start date defines the inclusive date at which the event starts.
endDate - the end date of the event. The end date defines the non-inclusive date at which the event ends up.
Returns:
a calendar event.

withAccessLevel

public CalendarEvent withAccessLevel(String accessLevel)
Specifies the access level to this event. In generally, it defines the intention of the user about the access on the event he accepts to give. Usual values are PUBLIC, PRIVATE or CONFIDENTIAL for example. By default, the access level is PUBLIC.

Parameters:
accessLevel - the new access level to this event.
Returns:
itself.

endingAt

public CalendarEvent endingAt(Datable<?> endDate)
Sets an end date to this event. By default, the event end date is non inclusive and it is set to the start date. For a recurring event, the end date is the one for each occurrences of the event.

Parameters:
endDate - the event end date.
Returns:
itself.

withPriority

public CalendarEvent withPriority(int priority)
Sets a priority to this event.

Parameters:
priority - an event priority.
Returns:
itself.

getLocation

public String getLocation()
Gets the location where this event should occur.

Returns:
the location of this event or an empty string if no location is defined for this event.

withLocation

public CalendarEvent withLocation(String location)
Sets a location where this event should occur.

Parameters:
location - the location of this event.
Returns:
itself.

getUrl

public URL getUrl()
Sets an URL of a resource describing or representing this event.

Returns:
an URL of a resource in connection with this event or null if no URL is defined for this event.

withUrl

public CalendarEvent withUrl(URL url)
Gets the URL of a resource describing or representing this event.

Parameters:
url - the URL of a resource in connection with this event.
Returns:
itself.

startingAt

public CalendarEvent startingAt(Datable<?> startDate)
Modifies the start date of this event.

Parameters:
startDate - the new event start date.
Returns:
itself.

getAttendees

public CalendarEventAttendees getAttendees()
Gets the attendees to this event.

Returns:
the attendees to this event.

getCategories

public CalendarEventCategories getCategories()
Gets the categories to which this event belongs.

Returns:
the categories of this event.

getAccessLevel

public String getAccessLevel()
Gets the classification of this event.

Returns:
the classification of this event.

getDescription

public String getDescription()
Gets a description about this event.

Returns:
a description about this event or an empty string if no description is attached to this event.

getEndDate

public Datable<?> getEndDate()
Gets the date at which this event ends.

Returns:
the end date of this event.

getTitle

public String getTitle()
Gets the title of this event.

Returns:
the event title or an empty string if the event has no title.

getPriority

public int getPriority()
Gets the priority of this event.

Returns:
the priority of the event.

getStartDate

public Datable<?> getStartDate()
Gets the date at which this event should starts

Returns:
the start date of the event.

recur

public CalendarEvent recur(CalendarEventRecurrence recurrence)
Recurs this event with the specified event recurrence.

Parameters:
recurrence - the recurrence defining the recurring property of this event.
Returns:
itself.

withTitle

public CalendarEvent withTitle(String title)
Sets a title to this event.

Parameters:
title - the title to set.
Returns:
itself.

withDescription

public CalendarEvent withDescription(String description)
Sets a description ot this event.

Parameters:
description - the description to set.
Returns:
itself.

getRecurrence

public CalendarEventRecurrence getRecurrence()
Gets the recurrence of this recurring event. If the event isn't a recurring one, then returns NO_RECURRENCE.

Returns:
this event recurrence or NO_RECURRENCE.

isRecurring

public boolean isRecurring()
Is this event a recurring one?

Returns:
true if this event is recurring, false otherwise.

isOnAllDay

public boolean isOnAllDay()
Is this event occurring on all the day(s)?

Returns:
true if this event is occurring on all its day(s).

from

public CalendarEvent from(SilverpeasContent content)

identifiedBy

public CalendarEvent identifiedBy(String appId,
                                  String eventId)

getId

public String getId()


Copyright © 2016 Silverpeas. All Rights Reserved.