Monotone-Parent: 304019ef4927dcf653b6c4c591e87a5b17c9edf2
Monotone-Revision: 77b66d1c57c68b5b16ff0e72dbda315edaeed590 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-16T22:14:37 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
b3e112a022
commit
206ba45c65
|
@ -25,8 +25,10 @@
|
||||||
#import <NGObjWeb/NSException+HTTP.h>
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
#import <NGObjWeb/SoObject+SoDAV.h>
|
#import <NGObjWeb/SoObject+SoDAV.h>
|
||||||
#import <NGObjWeb/WOContext.h>
|
#import <NGObjWeb/WOContext.h>
|
||||||
|
#import <NGObjWeb/WOResponse.h>
|
||||||
#import <NGObjWeb/WORequest.h>
|
#import <NGObjWeb/WORequest.h>
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
|
#import <NGExtensions/NSString+misc.h>
|
||||||
#import <EOControl/EOQualifier.h>
|
#import <EOControl/EOQualifier.h>
|
||||||
#import <EOControl/EOSortOrdering.h>
|
#import <EOControl/EOSortOrdering.h>
|
||||||
#import <GDLContentStore/GCSFolder.h>
|
#import <GDLContentStore/GCSFolder.h>
|
||||||
|
@ -103,7 +105,6 @@
|
||||||
|
|
||||||
if (filter && [filter length] > 0)
|
if (filter && [filter length] > 0)
|
||||||
{
|
{
|
||||||
#warning why we do not use %%%@%% everywhere?
|
|
||||||
qs = [NSString stringWithFormat:
|
qs = [NSString stringWithFormat:
|
||||||
@"(c_sn isCaseInsensitiveLike: '%@%%') OR "
|
@"(c_sn isCaseInsensitiveLike: '%@%%') OR "
|
||||||
@"(c_givenname isCaseInsensitiveLike: '%@%%') OR "
|
@"(c_givenname isCaseInsensitiveLike: '%@%%') OR "
|
||||||
|
@ -195,7 +196,6 @@
|
||||||
NSMutableDictionary *filterData;
|
NSMutableDictionary *filterData;
|
||||||
id <DOMNode> parentNode;
|
id <DOMNode> parentNode;
|
||||||
id <DOMNodeList> ranges;
|
id <DOMNodeList> ranges;
|
||||||
NSString *componentName;
|
|
||||||
|
|
||||||
parentNode = [filterElement parentNode];
|
parentNode = [filterElement parentNode];
|
||||||
|
|
||||||
|
@ -244,34 +244,6 @@
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _appendComponentsMatchingFilters: (NSArray *) filters
|
|
||||||
toResponse: (WOResponse *) response
|
|
||||||
{
|
|
||||||
unsigned int count, max;
|
|
||||||
NSDictionary *currentFilter, *contact;
|
|
||||||
NSEnumerator *contacts;
|
|
||||||
NSString *baseURL;
|
|
||||||
|
|
||||||
baseURL = [self baseURLInContext: context];
|
|
||||||
|
|
||||||
max = [filters count];
|
|
||||||
for (count = 0; count < max; count++)
|
|
||||||
{
|
|
||||||
currentFilter = [filters objectAtIndex: count];
|
|
||||||
contacts = [[self lookupContactsWithFilter: [[currentFilter allValues] lastObject]
|
|
||||||
sortBy: @"c_givenname"
|
|
||||||
ordering: NSOrderedDescending]
|
|
||||||
objectEnumerator];
|
|
||||||
|
|
||||||
while ((contact = [contacts nextObject]))
|
|
||||||
{
|
|
||||||
[self appendObject: contact
|
|
||||||
withBaseURL: baseURL
|
|
||||||
toREPORTResponse: response];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) appendObject: (NSDictionary *) object
|
- (void) appendObject: (NSDictionary *) object
|
||||||
withBaseURL: (NSString *) baseURL
|
withBaseURL: (NSString *) baseURL
|
||||||
toREPORTResponse: (WOResponse *) r
|
toREPORTResponse: (WOResponse *) r
|
||||||
|
@ -308,6 +280,34 @@
|
||||||
[r appendContentString: @" </D:response>\r\n"];
|
[r appendContentString: @" </D:response>\r\n"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) _appendComponentsMatchingFilters: (NSArray *) filters
|
||||||
|
toResponse: (WOResponse *) response
|
||||||
|
{
|
||||||
|
unsigned int count, max;
|
||||||
|
NSDictionary *currentFilter, *contact;
|
||||||
|
NSEnumerator *contacts;
|
||||||
|
NSString *baseURL;
|
||||||
|
|
||||||
|
baseURL = [self baseURLInContext: context];
|
||||||
|
|
||||||
|
max = [filters count];
|
||||||
|
for (count = 0; count < max; count++)
|
||||||
|
{
|
||||||
|
currentFilter = [filters objectAtIndex: count];
|
||||||
|
contacts = [[self lookupContactsWithFilter: [[currentFilter allValues] lastObject]
|
||||||
|
sortBy: @"c_givenname"
|
||||||
|
ordering: NSOrderedDescending]
|
||||||
|
objectEnumerator];
|
||||||
|
|
||||||
|
while ((contact = [contacts nextObject]))
|
||||||
|
{
|
||||||
|
[self appendObject: contact
|
||||||
|
withBaseURL: baseURL
|
||||||
|
toREPORTResponse: response];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *) lookupContactsWithFilter: (NSString *) filter
|
- (NSArray *) lookupContactsWithFilter: (NSString *) filter
|
||||||
sortBy: (NSString *) sortKey
|
sortBy: (NSString *) sortKey
|
||||||
ordering: (NSComparisonResult) sortOrdering
|
ordering: (NSComparisonResult) sortOrdering
|
||||||
|
|
Loading…
Reference in a new issue