diff --git a/ChangeLog b/ChangeLog index c730438b8..6b065820b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,17 @@ * UI/Scheduler/UIxAppointmentEditor.m (-viewAction): added calendar name in returned dictionary. +2009-12-22 Wolfgang Sourdeau + + * Tests/test-webdav.py (WebDAVTest.testPrincipalCollectionSet2): + fixed test to use the proper collection URL as expected value, + rather that the freebusy.ifb resource URL. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (_appendComponentProperties:matchingFilters:toResponse:) + (_appendComponentProperties:matchingURLs:toResponse:): ensure that + baseURL ends with "/". + 2009-12-21 Wolfgang Sourdeau * SoObjects/SOGo/SOGoUserFolder.m (-fetchContentObjectNames): diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index e1c465207..0d51e7fd8 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1308,8 +1308,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir [r appendFormat: @""]; [r appendString: baseURL]; -// if (![baseURL hasSuffix: @"/"]) -// [r appendContentString: @"/"]; [r appendString: [object objectForKey: @"c_name"]]; [r appendString: @""]; @@ -1715,6 +1713,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir if ([currentField length]) [fields addObjectUniquely: currentField]; baseURL = [self davURLAsString]; +#warning review this when fixing http://www.scalableogo.org/bugs/view.php?id=276 + if (![baseURL hasSuffix: @"/"]) + baseURL = [NSString stringWithFormat: @"%@/", baseURL]; propertiesArray = [[properties allKeys] asPointersOfObjects]; propertiesCount = [properties count]; @@ -1934,6 +1935,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir NSEnumerator *addFields; baseURL = [self davURLAsString]; +#warning review this when fixing http://www.scalableogo.org/bugs/view.php?id=276 + if (![baseURL hasSuffix: @"/"]) + baseURL = [NSString stringWithFormat: @"%@/", baseURL]; urls = [NSMutableArray array]; max = [refs length]; diff --git a/SoObjects/Appointments/SOGoUserFolder+Appointments.m b/SoObjects/Appointments/SOGoUserFolder+Appointments.m index ac1ba9c86..506e1ac7c 100644 --- a/SoObjects/Appointments/SOGoUserFolder+Appointments.m +++ b/SoObjects/Appointments/SOGoUserFolder+Appointments.m @@ -98,7 +98,8 @@ - (NSArray *) _davPersonalCalendarURL { SOGoAppointmentFolders *parent; - NSArray *tag, *parentURL; + NSArray *tag; + NSString *parentURL; parent = [self privateCalendars: @"Calendar" inContext: context]; parentURL = [parent davURLAsString]; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 33bed506f..8d0d4a971 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -1064,6 +1064,9 @@ static NSArray *childRecordFields = nil; newToken = 0; baseURL = [self davURLAsString]; +#warning review this when fixing http://www.scalableogo.org/bugs/view.php?id=276 + if (![baseURL hasSuffix: @"/"]) + baseURL = [NSString stringWithFormat: @"%@/", baseURL]; max = [records count]; syncResponses = [NSMutableArray arrayWithCapacity: max + 1]; diff --git a/Tests/test-webdav.py b/Tests/test-webdav.py index d8cb79663..14e45cf70 100755 --- a/Tests/test-webdav.py +++ b/Tests/test-webdav.py @@ -7,7 +7,7 @@ import webdavlib class WebDAVTest(unittest.TestCase): def testPrincipalCollectionSet(self): - """property: principal-collection-set""" + """property: 'principal-collection-set' on collection object""" client = webdavlib.WebDAVClient(hostname, port, username, password) resource = '/SOGo/dav/%s/' % username propfind = webdavlib.WebDAVPROPFIND(resource, @@ -29,7 +29,7 @@ class WebDAVTest(unittest.TestCase): % ( responseHref, resource )) def testPrincipalCollectionSet2(self): - """property: principal-collection-set""" + """property: 'principal-collection-set' on non-collection object""" client = webdavlib.WebDAVClient(hostname, port, username, password) resource = '/SOGo/dav/%s/freebusy.ifb' % username propfind = webdavlib.WebDAVPROPFIND(resource, @@ -41,14 +41,15 @@ class WebDAVTest(unittest.TestCase): nodes = propfind.xpath_evaluate('/D:multistatus/D:response/D:propstat/D:prop/D:principal-collection-set/D:href', None) responseHref = nodes[0].childNodes[0].nodeValue + expectedHref = '/SOGo/dav/%s/' % username if responseHref[0:4] == "http": - self.assertEquals("http://%s%s" % (hostname, resource), responseHref, + self.assertEquals("http://%s%s" % (hostname, expectedHref), responseHref, "{DAV:}principal-collection-set returned %s instead of '%s'" - % ( responseHref, resource )) + % ( responseHref, expectedHref )) else: - self.assertEquals(resource, responseHref, + self.assertEquals(expectedHref, responseHref, "{DAV:}principal-collection-set returned %s instead of '%s'" - % ( responseHref, resource )) + % ( responseHref, expectedHref )) if __name__ == "__main__": unittest.main()