2
Copyright (C) 2000-2005 SKYRIX Software AG
4
This file is part of SOPE.
6
SOPE is free software; you can redistribute it and/or modify it under
7
the terms of the GNU Lesser General Public License as published by the
8
Free Software Foundation; either version 2, or (at your option) any
11
SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12
WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14
License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with SOPE; see the file COPYING. If not, write to the
18
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22
#include <NGObjWeb/WODirectActionRequestHandler.h>
23
#include <NGObjWeb/WODirectAction.h>
24
#include <NGObjWeb/WOContext.h>
25
#include <NGObjWeb/WOApplication.h>
29
@implementation WODirectActionRequestHandler(Pub)
32
return [WOApplication application];
35
- (BOOL)allowDirectActionClass:(Class)_clazz {
37
#warning to be completed ...
38
if (![clazz isSubclassOfClass:[WODirectAction class]])
44
- (id)lookupName:(NSString *)_name inContext:(id)_ctx acquire:(BOOL)_ac {
46
BOOL lookupInAction = NO;
48
/* check whether name is a direct-action class */
49
if ((clazz = NSClassFromString(_name))) {
50
if (![self allowDirectActionClass:clazz])
54
/* automatically use DirectAction class */
56
clazz = NSClassFromString(@"DirectAction");
59
/* found a class, construct direct action */
61
WODirectAction *actionObject;
64
ctx = _ctx ? _ctx : [[WOApplication application] context];
66
if ((actionObject = [[clazz alloc] initWithContext:ctx]) == nil) {
67
/* failed to create object */
70
actionObject = [actionObject autorelease];
73
? [actionObject lookupName:_name inContext:ctx acquire:_ac]
77
return [super lookupName:_name inContext:_ctx acquire:_ac];
80
@end /* WODirectActionRequestHandler(Pub) */