From: helge Date: Wed, 11 Aug 2004 12:43:39 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/trunk@176 d1b88da0-ebda-0310-925b-ed51d... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=367f28c1a1e11c974d8d5479319a2c1fc037c29c;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/trunk@176 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/SOGo/SOGoGroupFolder.m b/SOGo/SoObjects/SOGo/SOGoGroupFolder.m index d1f49d21..ca833a80 100644 --- a/SOGo/SoObjects/SOGo/SOGoGroupFolder.m +++ b/SOGo/SoObjects/SOGo/SOGoGroupFolder.m @@ -52,4 +52,37 @@ /* name lookup */ +- (id)groupCalendar:(NSString *)_key inContext:(id)_ctx { + static Class calClass = Nil; + id calendar; + + if (calClass == Nil) + calClass = NSClassFromString(@"SOGoGroupAppointmentFolder"); + if (calClass == Nil) { + [self logWithFormat:@"ERROR: missing SOGoGroupAppointmentFolder class!"]; + return nil; + } + + calendar = [[calClass alloc] initWithName:_key inContainer:self]; + + // TODO: should we pass over the uids in questions or should the + // appointment folder query its container for that info? + + return [calendar autorelease]; +} + +- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { + id obj; + + /* first check attributes directly bound to the application */ + if ((obj = [super lookupName:_key inContext:_ctx acquire:NO])) + return obj; + + if ([_key isEqualToString:@"Calendar"]) + return [self groupCalendar:_key inContext:_ctx]; + + /* return 404 to stop acquisition */ + return [NSException exceptionWithHTTPStatus:404 /* Not Found */]; +} + @end /* SOGoGroupFolder */