* GSWeb/GSWConstants.[hm]

add GSWClassName_Component
* GSWeb/GSWComponentDefinition.m
  fix -componentClass to use GSWClassName_Component


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@37919 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2014-05-29 12:05:16 +00:00
parent b34133e129
commit 0a37d5bcd6
4 changed files with 27 additions and 31 deletions

View file

@ -1,3 +1,8 @@
2014-05-29 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb/GSWConstants.[hm]
add GSWClassName_Component
* GSWeb/GSWComponentDefinition.m
fix -componentClass to use GSWClassName_Component
2014-05-29 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWDatabase/WODisplayGroup.m
respect GNUstep coding standard (curly brackets placement, indentation)

View file

@ -76,7 +76,7 @@ static GSWContext * TheTemporaryContext;
[super init];
ASSIGN(_name, [aName stringByDeletingPathExtension]); // does it ever happen that
ASSIGN(_className, aName); // those are different? dw.
_componentClass = NSClassFromString(_className);
ASSIGN(_componentClass,NSClassFromString(_className));
ASSIGN(_path, aPath);
ASSIGN(_url, baseURL);
ASSIGN(_frameworkName, aFrameworkName);
@ -90,9 +90,11 @@ static GSWContext * TheTemporaryContext;
_instancePool = [NSMutableArray new];
_lockInstancePool = [GSWApp isConcurrentRequestHandlingEnabled];
if ((_name != nil) && (_frameworkName != nil)) {
_componentClass = NSClassFromString(_className);
}
if (_name != nil
&& _frameworkName != nil)
{
ASSIGN(_componentClass,NSClassFromString(_className));
}
myBasePath = [aPath stringByAppendingPathComponent: aName];
ASSIGN(_htmlPath,[myBasePath stringByAppendingPathExtension:@"html"]);
ASSIGN(_wodPath,[myBasePath stringByAppendingPathExtension:GSWComponentDeclarationsSuffix[GSWebNamingConv]]);
@ -135,7 +137,7 @@ static GSWContext * TheTemporaryContext;
DESTROY(_frameworkName);
DESTROY(_language);
DESTROY(_className);
_componentClass = Nil;
DESTROY(_componentClass);
DESTROY(_template);
DESTROY(_htmlPath);
DESTROY(_wodPath);
@ -419,34 +421,21 @@ static GSWContext * TheTemporaryContext;
/** Find the class of the component **/
-(Class) componentClass
{
Class componentClass = Nil;
if (_componentClass) {
return _componentClass;
}
componentClass = _componentClass;
if (!componentClass) {
componentClass=NSClassFromString(_name);//???
}
if (!componentClass) // There's no class with that name
{
BOOL createClassesOk=NO;
NSString* superClassName=nil;
// If we haven't found a superclass, use GSWComponent as the superclass
if (!superClassName)
superClassName=@"WOComponent";
// Create class
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
superClassName:superClassName];
if (_componentClass==Nil)
{
ASSIGN(_componentClass,NSClassFromString(_name));
if (_componentClass==Nil) // There's no class with that name
{
BOOL createClassesOk=NO;
// Create class with GSWComponent as the superclass
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
superClassName:GSWClassName_Component[GSWebNamingConv]];
// Use it
componentClass=NSClassFromString(_name);
};
//call GSWApp isCaching
_componentClass=componentClass;
ASSIGN(_componentClass,NSClassFromString(_name));
};
}
return componentClass;
return _componentClass;
};
//--------------------------------------------------------------------

View file

@ -94,6 +94,7 @@ GSWEB_EXPORT NSString* GSWClassName_Application;
GSWEB_EXPORT NSString* GSWClassName_ResourceManager[2];
GSWEB_EXPORT NSString* GSWClassName_StatisticsStore[2];
GSWEB_EXPORT NSString* GSWClassName_ServerSessionStore[2];
GSWEB_EXPORT NSString* GSWClassName_Component[2];
GSWEB_EXPORT NSString* GSWClassName_DefaultAdaptor[2];
GSWEB_EXPORT NSString* GSWClassName_DefaultContext[2];
GSWEB_EXPORT NSString* GSWClassName_DefaultResponse[2];

View file

@ -90,6 +90,7 @@ NSString* GSWClassName_Application=@"Application";
NSString* GSWClassName_ResourceManager[2]={ @"GSWResourceManager", @"WOResourceManager" };
NSString* GSWClassName_StatisticsStore[2]={ @"GSWStatisticsStore", @"WOStatisticsStore" };
NSString* GSWClassName_ServerSessionStore[2]={ @"GSWServerSessionStore", @"WOServerSessionStore" };
NSString* GSWClassName_Component[2]={ @"GSWComponent", @"WOComponent" };
NSString* GSWClassName_DefaultAdaptor[2]={ @"GSWDefaultAdaptor", @"WODefaultAdaptor" };
NSString* GSWClassName_DefaultContext[2]={ @"GSWContext", @"WOContext" };
NSString* GSWClassName_DefaultResponse[2]={ @"GSWResponse", @"WOResponse" };