mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-06 04:20:33 +00:00
Monotone-Parent: 4147bb1d4b55d6458b5f11fe840ccc1671d4f45e
Monotone-Revision: e93fdeaa76b1e9c3f341133f6683d32e2788bdab Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-06-13T20:18:03 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -87,6 +87,20 @@
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (Class) objectClassForComponentName: (NSString *) componentName
|
||||
{
|
||||
Class objectClass;
|
||||
|
||||
if ([componentName isEqualToString: @"vcard"])
|
||||
objectClass = [SOGoContactGCSEntry class];
|
||||
else if ([componentName isEqualToString: @"vlist"])
|
||||
objectClass = [SOGoContactGCSList class];
|
||||
else
|
||||
objectClass = Nil;
|
||||
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (Class) objectClassForResourceNamed: (NSString *) name
|
||||
{
|
||||
EOQualifier *qualifier;
|
||||
@@ -101,12 +115,7 @@
|
||||
if ([records count])
|
||||
{
|
||||
component = [[records objectAtIndex: 0] valueForKey: @"c_component"];
|
||||
if ([component isEqualToString: @"vcard"])
|
||||
objectClass = [SOGoContactGCSEntry class];
|
||||
else if ([component isEqualToString: @"vlist"])
|
||||
objectClass = [SOGoContactGCSList class];
|
||||
else
|
||||
objectClass = Nil;
|
||||
objectClass = [self objectClassForComponentName: component];
|
||||
}
|
||||
else
|
||||
objectClass = Nil;
|
||||
@@ -114,29 +123,6 @@
|
||||
return objectClass;
|
||||
}
|
||||
|
||||
- (id) deduceObjectForName: (NSString *)_key
|
||||
inContext: (id)_ctx
|
||||
{
|
||||
WORequest *request;
|
||||
NSString *method;
|
||||
Class objectClass;
|
||||
id obj;
|
||||
|
||||
request = [_ctx request];
|
||||
method = [request method];
|
||||
if ([method isEqualToString: @"PUT"])
|
||||
objectClass = [self objectClassForContent: [request contentAsString]];
|
||||
else
|
||||
objectClass = [self objectClassForResourceNamed: _key];
|
||||
|
||||
if (objectClass)
|
||||
obj = [objectClass objectWithName: _key inContainer: self];
|
||||
else
|
||||
obj = nil;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
- (BOOL) requestNamedIsHandledLater: (NSString *) name
|
||||
{
|
||||
return [name isEqualToString: @"OPTIONS"];
|
||||
@@ -168,9 +154,6 @@
|
||||
else if ([url hasSuffix: @"AsList"])
|
||||
obj = [SOGoContactGCSList objectWithName: _key
|
||||
inContainer: self];
|
||||
else
|
||||
obj = [self deduceObjectForName: _key
|
||||
inContext: _ctx];
|
||||
}
|
||||
}
|
||||
if (!obj)
|
||||
|
||||
Reference in New Issue
Block a user