com.stratelia.webactiv.almanach.control
Class AlmanachCalendarView

java.lang.Object
  extended by com.stratelia.webactiv.almanach.control.AlmanachCalendarView

public class AlmanachCalendarView
extends Object

It defines a window in time of the calendar belonging to a given almanach instance. The type of view can be a weekly or a monthly one and it renders the events between the two dates of the window in time.


Constructor Summary
AlmanachCalendarView(AlmanachDTO almanach, Date currentDay, org.silverpeas.calendar.CalendarViewType viewType, String locale)
          Constructs a new calendar view of the specified almanach.
 
Method Summary
 AlmanachDTO getAlmanach()
          Gets a DTO on the almanach instance this calendar view belongs to.
 org.silverpeas.calendar.CalendarDay getCurrentDay()
          Gets the current day in this calendar view.
 List<DisplayableEventOccurrence> getEvents()
          Gets all events defined in the window in time this calendar view defines.
 String getEventsInJSON()
          Gets the JSON representation of the event occurrences.
 int getFirstDayOfWeek()
          Gets the first day of weeks of the calendar with 1 meaning for sunday, 2 meaning for monday, and so on.
 String getLabel()
          Gets the label of this calendar view to render.
 org.silverpeas.calendar.CalendarViewType getViewType()
          Gets the type of view of this calendar view.
 boolean isWeekendVisible()
          Is the week-end visible?
 void setEvents(List<DisplayableEventOccurrence> events)
          Sets the events that are defined in this calendar view.
 void setLabel(String label)
          Sets a label to this calendar view.
 void unsetWeekendVisible()
          Unset the rendering of the week-end days.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlmanachCalendarView

public AlmanachCalendarView(AlmanachDTO almanach,
                            Date currentDay,
                            org.silverpeas.calendar.CalendarViewType viewType,
                            String locale)
Constructs a new calendar view of the specified almanach. By default, the week-end days are displayed.

Parameters:
almanach - the DTO carrying information about the almanach instance this view is about.
currentDay - the current day in this calendar view.
viewType - the type of view the calendar should be rendered.
locale - the locale to take into account (fr for the french locale (fr_FR) for example).
Method Detail

getFirstDayOfWeek

public int getFirstDayOfWeek()
Gets the first day of weeks of the calendar with 1 meaning for sunday, 2 meaning for monday, and so on. The first day of weeks depends on the locale; the first day of weeks is monday for french whereas it is for sunday for US.

Returns:
the first day of week.

unsetWeekendVisible

public void unsetWeekendVisible()
Unset the rendering of the week-end days.


isWeekendVisible

public boolean isWeekendVisible()
Is the week-end visible?

Returns:
true if the week-end days should be rendered, false otherwise.

getLabel

public String getLabel()
Gets the label of this calendar view to render.

Returns:
the calendar view label.

setLabel

public void setLabel(String label)
Sets a label to this calendar view.

Parameters:
label - the label to set.

getCurrentDay

public org.silverpeas.calendar.CalendarDay getCurrentDay()
Gets the current day in this calendar view.

Returns:
the current day.

getAlmanach

public AlmanachDTO getAlmanach()
Gets a DTO on the almanach instance this calendar view belongs to.

Returns:
the almanach DTO.

getEvents

public List<DisplayableEventOccurrence> getEvents()
Gets all events defined in the window in time this calendar view defines.

Returns:
a list with all DTO on the events planned in this calendar view.

getViewType

public org.silverpeas.calendar.CalendarViewType getViewType()
Gets the type of view of this calendar view.

Returns:
the type of view.

setEvents

public void setEvents(List<DisplayableEventOccurrence> events)
Sets the events that are defined in this calendar view.

Parameters:
events - a list of event DTOs.

getEventsInJSON

public String getEventsInJSON()
Gets the JSON representation of the event occurrences.

Returns:
a JSON representation of the list of event occurrences.


Copyright © 2016 Silverpeas. All Rights Reserved.