]> err.no Git - sope/commitdiff
minor fixes
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 13 Nov 2004 16:20:34 +0000 (16:20 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 13 Nov 2004 16:20:34 +0000 (16:20 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@370 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/Version
sope-appserver/NGObjWeb/WOApplication.m
sope-core/NGExtensions/ChangeLog
sope-core/NGExtensions/NGBundleManager.m
sope-core/NGExtensions/NGExtensions/NSObject+ExtendedLogging.h
sope-core/NGExtensions/Version

index 29d273168f14acdd8f268e157754d0d1674fda8a..14bb58ea0b93bf179125742313f1b0a98603df96 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-13  Helge Hess  <helge.hess@opengroupware.org>
+
+       * WOApplication.m: changed wrapper-missing-log from warn to debug
+         (v4.5.86)
+
 2004-11-13  Helge Hess  <helge@groove.local>
 
        * WOApplication.m, WOCoreApplication.m: do not use deprecated logger
index 6049a6b8e007ca5f943d22d058272a4a8c84ec1b..9b30ff55b4d71eac9775ab7ba1bdb816827982cd 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=85
+SUBMINOR_VERSION:=86
 
 # v4.5.84  required libNGExtensions v4.5.127
 # v4.3.42  requires libNGExtensions v4.3.116
index 8677483494a5c675d218b8bf5f886acb98600174..7dafabd1ff1f2ddad4bb622967e585394d57afd1 100644 (file)
@@ -359,10 +359,12 @@ static NSString *rapidTurnAroundPath = nil;
 }
 - (NSString *)path {
   static BOOL missingPath = NO;
-  if (missingPath) return nil;
+  if (missingPath)
+    return nil;
+  
   if (self->path == nil) {
     if ((self->path = [[self _lookupAppPath] copy]) == nil) {
-      [self logWarnWithFormat:@"could not find wrapper of application !"];
+      [self logDebugWithFormat:@"could not find wrapper of application !"];
       missingPath = YES;
       return nil;
     }
index 901c9b842ed682a3506108c580ff1c56eac84872..8557cd20f55109ea34356dc047a5ad66a29e00e2 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-13  Helge Hess  <helge.hess@opengroupware.org>
+
+       * NGBundleManager.m: some code cleanups (v4.5.129)
+
 2004-11-12  Helge Hess  <helge.hess@opengroupware.org>
 
        * NGLogging: code cleanup (v4.5.128)
index 2f7066dd5a76b12bfcbd048aa9e82f1c5efd9df8..f4774237c944b6d810ba823a260460a5398f44ef 100644 (file)
@@ -1159,83 +1159,100 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info
   NSFileManager  *fm;
   NSEnumerator   *e;
   NSString       *path;
+
+  if (debugOn) {
+    NSLog(@"BM LOOKUP pathes (%d bundles loaded): %@ / %@", 
+          NSCountMapTable(self->loadedBundles), _resourceName, _type);
+  }
   
   fm     = [NSFileManager defaultManager];
   result = [NSMutableArray arrayWithCapacity:64];
   
+  // TODO: look in loaded bundles
+  
+  /* check physical pathes */
+  
   e = [self->bundleSearchPaths objectEnumerator];
-  while ((path = [e nextObject])) {
-    BOOL isDir = NO;
+  while ((path = [e nextObject]) != nil) {
+    NSEnumerator *dir;
+    BOOL     isDir = NO;
+    NSString *tmp, *bundleDirPath;
+    id       info = nil;
     
-    if ([fm fileExistsAtPath:path isDirectory:&isDir]) {
-      NSString *tmp;
-      id info = nil;
-      if (!isDir) continue;
-
-      /* check whether an appropriate bundle is contained in 'path' */
-      {
-        NSEnumerator *dir;
-
-        dir = [[fm directoryContentsAtPath:path] objectEnumerator];
-        while ((tmp = [dir nextObject])) {
-          NSDictionary *bundleInfo      = nil;
-          NSEnumerator *providedResources = nil;
-          NSString *infoPath;
-          id info;
+    if (![fm fileExistsAtPath:path isDirectory:&isDir])
+      continue;
+      
+    if (!isDir) continue;
+      
+    /* check whether an appropriate bundle is contained in 'path' */
+       
+    dir = [[fm directoryContentsAtPath:path] objectEnumerator];
+    while ((bundleDirPath = [dir nextObject]) != nil) {
+      NSDictionary *bundleInfo      = nil;
+      NSEnumerator *providedResources = nil;
+      NSString     *infoPath;
+      id           info;
           
-          tmp = [path stringByAppendingPathComponent:tmp];
-          infoPath = [self makeBundleInfoPath:tmp];
-
-          if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath)) == nil) {
-            if (![fm fileExistsAtPath:infoPath])
-              continue;
-
-            bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath];
-          }
-
-          providedResources = 
-            [[(NSDictionary *)[bundleInfo objectForKey:@"provides"]
-                                          objectForKey:_type]
-                                          objectEnumerator];
-          if (providedResources == nil) continue;
+      bundleDirPath = [path stringByAppendingPathComponent:bundleDirPath];
+      infoPath = [self makeBundleInfoPath:bundleDirPath];
+         
+      // TODO: can we use _doesBundleInfo:path:providedResource:... ?
+      if ((bundleInfo = NSMapGet(self->pathToBundleInfo, infoPath))==nil) {
+       if (![fm fileExistsAtPath:infoPath])
+         continue;
 
-          // scan provide array
-          while ((info = [providedResources nextObject])) {
-            NSString *name;
+       bundleInfo = [self _loadBundleInfoAtExistingPath:infoPath];
+      }
+      
+      providedResources = 
+       [[(NSDictionary *)[bundleInfo objectForKey:@"provides"]
+                                     objectForKey:_type]
+                                     objectEnumerator];
+      if (providedResources == nil) continue;
+      
+      /* scan 'provides' array */
+      while ((info = [providedResources nextObject])) {
+       NSString *name;
             
-            name = [[(NSDictionary *)info objectForKey:@"name"] stringValue];
-            if (name == nil) continue;
-
-            if (_resourceName) {
-              if (![name isEqualToString:_resourceName])
-                continue;
-            }
-            if (_selector) {
-              if (!_selector(name, _type, tmp, info, self, _context))
-                continue;
-            }
-
-            [result addObject:tmp];
-            break;
-          }
-        }
+       name = [[(NSDictionary *)info objectForKey:@"name"] stringValue];
+       if (name == nil) continue;
+       
+       if (_resourceName != nil) {
+         if (![name isEqualToString:_resourceName])
+           continue;
+       }
+       if (_selector != NULL) {
+         if (!_selector(name, _type, bundleDirPath, info, self, _context))
+           continue;
+       }
+
+       [result addObject:bundleDirPath];
+       break;
       }
+    }
+    
+    /* check for direct match (NGBundlePath element is a bundle) */
+    
+    tmp = [self makeBundleInfoPath:path];
 
-      /* check for direct match */
-
-      tmp = [self makeBundleInfoPath:path];
-
-      if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) {
-        if ([fm fileExistsAtPath:tmp])
-          info = [self _loadBundleInfoAtExistingPath:tmp];
-      }
-      
-      [self _processInfoForProvidedResources:info ofType:_type path:path
-           resourceName:_resourceName resourceSelector:_selector
-           context:_context
-           andAddToResultArray:result];
+    if ((info = NSMapGet(self->pathToBundleInfo, tmp)) == nil) {
+      if ([fm fileExistsAtPath:tmp])
+       info = [self _loadBundleInfoAtExistingPath:tmp];
     }
+    
+    [self _processInfoForProvidedResources:info ofType:_type path:path
+         resourceName:_resourceName resourceSelector:_selector
+         context:_context
+         andAddToResultArray:result];
   }
+  
+  if ([result count] == 0) {
+    [self logWithFormat:
+           @"Note(%s): method does not search in loaded bundles for "
+           @"resources of type '%@'",
+           __PRETTY_FUNCTION__, _type];
+  }
+  
   return [[result copy] autorelease];
 }
 
@@ -1979,7 +1996,7 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info
 
 - (NSString *)description {
   char buffer[1024];
-    
+  
   sprintf (buffer,
           "<%s %p fullPath: %s infoDictionary: %p loaded=%s>",
           (char*)object_get_class_name(self),
index 548f07789cf5bc141e967aeac2a23948881a86aa..e4cd2dabe5b5b9e3f4da319eb71508976551706d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2000-2004 SKYRIX Software AG
+  Copyright (C) 2004 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
index 195a3590a312de7a687f923be9e5873df4869960..9f7ca49b8c6ce0cb4e96526de2cb437eac80dcbe 100644 (file)
@@ -1,6 +1,6 @@
 # version
 
-SUBMINOR_VERSION:=128
+SUBMINOR_VERSION:=129
 
 # v4.3.115 requires libFoundation v1.0.59
 # v4.2.72  requires libEOControl  v4.2.39