mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
Monotone-Parent: f6b8a3a72253a47ef5eda38ba241b206f9b48f65
Monotone-Revision: 1fb2ab16dbaee22f67d20e86943f297a72cf6c72 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-07T23:34:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
2007-11-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Contacts/SOGoContactLDAPFolder.m
|
||||
([SOGoContactLDAPFolder
|
||||
-appendObject:objectwithBaseURL:baseURLtoREPORTResponse:r]):
|
||||
take the content of an object returned by
|
||||
lookupName:inContext:acquire: instead of the dictionary passed as
|
||||
parameter since it represents a flattened entry return by
|
||||
lookupContactsWithFilter...
|
||||
|
||||
* SoObjects/Contacts/SOGoFolder+CardDAV.m: NSObject+CardDAV
|
||||
category renamed to SOGoFolder+CardDAV.
|
||||
|
||||
* SoObjects/SOGo/SOGoParentFolder.m: no longer a subclass of
|
||||
SOGoObject, but of SOGoFolder instead.
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ BUNDLE_NAME = Contacts
|
||||
Contacts_PRINCIPAL_CLASS = SOGoContactsProduct
|
||||
|
||||
Contacts_OBJC_FILES = \
|
||||
NSObject+CardDAV.m \
|
||||
Product.m \
|
||||
SOGoFolder+CardDAV.m \
|
||||
SOGoContactFolders.m \
|
||||
SOGoContactGCSEntry.m \
|
||||
SOGoContactGCSFolder.m \
|
||||
|
||||
@@ -33,15 +33,13 @@
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
@class NSString, NSArray;
|
||||
@class SOGoContactObject;
|
||||
@class SOGoObject;
|
||||
@class WOResponse;
|
||||
|
||||
@protocol SOGoContactObject;
|
||||
|
||||
#import <SoObjects/SOGo/SOGoFolder.h>
|
||||
|
||||
@class NSArray;
|
||||
@class NSDictionary;
|
||||
@class NSString;
|
||||
@class WOResponse;
|
||||
|
||||
@protocol SOGoContactFolder <NSObject>
|
||||
|
||||
- (void) appendObject: (NSDictionary *) object
|
||||
|
||||
@@ -53,21 +53,20 @@
|
||||
{
|
||||
LDAPUserManager *um;
|
||||
NSEnumerator *sourceIDs;
|
||||
NSString *currentSourceID, *displayName;
|
||||
NSString *currentSourceID, *srcDisplayName;
|
||||
SOGoContactLDAPFolder *currentFolder;
|
||||
|
||||
um = [LDAPUserManager sharedUserManager];
|
||||
sourceIDs = [[um addressBookSourceIDs] objectEnumerator];
|
||||
currentSourceID = [sourceIDs nextObject];
|
||||
while (currentSourceID)
|
||||
while ((currentSourceID = [sourceIDs nextObject]))
|
||||
{
|
||||
displayName = [um displayNameForSourceWithID: currentSourceID];
|
||||
srcDisplayName = [um displayNameForSourceWithID: currentSourceID];
|
||||
currentFolder = [SOGoContactLDAPFolder folderWithName: currentSourceID
|
||||
andDisplayName: displayName
|
||||
andDisplayName: srcDisplayName
|
||||
inContainer: self];
|
||||
[currentFolder setLDAPSource: [um sourceWithID: currentSourceID]];
|
||||
[subFolders setObject: currentFolder forKey: currentSourceID];
|
||||
currentSourceID = [sourceIDs nextObject];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#import <SoObjects/SOGo/SOGoGCSFolder.h>
|
||||
|
||||
#import "SOGoContactFolder.h"
|
||||
#import "NSObject+CardDAV.h"
|
||||
#import "SOGoFolder+CardDAV.h"
|
||||
|
||||
@class NSArray;
|
||||
@class NSString;
|
||||
|
||||
@@ -205,18 +205,16 @@
|
||||
return records;
|
||||
}
|
||||
|
||||
#warning this should be unified within SOGoFolder
|
||||
- (void) appendObject: (NSDictionary *) object
|
||||
withBaseURL: (NSString *) baseURL
|
||||
toREPORTResponse: (WOResponse *) r
|
||||
{
|
||||
SOGoContactGCSEntry *component;
|
||||
Class componentClass;
|
||||
NSString *name, *etagLine, *contactString;
|
||||
|
||||
name = [object objectForKey: @"c_name"];
|
||||
componentClass = [SOGoContactGCSEntry class];
|
||||
|
||||
component = [componentClass objectWithName: name inContainer: self];
|
||||
component = [self lookupName: name inContext: context acquire: NO];
|
||||
|
||||
[r appendContentString: @" <D:response>\r\n"];
|
||||
[r appendContentString: @" <D:href>"];
|
||||
|
||||
@@ -24,13 +24,13 @@
|
||||
#define SOGOCONTACTLDAPFOLDER_H
|
||||
|
||||
#import "SOGoContactFolder.h"
|
||||
#import "NSObject+CardDAV.h"
|
||||
#import "SOGoFolder+CardDAV.h"
|
||||
|
||||
@class NSMutableDictionary;
|
||||
|
||||
@class LDAPSource;
|
||||
|
||||
@interface SOGoContactLDAPFolder : SOGoObject <SOGoContactFolder>
|
||||
@interface SOGoContactLDAPFolder : SOGoFolder <SOGoContactFolder>
|
||||
{
|
||||
NSString *displayName;
|
||||
LDAPSource *ldapSource;
|
||||
|
||||
@@ -45,20 +45,16 @@
|
||||
|
||||
@implementation SOGoContactLDAPFolder
|
||||
|
||||
#warning this should be unified within SOGoFolder
|
||||
- (void) appendObject: (NSDictionary *) object
|
||||
withBaseURL: (NSString *) baseURL
|
||||
toREPORTResponse: (WOResponse *) r
|
||||
{
|
||||
SOGoContactLDIFEntry *component;
|
||||
Class componentClass;
|
||||
NSString *name, *etagLine, *contactString;
|
||||
|
||||
name = [object objectForKey: @"c_name"];
|
||||
componentClass = [SOGoContactLDIFEntry class];
|
||||
|
||||
|
||||
component = [componentClass contactEntryWithName: name
|
||||
withLDIFEntry: object inContainer: self];
|
||||
component = [self lookupName: name inContext: context acquire: NO];
|
||||
|
||||
[r appendContentString: @" <D:response>\r\n"];
|
||||
[r appendContentString: @" <D:href>"];
|
||||
@@ -163,42 +159,11 @@
|
||||
if (!obj)
|
||||
{
|
||||
ldifEntry = [ldapSource lookupContactEntry: objectName];
|
||||
#if 0
|
||||
obj = ((ldifEntry)
|
||||
? [SOGoContactLDIFEntry contactEntryWithName: objectName
|
||||
withLDIFEntry: ldifEntry
|
||||
inContainer: self]
|
||||
: [NSException exceptionWithHTTPStatus: 404]);
|
||||
#else
|
||||
if (ldifEntry)
|
||||
obj = [SOGoContactLDIFEntry contactEntryWithName: objectName
|
||||
withLDIFEntry: ldifEntry
|
||||
inContainer: self];
|
||||
else
|
||||
{
|
||||
NSArray *davNamespaces;
|
||||
NSDictionary *davInvocation;
|
||||
NSString *objcMethod;
|
||||
|
||||
davNamespaces = [self davNamespaces];
|
||||
if ([davNamespaces count] > 0)
|
||||
{
|
||||
davInvocation = [objectName asDavInvocation];
|
||||
if (davInvocation
|
||||
&& [davNamespaces
|
||||
containsObject: [davInvocation objectForKey: @"ns"]])
|
||||
{
|
||||
objcMethod = [[davInvocation objectForKey: @"method"]
|
||||
davMethodToObjC];
|
||||
obj = [[SoSelectorInvocation alloc]
|
||||
initWithSelectorNamed:
|
||||
[NSString stringWithFormat: @"%@:", objcMethod]
|
||||
addContextParameter: YES];
|
||||
[obj autorelease];
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
#ifndef __Contacts_NSObject_CardDAV_H__
|
||||
#define __Contacts_NSObject_CardDAV_H__
|
||||
|
||||
@interface NSObject (CardDAV)
|
||||
#import "SOGoContactFolder.h"
|
||||
|
||||
@interface SOGoFolder (CardDAV) <SOGoContactFolder>
|
||||
|
||||
- (id) davAddressbookQuery: (id) queryContext;
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#import "SOGoContactFolder.h"
|
||||
#import "SOGoContactGCSEntry.h"
|
||||
|
||||
@implementation NSObject (CardDAV)
|
||||
@implementation SOGoFolder (CardDAV)
|
||||
|
||||
- (void) _appendComponentsMatchingFilters: (NSArray *) filters
|
||||
toResponse: (WOResponse *) response
|
||||
context: (id) context
|
||||
context: (id) localContext
|
||||
{
|
||||
unsigned int count, max;
|
||||
NSDictionary *currentFilter, *contact;
|
||||
@@ -46,7 +46,7 @@
|
||||
SOGoObject <SOGoContactFolder> *o;
|
||||
|
||||
o = (id<SOGoContactFolder>)self;
|
||||
baseURL = [o baseURLInContext: context];
|
||||
baseURL = [o baseURLInContext: localContext];
|
||||
|
||||
max = [filters count];
|
||||
for (count = 0; count < max; count++)
|
||||
Reference in New Issue
Block a user