From 659dd814d4e8d2283483aab51f15c0bdad7578d3 Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 15 Aug 2004 23:55:43 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@243 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Appointments/ChangeLog | 4 ++ .../Appointments/SOGoAppointmentObject.h | 30 +++++++++++ .../Appointments/SOGoAppointmentObject.m | 50 +++++++++++++++++++ SOGo/SoObjects/Appointments/Version | 2 +- SOGo/SoObjects/SOGo/ChangeLog | 6 +++ SOGo/SoObjects/SOGo/SOGoContentObject.m | 18 ++++--- SOGo/SoObjects/SOGo/Version | 2 +- 7 files changed, 102 insertions(+), 10 deletions(-) diff --git a/SOGo/SoObjects/Appointments/ChangeLog b/SOGo/SoObjects/Appointments/ChangeLog index 6fc2d052..1d9e3e0d 100644 --- a/SOGo/SoObjects/Appointments/ChangeLog +++ b/SOGo/SoObjects/Appointments/ChangeLog @@ -1,3 +1,7 @@ +2004-08-16 Helge Hess + + * SOGoAppointmentObject.m: added new multi folder methods (v0.9.7) + 2004-08-14 Helge Hess * SOGoGroupAppointmentFolder.m: implemented proper URL generation for diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.h b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.h index adea357b..e4d5beee 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.h +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.h @@ -25,10 +25,40 @@ #include +/* + SOGoAppointmentObject + + Represents a single appointment. This SOPE controller object manages all the + attendee storages (that is, it might store into multiple folders for meeting + appointments!). + + Note: SOGoAppointmentObject do not need to exist yet. They can also be "new" + appointments with an externally generated unique key. +*/ + +@class NSString, NSException; + @interface SOGoAppointmentObject : SOGoContentObject { } +/* accessors */ + +- (NSString *)iCalString; + +/* raw saving */ + +- (NSException *)primarySaveContentString:(NSString *)_iCalString; +- (NSException *)primaryDelete; + +/* "iCal multifolder saves" */ + +- (NSException *)saveContentString:(NSString *)_iCal baseSequence:(int)_v; +- (NSException *)deleteWithBaseSequence:(int)_v; + +- (NSException *)saveContentString:(NSString *)_iCalString; +- (NSException *)delete; + @end #endif /* __Appointments_SOGoAppointmentObject_H__ */ diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m index 1e60daba..345c51d2 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m @@ -36,4 +36,54 @@ return [self contentAsString]; } +/* raw saving */ + +- (NSException *)primarySaveContentString:(NSString *)_iCalString { + return [super saveContentString:_iCalString]; +} +- (NSException *)primaryDelete { + return [super delete]; +} + +/* "iCal multifolder saves" */ + +- (NSException *)saveContentString:(NSString *)_iCal baseSequence:(int)_v { + /* + Note: we need to delete in all participants folders and send iMIP messages + for all external accounts. + + Steps: + - fetch stored content + - parse old content + - check if sequence matches (or if 0=ignore) + - extract old attendee list + organizer (make unique) + - parse new content (ensure that sequence is increased!) + - extract new attendee list + organizer (make unique) + - make a diff => new, same, removed + - write to new, same + - delete in removed folders + - send iMIP mail for all folders not found + */ +#warning TODO: implement proper "multi-saves" + return [self primarySaveContentString:_iCal]; +} + +- (NSException *)deleteWithBaseSequence:(int)_v { + /* + Note: We need to delete in all participants folders and send iMIP messages + for all external accounts. + Delete is basically identical to save with all attendees and the + organizer being deleted. + */ +#warning TODO: implement proper "multi-saves" + return [self primaryDelete]; +} + +- (NSException *)saveContentString:(NSString *)_iCalString { + return [self saveContentString:_iCalString baseSequence:0]; +} +- (NSException *)delete { + return [self deleteWithBaseSequence:0]; +} + @end /* SOGoAppointmentObject */ diff --git a/SOGo/SoObjects/Appointments/Version b/SOGo/SoObjects/Appointments/Version index c49415d6..a4628e90 100644 --- a/SOGo/SoObjects/Appointments/Version +++ b/SOGo/SoObjects/Appointments/Version @@ -1,3 +1,3 @@ # $Id: Version,v 1.9 2004/05/19 14:30:45 helge Exp $ -SUBMINOR_VERSION:=6 +SUBMINOR_VERSION:=7 diff --git a/SOGo/SoObjects/SOGo/ChangeLog b/SOGo/SoObjects/SOGo/ChangeLog index e6d25a55..f205a43a 100644 --- a/SOGo/SoObjects/SOGo/ChangeLog +++ b/SOGo/SoObjects/SOGo/ChangeLog @@ -1,3 +1,9 @@ +2004-08-16 Helge Hess + + * SOGoContentObject.m: updated multi-save things (which belong into the + SOGoAppointmentObject class), implement -sleep to release the content + (v0.9.10) + 2004-08-15 Helge Hess * SOGoContentObject.m: implement first version of -delete (v0.9.9) diff --git a/SOGo/SoObjects/SOGo/SOGoContentObject.m b/SOGo/SoObjects/SOGo/SOGoContentObject.m index 69fb7b34..f82d031d 100644 --- a/SOGo/SoObjects/SOGo/SOGoContentObject.m +++ b/SOGo/SoObjects/SOGo/SOGoContentObject.m @@ -32,6 +32,13 @@ [super dealloc]; } +/* notifications */ + +- (void)sleep { + [self->content release]; self->content = nil; + [super sleep]; +} + /* accessors */ - (BOOL)isFolderish { @@ -82,7 +89,7 @@ if (self->content != nil) return self->content; - + if ((folder = [self ocsFolder]) == nil) { [self logWithFormat:@"did not find folder of appointment."]; return nil; @@ -93,29 +100,25 @@ } - (NSException *)saveContentString:(NSString *)_str { + /* Note: "iCal multifolder saves" are implemented in the apt subclass! */ OCSFolder *folder; NSException *ex; -#warning TODO: implement proper "multi-saves" - if ((folder = [self ocsFolder]) == nil) { [self logWithFormat:@"did not find folder of appointment."]; return nil; } - if ((ex = [folder writeContent:_str toName:[self nameInContainer]])) { [self logWithFormat:@"write failed: %@", ex]; return ex; } - return nil; } - (NSException *)delete { + /* Note: "iCal multifolder saves" are implemented in the apt subclass! */ OCSFolder *folder; NSException *ex; - -#warning TODO: implement proper "multi-saves" if ((folder = [self ocsFolder]) == nil) { [self logWithFormat:@"did not find folder of appointment."]; @@ -126,7 +129,6 @@ [self logWithFormat:@"delete failed: %@", ex]; return ex; } - return nil; } diff --git a/SOGo/SoObjects/SOGo/Version b/SOGo/SoObjects/SOGo/Version index f77de926..177ef7b7 100644 --- a/SOGo/SoObjects/SOGo/Version +++ b/SOGo/SoObjects/SOGo/Version @@ -1,3 +1,3 @@ # $Id: Version 170 2004-08-11 10:45:40Z helge $ -SUBMINOR_VERSION:=9 +SUBMINOR_VERSION:=10 -- 2.39.5