if (entry.getStart() == null || entry.getEnd() == null) Calendar endUTC = Calendar.getInstance(); startUTC.setTime(entry.getStart()); endUTC.setTime(entry.getEnd()); startUTC.setTimeZone(UTC); endUTC.setTimeZone(UTC); Calendar endLocal = Calendar.getInstance(); startLocal.setTime(entry.getStart()); endLocal.setTime(entry.getEnd());
if (entry.getStart() == null || entry.getEnd() == null) Calendar endUTC = Calendar.getInstance(); startUTC.setTime(entry.getStart()); endUTC.setTime(entry.getEnd()); startUTC.setTimeZone(UTC); endUTC.setTimeZone(UTC); Calendar endLocal = Calendar.getInstance(); startLocal.setTime(entry.getStart()); endLocal.setTime(entry.getEnd());
/** * Builds up the node properties for a given Calendar Entry * Doesn't handle tags, those must be done in the service itself. */ protected static Map<QName,Serializable> toNodeProperties(CalendarEntry entry) { Map<QName,Serializable> properties = new HashMap<QName, Serializable>(); properties.put(CalendarModel.PROP_WHAT, entry.getTitle()); properties.put(CalendarModel.PROP_DESCRIPTION, entry.getDescription()); properties.put(CalendarModel.PROP_WHERE, entry.getLocation()); properties.put(CalendarModel.PROP_FROM_DATE, entry.getStart()); properties.put(CalendarModel.PROP_TO_DATE, entry.getEnd()); properties.put(CalendarModel.PROP_RECURRENCE_RULE, entry.getRecurrenceRule()); properties.put(CalendarModel.PROP_RECURRENCE_LAST_MEETING, entry.getLastRecurrence()); properties.put(CalendarModel.PROP_IS_OUTLOOK, entry.isOutlook()); properties.put(CalendarModel.PROP_OUTLOOK_UID, entry.getOutlookUID()); properties.put(CalendarModel.PROP_DOC_FOLDER, entry.getSharePointDocFolder()); // properties.put(CalendarModel.PROP_COLOR, entry.getColor(); return properties; }
/** * Builds up the node properties for a given Calendar Entry * Doesn't handle tags, those must be done in the service itself. */ protected static Map<QName,Serializable> toNodeProperties(CalendarEntry entry) { Map<QName,Serializable> properties = new HashMap<QName, Serializable>(); properties.put(CalendarModel.PROP_WHAT, entry.getTitle()); properties.put(CalendarModel.PROP_DESCRIPTION, entry.getDescription()); properties.put(CalendarModel.PROP_WHERE, entry.getLocation()); properties.put(CalendarModel.PROP_FROM_DATE, entry.getStart()); properties.put(CalendarModel.PROP_TO_DATE, entry.getEnd()); properties.put(CalendarModel.PROP_RECURRENCE_RULE, entry.getRecurrenceRule()); properties.put(CalendarModel.PROP_RECURRENCE_LAST_MEETING, entry.getLastRecurrence()); properties.put(CalendarModel.PROP_IS_OUTLOOK, entry.isOutlook()); properties.put(CalendarModel.PROP_OUTLOOK_UID, entry.getOutlookUID()); properties.put(CalendarModel.PROP_DOC_FOLDER, entry.getSharePointDocFolder()); // properties.put(CalendarModel.PROP_COLOR, entry.getColor(); return properties; }
/** * 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); }
/** * 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); }
assertEquals(c3.getEnd(), ISO8601DateFormat.parse(filtered.get(0).getToDate(),utc)); assertEquals(c3.getRecurrenceRule(), filtered.get(0).getRecurrenceRule()); assertEquals(null, filtered.get(0).getRecurrenceLastMeeting()); assertEquals(c1.getEnd(), ISO8601DateFormat.parse(filtered.get(1).getToDate(),utc)); assertEquals(c1.getRecurrenceRule(), filtered.get(1).getRecurrenceRule()); assertEquals(null, filtered.get(1).getRecurrenceLastMeeting()); assertEquals(c2.getEnd(), ISO8601DateFormat.parse(filtered.get(2).getToDate(),utc)); assertEquals(c2.getRecurrenceRule(), filtered.get(2).getRecurrenceRule()); assertEquals(null, filtered.get(2).getRecurrenceLastMeeting()); assertEquals(c3.getEnd(), ISO8601DateFormat.parse(filtered.get(0).getToDate(),utc)); assertEquals(c3.getLastRecurrence(), ISO8601DateFormat.parse(filtered.get(0).getRecurrenceLastMeeting(),utc)); assertEquals(c3.getRecurrenceRule(), filtered.get(0).getRecurrenceRule()); assertEquals(c1.getEnd(), ISO8601DateFormat.parse(filtered.get(1).getToDate(),utc)); assertEquals(c1.getRecurrenceRule(), filtered.get(1).getRecurrenceRule()); assertEquals(null, filtered.get(1).getRecurrenceLastMeeting());
assertEquals("Location", entry.getLocation()); assertEquals(1, entry.getStart().getTime()); assertEquals(1234, entry.getEnd().getTime()); assertEquals(null, entry.getRecurrenceRule()); assertEquals(null, entry.getLastRecurrence()); assertEquals("Location", entry.getLocation()); assertEquals(1234567, entry.getStart().getTime()); assertEquals(1294567, entry.getEnd().getTime()); assertEquals("1w", entry.getRecurrenceRule()); assertEquals(1234567, entry.getLastRecurrence().getTime());
assertEquals("Location", entry.getLocation()); assertEquals(1, entry.getStart().getTime()); assertEquals(1234, entry.getEnd().getTime()); assertEquals(null, entry.getRecurrenceRule()); assertEquals(null, entry.getLastRecurrence()); assertEquals("Location", entry.getLocation()); assertEquals(1, entry.getStart().getTime()); assertEquals(1234, entry.getEnd().getTime()); assertEquals(null, entry.getRecurrenceRule()); assertEquals(null, entry.getLastRecurrence());