]> err.no Git - sope/commitdiff
major improvements in resource/template lookup with SoProduct's
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 17 Feb 2005 22:43:12 +0000 (22:43 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 17 Feb 2005 22:43:12 +0000 (22:43 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@571 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/SoObjects/SoComponent.m
sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m
sope-appserver/NGObjWeb/Version
sope-appserver/NGObjWeb/WOResourceManager.m
sope-appserver/WEExtensions/ChangeLog
sope-appserver/WEExtensions/GNUmakefile
sope-appserver/WEExtensions/Version
sope-appserver/WEExtensions/WEResourceManager.m

index 8de3fad640e7f99cedd9bb03ae87de314a941646..8aae22cf1cb039eed382c7e2bfac22e0a2e95d0a 100644 (file)
@@ -1,3 +1,18 @@
+2005-02-17  Helge Hess  <helge.hess@opengroupware.org>
+
+       * v4.5.118
+       
+       * SoObjects/SoProductResourceManager.m:
+         - if a resource could not be found, continue lookup using
+           WOApplication resource manager instead of calling super
+         - fixed a major issue in the bundle resource lookup code
+         - use resource manager of other product when looking up a file of
+           that (instead of directly querying the bundle)
+       
+       * WOResourceManager.m: minor code cleanups
+       
+       * SoObjects/SoComponent.m: fixed a typo
+
 2005-02-17  Helge Hess  <helge.hess@skyrix.com>
 
        * WOApplication.m: the resource manager class to be used for a SOPE
index 28cf04147d54f26af37b742caf1b45747daa1061..933a14e55335a3f6295fb5b37625bc8da84e68f5 100644 (file)
   
   tmpl = [self templateWithName:[self name]];
   if (tmpl == nil) {
-    [self warnWithFormat:@"found not template named '%@' for component.",
+    [self warnWithFormat:@"found no template named '%@' for component.",
             [self name]];
   }
   return tmpl;
index fa1f7f9803998467c440b2980dc5af4792cde967..0b3c58777734c1d7b631abe83391955336626b56 100644 (file)
@@ -23,6 +23,7 @@
 #include "SoProduct.h"
 #include "SoObject.h"
 #include "SoClassSecurityInfo.h"
+#include "SoProductRegistry.h"
 #include <NGObjWeb/WOApplication.h>
 #include <NGObjWeb/WOContext.h>
 #include <NGObjWeb/WOResponse.h>
@@ -67,69 +68,108 @@ static BOOL debugOn = NO;
   return @"Resources";
 }
 
+- (WOResourceManager *)fallbackResourceManager {
+  WOResourceManager *rm;
+  
+  rm = [[WOApplication application] resourceManager];
+  return (rm == self) ? nil : rm; /* avoid recursion */
+}
+
 /* lookup resources */
 
+- (NSBundle *)bundleForFrameworkName:(NSString *)_fwName {
+  NSBundle *bundle;
+  
+  if ([_fwName length] == 0) {
+    if ((bundle = [self->product bundle]) == nil)
+      [self warnWithFormat:@"missing bundle for product: %@", self->product];
+    return bundle;
+  }
+  
+  if ([_fwName hasPrefix:@"/"]) {
+    bundle = [bm bundleWithPath:_fwName];
+  }
+  else {
+    bundle = [bm bundleWithName:[_fwName stringByDeletingPathExtension]
+                type:[_fwName pathExtension]];
+  }
+  if (bundle == nil)
+      [self warnWithFormat:@"missing bundle for framework: '%@'", _fwName];
+  
+  return bundle;
+}
+
 - (NSString *)pathForResourceNamed:(NSString *)_name
   inFramework:(NSString *)_frameworkName
   languages:(NSArray *)_languages
 {
   // TODO: should we do acquisition? (hm, don't think so!, done in lookup)
   //       but maybe we should not fall back to WOApplication resources
-  NSBundle *bundle;
-  NSString *path;
+  WOResourceManager *rm;
+  SoProduct *bproduct;
+  NSBundle  *bundle;
+  NSString  *path;
   
   if (debugOn) [self debugWithFormat:@"lookup resource: '%@'", _name];
   
   /* determine product bundle or explicitly requested framework/bundle */
   
-  if ([_frameworkName length] > 0) {
-    if ([_frameworkName hasPrefix:@"/"]) {
-      bundle = [bm bundleWithPath:_frameworkName];
-    }
-    else {
-      bundle = [bm bundleWithName:
-                     [_frameworkName stringByDeletingPathExtension]
-                   type:[_frameworkName pathExtension]];
-    }
-    if (bundle == nil) {
-      [self warnWithFormat:@"missing bundle for framework: '%@'",
-              _frameworkName];
-      goto fallback;
-    }
-  }
-  else {
-    if ((bundle = [self->product bundle]) == nil) {
-      [self warnWithFormat:@"missing bundle for product: %@", self->product];
-      goto fallback;
-    }
-  }
+  if ((bundle = [self bundleForFrameworkName:_frameworkName]) == nil)
+    goto fallback;
+  
+  bproduct = [[SoProductRegistry sharedProductRegistry] 
+              productForBundle:bundle];
+  rm = [bproduct resourceManager];
   
-  if (debugOn) [self debugWithFormat:@"  bundle: %@", bundle];
+  if (debugOn) {
+    [self debugWithFormat:
+           @"  fwname %@\n  bundle: %@\n  product: %@", 
+           _frameworkName, bundle, bproduct];
+  }
   
   /* lookup resource in bundle */
   
-  path = [bundle pathForResource:[_name stringByDeletingPathExtension]
-                 ofType:[_name pathExtension]
-                 inDirectory:nil
-                 languages:_languages];
+  if (bproduct == self->product || rm == self) {
+    path = [bundle pathForResource:[_name stringByDeletingPathExtension]
+                  ofType:[_name pathExtension]
+                  inDirectory:@"Resources"
+                  languages:_languages];
+    if (debugOn && path == nil) {
+      [self debugWithFormat:@"  resource %@/%@ not found in bundle: %@", 
+           _name, [_languages componentsJoinedByString:@","], bundle];
+    }
+  }
+  else {
+    /* delegate lookup to resource manager of other product */
+    path = [rm pathForResourceNamed:_name inFramework:_frameworkName
+              languages:_languages];
+    if (debugOn && path == nil)
+      [self debugWithFormat:@"  resource %@ not found in rm: %@", _name, rm];
+  }
   if (path != nil) {
     if (debugOn) [self debugWithFormat:@"  => found: %@", path];
     return path;
   }
-  if (debugOn) [self debugWithFormat:@"  resource not found in bundle ..."];
   
   /* fall back to WOResourceManager lookup */
  fallback:
-  return [super pathForResourceNamed:_name inFramework:_frameworkName
-                languages:_languages];
+    
+  rm = [self fallbackResourceManager];
+  if (rm != nil) {
+    return [rm pathForResourceNamed:_name inFramework:_frameworkName
+              languages:_languages];
+  }
+  else {
+    return [super pathForResourceNamed:_name inFramework:_frameworkName
+                 languages:_languages];
+  }
 }
 
 /* generate URL for resources (eg filename binding in WOImage) */
 
 - (NSString *)webServerResourcesPath {
   /* to avoid warning that WebServerResources path does not exist ... */
-  return [[[WOApplication application] resourceManager]
-                          webServerResourcesPath];
+  return [[self fallbackResourceManager] webServerResourcesPath];
 }
 
 - (NSString *)urlForResourceNamed:(NSString *)_name
@@ -204,12 +244,49 @@ static BOOL debugOn = NO;
   return url;
 }
 
+- (NSString *)pathToComponentNamed:(NSString *)_name
+  inFramework:(NSString *)_fwname
+  languages:(NSArray *)_langs
+{
+  NSString *p;
+  
+  p = [super pathToComponentNamed:_name inFramework:_fwname languages:_langs];
+  if (![p isNotNull] || [p length] == 0 ) {
+    [self logWithFormat:@"LOOKUP FAILED: %@", _name];
+    p = [[self fallbackResourceManager] pathToComponentNamed:_name
+                                       inFramework:_fwname
+                                       languages:_langs];
+    [self logWithFormat:@"  PARENT SAID: %@", p];
+  }
+  return p;
+}
+
 - (WOElement *)templateWithName:(NSString *)_name
   languages:(NSArray *)_languages
 {
-  [self logWithFormat:@"lookup template with name '%@' (languages=%@)",
+  WOResourceManager *arm;
+  WOElement *e;
+  
+  if (debugOn) {
+    [self logWithFormat:@"lookup template with name '%@' (languages=%@)",
          _name, [_languages componentsJoinedByString:@","]];
-  return [super templateWithName:_name languages:_languages];
+  }
+  if ((e = [super templateWithName:_name languages:_languages]) != nil) {
+    if (debugOn) [self logWithFormat:@"  found: %@", e];
+    return e;
+  }
+  
+  arm = [self fallbackResourceManager];
+  if (arm == self) return nil;
+  
+  if (debugOn) [self logWithFormat:@"  lookup in parent RM: %@", arm];
+  if ((e = [arm templateWithName:_name languages:_languages]) != nil) {
+    if (debugOn) [self logWithFormat:@"  found: %@", e];
+    return e;
+  }
+  
+  if (debugOn) [self logWithFormat:@"did not find template %@", _name];
+  return nil;
 }
 
 /* resource manager as a SoObject */
index c2187ba337b18d0f44f29cc399c7bca106265b86..78ac92e57b98bcbd971c51649d05d08a2351fc92 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=117
+SUBMINOR_VERSION:=118
 
 # v4.5.91  requires libNGExtensions v4.5.134
 # v4.5.84  requires libNGExtensions v4.5.127
index 2c20ee2575ff3414c1a54cd66d59a2f39ee40291..7b0edb5f3eb2dbc0ff43b12d4f7211264d3597e1 100644 (file)
@@ -767,32 +767,31 @@ _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path)
            _nameOrURL, _framework];
   }
 
+  /* look for .wox component */
     
-    /* look for .wox component */
+  path = [self pathForResourceNamed:
+                [self resourceNameForComponentNamed:*name_]
+              inFramework:_framework
+              languages:_languages];
     
-    path = [self pathForResourceNamed:
-                   [self resourceNameForComponentNamed:*name_]
-                 inFramework:_framework
-                 languages:_languages];
-    
-    if (debugComponentLookup)
-      [self logWithFormat:@"  path: '%@'", path];
+  if (debugComponentLookup)
+    [self logWithFormat:@"  .wox path: '%@'", path];
     
-    /* look for .wo component */
+  /* look for .wo component */
     
-    if ([path length] == 0) {
-      path = [self pathToComponentNamed:*name_
-                   inFramework:_framework
-                   languages:_languages];
-      if (debugComponentLookup)
-        [self logWithFormat:@"  path: '%@'", path];
-    }
+  if ([path length] == 0) {
+    path = [self pathToComponentNamed:*name_
+                inFramework:_framework
+                languages:_languages];
+    if (debugComponentLookup)
+      [self logWithFormat:@"  .wo  path: '%@'", path];
+  }
     
-    /* make URL from path */
+  /* make URL from path */
     
-    *url_ = ([path length] > 0)
-      ? [[[UrlClass alloc] initFileURLWithPath:path] autorelease]
-      : nil;
+  *url_ = ([path length] > 0)
+    ? [[[UrlClass alloc] initFileURLWithPath:path] autorelease]
+    : nil;
 }
 
 - (WOComponentDefinition *)definitionForFileURL:(NSURL *)componentURL
@@ -1056,7 +1055,8 @@ _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path)
   WOComponentDefinition *cdef;
   
   cdef = [self __definitionForComponent:_name languages:_languages];
-  if (cdef == nil) return nil;
+  if (cdef == nil)
+    return nil;
   
   return (WOElement *)[cdef template];
 }
@@ -1087,9 +1087,14 @@ _pathExists(WOResourceManager *self, NSFileManager *fm, NSString *path)
 /* description */
 
 - (NSString *)description {
-  return [NSString stringWithFormat:@"<%@[0x%08X]: path=%@>",
-                     [self class], self, self->base];
-                   
+  NSMutableString *ms;
+
+  ms = [NSMutableString stringWithCapacity:32];
+  [ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
+  if ([self->base length] > 0)
+    [ms appendFormat:@" path='%@'", self->base];
+  [ms appendString:@">"];
+  return ms;
 }
 
 /* KeyedData */
index b71582b72ac0bc8bed2c2ffe2a82fa1f0cf59a71..d9e02f277a2bd36756ca7962336af1ed9faca2e5 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-17  Helge Hess  <helge.hess@opengroupware.org>
+
+       * v4.5.67
+       
+       * WEResourceManager.m: removed special handling of components.cfg (only
+         required by OGo for legacy reasons)
+
+       * GNUmakefile: properly export the WEResourceManager.h header file
+
 2005-02-17  Helge Hess  <helge.hess@skyrix.com>
 
        * added a modified variant of the OGoResourceManager and the required
index a992b17edb678538c7cb0937f069b3c2613ed593..964927d0c60ea9f829d615dbc91d0215ba64cf66 100644 (file)
@@ -14,7 +14,8 @@ libWEExtensions_HEADER_FILES_DIR         = .
 libWEExtensions_HEADER_FILES_INSTALL_DIR = /WEExtensions
 
 libWEExtensions_HEADER_FILES = \
-       WEContextConditional.h
+       WEContextConditional.h  \
+       WEResourceManager.h     \
 
 libWEExtensions_OBJC_FILES =   \
        JSClipboard.m                   \
index f6b45b2434672ef874ee1e9c93f06970918e2ec0..cc5862656ed0916a5e2b33230093b9f4dfaa7990 100644 (file)
@@ -1,5 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=66
+SUBMINOR_VERSION:=67
 
 # v4.5.65 requires libNGObjWeb v4.5.106
index 68fbc415ce25d9f5c85a8bec26338c911c99c73a..23ea6bb5d5c591826912c8b8a9459c03a5011d64 100644 (file)
@@ -167,7 +167,7 @@ static NSString *themesDirName = @"Themes";
   if (debugOn)
     NSLog(@"template pathes: %@", templatePathes);
   if ([templatePathes count] == 0)
-    NSLog(@"WARNING: found no directories containing SOPE templates!");
+    NSLog(@"Note: found no directories containing flat templates.");
 }
 
 + (NSArray *)availableThemes {
@@ -286,7 +286,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
 /* locate Resources */
 
-- (NSString *)_checkPath:(NSString *)_p forResourceNamed:(NSString *)_name
+- (NSString *)_weCheckPath:(NSString *)_p forResourceNamed:(NSString *)_name
   inFramework:(NSString *)_frameworkName
   language:(NSString *)_language
 {
@@ -311,7 +311,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   return path;
 }
 
-- (NSString *)_checkPathes:(NSArray *)_p forResourceNamed:(NSString *)_name
+- (NSString *)_weCheckPathes:(NSArray *)_p forResourceNamed:(NSString *)_name
   inFramework:(NSString *)_frameworkName
   language:(NSString *)_language
 {
@@ -320,7 +320,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   
   e = [_p objectEnumerator];
   while ((path = [e nextObject]) != nil) {
-    path = [self _checkPath:path forResourceNamed:_name
+    path = [self _weCheckPath:path forResourceNamed:_name
                 inFramework:_frameworkName language:_language];
     if (path != nil) {
       if (debugOn) [self debugWithFormat:@"FOUND: '%@'", path];
@@ -330,7 +330,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   return nil;
 }
 
-- (NSString *)_pathForResourceNamed:(NSString *)_name
+- (NSString *)_wePathForResourceNamed:(NSString *)_name
   inFramework:(NSString *)_fwName
   language:(NSString *)_lang
   searchPathes:(NSArray *)_pathes
@@ -352,7 +352,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 
   if (debugOn) 
     [self debugWithFormat:@"check framework resources ..."];
-  path = [self _checkPathes:_pathes forResourceNamed:_name
+  path = [self _weCheckPathes:_pathes forResourceNamed:_name
               inFramework:_fwName language:_lang];
   if (path != nil) {
     [self cacheValue:path inCache:self->keyToPath];
@@ -363,7 +363,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   
   // TODO: where is the difference, same call like above?
   if (debugOn) [self debugWithFormat:@"check global resources ..."];
-  path = [self _checkPathes:_pathes forResourceNamed:_name
+  path = [self _weCheckPathes:_pathes forResourceNamed:_name
               inFramework:_fwName language:_lang];
   if (path != nil) {
     [self cacheValue:path inCache:self->keyToPath];
@@ -382,7 +382,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   return YES;
 }
 
-- (NSString *)_pathForResourceNamed:(NSString *)_name
+- (NSString *)_wePathForResourceNamed:(NSString *)_name
   inFramework:(NSString *)_fwName
   language:(NSString *)_lang
 {
@@ -391,7 +391,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   /* check in webserver resources */
   
   if ([self shouldLookupResourceInWebServerResources:_name]) {
-    p = [self _pathForResourceNamed:_name inFramework:_fwName
+    p = [self _wePathForResourceNamed:_name inFramework:_fwName
               language:_lang searchPathes:wsPathes];
     if (p != nil) return p;
   }
@@ -399,96 +399,9 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   return nil;
 }
 
-- (NSString *)lookupComponentsConfigInFramework:(NSString *)_fwName
-  theme:(NSString *)_theme
-{
-  NSString     *path;
-  NSEnumerator *e;
-  
-  /* check cache */
-  
-  path = checkCache(self->keyToPath, self->cachedKey, @"components.cfg",
-                   _fwName, _theme);
-  if (path != nil) {
-    if (debugOn) [self debugWithFormat:@"  found in cache: %@", path];
-    return [path isNotNull] ? path : nil;
-  }
-
-  /* traverse template dirs */
-  
-  e = [templatePathes objectEnumerator];
-  while ((path = [e nextObject]) != nil) {
-    if (_theme != nil) {
-      path = [path stringByAppendingPathComponent:themesDirName];
-      path = [path stringByAppendingPathComponent:_theme];
-    }
-    if (_fwName != nil)
-      path = [path stringByAppendingPathComponent:_fwName];
-    path = [path stringByAppendingPathComponent:@"components.cfg"];
-    
-    if ([fm fileExistsAtPath:path]) {
-#if 0
-      [self logWithFormat:@"components.cfg theme %@ fw %@: %@",
-           _theme, _fwName, path];
-#endif
-      [self cacheValue:path inCache:self->keyToPath];
-      return path;
-    }
-  }
-  
-  /* cache miss */
-  [self cacheValue:nil inCache:self->keyToPath];
-  return nil;
-}
-
-- (NSString *)lookupComponentsConfigInFramework:(NSString *)_fwName
-  languages:(NSArray *)_langs
-{
-  NSEnumerator *e;
-  NSString *rpath;
-  
-  if (![_fwName isNotNull])
-    _fwName = [[WOApplication application] name];
-  
-  if (debugOn) {
-    [self debugWithFormat:@"lookup components cfg: %@/%@", _fwName,
-            [_langs componentsJoinedByString:@","]];
-  }
-  
-  /* check themes */
-  
-  e = [_langs objectEnumerator];
-  while ((rpath = [e nextObject]) != nil) {
-    NSRange  r;
-    NSString *theme;
-    
-    r = [rpath rangeOfString:@"_"];
-    theme = (r.length > 0)
-      ? [rpath substringFromIndex:(r.location + r.length)]
-      : nil; /* default theme */
-    
-    rpath = [self lookupComponentsConfigInFramework:_fwName theme:theme];
-    if (rpath != nil)
-      return rpath;
-    
-    [self logWithFormat:@"Note: did not find components.cfg(%@) for theme: %@",
-            _fwName, (theme != nil ? theme : @"default-theme")];
-  }
-  
-  /* look using OWResourceManager */
-  
-  rpath = [super pathForResourceNamed:@"components.cfg"
-                 inFramework:_fwName
-                languages:_langs];
-
-  /* not found */
-  
-  if (rpath == nil) {
-    [self logWithFormat:@"Note: did not find components.cfg: %@/%@", 
-           _fwName ? _fwName : @"[app]",
-            [_langs componentsJoinedByString:@","]];
-  }
-  return rpath;
+- (BOOL)isTemplateResourceName:(NSString *)_name {
+  // TODO: non-extensible
+  return [_name hasSuffix:@".wox"];
 }
 
 - (NSString *)pathForResourceNamed:(NSString *)_name
@@ -505,40 +418,42 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   NSString     *rpath;
   
   if ([_name length] == 0) {
-    if (debugOn) [self logWithFormat:@"got no name for resource lookup?!"];
+    [self debugWithFormat:@"got no name for resource lookup?!"];
     return nil;
   }
   
-  /* special handling for components.cfg */
-  
-  if ([_name isEqualToString:@"components.cfg"])
-    return [self lookupComponentsConfigInFramework:_fwName languages:_langs];
-  
   if (debugOn) {
     [self debugWithFormat:@"pathForResourceNamed: %@/%@ (languages: %@)",
             _name, _fwName, [_langs componentsJoinedByString:@","]];
   }
+
+  if ([self isTemplateResourceName:_name]) {
+    if (debugOn) [self debugWithFormat:@"  is template resource .."];
+    return [self pathToComponentNamed:[_name stringByDeletingPathExtension]
+                inFramework:_fwName
+                languages:_langs];
+  }
   
   /* check languages */
   
   e = [_langs objectEnumerator];
-  while ((language = [e nextObject])) {
+  while ((language = [e nextObject]) != nil) {
       NSString *rpath;
       
       if (debugOn) 
        [self logWithFormat:@"  check language (%@): '%@'", _name, language];
-      rpath = [self _pathForResourceNamed:_name inFramework:_fwName
+      rpath = [self _wePathForResourceNamed:_name inFramework:_fwName
                    language:language];
       if (rpath != nil) {
-       if (debugOn) [self logWithFormat:@"  FOUND: %@", rpath];
+       if (debugOn) [self debugWithFormat:@"  FOUND: %@", rpath];
        return rpath;
       }
   }
   
   /* check without language */
   
-  rpath = [self _pathForResourceNamed:_name inFramework:_fwName
-                 language:nil];
+  rpath = [self _wePathForResourceNamed:_name inFramework:_fwName
+               language:nil];
   if (rpath != nil)
     return rpath;
   
@@ -547,7 +462,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
              @"did not find resource, try super lookup: '%@'", _name];
   }
     
-  /* look using OWResourceManager */
+  /* look using WOResourceManager */
   
   rpath = [super pathForResourceNamed:_name inFramework:_fwName
                 languages:_langs];
@@ -775,17 +690,27 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   NSEnumerator *e;
   NSString *path;
   
+  if (debugComponents) {
+    [self logWithFormat:@"lookup component in std pathes: %@|%@|%@",
+         _name, _framework, _theme];
+  }
+  
+  if ([_theme isNotNull] && [_theme length] == 0) 
+    _theme = nil;
+  if ([_framework isNotNull] && [_framework length] == 0) 
+    _framework = nil;
+  
   e = [templatePathes objectEnumerator];
-  while ((path = [e nextObject])) {
+  while ((path = [e nextObject]) != nil) {
     NSString *pe;
-
+    
     if (_theme != nil) {
       // TODO: should be lower case for FHS? or use a different path?
       path = [path stringByAppendingPathComponent:themesDirName];
       path = [path stringByAppendingPathComponent:_theme];
     }
     
-    if ([_framework length] > 0) {
+    if (_framework != nil) {
       NSString *pureName;
       
       pureName = [_framework lastPathComponent];
@@ -796,6 +721,8 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
     path = [path stringByAppendingPathComponent:_name];
     
     pe = [path stringByAppendingPathExtension:@"wox"];
+    if (debugComponents) [self logWithFormat:@"CHECK %@", pe];
+    
     if ([fm fileExistsAtPath:pe])
       return pe;
 
@@ -818,6 +745,11 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   NSString *path;
   NSString *theme;
   
+  if (debugComponents) {
+    [self logWithFormat:@"lookup component in std pathes(langs): %@|%@",
+         _name, _framework];
+  }
+  
   /* extract theme from language array (we do not support nested themes ATM) */
   
   theme = nil;
@@ -848,6 +780,15 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
               theme:nil];
   if (path != nil)
     return path;
+  
+  /* check without framework subdir */
+
+  if ([_framework length] > 0) {
+    path = [self lookupComponentInStandardPathes:_name inFramework:nil
+                theme:nil];
+    if (path != nil)
+      return path;
+  }
 
   return nil;
 }
@@ -858,6 +799,9 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   NSString *wrapper = nil;
   NSBundle *bundle  = nil;
   NSString *path;
+
+  if (debugComponents)
+    [self logWithFormat:@"lookup component using bundle manager: %@", _name];
   
   bundle = [[self bundleManager]
                   bundleProvidingResource:_name
@@ -895,7 +839,7 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
 {
   // TODO: what about languages in lookup?
   NSString *path;
-  
+
   if (debugComponents) {
     [self logWithFormat:@"%s: lookup component: %@|%@",
          __PRETTY_FUNCTION__, _name, _fw];
@@ -923,10 +867,12 @@ checkCache(NSDictionary *_cache, WEResourceKey *_key,
   
   /* try to find component by standard NGObjWeb method */
   
+  if (debugComponents)
+    [self logWithFormat:@"lookup component using WOResourceManager ..."];
   path = [super pathToComponentNamed:_name inFramework:_fw languages:_langs];
   if (path != nil) {
     if (debugComponents)
-      [self logWithFormat:@"  found using OWResourceManager: %@", path];
+      [self logWithFormat:@"  found using WOResourceManager: %@", path];
     goto done;
   }