]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@60 d1b88da0-ebda-0310-925b-ed51d8...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 23 Jun 2004 13:32:21 +0000 (13:32 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 23 Jun 2004 13:32:21 +0000 (13:32 +0000)
OGoContentStore/GNUmakefile
OGoContentStore/OCSFolderManager.h
OGoContentStore/OCSFolderManager.m
OGoContentStore/README
ZideStore/UI-X/Common/GNUmakefile
dbd/DTable.m
dbd/DTable.wox

index ef9bc9da6e381be69d381c4a2c3b9362b23fc67a..348e1aecc0062584ec5285e4b9d61ecf1f164e5d 100644 (file)
@@ -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
index ee7fed1d9233d4d3e9dd344644f4a4d237b24e7e..90efca46dacf67f516841acbbaa0a690c711f2eb 100644 (file)
@@ -39,6 +39,7 @@
   NSURL *folderInfoLocation;
 }
 
++ (id)defaultFolderManager;
 - (id)initWithFolderInfoLocation:(NSURL *)_url;
 
 /* accessors */
index e0637e88e34d861e6f6fe764c32cfbfd781c2a0f..8aeb19fabcc42cbb62eacf1bd3ebb9155675e57d 100644 (file)
 
 @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;
   }
index edfa572c98efd76345fe3ac6ae2bdabbfd5c57d7..c5c468c231d7397540adf7d0433707df9b5d5db2 100644 (file)
@@ -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
 ============
 
index 916326f94a6d822caf37f96ba36bdfa206d4c624..0fda272fc23945188625417bf1c7281e706e80f0 100644 (file)
@@ -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           \
index a45f6ce5c04741f46d749fd4bba21649b36673c1..bdd78a955c4821d11990c026cab09807861d0d1e 100644 (file)
@@ -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];
   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:@"/"];
index eb3ce5fff8b268740e5e446a256b236257f31a12..a15423fb91682e1ae1732b1cfe371690fa675a91 100644 (file)
@@ -11,8 +11,14 @@ DB:    <a href=".."><var:string value="clientObject.databaseName"/></a><br />
 Table: <var:string value="clientObject.tableName"/><br />
 
 <h4>Columns</h4>
-<var:foreach list="columnNames" item="item">
-  <li><a var:href="itemSlashLink"><var:string value="item" /></a></li>
-</var:foreach>
+<table>
+  <var:foreach list="attributes" item="item">
+    <tr>
+      <td><a var:href="columnLink"
+            ><var:string value="item.columnName" /></a></td>
+      <td><var:string value="item.externalType" /></td>
+    </tr>
+  </var:foreach>
+</table>
 
 </var:component>