Package org.silverpeas.core.calendar
Class CalendarEventUtil
- java.lang.Object
-
- org.silverpeas.core.calendar.CalendarEventUtil
-
public class CalendarEventUtil extends Object
- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Attendee
asAttendee(User user, CalendarComponent component)
Makes the specified user in Silverpeas an attendee in the given calendar component.static String
formatDateWithOffset(CalendarComponent component, Temporal temporal, ZoneId zoneId)
Formats the given temporal according to the calendar component data and given zoneId.static String
formatTitle(CalendarComponent component, String componentInstanceId, boolean canBeAccessed)
Centralizes the format treatment of title display, according the given parameters, which determine the context, the title is modified.static Temporal
getDateWithOffset(CalendarComponent component, Temporal temporal)
Gets the given temporal according to the calendar component data.
If the component is on all days, no offset is applied.static Temporal
getDateWithOffset(CalendarComponent component, Temporal temporal, ZoneId zoneId)
Gets the given temporal according to the calendar component data.
If the component is on all days, no offset is applied.
-
-
-
Method Detail
-
formatTitle
public static String formatTitle(CalendarComponent component, String componentInstanceId, boolean canBeAccessed)
Centralizes the format treatment of title display, according the given parameters, which determine the context, the title is modified.- Parameters:
component
- the component data.componentInstanceId
- the identifier of component instance into which the component is handled.canBeAccessed
- indicates if the component is accessible for the current user into the current context.- Returns:
- the display title as string.
-
getDateWithOffset
public static Temporal getDateWithOffset(CalendarComponent component, Temporal temporal)
Gets the given temporal according to the calendar component data.
If the component is on all days, no offset is applied.- Parameters:
component
- the component data.temporal
- the temporal to format.- Returns:
- the date, with offset if the component is not on all days.
-
getDateWithOffset
public static Temporal getDateWithOffset(CalendarComponent component, Temporal temporal, ZoneId zoneId)
Gets the given temporal according to the calendar component data.
If the component is on all days, no offset is applied. If a specific zoneId is given, then the date is set to the offset of the given zoneId instead of the one linked to the calendar.- Parameters:
component
- the component data.temporal
- the temporal to format.zoneId
- the zoneId requested (optional).- Returns:
- the date, with offset if the component is not on all days.
-
formatDateWithOffset
public static String formatDateWithOffset(CalendarComponent component, Temporal temporal, ZoneId zoneId)
Formats the given temporal according to the calendar component data and given zoneId.- Parameters:
component
- the component data.temporal
- the temporal to format.zoneId
- the zoneId requested (optional).- Returns:
- the formatted date.
- See Also:
getDateWithOffset(CalendarComponent, Temporal, ZoneId)
-
asAttendee
public static Attendee asAttendee(User user, CalendarComponent component)
Makes the specified user in Silverpeas an attendee in the given calendar component.- Parameters:
user
- a user in Silverpeas.component
- the calendar component in which the user attends.- Returns:
- an attendee in the specified calendar component.
-
-