diff --git a/ChangeLog b/ChangeLog index 45078c653..4c23be7c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2006-11-02 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -lookupName:inContext:acquire:]): certain + HTTP methods are handled by SOPE and requires nil to be returned, + this method now invokes the new + "requestNamedIsHandledLater:inContext:" method to check that. + ([SOGoAppointmentFolder + -requestNamedIsHandledLater:nameinContext:context]): new methods + that returns "YES" only for the "OPTIONS" http method (for now...). + ([SOGoAppointmentFolder -davComplianceClassesInContext:]): + overloaded method to append the "access-control" and + "calendar-access" DAV abilities to the initial declaration. + * UI/Scheduler/UIxCalMonthView.[hm]: rewritten module entirely to imitate the look of Sunbird/Lightning's monthly view. diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index df72be3e7..bc7b78907 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -19,14 +19,16 @@ 02111-1307, USA. */ -#import -#import #import #import #import +#import #import -#import "common.h" +#import +#import + +#import "common.h" #import #import "SOGoAppointmentObject.h" @@ -347,43 +349,72 @@ static NSNumber *sharedYes = nil; return obj; } +- (BOOL) requestNamedIsHandledLater: (NSString *) name + inContext: (WOContext *) context +{ + return [name isEqualToString: @"OPTIONS"]; +} + - (id) lookupName: (NSString *)_key inContext: (id)_ctx acquire: (BOOL)_flag { id obj; NSString *url; + BOOL handledLater; NSLog (@"lookup name '%@' in apt folder", _key); /* first check attributes directly bound to the application */ - obj = [super lookupName:_key inContext:_ctx acquire:NO]; - if (!obj) + handledLater = [self requestNamedIsHandledLater: _key inContext: _ctx]; + if (handledLater) + obj = nil; + else { - if ([_key hasPrefix: @"{urn:ietf:params:xml:ns:caldav}"]) - obj - = [self lookupActionForCalDAVMethod: [_key substringFromIndex: 31]]; - else if ([self isValidAppointmentName:_key]) + obj = [super lookupName:_key inContext:_ctx acquire:NO]; + if (!obj) { - url = [[[_ctx request] uri] urlWithoutParameters]; - if ([url hasSuffix: @"AsTask"]) - obj = [SOGoTaskObject objectWithName: _key - inContainer: self]; - else if ([url hasSuffix: @"AsAppointment"]) - obj = [SOGoAppointmentObject objectWithName: _key - inContainer: self]; - else - obj = [self deduceObjectForName: _key - inContext: _ctx]; + if ([_key hasPrefix: @"{urn:ietf:params:xml:ns:caldav}"]) + obj + = [self lookupActionForCalDAVMethod: [_key substringFromIndex: 31]]; + else if ([self isValidAppointmentName:_key]) + { + url = [[[_ctx request] uri] urlWithoutParameters]; + if ([url hasSuffix: @"AsTask"]) + obj = [SOGoTaskObject objectWithName: _key + inContainer: self]; + else if ([url hasSuffix: @"AsAppointment"]) + obj = [SOGoAppointmentObject objectWithName: _key + inContainer: self]; + else + obj = [self deduceObjectForName: _key + inContext: _ctx]; + } } + if (!obj) + obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */]; } - if (!obj) - obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */]; - return obj; } +- (NSArray *) davComplianceClassesInContext: (id)_ctx +{ + NSMutableArray *classes; + NSArray *primaryClasses; + + classes = [NSMutableArray new]; + [classes autorelease]; + + primaryClasses = [super davComplianceClassesInContext: _ctx]; + if (primaryClasses) + [classes addObjectsFromArray: primaryClasses]; + [classes addObject: @"access-control"]; + [classes addObject: @"calendar-access"]; + + return classes; +} + /* vevent UID handling */ - (NSString *) resourceNameForEventUID: (NSString *)_u