OCSFolderType.m \
OCSChannelManager.m \
-libOGoContentStore_LIBRARY_DEPENDS_UPON += -lGDLAccess
-
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
-include GNUmakefile.postamble
NSURL *folderInfoLocation;
}
++ (id)defaultFolderManager;
- (id)initWithFolderInfoLocation:(NSURL *)_url;
/* accessors */
@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;
}
- field 'value' (eg array values for participants?)
- BLOB archiver/unarchiver
+Defaults
+========
+
+ OCSFolderInfoURL - the DB URL where the folder-info table is located
+
BLOB Formats
============
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 \
@interface DTable : SoComponent
{
EOAdaptorChannel *channel;
+ NSArray *attributes;
NSArray *columnNames;
id item;
}
[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:@"/"];
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>