+2004-11-27 Helge Hess <helge.hess@skyrix.com>
+
+ * SOGoMailAccount.m: added 'Filters' key and lookup of Sieve filters
+ (v0.9.54)
+
2004-11-11 Helge Hess <helge.hess@skyrix.com>
* v0.9.53
-# $Id$
+# GNUstep makefile
include ../common.make
- (NSArray *)toManyRelationshipKeys {
// TODO: hardcoded, if we want to support shared fldrs, this needs to change
- return [NSArray arrayWithObjects:@"INBOX", @"Drafts", nil];
+ static NSArray *accFolderNames = nil;
+ if (accFolderNames == nil) {
+ accFolderNames = [[NSArray alloc] initWithObjects:
+ @"INBOX", @"Drafts", @"Filters", nil];
+ }
+ return accFolderNames;
}
/* hierarchy */
/* name lookup */
-- (id)lookupImap4Folder:(NSString *)_key inContext:(id)_ctx {
- return [[[SOGoMailFolder alloc] initWithName:_key
- inContainer:self] autorelease];
+- (id)lookupFolder:(NSString *)_key ofClassNamed:(NSString *)_cn
+ inContext:(id)_cx
+{
+ Class clazz;
+
+ if ((clazz = NSClassFromString(_cn)) == Nil) {
+ [self logWithFormat:@"ERROR: did not find class '%@' for key: '%@'",
+ _cn, _key];
+ return [NSException exceptionWithHTTPStatus:500 /* server error */
+ reason:@"did not find mail folder class!"];
+ }
+ return [[[clazz alloc] initWithName:_key inContainer:self] autorelease];
}
+- (id)lookupImap4Folder:(NSString *)_key inContext:(id)_cx {
+ return [self lookupFolder:_key ofClassNamed:@"SOGoMailFolder" inContext:_cx];
+}
- (id)lookupDraftsFolder:(NSString *)_key inContext:(id)_ctx {
- return [[[SOGoDraftsFolder alloc] initWithName:_key
- inContainer:self] autorelease];
+ return [self lookupFolder:_key ofClassNamed:@"SOGoDraftsFolder"
+ inContext:_ctx];
+}
+- (id)lookupFiltersFolder:(NSString *)_key inContext:(id)_ctx {
+ return [self lookupFolder:_key ofClassNamed:@"SOGoSieveScriptsFolder"
+ inContext:_ctx];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil)
return obj;
+ // TODO: those should be product.plist bindings? (can't be class bindings
+ // though because they are 'per-account')
if ([_key isEqualToString:@"Drafts"]) {
if ((obj = [self lookupDraftsFolder:_key inContext:_ctx]) != nil)
return obj;
}
+ if ([_key isEqualToString:@"Filters"]) {
+ if ((obj = [self lookupFiltersFolder:_key inContext:_ctx]) != nil)
+ return obj;
+ }
if ((obj = [self lookupImap4Folder:_key inContext:_ctx]) != nil)
return obj;
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __Mailer_SOGoMailBaseObject_H__
#define __Mailer_SOGoMailBaseObject_H__
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __Mailer_SOGoMailFolder_H__
#define __Mailer_SOGoMailFolder_H__
# Version file
-SUBMINOR_VERSION:=53
+SUBMINOR_VERSION:=54
-# v0.9.44 requires NGMime v4.3.194
-# v0.9.41 requires NGMime v4.3.190
-# v0.9.35 requires SOGoLogic v0.9.24
-# v0.9.34 requires SOGoLogic v0.9.22
+# v0.9.44 requires libNGMime v4.3.194
+# v0.9.41 requires libNGMime v4.3.190
+# v0.9.35 requires libSOGoLogic v0.9.24
+# v0.9.34 requires libSOGoLogic v0.9.22
--- /dev/null
+2004-11-27 Helge Hess <helge.hess@skyrix.com>
+
+ * started Sieve product
--- /dev/null
+# GNUstep makefile
+
+include ../common.make
+
+BUNDLE_NAME = Sieve
+
+Sieve_PRINCIPAL_CLASS = SOGoSieveProduct
+
+Sieve_OBJC_FILES += \
+ Product.m \
+ SOGoSieveBaseObject.m \
+ SOGoSieveScriptsFolder.m\
+ SOGoSieveScriptObject.m \
+
+Sieve_RESOURCE_FILES += \
+ Version \
+ product.plist \
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/bundle.make
+-include GNUmakefile.postamble
--- /dev/null
+# compilation settings
+
+ADDITIONAL_INCLUDE_DIRS += -I../Mailer
--- /dev/null
+/*
+ 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.
+*/
+
+#import <Foundation/NSObject.h>
+
+@interface SOGoSieveProduct : NSObject
+{
+}
+
+@end
+
+@implementation SOGoSieveProduct
+
+@end /* SOGoSieveProduct */
--- /dev/null
+# README for Sieve SoObjects
+
+Class Overview
+==============
+
+
+Defaults
+========
--- /dev/null
+/*
+ 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.
+*/
+
+#ifndef __Sieve_SOGoSieveBaseObject_H__
+#define __Sieve_SOGoSieveBaseObject_H__
+
+#include <SOGo/SOGoObject.h>
+
+/*
+ SOGoSieveBaseObject
+
+ Common base class for Sieve SoObjects.
+*/
+
+@class NSString, NSArray, NSURL;
+@class NGImap4Client;
+@class SOGoMailManager;
+@class SOGoMailAccount;
+
+@interface SOGoSieveBaseObject : SOGoObject
+{
+}
+
+/* hierarchy */
+
+- (SOGoMailAccount *)mailAccountFolder;
+
+/* IMAP4 */
+
+- (SOGoMailManager *)mailManager;
+- (NSURL *)imap4URL;
+- (NSString *)imap4Password;
+- (NGImap4Client *)imap4Client;
+- (void)flushMailCaches;
+
+@end
+
+#endif /* __Sieve_SOGoSieveBaseObject_H__ */
--- /dev/null
+/*
+ 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.
+*/
+
+#include "SOGoSieveBaseObject.h"
+#include <Mailer/SOGoMailManager.h>
+#include <Mailer/SOGoMailAccount.h>
+#include "common.h"
+#include <NGObjWeb/SoObject+SoDAV.h>
+#include <NGObjWeb/SoHTTPAuthenticator.h>
+#include <NGExtensions/NSURL+misc.h>
+
+@implementation SOGoSieveBaseObject
+
+/* hierarchy */
+
+- (SOGoMailAccount *)mailAccountFolder {
+ if (![[self container] respondsToSelector:_cmd]) {
+ [self logWithFormat:@"WARNING: weird container of mailfolder: %@",
+ [self container]];
+ return nil;
+ }
+
+ return [[self container] mailAccountFolder];
+}
+
+/* IMAP4 */
+
+- (SOGoMailManager *)mailManager {
+ return [[self mailAccountFolder] mailManager];
+}
+- (NSURL *)imap4URL {
+ return [[self mailAccountFolder] imap4URL];
+}
+
+- (NSString *)imap4Password {
+ return [[self mailAccountFolder] imap4Password];
+}
+
+- (NGImap4Client *)imap4Client {
+ return [[self mailAccountFolder] imap4Client];
+}
+
+- (void)flushMailCaches {
+}
+
+/* debugging */
+
+- (NSString *)loggingPrefix {
+ /* improve perf ... */
+ return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
+ self, NSStringFromClass([self class]),
+ [self nameInContainer]];
+}
+@end /* SOGoSieveBaseObject */
--- /dev/null
+/*
+ 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.
+*/
+
+#ifndef __Sieve_SOGoSieveScriptObject_H__
+#define __Sieve_SOGoSieveScriptObject_H__
+
+#include "SOGoSieveBaseObject.h"
+
+/*
+ SOGoSieveScriptObject
+
+ Parent object: SOGoSieveScriptsFolder
+ Child objects: none
+
+ The SOGoSieveScriptObject represents a single sieve script on a Cyrus folder.
+*/
+
+@interface SOGoSieveScriptObject : SOGoSieveBaseObject
+{
+}
+
+
+@end
+
+#endif /* __Sieve_SOGoSieveScriptObject_H__ */
--- /dev/null
+/*
+ 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.
+*/
+
+#include "SOGoSieveScriptObject.h"
+#include "common.h"
+
+@implementation SOGoSieveScriptObject
+
+@end /* SOGoSieveScriptObject */
--- /dev/null
+/*
+ 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.
+*/
+
+#ifndef __Sieve_SOGoSieveScriptsFolder_H__
+#define __Sieve_SOGoSieveScriptsFolder_H__
+
+#include "SOGoSieveBaseObject.h"
+
+/*
+ SOGoSieveScriptsFolder
+
+ Parent object: the SOGoMailAccount
+ Child objects: SOGoSieveScriptObject
+
+ The SOGoSieveScriptsFolder represents a list of sieve scripts on a Cyrus
+ server.
+*/
+
+@interface SOGoSieveScriptsFolder : SOGoSieveBaseObject
+{
+}
+
+
+@end
+
+#endif /* __Sieve_SOGoSieveScriptsFolder_H__ */
--- /dev/null
+/*
+ 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.
+*/
+
+#include "SOGoSieveScriptsFolder.h"
+#include "common.h"
+
+@implementation SOGoSieveScriptsFolder
+
+@end /* SOGoSieveScriptsFolder */
--- /dev/null
+# Version file
+
+SUBMINOR_VERSION:=1
+
+# v0.9.1 requires libNGMime v4.3.194
--- /dev/null
+/*
+ Copyright (C) 2002-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: common.h 335 2004-09-29 23:24:45Z helge $
+
+#import <Foundation/Foundation.h>
+#import <Foundation/NSObjCRuntime.h>
+
+#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
+# include <NGExtensions/NGObjectMacros.h>
+# include <NGExtensions/NSString+Ext.h>
+#endif
+
+#include <NGExtensions/NGExtensions.h>
+#include <NGObjWeb/NGObjWeb.h>
+#include <NGObjWeb/SoObjects.h>
+
+#include <SOGoLogic/SOGoAppointment.h>
+
+#include <NGImap4/NGImap4Client.h>
--- /dev/null
+{
+ requires = ( MAIN, Mailer );
+
+ publicResources = (
+ );
+
+ factories = {
+ };
+
+ classes = {
+ SOGoSieveBaseObject = {
+ superclass = "SOGoObject";
+ };
+
+ SOGoSieveScriptsFolder = {
+ superclass = "SOGoSieveBaseObject";
+ };
+
+ SOGoSieveScriptObject = {
+ superclass = "SOGoSieveBaseObject";
+ };
+ };
+}