((CalendarEntryDTO)entry).setCreatedAt((Date)properties.get(ContentModel.PROP_CREATED)); ((CalendarEntryDTO)entry).setModifiedAt((Date)properties.get(ContentModel.PROP_MODIFIED));
CalendarEntryDTO entry = new CalendarEntryDTO(); entry.setStart(c20110719_0000.getTime()); entry.setEnd( c20110719_0000.getTime()); assertTrue(CalendarEntryDTO.isAllDay(entry)); entry.setStart(c20110719_0000.getTime()); entry.setEnd( c20110720_0000.getTime()); assertTrue(CalendarEntryDTO.isAllDay(entry)); entry.setStart(c20110719_0000.getTime()); entry.setEnd( c20110721_0000.getTime()); assertTrue(CalendarEntryDTO.isAllDay(entry)); entry.setStart(c20110719_0000.getTime()); entry.setEnd( c20110719_1000.getTime()); assertFalse(CalendarEntryDTO.isAllDay(entry)); entry.setStart(c20110719_1000.getTime()); entry.setEnd( c20110720_0000.getTime()); assertFalse(CalendarEntryDTO.isAllDay(entry)); entry.setStart(c20110719_1000.getTime()); entry.setEnd( c20110719_1000.getTime()); assertFalse(CalendarEntryDTO.isAllDay(entry)); entry.setStart( c20110721_0000ny.getTime()); entry.setEnd( c20110721_0000ny.getTime()); assertTrue(CalendarEntryDTO.isAllDay(entry));
CalendarEntry entryA = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleA", "Description", "Location", new Date(1302431400), new Date(1302435000))); CalendarEntry entryB = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleB", "Description", "Location", new Date(1302431400), new Date(1302442200))); CalendarEntry entryC = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleC", "Description", "Location", new Date(1302435000), new Date(1302442200))); testNodesToTidy.add(entryA.getNodeRef()); CalendarEntry entryD = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleD", "Description", "Location", new Date(1302417000), new Date(1302420600))); testNodesToTidy.add(entryD.getNodeRef()); ((CalendarEntryDTO)entryB).setOutlook(true); ((CalendarEntryDTO)entryB).setOutlookUID(uidB); ((CalendarEntryDTO)entryC).setOutlook(true); ((CalendarEntryDTO)entryC).setOutlookUID(uidC); CALENDAR_SERVICE.updateCalendarEntry(entryB); CALENDAR_SERVICE.updateCalendarEntry(entryC);
CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleA", "Description", "Location", new Date(1302431400), new Date(1302435000))); CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleB", "Description", "Location", new Date(1302431400), new Date(1302442200))); CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleA", "Description", "Location", new Date(1302431400), new Date(1302435000))); CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleB", "Description", "Location", new Date(1302431400), new Date(1302442200))); NodeRef priv3 = CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleC", "Description", "Location", new Date(1302431400), new Date(1302442200) )).getNodeRef();
entry = new CalendarEntryDTO( "Title", "Description", "Location", new Date(1), new Date(1234)); entry.setOutlook(true); assertEquals(false, CalendarEntryDTO.isAllDay(entry)); assertEquals(false, CalendarEntryDTO.isAllDay(entry)); assertEquals(true, CalendarEntryDTO.isAllDay(entry));
((CalendarEntryDTO)entry).setModifiedAt( (Date)nodeService.getProperty(entry.getNodeRef(), ContentModel.PROP_MODIFIED) );
entry = new CalendarEntryDTO( "Title", "Description", "Location", new Date(1), new Date(1234)); entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry); entry = new CalendarEntryDTO( "Title", "Description", "Location", new Date(1), new Date(1234)); entry.getTags().add(TAG_1);
((CalendarEntryDTO)entry).setModifiedAt( (Date)nodeService.getProperty(entry.getNodeRef(), ContentModel.PROP_MODIFIED) );
((CalendarEntryDTO)entry).setCreatedAt((Date)properties.get(ContentModel.PROP_CREATED)); ((CalendarEntryDTO)entry).setModifiedAt((Date)properties.get(ContentModel.PROP_MODIFIED));
CalendarEntry c1 = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "SiteNormal", "Description", "Location", new Date(1302431400), new Date(1302442200))); CalendarEntry c2 = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "SiteRepeating", "Description", "Location", new Date(1302435000), new Date(1302435000))); CalendarEntry c3 = CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "AltSiteNormal", "Description", "Location", new Date(1302431400), new Date(1302435000)));
NodeRef c1 = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleA", "Description", "Location", new Date(1302431400), new Date(1302442200) )).getNodeRef(); NodeRef c2 = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleB", "Description", "Location", new Date(1302435000), new Date(1302435000) )).getNodeRef(); NodeRef c3 = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleC", "Description", "Location", new Date(1302431400), new Date(1302435000) )).getNodeRef(); NodeRef ca1 = CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleA", "Description", "Location", new Date(1302131400), new Date(1302135000) )).getNodeRef(); NodeRef ca2 = CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleB", "Description", "Location", new Date(1302731400), new Date(1302472200) )).getNodeRef();
entry = new CalendarEntryDTO( "Title", "Description", "Location", new Date(1), new Date(1234)); entry.setOutlook(true);