mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-24 04:01:16 +00:00
if _actionClassClass is nil find it with NSClassFromString
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18293 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
11acecdd51
commit
a5ed9358d5
1 changed files with 16 additions and 8 deletions
|
@ -219,11 +219,15 @@ RCS_ID("$Id$")
|
|||
{
|
||||
NSString* testActionName=[path objectAtIndex:0];
|
||||
NSDebugMLog(@"testActionName=%@",testActionName);
|
||||
|
||||
if ([GSWAction _isActionNamed:testActionName
|
||||
actionOfClass:*actionClassPtr])
|
||||
{
|
||||
NSDebugMLog(@"_actionClassName=%@",_actionClassName);
|
||||
NSDebugMLog(@"_actionClassClass=%@",_actionClassClass);
|
||||
if(!_actionClassClass) {
|
||||
_actionClassClass = NSClassFromString(_actionClassName);
|
||||
}
|
||||
NSDebugMLog(@"_actionClassClass=%@",_actionClassClass); //nil here?? dave
|
||||
NSDebugMLog(@"testActionName=%@",testActionName);
|
||||
*actionClassNamePtr = _actionClassName;
|
||||
*actionClassPtr = _actionClassClass;
|
||||
|
@ -251,8 +255,7 @@ RCS_ID("$Id$")
|
|||
}
|
||||
}
|
||||
/*
|
||||
NSString* tmpActionName=[NSString stringWithFormat:@"%@Action",
|
||||
];
|
||||
NSString* tmpActionName=[NSString stringWithFormat:@"%@Action",];
|
||||
SEL tmpActionSel=NSSelectorFromString(tmpActionName);
|
||||
Class aClass = NSClassFromString(@"DirectAction");
|
||||
NSDebugMLLog(@"requests",@"tmpActionName=%@",
|
||||
|
@ -338,7 +341,6 @@ RCS_ID("$Id$")
|
|||
classInto:&actionClass
|
||||
nameInto:&actionName
|
||||
forPath:requestHandlerPathArray];
|
||||
|
||||
NSDebugMLLog(@"requests",@"className=%@",actionClassName);
|
||||
NSDebugMLLog(@"requests",@"actionClass=%@",actionClass);
|
||||
NSDebugMLLog(@"requests",@"actionName=%@",actionName);
|
||||
|
@ -348,6 +350,7 @@ RCS_ID("$Id$")
|
|||
GSWResourceManager* resourceManager=nil;
|
||||
GSWDeployedBundle* appBundle=nil;
|
||||
id<GSWActionResults> actionResult=nil;
|
||||
|
||||
resourceManager=[application resourceManager];
|
||||
appBundle=[resourceManager _appProjectBundle];
|
||||
[resourceManager _allFrameworkProjectBundles];//So what ?
|
||||
|
@ -356,7 +359,6 @@ RCS_ID("$Id$")
|
|||
GSWAction* action=[self getActionInstanceOfClass:actionClass
|
||||
withRequest:aRequest];
|
||||
|
||||
|
||||
NSAssert1(action,@"Direct action of class named %@ can't be created",
|
||||
actionClassName);
|
||||
|
||||
|
@ -366,26 +368,31 @@ RCS_ID("$Id$")
|
|||
|
||||
context=[action _context];
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:@"DidHandleRequestNotification"
|
||||
object:context];
|
||||
[self _setRecordingHeadersToResponse:response
|
||||
forRequest:aRequest
|
||||
inContext:context];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
NSException* exception=nil;
|
||||
|
||||
if ([actionClassName length]>0)
|
||||
{
|
||||
|
||||
exception=[NSException exceptionWithName:NSInvalidArgumentException//TODO better name
|
||||
reason:[NSString stringWithFormat:@"Can't find action class named '%@'",actionClassName]
|
||||
userInfo:nil];
|
||||
|
||||
}
|
||||
else
|
||||
else {
|
||||
exception=[NSException exceptionWithName:NSInvalidArgumentException//TODO better name
|
||||
reason:[NSString stringWithFormat:@"Can't execute action with path: '%@'",requestHandlerPathArray]
|
||||
userInfo:nil];
|
||||
}
|
||||
|
||||
[exception raise];
|
||||
};
|
||||
if ([application isCachingEnabled])
|
||||
|
@ -399,6 +406,7 @@ RCS_ID("$Id$")
|
|||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
if (!context)
|
||||
context=[GSWApp _context];
|
||||
|
|
Loading…
Reference in a new issue