Class CalendarRecurrenceHelper
java.lang.Object
org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper
This class provides helper functions for when working
with recurring
CalendarEntry instances.
It provides support for working with key parts of the
Outlook/SharePoint recurrence rules- Since:
- 4.0
- Author:
- Nick Burch
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidbuildDailyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String, String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) Returns a lookup from recurrence rule days of the week, to the proper days of the week in the specified localebuildLocalRecurrenceWeekNames(Locale locale) The lookup from the week in month number to week in month name in the specified localeprotected static voidbuildMonthlyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String, String> params, Date onOrAfter, Date until, boolean firstOnly, int monthInterval) protected static voidbuildWeeklyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String, String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) protected static voidbuildYearlyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String, String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) Returns the parsed calendar recurrence rule WARNING - Alfresco use only.fixOutlookRecurrenceQuirks(Map<String, String> params) Outlook does some crazy stuff, which is only just about permitted by the specification, and is hard to parse, especially for yearly events.getRecurrencesOnOrAfter(String recurrenceRule, Date eventStart, Date eventEnd, Date lastRecurrence, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit.getRecurrencesOnOrAfter(CalendarEntry entry, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit.
-
Field Details
-
d2cd
-
DAY_NAMES_TO_CALENDAR_DAYS
The lookup from the day strings to Calendar Day entries -
DAY
- See Also:
-
WEEKDAYS
- See Also:
-
WEEKENDS
- See Also:
-
WEEK_NUMBER_TO_WEEK_NAME
-
-
Constructor Details
-
CalendarRecurrenceHelper
public CalendarRecurrenceHelper()
-
-
Method Details
-
buildLocalRecurrenceDaysOfTheWeek
Returns a lookup from recurrence rule days of the week, to the proper days of the week in the specified locale -
buildLocalRecurrenceWeekNames
The lookup from the week in month number to week in month name in the specified locale -
extractRecurrenceRule
Returns the parsed calendar recurrence rule WARNING - Alfresco use only. Return type will likely shift to a real object in the near future -
fixOutlookRecurrenceQuirks
Outlook does some crazy stuff, which is only just about permitted by the specification, and is hard to parse, especially for yearly events. Fix these to more normal cases where possible TODO: This method modifies the input, returning the Map perhaps implies a copy is returned. Decide whether this should be of return type 'void', or make a defensive copy before modification. -
getRecurrencesOnOrAfter
public static List<Date> getRecurrencesOnOrAfter(CalendarEntry entry, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit. If it doesn't have any recurrences on or after the start date (either no recurrence rules, or the last recurrence date is before then), null will be returned. (The onOrAfter and until dates are treat as inclusive) If requested, can stop after the first hit- Returns:
- The next recurrence on or after the given date, or null if there aren't any
-
getRecurrencesOnOrAfter
public static List<Date> getRecurrencesOnOrAfter(String recurrenceRule, Date eventStart, Date eventEnd, Date lastRecurrence, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit. If it doesn't have any recurrences on or after the start date (either no recurrence rules, or the last recurrence date is before then), null will be returned. (The onOrAfter and until dates are treat as inclusive) If requested, can stop after the first hit- Returns:
- The next recurrence on or after the given date, or null if there aren't any
-
buildDailyRecurrences
-
buildWeeklyRecurrences
-
buildMonthlyRecurrences
-
buildYearlyRecurrences
-