]> err.no Git - sope/commitdiff
added WODefaultResourceManager default to specify the classname of the
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 17 Feb 2005 14:48:43 +0000 (14:48 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 17 Feb 2005 14:48:43 +0000 (14:48 +0000)
resource manager being used

git-svn-id: http://svn.opengroupware.org/SOPE/trunk@565 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/Defaults.plist
sope-appserver/NGObjWeb/Version
sope-appserver/NGObjWeb/WOApplication.m

index e17de4cb23d7b25f71b9e5315240792690c2cbe8..f39f03e0b16bcccb92ecc784d9335e2c534c3487 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-17  Helge Hess  <helge.hess@skyrix.com>
+
+       * WOApplication.m: the resource manager class to be used for a SOPE
+         application can now be choosen using the 'WODefaultResourceManager'
+         default (defaults to WOResourceManager) (v4.5.116)
+
 2005-02-14  Helge Hess  <helge.hess@opengroupware.org>
 
        * SoObjects/SoObjectRequestHandler.m: added a safety limit on the URL
index 1b236d5a40d6dbb8013c5df9c3764e768676884c..c303f68b3d4cfb8504733a060cd0623f37a67af3 100644 (file)
@@ -35,6 +35,7 @@
   WODebugTakeValues                    = NO;
   WODebugZipResponse                    = NO;
   WODebuggingEnabled                    = NO;
+  WODefaultResourceManager              = "WOResourceManager";
   WODefaultSessionTimeOut               = 3600;
   WODefaultLanguages = ( 
     English, 
index 1ad5ef21a7f22f8c02357ba5cfaf4ef4c8432d4a..06ed44f42ecc461f5b1ade1fea266bfb73862ed4 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=114
+SUBMINOR_VERSION:=116
 
 # v4.5.91  requires libNGExtensions v4.5.134
 # v4.5.84  requires libNGExtensions v4.5.127
index 86206f3a0ac7c94dbc633cb80f60e7fc9a95f940..61bca098e6b568ff7d5e1c764de345286f7b91f2 100644 (file)
@@ -818,23 +818,38 @@ static NSString *defaultCompRqHandlerClassName = @"WOComponentRequestHandler";
 
 /* resources */
 
+- (void)_setupDefaultResourceManager {
+  NSUserDefaults *ud;
+  Class    rmClass;
+  NSString *p;
+  
+  ud = [NSUserDefaults standardUserDefaults];
+  p  = [ud stringForKey:@"WODefaultResourceManager"];
+  rmClass = ([p length] == 0)
+    ? [WOResourceManager class]
+    : NSClassFromString(p);
+  
+  if (rmClass == Nil) {
+    [self errorWithFormat:
+            @"failed to locate class of resource manager: '%@'", p];
+    return;
+  }
+  
+  if ([rmClass instancesRespondToSelector:@selector(initWithPath:)])
+    self->resourceManager = [[rmClass alloc] init];
+  else {
+    self->resourceManager = 
+      [(WOResourceManager *)[rmClass alloc] initWithPath:[self path]];
+  }
+}
+
 - (void)setResourceManager:(WOResourceManager *)_manager {
   ASSIGN(self->resourceManager, _manager);
 }
 - (WOResourceManager *)resourceManager {
-  if (self->resourceManager == nil) {
-    NSString *p;
-
-#if 0 && DEBUG
-    if ([(p = [self path]) length] > 0)
-      [self debugWithFormat:@"setup WOResourceManager at path '%@' ...", p];
-#else
-    p = [self path];
-#endif
-    
-    self->resourceManager = 
-      [(WOResourceManager *)[WOResourceManager alloc] initWithPath:p];
-  }
+  if (self->resourceManager == nil)
+    [self _setupDefaultResourceManager];
+  
   return self->resourceManager;
 }