From d01770e42310c8575eda1ea1485776c0d706fc81 Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 8 Sep 2004 14:58:08 +0000 Subject: [PATCH] a bit of work on the mail stuff git-svn-id: http://svn.opengroupware.org/SOGo/trunk@298 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Mailer/ChangeLog | 4 +++ SOGo/SoObjects/Mailer/GNUmakefile | 18 +++++----- SOGo/SoObjects/Mailer/SOGoMailAccount.h | 45 ++++++++++++++++++++++++ SOGo/SoObjects/Mailer/SOGoMailAccount.m | 28 +++++++++++++++ SOGo/SoObjects/Mailer/SOGoMailAccounts.h | 45 ++++++++++++++++++++++++ SOGo/SoObjects/Mailer/SOGoMailAccounts.m | 28 +++++++++++++++ SOGo/SoObjects/Mailer/SOGoMailFolder.h | 12 +++---- SOGo/SoObjects/Mailer/SOGoMailFolder.m | 14 -------- SOGo/SoObjects/Mailer/SOGoMailObject.h | 6 ++-- SOGo/SoObjects/Mailer/Version | 2 +- SOGo/SoObjects/Mailer/product.plist | 13 +++++-- SOGo/SoObjects/SOGo/ChangeLog | 4 +++ SOGo/SoObjects/SOGo/SOGoUserFolder.m | 18 ++++++++++ SOGo/SoObjects/SOGo/Version | 2 +- 14 files changed, 204 insertions(+), 35 deletions(-) create mode 100644 SOGo/SoObjects/Mailer/SOGoMailAccount.h create mode 100644 SOGo/SoObjects/Mailer/SOGoMailAccount.m create mode 100644 SOGo/SoObjects/Mailer/SOGoMailAccounts.h create mode 100644 SOGo/SoObjects/Mailer/SOGoMailAccounts.m diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index 88155401..e7ca1869 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -1,3 +1,7 @@ +2004-09-08 Helge Hess + + * added missing account objects (v0.9.2) + 2004-08-26 Marcus Mueller * ChangeLog: created diff --git a/SOGo/SoObjects/Mailer/GNUmakefile b/SOGo/SoObjects/Mailer/GNUmakefile index 905de409..5dcbc058 100644 --- a/SOGo/SoObjects/Mailer/GNUmakefile +++ b/SOGo/SoObjects/Mailer/GNUmakefile @@ -8,15 +8,17 @@ BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo Mailer_PRINCIPAL_CLASS = SOGoMailerProduct -Mailer_OBJC_FILES = \ - Product.m \ - \ - SOGoMailObject.m \ - SOGoMailFolder.m \ +Mailer_OBJC_FILES += \ + Product.m \ + \ + SOGoMailAccounts.m \ + SOGoMailAccount.m \ + SOGoMailFolder.m \ + SOGoMailObject.m \ -Mailer_RESOURCE_FILES += \ - Version \ - product.plist \ +Mailer_RESOURCE_FILES += \ + Version \ + product.plist \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make diff --git a/SOGo/SoObjects/Mailer/SOGoMailAccount.h b/SOGo/SoObjects/Mailer/SOGoMailAccount.h new file mode 100644 index 00000000..b889536f --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoMailAccount.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id: SOGoMailAccount.h 274 2004-08-26 13:10:49Z znek $ + +#ifndef __Mailer_SOGoMailAccount_H__ +#define __Mailer_SOGoMailAccount_H__ + +#include + +/* + SOGoMailAccount + Parent object: SOGoMailAccounts + Child objects: SOGoMailFolder + + The SOGoMailAccount represents a single IMAP4 mail account (host, login, + password, etc) +*/ + +@class NSString, NSArray, NSCalendarDate, NSException; + +@interface SOGoMailAccount : SOGoObject +{ +} + +@end + +#endif /* __Mailer_SOGoMailAccount_H__ */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailAccount.m b/SOGo/SoObjects/Mailer/SOGoMailAccount.m new file mode 100644 index 00000000..92babab1 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoMailAccount.m @@ -0,0 +1,28 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id: SOGoMailAccount.m 274 2004-08-26 13:10:49Z znek $ + +#include "SOGoMailAccount.h" +#include "common.h" + +@implementation SOGoMailAccount + +@end /* SOGoMailAccount */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailAccounts.h b/SOGo/SoObjects/Mailer/SOGoMailAccounts.h new file mode 100644 index 00000000..e8624754 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoMailAccounts.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id: SOGoMailAccounts.h 274 2004-08-26 13:10:49Z znek $ + +#ifndef __Mailer_SOGoMailAccounts_H__ +#define __Mailer_SOGoMailAccounts_H__ + +#include + +/* + SOGoMailAccounts + Parent object: SOGoUserFolder + Child objects: SOGoMailAccount + + The SOGoMailAccounts folder contains the mail accounts which are associated + with a user. +*/ + +@class NSString, NSArray, NSCalendarDate, NSException; + +@interface SOGoMailAccounts : SOGoObject +{ +} + +@end + +#endif /* __Mailer_SOGoMailAccounts_H__ */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailAccounts.m b/SOGo/SoObjects/Mailer/SOGoMailAccounts.m new file mode 100644 index 00000000..ae903cf1 --- /dev/null +++ b/SOGo/SoObjects/Mailer/SOGoMailAccounts.m @@ -0,0 +1,28 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + 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 + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id: SOGoMailAccounts.m 274 2004-08-26 13:10:49Z znek $ + +#include "SOGoMailAccounts.h" +#include "common.h" + +@implementation SOGoMailAccounts + +@end /* SOGoMailAccounts */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailFolder.h b/SOGo/SoObjects/Mailer/SOGoMailFolder.h index f007dc16..f93bcb74 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailFolder.h +++ b/SOGo/SoObjects/Mailer/SOGoMailFolder.h @@ -23,21 +23,19 @@ #ifndef __Mailer_SOGoMailFolder_H__ #define __Mailer_SOGoMailFolder_H__ -#include +#include /* SOGoMailFolder - Parent object: the SOGoUserFolder - Child objects: SOGoMailObject + Parent object: the SOGoMailAccount + Child objects: SOGoMailObject or SOGoMailFolder - The SOGoMailFolder maps to an OCS folder of type 'mail', that - is, a content folder containing ??? files (and a proper quicktable). + The SOGoMailFolder maps to an IMAP4 folder from NGImap4. */ @class NSString, NSArray, NSCalendarDate, NSException; -@class OCSFolder; -@interface SOGoMailFolder : SOGoFolder +@interface SOGoMailFolder : SOGoObject { } diff --git a/SOGo/SoObjects/Mailer/SOGoMailFolder.m b/SOGo/SoObjects/Mailer/SOGoMailFolder.m index d940999d..772c873f 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailFolder.m +++ b/SOGo/SoObjects/Mailer/SOGoMailFolder.m @@ -25,18 +25,4 @@ @implementation SOGoMailFolder -/* GET */ - -- (id)GETAction:(WOContext *)_ctx { - // TODO: I guess this should really be done by SOPE (redirect to - // default method) - NSString *uri; - - uri = [[_ctx request] uri]; - if (![uri hasSuffix:@"/"]) uri = [uri stringByAppendingString:@"/"]; - uri = [uri stringByAppendingString:@"view"]; - - return [self redirectToLocation:uri]; -} - @end /* SOGoMailFolder */ diff --git a/SOGo/SoObjects/Mailer/SOGoMailObject.h b/SOGo/SoObjects/Mailer/SOGoMailObject.h index 8e2a3f12..351017e2 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailObject.h +++ b/SOGo/SoObjects/Mailer/SOGoMailObject.h @@ -27,13 +27,15 @@ /* SOGoMailObject + Parent object: the SOGoMailFolder + Child objects: none (maybe SOGoMailAttachments?) - Represents a single mail. + Represents a single mail as retrieved using NGImap4. */ @class NSString, NSArray, NSException; -@interface SOGoMailObject : SOGoContentObject +@interface SOGoMailObject : SOGoObject { } diff --git a/SOGo/SoObjects/Mailer/Version b/SOGo/SoObjects/Mailer/Version index 9385a64d..1bf86739 100644 --- a/SOGo/SoObjects/Mailer/Version +++ b/SOGo/SoObjects/Mailer/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=0 +SUBMINOR_VERSION:=2 diff --git a/SOGo/SoObjects/Mailer/product.plist b/SOGo/SoObjects/Mailer/product.plist index d7b55522..9e7adb65 100644 --- a/SOGo/SoObjects/Mailer/product.plist +++ b/SOGo/SoObjects/Mailer/product.plist @@ -8,11 +8,20 @@ }; classes = { + SOGoMailAccounts = { + superclass = "SOGoObject"; + }; + + SOGoMailAccount = { + superclass = "SOGoObject"; + }; + SOGoMailFolder = { - superclass = "SOGoFolder"; + superclass = "SOGoObject"; }; + SOGoMailObject = { - superclass = "SOGoContentObject"; + superclass = "SOGoObject"; }; }; } diff --git a/SOGo/SoObjects/SOGo/ChangeLog b/SOGo/SoObjects/SOGo/ChangeLog index 3f389e2f..ac8a2793 100644 --- a/SOGo/SoObjects/SOGo/ChangeLog +++ b/SOGo/SoObjects/SOGo/ChangeLog @@ -1,3 +1,7 @@ +2004-09-08 Helge Hess + + * SOGoUserFolder.m: map "Mail" key to SOGoMailAccounts object (v0.9.15) + 2004-09-01 Marcus Mueller * v0.9.14 diff --git a/SOGo/SoObjects/SOGo/SOGoUserFolder.m b/SOGo/SoObjects/SOGo/SOGoUserFolder.m index 314c4bc0..9bc1a24a 100644 --- a/SOGo/SoObjects/SOGo/SOGoUserFolder.m +++ b/SOGo/SoObjects/SOGo/SOGoUserFolder.m @@ -120,6 +120,21 @@ return [folder autorelease]; } +- (id)mailAccountsFolder:(NSString *)_key inContext:(id)_ctx { + static Class fldClass = Nil; + id folder; + + if (fldClass == Nil) + fldClass = NSClassFromString(@"SOGoMailAccounts"); + if (fldClass == Nil) { + [self logWithFormat:@"ERROR: missing SOGoMailAccounts class!"]; + return nil; + } + + folder = [[fldClass alloc] initWithName:_key inContainer:self]; + return [folder autorelease]; +} + - (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { id obj; @@ -135,6 +150,9 @@ if ([_key isEqualToString:@"Groups"]) return [self groupsFolder:_key inContext:_ctx]; + + if ([_key isEqualToString:@"Mail"]) + return [self mailAccountsFolder:_key inContext:_ctx]; /* return 404 to stop acquisition */ return [NSException exceptionWithHTTPStatus:404 /* Not Found */]; diff --git a/SOGo/SoObjects/SOGo/Version b/SOGo/SoObjects/SOGo/Version index 72b1d704..ecb7d826 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:=14 +SUBMINOR_VERSION:=15 -- 2.39.5