]> err.no Git - sope/commitdiff
improved support for using custom components
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sun, 31 Dec 2006 17:00:53 +0000 (17:00 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sun, 31 Dec 2006 17:00:53 +0000 (17:00 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1396 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/SoOFS/ChangeLog
sope-appserver/SoOFS/OFSResourceManager.m
sope-appserver/SoOFS/SoOFS.xcodeproj/project.pbxproj
sope-appserver/SoOFS/Version
sope-appserver/SoOFS/sope.m

index 91e6e38be501cb59e22964d764587194586056d8..9862421c5c383ee7a5f5a538f2212276305e7e0b 100644 (file)
@@ -1,3 +1,14 @@
+2006-12-31  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v4.5.25
+       
+       * OFSResourceManager.m: try to locate component class in runtime,
+         according to the name of the template. If that cannot be found,
+         fall back to WOComponent.
+
+       * sope.m: accept --bundle <path> commandline parameters for loading
+         custom classes, i.e. custom component classes.
+
 2006-12-30  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * OFSResourceManager.m: assign self as resourceManager to components
index 2b22cbbb1bd22237fb44183cab21bbb3f62934bf..ea5cfaea76464eb3a0e517bd65165699f924c08a 100644 (file)
@@ -142,11 +142,24 @@ static BOOL debugOn = NO;
   languages:(NSArray *)_languages
 {
   WOComponentDefinition *cdef;
-  
+  NSRange               r;
+  NSString              *name;
+  Class                 cClass;
+
   cdef = [super definitionForComponent:_name
                inFramework:_framework
                languages:_languages];
-  [cdef setComponentClass:NSClassFromString(@"WOComponent")];
+  r = [_name rangeOfString:@"."];
+  if (r.length > 0)
+    name = [_name substringToIndex:r.location];
+  else 
+    name = _name;
+  
+  cClass = NSClassFromString(name);
+  if (cClass == Nil)
+    cClass = NSClassFromString(@"WOComponent");
+
+  [cdef setComponentClass:cClass];
   return cdef;
 }
 
index 1eac9080a6df9396373cac145e49e48201048c60..d5e12fb077f37ac9192606c40f97661e940610a8 100644 (file)
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.24;
+                               DYLIB_CURRENT_VERSION = 4.5.25;
                                FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
                                FRAMEWORK_VERSION = A;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
                                DEPLOYMENT_POSTPROCESSING = YES;
                                DSTROOT = /;
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.24;
+                               DYLIB_CURRENT_VERSION = 4.5.25;
                                DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
                                FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
                                FRAMEWORK_VERSION = A;
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.24;
+                               DYLIB_CURRENT_VERSION = 4.5.25;
                                FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
                                FRAMEWORK_VERSION = A;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
index c68bd2a4313636ed5afbe0a72201f7777a442546..cd99f93887749d03525c28cae2424cb2211e78d7 100644 (file)
@@ -1,5 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=24
+SUBMINOR_VERSION:=25
 
 # v4.5.23 requires libNGObjWeb v4.5.263
index ba559bf37c397ec55aec826f1700d02287474af7..70ce2200be0e5d35f5e4044e53f103d43d02e2aa 100644 (file)
@@ -233,12 +233,43 @@ static BOOL debugRootObject = NO;
 
 int main(int argc, char **argv, char **env) {
   NSAutoreleasePool *pool;
-  
+  NSEnumerator      *args;
+  NSString          *arg;
+  id                self;
+
   pool = [[NSAutoreleasePool alloc] init];
 #if LIB_FOUNDATION_LIBRARY
   [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
 #endif
-  
+
+  self = pool;
+  args = [[[NSProcessInfo processInfo] arguments] objectEnumerator];
+  [args nextObject];
+
+  while ((arg = [args nextObject]) != nil) {
+    if ([arg isEqualToString:@"--bundle"]) {
+      NSString *path = [args nextObject];
+      if (path != nil) {
+        NSBundle *bundle;
+        bundle = [NSBundle bundleWithPath:path];
+        if (!bundle) {
+          [self errorWithFormat:@"No loadable bundle at path: '%@'!", path];
+          exit(1);
+        }
+        [bundle load];
+      }
+      else {
+        [self errorWithFormat:@"Missing path for --bundle argument!"];
+        exit(1);
+      }
+    }
+#if 0
+    else {
+      [self errorWithFormat:@"Unknown argument: '%@', skipping.", arg];
+    }
+#endif
+  }
+
   WOWatchDogApplicationMain(@"SOPE", argc, (void*)argv);
   
   [pool release];