]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@73 d1b88da0-ebda-0310-925b-ed51d8...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 29 Jun 2004 10:41:53 +0000 (10:41 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 29 Jun 2004 10:41:53 +0000 (10:41 +0000)
OGoContentStore/OCSFolder.h
OGoContentStore/OCSFolder.m
OGoContentStore/OCSFolderManager.m
OGoContentStore/sql/folderinfo.psql

index 18b0219f294b709f0a12faea3a1d04c861d89e9f..2d74c5e436d9f183339dc15925d0135a3371b3f7 100644 (file)
   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 */
index 511993710e994ba64c910148d3e78b7afdc5ee5e..373b127d731c8984747406fa15e2998e37d329f5 100644 (file)
@@ -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])) {
     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 */
index 0e2c6838e49bfaa8c744ad3f72f4b6c782a27db6..6e9e408a0686d9b31518f2dd60fa4490687b8a0e 100644 (file)
@@ -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];
 }
 
index faaf88898a7a543fd2c6a0ed43b0d81f659d9ea6..d6eb20479e2a0f82256a07cbb127c8b9413b6a28 100644 (file)
@@ -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' );