From e0f65f555e8215905a365b0b8647878c80977cb3 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 29 Jun 2004 10:41:53 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@73 d1b88da0-ebda-0310-925b-ed51d893ca5b --- OGoContentStore/OCSFolder.h | 5 ++-- OGoContentStore/OCSFolder.m | 13 ++++++---- OGoContentStore/OCSFolderManager.m | 10 ++++++-- OGoContentStore/sql/folderinfo.psql | 39 +++++++++++++++++------------ 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/OGoContentStore/OCSFolder.h b/OGoContentStore/OCSFolder.h index 18b0219f..2d74c5e4 100644 --- a/OGoContentStore/OCSFolder.h +++ b/OGoContentStore/OCSFolder.h @@ -37,12 +37,13 @@ NSString *folderName; NSString *path; NSURL *location; - NSString *folderType; + NSURL *quickLocation; + NSString *folderTypeName; } - (id)initWithPath:(NSString *)_path primaryKey:(id)_folderId folderTypeName:(NSString *)_ftname folderType:(OCSFolderType *)_ftype - location:(NSURL *)_loc + location:(NSURL *)_loc quickLocation:(NSURL *)_qloc folderManager:(OCSFolderManager *)_fm; /* accessors */ diff --git a/OGoContentStore/OCSFolder.m b/OGoContentStore/OCSFolder.m index 51199371..373b127d 100644 --- a/OGoContentStore/OCSFolder.m +++ b/OGoContentStore/OCSFolder.m @@ -29,7 +29,7 @@ - (id)initWithPath:(NSString *)_path primaryKey:(id)_folderId folderTypeName:(NSString *)_ftname folderType:(OCSFolderType *)_ftype - location:(NSURL *)_loc + location:(NSURL *)_loc quickLocation:(NSURL *)_qloc folderManager:(OCSFolderManager *)_fm { if ((self = [super init])) { @@ -40,14 +40,16 @@ self->folderName = [[_path lastPathComponent] copy]; self->path = [_path copy]; self->location = [_loc retain]; - self->folderType = [_ftname copy]; + self->quickLocation = [_qloc retain]; + self->folderTypeName = [_ftname copy]; } return self; } - (id)init { return [self initWithPath:nil primaryKey:nil folderTypeName:nil folderType:nil - location:nil folderManager:nil]; + location:nil quickLocation:nil + folderManager:nil]; } - (void)dealloc { @@ -57,7 +59,8 @@ [self->folderName release]; [self->path release]; [self->location release]; - [self->folderType release]; + [self->quickLocation release]; + [self->folderTypeName release]; [super dealloc]; } @@ -79,7 +82,7 @@ } - (NSString *)folderTypeName { - return self->folderType; + return self->folderTypeName; } /* description */ diff --git a/OGoContentStore/OCSFolderManager.m b/OGoContentStore/OCSFolderManager.m index 0e2c6838..6e9e408a 100644 --- a/OGoContentStore/OCSFolderManager.m +++ b/OGoContentStore/OCSFolderManager.m @@ -211,7 +211,7 @@ static const char *OCSPathColumnPattern = "c_path%i"; OCSFolderType *folderType; NSString *folderTypeName, *locationString, *folderName, *path; NSNumber *folderId; - NSURL *location; + NSURL *location, *quickLocation; if (_record == nil) return nil; @@ -235,11 +235,17 @@ static const char *OCSPathColumnPattern = "c_path%i"; __PRETTY_FUNCTION__, _record]; return nil; } + + locationString = [_record objectForKey:@"cLocation"]; + quickLocation = [locationString isNotNull] + ? [NSURL URLWithString:locationString] + : nil; folder = [[OCSFolder alloc] initWithPath:path primaryKey:folderId folderTypeName:folderTypeName folderType:folderType - location:location folderManager:self]; + location:location quickLocation:quickLocation + folderManager:self]; return [folder autorelease]; } diff --git a/OGoContentStore/sql/folderinfo.psql b/OGoContentStore/sql/folderinfo.psql index faaf8889..d6eb2047 100644 --- a/OGoContentStore/sql/folderinfo.psql +++ b/OGoContentStore/sql/folderinfo.psql @@ -14,43 +14,48 @@ CREATE TABLE SOGo_folder_info ( DEFAULT nextval('SOGo_folder_info_seq') NOT NULL PRIMARY KEY, -- the primary key - c_path VARCHAR(255) NOT NULL, -- the full path to the folder - c_path1 VARCHAR(255) NOT NULL, -- individual parts (for fast queries) - c_path2 VARCHAR(255) NULL, -- individual parts (for fast queries) - c_path3 VARCHAR(255) NULL, -- individual parts (for fast queries) - c_path4 VARCHAR(255) NULL, -- individual parts (for fast queries) - c_foldername VARCHAR(255) NOT NULL, -- last path component - c_location VARCHAR(2048) NOT NULL, -- URL to database of the folder - c_folder_type VARCHAR(255) NOT NULL -- the folder type ... + c_path VARCHAR(255) NOT NULL, -- the full path to the folder + c_path1 VARCHAR(255) NOT NULL, -- parts (for fast queries) + c_path2 VARCHAR(255) NULL, -- parts (for fast queries) + c_path3 VARCHAR(255) NULL, -- parts (for fast queries) + c_path4 VARCHAR(255) NULL, -- parts (for fast queries) + c_foldername VARCHAR(255) NOT NULL, -- last path component + c_location VARCHAR(2048) NOT NULL, -- URL to folder + c_quick_location VARCHAR(2048) NULL, -- URL to quicktable of folder + c_folder_type VARCHAR(255) NOT NULL -- the folder type ... ); INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_folder_type ) + c_location, c_quick_location, c_folder_type ) VALUES ( '/Users', 'Users', NULL, NULL, NULL, - 'Calendar', - 'http://OGo:OGo@localhost/test', 'Container' ); + 'Users', + 'http://OGo:OGo@localhost/test/SOGo_user_folder', + 'http://OGo:OGo@localhost/test/SOGo_user_folder_quick', + 'Container' ); INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_folder_type ) + c_location, c_quick_location, c_folder_type ) VALUES ( '/Users/helge', 'Users', 'helge', NULL, NULL, - 'Calendar', - 'http://OGo:OGo@localhost/test', 'Container' ); + 'helge', + 'http://OGo:OGo@localhost/test/SOGo_user_folder', + 'http://OGo:OGo@localhost/test/SOGo_user_folder_quick', + 'Container' ); INSERT INTO SOGo_folder_info ( c_path, c_path1, c_path2, c_path3, c_path4, c_foldername, - c_location, c_folder_type ) + c_location, c_quick_location, c_folder_type ) VALUES ( '/Users/helge/Calendar', 'Users', @@ -58,4 +63,6 @@ VALUES 'Calendar', NULL, 'Calendar', - 'http://OGo:OGo@localhost/test', 'Appointment' ); + 'http://OGo:OGo@localhost/test/SOGo_helge_privcal', + 'http://OGo:OGo@localhost/test/SOGo_helge_privcal_quick', + 'Appointment' ); -- 2.39.5