mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-19 10:01:05 +00:00
cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/branches/06-02-dwetzel@25018 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
121f4e0d1c
commit
e6d3eea85a
3 changed files with 213 additions and 443 deletions
File diff suppressed because it is too large
Load diff
|
@ -539,9 +539,7 @@ objectForReference:(NSString*)keyPath
|
|||
languages:(NSArray*)someLanguages
|
||||
{
|
||||
GSWElement* template=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"bundles",@"Name=%@",aName);
|
||||
//OK
|
||||
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
|
@ -560,8 +558,7 @@ objectForReference:(NSString*)keyPath
|
|||
};
|
||||
NS_ENDHANDLER;
|
||||
[self unlock];
|
||||
NSDebugMLLog(@"bundles",@"template=%@",template);
|
||||
LOGObjectFnStop();
|
||||
|
||||
return template;
|
||||
};
|
||||
|
||||
|
@ -573,12 +570,7 @@ objectForReference:(NSString*)keyPath
|
|||
GSWElement* template=nil;
|
||||
NSString* relativeTemplatePath=nil;
|
||||
NSString* absoluteTemplatePath=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"bundles",@"AName=%@",aName);
|
||||
NSDebugMLLog(@"bundles",@"SomeLanguages=%@",someLanguages);
|
||||
NSDebugMLLog(@"bundles",@"Path=%@",_path);
|
||||
NSDebugMLLog(@"bundles",@"baseURL=%@",_baseURL);
|
||||
NSDebugMLLog(@"bundles",@"frameworkName=%@",_frameworkName);
|
||||
|
||||
template=[self lockedResourceNamed:aName
|
||||
ofType:GSWComponentTemplateSuffix
|
||||
withLanguages:someLanguages
|
||||
|
@ -586,9 +578,6 @@ objectForReference:(NSString*)keyPath
|
|||
relativePath:&relativeTemplatePath
|
||||
absolutePath:&absoluteTemplatePath];
|
||||
|
||||
NSDebugMLLog(@"bundles",@"relativeTemplatePath=%@",relativeTemplatePath);
|
||||
NSDebugMLLog(@"bundles",@"absoluteTemplatePath=%@",absoluteTemplatePath);
|
||||
|
||||
if (!template)
|
||||
{
|
||||
if (!relativeTemplatePath)
|
||||
|
@ -676,8 +665,6 @@ objectForReference:(NSString*)keyPath
|
|||
};
|
||||
NS_ENDHANDLER;
|
||||
#endif
|
||||
GSWLogC("TemplateParsed\n");
|
||||
NSDebugMLLog(@"bundles",@"template=%@",template);
|
||||
};
|
||||
if ([[GSWApplication application] isCachingEnabled])
|
||||
{
|
||||
|
@ -694,8 +681,7 @@ objectForReference:(NSString*)keyPath
|
|||
};
|
||||
};
|
||||
};
|
||||
NSDebugMLLog(@"bundles",@"template=%@",template);
|
||||
LOGObjectFnStop();
|
||||
|
||||
return template;
|
||||
};
|
||||
|
||||
|
|
|
@ -86,14 +86,12 @@ static BOOL _IsEventLoggingEnabled; // needed?
|
|||
DESTROY(_instancePool);
|
||||
_instancePool = [NSMutableArray new];
|
||||
_lockInstancePool = [GSWApp isConcurrentRequestHandlingEnabled];
|
||||
|
||||
if ((_name != nil) && (_frameworkName != nil)) {
|
||||
// NSBundle * nsbundle = [NSBundle bundleForName:_frameworkName];
|
||||
// HACK! dw
|
||||
NSBundle * nsbundle = [NSBundle bundleForClass:NSClassFromString(_className)];
|
||||
if (nsbundle != nil) {
|
||||
_componentClass = NSClassFromString(_className);
|
||||
}
|
||||
// TODO: what if classname is nil?
|
||||
}
|
||||
myBasePath = [aPath stringByAppendingPathComponent: aName];
|
||||
ASSIGN(_htmlPath,[myBasePath stringByAppendingPathExtension:@"html"]);
|
||||
|
@ -101,16 +99,22 @@ static BOOL _IsEventLoggingEnabled; // needed?
|
|||
ASSIGN(_wooPath,[myBasePath stringByAppendingPathExtension:GSWArchiveSuffix[GSWebNamingConv]]);
|
||||
|
||||
defaultFileManager = [NSFileManager defaultManager];
|
||||
|
||||
if (([defaultFileManager fileExistsAtPath: _htmlPath] == NO) ||
|
||||
([defaultFileManager fileExistsAtPath: _wodPath] == NO) ||
|
||||
([defaultFileManager fileExistsAtPath: _wooPath] == NO) ||
|
||||
(_componentClass == Nil)) {
|
||||
|
||||
[NSException raise:NSInvalidArgumentException
|
||||
format:@"%s: No template found for component named '%@'",
|
||||
__PRETTY_FUNCTION__, _name];
|
||||
|
||||
if (_componentClass == Nil) {
|
||||
[self autorelease];
|
||||
NSLog(@"%s: No component class for component named '%@' found", __PRETTY_FUNCTION__, _name);
|
||||
return nil;
|
||||
}
|
||||
|
||||
// if (([defaultFileManager fileExistsAtPath: _htmlPath] == NO) ||
|
||||
// ([defaultFileManager fileExistsAtPath: _wodPath] == NO) ||
|
||||
// ([defaultFileManager fileExistsAtPath: _wooPath] == NO) ||
|
||||
// (_componentClass == Nil)) {
|
||||
//
|
||||
// [NSException raise:NSInvalidArgumentException
|
||||
// format:@"%s: No template found for component named '%@'",
|
||||
// __PRETTY_FUNCTION__, _name];
|
||||
// }
|
||||
_archive = nil;
|
||||
_encoding = NSUTF8StringEncoding;
|
||||
_template = nil;
|
||||
|
@ -290,65 +294,7 @@ static BOOL _IsEventLoggingEnabled; // needed?
|
|||
|
||||
return element;
|
||||
};
|
||||
/*
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)stringForKey:(NSString*)key
|
||||
inTableNamed:(NSString*)aName
|
||||
withDefaultValue:(NSString*)defaultValue
|
||||
languages:(NSArray*)languages
|
||||
{
|
||||
NSString* string=nil;
|
||||
LOGObjectFnStart();
|
||||
string=[_bundle stringForKey:key
|
||||
inTableNamed:aName
|
||||
withDefaultValue:defaultValue
|
||||
languages:languages];
|
||||
LOGObjectFnStop();
|
||||
return string;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//NDFN
|
||||
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
||||
withLanguages:(NSArray*)languages
|
||||
{
|
||||
NSDictionary* stringsTable=nil;
|
||||
LOGObjectFnStart();
|
||||
stringsTable=[bundle stringsTableNamed:aName
|
||||
withLanguages:languages];
|
||||
LOGObjectFnStop();
|
||||
return stringsTable;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//NDFN
|
||||
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
||||
withLanguages:(NSArray*)languages
|
||||
{
|
||||
NSArray* stringsTableArray=nil;
|
||||
LOGObjectFnStart();
|
||||
stringsTableArray=[bundle stringsTableArrayNamed:aName
|
||||
withLanguages:languages];
|
||||
LOGObjectFnStop();
|
||||
return stringsTableArray;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||
ofType:(NSString*)type
|
||||
languages:(NSArray*)languages
|
||||
request:(GSWRequest*)request
|
||||
{
|
||||
NSString* url=nil;
|
||||
LOGObjectFnStart();
|
||||
url=[bundle urlForResourceNamed:aName
|
||||
ofType:type
|
||||
languages:languages
|
||||
request:request];
|
||||
LOGObjectFnStop();
|
||||
return url;
|
||||
};
|
||||
*/
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||
ofType:(NSString*)aType
|
||||
|
|
Loading…
Reference in a new issue