/** * Returns the parsed calendar recurrence rule * WARNING - Alfresco use only. Return type will likely shift to * a real object in the near future */ public static Map<String,String> extractRecurrenceRule(CalendarEntry entry) { return extractRecurrenceRule(entry.getRecurrenceRule()); }
/** * Builds a Java TimeZone from the VTIMEZONE info in an * iCal file. * @return a Java TimeZone that matches the iCal one, or NULL if no TZ info present */ public static SimpleTimeZone buildTimeZone(String ical) { return buildTimeZone( getICalParams(ical) ); }
private static void addMonthToFirstDayOfWeek(Calendar c, int dayOfWeek, int monthInterval) { // Go forward to the 1st of next month addMonthToDayOfMonth(c, 1, monthInterval); // Set the day of the week toDayOfWeekInMonth(c, dayOfWeek, 1); }
/** * 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 * @return The next recurrence on or after the given date, or null if there aren't any */ public static List<Date> getRecurrencesOnOrAfter(CalendarEntry entry, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) { return getRecurrencesOnOrAfter( entry.getRecurrenceRule(), entry.getStart(), entry.getEnd(), entry.getLastRecurrence(), onOrAfter, until, firstOnly, ignoredDates); }
protected static Map<String,String> fixOutlookRecurrenceQuirks(Map<String,String> params) { return CalendarRecurrenceHelper.fixOutlookRecurrenceQuirks(params); } }
protected static Map<String,String> getICalParams(String icalText) { return CalendarTimezoneHelper.getICalParams(icalText); } }
@Override public void deleteCalendarEntry(CalendarEntry entry) { if (entry.getNodeRef() == null) { throw new IllegalArgumentException("Can't delete a calendar entry that was never persisted"); } nodeService.deleteNode(entry.getNodeRef()); }
protected static void buildDailyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String,String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) { CalendarRecurrenceHelper.buildDailyRecurrences( currentDate, duration, dates, params, onOrAfter, until, firstOnly, interval); }
protected static void buildWeeklyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String,String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) { CalendarRecurrenceHelper.buildWeeklyRecurrences( currentDate, duration, dates, params, onOrAfter, until, firstOnly, interval); }
protected static void buildMonthlyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String,String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) { CalendarRecurrenceHelper.buildMonthlyRecurrences( currentDate, duration, dates, params, onOrAfter, until, firstOnly, interval); }
protected static void buildYearlyRecurrences(Calendar currentDate, long duration, List<Date> dates, Map<String,String> params, Date onOrAfter, Date until, boolean firstOnly, int interval) { CalendarRecurrenceHelper.buildYearlyRecurrences( currentDate, duration, dates, params, onOrAfter, until, firstOnly, interval); }
/** * Splits an iCal line into key and value by the first * unquoted colon. * @param icalLine String */ protected static String[] icalLineKeyValue(String icalLine){ int delim = indexOfFirstUnquotedColon(icalLine); if(delim == -1){ return new String[]{"",""}; } String key = icalLine.substring(0,delim); String value = icalLine.substring(delim+1); return new String[]{key,value}; }
private static Params fromMap(Map<String, String> params) { return new Params(params); }
/** * 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 * @return The next recurrence on or after the given date, or null if there aren't any */ public static List<Date> getRecurrencesOnOrAfter(CalendarEntry entry, Date onOrAfter, Date until, boolean firstOnly, Set<Date> ignoredDates) { return getRecurrencesOnOrAfter( entry.getRecurrenceRule(), entry.getStart(), entry.getEnd(), entry.getLastRecurrence(), onOrAfter, until, firstOnly, ignoredDates); }
/** * Builds a Java TimeZone from the VTIMEZONE info in an * iCal file. * @return a Java TimeZone that matches the iCal one, or NULL if no TZ info present */ public static SimpleTimeZone buildTimeZone(String ical) { return buildTimeZone( getICalParams(ical) ); }
/** * Returns the parsed calendar recurrence rule * WARNING - Alfresco use only. Return type will likely shift to * a real object in the near future */ public static Map<String,String> extractRecurrenceRule(CalendarEntry entry) { return extractRecurrenceRule(entry.getRecurrenceRule()); }
private static void addMonthToFirstDayOfWeek(Calendar c, int dayOfWeek, int monthInterval) { // Go forward to the 1st of next month addMonthToDayOfMonth(c, 1, monthInterval); // Set the day of the week toDayOfWeekInMonth(c, dayOfWeek, 1); }
/** * Splits an iCal line into key and value by the first * unquoted colon. * @param icalLine String */ protected static String[] icalLineKeyValue(String icalLine){ int delim = indexOfFirstUnquotedColon(icalLine); if(delim == -1){ return new String[]{"",""}; } String key = icalLine.substring(0,delim); String value = icalLine.substring(delim+1); return new String[]{key,value}; }