Monotone-Parent: 4198b7cec911933d302e467416f80df87577acdb

Monotone-Revision: a7a7371747e1185b197e3a0ea0c6d585bf7e0a46

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-07-22T20:40:34
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-07-22 20:40:34 +00:00
parent bf8245a4be
commit 2edfcaa0f2
3 changed files with 55 additions and 0 deletions

View File

@@ -1,5 +1,13 @@
2007-07-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder -davNamespaces]): new
optional method for subclasses which handle specific extensions to
the DAV protocol: CardDAV or CalDAV.
([SOGoFolder
-lookupName:lookupNameinContext:localContextacquire:acquire]):
new overriden method that handles dav invocations for extensions
to DAV by returning an appropriate SoSelectorInvocation.
* SoObjects/SOGo/NSString+Utilities.m ([NSString
-asDavInvocation]): new method returning a dictionary with a "ns"
key representing the dav namespace and a "method" key representing

View File

@@ -73,6 +73,9 @@
- (BOOL) create;
- (NSException *) delete;
/* dav */
- (NSArray *) davNamespaces;
/* acls as a container */
- (NSArray *) aclUsersForObjectAtPath: (NSArray *) objectPathArray;
- (NSArray *) aclsForUser: (NSString *) uid

View File

@@ -28,6 +28,8 @@
#import <Foundation/NSURL.h>
#import <NGObjWeb/SoObject.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/SoSelectorInvocation.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
@@ -38,6 +40,8 @@
#import <GDLContentStore/GCSFolderType.h>
#import <SaxObjC/XMLNamespaces.h>
#import "NSString+Utilities.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
@@ -523,8 +527,48 @@ static NSString *defaultUserID = @"<default>";
return [[self davURL] absoluteString];
}
- (id) lookupName: (NSString *) lookupName
inContext: (id) localContext
acquire: (BOOL) acquire
{
id obj;
NSArray *davNamespaces;
NSDictionary *davInvocation;
NSString *objcMethod;
obj = [super lookupName: lookupName inContext: localContext
acquire: acquire];
if (!obj)
{
davNamespaces = [self davNamespaces];
if ([davNamespaces count] > 0)
{
davInvocation = [lookupName asDavInvocation];
if (davInvocation
&& [davNamespaces
containsObject: [davInvocation objectForKey: @"ns"]])
{
objcMethod = [[davInvocation objectForKey: @"method"]
davMethodToObjC];
obj = [[SoSelectorInvocation alloc]
initWithSelectorNamed:
[NSString stringWithFormat: @"%@:", objcMethod]
addContextParameter: YES];
[obj autorelease];
}
}
}
return obj;
}
/* WebDAV */
- (NSArray *) davNamespaces
{
return nil;
}
- (BOOL) davIsCollection
{
return [self isFolderish];