From: helge Date: Wed, 13 Jul 2005 09:53:32 +0000 (+0000) Subject: changed not to use beautified attribute names X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c3e205c920544ba9e935e79e4462eea2aecfd11;p=sope changed not to use beautified attribute names git-svn-id: http://svn.opengroupware.org/SOPE/trunk@889 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-gdl1/GDLContentStore/ChangeLog b/sope-gdl1/GDLContentStore/ChangeLog index a043ae60..36616725 100644 --- a/sope-gdl1/GDLContentStore/ChangeLog +++ b/sope-gdl1/GDLContentStore/ChangeLog @@ -1,3 +1,9 @@ +2005-07-13 Helge Hess + + * GCSFolderManager.m, GCSFolder.m: changed not to use EOF + attribute-name 'beautification', eg 'c_name' will stay 'c_name' + instead of being transformed into 'cName' (v4.5.30) + 2005-07-11 Helge Hess * GCSFolderManager.m: added automatic discovery of folder types by diff --git a/sope-gdl1/GDLContentStore/GCSFolder.h b/sope-gdl1/GDLContentStore/GCSFolder.h index f4b66bf9..243b263f 100644 --- a/sope-gdl1/GDLContentStore/GCSFolder.h +++ b/sope-gdl1/GDLContentStore/GCSFolder.h @@ -24,6 +24,20 @@ #import +/* + GCSFolder + + TODO: document + + Fixed Quick-Table SQL fields: + - "c_name" (name of the file in the folder) + + Fixed BLOB-Table SQL fields: + - "c_name" (name of the file in the folder) + - "c_content" (content of the file in the folder) + - "c_version" (update revision of the file in the folder) +*/ + @class NSString, NSURL, NSNumber, NSArray, NSException, NSMutableString; @class NSDictionary; @class EOQualifier, EOFetchSpecification; diff --git a/sope-gdl1/GDLContentStore/GCSFolder.m b/sope-gdl1/GDLContentStore/GCSFolder.m index c74ef160..ec6f1592 100644 --- a/sope-gdl1/GDLContentStore/GCSFolder.m +++ b/sope-gdl1/GDLContentStore/GCSFolder.m @@ -50,7 +50,7 @@ static GCSStringFormatter *stringFormatter = nil; NSStringClass = [NSString class]; NSNumberClass = [NSNumber class]; NSCalendarDateClass = [NSCalendarDate class]; - + stringFormatter = [GCSStringFormatter sharedFormatter]; } @@ -176,9 +176,7 @@ static GCSStringFormatter *stringFormatter = nil; recursive:YES]; } -- (id)_fetchValueOfColumn:(NSString *)_col attributeName:(NSString *)_attrName - inContentWithName:(NSString *)_name -{ +- (id)_fetchValueOfColumn:(NSString *)_col inContentWithName:(NSString *)_name{ EOAdaptorChannel *channel; NSException *error; NSDictionary *row; @@ -214,9 +212,9 @@ static GCSStringFormatter *stringFormatter = nil; /* fetch results */ result = nil; - attrs = [channel describeResults]; + attrs = [channel describeResults:NO /* do not beautify names */]; if ((row = [channel fetchAttributes:attrs withZone:NULL]) != nil) { - result = [[[row objectForKey:_attrName] copy] autorelease]; + result = [[[row objectForKey:_col] copy] autorelease]; if (![result isNotNull]) result = nil; [channel cancelFetch]; } @@ -228,13 +226,11 @@ static GCSStringFormatter *stringFormatter = nil; } - (NSNumber *)versionOfContentWithName:(NSString *)_name { - return [self _fetchValueOfColumn:@"c_version" attributeName:@"cVersion" - inContentWithName:_name]; + return [self _fetchValueOfColumn:@"c_version" inContentWithName:_name]; } - (NSString *)fetchContentWithName:(NSString *)_name { - return [self _fetchValueOfColumn:@"c_content" attributeName:@"cContent" - inContentWithName:_name]; + return [self _fetchValueOfColumn:@"c_content" inContentWithName:_name]; } - (NSDictionary *)fetchContentsOfAllFiles { @@ -272,19 +268,19 @@ static GCSStringFormatter *stringFormatter = nil; /* fetch results */ result = [NSMutableDictionary dictionaryWithCapacity:128]; - attrs = [channel describeResults]; + attrs = [channel describeResults:NO /* do not beautify names */]; while ((row = [channel fetchAttributes:attrs withZone:NULL]) != nil) { NSString *cName, *cContent; - - cName = [row objectForKey:@"cName"]; - cContent = [row objectForKey:@"cContent"]; + + cName = [row objectForKey:@"c_name"]; + cContent = [row objectForKey:@"c_content"]; if (![cName isNotNull]) { - [self logWithFormat:@"ERROR: missing cName in row: %@", row]; + [self logWithFormat:@"ERROR: missing c_name in row: %@", row]; continue; } if (![cContent isNotNull]) { - [self logWithFormat:@"ERROR: missing cContent in row: %@", row]; + [self logWithFormat:@"ERROR: missing c_content in row: %@", row]; continue; } @@ -728,11 +724,11 @@ static GCSStringFormatter *stringFormatter = nil; [self releaseChannel:channel]; return nil; } - + /* fetch results */ results = [NSMutableArray arrayWithCapacity:64]; - attrs = [channel describeResults]; + attrs = [channel describeResults:NO /* do not beautify names */]; while ((row = [channel fetchAttributes:attrs withZone:NULL]) != nil) [results addObject:row]; diff --git a/sope-gdl1/GDLContentStore/GCSFolderManager.m b/sope-gdl1/GDLContentStore/GCSFolderManager.m index 630c05cd..53a56b33 100644 --- a/sope-gdl1/GDLContentStore/GCSFolderManager.m +++ b/sope-gdl1/GDLContentStore/GCSFolderManager.m @@ -52,9 +52,9 @@ static NSArray *emptyArray = nil; #if 0 static NSString *GCSPathColumnName = @"c_path"; static NSString *GCSTypeColumnName = @"c_folder_type"; -static NSString *GCSTypeRecordName = @"cFolderType"; +static NSString *GCSTypeRecordName = @"c_folder_type"; #endif -static NSString *GCSPathRecordName = @"cPath"; +static NSString *GCSPathRecordName = @"c_path"; static NSString *GCSGenericFolderTypeName = @"Container"; static const char *GCSPathColumnPattern = "c_path%i"; @@ -213,7 +213,7 @@ static const char *GCSPathColumnPattern = "c_path%i"; /* fetch results */ - attrs = [channel describeResults]; + attrs = [channel describeResults:NO /* do not beautify names */]; rows = [NSMutableArray arrayWithCapacity:16]; while ((row = [channel fetchAttributes:attrs withZone:NULL]) != nil) [rows addObject:row]; @@ -233,7 +233,7 @@ static const char *GCSPathColumnPattern = "c_path%i"; if (_record == nil) return nil; - folderTypeName = [_record objectForKey:@"cFolderType"]; + folderTypeName = [_record objectForKey:@"c_folder_type"]; if (![folderTypeName isNotNull]) { [self logWithFormat:@"ERROR(%s): missing type in folder: %@", __PRETTY_FUNCTION__, _record]; @@ -243,15 +243,15 @@ static const char *GCSPathColumnPattern = "c_path%i"; [self logWithFormat: @"ERROR(%s): could not resolve type '%@' of folder: %@", __PRETTY_FUNCTION__, - folderTypeName, [_record valueForKey:@"cPath"]]; + folderTypeName, [_record valueForKey:@"c_path"]]; return nil; } - folderId = [_record objectForKey:@"cFolderId"]; - folderName = [_record objectForKey:@"cPath"]; + folderId = [_record objectForKey:@"c_folder_id"]; + folderName = [_record objectForKey:@"c_path"]; path = [self pathFromInternalName:folderName]; - locationString = [_record objectForKey:@"cLocation"]; + locationString = [_record objectForKey:@"c_location"]; location = [locationString isNotNull] ? [NSURL URLWithString:locationString] : nil; @@ -261,7 +261,7 @@ static const char *GCSPathColumnPattern = "c_path%i"; return nil; } - locationString = [_record objectForKey:@"cQuickLocation"]; + locationString = [_record objectForKey:@"c_quick_location"]; quickLocation = [locationString isNotNull] ? [NSURL URLWithString:locationString] : nil; diff --git a/sope-gdl1/GDLContentStore/Version b/sope-gdl1/GDLContentStore/Version index 024088a4..0d34fc44 100644 --- a/sope-gdl1/GDLContentStore/Version +++ b/sope-gdl1/GDLContentStore/Version @@ -2,7 +2,7 @@ MAJOR_VERSION:=4 MINOR_VERSION:=5 -SUBMINOR_VERSION:=29 +SUBMINOR_VERSION:=30 # v4.5.29 requires libNGExtensions v4.5.161 # v4.5.26 does not require libNGiCal anymore