2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include <NGObjWeb/WODirectActionRequestHandler.h>
24 #include <NGObjWeb/WODirectAction.h>
25 #include <NGObjWeb/WOContext.h>
26 #include <NGObjWeb/WOApplication.h>
30 @implementation WODirectActionRequestHandler(Pub)
33 return [WOApplication application];
36 - (BOOL)allowDirectActionClass:(Class)_clazz {
38 #warning to be completed ...
39 if (![clazz isSubclassOfClass:[WODirectAction class]])
45 - (id)lookupName:(NSString *)_name inContext:(id)_ctx acquire:(BOOL)_ac {
47 BOOL lookupInAction = NO;
49 /* check whether name is a direct-action class */
50 if ((clazz = NSClassFromString(_name))) {
51 if (![self allowDirectActionClass:clazz])
55 /* automatically use DirectAction class */
57 clazz = NSClassFromString(@"DirectAction");
60 /* found a class, construct direct action */
62 WODirectAction *actionObject;
65 ctx = _ctx ? _ctx : [[WOApplication application] context];
67 if ((actionObject = [[clazz alloc] initWithContext:ctx]) == nil) {
68 /* failed to create object */
71 actionObject = [actionObject autorelease];
74 ? [actionObject lookupName:_name inContext:ctx acquire:_ac]
78 return [super lookupName:_name inContext:_ctx acquire:_ac];
81 @end /* WODirectActionRequestHandler(Pub) */