diff --git a/ChangeLog b/ChangeLog index 4a1d197cd..3d1eab226 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-10 Wolfgang Sourdeau + * SoObjects/SOGo/NSString+DAV.m ([NSString -asWebDAVTuple]): new + method that parses a webdav tag in the form "{ns:}tag" and returns + a dictionary. + * SoObjects/Appointments/SOGoUserFolder+Appointments.m ([SOGoUserFolder -davPrincipalPropertySearch:queryContext]): new method to answer to "principal-property-search" report. diff --git a/SoObjects/SOGo/NSString+DAV.h b/SoObjects/SOGo/NSString+DAV.h index 068e8f8ba..0292ff940 100644 --- a/SoObjects/SOGo/NSString+DAV.h +++ b/SoObjects/SOGo/NSString+DAV.h @@ -31,6 +31,7 @@ - (NSString *) asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces; +- (NSDictionary *) asWebDAVTuple; @end diff --git a/SoObjects/SOGo/NSString+DAV.m b/SoObjects/SOGo/NSString+DAV.m index 25d886618..2c0b06073 100644 --- a/SoObjects/SOGo/NSString+DAV.m +++ b/SoObjects/SOGo/NSString+DAV.m @@ -20,6 +20,8 @@ * Boston, MA 02111-1307, USA. */ +#import + #import #import "NSString+DAV.h" @@ -32,4 +34,19 @@ return [self stringByEscapingXMLString]; } +#warning we should use the same nomenclature as the webdav values... +- (NSDictionary *) asWebDAVTuple +{ + NSString *namespace, *nodeName; + NSRange nsEnd; + + nsEnd = [self rangeOfString: @"}"]; + namespace = [self substringFromRange: NSMakeRange (1, nsEnd.location - 1)]; + nodeName = [self substringFromIndex: nsEnd.location + 1]; + + return [NSDictionary dictionaryWithObjectsAndKeys: namespace, @"ns", + nodeName, @"method", nil]; +} + + @end