diff --git a/ChangeLog b/ChangeLog index fa24c16..0e79bd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,109 @@ +2002-05-xx Manuel Guesdon + * GSWeb.framework/GSWTextField.m: + o added warning in _isFormattedValueInComponent:equalToFormattedValue: + o added warning in takeValuesFromRequest:inContext: + * GSWeb.framework/GSWPopUpButton.m + o added ElementID debugging methods + o added DocStructure debugging features + * GSWeb.framework/GSWSwitchComponent.m + o added ElementID debugging methods + o added DocStructure debugging features + * GSWeb.framework/GSWRepetition.m + o added ElementID debugging methods + o added DocStructure debugging features + o param names changes to conform to coding standards + * GSWeb.framework/GSWComponentContent.m + o added ElementID debugging methods + o added DocStructure debugging features + * GSWeb.framework/GSWComponentReference.m: + o added ElementID debugging methods + o added DocStructure debugging features + o ivar names changes to conform to coding standards + o logs + * GSWeb.framework/GSWElement.m: + o added ElementID debugging methods + o added DocStructure debugging features + o logs + * GSWeb.framework/GSWElement.h + o added ElementID debugging + * GSWeb.framework/GSWForm.m: + o added ElementID debugging + o added DocStructure debugging features + o logs + * GSWeb.framework/GSWHTMLDynamicElement.m: + o ivar names changes to conform to coding standards + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWConditional.m: + o added ElementID debugging + o added DocStructure debugging features + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWConditional.h. + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWRepetition.h. + o param names changes to conform to coding standards + * GSWeb.framework/GSWReset.m: + o ivar names changes to conform to coding standards + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWReset.h. + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWResponse.h/.m: + o added DocStructure debugging features + * GSWeb.framework/GSWContext.h/.m: + o added DocStructure debugging features + * GSWeb.framework/GSWSession.m: + o added DocStructure debugging features + * GSWeb.framework/GSWTemplateParserXML.m + o logs + * GSWeb.framework/GSWTemplateParser.m + o logs + * GSWeb.framework/GSWDisplayGroup.m: + o corrected insertion bugs + o added -insertAfterLastObject + o added -selectFirst + * GSWeb.framework/GSWDisplayGroup.h: + o added -insertAfterLastObject + o added -selectFirst + * GSWeb.framework/GSWHTMLStaticElement.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWCheckBox.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWComponent.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWHTMLStaticGroup.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWTextField.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWString.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWSubmitButton.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWURLValuedElementData.m/.h: + o added ElementID debugging + o added DocStructure debugging features + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWRadioButton.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWInput.m + o added ElementID debugging + o added DocStructure debugging features + o logs + * GSWeb.framework/GSWHyperlink.m + o added ElementID debugging + o added DocStructure debugging features + * GSWeb.framework/GSWFileUpload.m + o added ElementID debugging + o added DocStructure debugging features + 2002-05-14 Manuel Guesdon * GSWeb.framework/GSWSubmitButton.m: o corrected setActionInvoked into _setActionInvoked @@ -27,7 +133,7 @@ * GSWeb.framework/GSWText.m: o handling exception in takeValue * GSWeb.framework/GSWInput.m: - o corrected bug in akeValuesFromRequest:inContext: + o corrected bug in takeValuesFromRequest:inContext: * GSWExtensionsGSW.framework: o added GSWFileUploadComponent * GSWExtensionsGSW.framework/GNUmakefile diff --git a/GSWExtensionsGSW.framework/GSWLogin.m b/GSWExtensionsGSW.framework/GSWLogin.m index 27c9be6..8cf95f6 100644 --- a/GSWExtensionsGSW.framework/GSWLogin.m +++ b/GSWExtensionsGSW.framework/GSWLogin.m @@ -29,9 +29,8 @@ { LOGObjectFnStart(); if ((self=[super init])) - { - NSDebugMLog(@"associationsKeys=%@",associationsKeys); - }; + { + }; LOGObjectFnStop(); return self; }; @@ -74,7 +73,6 @@ BOOL _bindingOk=NO; LOGObjectFnStart(); NSDebugMLog(@"user=%@ password=%@",user,password); - NSDebugMLog(@"associationsKeys=%@",associationsKeys); NS_DURING { if ([self hasBinding:@"password"]) diff --git a/GSWeb.framework/GSWApplication.m b/GSWeb.framework/GSWApplication.m index a03f3ea..981afc7 100644 --- a/GSWeb.framework/GSWApplication.m +++ b/GSWeb.framework/GSWApplication.m @@ -2605,6 +2605,7 @@ int GSWApplicationMain(NSString* applicationClassName, GSWResponse* _response=nil; LOGObjectFnStart(); NSDebugMLLog(@"application",@"context=%@",context_); + NSDebugMLog(@"EXCEPTION=%@",exception_); NS_DURING { _response=[self _handleException:exception_ diff --git a/GSWeb.framework/GSWCheckBox.m b/GSWeb.framework/GSWCheckBox.m index 3729fc1..fd248ac 100644 --- a/GSWeb.framework/GSWCheckBox.m +++ b/GSWeb.framework/GSWCheckBox.m @@ -144,6 +144,8 @@ static char rcsId[] = "$Id$"; //OK BOOL disabledInContext=NO; LOGObjectFnStartC("GSWCheckBox"); + GSWStartElement(context); + GSWAssertCorrectElementID(context); disabledInContext=[self disabledInContext:context]; if (!disabledInContext) { @@ -212,6 +214,8 @@ static char rcsId[] = "$Id$"; }; }; }; + GSWStopElement(context); + GSWAssertIsElementID(context); LOGObjectFnStopC("GSWCheckBox"); }; diff --git a/GSWeb.framework/GSWComponent.m b/GSWeb.framework/GSWComponent.m index 2eafbf2..def8b5a 100644 --- a/GSWeb.framework/GSWComponent.m +++ b/GSWeb.framework/GSWComponent.m @@ -559,6 +559,7 @@ associationsKeys:(NSArray*)associationsKeys NSDebugMLLog(@"gswcomponents",@"subComponents=%@",_subComponents); subc=[_subComponents objectForKey:elementId]; NSDebugMLLog(@"gswcomponents",@"subc=%@",subc); + NSDebugMLog(@"subComponent %@ for _elementId=%@",[subc class],elementId); LOGObjectFnStop(); return subc; }; @@ -569,6 +570,7 @@ associationsKeys:(NSArray*)associationsKeys { //OK LOGObjectFnStart(); + NSDebugMLog(@"setSubComponent %@ for _elementId=%@",[component class],elementId); NSDebugMLLog(@"gswcomponents",@"elementId=%@",elementId); NSDebugMLLog(@"gswcomponents",@"component=%@",component); NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents); @@ -981,13 +983,15 @@ associationsKeys:(NSArray*)associationsKeys GSWElementIDString* debugElementID=[aContext elementID]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); - GSWSaveAppendToResponseElementID(aContext);//Debug Only + GSWStartElement(aContext); + GSWSaveAppendToResponseElementID(aContext); template=[self _template]; + +#ifndef NDEBUG if(GSDebugSet(@"gswcomponents") == YES) - [aResponse appendContentString:[NSString stringWithFormat:@"\n\n",[self _templateName]]];//TODO enlever + [aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]]; +#endif request=[aContext request]; isFromClientComponent=[request isFromClientComponent]; @@ -995,6 +999,8 @@ associationsKeys:(NSArray*)associationsKeys [aContext appendZeroElementIDComponent]; NS_DURING { + [aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",[self definitionName],[aContext elementID]]]; + NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]); [template appendToResponse:aResponse inContext:aContext]; } @@ -1010,8 +1016,7 @@ associationsKeys:(NSArray*)associationsKeys NS_ENDHANDLER; [aContext deleteLastElementIDComponent]; - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); + GSWStopElement(aContext); #ifndef NDEBUG if (![debugElementID isEqualToString:[aContext elementID]]) { @@ -1023,6 +1028,7 @@ associationsKeys:(NSArray*)associationsKeys [aResponse appendContentString:[NSString stringWithFormat:@"\n\n", [self _templateName]]];//TODO enlever + GSWAssertIsElementID(aContext); LOGObjectFnStop(); }; @@ -1039,11 +1045,10 @@ associationsKeys:(NSArray*)associationsKeys GSWElementIDString* debugElementID=[aContext elementID]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); + GSWStartElement(aContext); NS_DURING { - GSWAssertCorrectElementID(aContext);// Debug Only + GSWAssertCorrectElementID(aContext); template=[self _template]; [aContext appendZeroElementIDComponent]; element=[[self _template] invokeActionForRequest:aRequest @@ -1060,8 +1065,7 @@ associationsKeys:(NSArray*)associationsKeys [localException raise]; } NS_ENDHANDLER; - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); + GSWStopElement(aContext); #ifndef NDEBUG if (![debugElementID isEqualToString:[aContext elementID]]) { @@ -1079,6 +1083,7 @@ associationsKeys:(NSArray*)associationsKeys [aContext elementID], [aContext senderID]); }; + GSWAssertIsElementID(aContext); LOGObjectFnStop(); return element; }; @@ -1096,20 +1101,19 @@ associationsKeys:(NSArray*)associationsKeys GSWElementIDString* debugElementID=[aContext elementID]; #endif LOGObjectFnStart(); - GSWAssertCorrectElementID(aContext);// Debug Only + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); [_validationFailureMessages removeAllObjects]; oldValidateFlag=[aContext isValidate]; [aContext setValidate:YES]; - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); template=[self _template]; [aContext appendZeroElementIDComponent]; + NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]); [template takeValuesFromRequest:aRequest inContext:aContext]; [aContext deleteLastElementIDComponent]; - NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); - NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); + GSWStopElement(aContext); #ifndef NDEBUG if (![debugElementID isEqualToString:[aContext elementID]]) { @@ -1119,6 +1123,7 @@ associationsKeys:(NSArray*)associationsKeys }; #endif [aContext setValidate:oldValidateFlag]; + GSWAssertIsElementID(aContext); LOGObjectFnStop(); }; @@ -1382,8 +1387,6 @@ associationsKeys:(NSArray*)associationsKeys { NSArray* languages=nil; LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"[self context]=%p",(void*)[self context]); - NSDebugMLLog(@"gswcomponents",@"[self context]=%@",[self context]); languages=[[self context] languages]; LOGObjectFnStop(); return languages; diff --git a/GSWeb.framework/GSWComponentContent.m b/GSWeb.framework/GSWComponentContent.m index 6aebcce..7fdd3b8 100644 --- a/GSWeb.framework/GSWComponentContent.m +++ b/GSWeb.framework/GSWComponentContent.m @@ -49,6 +49,7 @@ static char rcsId[] = "$Id$"; LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@", [self class],[self definitionName],[aContext elementID]); + GSWSaveAppendToResponseElementID(aContext);//Debug Only component=[aContext component]; childTemplate=[component _childTemplate]; parent=[component parent]; @@ -114,6 +115,7 @@ static char rcsId[] = "$Id$"; LOGObjectFnStart(); NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@", [self class],[self definitionName],[aContext elementID]); + GSWAssertCorrectElementID(aContext);// Debug Only component=[aContext component]; childTemplate=[component _childTemplate]; parent=[component parent]; diff --git a/GSWeb.framework/GSWComponentReference.h b/GSWeb.framework/GSWComponentReference.h index 2d34d74..28fc28e 100644 --- a/GSWeb.framework/GSWComponentReference.h +++ b/GSWeb.framework/GSWComponentReference.h @@ -1,11 +1,18 @@ -/* GSWComponentReference.h - GSWeb: Class GSWComponentReference - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWComponentReference.h - GSWeb: Class GSWComponentReference + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -29,39 +37,39 @@ //==================================================================== @interface GSWComponentReference: GSWDynamicElement { - NSString* name; - NSArray* associationsKeys; - NSArray* associations; - GSWElement* contentElement; + NSString* _name; + NSArray* _associationsKeys; + NSArray* _associations; + GSWElement* _contentElement; }; -(void)dealloc; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)template_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)template; -(NSString*)description; @end //==================================================================== @interface GSWComponentReference (GSWComponentReferenceA) --(void)popRefComponentInContext:(GSWContext*)context_; --(void)pushRefComponentInContext:(GSWContext*)context_; +-(void)popRefComponentInContext:(GSWContext*)aContext; +-(void)pushRefComponentInContext:(GSWContext*)aContext; @end //==================================================================== @interface GSWComponentReference (GSWRequestHandling) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; @end #endif //_GSWComponentReference_h__ diff --git a/GSWeb.framework/GSWComponentReference.m b/GSWeb.framework/GSWComponentReference.m index efd374c..d4f1466 100644 --- a/GSWeb.framework/GSWComponentReference.m +++ b/GSWeb.framework/GSWComponentReference.m @@ -1,11 +1,18 @@ -/* GSWComponentReference.m - GSWeb: Class GSWComponentReference - Copyright (C) 1999 Free Software Foundation, Inc. +/* GSWComponentReference.m - GSWeb: Class GSWComponentReference + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -29,28 +37,28 @@ static char rcsId[] = "$Id$"; @implementation GSWComponentReference //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations { LOGObjectFnStart(); //OK - NSDebugMLLog(@"gswdync",@"name:%@",name); - NSDebugMLLog(@"gswdync",@"associations_:%@",associations_); - if ((self==[super initWithName:name_ - associations:associations_ + NSDebugMLLog(@"gswdync",@"aName:%@",aName); + NSDebugMLLog(@"gswdync",@"associations:%@",associations); + if ((self==[super initWithName:aName + associations:associations template:nil])) { - ASSIGN(name,name_); - if (associations_ && [associations_ count]) + ASSIGN(_name,aName); + if (associations && [associations count]) { NSMutableArray* tmpArray=[NSMutableArray array]; int i=0; - ASSIGN(associationsKeys,[associations_ allKeys]); - for(i=0;i<[associationsKeys count];i++) + ASSIGN(_associationsKeys,[associations allKeys]); + for(i=0;i<[_associationsKeys count];i++) { - [tmpArray addObject:[associations_ objectForKey:[associationsKeys objectAtIndex:i]]]; + [tmpArray addObject:[associations objectForKey:[_associationsKeys objectAtIndex:i]]]; }; - ASSIGN(associations,[NSArray arrayWithArray:tmpArray]); + ASSIGN(_associations,[NSArray arrayWithArray:tmpArray]); }; }; LOGObjectFnStop(); @@ -58,19 +66,19 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)_template +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)template { LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"name:%@",name); - NSDebugMLLog(@"gswdync",@"associations_:%@",associations_); - NSDebugMLLog(@"gswdync",@"_template:%@",_template); - if ((self==[self initWithName:name_ - associations:associations_])) - { - ASSIGN(contentElement,_template); - }; + NSDebugMLLog(@"gswdync",@"aName:%@",aName); + NSDebugMLLog(@"gswdync",@"associations:%@",associations); + NSDebugMLLog(@"gswdync",@"template:%@",template); + if ((self==[self initWithName:aName + associations:associations])) + { + ASSIGN(_contentElement,template); + }; LOGObjectFnStop(); return self; }; @@ -80,13 +88,13 @@ static char rcsId[] = "$Id$"; { GSWLogC("Dealloc GSWComponentReference"); GSWLogC("Destroy name"); - DESTROY(name); + DESTROY(_name); GSWLogC("Destroy associationsKeys"); - DESTROY(associationsKeys); + DESTROY(_associationsKeys); GSWLogC("Destroy associations"); - DESTROY(associations); + DESTROY(_associations); GSWLogC("Destroy contentElement"); - DESTROY(contentElement); + DESTROY(_contentElement); GSWLogC("Dealloc GSWComponentReference Super"); [super dealloc]; GSWLogC("End Dealloc GSWComponentReference"); @@ -96,91 +104,93 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%@ %p name:%@ associationsKeys:%@ associations:%@ contentElement:%@>", - [self class], - (void*)self, - name, - associationsKeys, - associations, - contentElement]; + [self class], + (void*)self, + _name, + _associationsKeys, + _associations, + _contentElement]; }; @end //==================================================================== @implementation GSWComponentReference (GSWComponentReferenceA) --(void)popRefComponentInContext:(GSWContext*)_context +-(void)popRefComponentInContext:(GSWContext*)context { //OK - GSWComponent* _subComponent=nil; - GSWComponent* _component=nil; + GSWComponent* subComponent=nil; + GSWComponent* component=nil; LOGObjectFnStart(); - _subComponent=[_context component]; - _component=[_subComponent parent]; - [_subComponent synchronizeComponentToParent]; - [_context _setCurrentComponent:_component]; + subComponent=[context component]; + component=[subComponent parent]; + [subComponent synchronizeComponentToParent]; + [context _setCurrentComponent:component]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)pushRefComponentInContext:(GSWContext*)_context +-(void)pushRefComponentInContext:(GSWContext*)context { //OK - GSWComponent* _subComponent=nil; - GSWComponentDefinition* _subComponentDefinition=nil; - GSWComponent* _component=nil; - NSString* _elementID=nil; + GSWComponent* subComponent=nil; + GSWComponentDefinition* subComponentDefinition=nil; + GSWComponent* component=nil; + NSString* elementID=nil; LOGObjectFnStart(); - _component=[_context component]; - _elementID=[_context elementID]; - NSDebugMLLog(@"gswdync",@"_elementID:%@",_elementID); - _subComponent=[_component subComponentForElementID:_elementID]; - NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent); - if (!_subComponent) - { - NSArray* _languages=[_context languages]; - NSDebugMLLog(@"gswdync",@"name:%@",name); - NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p", - (void*)self, - (void*)_component); - _subComponentDefinition=[GSWApp componentDefinitionWithName:name - languages:_languages]; - NSDebugMLLog(@"gswdync",@"_subComponentDefinition=%@",_subComponentDefinition); - if (_subComponentDefinition) - { - _subComponent=[_subComponentDefinition componentInstanceInContext:_context]; - NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent); - if (_subComponent) - { - NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p", - (void*)self, - (void*)_component, - (void*)_subComponent); - [_subComponent setParent:_component - associationsKeys:associationsKeys - associations:associations - template:contentElement]; - } - else - { - ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'",name); - }; - } - else - { - ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'",name); - }; - if (_subComponent) - { - [_component setSubComponent:_subComponent - forElementID:_elementID]; - [_subComponent awakeInContext:_context]; - }; - }; - if (_subComponent) - { - [_subComponent synchronizeParentToComponent]; - }; - [_context _setCurrentComponent:_subComponent]; + component=[context component]; + elementID=[context elementID]; + NSDebugMLLog(@"gswdync",@"_elementID:%@",elementID); + subComponent=[component subComponentForElementID:elementID]; + NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent); + if (!subComponent) + { + NSArray* languages=[context languages]; + NSDebugMLLog(@"gswdync",@"name:%@",_name); + NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p", + (void*)self, + (void*)component); + subComponentDefinition=[GSWApp componentDefinitionWithName:_name + languages:languages]; + NSDebugMLLog(@"gswdync",@"subComponentDefinition=%@",subComponentDefinition); + if (subComponentDefinition) + { + subComponent=[subComponentDefinition componentInstanceInContext:context]; + NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent); + if (subComponent) + { + NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p", + (void*)self, + (void*)component, + (void*)subComponent); + [subComponent setParent:component + associationsKeys:_associationsKeys + associations:_associations + template:_contentElement]; + } + else + { + ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'", + _name); + }; + } + else + { + ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'", + _name); + }; + if (subComponent) + { + [component setSubComponent:subComponent + forElementID:elementID]; + [subComponent awakeInContext:context]; + }; + }; + if (subComponent) + { + [subComponent synchronizeParentToComponent]; + }; + [context _setCurrentComponent:subComponent]; LOGObjectFnStop(); }; @@ -191,99 +201,105 @@ static char rcsId[] = "$Id$"; @implementation GSWComponentReference (GSWRequestHandling) //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)response + inContext:(GSWContext*)context { //OK - GSWComponent* _component=nil; - GSWComponent* _componentPrev=nil; + GSWComponent* component=nil; + GSWComponent* componentPrev=nil; #ifndef NDEBBUG - int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; + int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - GSWSaveAppendToResponseElementID(context_);//Debug Only - _componentPrev=[context_ component]; - [self pushRefComponentInContext:context_]; - if ([context_ component]) - { - _component=[context_ component]; - [_component appendToResponse:response_ - inContext:context_]; - [self popRefComponentInContext:context_]; - } + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); + [response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@", + [self definitionName], + [context elementID]]]; + componentPrev=[context component]; + [self pushRefComponentInContext:context]; + if ([context component]) + { + component=[context component]; + [component appendToResponse:response + inContext:context]; + [self popRefComponentInContext:context]; + } else - [context_ _setCurrentComponent:_componentPrev]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + [context _setCurrentComponent:componentPrev]; + GSWStopElement(context); #ifndef NDEBBUG - NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb], - @"GSWComponentReference appendToResponse: bad elementID"); + NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], + @"GSWComponentReference appendToResponse: bad elementID"); #endif LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)request + inContext:(GSWContext*)context { - GSWElement* _element=nil; - GSWComponent* _component=nil; - GSWComponent* _componentPrev=nil; + GSWElement* element=nil; + GSWComponent* component=nil; + GSWComponent* componentPrev=nil; #ifndef NDEBBUG - int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; + int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); - _componentPrev=[context_ component]; - GSWAssertCorrectElementID(context_);// Debug Only - [self pushRefComponentInContext:context_]; - if ([context_ component]) - { - if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component - { - _component=[context_ component]; - _element=[_component invokeActionForRequest:request_ - inContext:context_]; - }; - [self popRefComponentInContext:context_]; - } + GSWStartElement(context); + GSWAssertCorrectElementID(context); + NSDebugMLLog(@"gswdync",@"senderId=%@",[context senderID]); + componentPrev=[context component]; + [self pushRefComponentInContext:context]; + if ([context component]) + { + if ([self prefixMatchSenderIDInContext:context]) //Avoid trying to find action if we are not the good component + { + component=[context component]; + element=[component invokeActionForRequest:request + inContext:context]; + }; + [self popRefComponentInContext:context]; + } else - [context_ _setCurrentComponent:_componentPrev]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + [context _setCurrentComponent:componentPrev]; + GSWStopElement(context); #ifndef NDEBBUG - NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference invokeActionForRequest: bad elementID"); + NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], + @"GSWComponentReference invokeActionForRequest: bad elementID"); #endif LOGObjectFnStop(); - return _element; + return element; }; //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(void)takeValuesFromRequest:(GSWRequest*)request + inContext:(GSWContext*)context { //OK - GSWComponent* _component=nil; - GSWComponent* _componentPrev=nil; + GSWComponent* component=nil; + GSWComponent* componentPrev=nil; #ifndef NDEBBUG - int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; + int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - GSWAssertCorrectElementID(context_);// Debug Only - _componentPrev=[context_ component]; - [self pushRefComponentInContext:context_]; - if ([context_ component]) - { - _component=[context_ component]; - [_component takeValuesFromRequest:request_ - inContext:context_]; - [self popRefComponentInContext:context_]; - } + GSWStartElement(context); + GSWAssertCorrectElementID(context); + componentPrev=[context component]; + [self pushRefComponentInContext:context]; + if ([context component]) + { + component=[context component]; + [component takeValuesFromRequest:request + inContext:context]; + [self popRefComponentInContext:context]; + } else - [context_ _setCurrentComponent:_componentPrev]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + [context _setCurrentComponent:componentPrev]; + GSWStopElement(context); #ifndef NDEBBUG - NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference takeValuesFromRequest: bad elementID"); + NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], + @"GSWComponentReference takeValuesFromRequest: bad elementID"); #endif LOGObjectFnStop(); }; diff --git a/GSWeb.framework/GSWConditional.h b/GSWeb.framework/GSWConditional.h index f3a2d00..dfa8d97 100644 --- a/GSWeb.framework/GSWConditional.h +++ b/GSWeb.framework/GSWConditional.h @@ -1,11 +1,18 @@ -/* GSWConditional.h - GSWeb: Class GSWConditional - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWConditional.h - GSWeb: Class GSWConditional + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -30,17 +38,17 @@ //==================================================================== @interface GSWConditional: GSWDynamicElement { - GSWAssociation* condition; - GSWAssociation* negate; - GSWHTMLStaticGroup* childrenGroup; + GSWAssociation* _condition; + GSWAssociation* _negate; + GSWHTMLStaticGroup* _childrenGroup; }; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; -(NSString*)description; -(void)dealloc; @@ -48,14 +56,14 @@ //==================================================================== @interface GSWConditional (GSWConditionalA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; @end diff --git a/GSWeb.framework/GSWConditional.m b/GSWeb.framework/GSWConditional.m index ab789f6..2aeb651 100644 --- a/GSWeb.framework/GSWConditional.m +++ b/GSWeb.framework/GSWConditional.m @@ -1,11 +1,18 @@ -/* GSWConditional.m - GSWeb: Class GSWConditional - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWConditional.m - GSWeb: Class GSWConditional + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -29,38 +37,41 @@ static char rcsId[] = "$Id$"; @implementation GSWConditional //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)someAssociations - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)someAssociations + template:(GSWElement*)templateElement { //OK LOGObjectFnStart(); - self=[self initWithName:name_ - associations:someAssociations - contentElements:templateElement_ ? [NSArray arrayWithObject:templateElement_] : nil]; + if ((self=[self initWithName:aName + associations:someAssociations + contentElements:templateElement ? [NSArray arrayWithObject:templateElement] : nil])) + { + }; LOGObjectFnStop(); return self; }; //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)_elements +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements { LOGObjectFnStart(); - if ((self=[super initWithName:name_ - associations:nil - template:nil])) - { - if (_elements) - childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:_elements]; - condition = [[associations_ objectForKey:condition__Key - withDefaultObject:[condition autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",condition); - negate = [[associations_ objectForKey:negate__Key - withDefaultObject:[negate autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",negate); - }; + if ((self=[super initWithName:aName + associations:nil + template:nil])) + { + if (elements) + _childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements]; + + _condition = [[associations objectForKey:condition__Key + withDefaultObject:[_condition autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",_condition); + _negate = [[associations objectForKey:negate__Key + withDefaultObject:[_negate autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",_negate); + }; LOGObjectFnStop(); return self; }; @@ -68,11 +79,20 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(condition); - DESTROY(negate); + DESTROY(_condition); + DESTROY(_negate); + DESTROY(_childrenGroup); [super dealloc]; } +//-------------------------------------------------------------------- +-(void)setDefinitionName:(NSString*)definitionName +{ + [super setDefinitionName:definitionName]; + if (definitionName && _childrenGroup) + [_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]]; +}; + //-------------------------------------------------------------------- -(NSString*)description { @@ -85,123 +105,126 @@ static char rcsId[] = "$Id$"; @implementation GSWConditional (GSWConditionalA) //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { //OK - BOOL _condition=NO; - BOOL _negate=NO; - BOOL _doIt=NO; + BOOL condition=NO; + BOOL negate=NO; + 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 - inContext:context_]; - _doIt=_condition; - NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ elementID]); - if (_negate) - _doIt=!_doIt; - NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s", + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); + condition=[self evaluateCondition:_condition + inContext:aContext]; + negate=[self evaluateCondition:_negate + inContext:aContext]; + doIt=condition; + NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]); + if (negate) + doIt=!doIt; + NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s", [self definitionName], - condition, - negate, - (_condition ? "YES" : "NO"), - (_negate ? "YES" : "NO"), - (_doIt ? "YES" : "NO")); - if (_doIt) - { - GSWRequest* _request=[context_ request]; - BOOL _isFromClientComponent=[_request isFromClientComponent]; - [context_ appendZeroElementIDComponent]; - [childrenGroup takeValuesFromRequest:request_ - inContext:context_]; - [context_ deleteLastElementIDComponent]; - }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); - LOGObjectFnStop(); -}; - -//-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ -{ - //OK - GSWElement* _element=nil; - BOOL _condition=NO; - BOOL _negate=NO; - BOOL _doIt=NO; - LOGObjectFnStart(); - 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 - inContext:context_]; - _doIt=_condition; - if (_negate) - _doIt=!_doIt; - NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s", - [self definitionName], - condition, - negate, - (_condition ? "YES" : "NO"), - (_negate ? "YES" : "NO"), - (_doIt ? "YES" : "NO")); - if (_doIt) + _condition, + _negate, + (condition ? "YES" : "NO"), + (negate ? "YES" : "NO"), + (doIt ? "YES" : "NO")); + if (doIt) { - GSWRequest* _request=[context_ request]; - BOOL _isFromClientComponent=[_request isFromClientComponent]; - [context_ appendZeroElementIDComponent]; - NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup); - _element=[childrenGroup invokeActionForRequest:request_ - inContext:context_]; - NSDebugMLLog(@"gswdync",@"_element=%@",_element); - [context_ deleteLastElementIDComponent]; + GSWRequest* _request=[aContext request]; + BOOL isFromClientComponent=[_request isFromClientComponent]; + [aContext appendZeroElementIDComponent]; + [_childrenGroup takeValuesFromRequest:aRequest + inContext:aContext]; + [aContext deleteLastElementIDComponent]; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + GSWStopElement(aContext); + GSWAssertIsElementID(aContext); LOGObjectFnStop(); - return _element; }; //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { //OK - BOOL _condition=NO; - BOOL _negate=NO; - BOOL _doIt=NO; + GSWElement* element=nil; + BOOL condition=NO; + BOOL negate=NO; + 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"); - _negate=[self evaluateCondition:negate - inContext:context_]; - NSDebugMLLog(@"gswdync",@"_negate=%s",_negate ? "YES" : "NO"); - _doIt=_condition; - if (_negate) - _doIt=!_doIt; - NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s", + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); + condition=[self evaluateCondition:_condition + inContext:aContext]; + negate=[self evaluateCondition:_negate + inContext:aContext]; + doIt=condition; + if (negate) + doIt=!doIt; + NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s", [self definitionName], - condition, - negate, - (_condition ? "YES" : "NO"), - (_negate ? "YES" : "NO"), - (_doIt ? "YES" : "NO")); - if (_doIt) - { - GSWRequest* _request=[context_ request]; - BOOL _isFromClientComponent=[_request isFromClientComponent]; - [context_ appendZeroElementIDComponent]; - [childrenGroup appendToResponse:response_ - inContext:context_]; - [context_ deleteLastElementIDComponent]; - }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + _condition, + _negate, + (condition ? "YES" : "NO"), + (negate ? "YES" : "NO"), + (doIt ? "YES" : "NO")); + if (doIt) + { + GSWRequest* request=[aContext request]; + BOOL isFromClientComponent=[request isFromClientComponent]; + [aContext appendZeroElementIDComponent]; + NSDebugMLLog(@"gswdync",@"childrenGroup=%@",_childrenGroup); + element=[_childrenGroup invokeActionForRequest:aRequest + inContext:aContext]; + NSDebugMLLog(@"gswdync",@"element=%@",element); + [aContext deleteLastElementIDComponent]; + }; + GSWStopElement(aContext); + GSWAssertIsElementID(aContext); + LOGObjectFnStop(); + return element; +}; + +//-------------------------------------------------------------------- +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext +{ + //OK + BOOL condition=NO; + BOOL negate=NO; + BOOL doIt=NO; + LOGObjectFnStart(); + GSWStartElement(aContext); + GSWSaveAppendToResponseElementID(aContext); + condition=[self evaluateCondition:_condition + inContext:aContext]; + NSDebugMLLog(@"gswdync",@"condition=%s",condition ? "YES" : "NO"); + negate=[self evaluateCondition:_negate + inContext:aContext]; + NSDebugMLLog(@"gswdync",@"negate=%s",negate ? "YES" : "NO"); + doIt=condition; + if (negate) + doIt=!doIt; + NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s", + [self definitionName], + _condition, + _negate, + (condition ? "YES" : "NO"), + (negate ? "YES" : "NO"), + (doIt ? "YES" : "NO")); + if (doIt) + { + GSWRequest* request=[aContext request]; + BOOL isFromClientComponent=[request isFromClientComponent]; + [aContext appendZeroElementIDComponent]; + [_childrenGroup appendToResponse:aResponse + inContext:aContext]; + [aContext deleteLastElementIDComponent]; + }; + GSWStopElement(aContext); + GSWAssertIsElementID(aContext); LOGObjectFnStop(); }; diff --git a/GSWeb.framework/GSWContext.h b/GSWeb.framework/GSWContext.h index 7269e0e..106025d 100644 --- a/GSWeb.framework/GSWContext.h +++ b/GSWeb.framework/GSWContext.h @@ -54,6 +54,11 @@ BOOL formSubmitted; BOOL isMultipleSubmitForm; BOOL isValidate; +#ifndef NDEBUG + int _loopLevel; //ForDebugging purpose: each repetition increment and next decrement it + NSMutableString* _docStructure; //ForDebugging purpose: array of all objects if the document during appendResponse, takeValues, invokeAction + NSMutableSet* _docStructureElements; +#endif }; -(id)init; @@ -75,6 +80,14 @@ -(NSString*)contextID; -(id)initWithRequest:(GSWRequest*)_request; +#ifndef NDEBUG +-(void)incrementLoopLevel; //ForDebugging purpose: each repetition increment and next decrement it +-(void)decrementLoopLevel; +-(BOOL)isInLoop; +-(void)addToDocStructureElement:(id)element; +-(void)addDocStructureStep:(NSString*)stepLabel; +-(NSString*)docStructure; +#endif @end //==================================================================== diff --git a/GSWeb.framework/GSWContext.m b/GSWeb.framework/GSWContext.m index 5a7dcdc..c2ffa07 100644 --- a/GSWeb.framework/GSWContext.m +++ b/GSWeb.framework/GSWContext.m @@ -75,6 +75,10 @@ static int dontTraceComponentActionURL=0; DESTROY(url); NSDebugFLog0(@"Release GSWContext awakePageComponents"); DESTROY(awakePageComponents); +#ifndef NDEBUG + DESTROY(_docStructure); + DESTROY(_docStructureElements); +#endif NSDebugFLog0(@"Dealloc GSWContext super"); [super dealloc]; NSDebugFLog0(@"end Dealloc GSWContext"); @@ -254,6 +258,68 @@ static int dontTraceComponentActionURL=0; return senderID; }; +#ifndef NDEBUG +-(void)incrementLoopLevel //ForDebugging purpose: each repetition increment and next decrement it +{ + _loopLevel++; +}; +-(void)decrementLoopLevel +{ + _loopLevel--; +}; +-(BOOL)isInLoop +{ + return _loopLevel>0; +}; + +-(void)addToDocStructureElement:(id)element +{ + if(GSDebugSet(@"GSWDocStructure")) + { + NSString* string=nil; + int elementIDNb=[[self elementID] elementsNb]; + NSMutableData* data=[NSMutableData dataWithCapacity:elementIDNb+1]; + if (!_docStructure) + _docStructure=[NSMutableString new]; + if (!_docStructureElements) + _docStructureElements=[NSMutableSet new]; + char* ptab=(char*)[data bytes]; + memset(ptab,'\t',elementIDNb); + ptab[elementIDNb]='\0'; + string=[NSString stringWithFormat:@"%s %@ Element %p Class %@ defName=%@\n", + ptab, + [self elementID], + element, + [element class], + [element definitionName]]; + if (![_docStructureElements containsObject:string]) + { + [_docStructure appendString:string]; + [_docStructureElements addObject:string]; + }; + }; +} + +-(void)addDocStructureStep:(NSString*)stepLabel +{ + if(GSDebugSet(@"GSWDocStructure")) + { + if (!_docStructure) + _docStructure=[NSMutableString new]; + [_docStructureElements removeAllObjects]; + [_docStructure appendFormat:@"===== %@ =====\n",stepLabel]; + }; +} + +-(NSString*)docStructure +{ + if(GSDebugSet(@"GSWDocStructure")) + return _docStructure; + else + return nil; +} +#endif + @end //==================================================================== diff --git a/GSWeb.framework/GSWDisplayGroup.h b/GSWeb.framework/GSWDisplayGroup.h index 1890fc5..34bda6b 100644 --- a/GSWeb.framework/GSWDisplayGroup.h +++ b/GSWeb.framework/GSWDisplayGroup.h @@ -150,6 +150,7 @@ - (void)editingContext:(id)editingContext_ presentErrorMessage:(id)msg; - (id)insert; +- (id)insertAfterLastObject; - (NSDictionary *)insertedObjectDefaultValues; - (void)insertObject:object_ atIndex:(unsigned)index; @@ -175,6 +176,7 @@ - (void)setSelectedObject:(id)object; - (NSArray *)selectedObjects; - (NSArray *)selectionIndexes; +- (id)selectFirst; - (id)selectNext; - (BOOL)selectObject:(id)object; - (BOOL)selectObjectsIdenticalTo:(NSArray *)objects; diff --git a/GSWeb.framework/GSWDisplayGroup.m b/GSWeb.framework/GSWDisplayGroup.m index 8551cbd..66e26e4 100644 --- a/GSWeb.framework/GSWDisplayGroup.m +++ b/GSWeb.framework/GSWDisplayGroup.m @@ -660,7 +660,7 @@ Description: LOGObjectFnStart(); [self deleteSelection]; LOGObjectFnStop(); - return nil;//FIXME + return nil;//return nil for direct .gswd actions ==> same page } //-------------------------------------------------------------------- @@ -732,33 +732,33 @@ Description: } if (result) { - NS_DURING - { - enumerator = [_selectedObjects objectEnumerator]; - while((object = [enumerator nextObject])) - { - [_dataSource deleteObject:object]; - - [_displayedObjects removeObjectIdenticalTo:object]; - [_allObjects removeObjectIdenticalTo:object]; - - if(_delegateRespondsTo.didDeleteObject == YES) - [delegate displayGroup:self - didDeleteObject:object]; - } - } - NS_HANDLER - { - NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object"); - NSLog(@"object : %@", object); - NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n", - localException, - [localException description], - [localException name], - [localException reason]); - delete = NO; - } - NS_ENDHANDLER; + NS_DURING + { + enumerator = [_selectedObjects objectEnumerator]; + while((object = [enumerator nextObject])) + { + [_dataSource deleteObject:object]; + + [_displayedObjects removeObjectIdenticalTo:object]; + [_allObjects removeObjectIdenticalTo:object]; + + if(_delegateRespondsTo.didDeleteObject == YES) + [delegate displayGroup:self + didDeleteObject:object]; + } + } + NS_HANDLER + { + NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object"); + NSLog(@"object : %@", object); + NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n", + localException, + [localException description], + [localException name], + [localException reason]); + delete = NO; + } + NS_ENDHANDLER; }; [self clearSelection]; @@ -841,7 +841,7 @@ Description: [self clearSelection]; LOGObjectFnStop(); - return nil;//FIXME + return nil;//return nil for direct .gswd actions ==> same page } //-------------------------------------------------------------------- @@ -884,7 +884,7 @@ Description: [self clearSelection]; LOGObjectFnStop(); - return nil;//FIXME + return nil;//return nil for direct .gswd actions ==> same page } //-------------------------------------------------------------------- @@ -903,7 +903,7 @@ Description: LOGObjectFnStart(); LOGObjectFnNotImplemented(); //TODOFN LOGObjectFnStop(); - return nil; + return nil;//return nil for direct .gswd actions ==> same page }; //-------------------------------------------------------------------- @@ -919,9 +919,9 @@ Description: [[NSNotificationCenter defaultCenter] postNotificationName:@"WODisplayGroupWillFetch" //TODO Name object:self]; - undoManager=[self undoManager];// //WO45P3 - [undoManager removeAllActionsWithTarget:self];//WO45P3 - [_dataSource setQualifierBindings:_queryBindings];//WO45P3 + undoManager=[self undoManager]; + [undoManager removeAllActionsWithTarget:self]; + [_dataSource setQualifierBindings:_queryBindings]; if(_delegateRespondsTo.shouldFetchObjects == YES) fetch = [delegate displayGroupShouldFetch:self]; @@ -930,7 +930,7 @@ Description: { NSArray *objects=nil; - objects = [_dataSource fetchObjects];//OK WO45P3 + objects = [_dataSource fetchObjects]; [self setObjectArray:objects];//OK [self _notify:@selector(displayGroup:didFetchObjects:) with:self @@ -941,7 +941,7 @@ Description: */ }; LOGObjectFnStop(); - return nil;//FIXME ?? + return nil;//return nil for direct .gswd actions ==> same page } //-------------------------------------------------------------------- @@ -1040,15 +1040,22 @@ Description: if([_selection count]) index = [[_selection objectAtIndex:0] unsignedIntValue]+1; - if(!count) - index = 0; - if((count <= index) && count>0) - index = count - 1; + index=max(0,index); + index=min(count,index); + NSDebugMLog(@"INSERT Index=%d",index); [self insertObjectAtIndex:index]; LOGObjectFnStop(); - return nil;//FIXME + return nil;//return nil for direct .gswd actions ==> same page +} + +//-------------------------------------------------------------------- + +- (id)insertAfterLastObject +{ + int index= [_allObjects count]; + return [self insertObjectAtIndex:index]; } //-------------------------------------------------------------------- @@ -1087,8 +1094,7 @@ Description: [delegate displayGroup:self didInsertObject:anObject]; - [self setSelectionIndexes: - [NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]]; + [self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]]; }; } @@ -1266,7 +1272,7 @@ Description: NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); NSDebugMLLog(@"gswdisplaygroup",@"_dataSource=%@",_dataSource); [_dataSource setAuxiliaryQualifier:qualifier];//OK - + NSDebugMLLog0(@"gswdisplaygroup",@"Will fetch"); [self fetch];//OK use ret Value ? NSDebugMLLog0(@"gswdisplaygroup",@"End fetch"); @@ -1400,6 +1406,20 @@ Description: return _selection; } +//-------------------------------------------------------------------- +// selectFirst + +- (id)selectFirst +{ + LOGObjectFnStart(); + + if([_allObjects count]>0) + { + [self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]]; + }; + return nil;//return nil for direct .gswd actions ==> same page +}; + //-------------------------------------------------------------------- // selectNext @@ -1412,8 +1432,7 @@ Description: if([_allObjects count]>0) { if(![_selectedObjects count]) - [self setSelectionIndexes: - [NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]]; + [self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]]; else { obj = [_selectedObjects objectAtIndex:0]; @@ -1441,7 +1460,7 @@ Description: }; }; LOGObjectFnStop(); - return nil;//FIXME + return nil;//return nil for direct .gswd actions ==> same page } //-------------------------------------------------------------------- @@ -1911,7 +1930,7 @@ STOP ? BOOL stop = NO; BOOL retValue=NO; LOGObjectFnStart(); -//call selectedObjects //0x1a38b78 +//call selectedObjects // if(_delegateRespondsTo.shouldChangeSelection == YES && [delegate displayGroup:self shouldChangeSelectionToIndexes:selection_] == NO) @@ -2006,9 +2025,10 @@ STOP ? NSEnumerator *objsEnum=nil; id object=nil; LOGObjectFnStart(); + //TODO -//self selectedObjects //() 0x1a38b78 -//self allObjects 0x27cadf8 +//self selectedObjects //() +//self allObjects //self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0 //self redisplay //STOP @@ -2016,30 +2036,29 @@ STOP ? if(_delegateRespondsTo.displayArrayForObjects == YES) { - [_displayedObjects - addObjectsFromArray:[delegate displayGroup:self - displayArrayForObjects:_allObjects]]; - - return; - } - - if(_qualifier) - { - objsEnum = [_allObjects objectEnumerator]; - while((object = [objsEnum nextObject])) - { - if([_qualifier evaluateWithObject:object] == YES) - [_displayedObjects addObject:object]; - } + [_displayedObjects addObjectsFromArray:[delegate displayGroup:self + displayArrayForObjects:_allObjects]]; } else { - _batchIndex = [self batchCount]; - [self displayNextBatch]; - } - - if(_sortOrdering) - [_displayedObjects sortUsingKeyOrderArray:_sortOrdering]; + if(_qualifier) + { + objsEnum = [_allObjects objectEnumerator]; + while((object = [objsEnum nextObject])) + { + if([_qualifier evaluateWithObject:object] == YES) + [_displayedObjects addObject:object]; + } + } + else + { + _batchIndex = [self batchCount]; + [self displayNextBatch]; + } + + if(_sortOrdering) + [_displayedObjects sortUsingKeyOrderArray:_sortOrdering]; + }; LOGObjectFnStop(); } diff --git a/GSWeb.framework/GSWDynamicElement.h b/GSWeb.framework/GSWDynamicElement.h index 1953fe1..5de0f42 100644 --- a/GSWeb.framework/GSWDynamicElement.h +++ b/GSWeb.framework/GSWDynamicElement.h @@ -36,7 +36,6 @@ //==================================================================== @interface GSWDynamicElement : GSWElement { - NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose }; -(id)initWithName:(NSString*)name diff --git a/GSWeb.framework/GSWDynamicElement.m b/GSWeb.framework/GSWDynamicElement.m index d60fe20..0284f1e 100644 --- a/GSWeb.framework/GSWDynamicElement.m +++ b/GSWeb.framework/GSWDynamicElement.m @@ -55,26 +55,11 @@ static char rcsId[] = "$Id$"; GSWLogAssertGood(self); GSWLogC("Dealloc GSWDynamicElement"); GSWLogC("Dealloc GSWDynamicElement: name"); - DESTROY(_definitionName); GSWLogC("Dealloc GSWDynamicElement Super"); [super dealloc]; GSWLogC("End Dealloc GSWDynamicElement"); } --(NSString*)definitionName -{ - return _definitionName; -}; - --(void)setDefinitionName:(NSString*)definitionName -{ - NSDebugMLLog(@"gswdync",@"setDefinitionName1 in %p: %p %@", - self,definitionName,definitionName); - ASSIGN(_definitionName,definitionName); - NSDebugMLLog(@"gswdync",@"setDefinitionName2 in %p: %p %@", - self,_definitionName,_definitionName); -}; - @end //==================================================================== @implementation GSWDynamicElement (GSWDynamicElement) diff --git a/GSWeb.framework/GSWElement.h b/GSWeb.framework/GSWElement.h index 5fd61c6..73e667e 100644 --- a/GSWeb.framework/GSWElement.h +++ b/GSWeb.framework/GSWElement.h @@ -43,28 +43,53 @@ extern BYTE ElementsMap_attributeElement; #ifndef NDEBBUG { NSString* _appendToResponseElementID; + NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose }; #endif #ifndef NDEBBUG -(void)saveAppendToResponseElementIDInContext:(id)context; -(void)assertCorrectElementIDInContext:(id)context - inCLass:(Class)class method:(SEL)method file:(const char*)file line:(int)line; +-(void)assertIsElementIDInContext:(id)context + method:(SEL)method + file:(const char*)file + line:(int)line; +-(void)logElementInContext:(id)context + method:(SEL)method + file:(const char*)file + line:(int)line + startFlag:(BOOL)start + stopFlag:(BOOL)stop; #endif --(NSString*)definitionName; //return nil (for non dynamic element) +-(NSString*)definitionName; @end #ifdef NDEBBUG -#define GSWSaveAppendToResponseElementID(context_); {}; -#define GSWAssertCorrectElementID(context_); {}; +#define GSWSaveAppendToResponseElementID(TheContext); {}; +#define GSWAssertCorrectElementID(TheContext); {}; +#define GSWAssertIsElementID(TheContext); {}; +#define GSWStartElement(TheContext); {}; +#define GSWStopElement(TheContext); {}; +#define GSWAddElementToDocStructure(TheContext); {}; #else -#define GSWSaveAppendToResponseElementID(context_); [self saveAppendToResponseElementIDInContext:context_]; -#define GSWAssertCorrectElementID(context_); \ - ([self assertCorrectElementIDInContext:context_ inCLass:[self class] method:_cmd file:__FILE__ line:__LINE__]); +#define GSWSaveAppendToResponseElementID(TheContext); [self saveAppendToResponseElementIDInContext:TheContext]; +#define GSWAssertCorrectElementID(TheContext); \ + ([self assertCorrectElementIDInContext:TheContext method:_cmd file:__FILE__ line:__LINE__]); +#define GSWAssertIsElementID(TheContext); \ + ([self assertIsElementIDInContext:TheContext method:_cmd file:__FILE__ line:__LINE__]); +#define GSWStartElement(TheContext); \ + ([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:YES stopFlag:NO]); +#define GSWStopElement(TheContext); \ + ([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:NO stopFlag:YES]); +#define GSWLogElement(TheContext); \ + ([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:NO stopFlag:NO]); +#define GSWAddElementToDocStructure(TheContext); \ + ([TheContext addToDocStructureElement:self]); + #endif diff --git a/GSWeb.framework/GSWElement.m b/GSWeb.framework/GSWElement.m index 06aa46d..8447b86 100644 --- a/GSWeb.framework/GSWElement.m +++ b/GSWeb.framework/GSWElement.m @@ -42,46 +42,148 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; #ifndef NDEBBUG -(void)saveAppendToResponseElementIDInContext:(id)context { - NSString* elementID=[context elementID]; - ASSIGN(_appendToResponseElementID,elementID); + NSString* elementID=nil; + LOGObjectFnStartC("GSWElement"); + elementID=[context elementID]; +/* if ([elementID length]==0) + elementID=@"MARKER";*/ + NSDebugMLog(@"self=%p definitionName=%@ elementID=%@ %p",self,[self definitionName],elementID,elementID); + ASSIGNCOPY(_appendToResponseElementID,elementID); + NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p",self,[self definitionName],_appendToResponseElementID,_appendToResponseElementID); + GSWAssertIsElementID(context); + LOGObjectFnStopC("GSWElement"); }; -(void)assertCorrectElementIDInContext:(id)context - inCLass:(Class)class method:(SEL)method file:(const char*)file line:(int)line { + LOGObjectFnStartC("GSWElement"); + NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d", + self, + [self class], + [self definitionName], + _appendToResponseElementID,[_appendToResponseElementID length]); + [self assertIsElementIDInContext:context + method:method + file:file + line:line]; + NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d", + self, + [self class], + [self definitionName], + _appendToResponseElementID,[_appendToResponseElementID length]); if ([_appendToResponseElementID length]>0) { NSString* elementID=[context elementID]; BOOL appendToResponseElementIDIsFirst=NO; BOOL elementIDIsFirst=NO; BOOL OK=YES; +/* if ([elementID length]==0) + elementID=@"MARKER";*/ appendToResponseElementIDIsFirst=([_appendToResponseElementID length]==0 || [_appendToResponseElementID isEqualToString:@"0"]); elementIDIsFirst=([elementID length]==0 || [elementID isEqualToString:@"0"]); - if (appendToResponseElementIDIsFirst!=elementIDIsFirst) + if (!appendToResponseElementIDIsFirst || appendToResponseElementIDIsFirst!=elementIDIsFirst) { OK=[_appendToResponseElementID isEqualToString:elementID]; + NSDebugMLog(@"[context elementID]=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d OK=%d [context isInLoop]=%d", + [context elementID],_appendToResponseElementID,[_appendToResponseElementID length],OK,[context isInLoop]); }; - if (!OK) + if (!OK && ![context isInLoop]) { - NSString* msg=[NSString stringWithFormat:@"In Class %@ (file %s line %d), id %@ in %@ is not the same than in appendToResponse %@", - NSStringFromClass(class), + NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), id '%@' (%p) in %@ is not the same than in appendToResponse '%@' (%p)", + self, + [self class], + [self definitionName], file, line, [context elementID], + [context elementID], NSStringFromSelector(method), + _appendToResponseElementID, _appendToResponseElementID]; - NSAssert1(OK,@"%@",msg); + //No: we may have multiple occurences NSAssert1(OK,@"%@",msg); + NSDebugMLog(@"ELEMENT ID WARNING %@",msg); }; }; + LOGObjectFnStopC("GSWElement"); }; + +-(void)assertIsElementIDInContext:(id)context + method:(SEL)method + file:(const char*)file + line:(int)line +{ + LOGObjectFnStartC("GSWElement"); + NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@", + self, + [self definitionName], + _appendToResponseElementID,_appendToResponseElementID,[context elementID]); + if (_appendToResponseElementID && [_appendToResponseElementID length]==0 && [[context elementID] length]>0) + { + NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), in %@ _appendToResponseElementID '%@' (%p) is not set", + self, + [self class], + [self definitionName], + file, + line, + NSStringFromSelector(method), + _appendToResponseElementID, + _appendToResponseElementID]; + NSAssert1(NO,@"%@",msg); + }; + LOGObjectFnStopC("GSWElement"); +}; + +-(void)logElementInContext:(id)context + method:(SEL)method + file:(const char*)file + line:(int)line + startFlag:(BOOL)start + stopFlag:(BOOL)stop +{ + NSString* senderID=[context senderID]; + if (start) + [context addToDocStructureElement:self]; + NSDebugMLLog(@"gswdync",@"%s:.%d - %@ %s ELEMENT self=%p class=%@ defName=%@ id=%@ appendID:%@ %s%@", + file,line,NSStringFromSelector(method), + (start ? "START" : (stop ? "STOP" : "")), + self, + [self class], + [self definitionName], + [context elementID], + _appendToResponseElementID, + (senderID ? "senderID:" : ""), + (senderID ? senderID : @"")); +}; + #endif +//-------------------------------------------------------------------- +-(void)dealloc +{ + GSWLogAssertGood(self); + GSWLogC("Dealloc GSWElement"); + GSWLogC("Dealloc GSWElement: name"); + DESTROY(_definitionName); + GSWLogC("Dealloc GSWElement Super"); + [super dealloc]; + GSWLogC("End Dealloc GSWElement"); +} + -(NSString*)definitionName { - return nil; //return nil (for non dynamic element) + return _definitionName; +}; + +-(void)setDefinitionName:(NSString*)definitionName +{ + NSDebugMLLog(@"gswdync",@"setDefinitionName1 in %p: %p %@", + self,definitionName,definitionName); + ASSIGN(_definitionName,definitionName); + NSDebugMLLog(@"gswdync",@"setDefinitionName2 in %p: %p %@", + self,_definitionName,_definitionName); }; @end @@ -94,8 +196,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; -(void)takeValuesFromRequest:(GSWRequest*)request inContext:(GSWContext*)context { + GSWStartElement(context); + GSWAddElementToDocStructure(context); GSWAssertCorrectElementID(context);// Debug Only //Does Nothing + GSWStopElement(context); }; //-------------------------------------------------------------------- @@ -104,10 +209,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; -(GSWElement*)invokeActionForRequest:(GSWRequest*)request inContext:(GSWContext*)context { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", - [self class],[context elementID],[context senderID]); + GSWStartElement(context); + GSWAddElementToDocStructure(context); GSWAssertCorrectElementID(context);// Debug Only //Does Nothing + GSWStopElement(context); return nil; }; @@ -118,6 +224,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; inContext:(GSWContext*)context { GSWSaveAppendToResponseElementID(context);//Debug Only + GSWAddElementToDocStructure(context); //Does Nothing }; @@ -125,13 +232,14 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; //NDFN -(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context { + BOOL match=NO; NSString* senderID=[context senderID]; NSString* elementID=[context elementID]; - NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); + NSDebugMLLog(@"gswdync",@" senderID=%@",senderID); NSDebugMLLog(@"gswdync",@"elementID=%@",elementID); - return ([elementID hasPrefix:senderID] || [senderID hasPrefix:elementID]); + match=([elementID hasPrefix:senderID] || [senderID hasPrefix:elementID]); + NSDebugMLLog(@"gswdync",@"match=%s",(match ? "YES" : "NO")); + return match; }; @end - - diff --git a/GSWeb.framework/GSWElementIDString.m b/GSWeb.framework/GSWElementIDString.m index f388836..ed62a59 100644 --- a/GSWeb.framework/GSWElementIDString.m +++ b/GSWeb.framework/GSWElementIDString.m @@ -223,11 +223,12 @@ static char rcsId[] = "$Id$"; else finished=YES; }; - if (!over && !finished) +/* if (!over && !finished) { if (selfElementsCount>senderIDElementsCount) over=YES; }; +*/ }; return over; } diff --git a/GSWeb.framework/GSWFileUpload.m b/GSWeb.framework/GSWFileUpload.m index a56e27d..632967d 100644 --- a/GSWeb.framework/GSWFileUpload.m +++ b/GSWeb.framework/GSWFileUpload.m @@ -98,7 +98,8 @@ static char rcsId[] = "$Id$"; -(GSWElement*)invokeActionForRequest:(GSWRequest*)request inContext:(GSWContext*)context { - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); //Bypass GSWInput return nil; }; @@ -110,7 +111,8 @@ static char rcsId[] = "$Id$"; //OK BOOL disabledValue=NO; LOGObjectFnStartC("GSWFileUpload"); - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); disabledValue=[self disabledInContext:context]; if (!disabledValue) { diff --git a/GSWeb.framework/GSWForm.m b/GSWeb.framework/GSWForm.m index 4899bc5..d0a6932 100644 --- a/GSWeb.framework/GSWForm.m +++ b/GSWeb.framework/GSWForm.m @@ -211,9 +211,11 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStartC("GSWForm"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); - - GSWSaveAppendToResponseElementID(context);//Debug Only + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); + [response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@", + [self definitionName], + [context elementID]]]; if (!WOStrictFlag) { @@ -227,18 +229,19 @@ static char rcsId[] = "$Id$"; [self appendToResponse:response inContext:context elementsFromIndex:0 - toIndex:[elementsMap length]-2]; + toIndex:[_elementsMap length]-2]; [self _appendHiddenFieldsToResponse:response inContext:context]; [self appendToResponse:response - inContext:context - elementsFromIndex:[elementsMap length]-1 - toIndex:[elementsMap length]-1]; + inContext:context + elementsFromIndex:[_elementsMap length]-1 + toIndex:[_elementsMap length]-1]; [context setInForm:NO]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); + GSWStopElement(context); #ifndef NDEBBUG - NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], - @"GSWForm appendToResponse: bad elementID"); + NSAssert3(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], + @"GSWForm appendToResponse: bad elementID: elementsNb=%d [context elementID]=%@ [(GSWElementIDString*)[context elementID]elementsNb]=%d", + elementsNb,[context elementID],[(GSWElementIDString*)[context elementID]elementsNb]); #endif LOGObjectFnStopC("GSWForm"); }; @@ -258,10 +261,10 @@ static char rcsId[] = "$Id$"; BOOL multipleSubmitValue=NO; int i=0; LOGObjectFnStartC("GSWForm"); + GSWStartElement(context); senderID=[context senderID]; elementID=[context elementID]; - NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", - [self class],[self definitionName],elementID,senderID); + NSDebugMLLog(@"gswdync",@"senderId=%@",senderID); NS_DURING { GSWAssertCorrectElementID(context);// Debug Only @@ -269,9 +272,10 @@ static char rcsId[] = "$Id$"; { BOOL searchIsOver=NO; isFormSubmited=[elementID isEqualToString:senderID]; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s", + NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nisFormSubmited=%s", [self class], - elementID, + [self definitionName], + elementID, senderID, (isFormSubmited ? "YES" : "NO")); if (!WOStrictFlag && isFormSubmited && [self disabledInContext:context]) @@ -283,21 +287,20 @@ static char rcsId[] = "$Id$"; [context _setFormSubmitted:YES]; multipleSubmitValue=[self evaluateCondition:_multipleSubmit inContext:context]; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ multipleSubmit=%s", + NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nmultipleSubmit=%s", [self class], - elementID, + [self definitionName], + elementID, senderID, (multipleSubmitValue ? "YES" : "NO")); [context _setIsMultipleSubmitForm:multipleSubmitValue]; }; - [context appendZeroElementIDComponent]; - for(i=0;!element && !searchIsOver && i<[dynamicChildren count];i++) +/* + for(i=0;!element && !searchIsOver && i<[_dynamicChildren count];i++) { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", - [[dynamicChildren objectAtIndex:i] class], - [context elementID]); - element=[[dynamicChildren objectAtIndex:i] invokeActionForRequest:request - inContext:context]; + NSDebugMLLog(@"gswdync",@"i=%d",i); + element=[[_dynamicChildren objectAtIndex:i] invokeActionForRequest:request + inContext:context]; // if (![context _wasFormSubmitted] && [[context elementID] compare:senderID]==NSOrderedDescending) if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID]) { @@ -308,7 +311,9 @@ static char rcsId[] = "$Id$"; }; [context incrementLastElementIDComponent]; }; - [context deleteLastElementIDComponent]; +*/ + element=[super invokeActionForRequest:request + inContext:context]; if (isFormSubmited) { if ([context _wasActionInvoked]) @@ -321,15 +326,13 @@ static char rcsId[] = "$Id$"; [context _setFormSubmitted:NO]; }; elementID=[context elementID]; - NSDebugMLLog(@"gswdync",@"END ET=%@ def name=%@ id=%@", - [self class], - [self definitionName], - elementID); -#ifndef NDEBBUG - NSAssert(elementsNb==[(GSWElementIDString*)elementID elementsNb], - @"GSWForm invokeActionForRequest: bad elementID"); -#endif + GSWStopElement(context); }; +#ifndef NDEBBUG + NSAssert3(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], + @"GSWForm invokeActionForRequest: bad elementID: elementsNb=%d [context elementID]=%@ [(GSWElementIDString*)[context elementID]elementsNb]=%d", + elementsNb,[context elementID],[(GSWElementIDString*)[context elementID]elementsNb]); +#endif } NS_HANDLER { @@ -369,12 +372,12 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStartC("GSWForm"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); + senderID=[context senderID]; elementID=[context elementID]; NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); - NSDebugMLLog(@"gswdync",@"elementID=%@",elementID); if ([self prefixMatchSenderIDInContext:context]) //Avoid taking values if we are not the good form { isFormSubmited=[elementID isEqualToString:senderID]; @@ -388,25 +391,19 @@ static char rcsId[] = "$Id$"; [context setInForm:YES]; [context _setFormSubmitted:YES]; }; - [context appendZeroElementIDComponent]; - NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",dynamicChildren); - NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[dynamicChildren count]); - for(i=0;i<[dynamicChildren count];i++) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[dynamicChildren objectAtIndex:i] class],[context elementID]); - NSDebugMLLog(@"gswdync",@"\n[dynamicChildren objectAtIndex:i]=%@",[dynamicChildren objectAtIndex:i]); - [[dynamicChildren objectAtIndex:i] takeValuesFromRequest:request - inContext:context]; - [context incrementLastElementIDComponent]; - }; - [context deleteLastElementIDComponent]; + NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",_dynamicChildren); + NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[_dynamicChildren count]); + + [super takeValuesFromRequest:request + inContext:context]; + if (isFormSubmited) { [context setInForm:NO]; [context _setFormSubmitted:NO]; }; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); + GSWStopElement(context); #ifndef NDEBBUG NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], @"GSWForm takeValuesFromRequest: bad elementID"); diff --git a/GSWeb.framework/GSWHTMLDynamicElement.h b/GSWeb.framework/GSWHTMLDynamicElement.h index 7e2a3b1..bc8db19 100644 --- a/GSWeb.framework/GSWHTMLDynamicElement.h +++ b/GSWeb.framework/GSWHTMLDynamicElement.h @@ -1,11 +1,18 @@ -/* GSWHTMLDynamicElement.h - GSWeb: Class GSWHTMLDynamicElement - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLDynamicElement.h - GSWeb: Class GSWHTMLDynamicElement + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Feb 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -30,10 +38,10 @@ //==================================================================== @interface GSWHTMLDynamicElement: GSWDynamicElement { - NSData* elementsMap; - NSArray* htmlBareStrings; - NSArray* dynamicChildren; - NSArray* attributeAssociations; + NSData* _elementsMap; + NSArray* _htmlBareStrings; + NSArray* _dynamicChildren; + NSArray* _attributeAssociations; }; -(NSString*)elementName; -(NSArray*)dynamicChildren; @@ -41,64 +49,64 @@ -(NSData*)elementsMap; -(NSArray*)attributeAssociations; --(id)_initWithElementsMap:(NSData*)_elementsMap - htmlBareStrings:(NSArray*)_htmlBareStrings - dynamicChildren:(NSArray*)_dynamicChildren - attributeAssociations:(NSArray*)_attributeAssociations; +-(id)_initWithElementsMap:(NSData*)elementsMap + htmlBareStrings:(NSArray*)htmlBareStrings + dynamicChildren:(NSArray*)dynamicChildren + attributeAssociations:(NSArray*)attributeAssociations; --(id) initWithName:(NSString*)elementName_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_; +-(id)initWithName:(NSString*)elementName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements; --(id) initWithName:(NSString*)elementName_ - attributeAssociations:(NSDictionary*)attributeAssociations_ - contentElements:(NSArray*)elements_; +-(id)initWithName:(NSString*)elementName +attributeAssociations:(NSDictionary*)attributeAssociations + contentElements:(NSArray*)elements; --(id) initWithName:(NSString*)elementName_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)elementName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; -(void)dealloc; --(void)_setEndOfHTMLTag:(unsigned int)_unknown; +-(void)_setEndOfHTMLTag:(unsigned int)unknown; -(NSString*)description; --(void)setHtmlBareStrings:(NSArray*)_htmlBareStrings; +-(void)setHtmlBareStrings:(NSArray*)htmlBareStrings; @end //==================================================================== @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementA) --(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; -(unsigned int)GSWebObjectsAssociationsCount; --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ - elementsFromIndex:(unsigned int)_fromIndex - toIndex:(unsigned int)_toIndex; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext + elementsFromIndex:(unsigned int)fromIndex + toIndex:(unsigned int)toIndex; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; @end //==================================================================== @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementB) -(BOOL)compactHTMLTags; --(BOOL)appendStringAtRight:(id)_unkwnon - withMapping:(char*)_mapping; --(BOOL)appendStringAtLeft:(id)_unkwnon - withMapping:(char*)_mapping; +-(BOOL)appendStringAtRight:(id)unkwnon + withMapping:(char*)mapping; +-(BOOL)appendStringAtLeft:(id)unkwnon + withMapping:(char*)mapping; -(BOOL)canBeFlattenedAtInitialization; @end //==================================================================== @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementC) -+(void)setDynamicElementCompaction:(BOOL)_flag; ++(void)setDynamicElementCompaction:(BOOL)flag; +(BOOL)escapeHTML; +(BOOL)hasGSWebObjectsAssociations; @end diff --git a/GSWeb.framework/GSWHTMLDynamicElement.m b/GSWeb.framework/GSWHTMLDynamicElement.m index 2347122..7a23a9d 100644 --- a/GSWeb.framework/GSWHTMLDynamicElement.m +++ b/GSWeb.framework/GSWHTMLDynamicElement.m @@ -1,11 +1,18 @@ -/* GSWHTMLDynamicElement.m - GSWeb: Class GSWHTMLDynamicElement - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLDynamicElement.m - GSWeb: Class GSWHTMLDynamicElement + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Feb 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -30,139 +38,142 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(id)initWithName:(NSString*)_elementName - associations:(NSDictionary*)_associations - contentElements:(NSArray*)_elements +-(id)initWithName:(NSString*)elementName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements { LOGObjectFnStartC("GSWHTMLDynamicElement"); LOGObjectFnNotImplemented(); //TODOFN - NSDebugMLLog(@"gswdync",@"_elementName=%@ associations:%@ _elements=%@",_elementName,_associations,_elements); - if ((self=[super initWithName:_elementName - associations:_associations - template:nil])) - { - }; + NSDebugMLLog(@"gswdync",@"elementName=%@ associations:%@ elements=%@",elementName,associations,elements); + if ((self=[super initWithName:elementName + associations:associations + template:nil])) + { + }; LOGObjectFnStopC("GSWHTMLDynamicElement"); return self; }; //-------------------------------------------------------------------- --(id) initWithName:(NSString*)_elementName - attributeAssociations:(NSDictionary*)attributeAssociations_ - contentElements:(NSArray*)_elements +-(id)initWithName:(NSString*)elementName +attributeAssociations:(NSDictionary*)attributeAssociations + contentElements:(NSArray*)elements { //OK - NSString* _dynamicElementName=[[self elementName] uppercaseString]; + NSString* dynamicElementName=[[self elementName] uppercaseString]; LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"_elementName=%@ attributeAssociations_:%@ _elements=%@ _dynamicElementName=%@", - _elementName, - attributeAssociations_, - _elements, - _dynamicElementName); - if ((self=[super initWithName:_dynamicElementName - associations:attributeAssociations_ - template:nil])) - { - NSMutableArray* _attributeAssociationsValues=[NSMutableArray array]; - NSEnumerator* attributesKeyEnum=nil; - id _key=nil; - NSMutableArray* _htmlBareStrings=[NSMutableArray array]; - NSMutableData* _elementsMap=[[NSMutableData new]autorelease]; - BOOL _hasGSWebObjectsAssociations=NO; - int _GSWebObjectsAssociationsCount=0; - BOOL _escapeHTML=[[self class] escapeHTML];// (return NO) - if (_escapeHTML) - { - //TODO - }; + NSDebugMLLog(@"gswdync",@"elementName=%@ attributeAssociations_:%@ elements=%@ dynamicElementName=%@", + elementName, + attributeAssociations, + elements, + dynamicElementName); + if ((self=[super initWithName:dynamicElementName + associations:attributeAssociations + template:nil])) + { + NSMutableArray* attributeAssociationsValues=[NSMutableArray array]; + NSEnumerator* attributesKeyEnum=nil; + id key=nil; + NSMutableArray* htmlBareStrings=[NSMutableArray array]; + NSMutableData* elementsMap=[[NSMutableData new]autorelease]; + BOOL hasGSWebObjectsAssociations=NO; + int GSWebObjectsAssociationsCount=0; + BOOL escapeHTML=[[self class] escapeHTML];// (return NO) + if (escapeHTML) + { + //TODO + }; - //("") - if (_dynamicElementName) - { - [_htmlBareStrings addObject:[NSString stringWithFormat:@"<%@", - _dynamicElementName]]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - }; + //("") + if (dynamicElementName) + { + [htmlBareStrings addObject:[NSString stringWithFormat:@"<%@", + dynamicElementName]]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + }; - attributesKeyEnum= [attributeAssociations_ keyEnumerator]; - NSDebugMLLog(@"gswdync",@"attributesKeyEnum=%@ attributeAssociations_=%@",attributesKeyEnum,attributeAssociations_); - while ((_key = [attributesKeyEnum nextObject])) - { - id _association=[attributeAssociations_ objectForKey:_key]; - id _associationValue=[_association valueInComponent:nil]; - NSDebugMLLog(@"gswdync",@"_association=%@ _associationValue=%@",_association,_associationValue); - [_htmlBareStrings addObject:[NSString stringWithFormat:@" %@",_key]]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - if (_associationValue) - { - [_htmlBareStrings addObject:[NSString stringWithString:@"="]]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - [_htmlBareStrings addObject:[NSString stringWithFormat:@"%@",_associationValue]]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - } - else - { - //TODOV - [_attributeAssociationsValues addObject:_association]; - [_elementsMap appendBytes:&ElementsMap_attributeElement - length:1]; - - }; - }; - _GSWebObjectsAssociationsCount=[self GSWebObjectsAssociationsCount]; - if (_GSWebObjectsAssociationsCount>0) - _hasGSWebObjectsAssociations=YES; - else - _hasGSWebObjectsAssociations=[[self class]hasGSWebObjectsAssociations]; //return:YES - if (_hasGSWebObjectsAssociations) - { - [_elementsMap appendBytes:&ElementsMap_gswebElement - length:1]; - }; - [_htmlBareStrings addObject:@">"]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - if (_elements) - { - int elementsN=[_elements count]; - for(;elementsN>0;elementsN--) - [_elementsMap appendBytes:&ElementsMap_dynamicElement - length:1]; - if (_dynamicElementName) - { - [_htmlBareStrings addObject:[NSString stringWithFormat:@"", - _dynamicElementName]]; - [_elementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - }; - }; - [self _initWithElementsMap:_elementsMap - htmlBareStrings:_htmlBareStrings - dynamicChildren:_elements - attributeAssociations:_attributeAssociationsValues]; - }; + attributesKeyEnum= [attributeAssociations keyEnumerator]; + NSDebugMLLog(@"gswdync",@"attributesKeyEnum=%@ attributeAssociations=%@", + attributesKeyEnum,attributeAssociations); + while ((key = [attributesKeyEnum nextObject])) + { + id association=[attributeAssociations objectForKey:key]; + id associationValue=[association valueInComponent:nil]; + NSDebugMLLog(@"gswdync",@"association=%@ associationValue=%@", + association,associationValue); + [htmlBareStrings addObject:[NSString stringWithFormat:@" %@",key]]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + if (associationValue) + { + [htmlBareStrings addObject:[NSString stringWithString:@"="]]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + [htmlBareStrings addObject:[NSString stringWithFormat:@"%@",associationValue]]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + } + else + { + //TODOV + [attributeAssociationsValues addObject:association]; + [elementsMap appendBytes:&ElementsMap_attributeElement + length:1]; + + }; + }; + GSWebObjectsAssociationsCount=[self GSWebObjectsAssociationsCount]; + if (GSWebObjectsAssociationsCount>0) + hasGSWebObjectsAssociations=YES; + else + hasGSWebObjectsAssociations=[[self class]hasGSWebObjectsAssociations]; //return:YES + if (hasGSWebObjectsAssociations) + { + [elementsMap appendBytes:&ElementsMap_gswebElement + length:1]; + }; + [htmlBareStrings addObject:@">"]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + if (elements) + { + int elementsN=[elements count]; + for(;elementsN>0;elementsN--) + [elementsMap appendBytes:&ElementsMap_dynamicElement + length:1]; + if (dynamicElementName) + { + [htmlBareStrings addObject:[NSString stringWithFormat:@"", + dynamicElementName]]; + [elementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + }; + }; + [self _initWithElementsMap:elementsMap + htmlBareStrings:htmlBareStrings + dynamicChildren:elements + attributeAssociations:attributeAssociationsValues]; + }; LOGObjectFnStopC("GSWHTMLDynamicElement"); return self; }; //-------------------------------------------------------------------- --(id)initWithName:(NSString*)_elementName - associations:(NSDictionary*)_associations - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)elementName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement { LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"_elementName=[%@] _associations=[%@] templateElement_=[%@]",_elementName,_associations,templateElement_); + NSDebugMLLog(@"gswdync",@"elementName=[%@] associations=[%@] templateElement=[%@]", + elementName,associations,templateElement); //OK - if ((self=[self initWithName:_elementName - associations:_associations - contentElements:templateElement_ ? [NSArray arrayWithObject:templateElement_] : nil])) - { - }; + if ((self=[self initWithName:elementName + associations:associations + contentElements:templateElement ? [NSArray arrayWithObject:templateElement] : nil])) + { + }; LOGObjectFnStopC("GSWHTMLDynamicElement"); return self; }; @@ -170,88 +181,93 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(elementsMap); - DESTROY(htmlBareStrings); - DESTROY(dynamicChildren); - DESTROY(attributeAssociations); + DESTROY(_elementsMap); + DESTROY(_htmlBareStrings); + DESTROY(_dynamicChildren); + DESTROY(_attributeAssociations); [super dealloc]; }; //-------------------------------------------------------------------- --(id)_initWithElementsMap:(NSData*)_elementsMap - htmlBareStrings:(NSArray*)_htmlBareStrings - dynamicChildren:(NSArray*)_dynamicChildren - attributeAssociations:(NSArray*)attributeAssociations_ +-(id)_initWithElementsMap:(NSData*)elementsMap + htmlBareStrings:(NSArray*)htmlBareStrings + dynamicChildren:(NSArray*)dynamicChildren + attributeAssociations:(NSArray*)attributeAssociations { - BOOL _compactHTMLTags=NO; - BOOL _hasGSWebObjectsAssociations=NO; - int _GSWebObjectsAssociationsCount=0; + BOOL compactHTMLTags=NO; + BOOL hasGSWebObjectsAssociations=NO; + int GSWebObjectsAssociationsCount=0; LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"_elementsMap=%@ _htmlBareStrings:%@ _dynamicChildren=%@ attributeAssociations_=%@", - _elementsMap, - _htmlBareStrings, - _dynamicChildren, - attributeAssociations_); - _compactHTMLTags=[self compactHTMLTags]; + NSDebugMLLog(@"gswdync",@"elementsMap=%@ htmlBareStrings:%@ dynamicChildren=%@ attributeAssociations=%@", + elementsMap, + htmlBareStrings, + dynamicChildren, + attributeAssociations); + compactHTMLTags=[self compactHTMLTags]; //OK - if (_compactHTMLTags) - { - int elementN=0; - while(elementN<[_elementsMap length] && ((BYTE*)[_elementsMap bytes])[elementN]==ElementsMap_htmlBareString) - elementN++; - NSDebugMLLog(@"gswdync",@"elementN=%d",elementN); - [self _setEndOfHTMLTag:elementN]; - if (elementN>0) - { - int rmStringN=0; - NSMutableArray* rmStrings=[NSMutableArray array]; - NSMutableString* rmString=[[NSMutableString new] autorelease]; - NSMutableData* tmpElementsMap=[[NSMutableData new] autorelease]; - [tmpElementsMap appendBytes:&ElementsMap_htmlBareString - length:1]; - if ([_elementsMap length]>elementN) - [tmpElementsMap appendData: - [_elementsMap subdataWithRange: - NSMakeRange(elementN, - [_elementsMap length]-elementN)]]; - _elementsMap=tmpElementsMap; - for(rmStringN=0;rmStringN0) - _hasGSWebObjectsAssociations=YES; + if (compactHTMLTags) + { + int elementN=0; + while(elementN<[elementsMap length] && ((BYTE*)[elementsMap bytes])[elementN]==ElementsMap_htmlBareString) + elementN++; + NSDebugMLLog(@"gswdync",@"elementN=%d",elementN); + [self _setEndOfHTMLTag:elementN]; + if (elementN>0) + { + int rmStringN=0; + NSMutableArray* rmStrings=[NSMutableArray array]; + NSMutableString* rmString=[[NSMutableString new] autorelease]; + NSMutableData* tmpElementsMap=[[NSMutableData new] autorelease]; + NSDebugMLLog(@"gswdync",@"XXXXXX");//XXXXXXX + [tmpElementsMap appendBytes:&ElementsMap_htmlBareString + length:1]; + if ([elementsMap length]>elementN) + [tmpElementsMap appendData:[elementsMap subdataWithRange: + NSMakeRange(elementN, + [elementsMap length]-elementN)]]; + NSDebugMLLog(@"gswdync",@"XXXXXX");//XXXXXXX + elementsMap=tmpElementsMap; + for(rmStringN=0;rmStringN0) + hasGSWebObjectsAssociations=YES; else - _hasGSWebObjectsAssociations=[[self class]hasGSWebObjectsAssociations]; - if (_hasGSWebObjectsAssociations) - { - //TODO - }; + hasGSWebObjectsAssociations=[[self class]hasGSWebObjectsAssociations]; + if (hasGSWebObjectsAssociations) + { + //TODO + }; - ASSIGN(elementsMap,_elementsMap); + ASSIGN(_elementsMap,elementsMap); - ASSIGN(dynamicChildren,_dynamicChildren); - ASSIGN(attributeAssociations,attributeAssociations_); + ASSIGN(_dynamicChildren,dynamicChildren); + ASSIGN(_attributeAssociations,attributeAssociations); LOGObjectFnStopC("GSWHTMLDynamicElement"); return self; @@ -269,32 +285,32 @@ static char rcsId[] = "$Id$"; -(NSArray*)dynamicChildren { //OK - return dynamicChildren; + return _dynamicChildren; }; //-------------------------------------------------------------------- -(NSArray*)htmlBareStrings { //OK - return htmlBareStrings; + return _htmlBareStrings; }; //-------------------------------------------------------------------- -(NSData*)elementsMap { //OK - return elementsMap; + return _elementsMap; }; //-------------------------------------------------------------------- -(NSArray*)attributeAssociations { //OK - return attributeAssociations; + return _attributeAssociations; }; //-------------------------------------------------------------------- --(void)_setEndOfHTMLTag:(unsigned int)_unknown +-(void)_setEndOfHTMLTag:(unsigned int)unknown { LOGObjectFnStartC("GSWHTMLDynamicElement"); LOGObjectFnNotImplemented(); //TODOFN @@ -305,18 +321,18 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%@ %p elementsMap:%@ htmlBareStrings:%@ dynamicChildren:%@ attributeAssociations:%@>", - [self class], - (void*)self, - elementsMap, - htmlBareStrings, - dynamicChildren, - attributeAssociations]; + [self class], + (void*)self, + _elementsMap, + _htmlBareStrings, + _dynamicChildren, + _attributeAssociations]; }; //-------------------------------------------------------------------- --(void)setHtmlBareStrings:(NSArray*)_htmlBareStrings +-(void)setHtmlBareStrings:(NSArray*)htmlBareStrings { - ASSIGN(htmlBareStrings,_htmlBareStrings); + ASSIGN(_htmlBareStrings,htmlBareStrings); }; @@ -326,8 +342,8 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLDynamicElement (GSWHTMLDynamicElementA) //-------------------------------------------------------------------- --(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; @@ -339,39 +355,39 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { //OK LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - GSWSaveAppendToResponseElementID(context_);//Debug Only - if ([elementsMap length]>0) - { - [self appendToResponse:response_ - inContext:context_ - elementsFromIndex:0 - toIndex:[elementsMap length]-1]; - }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + GSWStartElement(aContext); + GSWSaveAppendToResponseElementID(aContext);//Debug Only + if ([_elementsMap length]>0) + { + [self appendToResponse:aResponse + inContext:aContext + elementsFromIndex:0 + toIndex:[_elementsMap length]-1]; + }; + GSWStopElement(aContext); LOGObjectFnStopC("GSWHTMLDynamicElement"); }; //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ - elementsFromIndex:(unsigned int)_fromIndex - toIndex:(unsigned int)_toIndex +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext + elementsFromIndex:(unsigned int)fromIndex + toIndex:(unsigned int)toIndex { //OK - NSStringEncoding _encoding=0; - NSArray* _dynamicChildren=nil; - GSWComponent* _component=nil; - GSWRequest* _request=nil; + NSStringEncoding encoding=0; + NSArray* dynamicChildren=nil; + GSWComponent* component=nil; + GSWRequest* request=nil; BOOL isFromClientComponent=NO; - NSArray* _attributeAssociations=nil; + NSArray* attributeAssociations=nil; int elementN=0; - const BYTE* elements=[elementsMap bytes]; + const BYTE* elements=[_elementsMap bytes]; BYTE element=0; int elementsN[4]={0,0,0,0}; BOOL inChildren=NO; @@ -379,148 +395,35 @@ static char rcsId[] = "$Id$"; NSString* debugElementID=nil; #endif LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - _encoding=[response_ contentEncoding]; - _dynamicChildren=[self dynamicChildren];//call dynamicChildren //GSWTextField: nil - NSDebugMLLog(@"gswdync",@"_dynamicChildren=%@",_dynamicChildren); - _component=[context_ component]; - _request=[context_ request]; - isFromClientComponent=[_request isFromClientComponent]; //return NO - _attributeAssociations=[self attributeAssociations]; //return nil for GSWTextField/GSWSubmitButton; + encoding=[aResponse contentEncoding]; + dynamicChildren=[self dynamicChildren];//call dynamicChildren //GSWTextField: nil + NSDebugMLLog(@"gswdync",@"dynamicChildren=%@",dynamicChildren); + component=[aContext component]; + request=[aContext request]; + isFromClientComponent=[request isFromClientComponent]; //return NO + attributeAssociations=[self attributeAssociations]; //return nil for GSWTextField/GSWSubmitButton; - - NSAssert2(_fromIndex<[elementsMap length],@"_fromIndex out of range:%u (length=%d)",_fromIndex,[elementsMap length]); - NSAssert2(_toIndex<[elementsMap length],@"_toIndex out of range:%u (length=%d)",_toIndex,[elementsMap length]); - NSAssert2(_fromIndex<=_toIndex,@"_fromIndex>_toIndex %u %u ",_fromIndex,_toIndex); - NSDebugMLLog(@"gswdync",@"Starting HTMLDyn AR ET=%@ id=%@",[self class],[context_ elementID]); - for(elementN=0;elementN<=_toIndex;elementN++) - { - element=(BYTE)elements[elementN]; - NSDebugMLLog(@"gswdync",@"elements=%c",element); - if (element==ElementsMap_dynamicElement) - { - if (!inChildren) - { -#ifndef NDEBUG - debugElementID=[context_ elementID]; -#endif - [context_ appendZeroElementIDComponent]; - inChildren=YES; - }; - } - else - { - if (inChildren) - { - [context_ deleteLastElementIDComponent]; - inChildren=NO; -#ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; -#endif - }; - }; - - if (element==ElementsMap_htmlBareString) - { - if (elementN>=_fromIndex) - [response_ appendContentString:[htmlBareStrings objectAtIndex:elementsN[0]]]; - elementsN[0]++; - } - else if (element==ElementsMap_gswebElement) - { - if (elementN>=_fromIndex) - [self appendGSWebObjectsAssociationsToResponse:response_ - inContext:context_]; - elementsN[1]++; - } - else if (element==ElementsMap_dynamicElement) - { - if (elementN>=_fromIndex) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ [%s %d]", - [[_dynamicChildren objectAtIndex:elementsN[2]] class], - [context_ elementID], - __FILE__,__LINE__); - [[_dynamicChildren objectAtIndex:elementsN[2]] appendToResponse:response_ - inContext:context_]; - [context_ incrementLastElementIDComponent]; - }; - elementsN[2]++; - } - else if (element==ElementsMap_attributeElement) - { - if (elementN>=_fromIndex) - { - GSWAssociation* _association=[attributeAssociations objectAtIndex:elementsN[3]]; - id _value=[_association valueInComponent:_component]; - if (_value) - { - [response_ appendContentString:@"=\""]; - [response_ appendContentHTMLAttributeValue:_value]; - [response_ appendContentString:@"\""]; - }; - }; - elementsN[3]++; - }; - }; - if (inChildren) - { - [context_ deleteLastElementIDComponent]; -#ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; -#endif - }; - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); - LOGObjectFnStopC("GSWHTMLDynamicElement"); -}; - - -//-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ -{ - //??? - GSWElement* _element=nil; - int elementN=0; - NSArray* _dynamicChildren=[self dynamicChildren]; - const BYTE* elements=[elementsMap bytes]; - BYTE element=0; - int elementsN[4]={0,0,0,0}; - BOOL inChildren=NO; - BOOL searchIsOver=NO; - NSString* _senderID=nil; -#ifndef NDEBUG - NSString* debugElementID=nil; -#endif - LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - GSWAssertCorrectElementID(context_);// Debug Only - _senderID=[context_ senderID]; - for(elementN=0;!_element && !searchIsOver && elementN<[elementsMap length];elementN++) + NSAssert2(fromIndex<[_elementsMap length],@"fromIndex out of range:%u (length=%d)", + fromIndex,[_elementsMap length]); + NSAssert2(toIndex<[_elementsMap length],@"toIndex out of range:%u (length=%d)", + toIndex,[_elementsMap length]); + NSAssert2(fromIndex<=toIndex,@"fromIndex>toIndex %u %u ", + fromIndex,toIndex); + NSDebugMLLog(@"gswdync",@"Starting HTMLDyn AR ET=%@ id=%@", + [self class],[aContext elementID]); + for(elementN=0;elementN<=toIndex;elementN++) { element=(BYTE)elements[elementN]; + NSDebugMLLog(@"gswdync",@"elements=%c",element); if (element==ElementsMap_dynamicElement) { if (!inChildren) { #ifndef NDEBUG - debugElementID=[context_ elementID]; + debugElementID=[aContext elementID]; #endif - [context_ appendZeroElementIDComponent]; + [aContext appendZeroElementIDComponent]; inChildren=YES; }; } @@ -528,142 +431,248 @@ static char rcsId[] = "$Id$"; { if (inChildren) { - [context_ deleteLastElementIDComponent]; + [aContext deleteLastElementIDComponent]; inChildren=NO; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) + if (![debugElementID isEqualToString:[aContext elementID]]) { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@", - [self class], - debugElementID, - [context_ elementID]); + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class],debugElementID,[aContext elementID]); }; #endif }; }; - if (element==ElementsMap_htmlBareString) - elementsN[0]++; + { + if (elementN>=fromIndex) + [aResponse appendContentString:[_htmlBareStrings objectAtIndex:elementsN[0]]]; + elementsN[0]++; + } else if (element==ElementsMap_gswebElement) - elementsN[1]++; + { + if (elementN>=fromIndex) + [self appendGSWebObjectsAssociationsToResponse:aResponse + inContext:aContext]; + elementsN[1]++; + } else if (element==ElementsMap_dynamicElement) { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", - [[_dynamicChildren objectAtIndex:elementsN[2]] class], - [context_ elementID]); - _element=[[_dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:request_ - inContext:context_]; - //if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending) - if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID]) + if (elementN>=fromIndex) { - NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", - [context_ elementID], - _senderID); - searchIsOver=YES; + NSDebugMLLog(@"gswdync",@"appendToResponse i=%d", + elementN); + [[dynamicChildren objectAtIndex:elementsN[2]] appendToResponse:aResponse + inContext:aContext]; + [aContext incrementLastElementIDComponent]; }; - [context_ incrementLastElementIDComponent]; elementsN[2]++; } else if (element==ElementsMap_attributeElement) - elementsN[3]++; + { + if (elementN>=fromIndex) + { + GSWAssociation* association=[_attributeAssociations objectAtIndex:elementsN[3]]; + id value=[association valueInComponent:component]; + if (value) + { + [aResponse appendContentString:@"=\""]; + [aResponse appendContentHTMLAttributeValue:value]; + [aResponse appendContentString:@"\""]; + }; + }; + elementsN[3]++; + }; }; if (inChildren) { - [context_ deleteLastElementIDComponent]; + [aContext deleteLastElementIDComponent]; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) + if (![debugElementID isEqualToString:[aContext elementID]]) { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class],debugElementID,[aContext elementID]); }; #endif }; - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + GSWStopElement(aContext); LOGObjectFnStopC("GSWHTMLDynamicElement"); - return _element; }; //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { - int elementN=0; - NSArray* _dynamicChildren=[self dynamicChildren]; - const BYTE* elements=[elementsMap bytes]; - BYTE element=0; - int elementsN[4]={0,0,0,0}; - BOOL inChildren=NO; -#ifndef NDEBUG - NSString* debugElementID=nil; -#endif + //??? + GSWElement* element=nil; + NSString* senderID=nil; LOGObjectFnStartC("GSWHTMLDynamicElement"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"Starting HTMLDyn TV ET=%@ id=%@",[self class],[context_ elementID]); - GSWAssertCorrectElementID(context_);// Debug Only - for(elementN=0;elementN<[elementsMap length];elementN++) + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext);// Debug Only + senderID=[aContext senderID]; + if ([_elementsMap length]>0) + { + int elementN=0; + NSArray* dynamicChildren=[self dynamicChildren]; + const BYTE* elements=[_elementsMap bytes]; + BYTE elementIndic=0; + int elementsN[4]={0,0,0,0}; + BOOL searchIsOver=NO; + BOOL inChildren=NO; +#ifndef NDEBUG + NSString* debugElementID=nil; +#endif + for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++) + { + elementIndic=(BYTE)elements[elementN]; + if (elementIndic==ElementsMap_dynamicElement) + { + if (!inChildren) + { +#ifndef NDEBUG + debugElementID=[aContext elementID]; +#endif + [aContext appendZeroElementIDComponent]; + inChildren=YES; + }; + } + else + { + if (inChildren) + { + [aContext deleteLastElementIDComponent]; + inChildren=NO; +#ifndef NDEBUG + if (![debugElementID isEqualToString:[aContext elementID]]) + { + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class], + debugElementID, + [aContext elementID]); + + }; +#endif + }; + }; + if (elementIndic==ElementsMap_htmlBareString) + elementsN[0]++; + else if (elementIndic==ElementsMap_gswebElement) + elementsN[1]++; + else if (elementIndic==ElementsMap_dynamicElement) + { + element=[[dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:aRequest + inContext:aContext]; + if (![aContext _wasFormSubmitted] && [[aContext elementID] isSearchOverForSenderID:senderID]) + { + NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", + [aContext elementID], + senderID); + searchIsOver=YES; + }; + [aContext incrementLastElementIDComponent]; + elementsN[2]++; + } + else if (elementIndic==ElementsMap_attributeElement) + elementsN[3]++; + }; + if (inChildren) + { + [aContext deleteLastElementIDComponent]; +#ifndef NDEBUG + if (![debugElementID isEqualToString:[aContext elementID]]) + { + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class],debugElementID,[aContext elementID]); + + }; +#endif + }; + }; + GSWStopElement(aContext); + NSDebugMLLog(@"gswdync",@"senderID=%@",[aContext senderID]); + LOGObjectFnStopC("GSWHTMLDynamicElement"); + return element; +}; + + +//-------------------------------------------------------------------- +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext +{ + LOGObjectFnStartC("GSWHTMLDynamicElement"); + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); + if ([_elementsMap length]>0) + { + int elementN=0; + NSArray* dynamicChildren=[self dynamicChildren]; + const BYTE* elements=[_elementsMap bytes]; + BYTE element=0; + int elementsN[4]={0,0,0,0}; + BOOL inChildren=NO; +#ifndef NDEBUG + NSString* debugElementID=nil; +#endif + for(elementN=0;elementN<[_elementsMap length];elementN++) { element=(BYTE)elements[elementN]; if (element==ElementsMap_dynamicElement) - { - if (!inChildren) - { + { + if (!inChildren) + { #ifndef NDEBUG - debugElementID=[context_ elementID]; + debugElementID=[aContext elementID]; #endif - [context_ appendZeroElementIDComponent]; - inChildren=YES; - }; - } + [aContext appendZeroElementIDComponent]; + inChildren=YES; + }; + } else - { - if (inChildren) - { - [context_ deleteLastElementIDComponent]; - inChildren=NO; + { + if (inChildren) + { + [aContext deleteLastElementIDComponent]; + inChildren=NO; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; + if (![debugElementID isEqualToString:[aContext elementID]]) + { + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class],debugElementID,[aContext elementID]); + }; #endif - }; - }; + }; + }; if (element==ElementsMap_htmlBareString) - elementsN[0]++; + elementsN[0]++; else if (element==ElementsMap_gswebElement) - elementsN[1]++; + elementsN[1]++; else if (element==ElementsMap_dynamicElement) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[2]] class],[context_ elementID]); - [[_dynamicChildren objectAtIndex:elementsN[2]] takeValuesFromRequest:request_ - inContext:context_]; - [context_ incrementLastElementIDComponent]; - elementsN[2]++; - } + { + NSDebugMLLog(@"gswdync",@"i=%d", + elementN); + [[dynamicChildren objectAtIndex:elementsN[2]] takeValuesFromRequest:aRequest + inContext:aContext]; + [aContext incrementLastElementIDComponent]; + elementsN[2]++; + } else if (element==ElementsMap_attributeElement) elementsN[3]++; }; - if (inChildren) + if (inChildren) { - [context_ deleteLastElementIDComponent]; + [aContext deleteLastElementIDComponent]; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; + if (![debugElementID isEqualToString:[aContext elementID]]) + { + NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [aContext elementID]=%@", + [self class],debugElementID,[aContext elementID]); + }; #endif }; - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + }; + GSWStopElement(aContext); LOGObjectFnStopC("GSWHTMLDynamicElement"); }; @@ -679,16 +688,16 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(BOOL)appendStringAtRight:(id)_unkwnon - withMapping:(char*)_mapping +-(BOOL)appendStringAtRight:(id)unkwnon + withMapping:(char*)mapping { LOGObjectFnNotImplemented(); //TODOFN return NO; }; //-------------------------------------------------------------------- --(BOOL)appendStringAtLeft:(id)_unkwnon - withMapping:(char*)_mapping +-(BOOL)appendStringAtLeft:(id)unkwnon + withMapping:(char*)mapping { LOGObjectFnNotImplemented(); //TODOFN return NO; @@ -707,7 +716,7 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLDynamicElement (GSWHTMLDynamicElementC) //-------------------------------------------------------------------- -+(void)setDynamicElementCompaction:(BOOL)_flag ++(void)setDynamicElementCompaction:(BOOL)flag { LOGClassFnNotImplemented(); //TODOFN }; diff --git a/GSWeb.framework/GSWHTMLStaticElement.m b/GSWeb.framework/GSWHTMLStaticElement.m index 73cebd8..e17a70f 100644 --- a/GSWeb.framework/GSWHTMLStaticElement.m +++ b/GSWeb.framework/GSWHTMLStaticElement.m @@ -276,13 +276,9 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%@ %p elementsMap:%@>", -/* htmlBareStrings:%@ dynamicChildren:%@ elementName:%@>",*/ [self class], (void*)self, _elementsMap]; -/* _htmlBareStrings, - _dynamicChildren, - _elementName];*/ }; @end @@ -294,12 +290,11 @@ static char rcsId[] = "$Id$"; -(void)appendToResponse:(GSWResponse*)response inContext:(GSWContext*)context { - //OK (verifier avec GSWSession appendToR + //OK GSWRequest* request=[context request]; BOOL isFromClientComponent=[request isFromClientComponent]; //bis repetitam - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ self=%p", - [self class],[context elementID],self); - GSWSaveAppendToResponseElementID(context);//Debug Only + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); if ([_elementsMap length]>0) { [self appendToResponse:response @@ -307,8 +302,8 @@ static char rcsId[] = "$Id$"; elementsFromIndex:0 toIndex:[_elementsMap length]-1]; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@ self=%p", - [self class],[context elementID],self); + GSWAssertIsElementID(context); + GSWStopElement(context); }; //-------------------------------------------------------------------- @@ -332,11 +327,10 @@ static char rcsId[] = "$Id$"; fromIndex,toIndex); for(elementN=0;elementN<=toIndex;elementN++) { + NSDebugMLog(@"appendTo self=%p elementN=%d [context elementID]=%@",self,elementN,[context elementID]); element=(BYTE)elements[elementN]; if (element==ElementsMap_htmlBareString) { - NSDebugMLLog(@"gswdync",@"%d:htmlBareString : %@", - elementN,[_htmlBareStrings objectAtIndex:elementsN[0]]); if (elementN>=fromIndex) [response appendContentData:[[_htmlBareStrings objectAtIndex:elementsN[0]] dataUsingEncoding:encoding]]; @@ -346,11 +340,6 @@ static char rcsId[] = "$Id$"; { if (elementN>=fromIndex) { - NSDebugMLLog(@"gswdync",@"%d:dynamicElement : %@", - elementN,[aDynamicChildrensArray objectAtIndex:elementsN[1]]); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", - [[aDynamicChildrensArray objectAtIndex:elementsN[1]] class], - [context elementID]); [[aDynamicChildrensArray objectAtIndex:elementsN[1]] appendToResponse:response inContext:context]; [context incrementLastElementIDComponent]; @@ -360,10 +349,10 @@ static char rcsId[] = "$Id$"; else if (element==ElementsMap_attributeElement) { //TODO - NSDebugMLLog(@"gswdync",@"%d:attributeElement",elementN); elementsN[2]++; }; }; + GSWStopElement(context); }; //-------------------------------------------------------------------- @@ -372,46 +361,42 @@ static char rcsId[] = "$Id$"; { //OK GSWElement* element=nil; - int elementN=0; - NSArray* aDynamicChildrensArray=[self dynamicChildren]; - const BYTE* elements=[_elementsMap bytes]; - BYTE elementIndic=0; - int elementsN[3]={0,0,0}; BOOL searchIsOver=NO; NSString* senderID=nil; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", - [self class],[context elementID],[context senderID]); + GSWStartElement(context); GSWAssertCorrectElementID(context);// Debug Only senderID=[context senderID]; - for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++) + if ([_elementsMap length]>0) { - elementIndic=(BYTE)elements[elementN]; - if (elementIndic==ElementsMap_htmlBareString) - elementsN[0]++; - else if (elementIndic==ElementsMap_dynamicElement) + NSArray* aDynamicChildrensArray=[self dynamicChildren]; + const BYTE* elements=[_elementsMap bytes]; + BYTE elementIndic=0; + int elementsN[3]={0,0,0}; + int elementN=0; + for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++) { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", - [[aDynamicChildrensArray objectAtIndex:elementsN[1]] class], - [context elementID]); - element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request - inContext:context]; - //if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending) - if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID]) + elementIndic=(BYTE)elements[elementN]; + if (elementIndic==ElementsMap_htmlBareString) + elementsN[0]++; + else if (elementIndic==ElementsMap_dynamicElement) { - NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", - [context elementID], - senderID); - searchIsOver=YES; + element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request + inContext:context]; + if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID]) + { + searchIsOver=YES; + }; + [context incrementLastElementIDComponent]; + elementsN[1]++; + } + else if (elementIndic==ElementsMap_attributeElement) + { + elementsN[2]++; }; - [context incrementLastElementIDComponent]; - elementsN[1]++; - } - else if (elementIndic==ElementsMap_attributeElement) - { - elementsN[2]++; }; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); + GSWAssertIsElementID(context); + GSWStopElement(context); return element; }; @@ -420,41 +405,37 @@ static char rcsId[] = "$Id$"; inContext:(GSWContext*)context { //OK - int elementN=0; - NSArray* aDynamicChildrensArray=[self dynamicChildren]; - const BYTE* elements=[_elementsMap bytes]; - BYTE elementIndic=0; - 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++) + GSWStartElement(context); + GSWAssertCorrectElementID(context); + if ([_elementsMap length]>0) { - NSDebugMLLog(@"gswdync",@"elementN=%d",elementN); - elementIndic=(BYTE)elements[elementN]; - NSDebugMLLog(@"gswdync",@"element=%x",(unsigned int)elementIndic); - if (elementIndic==ElementsMap_htmlBareString) - elementsN[0]++; - else if (elementIndic==ElementsMap_dynamicElement) + int elementN=0; + NSArray* aDynamicChildrensArray=[self dynamicChildren]; + const BYTE* elements=[_elementsMap bytes]; + BYTE elementIndic=0; + int elementsN[3]={0,0,0}; + + for(elementN=0;elementN<[_elementsMap length];elementN++) { - NSDebugMLLog(@"gswdync",@"\n[aDynamicChildrensArray objectAtIndex:elementsN[1]=%@", - [aDynamicChildrensArray objectAtIndex:elementsN[1]]); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", - [[aDynamicChildrensArray objectAtIndex:elementsN[1]] class], - [context elementID]); - [[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request - inContext:context]; - [context incrementLastElementIDComponent]; - elementsN[1]++; - } - else if (elementIndic==ElementsMap_attributeElement) - { - elementsN[2]++; + elementIndic=(BYTE)elements[elementN]; + if (elementIndic==ElementsMap_htmlBareString) + elementsN[0]++; + else if (elementIndic==ElementsMap_dynamicElement) + { + [[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request + inContext:context]; + [context incrementLastElementIDComponent]; + elementsN[1]++; + } + else if (elementIndic==ElementsMap_attributeElement) + { + elementsN[2]++; + }; }; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@", - [self class],[context elementID]); + GSWAssertIsElementID(context); + GSWStopElement(context); LOGObjectFnStop(); }; diff --git a/GSWeb.framework/GSWHTMLStaticGroup.m b/GSWeb.framework/GSWHTMLStaticGroup.m index 88e3f0e..4b37533 100644 --- a/GSWeb.framework/GSWHTMLStaticGroup.m +++ b/GSWeb.framework/GSWHTMLStaticGroup.m @@ -67,6 +67,8 @@ static char rcsId[] = "$Id$"; -(void)appendToResponse:(GSWResponse*)response inContext:(GSWContext*)context { + LOGObjectFnStart(); + GSWStartElement(context); if (_documentTypeString) { NSStringEncoding encoding=[response contentEncoding]; @@ -76,6 +78,8 @@ static char rcsId[] = "$Id$"; [super appendToResponse:response inContext:context]; + GSWStopElement(context); + LOGObjectFnStop(); }; @end diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index 86ec6f7..50ed06d 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -222,8 +222,8 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); - GSWSaveAppendToResponseElementID(context);//Debug Only + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); if (_disabled) disabledValue=[self evaluateCondition:_disabled inContext:context]; @@ -553,10 +553,8 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", - [self class],[self definitionName], - [context elementID],[context senderID]); - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); senderID=[context senderID]; elementID=[context elementID]; if ([elementID isEqualToString:senderID]) diff --git a/GSWeb.framework/GSWInput.m b/GSWeb.framework/GSWInput.m index 89eb092..248d263 100644 --- a/GSWeb.framework/GSWInput.m +++ b/GSWeb.framework/GSWInput.m @@ -120,6 +120,7 @@ static char rcsId[] = "$Id$"; GSWComponent* component=nil; NSString* nameValue=nil; LOGObjectFnStartC("GSWInput"); + GSWAssertIsElementID(context); if (_name) { component=[context component]; @@ -130,6 +131,7 @@ static char rcsId[] = "$Id$"; nameValue=[context elementID]; NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]); }; + GSWAssertIsElementID(context); LOGObjectFnStopC("GSWInput"); return nameValue; }; @@ -193,7 +195,8 @@ static int countAutoValue = 0; //OK BOOL disabledInContext=NO; LOGObjectFnStartC("GSWInput"); - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); disabledInContext=[self disabledInContext:context]; //return 0 if (!disabledInContext) { @@ -227,6 +230,7 @@ static int countAutoValue = 0; NS_ENDHANDLER; }; }; + GSWAssertIsElementID(context); LOGObjectFnStopC("GSWInput"); }; @@ -259,7 +263,6 @@ static int countAutoValue = 0; //OK GSWComponent* component=nil; LOGObjectFnStartC("GSWInput"); - GSWSaveAppendToResponseElementID(context);//Debug Only component=[context component]; if (_value) { diff --git a/GSWeb.framework/GSWPopUpButton.m b/GSWeb.framework/GSWPopUpButton.m index ca3f72c..9325280 100644 --- a/GSWeb.framework/GSWPopUpButton.m +++ b/GSWeb.framework/GSWPopUpButton.m @@ -170,6 +170,8 @@ static char rcsId[] = "$Id$"; #endif int countValue=0; LOGObjectFnStartC("GSWPopUpButton"); + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); [self resetAutoValue]; _autoValue = NO; request=[context request]; @@ -391,6 +393,8 @@ static char rcsId[] = "$Id$"; inOptGroup=NO; }; [response _appendContentAsciiString:@""]; + GSWStopElement(context); + GSWAssertIsElementID(context); LOGObjectFnStopC("GSWPopUpButton"); }; @@ -408,8 +412,12 @@ static char rcsId[] = "$Id$"; { //OK LOGObjectFnStartC("GSWPopUpButton"); + GSWStartElement(context); + GSWAssertCorrectElementID(context); [self _slowTakeValuesFromRequest:request inContext:context]; + GSWAssertIsElementID(context); + GSWStopElement(context); LOGObjectFnStopC("GSWPopUpButton"); }; @@ -428,6 +436,8 @@ static char rcsId[] = "$Id$"; BOOL disabledValue=NO; BOOL wasFormSubmitted=NO; LOGObjectFnStartC("GSWPopUpButton"); + GSWStartElement(context); + GSWAssertCorrectElementID(context); [self resetAutoValue]; disabledValue=[self disabledInContext:context]; if (!disabledValue) @@ -450,7 +460,7 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"name=%@",name); formValues=[request formValuesForKey:name]; NSDebugMLLog(@"gswdync",@"formValues=%@",formValues); - if (formValues && [formValues count]) + if (formValues && [formValues count]>0) { BOOL isEqual=NO; formValue=[formValues objectAtIndex:0]; @@ -604,6 +614,8 @@ static char rcsId[] = "$Id$"; }; }; }; + GSWStopElement(context); + GSWAssertIsElementID(context); LOGObjectFnStopC("GSWPopUpButton"); }; diff --git a/GSWeb.framework/GSWRadioButton.m b/GSWeb.framework/GSWRadioButton.m index ef00e2c..7c7b941 100644 --- a/GSWeb.framework/GSWRadioButton.m +++ b/GSWeb.framework/GSWRadioButton.m @@ -136,6 +136,8 @@ static char rcsId[] = "$Id$"; //OK BOOL disabledInContext=NO; LOGObjectFnStart(); + GSWStartElement(context); + GSWAssertCorrectElementID(context); disabledInContext=[self disabledInContext:context]; if (!disabledInContext) { diff --git a/GSWeb.framework/GSWRepetition.h b/GSWeb.framework/GSWRepetition.h index 7491a7d..606e36b 100644 --- a/GSWeb.framework/GSWRepetition.h +++ b/GSWeb.framework/GSWRepetition.h @@ -1,11 +1,18 @@ -/* GSWRepetition.h - GSWeb: Class GSWRepetition - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWRepetition.h - GSWeb: Class GSWRepetition + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + + $Revision$ + $Date$ + + This file is part of the GNUstep Web Library. - + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -37,12 +45,12 @@ GSWHTMLStaticGroup* _childrenGroup; }; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; -(NSString*)description; -(void)dealloc; @@ -51,28 +59,28 @@ //==================================================================== @interface GSWRepetition (GSWRepetitionA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)stopOneIterationWithIndex:(int)index_ - count:(int)count_ - isLastOne:(BOOL)isLastOne_ - inContext:(GSWContext*)context_; --(void)startOneIterationWithIndex:(unsigned int)index_ - list:(NSArray*)list_ - inContext:(GSWContext*)context_; +-(void)stopOneIterationWithIndex:(int)index + count:(int)count + isLastOne:(BOOL)isLastOne + inContext:(GSWContext*)aContext; +-(void)startOneIterationWithIndex:(unsigned int)index + list:(NSArray*)aList + inContext:(GSWContext*)aContext; @end diff --git a/GSWeb.framework/GSWRepetition.m b/GSWeb.framework/GSWRepetition.m index cb03ca5..c6bbd67 100644 --- a/GSWeb.framework/GSWRepetition.m +++ b/GSWeb.framework/GSWRepetition.m @@ -1,11 +1,18 @@ -/* GSWRepetition.m - GSWeb: Class GSWRepetition - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWRepetition.m - GSWeb: Class GSWRepetition + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - This file is part of the GNUstep Web Library. + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -96,6 +104,14 @@ static char rcsId[] = "$Id$"; [super dealloc]; } +//-------------------------------------------------------------------- +-(void)setDefinitionName:(NSString*)definitionName +{ + [super setDefinitionName:definitionName]; + if (definitionName && _childrenGroup) + [_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]]; +}; + //-------------------------------------------------------------------- -(NSString*)description { @@ -120,7 +136,8 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); component=[context component]; NSDebugMLLog(@"gswdync",@"_list=%@",_list); if (_list) @@ -151,6 +168,7 @@ static char rcsId[] = "$Id$"; }; NSDebugMLLog(@"gswdync",@"countValue=%d",countValue); + [context incrementLoopLevel]; for(i=0;iGSWeb: Class GSWResetButton + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +24,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -29,12 +35,12 @@ //OK //==================================================================== @interface GSWResetButton: GSWInput --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)takeValuesFromRequest:(GSWRequest*)request + inContext:(GSWContext*)context; @end diff --git a/GSWeb.framework/GSWResetButton.m b/GSWeb.framework/GSWResetButton.m index f99a37c..239e3d5 100644 --- a/GSWeb.framework/GSWResetButton.m +++ b/GSWeb.framework/GSWResetButton.m @@ -1,11 +1,16 @@ -/* GSWResetButton.m - GSWeb: Class GSWResetButton - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWResetButton.m - GSWeb: Class GSWResetButton + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +24,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -28,34 +34,35 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWResetButton --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements { - NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_]; + NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations]; LOGObjectFnStartC("GSWResetButton"); - NSDebugMLLog(@"gswdync",@"name_=%@ associations_:%@ _elements=%@",name_,associations_,elements_); - [_associations setObject:[GSWAssociation associationWithValue:@"reset"] - forKey:@"type"]; + NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements); + [tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"] + forKey:@"type"]; - if (![_associations objectForKey:value__Key]) - [_associations setObject:[GSWAssociation associationWithValue:@"reset"] - forKey:value__Key]; - - if ((self=[super initWithName:name_ - associations:_associations - contentElements:nil])) - { - }; + if (![tmpAssociations objectForKey:value__Key]) + [tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"] + forKey:value__Key]; + + if ((self=[super initWithName:aName + associations:tmpAssociations + contentElements:nil])) + { + }; LOGObjectFnStopC("GSWResetButton"); return self; }; //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(void)takeValuesFromRequest:(GSWRequest*)request + inContext:(GSWContext*)context { - GSWAssertCorrectElementID(context_);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); //Does Nothing and don't call its parent GSWInput ! }; diff --git a/GSWeb.framework/GSWResponse.h b/GSWeb.framework/GSWResponse.h index 4bf1144..2f11085 100644 --- a/GSWeb.framework/GSWResponse.h +++ b/GSWeb.framework/GSWResponse.h @@ -81,6 +81,7 @@ length:(unsigned)length; -(void)appendContentCharacter:(char)aChar; -(void)appendContentString:(NSString*)string; +-(void)appendDebugCommentContentString:(NSString*)string; -(void)appendContentData:(NSData*)contentData; -(void)setContentEncoding:(NSStringEncoding)encoding; -(NSStringEncoding)contentEncoding; diff --git a/GSWeb.framework/GSWResponse.m b/GSWeb.framework/GSWResponse.m index 9f7ea24..0712a99 100644 --- a/GSWeb.framework/GSWResponse.m +++ b/GSWeb.framework/GSWResponse.m @@ -397,7 +397,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(void)appendDebugCommentContentString:(NSString*)string { #ifndef NDEBUG - [self appendContentString:[NSString stringWithFormat:@"",string]]; + [self appendContentString:[NSString stringWithFormat:@"\n\n",string]]; #endif }; @@ -584,6 +584,16 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; NSString* _dataLengthString=nil; LOGObjectFnStart(); NSAssert(!isFinalizeInContextHasBeenCalled,@"GSWResponse _finalizeInContext: already called"); + +#ifndef NDEBUG + if(GSDebugSet(@"GSWDocStructure")) + { + NSString* docStructure=[_context docStructure]; + if (docStructure) + [self appendDebugCommentContentString:docStructure]; + } +#endif + //TODOV: if !session in request and session created: no client cache if (![self _isClientCachingDisabled] && [_context hasSession] && ![_context _requestSessionID]) [self disableClientCaching]; diff --git a/GSWeb.framework/GSWSession.m b/GSWeb.framework/GSWSession.m index 613fbab..e13838d 100644 --- a/GSWeb.framework/GSWSession.m +++ b/GSWeb.framework/GSWSession.m @@ -1093,6 +1093,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); LOGObjectFnStart(); _pageElement=[context_ _pageElement]; _pageComponent=[context_ _pageComponent]; +#ifndef NDEBUG + [context_ addDocStructureStep:@"Take Values From Request"]; +#endif [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? [_pageComponent takeValuesFromRequest:request_ inContext:context_]; //_pageComponent ?? @@ -1113,6 +1116,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); { _pageElement=[context_ _pageElement]; _pageComponent=[context_ _pageComponent]; +#ifndef NDEBUG + [context_ addDocStructureStep:@"Invoke Action For Request"]; +#endif [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? _element=[_pageComponent invokeActionForRequest:request_ inContext:context_]; //_pageComponent @@ -1152,6 +1158,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); _statisticsStore=[[GSWApplication application] statisticsStore]; _pageElement=[context_ _pageElement]; _pageComponent=[context_ _pageComponent]; +#ifndef NDEBUG + [context_ addDocStructureStep:@"Append To Response"]; +#endif [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? [_pageComponent appendToResponse:response_ inContext:context_]; //_pageComponent?? diff --git a/GSWeb.framework/GSWString.m b/GSWeb.framework/GSWString.m index ea8ee82..cde88ba 100644 --- a/GSWeb.framework/GSWString.m +++ b/GSWeb.framework/GSWString.m @@ -121,7 +121,8 @@ static char rcsId[] = "$Id$"; GSWComponent* component=nil; id valueValue = nil; LOGObjectFnStartC("GSWString"); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); request=[context request]; isFromClientComponent=[request isFromClientComponent]; component=[context component]; @@ -177,7 +178,7 @@ static char rcsId[] = "$Id$"; else [response appendContentString:formattedValue]; }; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); + GSWStopElement(context); LOGObjectFnStopC("GSWString"); }; diff --git a/GSWeb.framework/GSWSubmitButton.m b/GSWeb.framework/GSWSubmitButton.m index ef8c711..d07fe7e 100644 --- a/GSWeb.framework/GSWSubmitButton.m +++ b/GSWeb.framework/GSWSubmitButton.m @@ -2,7 +2,7 @@ Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 $Revision$ @@ -92,9 +92,11 @@ static char rcsId[] = "$Id$"; { //OK LOGObjectFnStart(); - GSWSaveAppendToResponseElementID(context);//Debug Only + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); [super appendToResponse:response inContext:context]; + GSWStopElement(context); LOGObjectFnStop(); }; @@ -106,16 +108,16 @@ static char rcsId[] = "$Id$"; GSWElement* element=nil; BOOL disabledValue=NO; LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", - [self class],[context elementID],[context senderID]); + GSWStartElement(context); NS_DURING { - GSWAssertCorrectElementID(context);// Debug Only + GSWAssertCorrectElementID(context); disabledValue=[self disabledInContext:context]; NSDebugMLLog(@"gswdync",@"disabledValue=%s",(disabledValue ? "YES" : "NO")); if (!disabledValue) { BOOL wasFormSubmitted=[context _wasFormSubmitted]; + NSDebugMLLog(@"gswdync",@"wasFormSubmitted=%s",(wasFormSubmitted ? "YES" : "NO")); if (wasFormSubmitted) { BOOL invoked=NO; @@ -162,7 +164,7 @@ static char rcsId[] = "$Id$"; { if (![element isKindOfClass:[GSWComponent class]]) //TODO GSWComponent or Element ? { - ExceptionRaise0(@"GSWHyperlink",@"Invoked element return a not GSWComponent element"); + ExceptionRaise0(@"GSWSubmitButton",@"Invoked element return a not GSWComponent element"); } else { @@ -204,6 +206,7 @@ static char rcsId[] = "$Id$"; [context elementID], [context senderID]); }; + GSWStopElement(context); LOGObjectFnStop(); return element; }; @@ -213,7 +216,9 @@ static char rcsId[] = "$Id$"; inContext:(GSWContext*)context { //Does Nothing ? - GSWAssertCorrectElementID(context);// Debug Only + GSWStartElement(context); + GSWAssertCorrectElementID(context); + GSWStopElement(context); }; //-------------------------------------------------------------------- diff --git a/GSWeb.framework/GSWSwitchComponent.h b/GSWeb.framework/GSWSwitchComponent.h index e65286b..b4ed249 100644 --- a/GSWeb.framework/GSWSwitchComponent.h +++ b/GSWeb.framework/GSWSwitchComponent.h @@ -51,13 +51,13 @@ @end @interface GSWSwitchComponent (GSWSwitchComponentA) --(void)appendToResponse:(GSWResponse*)response +-(void)appendToResponse:(GSWResponse*)aResponse inContext:(GSWContext*)aContext; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest inContext:(GSWContext*)aContext; --(void)takeValuesFromRequest:(GSWRequest*)request_ +-(void)takeValuesFromRequest:(GSWRequest*)aRequest inContext:(GSWContext*)aContext; -(GSWElement*)_realComponentWithName:(NSString*)name inContext:(GSWContext*)aContext; diff --git a/GSWeb.framework/GSWSwitchComponent.m b/GSWeb.framework/GSWSwitchComponent.m index b849ab0..1e931e3 100644 --- a/GSWeb.framework/GSWSwitchComponent.m +++ b/GSWeb.framework/GSWSwitchComponent.m @@ -111,6 +111,8 @@ static char rcsId[] = "$Id$"; GSWElement* element=nil; NSString* elementNameInContext=nil; LOGObjectFnStartC("GSWSwitchComponent"); + GSWStartElement(aContext); + GSWSaveAppendToResponseElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; element=[self _realComponentWithName:elementNameInContext @@ -129,6 +131,8 @@ static char rcsId[] = "$Id$"; GSWElement* element=nil; NSString* elementNameInContext=nil; LOGObjectFnStartC("GSWSwitchComponent"); + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; element=[self _realComponentWithName:elementNameInContext @@ -141,17 +145,19 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request +-(void)takeValuesFromRequest:(GSWRequest*)aRequest inContext:(GSWContext*)aContext { GSWElement* element=nil; NSString* elementNameInContext=nil; LOGObjectFnStartC("GSWSwitchComponent"); + GSWStartElement(aContext); + GSWAssertCorrectElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; element=[self _realComponentWithName:elementNameInContext inContext:aContext]; - [element takeValuesFromRequest:request + [element takeValuesFromRequest:aRequest inContext:aContext]; [aContext deleteLastElementIDComponent]; LOGObjectFnStopC("GSWSwitchComponent"); diff --git a/GSWeb.framework/GSWTemplateParser.m b/GSWeb.framework/GSWTemplateParser.m index 2312623..0a85351 100644 --- a/GSWeb.framework/GSWTemplateParser.m +++ b/GSWeb.framework/GSWTemplateParser.m @@ -236,7 +236,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil; NSRange docTypeRangeEnd=NSMakeRange(NSNotFound,0); _template=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements]; - + [_template setDefinitionName:[NSString stringWithFormat:@"Template - %@",_templateName]]; + NSDebugMLog(@"template %p=%@",_template,_template); //NSLog(@"_string = %@", _string); docTypeRangeStart=[_string rangeOfString:@"GSWeb: Class GSWURLValuedElementData + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Apr 1999 + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +25,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ // $Id$ @@ -29,21 +36,21 @@ @interface GSWURLValuedElementData: NSObject { - NSString* key; - NSString* mimeType; - NSData * data; - BOOL temporaryKey; + NSString* _key; + NSString* _mimeType; + NSData * _data; + BOOL _temporaryKey; }; --(id)initWithData:(NSData*)data_ - mimeType:(NSString*)type_ - key:(NSString*)key_; +-(id)initWithData:(NSData*)data + mimeType:(NSString*)type + key:(NSString*)key; -(void)dealloc; --(void)appendDataURLToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendDataURLToResponse:(GSWResponse*)response + inContext:(GSWContext*)context; +-(void)appendToResponse:(GSWResponse*)response + inContext:(GSWContext*)context; -(NSString*)description; -(BOOL)isTemporary; -(NSData*)data; diff --git a/GSWeb.framework/GSWURLValuedElementData.m b/GSWeb.framework/GSWURLValuedElementData.m index eaea482..3128d40 100644 --- a/GSWeb.framework/GSWURLValuedElementData.m +++ b/GSWeb.framework/GSWURLValuedElementData.m @@ -1,11 +1,18 @@ -/* GSWURLValuedElementData.m - GSWeb: Class GSWURLValuedElementData - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWURLValuedElementData.m - GSWeb: Class GSWURLValuedElementData + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + + + This file is part of the GNUstep Web Library. + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -19,7 +26,8 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -28,29 +36,29 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWURLValuedElementData --(id)initWithData:(NSData*)data_ - mimeType:(NSString*)type_ - key:(NSString*)key_ +-(id)initWithData:(NSData*)data + mimeType:(NSString*)type + key:(NSString*)key { LOGObjectFnStart(); if ((self=[super init])) - { - ASSIGN(data,data_); - NSDebugMLog(@"data=%@",data); - ASSIGN(mimeType,type_); - NSDebugMLog(@"mimeType=%@",mimeType); - NSDebugMLog(@"key_=%@",key_); - if (key_) - { - ASSIGN(key,key_); - } - else - { - temporaryKey=YES; - ASSIGN(key,[NSString stringUniqueIdWithLength:4]); - }; - NSDebugMLog(@"key=%@",key); - }; + { + ASSIGN(_data,data); + NSDebugMLog(@"data=%@",_data); + ASSIGN(_mimeType,type); + NSDebugMLog(@"mimeType=%@",_mimeType); + NSDebugMLog(@"key=%@",key); + if (key) + { + ASSIGN(_key,key); + } + else + { + _temporaryKey=YES; + ASSIGN(_key,[NSString stringUniqueIdWithLength:4]); + }; + NSDebugMLog(@"key=%@",_key); + }; LOGObjectFnStop(); return self; }; @@ -58,50 +66,52 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(data); - DESTROY(mimeType); - DESTROY(key); + DESTROY(_data); + DESTROY(_mimeType); + DESTROY(_key); [super dealloc]; }; //-------------------------------------------------------------------- --(void)appendDataURLToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendDataURLToResponse:(GSWResponse*)response + inContext:(GSWContext*)context { - NSString* _queryString=nil; - GSWDynamicURLString* _url=nil; + NSString* queryString=nil; + GSWDynamicURLString* url=nil; LOGObjectFnStart(); - _queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]]; - NSDebugMLog(@"_queryString=%@",_queryString); - _url=[context_ urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv] - path:nil - queryString:_queryString]; - NSDebugMLog(@"_url=%@",_url); - [response_ _appendContentAsciiString:(NSString*)_url]; + queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]]; + NSDebugMLog(@"queryString=%@",queryString); + url=[context urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv] + path:nil + queryString:queryString]; + NSDebugMLog(@"url=%@",url); + [response _appendContentAsciiString:(NSString*)url]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)response + inContext:(GSWContext*)context { //OK - NSData* _data=data; + NSData* data=_data; LOGObjectFnStart(); - NSDebugMLog(@"_data=%@",_data); - [response_ setHeader:[NSString stringWithFormat:@"%u",[data length]] - forKey:@"content-length"]; - if (!_data) - { - NSDebugMLog(@"key=%@",key); - _data=[NSData dataWithContentsOfFile:key]; - NSDebugMLog(@"_data=%@",_data); - } + GSWStartElement(context); + GSWSaveAppendToResponseElementID(context); + NSDebugMLog(@"data=%@",data); + if (!data) + { + NSDebugMLog(@"key=%@",_key); + data=[NSData dataWithContentsOfFile:_key]; + NSDebugMLog(@"data=%@",data); + } else - [response_ setContent:_data]; + [response setContent:data]; + [response setHeader:[NSString stringWithFormat:@"%u",[data length]] + forKey:@"content-length"]; - [response_ setHeader:mimeType - forKey:@"content-type"]; + [response setHeader:_mimeType + forKey:@"content-type"]; LOGObjectFnStop(); }; @@ -109,8 +119,8 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%s %p>", - object_get_class_name(self), - (void*)self]; + object_get_class_name(self), + (void*)self]; }; //-------------------------------------------------------------------- @@ -118,7 +128,7 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); LOGObjectFnStop(); - return temporaryKey; + return _temporaryKey; }; //-------------------------------------------------------------------- @@ -126,7 +136,7 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); LOGObjectFnStop(); - return data; + return _data; }; //-------------------------------------------------------------------- @@ -134,7 +144,7 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); LOGObjectFnStop(); - return mimeType; + return _mimeType; }; //-------------------------------------------------------------------- @@ -142,7 +152,7 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); LOGObjectFnStop(); - return key; + return _key; }; @end