+2004-10-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * marked collections as WebDAV collections (v0.9.28)
+
2004-10-06 Helge Hess <helge.hess@opengroupware.org>
* started SOGoDraftsFolder (v0.9.27)
@implementation SOGoDraftsFolder
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return YES;
+}
+
@end /* SOGoDraftsFolder */
/* WebDAV */
+- (BOOL)davIsCollection {
+ return YES;
+}
+
- (NSString *)shortTitle {
NSString *s, *login, *host;
NSRange r;
return [self treeNavigationBlockForActiveNode];
}
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return YES;
+}
+
@end /* SOGoMailAccounts */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return YES;
+}
+
@end /* SOGoMailFolder */
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ /* while a mail has child objects, it should appear as a file in WebDAV */
+ return NO;
+}
+
@end /* SOGoMailObject */
# $Id$
-SUBMINOR_VERSION:=27
+SUBMINOR_VERSION:=28
+2004-10-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.21
+
+ * SOGoContentObject.m: added PUTAction:
+
+ * SOGoObject.m: implemented special WebDAV support in GETAction:
+
+ * SOGoFolder.m: added -toOneRelationshipKeys method (enables listing of
+ contained objects in WebDAV), added container name to logging prefix,
+ explicitly mark as WebDAV collection
+
+ * SOGoContentObject.m: mark as WebDAV non-collection
+
+2004-10-07 Helge Hess <helge.hess@opengroupware.org>
+
+ * SOGoUserFolder.m: added toManyRelationshipKeys, marked as WebDAV
+ collection (v0.9.20)
+
2004-09-29 Helge Hess <helge.hess@opengroupware.org>
* SOGoObject.m: added -fetchSubfolders method to resolve all
return nil;
}
+/* actions */
+
+- (id)PUTAction:(WOContext *)_ctx {
+ WORequest *rq;
+ NSException *error;
+
+ rq = [_ctx request];
+ if ((error = [self saveContentString:[rq contentAsString]]) != nil)
+ return error;
+
+ // TODO: this should be automatic if we return nil?
+ [[_ctx response] setStatus:201 /* Created */];
+ return [_ctx response];
+}
+
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return [self isFolderish];
+}
+
/* description */
- (void)appendAttributesToDescription:(NSMutableString *)_ms {
return self->ocsFolder;
}
+- (NSArray *)fetchContentObjectNames {
+ NSArray *fields, *records;
+
+ fields = [NSArray arrayWithObject:@"c_name"];
+ records = [[self ocsFolder] fetchFields:fields matchingQualifier:nil];
+ if (![records isNotNull]) {
+ [self logWithFormat:@"ERROR(%s): fetch failed!", __PRETTY_FUNCTION__];
+ return nil;
+ }
+ if ([records isKindOfClass:[NSException class]])
+ return records;
+ return [records valueForKey:@"cName"];
+}
+
+/* reflection */
+
+- (NSArray *)toOneRelationshipKeys {
+ /* toOneRelationshipKeys are the 'files' contained in a folder */
+ return [self fetchContentObjectNames];
+}
+
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return [self isFolderish];
+}
+
/* description */
- (void)appendAttributesToDescription:(NSMutableString *)_ms {
[_ms appendFormat:@" ocs=%@", [self ocsPath]];
}
+- (NSString *)loggingPrefix {
+ return [NSString stringWithFormat:@"<0x%08X[%@]:%@>",
+ self, NSStringFromClass([self class]),
+ [self nameInContainer]];
+}
+
@end /* SOGoFolder */
/* hierarchy */
-- (NSArray *)fetchSubfolders;
+- (NSArray *)fetchSubfolders; /* uses toManyRelationshipKeys */
/* operations */
#include "SOGoUserFolder.h"
#include "common.h"
+@interface SOGoObject(Content)
+- (NSString *)contentAsString;
+@end
+
@implementation SOGoObject
- (BOOL)doesRetainContainer {
- (id)GETAction:(WOContext *)_ctx {
// TODO: I guess this should really be done by SOPE (redirect to
// default method)
+ WORequest *rq;
WOResponse *r;
NSString *uri;
- uri = [[_ctx request] uri];
+ rq = [_ctx request];
+ if ([rq isSoWebDAVRequest]) {
+ if ([self respondsToSelector:@selector(contentAsString)])
+ return [self contentAsString];
+
+ return [NSException exceptionWithHTTPStatus:502 /* not implemented */
+ reason:@"no WebDAV GET support?!"];
+ }
+
+ uri = [rq uri];
if (![uri hasSuffix:@"/"]) uri = [uri stringByAppendingString:@"/"];
uri = [uri stringByAppendingString:@"view"];
return [self nameInContainer];
}
+/* hierarchy */
+
+- (NSArray *)toManyRelationshipKeys {
+ static NSArray *children = nil;
+
+ if (children == nil) {
+ children = [[NSArray alloc] initWithObjects:
+ @"Calendar", @"Contacts", @"Mail", nil];
+ }
+ return children;
+}
+
/* ownership */
- (NSString *)ownerInContext:(id)_ctx {
return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
+/* WebDAV */
+
+- (BOOL)davIsCollection {
+ return YES;
+}
+
@end /* SOGoUserFolder */
# $Id: Version 170 2004-08-11 10:45:40Z helge $
-SUBMINOR_VERSION:=19
+SUBMINOR_VERSION:=21
+2004-10-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * SOGoAppointment.m: improved behaviour in some edge condition (the
+ value of the categories being an NSCalendarDate) (v0.9.14)
+
2004-10-06 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.13
NSString *catString;
NSArray *cats;
NSRange r;
-
+
catString = [self->event categories];
- if(!catString) {
+ if (![catString isNotNull])
return [NSArray array];
- }
- r = [catString rangeOfString:@";"];
+
+ r = [[catString stringValue] rangeOfString:@";"];
if(r.length > 0) {
catString = [catString substringToIndex:r.location];
}
# $Id$
-SUBMINOR_VERSION:=13
+SUBMINOR_VERSION:=14
# v0.9.13 requires libFoundation v1.0.62