From ae641aa7d33cb07635502103e93053fb6ad4260b Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 23 Jun 2004 13:32:21 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@60 d1b88da0-ebda-0310-925b-ed51d893ca5b --- OGoContentStore/GNUmakefile | 2 -- OGoContentStore/OCSFolderManager.h | 1 + OGoContentStore/OCSFolderManager.m | 31 +++++++++++++++++++++++++++++- OGoContentStore/README | 5 +++++ ZideStore/UI-X/Common/GNUmakefile | 6 +++--- dbd/DTable.m | 21 ++++++++++++++------ dbd/DTable.wox | 12 +++++++++--- 7 files changed, 63 insertions(+), 15 deletions(-) diff --git a/OGoContentStore/GNUmakefile b/OGoContentStore/GNUmakefile index ef9bc9da..348e1aec 100644 --- a/OGoContentStore/GNUmakefile +++ b/OGoContentStore/GNUmakefile @@ -24,8 +24,6 @@ libOGoContentStore_OBJC_FILES += \ OCSFolderType.m \ OCSChannelManager.m \ -libOGoContentStore_LIBRARY_DEPENDS_UPON += -lGDLAccess - -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble diff --git a/OGoContentStore/OCSFolderManager.h b/OGoContentStore/OCSFolderManager.h index ee7fed1d..90efca46 100644 --- a/OGoContentStore/OCSFolderManager.h +++ b/OGoContentStore/OCSFolderManager.h @@ -39,6 +39,7 @@ NSURL *folderInfoLocation; } ++ (id)defaultFolderManager; - (id)initWithFolderInfoLocation:(NSURL *)_url; /* accessors */ diff --git a/OGoContentStore/OCSFolderManager.m b/OGoContentStore/OCSFolderManager.m index e0637e88..8aeb19fa 100644 --- a/OGoContentStore/OCSFolderManager.m +++ b/OGoContentStore/OCSFolderManager.m @@ -25,9 +25,38 @@ @implementation OCSFolderManager +static OCSFolderManager *fm = nil; + ++ (id)defaultFolderManager { + NSString *s; + NSURL *url; + if (fm) return fm; + + s = [[NSUserDefaults standardUserDefaults] stringForKey:@"OCSFolderInfoURL"]; + if ([s length] == 0) { + NSLog(@"ERROR(%s): default 'OCSFolderInfoURL' is not configured.", + __PRETTY_FUNCTION__); + return nil; + } + if ((url = [NSURL URLWithString:s]) == nil) { + NSLog(@"ERROR(%s): default 'OCSFolderInfoURL' is not a valid URL: '%@'", + __PRETTY_FUNCTION__, s); + return nil; + } + if ((fm = [[self alloc] initWithFolderInfoLocation:url]) == nil) { + NSLog(@"ERROR(%s): could not create folder manager with URL: '%@'", + __PRETTY_FUNCTION__, url); + return nil; + } + + NSLog(@"Note: setup default manager at: %@", url); + return fm; +} + - (id)initWithFolderInfoLocation:(NSURL *)_url { if (_url == nil) { - [self logWithFormat:@"ERROR: missing folder info url!"]; + [self logWithFormat:@"ERROR(%s): missing folder info url!", + __PRETTY_FUNCTION__]; [self release]; return nil; } diff --git a/OGoContentStore/README b/OGoContentStore/README index edfa572c..c5c468c2 100644 --- a/OGoContentStore/README +++ b/OGoContentStore/README @@ -38,6 +38,11 @@ Class Hierarchy - field 'value' (eg array values for participants?) - BLOB archiver/unarchiver +Defaults +======== + + OCSFolderInfoURL - the DB URL where the folder-info table is located + BLOB Formats ============ diff --git a/ZideStore/UI-X/Common/GNUmakefile b/ZideStore/UI-X/Common/GNUmakefile index 916326f9..0fda272f 100644 --- a/ZideStore/UI-X/Common/GNUmakefile +++ b/ZideStore/UI-X/Common/GNUmakefile @@ -15,16 +15,16 @@ LIBRARY_NAME = libZideStoreCommonUI libZideStoreCommonUI_HEADER_FILES_DIR = . libZideStoreCommonUI_HEADER_FILES_INSTALL_DIR = $(ZIDESTORE)/Common -libZideStoreCommonUI_HEADER_FILES = \ +libZideStoreCommonUI_HEADER_FILES += \ UIxComponent.h \ -libZideStoreCommonUI_OBJC_FILES = \ +libZideStoreCommonUI_OBJC_FILES += \ UIxComponent.m \ CommonUI_PRINCIPAL_CLASS = CommonUIProduct -CommonUI_OBJC_FILES = \ +CommonUI_OBJC_FILES += \ CommonUIProduct.m \ UIxPageFrame.m \ UIxAppFrame.m \ diff --git a/dbd/DTable.m b/dbd/DTable.m index a45f6ce5..bdd78a95 100644 --- a/dbd/DTable.m +++ b/dbd/DTable.m @@ -7,6 +7,7 @@ @interface DTable : SoComponent { EOAdaptorChannel *channel; + NSArray *attributes; NSArray *columnNames; id item; } @@ -23,6 +24,7 @@ [self->channel closeChannel]; [self->channel release]; + [self->attributes release]; [self->columnNames release]; [self->item release]; [super dealloc]; @@ -75,20 +77,27 @@ return self->item; } -- (NSArray *)columnNames { +- (NSArray *)attributes { EOModel *model; - NSArray *attributes; + + if (self->attributes) + return self->attributes; + model = [self _describeModel]; + self->attributes = [[[[model entities] lastObject] attributes] retain]; + return self->attributes; +} +- (NSArray *)columnNames { if (self->columnNames) return self->columnNames; - model = [self _describeModel]; - attributes = [[[model entities] lastObject] attributes]; - - self->columnNames = [[attributes valueForKey:@"columnName"] copy]; + self->columnNames = [[[self attributes] valueForKey:@"columnName"] copy]; return self->columnNames; } +- (NSString *)columnLink { + return [[[self item] columnName] stringByAppendingString:@"/"]; +} - (NSString *)itemSlashLink { // this suxx, a) we need to write code, b) we need to attach the / manually return [[self item] stringByAppendingString:@"/"]; diff --git a/dbd/DTable.wox b/dbd/DTable.wox index eb3ce5ff..a15423fb 100644 --- a/dbd/DTable.wox +++ b/dbd/DTable.wox @@ -11,8 +11,14 @@ DB:
Table:

Columns

- -
  • -
    + + + + + + + +
    -- 2.39.5