From: helge Date: Fri, 16 Jul 2004 14:15:06 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/trunk@143 d1b88da0-ebda-0310-925b-ed51d... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eef266a7bce7a1aee7bf107173bbf11d3c43bde2;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/trunk@143 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/OGoContentStore/ChangeLog b/OGoContentStore/ChangeLog index c6cb08fa..447d52a7 100644 --- a/OGoContentStore/ChangeLog +++ b/OGoContentStore/ChangeLog @@ -1,3 +1,7 @@ +2004-07-16 Helge Hess + + * improved error handling in various files + 2004-07-02 Helge Hess * OCSChannelManager.m: added garbage collector for channel pools diff --git a/OGoContentStore/OCSChannelManager.m b/OGoContentStore/OCSChannelManager.m index 3d9a28bf..d891bfc6 100644 --- a/OGoContentStore/OCSChannelManager.m +++ b/OGoContentStore/OCSChannelManager.m @@ -270,7 +270,7 @@ static NSTimeInterval ChannelCollectionTimer = 5 * 60; ; else if (![channel openChannel]) { [self logWithFormat:@"could not open channel %@ for URL: %@", - channel, _url]; + channel, [_url absoluteString]]; return nil; } diff --git a/OGoContentStore/OCSFolder.m b/OGoContentStore/OCSFolder.m index f7dfce4b..599fc694 100644 --- a/OGoContentStore/OCSFolder.m +++ b/OGoContentStore/OCSFolder.m @@ -32,8 +32,8 @@ @implementation OCSFolder -static BOOL debugOn = YES; -static BOOL doLogStore = YES; +static BOOL debugOn = NO; +static BOOL doLogStore = NO; + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; @@ -160,7 +160,8 @@ static BOOL doLogStore = YES; NSString *sql; if ((channel = [self acquireStoreChannel]) == nil) { - [self logWithFormat:@"ERROR(%s): could not open storage channel!"]; + [self logWithFormat:@"ERROR(%s): could not open storage channel!", + __PRETTY_FUNCTION__]; return nil; } diff --git a/OGoContentStore/OCSFolderManager.h b/OGoContentStore/OCSFolderManager.h index 7fc7339e..6ce48480 100644 --- a/OGoContentStore/OCSFolderManager.h +++ b/OGoContentStore/OCSFolderManager.h @@ -48,6 +48,7 @@ /* accessors */ - (NSURL *)folderInfoLocation; +- (NSString *)folderInfoTableName; /* connection */ diff --git a/OGoContentStore/OCSFolderManager.m b/OGoContentStore/OCSFolderManager.m index cb1cb3ac..4c395db0 100644 --- a/OGoContentStore/OCSFolderManager.m +++ b/OGoContentStore/OCSFolderManager.m @@ -82,7 +82,7 @@ static const char *OCSPathColumnPattern = "c_path%i"; } if ((fm = [[self alloc] initWithFolderInfoLocation:url]) == nil) { NSLog(@"ERROR(%s): could not create folder manager with URL: '%@'", - __PRETTY_FUNCTION__, url); + __PRETTY_FUNCTION__, [url absoluteString]); return nil; } @@ -102,6 +102,13 @@ static const char *OCSPathColumnPattern = "c_path%i"; self->channelManager = [[OCSChannelManager defaultChannelManager] retain]; self->folderInfoLocation = [_url retain]; + + if ([[self folderInfoTableName] length] == 0) { + [self logWithFormat:@"ERROR(%s): missing tablename in URL: %@", + __PRETTY_FUNCTION__, [_url absoluteString]]; + [self release]; + return nil; + } cal = [[OCSFolderType alloc] initWithFolderTypeName:@"appointment"]; self->nameToType = @@ -381,9 +388,11 @@ static const char *OCSPathColumnPattern = "c_path%i"; if ((name = [self internalNameFromPath:_path]) == nil) return nil; for (i = 0, count = [_records count]; i < count; i++) { - NSString *recName; + NSDictionary *record; + NSString *recName; - recName = [[_records objectAtIndex:i] objectForKey:OCSPathRecordName]; + record = [_records objectAtIndex:i]; + recName = [record objectForKey:OCSPathRecordName]; #if 0 [self logWithFormat:@"check '%@' vs '%@' (%@)...", name, recName,[_records objectAtIndex:i]]; @@ -424,9 +433,11 @@ static const char *OCSPathColumnPattern = "c_path%i"; fname = [self internalNameFromPath:_path]; if (count == 1) { + NSDictionary *record; NSString *sname; - sname = [[records objectAtIndex:0] objectForKey:OCSPathRecordName]; + record = [records objectAtIndex:0]; + sname = [record objectForKey:OCSPathRecordName]; return [fname isEqualToString:sname]; } @@ -468,9 +479,11 @@ static const char *OCSPathColumnPattern = "c_path%i"; fname = [self internalNameFromPath:_path]; fname = [fname stringByAppendingString:@"/"]; /* add slash */ for (i = 0; i < count; i++) { + NSDictionary *record; NSString *sname, *spath; - sname = [[records objectAtIndex:0] objectForKey:OCSPathRecordName]; + record = [records objectAtIndex:0]; + sname = [record objectForKey:OCSPathRecordName]; if (![sname hasPrefix:fname]) /* does not match at all ... */ continue; diff --git a/OGoContentStore/sql/folderinfo-create.psql b/OGoContentStore/sql/folderinfo-create.psql index d6eb2047..c8f5833b 100644 --- a/OGoContentStore/sql/folderinfo-create.psql +++ b/OGoContentStore/sql/folderinfo-create.psql @@ -35,8 +35,8 @@ VALUES NULL, NULL, 'Users', - 'http://OGo:OGo@localhost/test/SOGo_user_folder', - 'http://OGo:OGo@localhost/test/SOGo_user_folder_quick', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_quick', 'Container' ); INSERT INTO SOGo_folder_info @@ -49,8 +49,8 @@ VALUES NULL, NULL, 'helge', - 'http://OGo:OGo@localhost/test/SOGo_user_folder', - 'http://OGo:OGo@localhost/test/SOGo_user_folder_quick', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_user_folder_quick', 'Container' ); INSERT INTO SOGo_folder_info @@ -63,6 +63,6 @@ VALUES 'Calendar', NULL, 'Calendar', - 'http://OGo:OGo@localhost/test/SOGo_helge_privcal', - 'http://OGo:OGo@localhost/test/SOGo_helge_privcal_quick', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_helge_privcal', + 'http://OGo:OGo@localhost:5432/OGo/SOGo_helge_privcal_quick', 'Appointment' ); diff --git a/SOGo/UI/Common/ChangeLog b/SOGo/UI/Common/ChangeLog index 5d087fcc..3ebb328b 100644 --- a/SOGo/UI/Common/ChangeLog +++ b/SOGo/UI/Common/ChangeLog @@ -1,5 +1,9 @@ 2004-07-16 Helge Hess + * UIxAppNavView.m: some fixes to navigation URLs + + * UIxAppNavView.wox: fixed indention + * product.plist: properly export uix.css as a public resource 2004-07-01 Helge Hess diff --git a/SOGo/UI/Common/UIxAppNavView.m b/SOGo/UI/Common/UIxAppNavView.m index 8bf1ff12..54d3930e 100644 --- a/SOGo/UI/Common/UIxAppNavView.m +++ b/SOGo/UI/Common/UIxAppNavView.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2004 SKYRIX Software AG + Copyright (C) 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 @@ -20,12 +20,7 @@ */ // $Id$ - -#import -#import -#import -#import - +#include @interface UIxAppNavView : WOComponent { @@ -35,70 +30,65 @@ @end +#include +#include +#include +#include "common.h" @implementation UIxAppNavView - (void)dealloc { - [self->element release]; - [self->lastElement release]; - [super dealloc]; + [self->element release]; + [self->lastElement release]; + [super dealloc]; } - (void)setElement:(id)_element { - ASSIGN(self->element, _element); + ASSIGN(self->element, _element); } - - (id)element { - return self->element; + return self->element; } - (void)setLastElement:(id)_element { - ASSIGN(self->lastElement, _element); + ASSIGN(self->lastElement, _element); } - - (id)lastElement { - return self->lastElement; + return self->lastElement; } - (NSArray *)navPathElements { - NSArray *traversalObjects; - NSMutableArray *navPathComponents; - NSMutableString *navURL; - unsigned int i, count; - - traversalObjects = [[self context] objectTraversalStack]; - count = ([traversalObjects count] - 1); /* remove SoPageInvocation */ - navPathComponents = [[NSMutableArray alloc] initWithCapacity:count]; - navURL = [[NSMutableString alloc] initWithString:@"/"]; - - for(i = 0; i < count; i++) { - NSString *name, *url; - id obj; + NSArray *traversalObjects; + NSMutableArray *navPathComponents; + unsigned int i, count; + + traversalObjects = [[self context] objectTraversalStack]; + count = ([traversalObjects count] - 1); /* remove SoPageInvocation */ + + navPathComponents = [[NSMutableArray alloc] initWithCapacity:count]; + for (i = 0; i < count; i++) { + NSString *name; + id obj; - obj = [traversalObjects objectAtIndex:i]; - - name = [obj davDisplayName]; - if(!name) - name = NSStringFromClass([obj class]); - - [navURL appendString:name]; - [navURL appendString:@"/"]; - - if(! [name hasPrefix:@"ZideStore"]) { - NSMutableDictionary *c; - - c = [[NSMutableDictionary alloc] initWithCapacity:2]; - [c setObject:name forKey:@"name"]; - url = [navURL copy]; - [c setObject:url forKey:@"url"]; - [url release]; - [navPathComponents addObject:c]; - [c release]; - } + obj = [traversalObjects objectAtIndex:i]; + + name = [obj davDisplayName]; + if ([name length] == 0) + name = NSStringFromClass([obj class]); + + if (![name hasPrefix:@"sogod"]) { + NSMutableDictionary *c; + + c = [[NSMutableDictionary alloc] initWithCapacity:2]; + [c setObject:name forKey:@"name"]; + [c setObject:[obj baseURLInContext:[self context]] forKey:@"url"]; + [navPathComponents addObject:c]; + [c release]; } + } - [self setLastElement:[navPathComponents lastObject]]; - return [navPathComponents autorelease]; + [self setLastElement:[navPathComponents lastObject]]; + return [navPathComponents autorelease]; } -@end +@end /* UIxAppNavView */ diff --git a/SOGo/UI/Common/UIxAppNavView.wox b/SOGo/UI/Common/UIxAppNavView.wox index 6e924d43..2b4f1f8d 100644 --- a/SOGo/UI/Common/UIxAppNavView.wox +++ b/SOGo/UI/Common/UIxAppNavView.wox @@ -1,10 +1,18 @@ - -You are here:/ - \ No newline at end of file + You are here: + + + + / + + + + + +