org.alfresco.service.cmr.calendar
Class CalendarRecurrenceHelper

java.lang.Object
  extended by org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper

public class CalendarRecurrenceHelper
extends java.lang.Object

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

Field Summary
static java.util.Map DAY_NAMES_TO_CALENDAR_DAYS
          The lookup from the day strings to Calendar Day entries
 
Constructor Summary
CalendarRecurrenceHelper()
           
 
Method Summary
protected static void buildDailyRecurrences(java.util.Calendar currentDate, java.util.List dates, java.util.Map params, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly, int interval)
           
static java.util.Map buildLocalRecurrenceDaysOfTheWeek(java.util.Locale locale)
          Returns a lookup from recurrence rule days of the week, to the proper days of the week in the specified locale
protected static void buildMonthlyRecurrences(java.util.Calendar currentDate, java.util.List dates, java.util.Map params, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly, int interval)
           
protected static void buildWeeklyRecurrences(java.util.Calendar currentDate, java.util.List dates, java.util.Map params, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly, int interval)
           
protected static void buildYearlyRecurrences(java.util.Calendar currentDate, java.util.List dates, java.util.Map params, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly, int interval)
           
static java.util.Map extractRecurrenceRule(CalendarEntry entry)
          Returns the parsed calendar recurrence rule WARNING - Alfresco use only.
static java.util.List getRecurrencesOnOrAfter(CalendarEntry entry, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly)
          For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit.
static java.util.List getRecurrencesOnOrAfter(java.lang.String recurrenceRule, java.util.Date eventStart, java.util.Date eventEnd, java.util.Date lastRecurrence, java.util.Date onOrAfter, java.util.Date until, boolean firstOnly)
          For the given Calendar Entry, return its subsequent Recurrence on or after the specified date, until the given limit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAY_NAMES_TO_CALENDAR_DAYS

public static final java.util.Map DAY_NAMES_TO_CALENDAR_DAYS
The lookup from the day strings to Calendar Day entries

Constructor Detail

CalendarRecurrenceHelper

public CalendarRecurrenceHelper()
Method Detail

buildLocalRecurrenceDaysOfTheWeek

public static java.util.Map buildLocalRecurrenceDaysOfTheWeek(java.util.Locale locale)
Returns a lookup from recurrence rule days of the week, to the proper days of the week in the specified locale


extractRecurrenceRule

public static java.util.Map extractRecurrenceRule(CalendarEntry entry)
Returns the parsed calendar recurrence rule WARNING - Alfresco use only. Return type will likely shift to a real object in the near future


getRecurrencesOnOrAfter

public static java.util.List getRecurrencesOnOrAfter(CalendarEntry entry,
                                                     java.util.Date onOrAfter,
                                                     java.util.Date until,
                                                     boolean firstOnly)
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. 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 java.util.List getRecurrencesOnOrAfter(java.lang.String recurrenceRule,
                                                     java.util.Date eventStart,
                                                     java.util.Date eventEnd,
                                                     java.util.Date lastRecurrence,
                                                     java.util.Date onOrAfter,
                                                     java.util.Date until,
                                                     boolean firstOnly)
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. 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

protected static void buildDailyRecurrences(java.util.Calendar currentDate,
                                            java.util.List dates,
                                            java.util.Map params,
                                            java.util.Date onOrAfter,
                                            java.util.Date until,
                                            boolean firstOnly,
                                            int interval)

buildWeeklyRecurrences

protected static void buildWeeklyRecurrences(java.util.Calendar currentDate,
                                             java.util.List dates,
                                             java.util.Map params,
                                             java.util.Date onOrAfter,
                                             java.util.Date until,
                                             boolean firstOnly,
                                             int interval)

buildMonthlyRecurrences

protected static void buildMonthlyRecurrences(java.util.Calendar currentDate,
                                              java.util.List dates,
                                              java.util.Map params,
                                              java.util.Date onOrAfter,
                                              java.util.Date until,
                                              boolean firstOnly,
                                              int interval)

buildYearlyRecurrences

protected static void buildYearlyRecurrences(java.util.Calendar currentDate,
                                             java.util.List dates,
                                             java.util.Map params,
                                             java.util.Date onOrAfter,
                                             java.util.Date until,
                                             boolean firstOnly,
                                             int interval)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.