3 #include <NGObjWeb/SoComponent.h>
5 @class EOAdaptorChannel;
7 @interface DDatabaseManager : SoComponent
9 EOAdaptorChannel *channel;
10 NSArray *databaseNames;
17 #include "DSoDatabaseManager.h"
20 @interface EOAdaptorChannel(ModelFetching)
21 - (NSArray *)describeDatabaseNames;
24 @implementation DDatabaseManager
27 if ([self->channel isOpen])
28 [self->channel closeChannel];
29 [self->channel release];
31 [self->databaseNames release];
39 if ([self->channel isOpen])
40 [self->channel closeChannel];
47 - (EOAdaptor *)adaptor {
48 return [[(DSoDatabaseManager *)[self clientObject]
49 host] adaptorInContext:[self context]];
52 - (EOAdaptorChannel *)channel {
53 EOAdaptorContext *ctx;
58 ctx = [[self adaptor] createAdaptorContext];
59 self->channel = [[ctx createAdaptorChannel] retain];
60 if (![self->channel openChannel]) {
61 [self->channel release];
70 - (void)setItem:(id)_item {
71 ASSIGN(self->item, _item);
77 - (NSArray *)databaseNames {
78 if (self->databaseNames == nil)
79 self->databaseNames = [[[self channel] describeDatabaseNames] copy];
80 return self->databaseNames;
83 - (NSString *)dbLink {
84 // this suxx, a) we need to write code, b) we need to attach the / manually
85 return [[self item] stringByAppendingString:@"/"];
88 @end /* DDatabaseManager */