From 56075d6240416f4b2a3c082d8d16598b21f19dee Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 Dec 2009 20:33:47 +0000 Subject: [PATCH 1/3] Monotone-Parent: 1f071b472ff826a3cdfb0f8ecafbe3f2c31e969e Monotone-Revision: a678bfc28369a5cca8665c85a0a2e944c1a1fa37 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-12-22T20:33:47 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/Appointments/SOGoAppointmentFolder.m | 8 ++++++-- SoObjects/SOGo/SOGoGCSFolder.m | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 649e17f27..6078f135a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-12-22 Wolfgang Sourdeau + + * 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/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]; From d73757c3ad7f8b8166e5296962cec9e23f371dac Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 Dec 2009 20:35:19 +0000 Subject: [PATCH 2/3] Monotone-Parent: becba1041ad050a1189effa1d6444a31a7727dc3 Monotone-Revision: 342a840830ca9a56c37f7c05d3a5defaf3099bb7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-12-22T20:35:19 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ Tests/test-webdav.py | 13 +++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6078f135a..eb1e428de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 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 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() From ab3c3f3599edf3f04061dc42e733ed9f5cd95242 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 Dec 2009 20:46:29 +0000 Subject: [PATCH 3/3] Monotone-Parent: 342a840830ca9a56c37f7c05d3a5defaf3099bb7 Monotone-Revision: 6f84a669db2d05b99c1720fe9558575f53130156 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-12-22T20:46:29 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoUserFolder+Appointments.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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];