2004-10-03 Helge Hess <helge.hess@opengroupware.org>
+ * v0.9.21
+
+ * SOGoMailObject.m: lookup 'number' names as part child objects
+
+ * added SOGoMailBodyPart as a child object of SOGoMailObject
+
+ * SOGoMailAccounts.m: changed link generation for active folder
+
* v0.9.20
-
+
* SOGoMailObject.m: added method to fetch parts
-
+
* SOGoMailManager.m: properly select folder prior fetch, added method
to fetch parts of a single (message) URL
SOGoMailAccount.m \
SOGoMailFolder.m \
SOGoMailObject.m \
+ SOGoMailBodyPart.m \
Mailer_RESOURCE_FILES += \
Version \
[md setObject:[NSNumber numberWithBool:YES] forKey:@"isPathNode"];
[md setObject:[self davDisplayName] forKey:@"title"];
[md setObject:[self nameInContainer] forKey:@"name"];
- [md setObject:@"." forKey:@"link"];
+ [md setObject:[@"../" stringByAppendingString:[self nameInContainer]]
+ forKey:@"link"];
if ([blocks count] > 0)
[md setObject:blocks forKey:@"children"];
return md;
--- /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 __Mailer_SOGoMailBodyPart_H__
+#define __Mailer_SOGoMailBodyPart_H__
+
+#include <Mailer/SOGoMailBaseObject.h>
+
+/*
+ SOGoMailBodyPart
+ Parent object: SOGoMailObject or SOGoMailBodyPart
+ Child objects: SOGoMailBodyPart's
+
+ Represents a MIME part of a mail as retrieved using IMAP4 body structure
+ commands in NGImap4.
+*/
+
+@interface SOGoMailBodyPart : SOGoMailBaseObject
+{
+}
+
+@end
+
+#endif /* __Mailer_SOGoMailBodyPart_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 "SOGoMailBodyPart.h"
+#include "SOGoMailObject.h"
+#include "common.h"
+
+@implementation SOGoMailBodyPart
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+/* hierarchy */
+
+- (SOGoMailObject *)mailObject {
+ return [[self container] mailObject];
+}
+
+/* name lookup */
+
+- (id)lookupImap4BodyPartKey:(NSString *)_key inContext:(id)_ctx {
+ // TODO: we might want to check for existence prior controller creation
+ return [[[SOGoMailBodyPart alloc] initWithName:_key
+ inContainer:self] 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]) != nil)
+ return obj;
+
+ /* lookup body part */
+
+ if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil)
+ return obj;
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
+@end /* SOGoMailBodyPart */
/*
SOGoMailObject
Parent object: the SOGoMailFolder
- Child objects: none (maybe SOGoMailAttachments?)
+ Child objects: SOGoMailBodyPart's
- Represents a single mail as retrieved using NGImap4.
+ Represents a single mail as retrieved using NGImap4. Since IMAP4 can parse
+ MIME structures on the server side, which we map into child objects of the
+ message.
+ The child objects are accessed using integer IDs, eg:
+ /INBOX/12345/1/2/3
+ would address the MIME part 1.2.3 of the mail 12345 in the folder INBOX.
*/
@interface SOGoMailObject : SOGoMailBaseObject
/* message */
-- (id)fetchParts:(NSArray *)_parts;
+- (id)fetchParts:(NSArray *)_parts; /* Note: 'parts' are fetch keys here */
@end
#include "SOGoMailObject.h"
#include "SOGoMailManager.h"
+#include "SOGoMailBodyPart.h"
#include "common.h"
@implementation SOGoMailObject
return [self nameInContainer];
}
+/* hierarchy */
+
+- (SOGoMailObject *)mailObject {
+ return self;
+}
+
/* message */
- (id)fetchParts:(NSArray *)_parts {
password:[self imap4Password]];
}
+/* name lookup */
+
+- (BOOL)isBodyPartKey:(NSString *)_key inContext:(id)_ctx {
+ /*
+ Every key starting with a digit is consider an IMAP4 mime part key.
+ */
+ if ([_key length] == 0)
+ return NO;
+
+ if (isdigit([_key characterAtIndex:0]))
+ return YES;
+
+ return NO;
+}
+
+- (id)lookupImap4BodyPartKey:(NSString *)_key inContext:(id)_ctx {
+ // TODO: we might want to check for existence prior controller creation
+ return [[[SOGoMailBodyPart alloc] initWithName:_key
+ inContainer:self] 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]) != nil)
+ return obj;
+
+ /* lookup body part */
+
+ if ([self isBodyPartKey:_key inContext:_ctx]) {
+ if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil)
+ return obj;
+ }
+
+ /* return 404 to stop acquisition */
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+}
+
@end /* SOGoMailObject */
# $Id$
-SUBMINOR_VERSION:=20
+SUBMINOR_VERSION:=21
SOGoMailObject = {
superclass = "SOGoMailBaseObject";
};
+
+ SOGoMailBodyPart = {
+ superclass = "SOGoMailBaseObject";
+ };
};
}