From 7acad8f8f9b671f8fe57b181e852036a5e598be1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 7 Jul 2009 20:56:09 +0000 Subject: [PATCH] Monotone-Parent: 18a2136e7e775fc22d94d6a7805e474939c22f28 Monotone-Revision: c7fbb37f86d4d228354053447bb000451c74730a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-07-07T20:56:09 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/SOGo/SOGoGCSFolder.m | 27 ++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1048a989..aa430454b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-07 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoGCSFolder.m (-davSyncCollection:): added the + ability to specify additional filters for elements that must be + returned. + (-additionalWebdavSyncFilters): new method that returns a + parametrable where clause for reset queries. + 2009-07-07 Cyril Robert * UI/WebServerResources/MailerUI.js: Fixed Drag&Drop issue (header was diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index bc54e036e..0aa9e451d 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -698,7 +698,7 @@ static NSArray *childRecordFields = nil; tmpA = [moduleSettings objectForKey: @"InactiveFolders"]; if (tmpA) - [tmpA removeObject: [self nameInContainer]]; + [tmpA removeObject: nameInContainer]; tmpD = [moduleSettings objectForKey: @"FolderSyncTags"]; if (tmpD) @@ -881,6 +881,11 @@ static NSArray *childRecordFields = nil; ignoreDeleted: ignoreDeleted]; } +- (NSString *) additionalWebdavSyncFilters +{ + return @""; +} + - (NSArray *) _fetchSyncTokenFields: (NSDictionary *) properties matchingSyncToken: (int) syncToken { @@ -893,7 +898,7 @@ static NSArray *childRecordFields = nil; NSArray *records; EOQualifier *qualifier; NSEnumerator *addFields; - NSString *currentField; + NSString *currentField, *filter; fields = [NSMutableArray arrayWithObjects: @"c_name", @"c_component", @"c_creationdate", @"c_lastmodified", nil]; @@ -910,8 +915,8 @@ static NSArray *childRecordFields = nil; withQualifier: qualifier ignoreDeleted: YES]]; qualifier = [EOQualifier qualifierWithQualifierFormat: - @"c_lastmodified > %d and c_deleted == 1", - syncToken]; + @"c_lastmodified > %d and c_deleted == 1", + syncToken]; fields = [NSMutableArray arrayWithObjects: @"c_name", @"c_deleted", nil]; [mRecords addObjectsFromArray: [self _fetchFields: fields withQualifier: qualifier @@ -919,8 +924,15 @@ static NSArray *childRecordFields = nil; records = mRecords; } else - records = [self _fetchFields: fields withQualifier: nil - ignoreDeleted: YES]; + { + filter = [self additionalWebdavSyncFilters]; + if ([filter length]) + qualifier = [EOQualifier qualifierWithQualifierFormat: filter]; + else + qualifier = nil; + records = [self _fetchFields: fields withQualifier: qualifier + ignoreDeleted: YES]; + } return records; } @@ -1115,6 +1127,7 @@ static NSArray *childRecordFields = nil; documentElement = (DOMElement *) [document documentElement]; syncToken = [[documentElement firstElementWithTag: @"sync-token" inNamespace: XMLNS_WEBDAV] textValue]; + propElement = [documentElement firstElementWithTag: @"prop" inNamespace: XMLNS_WEBDAV]; @@ -1333,7 +1346,7 @@ static NSArray *childRecordFields = nil; @" VALUES ('/%@', '%@', '%@')", [folder aclTableName], objectPath, uid, currentRole]; - [channel evaluateExpressionX: SQL]; + [channel evaluateExpressionX: SQL]; } [[channel adaptorContext] commitTransaction];