+2004-10-08 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.3.55
+
+ * WebDAV/SoObjectResultEntry.m, WebDAV/SoWebDAVRenderer.m: improved
+ debugging and error detection facilities
+
+ * WebDAV/SoObjectDataSource.m: fixed URL construction on Cocoa
+ Foundation (you cannot use NSPathUtilities to work on URLs with that
+ Foundation)
+
+ * WEClientCapabilities.m: added Goliath as a known (WebDAV) user agent,
+ added -isRSSClient method
+
2004-10-07 Helge Hess <helge.hess@opengroupware.org>
* v4.3.54
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __WEExtensions_WEClientCapabilities_H__
#define __WEExtensions_WEClientCapabilities_H__
- (BOOL)isDAVClient;
- (BOOL)isXmlRpcClient;
- (BOOL)isBLogClient;
+- (BOOL)isRSSClient;
- (BOOL)doesSupportCSSOverflow;
- (BOOL)doesSupportDHTMLDragAndDrop;
# version file
-SUBMINOR_VERSION:=54
+SUBMINOR_VERSION:=55
# v4.3.42 requires libNGExtensions v4.3.116
# v4.3.40 requires libNGExtensions v4.3.115
#define WEUA_SOPE 37
#define WEUA_Ecto 38
#define WEUA_NewsFire 39
+#define WEUA_Goliath 40
#define WEOS_UNKNOWN 0
#define WEOS_WINDOWS 1
else if (strstr(ua, "NewsFire")) {
self->browser = WEUA_NewsFire;
}
+ else if (strstr(ua, "Goliath")) {
+ self->browser = WEUA_Goliath;
+ }
else if (strstr(ua, "SOPE/")) {
self->browser = WEUA_SOPE;
}
case WEUA_KungLog: return @"KungLog";
case WEUA_Ecto: return @"Ecto";
case WEUA_NewsFire: return @"NewsFire";
+ case WEUA_Goliath: return @"Goliath";
default: return @"unknown";
}
}
if (self->browser == WEUA_ZideLook) return YES;
if (self->browser == WEUA_Entourage) return YES;
if (self->browser == WEUA_Morgul) return YES;
+ if (self->browser == WEUA_Goliath) return YES;
return NO;
}
if (self->browser == WEUA_Ecto) return YES;
return NO;
}
+- (BOOL)isRSSClient {
+ if (self->browser == WEUA_NetNewsWire) return YES;
+ if (self->browser == WEUA_NewsFire) return YES;
+ return NO;
+}
- (BOOL)doesSupportCSSOverflow {
if (![self isCSS1Browser])
NewsFire
'NewsFire/0.23'
+
+ Goliath
+ 'Goliath/1.0.1 (Macintosh-Carbon; PPC)'
*/
static BOOL debugOn = NO;
+ (void)initialize {
- debugOn = [[NSUserDefaults standardUserDefaults]
- boolForKey:@"SoObjectDataSourceDebugEnabled"];
+ NSUserDefaults *ud;
+
+ ud = [NSUserDefaults standardUserDefaults];
+ debugOn = [ud boolForKey:@"SoObjectDataSourceDebugEnabled"];
}
- (id)initWithObject:(id)_object inContext:(id)_ctx {
NSArray *queriedAttrNames;
NSArray *orderings;
NSString *childKey;
+ NSString *tmp;
BOOL isBrief = YES; // do not encode "sub-errors", just omit the item
[self debugWithFormat:@"performing flat query: %@", _fs];
if (isBrief) // when the brief header is set, forget errors
e = nil;
}
- else if ((child = [self->object lookupName:childKey inContext:_ctx acquire:NO])==nil) {
+ else if ((child = [self->object lookupName:childKey inContext:_ctx
+ acquire:NO])==nil) {
/* not found */
[self debugWithFormat:@" did not find key '%@'", childKey];
}
/* calc URI */
-
+
+ /*
+ Note: we cannot use NSPathUtilities, those will reformat the string on
+ Cocoa Foundation! (eg http://a => http:/a, remove double slashes)
+ */
childHref = [childKey stringByEscapingURL];
- childHref = [[_fs entityName] stringByAppendingPathComponent:childHref];
+ tmp = [_fs entityName];
+ if (![tmp hasSuffix:@"/"])
+ tmp = [tmp stringByAppendingString:@"/"];
+ childHref = [tmp stringByAppendingString:childHref];
+
+ if (debugOn) {
+ // TODO: this happens if we access using Goliath
+ if ([childHref hasPrefix:@"http:/"] &&
+ ![childHref hasPrefix:@"http://"]) {
+ [self logWithFormat:@"BROKEN CHILD URL: %@ (entity=%@,key=%@)",
+ childHref, [_fs entityName], childKey];
+ abort();
+ }
+ }
/* add errors if required */
/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2002-2004 SKYRIX Software AG
- This file is part of OGo
+ 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, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __WebDAV_SoObjectResultEntry_H__
#define __WebDAV_SoObjectResultEntry_H__
/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ 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, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "SoObjectResultEntry.h"
#include "common.h"
@implementation SoObjectResultEntry
+static BOOL debugOn = NO;
+
- (id)initWithURI:(NSString *)_href object:(id)_o values:(NSDictionary *)_d {
- self->href = [_href copy];
- self->values = [_d retain];
- self->object = [_o retain];
+ if ((self = [super init])) {
+ if (debugOn) {
+ // TODO: this happens if we access using Goliath
+ if ([_href hasPrefix:@"http:/"] && ![_href hasPrefix:@"http://"]) {
+ [self logWithFormat:@"BROKEN URL: %@", _href];
+ [self release];
+ abort();
+ return nil;
+ }
+ }
+
+ self->href = [_href copy];
+ self->values = [_d retain];
+ self->object = [_o retain];
+ }
return self;
}
+- (id)init {
+ return [self initWithURI:nil object:nil values:nil];
+}
- (void)dealloc {
[self->href release];
- (id)valueForKey:(NSString *)_key {
if ([_key isEqualToString:@"{DAV:}href"])
return self->href;
- else if ([_key isEqualToString:@"{DAV:}status"])
+
+ if ([_key isEqualToString:@"{DAV:}status"])
return nil;
- else {
-#if 1
+
+ if (!debugOn)
return [self->values objectForKey:_key];
-#else
+
+ {
id v = [self->values objectForKey:_key];
[self logWithFormat:@"key %@: %@", _key, v];
return v;
-#endif
}
}
return baseURL;
}
-- (NSString *)tidyHref:(id)href baseURL:(id)baseURL {
- href = [href stringValue];
+- (NSString *)tidyHref:(id)_href baseURL:(id)baseURL {
+ NSString *href;
+
+ href = [_href stringValue];
+
+ if (debugOn) {
+ // TODO: this happens if we access using Goliath
+ if ([href hasPrefix:@"http:/"] && ![href hasPrefix:@"http://"]) {
+ [self logWithFormat:@"BROKEN URL: %@", _href];
+ return nil;
+ }
+ }
+
if (href == nil) {
if (debugOn) {
[self logWithFormat:
/* we do not map these DAV properties because they are very special */
if (!_namesOnly) {
if ((href = [entry valueForKey:@"{DAV:}href"]) == nil) {
- if ((key = [_propMap objectForKey:@"{DAV:}href"])) {
+ if ((key = [_propMap objectForKey:@"{DAV:}href"]) != nil) {
if ((href = [entry valueForKey:key]) == nil) {
if (debugOn) {
[self debugWithFormat:
[r appendContentString:@"<D:response>"];
if (formatOutput) [r appendContentCharacter:'\n'];
- if (href) {
+ if ([href isNotNull]) {
[r appendContentString:@"<D:href>"];
/*
TODO: need to find out what is appropriate! While Cadaver and ZideLook
[r appendContentString:@"</D:href>"];
if (formatOutput) [r appendContentCharacter:'\n'];
}
-
+ else {
+ [self logWithFormat:
+ @"WARNING: WebDAV result entry has no valid href: %@", entry];
+ }
+
[r appendContentString:@"<D:propstat>"];
if (stat) {
[r appendContentString:@"<D:status>"];