2004-08-16 Helge Hess <helge.hess@skyrix.com>
+ * SOGoAppointmentFolder.m: added method to create a group folder and
+ a group calendar for a set of IDs (for internal queries) (v0.9.10)
+
* SOGoAppointmentObject.m, SOGoAppointmentFolder.m: moved calendar
folder lookup methods to folder class (the object uses its container
to lookup the folder) (v0.9.9)
- (NSArray *)lookupCalendarFoldersForICalPerson:(NSArray *)_persons
inContext:(id)_ctx;
+- (id)lookupGroupFolderForUIDs:(NSArray *)_uids inContext:(id)_ctx;
+- (id)lookupGroupCalendarFolderForUIDs:(NSArray *)_uids inContext:(id)_ctx;
+
@end
#endif /* __Appointments_SOGoAppointmentFolder_H__ */
// $Id$
#include "SOGoAppointmentFolder.h"
+#include <SOGo/SOGoCustomGroupFolder.h>
#include <SOGoLogic/AgenorUserManager.h>
#include <OGoContentStore/OCSFolder.h>
#include <NGiCal/NGiCal.h>
#include <unistd.h>
#include <stdlib.h>
-
@implementation SOGoAppointmentFolder
static BOOL debugOn = NO;
return [self lookupCalendarFoldersForUIDs:uids inContext:_ctx];
}
+- (id)lookupGroupFolderForUIDs:(NSArray *)_uids inContext:(id)_ctx {
+ SOGoCustomGroupFolder *folder;
+
+ if (_uids == nil)
+ return nil;
+
+ folder = [[SOGoCustomGroupFolder alloc] initWithUIDs:_uids inContainer:self];
+ return [folder autorelease];
+}
+- (id)lookupGroupCalendarFolderForUIDs:(NSArray *)_uids inContext:(id)_ctx {
+ SOGoCustomGroupFolder *folder;
+
+ if ((folder = [self lookupGroupFolderForUIDs:_uids inContext:_ctx]) == nil)
+ return nil;
+
+ folder = [folder lookupName:@"Calendar" inContext:_ctx acquire:NO];
+ if (![folder isNotNull])
+ return nil;
+ if ([folder isKindOfClass:[NSException class]]) {
+ [self debugWithFormat:@"Note: could not lookup 'Calendar' in folder: %@",
+ folder];
+ return nil;
+ }
+
+ return folder;
+}
+
/* GET */
- (id)GETAction:(WOContext *)_ctx {