From 65baa80766141904a19e8b550194f21318d2ec6f Mon Sep 17 00:00:00 2001 From: mguesdon Date: Mon, 14 Feb 2000 10:57:55 +0000 Subject: [PATCH] 2000-02-13 Manuel Guesdon * GSWStatisticsStore.m: added comment * GSWSubmitButton.m: added log and assert * GSWImageButton.m: added log and assert * GSWHyperlink.m: added log and assert * GSWHTMLStaticElement.m: added log and assert * GSWForm.m: added log and assert * GSWElement.m: added log and assert * GSWConditional.m: added log and assert * GSWComponentReference.m: added log and assert * GSWComponent.m: added log and assert * GSWElement.m: added log and assert * GSWElement.h: added debug ivar * GSWTextField.m: added log and assert * GSWInput.m: added log and assert * GSWelementIDString.h/.m: added -parentElementIDString -copyWithZone: -mutableCopyWithZone: git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@6019 72102866-910b-0410-8b05-ffd578937521 --- GSWeb.framework/GSWComponent.m | 12 +++++- GSWeb.framework/GSWComponentReference.m | 13 +++--- GSWeb.framework/GSWConditional.m | 6 ++- GSWeb.framework/GSWElement.h | 24 +++++++++++ GSWeb.framework/GSWElement.m | 54 +++++++++++++++++++++++++ GSWeb.framework/GSWElementIDString.h | 1 + GSWeb.framework/GSWElementIDString.m | 21 ++++++++++ GSWeb.framework/GSWFileUpload.m | 4 +- GSWeb.framework/GSWForm.m | 32 +++++++++++++-- GSWeb.framework/GSWHTMLBareString.m | 1 + GSWeb.framework/GSWHTMLDynamicElement.m | 5 ++- GSWeb.framework/GSWHTMLStaticElement.m | 5 ++- GSWeb.framework/GSWHyperlink.m | 7 ++-- GSWeb.framework/GSWImageButton.m | 4 ++ GSWeb.framework/GSWInput.m | 2 + GSWeb.framework/GSWResetButton.m | 1 + GSWeb.framework/GSWStatisticsStore.m | 1 + GSWeb.framework/GSWSubmitButton.m | 15 +++++++ GSWeb.framework/GSWTextField.m | 7 ++-- GSWeb.framework/GSWUtils.h | 3 ++ 20 files changed, 193 insertions(+), 25 deletions(-) diff --git a/GSWeb.framework/GSWComponent.m b/GSWeb.framework/GSWComponent.m index 57489b9..b42fb34 100644 --- a/GSWeb.framework/GSWComponent.m +++ b/GSWeb.framework/GSWComponent.m @@ -25,7 +25,6 @@ static char rcsId[] = "$Id$"; #include - //==================================================================== @implementation GSWComponent @@ -929,6 +928,7 @@ associationsKeys:(NSArray*)_associationsKeys #endif LOGObjectFnStart(); NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only _template=[self _template]; [response_ appendContentString:[NSString stringWithFormat:@"\n\n",[self _templateName]]];//TODO enlever @@ -967,6 +967,7 @@ associationsKeys:(NSArray*)_associationsKeys NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); NS_DURING { + GSWAssertCorrectElementID(context_);// Debug Only _template=[self _template]; [context_ appendZeroElementIDComponent]; element=[[self _template] invokeActionForRequest:request_ @@ -991,6 +992,13 @@ associationsKeys:(NSArray*)_associationsKeys }; #endif + if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]==NSOrderedDescending) + { + LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", + [self class], + [context_ elementID], + [context_ senderID]); + }; LOGObjectFnStop(); return element; }; @@ -1008,6 +1016,8 @@ associationsKeys:(NSArray*)_associationsKeys GSWElementIDString* debugElementID=[context_ elementID]; #endif LOGObjectFnStart(); + GSWAssertCorrectElementID(context_);// Debug Only + #if !GSWEB_STRICT [validationFailureMessages removeAllObjects]; #endif diff --git a/GSWeb.framework/GSWComponentReference.m b/GSWeb.framework/GSWComponentReference.m index cd50669..d765e4a 100644 --- a/GSWeb.framework/GSWComponentReference.m +++ b/GSWeb.framework/GSWComponentReference.m @@ -202,6 +202,7 @@ static char rcsId[] = "$Id$"; #endif LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only _componentPrev=[context_ component]; [self pushRefComponentInContext:context_]; if ([context_ component]) @@ -232,18 +233,13 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); _componentPrev=[context_ component]; + GSWAssertCorrectElementID(context_);// Debug Only [self pushRefComponentInContext:context_]; if ([context_ component]) { - NSString* _senderID=nil; - NSString* _elementID=nil; - _senderID=[context_ senderID]; - _elementID=[context_ elementID]; - NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID); - NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID); - if ([_senderID hasPrefix:_elementID]) //Avoid trying to find action if we are not the good component + if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component { _component=[context_ component]; _element=[_component invokeActionForRequest:request_ @@ -273,6 +269,7 @@ static char rcsId[] = "$Id$"; #endif LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only _componentPrev=[context_ component]; [self pushRefComponentInContext:context_]; if ([context_ component]) diff --git a/GSWeb.framework/GSWConditional.m b/GSWeb.framework/GSWConditional.m index 7175e76..5bbc9b6 100644 --- a/GSWeb.framework/GSWConditional.m +++ b/GSWeb.framework/GSWConditional.m @@ -25,7 +25,6 @@ static char rcsId[] = "$Id$"; #include - //==================================================================== @implementation GSWConditional @@ -95,6 +94,7 @@ static char rcsId[] = "$Id$"; BOOL _doIt=NO; LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only _condition=[self evaluateCondition:condition inContext:context_]; _negate=[self evaluateCondition:negate @@ -126,7 +126,8 @@ static char rcsId[] = "$Id$"; BOOL _negate=NO; BOOL _doIt=NO; LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + GSWAssertCorrectElementID(context_);// Debug Only _condition=[self evaluateCondition:condition inContext:context_]; _negate=[self evaluateCondition:negate @@ -161,6 +162,7 @@ static char rcsId[] = "$Id$"; BOOL _doIt=NO; LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only _condition=[self evaluateCondition:condition inContext:context_]; NSDebugMLLog(@"gswdync",@"_condition=%s",_condition ? "YES" : "NO"); diff --git a/GSWeb.framework/GSWElement.h b/GSWeb.framework/GSWElement.h index bf159d2..382b36d 100644 --- a/GSWeb.framework/GSWElement.h +++ b/GSWeb.framework/GSWElement.h @@ -31,11 +31,34 @@ extern BYTE ElementsMap_gswebElement; extern BYTE ElementsMap_dynamicElement; extern BYTE ElementsMap_attributeElement; + //==================================================================== @interface GSWElement : NSObject +#ifndef NDEBBUG +{ + NSString* _appendToResponseElementID; +}; +#endif +#ifndef NDEBBUG +-(void)saveAppendToResponseElementIDInContext:(id)context_; +-(void)assertCorrectElementIDInContext:(id)context_ + inCLass:(Class)class_ + method:(SEL)method_ + file:(const char*)file_ + line:(int)line_; +#endif @end +#ifdef NDEBBUG +#define GSWSaveAppendToResponseElementID(context_); {}; +#define GSWAssertCorrectElementID(context_); {}; +#else +#define GSWSaveAppendToResponseElementID(context_); [self saveAppendToResponseElementIDInContext:context_]; +#define GSWAssertCorrectElementID(context_); ([self assertCorrectElementIDInContext:context_ inCLass:[self class] method:_cmd file:__FILE__ line:__LINE__]); +#endif + + //==================================================================== @interface GSWElement (GSWRequestHandling) @@ -47,6 +70,7 @@ extern BYTE ElementsMap_attributeElement; -(void)takeValuesFromRequest:(GSWRequest*)request_ inContext:(GSWContext*)context_; +-(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context_; @end #endif //_GSWElement_h__ diff --git a/GSWeb.framework/GSWElement.m b/GSWeb.framework/GSWElement.m index c96dff8..3c8afff 100644 --- a/GSWeb.framework/GSWElement.m +++ b/GSWeb.framework/GSWElement.m @@ -33,6 +33,45 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; //==================================================================== @implementation GSWElement +#ifndef NDEBBUG +-(void)saveAppendToResponseElementIDInContext:(id)context_ +{ + NSString* _elementID=[context_ elementID]; + ASSIGN(_appendToResponseElementID,_elementID); +}; + +-(void)assertCorrectElementIDInContext:(id)context_ + inCLass:(Class)class_ + method:(SEL)method_ + file:(const char*)file_ + line:(int)line_ +{ + if ([_appendToResponseElementID length]>0) + { + NSString* _elementID=[context_ elementID]; + BOOL _appendToResponseElementIDIsFirst=NO; + BOOL _elementIDIsFirst=NO; + BOOL _OK=YES; + _appendToResponseElementIDIsFirst=[_appendToResponseElementID length]==0 || [_appendToResponseElementID isEqualToString:@"0"]; + _elementIDIsFirst=[_elementID length]==0 || [_elementID isEqualToString:@"0"]; + if (_appendToResponseElementIDIsFirst!=_elementIDIsFirst) + { + _OK=[_appendToResponseElementID isEqualToString:_elementID]; + }; + if (!_OK) + { + NSString* _msg=[NSString stringWithFormat:@"In Class %@ (file %s line %d), id %@ in %@ is not the same than in appendToResponse %@", + NSStringFromClass(class_), + file_, + line_, + [context_ elementID], + NSStringFromSelector(method_), + _appendToResponseElementID]; + NSAssert1(_OK,@"%@",_msg); + }; + }; +}; +#endif @end //==================================================================== @@ -44,6 +83,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; -(void)takeValuesFromRequest:(GSWRequest*)request_ inContext:(GSWContext*)context_ { + GSWAssertCorrectElementID(context_);// Debug Only //Does Nothing }; @@ -53,6 +93,8 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ inContext:(GSWContext*)context_ { + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + GSWAssertCorrectElementID(context_);// Debug Only //Does Nothing return nil; }; @@ -63,9 +105,21 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; -(void)appendToResponse:(GSWResponse*)response_ inContext:(GSWContext*)context_ { + GSWSaveAppendToResponseElementID(context_);//Debug Only //Does Nothing }; +//-------------------------------------------------------------------- +//NDFN +-(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context_ +{ + NSString* _senderID=[context_ senderID]; + NSString* _elementID=[context_ elementID]; + NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID); + NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID); + return ([_elementID hasPrefix:_senderID] || [_senderID hasPrefix:_elementID]); +}; + @end diff --git a/GSWeb.framework/GSWElementIDString.h b/GSWeb.framework/GSWElementIDString.h index c874d37..3c4981c 100644 --- a/GSWeb.framework/GSWElementIDString.h +++ b/GSWeb.framework/GSWElementIDString.h @@ -38,6 +38,7 @@ -(void)incrementLastElementIDComponent; -(void)appendZeroElementIDComponent; -(void)appendElementIDComponent:(id)_element; +-(NSString*)parentElementIDString;//NDFN #ifndef NDEBBUG -(int)elementsNb; #endif diff --git a/GSWeb.framework/GSWElementIDString.m b/GSWeb.framework/GSWElementIDString.m index 5e8e3b1..f9e3ff0 100644 --- a/GSWeb.framework/GSWElementIDString.m +++ b/GSWeb.framework/GSWElementIDString.m @@ -27,6 +27,18 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWElementIDString + +//-------------------------------------------------------------------- +-(id)copyWithZone:(NSZone*)zone +{ + return [self mutableCopyWithZone:zone]; +}; + +//-------------------------------------------------------------------- +-(id)mutableCopyWithZone:(NSZone*)zone +{ + return [[[self class] allocWithZone: zone] initWithString: self]; +}; @end //==================================================================== @@ -118,6 +130,15 @@ static char rcsId[] = "$Id$"; LOGObjectFnStop(); }; +//-------------------------------------------------------------------- +//NDFN +-(NSString*)parentElementIDString +{ + GSWElementIDString* _id=[[self copy] autorelease]; + if ([self length]>0) + [_id deleteLastElementIDComponent]; + return _id; +}; //-------------------------------------------------------------------- #ifndef NDEBBUG -(int)elementsNb diff --git a/GSWeb.framework/GSWFileUpload.m b/GSWeb.framework/GSWFileUpload.m index 1ff61f1..e1b9d62 100644 --- a/GSWeb.framework/GSWFileUpload.m +++ b/GSWeb.framework/GSWFileUpload.m @@ -81,7 +81,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { [super appendToResponse:response_ inContext:context_]; @@ -91,6 +91,7 @@ static char rcsId[] = "$Id$"; -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ inContext:(GSWContext*)context_ { + GSWAssertCorrectElementID(context_);// Debug Only //Bypass GSWInput return nil; }; @@ -102,6 +103,7 @@ static char rcsId[] = "$Id$"; //OK BOOL _disabled=NO; LOGObjectFnStartC("GSWFileUpload"); + GSWAssertCorrectElementID(context_);// Debug Only _disabled=[self disabledInContext:context_]; if (!_disabled) { diff --git a/GSWeb.framework/GSWForm.m b/GSWeb.framework/GSWForm.m index 6170edd..af823ae 100644 --- a/GSWeb.framework/GSWForm.m +++ b/GSWeb.framework/GSWForm.m @@ -203,6 +203,9 @@ static char rcsId[] = "$Id$"; #endif LOGObjectFnStartC("GSWForm"); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + + GSWSaveAppendToResponseElementID(context_);//Debug Only + #if !GSWEB_STRICT _disabledInContext=[self disabledInContext:context_]; [context_ setInForm:!_disabledInContext]; @@ -242,14 +245,20 @@ static char rcsId[] = "$Id$"; BOOL _multipleSubmit=NO; int i=0; LOGObjectFnStartC("GSWForm"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); NS_DURING { + GSWAssertCorrectElementID(context_);// Debug Only _senderID=[context_ senderID]; _elementID=[context_ elementID]; - if ([_senderID hasPrefix:_elementID]) //Avoid trying to find action if we are not the good form + if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component { _isFormSubmited=[_elementID isEqualToString:_senderID]; + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s", + [self class], + [context_ elementID], + [context_ senderID], + (_isFormSubmited ? "YES" : "NO")); #if !GSWEB_STRICT if (_isFormSubmited && [self disabledInContext:context_]) _isFormSubmited=NO; @@ -260,6 +269,11 @@ static char rcsId[] = "$Id$"; [context_ _setFormSubmitted:YES]; _multipleSubmit=[self evaluateCondition:multipleSubmit inContext:context_]; + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _multipleSubmit=%s", + [self class], + [context_ elementID], + [context_ senderID], + (_multipleSubmit ? "YES" : "NO")); [context_ _setIsMultipleSubmitForm:_multipleSubmit]; }; [context_ appendZeroElementIDComponent]; @@ -276,6 +290,10 @@ static char rcsId[] = "$Id$"; if ([context_ _wasActionInvoked]) { [context_ _setIsMultipleSubmitForm:NO]; + } + else + { + NSDebugMLLog0(@"gswdync",@"formSubmitted but no action was invoked!"); }; [context_ setInForm:NO]; [context_ _setFormSubmitted:NO]; @@ -296,6 +314,13 @@ static char rcsId[] = "$Id$"; [localException raise]; } NS_ENDHANDLER; + if (![context_ _wasActionInvoked] && [[context_ elementID] compare:[context_ senderID]]!=NSOrderedAscending) + { + LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", + [self class], + [context_ elementID], + [context_ senderID]); + }; LOGObjectFnStopC("GSWForm"); return _element; }; @@ -314,11 +339,12 @@ static char rcsId[] = "$Id$"; #endif LOGObjectFnStartC("GSWForm"); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only _senderID=[context_ senderID]; _elementID=[context_ elementID]; NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID); NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID); - if ([_senderID hasPrefix:_elementID]) //Avoid taking values if we are not the good form + if ([self prefixMatchSenderIDInContext:context_]) //Avoid taking values if we are not the good form { _isFormSubmited=[_elementID isEqualToString:_senderID]; NSDebugMLLog(@"gswdync",@"_isFormSubmited=%d",(int)_isFormSubmited); diff --git a/GSWeb.framework/GSWHTMLBareString.m b/GSWeb.framework/GSWHTMLBareString.m index 6b482ab..0dbca42 100644 --- a/GSWeb.framework/GSWHTMLBareString.m +++ b/GSWeb.framework/GSWHTMLBareString.m @@ -76,6 +76,7 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only [response_ appendContentString:string]; NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); LOGObjectFnStop(); diff --git a/GSWeb.framework/GSWHTMLDynamicElement.m b/GSWeb.framework/GSWHTMLDynamicElement.m index e6a15db..1850199 100644 --- a/GSWeb.framework/GSWHTMLDynamicElement.m +++ b/GSWeb.framework/GSWHTMLDynamicElement.m @@ -345,6 +345,7 @@ static char rcsId[] = "$Id$"; //OK LOGObjectFnStartC("GSWHTMLDynamicElement"); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only if ([elementsMap length]>0) { [self appendToResponse:response_ @@ -505,7 +506,7 @@ static char rcsId[] = "$Id$"; LOGObjectFnStartC("GSWHTMLDynamicElement"); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only for(elementN=0;!_element && elementN<[elementsMap length];elementN++) { element=(BYTE)elements[elementN]; @@ -586,8 +587,8 @@ static char rcsId[] = "$Id$"; LOGObjectFnStartC("GSWHTMLDynamicElement"); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); NSDebugMLLog(@"gswdync",@"Starting HTMLDyn TV ET=%@ id=%@",[self class],[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only for(elementN=0;elementN<[elementsMap length];elementN++) { element=(BYTE)elements[elementN]; diff --git a/GSWeb.framework/GSWHTMLStaticElement.m b/GSWeb.framework/GSWHTMLStaticElement.m index b30e346..05fe676 100644 --- a/GSWeb.framework/GSWHTMLStaticElement.m +++ b/GSWeb.framework/GSWHTMLStaticElement.m @@ -290,6 +290,7 @@ static char rcsId[] = "$Id$"; GSWRequest* _request=[context_ request]; BOOL _isFromClientComponent=[_request isFromClientComponent]; //bis repetitam NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only if ([elementsMap length]>0) { [self appendToResponse:response_ @@ -355,7 +356,8 @@ static char rcsId[] = "$Id$"; CONST BYTE* elements=[elementsMap bytes]; BYTE element=0; int elementsN[3]={0,0,0}; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + GSWAssertCorrectElementID(context_);// Debug Only for(elementN=0;!_element && elementN<[elementsMap length];elementN++) { element=(BYTE)elements[elementN]; @@ -390,6 +392,7 @@ static char rcsId[] = "$Id$"; int elementsN[3]={0,0,0}; LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + GSWAssertCorrectElementID(context_);// Debug Only for(elementN=0;elementN<[elementsMap length];elementN++) { NSDebugMLLog(@"gswdync",@"elementN=%d",elementN); diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index b759407..1d37e9c 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -226,7 +226,7 @@ static char rcsId[] = "$Id$"; #endif LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); + GSWSaveAppendToResponseElementID(context_);//Debug Only if (disabled) _disabled=[self evaluateCondition:disabled inContext:context_]; @@ -561,11 +561,10 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + GSWAssertCorrectElementID(context_);// Debug Only _senderID=[context_ senderID]; - NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID); _elementID=[context_ elementID]; - NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID); if ([_elementID isEqualToString:_senderID]) { GSWComponent* _component=[context_ component]; diff --git a/GSWeb.framework/GSWImageButton.m b/GSWeb.framework/GSWImageButton.m index 217cb8f..fe1c510 100644 --- a/GSWeb.framework/GSWImageButton.m +++ b/GSWeb.framework/GSWImageButton.m @@ -287,6 +287,7 @@ static char rcsId[] = "$Id$"; GSWRequest* _request=[context_ request]; BOOL _isFromClientComponent=[_request isFromClientComponent]; BOOL _disabledInContext=[self disabledInContext:context_]; + GSWSaveAppendToResponseElementID(context_);//Debug Only if (_disabledInContext) { //TODO @@ -308,6 +309,7 @@ static char rcsId[] = "$Id$"; inContext:(GSWContext*)context_ { LOGObjectFnStart(); + GSWAssertCorrectElementID(context_);// Debug Only //Does nothing ? LOGObjectFnStop(); }; @@ -319,6 +321,8 @@ static char rcsId[] = "$Id$"; GSWElement* _element=nil; BOOL _disabledInContext=NO; LOGObjectFnStart(); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + GSWAssertCorrectElementID(context_);// Debug Only _disabledInContext=[self disabledInContext:context_]; if (!_disabledInContext) { diff --git a/GSWeb.framework/GSWInput.m b/GSWeb.framework/GSWInput.m index de7c5bf..c32ba20 100644 --- a/GSWeb.framework/GSWInput.m +++ b/GSWeb.framework/GSWInput.m @@ -148,6 +148,7 @@ static char rcsId[] = "$Id$"; //OK BOOL _disabledInContext=NO; LOGObjectFnStartC("GSWInput"); + GSWAssertCorrectElementID(context_);// Debug Only _disabledInContext=[self disabledInContext:context_]; //return 0 if (!_disabledInContext) { @@ -210,6 +211,7 @@ static char rcsId[] = "$Id$"; //OK GSWComponent* _component=nil; LOGObjectFnStartC("GSWInput"); + GSWSaveAppendToResponseElementID(context_);//Debug Only _component=[context_ component]; if (value) { diff --git a/GSWeb.framework/GSWResetButton.m b/GSWeb.framework/GSWResetButton.m index c55affb..88d0d15 100644 --- a/GSWeb.framework/GSWResetButton.m +++ b/GSWeb.framework/GSWResetButton.m @@ -55,6 +55,7 @@ static char rcsId[] = "$Id$"; -(void)takeValuesFromRequest:(GSWRequest*)request_ inContext:(GSWContext*)context_ { + GSWAssertCorrectElementID(context_);// Debug Only //Does Nothing and don't call its parent GSWInput ! }; diff --git a/GSWeb.framework/GSWStatisticsStore.m b/GSWeb.framework/GSWStatisticsStore.m index 73b2ff0..6d1e578 100644 --- a/GSWeb.framework/GSWStatisticsStore.m +++ b/GSWeb.framework/GSWStatisticsStore.m @@ -616,6 +616,7 @@ static char rcsId[] = "$Id$"; struct rusage _rusage; int i=0; LOGObjectFnStart(); +//Use NSRealMemoryAvailable ?? for(i=0;i<2;i++) { memset(&_rusage,0,sizeof(_rusage)); diff --git a/GSWeb.framework/GSWSubmitButton.m b/GSWeb.framework/GSWSubmitButton.m index 5ab61cc..e6b537c 100644 --- a/GSWeb.framework/GSWSubmitButton.m +++ b/GSWeb.framework/GSWSubmitButton.m @@ -84,6 +84,7 @@ static char rcsId[] = "$Id$"; { //OK LOGObjectFnStart(); + GSWSaveAppendToResponseElementID(context_);//Debug Only [super appendToResponse:response_ inContext:context_]; LOGObjectFnStop(); @@ -97,8 +98,10 @@ static char rcsId[] = "$Id$"; GSWElement* _element=nil; BOOL _disabled=NO; LOGObjectFnStart(); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); NS_DURING { + GSWAssertCorrectElementID(context_);// Debug Only _disabled=[self disabledInContext:context_]; if (!_disabled) { @@ -115,6 +118,10 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"_formValue=%@",_formValue); if (_formValue) _invoked=YES; + else + { + NSDebugMLLog(@"gswdync",@"[request_ formValueKeys]=%@",[request_ formValueKeys]); + }; } else _invoked=YES; @@ -155,6 +162,13 @@ static char rcsId[] = "$Id$"; [localException raise]; } NS_ENDHANDLER; + if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]!=NSOrderedAscending) + { + LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", + [self class], + [context_ elementID], + [context_ senderID]); + }; LOGObjectFnStop(); return _element; }; @@ -164,6 +178,7 @@ static char rcsId[] = "$Id$"; inContext:(GSWContext*)context_ { //Does Nothing ? + GSWAssertCorrectElementID(context_);// Debug Only }; //-------------------------------------------------------------------- diff --git a/GSWeb.framework/GSWTextField.m b/GSWeb.framework/GSWTextField.m index 315960a..b9738ee 100644 --- a/GSWeb.framework/GSWTextField.m +++ b/GSWeb.framework/GSWTextField.m @@ -80,6 +80,7 @@ static char rcsId[] = "$Id$"; //OK BOOL _disabled=NO; LOGObjectFnStartC("GSWTextField"); + GSWAssertCorrectElementID(context_);// Debug Only _disabled=[self disabledInContext:context_]; if (!_disabled) { @@ -105,13 +106,13 @@ static char rcsId[] = "$Id$"; { NSException* _exception=nil; NSString* _valueKeyPath=[value keyPath]; - LOGException0(@"EOValidationException"); + LOGException(@"EOValidationException _resultValue=%@ _valueKeyPath=%@",_resultValue,_valueKeyPath); _exception=[NSException exceptionWithName:@"EOValidationException" reason:_errorDscr /*_exceptionDscr*/ userInfo:[NSDictionary dictionaryWithObjectsAndKeys: - @"EOValidatedObjectUserInfoKey",_resultValue, - @"EOValidatedPropertyUserInfoKey",_valueKeyPath, + (_resultValue ? _resultValue : @"nil"),@"EOValidatedObjectUserInfoKey", + _valueKeyPath,@"EOValidatedPropertyUserInfoKey", nil,nil]]; [_component validationFailedWithException:_exception value:_resultValue diff --git a/GSWeb.framework/GSWUtils.h b/GSWeb.framework/GSWUtils.h index 9f7e978..d10e7c1 100644 --- a/GSWeb.framework/GSWUtils.h +++ b/GSWeb.framework/GSWUtils.h @@ -39,6 +39,9 @@ #define IsStyle(__value,__style) ((((__value)&(__style))==(__style)) ? YES : NO) #define IsNumberStyle(__value,__style) (((([__value unsignedIntValue])&(__style))==(__style)) ? YES : NO) +#define VOID_RCSID \ +static void VoidUseRCSId() { rcsId[0]=0; }; + typedef unsigned char BYTE; #define allFrameworks tmpAllFrameworks