results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(ALTERNATE_CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); 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(); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(2, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(ALTERNATE_CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(2, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(ALTERNATE_CALENDAR_SITE.getShortName(), paging); assertEquals(3, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging);
CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); 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()); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(3, results.getPage().size()); assertEquals("TitleA", results.getPage().get(0).getTitle()); CalendarEntry entryD = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "TitleD", "Description", "Location", new Date(1302417000), new Date(1302420600))); testNodesToTidy.add(entryD.getNodeRef()); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(3, results.getPage().size()); assertEquals("TitleD", results.getPage().get(0).getTitle()); results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(1, results.getPage().size()); assertEquals("TitleC", results.getPage().get(0).getTitle()); results = CALENDAR_SERVICE.listOutlookCalendarEntries(CALENDAR_SITE.getShortName(), null, paging); assertEquals(0, results.getPage().size());
CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), new PagingRequest(10)); assertEquals(0, results.getPage().size()); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), "madeUp"); assertEquals(null, entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), "madeUp2"); assertEquals(null, entry); CALENDAR_SERVICE.updateCalendarEntry(entry); fail("Shouldn't be able to update a brand new entry"); entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals("Title", entry.getTitle()); assertEquals("Description", entry.getDescription());
entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry); testNodesToTidy.add(entry.getNodeRef()); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals(0, entry.getTags().size()); entry.getTags().add(TAG_1); assertEquals(3, entry.getTags().size()); CALENDAR_SERVICE.updateCalendarEntry(entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals(2, entry.getTags().size()); assertEquals(true, entry.getTags().contains(TAG_1)); entry.getTags().add(TAG_3); entry.getTags().add(TAG_1); CALENDAR_SERVICE.updateCalendarEntry(entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals(2, entry.getTags().size()); // Duplicate now gone assertEquals(true, entry.getTags().contains(TAG_1)); CALENDAR_SERVICE.updateCalendarEntry(entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals(0, entry.getTags().size()); entry.getTags().add(TAG_2); entry.getTags().add(TAG_3);
entries = calendarService.listCalendarEntries(site.getShortName(), paging);
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))); CALENDAR_SERVICE.updateCalendarEntry(c3); c3.setEnd(c20110719tue.getTime()); c3.setLastRecurrence(c20110722fri.getTime()); CALENDAR_SERVICE.updateCalendarEntry(c3); CALENDAR_SERVICE.updateCalendarEntry(c3);
entry.setOutlook(true); entry.setOutlookUID("12345LookOut!"); entry = CALENDAR_SERVICE.createCalendarEntry(CALENDAR_SITE.getShortName(), entry); entry.setOutlookUID(null); CALENDAR_SERVICE.updateCalendarEntry(entry); entry = CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()); assertEquals("New Title", entry.getTitle()); assertEquals("Description", entry.getDescription()); CALENDAR_SERVICE.deleteCalendarEntry(entry); assertEquals(null, CALENDAR_SERVICE.getCalendarEntry(CALENDAR_SITE.getShortName(), entry.getSystemName()));
entries = calendarService.listCalendarEntries(site.getShortName(), paging);
results = CALENDAR_SERVICE.listCalendarEntries(CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(ALTERNATE_CALENDAR_SITE.getShortName(), paging); assertEquals(0, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(new String[] { CALENDAR_SITE.getShortName(), ALTERNATE_CALENDAR_SITE.getShortName()}, paging); assertEquals(0, results.getPage().size()); results = CALENDAR_SERVICE.listCalendarEntries(new String[] { CALENDAR_SITE.getShortName(), ALTERNATE_CALENDAR_SITE.getShortName(), "MadeUpNumber1", "MadeUpTwo", "MadeUp3"}, paging); 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(); results = CALENDAR_SERVICE.listCalendarEntries(new String[] { CALENDAR_SITE.getShortName(), ALTERNATE_CALENDAR_SITE.getShortName()}, paging); assertEquals(3, results.getPage().size()); NodeRef ca1 = CALENDAR_SERVICE.createCalendarEntry(ALTERNATE_CALENDAR_SITE.getShortName(), new CalendarEntryDTO( "PrivateTitleA", "Description", "Location", new Date(1302131400), new Date(1302135000)