+2005-07-13 Helge Hess <helge.hess@opengroupware.org>
+
+ * 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 <helge.hess@opengroupware.org>
* GCSFolderManager.m: added automatic discovery of folder types by
#import <Foundation/NSObject.h>
+/*
+ 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;
NSStringClass = [NSString class];
NSNumberClass = [NSNumber class];
NSCalendarDateClass = [NSCalendarDate class];
-
+
stringFormatter = [GCSStringFormatter sharedFormatter];
}
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;
/* 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];
}
}
- (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 {
/* 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;
}
[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];
#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";
/* 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];
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];
[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;
return nil;
}
- locationString = [_record objectForKey:@"cQuickLocation"];
+ locationString = [_record objectForKey:@"c_quick_location"];
quickLocation = [locationString isNotNull]
? [NSURL URLWithString:locationString]
: nil;
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