}
- (void)_prepareContext:(id)_ctx withMethodObject:(id)_method {
- /* for subclasses */
+ /* for subclasses (set page in context in page invocation) */
+}
+- (void)_prepareMethod:(id)_method inContext:(id)_ctx {
+ /* for subclasses (triggers takeValues phase in page invocation) */
}
-- (id)callOnObject:(id)_client inContext:(id)_ctx {
+- (void)_applyArgumentsOnMethod:(id)_method inContext:(id)_ctx {
NSDictionary *argspec;
- id method;
- WORequest *rq;
+ NSDictionary *args;
+
+ argspec = [self->argumentSpecifications objectForKey:[_ctx soRequestType]];
+ if (argspec == nil)
+ return;
+
+ args = [self extractArgumentsFromContext:_ctx
+ forRequestType:[_ctx soRequestType]
+ specification:argspec];
+ if (debugOn) [self debugWithFormat:@"extracted args %@", args];
+
+ if (args != nil) [_method takeValuesFromDictionary:args];
+}
+
+- (id)callOnObject:(id)_client inContext:(id)_ctx {
+ id method;
if (self->object != _client) {
/* rebind */
if ([method respondsToSelector:@selector(setClientObject:)])
[method setClientObject:_client];
- /* apply request parameters */
-
- rq = [(id <WOPageGenerationContext>)_ctx request];
-
- if ([method shouldTakeValuesFromRequest:rq inContext:_ctx]) {
- [[_ctx application] takeValuesFromRequest:rq
- inContext:_ctx];
- }
-
- /* apply extracted parameters (TODO: what should be done first?) */
-
- argspec = [self->argumentSpecifications objectForKey:[_ctx soRequestType]];
- if (argspec != nil) {
- NSDictionary *args;
-
- args = [self extractArgumentsFromContext:_ctx
- forRequestType:[_ctx soRequestType]
- specification:argspec];
- if (debugOn) [self debugWithFormat:@"extracted args %@", args];
-
- if (args != nil) [method takeValuesFromDictionary:args];
- }
+ /* TODO: what should be done first?, take values or args? */
+ [self _prepareMethod:method inContext:_ctx];
+ [self _applyArgumentsOnMethod:method inContext:_ctx];
/* call action */
[_ctx setPage:_method];
}
+- (void)_prepareMethod:(id)_method inContext:(id)_ctx {
+ /* apply request parameters */
+ WORequest *rq;
+
+ rq = [(id <WOPageGenerationContext>)_ctx request];
+ if ([_method shouldTakeValuesFromRequest:rq inContext:_ctx]) {
+ [[_ctx application] takeValuesFromRequest:rq
+ inContext:_ctx];
+ }
+}
+
/* page construction */
- (WOComponent *)instantiatePageInContext:(id)_ctx {
/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include "WODirectActionRequestHandler.h"
#include "WORequestHandler+private.h"