From fa5145e1fcd03a7647f38308e611d5b3006c43f7 Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 30 Jun 2004 10:26:46 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@107 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/SOGo/SOGoContentObject.h | 6 +++ SOGo/SoObjects/SOGo/SOGoContentObject.m | 20 ++++++++++ SOGo/SoObjects/SOGo/SOGoFolder.h | 6 +++ SOGo/SoObjects/SOGo/SOGoFolder.m | 14 +++++++ SOGo/SoObjects/SOGo/SOGoObject.m | 6 +++ SOGo/SoObjects/SOGo/SOGoUserFolder.h | 7 ++++ SOGo/SoObjects/SOGo/SOGoUserFolder.m | 50 ++++++++++++++++++++++++ SOGo/UI/Scheduler/ChangeLog | 3 ++ SOGo/UI/Scheduler/UIxAppointmentEditor.m | 7 +++- SOGo/UI/Scheduler/UIxAppointmentView.h | 2 +- SOGo/UI/Scheduler/UIxCalView.h | 2 +- 11 files changed, 119 insertions(+), 4 deletions(-) diff --git a/SOGo/SoObjects/SOGo/SOGoContentObject.h b/SOGo/SoObjects/SOGo/SOGoContentObject.h index 0954f25c..2f8d7f2f 100644 --- a/SOGo/SoObjects/SOGo/SOGoContentObject.h +++ b/SOGo/SoObjects/SOGo/SOGoContentObject.h @@ -27,8 +27,14 @@ @interface SOGoContentObject : SOGoObject { + NSString *ocsPath; } +/* accessors */ + +- (void)setOCSPath:(NSString *)_path; +- (NSString *)ocsPath; + @end #endif /* __SOGo_SOGoContentObject_H__ */ diff --git a/SOGo/SoObjects/SOGo/SOGoContentObject.m b/SOGo/SoObjects/SOGo/SOGoContentObject.m index 98a8216e..452d782a 100644 --- a/SOGo/SoObjects/SOGo/SOGoContentObject.m +++ b/SOGo/SoObjects/SOGo/SOGoContentObject.m @@ -26,7 +26,27 @@ @implementation SOGoContentObject - (void)dealloc { + [self->ocsPath release]; [super dealloc]; } +/* accessors */ + +- (BOOL)isFolderish { + return NO; +} + +- (void)setOCSPath:(NSString *)_path { + if ([self->ocsPath isEqualToString:_path]) + return; + + if (self->ocsPath) + [self logWithFormat:@"WARNING: OCS path is already set! '%@'", _path]; + + ASSIGNCOPY(self->ocsPath, _path); +} +- (NSString *)ocsPath { + return self->ocsPath; +} + @end /* SOGoContentObject */ diff --git a/SOGo/SoObjects/SOGo/SOGoFolder.h b/SOGo/SoObjects/SOGo/SOGoFolder.h index 26b7d1f5..c62459f2 100644 --- a/SOGo/SoObjects/SOGo/SOGoFolder.h +++ b/SOGo/SoObjects/SOGo/SOGoFolder.h @@ -27,8 +27,14 @@ @interface SOGoFolder : SOGoObject { + NSString *ocsPath; } +/* accessors */ + +- (void)setOCSPath:(NSString *)_Path; +- (NSString *)ocsPath; + @end #endif /* __SOGo_SOGoFolder_H__ */ diff --git a/SOGo/SoObjects/SOGo/SOGoFolder.m b/SOGo/SoObjects/SOGo/SOGoFolder.m index c282fbef..28f8b1c6 100644 --- a/SOGo/SoObjects/SOGo/SOGoFolder.m +++ b/SOGo/SoObjects/SOGo/SOGoFolder.m @@ -26,6 +26,7 @@ @implementation SOGoFolder - (void)dealloc { + [self->ocsPath release]; [super dealloc]; } @@ -35,4 +36,17 @@ return YES; } +- (void)setOCSPath:(NSString *)_path { + if ([self->ocsPath isEqualToString:_path]) + return; + + if (self->ocsPath) + [self logWithFormat:@"WARNING: OCS path is already set! '%@'", _path]; + + ASSIGNCOPY(self->ocsPath, _path); +} +- (NSString *)ocsPath { + return self->ocsPath; +} + @end /* SOGoFolder */ diff --git a/SOGo/SoObjects/SOGo/SOGoObject.m b/SOGo/SoObjects/SOGo/SOGoObject.m index 8a15b440..dbde44b3 100644 --- a/SOGo/SoObjects/SOGo/SOGoObject.m +++ b/SOGo/SoObjects/SOGo/SOGoObject.m @@ -66,4 +66,10 @@ return [self->container lookupUserFolder]; } +/* KVC hacks */ + +- (id)valueForUndefinedKey:(NSString *)_key { + return nil; +} + @end /* SOGoObject */ diff --git a/SOGo/SoObjects/SOGo/SOGoUserFolder.h b/SOGo/SoObjects/SOGo/SOGoUserFolder.h index 022206cb..69454f17 100644 --- a/SOGo/SoObjects/SOGo/SOGoUserFolder.h +++ b/SOGo/SoObjects/SOGo/SOGoUserFolder.h @@ -25,6 +25,8 @@ #include +@class NSString; + @interface SOGoUserFolder : SOGoFolder { } @@ -33,6 +35,11 @@ - (NSString *)login; +/* pathes */ + +- (NSString *)ocsUserPath; +- (NSString *)ocsPrivateCalendarPath; + @end #endif /* __SOGo_SOGoUserFolder_H__ */ diff --git a/SOGo/SoObjects/SOGo/SOGoUserFolder.m b/SOGo/SoObjects/SOGo/SOGoUserFolder.m index 79ee1a36..b8dd3478 100644 --- a/SOGo/SoObjects/SOGo/SOGoUserFolder.m +++ b/SOGo/SoObjects/SOGo/SOGoUserFolder.m @@ -41,4 +41,54 @@ return self; } +/* pathes */ + +- (void)setOCSPath:(NSString *)_path { + [self logWithFormat: + @"WARNING: rejected attempt to reset user-folder path: '%@'", + _path]; +} +- (NSString *)ocsPath { + return [@"/Users/" stringByAppendingString:[self login]]; +} + +- (NSString *)ocsUserPath { + return [self ocsPath]; +} +- (NSString *)ocsPrivateCalendarPath { + return [[self ocsUserPath] stringByAppendingString:@"/Calendar"]; +} + +/* name lookup */ + +- (id)privateCalendar:(NSString *)_key inContext:(id)_ctx { + static Class calClass = Nil; + id calendar; + + if (calClass == Nil) + calClass = NSClassFromString(@"SOGoAppointmentFolder"); + if (calClass == Nil) { + [self logWithFormat:@"ERROR: missing SOGoAppointmentFolder!"]; + return nil; + } + + calendar = [[calClass alloc] initWithName:_key inContainer:self]; + [calendar setOCSPath:[self ocsPrivateCalendarPath]]; + 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 privateCalendar:_key inContext:_ctx]; + + /* return 404 to stop acquisition */ + return [NSException exceptionWithHTTPStatus:404 /* Not Found */]; +} + @end /* SOGoUserFolder */ diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 752c93ca..fff230bd 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,5 +1,8 @@ 2004-06-30 Helge Hess + * UIxCalView.h, UIxAppointmentView.h, UIxAppointmentEditor.m: include + UIxComponent from SOGoUI + * removed backend stuff from some sources * product.plist: bind things on SOGoAppointmentXXX instead of SX... diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 2287b597..ccfe386f 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -1,7 +1,7 @@ /* Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -22,13 +22,16 @@ #include "common.h" -#include +#include #include #include /* TODO: CLEAN THIS MESS UP */ +@interface NSDate(UsedPrivates) +- (NSString *)icalString; // TODO: this is in NGiCal +@end @interface NSObject (AppointmentHack) - (BOOL)isAppointment; diff --git a/SOGo/UI/Scheduler/UIxAppointmentView.h b/SOGo/UI/Scheduler/UIxAppointmentView.h index 9038594d..22dce898 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentView.h +++ b/SOGo/UI/Scheduler/UIxAppointmentView.h @@ -3,7 +3,7 @@ #ifndef __ZideStoreUI_UIxAppointmentView_H__ #define __ZideStoreUI_UIxAppointmentView_H__ -#include +#include @interface UIxAppointmentView : UIxComponent { diff --git a/SOGo/UI/Scheduler/UIxCalView.h b/SOGo/UI/Scheduler/UIxCalView.h index dca1329c..cf3e8816 100644 --- a/SOGo/UI/Scheduler/UIxCalView.h +++ b/SOGo/UI/Scheduler/UIxCalView.h @@ -3,7 +3,7 @@ #ifndef __ZideStoreUI_UIxCalView_H__ #define __ZideStoreUI_UIxCalView_H__ -#include +#include @class NSArray, NSCalendarDate; -- 2.39.5