From: helge Date: Mon, 11 Oct 2004 13:58:23 +0000 (+0000) Subject: more SoActionInvocation fixes X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25345a51c50e58d84c7eb5b9c546fa3a0b6bda34;p=sope more SoActionInvocation fixes git-svn-id: http://svn.opengroupware.org/SOPE/trunk@245 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index d0a4a681..edce86be 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,5 +1,12 @@ 2004-10-11 Helge Hess + * v4.3.61 + + * SoObjects/product.plist: properly export SoActionInvocation + + * SoObjects/SoProductClassInfo.m: fixed product.plist class name entry + for action invocations + * SoObjects/SoPageInvocation.h: fixed header file (install include and compile include differ :-|) (v4.3.60) diff --git a/sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.m b/sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.m index e16d7a2c..6a4a231d 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoActionInvocation.m @@ -186,13 +186,30 @@ static int debugOn = 0; } - (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 */ @@ -218,28 +235,9 @@ static int debugOn = 0; if ([method respondsToSelector:@selector(setClientObject:)]) [method setClientObject:_client]; - /* apply request parameters */ - - rq = [(id )_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 */ diff --git a/sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.m b/sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.m index e16743e1..a78cec84 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoPageInvocation.m @@ -100,6 +100,17 @@ static int debugOn = 0; [_ctx setPage:_method]; } +- (void)_prepareMethod:(id)_method inContext:(id)_ctx { + /* apply request parameters */ + WORequest *rq; + + rq = [(id )_ctx request]; + if ([_method shouldTakeValuesFromRequest:rq inContext:_ctx]) { + [[_ctx application] takeValuesFromRequest:rq + inContext:_ctx]; + } +} + /* page construction */ - (WOComponent *)instantiatePageInContext:(id)_ctx { diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m b/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m index f9ec9ada..3a168e3c 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductClassInfo.m @@ -333,7 +333,7 @@ static int loadDebugOn = 0; NSString *actionClass, *actionName; NSDictionary *argspecs; - actionClass = [_m objectForKey:@"className"]; + actionClass = [_m objectForKey:@"actionClass"]; argspecs = [_m objectForKey:@"arguments"]; if ((actionName = [_m objectForKey:@"directActionName"]) == nil) diff --git a/sope-appserver/NGObjWeb/SoObjects/WODirectAction+SoObjects.m b/sope-appserver/NGObjWeb/SoObjects/WODirectAction+SoObjects.m index 3c877d20..01d2ed12 100644 --- a/sope-appserver/NGObjWeb/SoObjects/WODirectAction+SoObjects.m +++ b/sope-appserver/NGObjWeb/SoObjects/WODirectAction+SoObjects.m @@ -24,6 +24,14 @@ #include "SoObject.h" #include "common.h" +/* + WODirectActionPubInvocation + + This invocation is used if you have a direct action in the lookup path, this + can be configured by setting a WODirectAction subclass as a 'slot' of a + class. +*/ + @interface WODirectActionPubInvocation : NSObject { @public diff --git a/sope-appserver/NGObjWeb/SoObjects/product.plist b/sope-appserver/NGObjWeb/SoObjects/product.plist index 3bc7d845..0853bbdd 100644 --- a/sope-appserver/NGObjWeb/SoObjects/product.plist +++ b/sope-appserver/NGObjWeb/SoObjects/product.plist @@ -1,5 +1,5 @@ { - CVSID = "$Id$"; + CVSID = "$Id: product.plist 4 2004-08-20 17:04:31Z helge $"; classes = { @@ -64,8 +64,13 @@ }; }; }; + SoActionInvocation = { + protectedBy = ""; + defaultAccess = "allow"; + }; SoPageInvocation = { - protectedBy = ""; + superclass = "SoActionInvocation"; + protectedBy = ""; defaultAccess = "allow"; }; SoProduct = { diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 6ac86bcc..ca7d1576 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=60 +SUBMINOR_VERSION:=61 # v4.3.42 requires libNGExtensions v4.3.116 # v4.3.40 requires libNGExtensions v4.3.115 diff --git a/sope-appserver/NGObjWeb/WODirectActionRequestHandler.m b/sope-appserver/NGObjWeb/WODirectActionRequestHandler.m index e536df73..30ccbd86 100644 --- a/sope-appserver/NGObjWeb/WODirectActionRequestHandler.m +++ b/sope-appserver/NGObjWeb/WODirectActionRequestHandler.m @@ -1,7 +1,7 @@ /* - 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 @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #include "WODirectActionRequestHandler.h" #include "WORequestHandler+private.h"