From 3383886b6dd3bfdf85ca7a8fde07e5ee0bc28f4d Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 17 Feb 2005 22:43:12 +0000 Subject: [PATCH] major improvements in resource/template lookup with SoProduct's git-svn-id: http://svn.opengroupware.org/SOPE/trunk@571 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 15 ++ .../NGObjWeb/SoObjects/SoComponent.m | 2 +- .../SoObjects/SoProductResourceManager.m | 147 +++++++++++---- sope-appserver/NGObjWeb/Version | 2 +- sope-appserver/NGObjWeb/WOResourceManager.m | 53 +++--- sope-appserver/WEExtensions/ChangeLog | 9 + sope-appserver/WEExtensions/GNUmakefile | 3 +- sope-appserver/WEExtensions/Version | 2 +- .../WEExtensions/WEResourceManager.m | 178 ++++++------------ 9 files changed, 232 insertions(+), 179 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 8de3fad6..8aae22cf 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,18 @@ +2005-02-17 Helge Hess + + * 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 * WOApplication.m: the resource manager class to be used for a SOPE diff --git a/sope-appserver/NGObjWeb/SoObjects/SoComponent.m b/sope-appserver/NGObjWeb/SoObjects/SoComponent.m index 28cf0414..933a14e5 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoComponent.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoComponent.m @@ -119,7 +119,7 @@ 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; diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m index fa1f7f98..0b3c5877 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m @@ -23,6 +23,7 @@ #include "SoProduct.h" #include "SoObject.h" #include "SoClassSecurityInfo.h" +#include "SoProductRegistry.h" #include #include #include @@ -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 */ diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index c2187ba3..78ac92e5 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -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 diff --git a/sope-appserver/NGObjWeb/WOResourceManager.m b/sope-appserver/NGObjWeb/WOResourceManager.m index 2c20ee25..7b0edb5f 100644 --- a/sope-appserver/NGObjWeb/WOResourceManager.m +++ b/sope-appserver/NGObjWeb/WOResourceManager.m @@ -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 */ diff --git a/sope-appserver/WEExtensions/ChangeLog b/sope-appserver/WEExtensions/ChangeLog index b71582b7..d9e02f27 100644 --- a/sope-appserver/WEExtensions/ChangeLog +++ b/sope-appserver/WEExtensions/ChangeLog @@ -1,3 +1,12 @@ +2005-02-17 Helge Hess + + * 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 * added a modified variant of the OGoResourceManager and the required diff --git a/sope-appserver/WEExtensions/GNUmakefile b/sope-appserver/WEExtensions/GNUmakefile index a992b17e..964927d0 100644 --- a/sope-appserver/WEExtensions/GNUmakefile +++ b/sope-appserver/WEExtensions/GNUmakefile @@ -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 \ diff --git a/sope-appserver/WEExtensions/Version b/sope-appserver/WEExtensions/Version index f6b45b24..cc586265 100644 --- a/sope-appserver/WEExtensions/Version +++ b/sope-appserver/WEExtensions/Version @@ -1,5 +1,5 @@ # version file -SUBMINOR_VERSION:=66 +SUBMINOR_VERSION:=67 # v4.5.65 requires libNGObjWeb v4.5.106 diff --git a/sope-appserver/WEExtensions/WEResourceManager.m b/sope-appserver/WEExtensions/WEResourceManager.m index 68fbc415..23ea6bb5 100644 --- a/sope-appserver/WEExtensions/WEResourceManager.m +++ b/sope-appserver/WEExtensions/WEResourceManager.m @@ -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; } -- 2.39.5