2002-05-16 Manuel Guesdon <mguesdon@orange-concept.com>

* 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


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@13661 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2002-05-16 18:01:40 +00:00
parent fd60ac7071
commit c576f5a730
45 changed files with 1807 additions and 1282 deletions

108
ChangeLog
View file

@ -1,3 +1,109 @@
2002-05-xx Manuel Guesdon <mguesdon@orange-concept.com>
* 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 <mguesdon@orange-concept.com> 2002-05-14 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWSubmitButton.m: * GSWeb.framework/GSWSubmitButton.m:
o corrected setActionInvoked into _setActionInvoked o corrected setActionInvoked into _setActionInvoked
@ -27,7 +133,7 @@
* GSWeb.framework/GSWText.m: * GSWeb.framework/GSWText.m:
o handling exception in takeValue o handling exception in takeValue
* GSWeb.framework/GSWInput.m: * GSWeb.framework/GSWInput.m:
o corrected bug in akeValuesFromRequest:inContext: o corrected bug in takeValuesFromRequest:inContext:
* GSWExtensionsGSW.framework: * GSWExtensionsGSW.framework:
o added GSWFileUploadComponent o added GSWFileUploadComponent
* GSWExtensionsGSW.framework/GNUmakefile * GSWExtensionsGSW.framework/GNUmakefile

View file

@ -29,9 +29,8 @@
{ {
LOGObjectFnStart(); LOGObjectFnStart();
if ((self=[super init])) if ((self=[super init]))
{ {
NSDebugMLog(@"associationsKeys=%@",associationsKeys); };
};
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
@ -74,7 +73,6 @@
BOOL _bindingOk=NO; BOOL _bindingOk=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLog(@"user=%@ password=%@",user,password); NSDebugMLog(@"user=%@ password=%@",user,password);
NSDebugMLog(@"associationsKeys=%@",associationsKeys);
NS_DURING NS_DURING
{ {
if ([self hasBinding:@"password"]) if ([self hasBinding:@"password"])

View file

@ -2605,6 +2605,7 @@ int GSWApplicationMain(NSString* applicationClassName,
GSWResponse* _response=nil; GSWResponse* _response=nil;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"application",@"context=%@",context_); NSDebugMLLog(@"application",@"context=%@",context_);
NSDebugMLog(@"EXCEPTION=%@",exception_);
NS_DURING NS_DURING
{ {
_response=[self _handleException:exception_ _response=[self _handleException:exception_

View file

@ -144,6 +144,8 @@ static char rcsId[] = "$Id$";
//OK //OK
BOOL disabledInContext=NO; BOOL disabledInContext=NO;
LOGObjectFnStartC("GSWCheckBox"); LOGObjectFnStartC("GSWCheckBox");
GSWStartElement(context);
GSWAssertCorrectElementID(context);
disabledInContext=[self disabledInContext:context]; disabledInContext=[self disabledInContext:context];
if (!disabledInContext) if (!disabledInContext)
{ {
@ -212,6 +214,8 @@ static char rcsId[] = "$Id$";
}; };
}; };
}; };
GSWStopElement(context);
GSWAssertIsElementID(context);
LOGObjectFnStopC("GSWCheckBox"); LOGObjectFnStopC("GSWCheckBox");
}; };

View file

@ -559,6 +559,7 @@ associationsKeys:(NSArray*)associationsKeys
NSDebugMLLog(@"gswcomponents",@"subComponents=%@",_subComponents); NSDebugMLLog(@"gswcomponents",@"subComponents=%@",_subComponents);
subc=[_subComponents objectForKey:elementId]; subc=[_subComponents objectForKey:elementId];
NSDebugMLLog(@"gswcomponents",@"subc=%@",subc); NSDebugMLLog(@"gswcomponents",@"subc=%@",subc);
NSDebugMLog(@"subComponent %@ for _elementId=%@",[subc class],elementId);
LOGObjectFnStop(); LOGObjectFnStop();
return subc; return subc;
}; };
@ -569,6 +570,7 @@ associationsKeys:(NSArray*)associationsKeys
{ {
//OK //OK
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLog(@"setSubComponent %@ for _elementId=%@",[component class],elementId);
NSDebugMLLog(@"gswcomponents",@"elementId=%@",elementId); NSDebugMLLog(@"gswcomponents",@"elementId=%@",elementId);
NSDebugMLLog(@"gswcomponents",@"component=%@",component); NSDebugMLLog(@"gswcomponents",@"component=%@",component);
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents); NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
@ -981,13 +983,15 @@ associationsKeys:(NSArray*)associationsKeys
GSWElementIDString* debugElementID=[aContext elementID]; GSWElementIDString* debugElementID=[aContext elementID];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); GSWStartElement(aContext);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); GSWSaveAppendToResponseElementID(aContext);
GSWSaveAppendToResponseElementID(aContext);//Debug Only
template=[self _template]; template=[self _template];
#ifndef NDEBUG
if(GSDebugSet(@"gswcomponents") == YES) if(GSDebugSet(@"gswcomponents") == YES)
[aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Start %@ -->\n",[self _templateName]]];//TODO enlever [aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
#endif
request=[aContext request]; request=[aContext request];
isFromClientComponent=[request isFromClientComponent]; isFromClientComponent=[request isFromClientComponent];
@ -995,6 +999,8 @@ associationsKeys:(NSArray*)associationsKeys
[aContext appendZeroElementIDComponent]; [aContext appendZeroElementIDComponent];
NS_DURING 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 [template appendToResponse:aResponse
inContext:aContext]; inContext:aContext];
} }
@ -1010,8 +1016,7 @@ associationsKeys:(NSArray*)associationsKeys
NS_ENDHANDLER; NS_ENDHANDLER;
[aContext deleteLastElementIDComponent]; [aContext deleteLastElementIDComponent];
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); GSWStopElement(aContext);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
#ifndef NDEBUG #ifndef NDEBUG
if (![debugElementID isEqualToString:[aContext elementID]]) if (![debugElementID isEqualToString:[aContext elementID]])
{ {
@ -1023,6 +1028,7 @@ associationsKeys:(NSArray*)associationsKeys
[aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Stop %@ -->\n", [aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Stop %@ -->\n",
[self _templateName]]];//TODO enlever [self _templateName]]];//TODO enlever
GSWAssertIsElementID(aContext);
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -1039,11 +1045,10 @@ associationsKeys:(NSArray*)associationsKeys
GSWElementIDString* debugElementID=[aContext elementID]; GSWElementIDString* debugElementID=[aContext elementID];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); GSWStartElement(aContext);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
NS_DURING NS_DURING
{ {
GSWAssertCorrectElementID(aContext);// Debug Only GSWAssertCorrectElementID(aContext);
template=[self _template]; template=[self _template];
[aContext appendZeroElementIDComponent]; [aContext appendZeroElementIDComponent];
element=[[self _template] invokeActionForRequest:aRequest element=[[self _template] invokeActionForRequest:aRequest
@ -1060,8 +1065,7 @@ associationsKeys:(NSArray*)associationsKeys
[localException raise]; [localException raise];
} }
NS_ENDHANDLER; NS_ENDHANDLER;
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); GSWStopElement(aContext);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
#ifndef NDEBUG #ifndef NDEBUG
if (![debugElementID isEqualToString:[aContext elementID]]) if (![debugElementID isEqualToString:[aContext elementID]])
{ {
@ -1079,6 +1083,7 @@ associationsKeys:(NSArray*)associationsKeys
[aContext elementID], [aContext elementID],
[aContext senderID]); [aContext senderID]);
}; };
GSWAssertIsElementID(aContext);
LOGObjectFnStop(); LOGObjectFnStop();
return element; return element;
}; };
@ -1096,20 +1101,19 @@ associationsKeys:(NSArray*)associationsKeys
GSWElementIDString* debugElementID=[aContext elementID]; GSWElementIDString* debugElementID=[aContext elementID];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
GSWAssertCorrectElementID(aContext);// Debug Only GSWStartElement(aContext);
GSWAssertCorrectElementID(aContext);
[_validationFailureMessages removeAllObjects]; [_validationFailureMessages removeAllObjects];
oldValidateFlag=[aContext isValidate]; oldValidateFlag=[aContext isValidate];
[aContext setValidate:YES]; [aContext setValidate:YES];
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
template=[self _template]; template=[self _template];
[aContext appendZeroElementIDComponent]; [aContext appendZeroElementIDComponent];
NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
[template takeValuesFromRequest:aRequest [template takeValuesFromRequest:aRequest
inContext:aContext]; inContext:aContext];
[aContext deleteLastElementIDComponent]; [aContext deleteLastElementIDComponent];
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]); GSWStopElement(aContext);
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
#ifndef NDEBUG #ifndef NDEBUG
if (![debugElementID isEqualToString:[aContext elementID]]) if (![debugElementID isEqualToString:[aContext elementID]])
{ {
@ -1119,6 +1123,7 @@ associationsKeys:(NSArray*)associationsKeys
}; };
#endif #endif
[aContext setValidate:oldValidateFlag]; [aContext setValidate:oldValidateFlag];
GSWAssertIsElementID(aContext);
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -1382,8 +1387,6 @@ associationsKeys:(NSArray*)associationsKeys
{ {
NSArray* languages=nil; NSArray* languages=nil;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswcomponents",@"[self context]=%p",(void*)[self context]);
NSDebugMLLog(@"gswcomponents",@"[self context]=%@",[self context]);
languages=[[self context] languages]; languages=[[self context] languages];
LOGObjectFnStop(); LOGObjectFnStop();
return languages; return languages;

View file

@ -49,6 +49,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@", NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@",
[self class],[self definitionName],[aContext elementID]); [self class],[self definitionName],[aContext elementID]);
GSWSaveAppendToResponseElementID(aContext);//Debug Only
component=[aContext component]; component=[aContext component];
childTemplate=[component _childTemplate]; childTemplate=[component _childTemplate];
parent=[component parent]; parent=[component parent];
@ -114,6 +115,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@", NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@",
[self class],[self definitionName],[aContext elementID]); [self class],[self definitionName],[aContext elementID]);
GSWAssertCorrectElementID(aContext);// Debug Only
component=[aContext component]; component=[aContext component];
childTemplate=[component _childTemplate]; childTemplate=[component _childTemplate];
parent=[component parent]; parent=[component parent];

View file

@ -1,11 +1,18 @@
/* GSWComponentReference.h - GSWeb: Class GSWComponentReference /** GSWComponentReference.h - <title>GSWeb: Class GSWComponentReference</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -29,39 +37,39 @@
//==================================================================== //====================================================================
@interface GSWComponentReference: GSWDynamicElement @interface GSWComponentReference: GSWDynamicElement
{ {
NSString* name; NSString* _name;
NSArray* associationsKeys; NSArray* _associationsKeys;
NSArray* associations; NSArray* _associations;
GSWElement* contentElement; GSWElement* _contentElement;
}; };
-(void)dealloc; -(void)dealloc;
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_; associations:(NSDictionary*)associations;
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
template:(GSWElement*)template_; template:(GSWElement*)template;
-(NSString*)description; -(NSString*)description;
@end @end
//==================================================================== //====================================================================
@interface GSWComponentReference (GSWComponentReferenceA) @interface GSWComponentReference (GSWComponentReferenceA)
-(void)popRefComponentInContext:(GSWContext*)context_; -(void)popRefComponentInContext:(GSWContext*)aContext;
-(void)pushRefComponentInContext:(GSWContext*)context_; -(void)pushRefComponentInContext:(GSWContext*)aContext;
@end @end
//==================================================================== //====================================================================
@interface GSWComponentReference (GSWRequestHandling) @interface GSWComponentReference (GSWRequestHandling)
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
@end @end
#endif //_GSWComponentReference_h__ #endif //_GSWComponentReference_h__

View file

@ -1,11 +1,18 @@
/* GSWComponentReference.m - GSWeb: Class GSWComponentReference /* GSWComponentReference.m - <title>GSWeb: Class GSWComponentReference</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
This file is part of the GNUstep Web Library. $Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
static char rcsId[] = "$Id$"; static char rcsId[] = "$Id$";
@ -29,28 +37,28 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentReference @implementation GSWComponentReference
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
{ {
LOGObjectFnStart(); LOGObjectFnStart();
//OK //OK
NSDebugMLLog(@"gswdync",@"name:%@",name); NSDebugMLLog(@"gswdync",@"aName:%@",aName);
NSDebugMLLog(@"gswdync",@"associations_:%@",associations_); NSDebugMLLog(@"gswdync",@"associations:%@",associations);
if ((self==[super initWithName:name_ if ((self==[super initWithName:aName
associations:associations_ associations:associations
template:nil])) template:nil]))
{ {
ASSIGN(name,name_); ASSIGN(_name,aName);
if (associations_ && [associations_ count]) if (associations && [associations count])
{ {
NSMutableArray* tmpArray=[NSMutableArray array]; NSMutableArray* tmpArray=[NSMutableArray array];
int i=0; int i=0;
ASSIGN(associationsKeys,[associations_ allKeys]); ASSIGN(_associationsKeys,[associations allKeys]);
for(i=0;i<[associationsKeys count];i++) 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(); LOGObjectFnStop();
@ -58,19 +66,19 @@ static char rcsId[] = "$Id$";
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
template:(GSWElement*)_template template:(GSWElement*)template
{ {
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"name:%@",name); NSDebugMLLog(@"gswdync",@"aName:%@",aName);
NSDebugMLLog(@"gswdync",@"associations_:%@",associations_); NSDebugMLLog(@"gswdync",@"associations:%@",associations);
NSDebugMLLog(@"gswdync",@"_template:%@",_template); NSDebugMLLog(@"gswdync",@"template:%@",template);
if ((self==[self initWithName:name_ if ((self==[self initWithName:aName
associations:associations_])) associations:associations]))
{ {
ASSIGN(contentElement,_template); ASSIGN(_contentElement,template);
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
@ -80,13 +88,13 @@ static char rcsId[] = "$Id$";
{ {
GSWLogC("Dealloc GSWComponentReference"); GSWLogC("Dealloc GSWComponentReference");
GSWLogC("Destroy name"); GSWLogC("Destroy name");
DESTROY(name); DESTROY(_name);
GSWLogC("Destroy associationsKeys"); GSWLogC("Destroy associationsKeys");
DESTROY(associationsKeys); DESTROY(_associationsKeys);
GSWLogC("Destroy associations"); GSWLogC("Destroy associations");
DESTROY(associations); DESTROY(_associations);
GSWLogC("Destroy contentElement"); GSWLogC("Destroy contentElement");
DESTROY(contentElement); DESTROY(_contentElement);
GSWLogC("Dealloc GSWComponentReference Super"); GSWLogC("Dealloc GSWComponentReference Super");
[super dealloc]; [super dealloc];
GSWLogC("End Dealloc GSWComponentReference"); GSWLogC("End Dealloc GSWComponentReference");
@ -96,91 +104,93 @@ static char rcsId[] = "$Id$";
-(NSString*)description -(NSString*)description
{ {
return [NSString stringWithFormat:@"<%@ %p name:%@ associationsKeys:%@ associations:%@ contentElement:%@>", return [NSString stringWithFormat:@"<%@ %p name:%@ associationsKeys:%@ associations:%@ contentElement:%@>",
[self class], [self class],
(void*)self, (void*)self,
name, _name,
associationsKeys, _associationsKeys,
associations, _associations,
contentElement]; _contentElement];
}; };
@end @end
//==================================================================== //====================================================================
@implementation GSWComponentReference (GSWComponentReferenceA) @implementation GSWComponentReference (GSWComponentReferenceA)
-(void)popRefComponentInContext:(GSWContext*)_context -(void)popRefComponentInContext:(GSWContext*)context
{ {
//OK //OK
GSWComponent* _subComponent=nil; GSWComponent* subComponent=nil;
GSWComponent* _component=nil; GSWComponent* component=nil;
LOGObjectFnStart(); LOGObjectFnStart();
_subComponent=[_context component]; subComponent=[context component];
_component=[_subComponent parent]; component=[subComponent parent];
[_subComponent synchronizeComponentToParent]; [subComponent synchronizeComponentToParent];
[_context _setCurrentComponent:_component]; [context _setCurrentComponent:component];
LOGObjectFnStop(); LOGObjectFnStop();
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)pushRefComponentInContext:(GSWContext*)_context -(void)pushRefComponentInContext:(GSWContext*)context
{ {
//OK //OK
GSWComponent* _subComponent=nil; GSWComponent* subComponent=nil;
GSWComponentDefinition* _subComponentDefinition=nil; GSWComponentDefinition* subComponentDefinition=nil;
GSWComponent* _component=nil; GSWComponent* component=nil;
NSString* _elementID=nil; NSString* elementID=nil;
LOGObjectFnStart(); LOGObjectFnStart();
_component=[_context component]; component=[context component];
_elementID=[_context elementID]; elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"_elementID:%@",_elementID); NSDebugMLLog(@"gswdync",@"_elementID:%@",elementID);
_subComponent=[_component subComponentForElementID:_elementID]; subComponent=[component subComponentForElementID:elementID];
NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent); NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent);
if (!_subComponent) if (!subComponent)
{ {
NSArray* _languages=[_context languages]; NSArray* languages=[context languages];
NSDebugMLLog(@"gswdync",@"name:%@",name); NSDebugMLLog(@"gswdync",@"name:%@",_name);
NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p", NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p",
(void*)self, (void*)self,
(void*)_component); (void*)component);
_subComponentDefinition=[GSWApp componentDefinitionWithName:name subComponentDefinition=[GSWApp componentDefinitionWithName:_name
languages:_languages]; languages:languages];
NSDebugMLLog(@"gswdync",@"_subComponentDefinition=%@",_subComponentDefinition); NSDebugMLLog(@"gswdync",@"subComponentDefinition=%@",subComponentDefinition);
if (_subComponentDefinition) if (subComponentDefinition)
{ {
_subComponent=[_subComponentDefinition componentInstanceInContext:_context]; subComponent=[subComponentDefinition componentInstanceInContext:context];
NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent); NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent);
if (_subComponent) if (subComponent)
{ {
NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p", NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p",
(void*)self, (void*)self,
(void*)_component, (void*)component,
(void*)_subComponent); (void*)subComponent);
[_subComponent setParent:_component [subComponent setParent:component
associationsKeys:associationsKeys associationsKeys:_associationsKeys
associations:associations associations:_associations
template:contentElement]; template:_contentElement];
} }
else else
{ {
ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'",name); ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'",
}; _name);
} };
else }
{ else
ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'",name); {
}; ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'",
if (_subComponent) _name);
{ };
[_component setSubComponent:_subComponent if (subComponent)
forElementID:_elementID]; {
[_subComponent awakeInContext:_context]; [component setSubComponent:subComponent
}; forElementID:elementID];
}; [subComponent awakeInContext:context];
if (_subComponent) };
{ };
[_subComponent synchronizeParentToComponent]; if (subComponent)
}; {
[_context _setCurrentComponent:_subComponent]; [subComponent synchronizeParentToComponent];
};
[context _setCurrentComponent:subComponent];
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -191,99 +201,105 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentReference (GSWRequestHandling) @implementation GSWComponentReference (GSWRequestHandling)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
//OK //OK
GSWComponent* _component=nil; GSWComponent* component=nil;
GSWComponent* _componentPrev=nil; GSWComponent* componentPrev=nil;
#ifndef NDEBBUG #ifndef NDEBBUG
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); GSWStartElement(context);
GSWSaveAppendToResponseElementID(context_);//Debug Only GSWSaveAppendToResponseElementID(context);
_componentPrev=[context_ component]; [response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",
[self pushRefComponentInContext:context_]; [self definitionName],
if ([context_ component]) [context elementID]]];
{ componentPrev=[context component];
_component=[context_ component]; [self pushRefComponentInContext:context];
[_component appendToResponse:response_ if ([context component])
inContext:context_]; {
[self popRefComponentInContext:context_]; component=[context component];
} [component appendToResponse:response
inContext:context];
[self popRefComponentInContext:context];
}
else else
[context_ _setCurrentComponent:_componentPrev]; [context _setCurrentComponent:componentPrev];
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb], NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWComponentReference appendToResponse: bad elementID"); @"GSWComponentReference appendToResponse: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)request
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
GSWElement* _element=nil; GSWElement* element=nil;
GSWComponent* _component=nil; GSWComponent* component=nil;
GSWComponent* _componentPrev=nil; GSWComponent* componentPrev=nil;
#ifndef NDEBBUG #ifndef NDEBBUG
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); GSWStartElement(context);
_componentPrev=[context_ component]; GSWAssertCorrectElementID(context);
GSWAssertCorrectElementID(context_);// Debug Only NSDebugMLLog(@"gswdync",@"senderId=%@",[context senderID]);
[self pushRefComponentInContext:context_]; componentPrev=[context component];
if ([context_ component]) [self pushRefComponentInContext:context];
{ if ([context component])
if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component {
{ if ([self prefixMatchSenderIDInContext:context]) //Avoid trying to find action if we are not the good component
_component=[context_ component]; {
_element=[_component invokeActionForRequest:request_ component=[context component];
inContext:context_]; element=[component invokeActionForRequest:request
}; inContext:context];
[self popRefComponentInContext:context_]; };
} [self popRefComponentInContext:context];
}
else else
[context_ _setCurrentComponent:_componentPrev]; [context _setCurrentComponent:componentPrev];
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference invokeActionForRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWComponentReference invokeActionForRequest: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
return _element; return element;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)request
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
//OK //OK
GSWComponent* _component=nil; GSWComponent* component=nil;
GSWComponent* _componentPrev=nil; GSWComponent* componentPrev=nil;
#ifndef NDEBBUG #ifndef NDEBBUG
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); GSWStartElement(context);
GSWAssertCorrectElementID(context_);// Debug Only GSWAssertCorrectElementID(context);
_componentPrev=[context_ component]; componentPrev=[context component];
[self pushRefComponentInContext:context_]; [self pushRefComponentInContext:context];
if ([context_ component]) if ([context component])
{ {
_component=[context_ component]; component=[context component];
[_component takeValuesFromRequest:request_ [component takeValuesFromRequest:request
inContext:context_]; inContext:context];
[self popRefComponentInContext:context_]; [self popRefComponentInContext:context];
} }
else else
[context_ _setCurrentComponent:_componentPrev]; [context _setCurrentComponent:componentPrev];
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference takeValuesFromRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWComponentReference takeValuesFromRequest: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
}; };

View file

@ -1,11 +1,18 @@
/* GSWConditional.h - GSWeb: Class GSWConditional /** GSWConditional.h - <title>GSWeb: Class GSWConditional</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
This file is part of the GNUstep Web Library. $Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -30,17 +38,17 @@
//==================================================================== //====================================================================
@interface GSWConditional: GSWDynamicElement @interface GSWConditional: GSWDynamicElement
{ {
GSWAssociation* condition; GSWAssociation* _condition;
GSWAssociation* negate; GSWAssociation* _negate;
GSWHTMLStaticGroup* childrenGroup; GSWHTMLStaticGroup* _childrenGroup;
}; };
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)elements_; contentElements:(NSArray*)elements;
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
template:(GSWElement*)templateElement_; template:(GSWElement*)templateElement;
-(NSString*)description; -(NSString*)description;
-(void)dealloc; -(void)dealloc;
@ -48,14 +56,14 @@
//==================================================================== //====================================================================
@interface GSWConditional (GSWConditionalA) @interface GSWConditional (GSWConditionalA)
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
@end @end

View file

@ -1,11 +1,18 @@
/* GSWConditional.m - GSWeb: Class GSWConditional /** GSWConditional.m - <title>GSWeb: Class GSWConditional</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
This file is part of the GNUstep Web Library. $Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
static char rcsId[] = "$Id$"; static char rcsId[] = "$Id$";
@ -29,38 +37,41 @@ static char rcsId[] = "$Id$";
@implementation GSWConditional @implementation GSWConditional
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)someAssociations associations:(NSDictionary*)someAssociations
template:(GSWElement*)templateElement_ template:(GSWElement*)templateElement
{ {
//OK //OK
LOGObjectFnStart(); LOGObjectFnStart();
self=[self initWithName:name_ if ((self=[self initWithName:aName
associations:someAssociations associations:someAssociations
contentElements:templateElement_ ? [NSArray arrayWithObject:templateElement_] : nil]; contentElements:templateElement ? [NSArray arrayWithObject:templateElement] : nil]))
{
};
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)_elements contentElements:(NSArray*)elements
{ {
LOGObjectFnStart(); LOGObjectFnStart();
if ((self=[super initWithName:name_ if ((self=[super initWithName:aName
associations:nil associations:nil
template:nil])) template:nil]))
{ {
if (_elements) if (elements)
childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:_elements]; _childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
condition = [[associations_ objectForKey:condition__Key
withDefaultObject:[condition autorelease]] retain]; _condition = [[associations objectForKey:condition__Key
NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",condition); withDefaultObject:[_condition autorelease]] retain];
negate = [[associations_ objectForKey:negate__Key NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",_condition);
withDefaultObject:[negate autorelease]] retain]; _negate = [[associations objectForKey:negate__Key
NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",negate); withDefaultObject:[_negate autorelease]] retain];
}; NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",_negate);
};
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
@ -68,11 +79,20 @@ static char rcsId[] = "$Id$";
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)dealloc -(void)dealloc
{ {
DESTROY(condition); DESTROY(_condition);
DESTROY(negate); DESTROY(_negate);
DESTROY(_childrenGroup);
[super dealloc]; [super dealloc];
} }
//--------------------------------------------------------------------
-(void)setDefinitionName:(NSString*)definitionName
{
[super setDefinitionName:definitionName];
if (definitionName && _childrenGroup)
[_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]];
};
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(NSString*)description -(NSString*)description
{ {
@ -85,123 +105,126 @@ static char rcsId[] = "$Id$";
@implementation GSWConditional (GSWConditionalA) @implementation GSWConditional (GSWConditionalA)
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_ inContext:(GSWContext*)aContext
{ {
//OK //OK
BOOL _condition=NO; BOOL condition=NO;
BOOL _negate=NO; BOOL negate=NO;
BOOL _doIt=NO; BOOL doIt=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); GSWStartElement(aContext);
GSWAssertCorrectElementID(context_);// Debug Only GSWAssertCorrectElementID(aContext);
_condition=[self evaluateCondition:condition condition=[self evaluateCondition:_condition
inContext:context_]; inContext:aContext];
_negate=[self evaluateCondition:negate negate=[self evaluateCondition:_negate
inContext:context_]; inContext:aContext];
_doIt=_condition; doIt=condition;
NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ elementID]); NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
if (_negate) if (negate)
_doIt=!_doIt; doIt=!doIt;
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s", NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s",
[self definitionName], [self definitionName],
condition, _condition,
negate, _negate,
(_condition ? "YES" : "NO"), (condition ? "YES" : "NO"),
(_negate ? "YES" : "NO"), (negate ? "YES" : "NO"),
(_doIt ? "YES" : "NO")); (doIt ? "YES" : "NO"));
if (_doIt) 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)
{ {
GSWRequest* _request=[context_ request]; GSWRequest* _request=[aContext request];
BOOL _isFromClientComponent=[_request isFromClientComponent]; BOOL isFromClientComponent=[_request isFromClientComponent];
[context_ appendZeroElementIDComponent]; [aContext appendZeroElementIDComponent];
NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup); [_childrenGroup takeValuesFromRequest:aRequest
_element=[childrenGroup invokeActionForRequest:request_ inContext:aContext];
inContext:context_]; [aContext deleteLastElementIDComponent];
NSDebugMLLog(@"gswdync",@"_element=%@",_element);
[context_ deleteLastElementIDComponent];
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); GSWStopElement(aContext);
GSWAssertIsElementID(aContext);
LOGObjectFnStop(); LOGObjectFnStop();
return _element;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)appendToResponse:(GSWResponse*)response_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_ inContext:(GSWContext*)aContext
{ {
//OK //OK
BOOL _condition=NO; GSWElement* element=nil;
BOOL _negate=NO; BOOL condition=NO;
BOOL _doIt=NO; BOOL negate=NO;
BOOL doIt=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); GSWStartElement(aContext);
GSWSaveAppendToResponseElementID(context_);//Debug Only GSWAssertCorrectElementID(aContext);
_condition=[self evaluateCondition:condition condition=[self evaluateCondition:_condition
inContext:context_]; inContext:aContext];
NSDebugMLLog(@"gswdync",@"_condition=%s",_condition ? "YES" : "NO"); negate=[self evaluateCondition:_negate
_negate=[self evaluateCondition:negate inContext:aContext];
inContext:context_]; doIt=condition;
NSDebugMLLog(@"gswdync",@"_negate=%s",_negate ? "YES" : "NO"); if (negate)
_doIt=_condition; doIt=!doIt;
if (_negate) NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s",
_doIt=!_doIt;
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s",
[self definitionName], [self definitionName],
condition, _condition,
negate, _negate,
(_condition ? "YES" : "NO"), (condition ? "YES" : "NO"),
(_negate ? "YES" : "NO"), (negate ? "YES" : "NO"),
(_doIt ? "YES" : "NO")); (doIt ? "YES" : "NO"));
if (_doIt) if (doIt)
{ {
GSWRequest* _request=[context_ request]; GSWRequest* request=[aContext request];
BOOL _isFromClientComponent=[_request isFromClientComponent]; BOOL isFromClientComponent=[request isFromClientComponent];
[context_ appendZeroElementIDComponent]; [aContext appendZeroElementIDComponent];
[childrenGroup appendToResponse:response_ NSDebugMLLog(@"gswdync",@"childrenGroup=%@",_childrenGroup);
inContext:context_]; element=[_childrenGroup invokeActionForRequest:aRequest
[context_ deleteLastElementIDComponent]; inContext:aContext];
}; NSDebugMLLog(@"gswdync",@"element=%@",element);
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); [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(); LOGObjectFnStop();
}; };

View file

@ -54,6 +54,11 @@
BOOL formSubmitted; BOOL formSubmitted;
BOOL isMultipleSubmitForm; BOOL isMultipleSubmitForm;
BOOL isValidate; 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; -(id)init;
@ -75,6 +80,14 @@
-(NSString*)contextID; -(NSString*)contextID;
-(id)initWithRequest:(GSWRequest*)_request; -(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 @end
//==================================================================== //====================================================================

View file

@ -75,6 +75,10 @@ static int dontTraceComponentActionURL=0;
DESTROY(url); DESTROY(url);
NSDebugFLog0(@"Release GSWContext awakePageComponents"); NSDebugFLog0(@"Release GSWContext awakePageComponents");
DESTROY(awakePageComponents); DESTROY(awakePageComponents);
#ifndef NDEBUG
DESTROY(_docStructure);
DESTROY(_docStructureElements);
#endif
NSDebugFLog0(@"Dealloc GSWContext super"); NSDebugFLog0(@"Dealloc GSWContext super");
[super dealloc]; [super dealloc];
NSDebugFLog0(@"end Dealloc GSWContext"); NSDebugFLog0(@"end Dealloc GSWContext");
@ -254,6 +258,68 @@ static int dontTraceComponentActionURL=0;
return senderID; 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 @end
//==================================================================== //====================================================================

View file

@ -150,6 +150,7 @@
- (void)editingContext:(id)editingContext_ - (void)editingContext:(id)editingContext_
presentErrorMessage:(id)msg; presentErrorMessage:(id)msg;
- (id)insert; - (id)insert;
- (id)insertAfterLastObject;
- (NSDictionary *)insertedObjectDefaultValues; - (NSDictionary *)insertedObjectDefaultValues;
- (void)insertObject:object_ - (void)insertObject:object_
atIndex:(unsigned)index; atIndex:(unsigned)index;
@ -175,6 +176,7 @@
- (void)setSelectedObject:(id)object; - (void)setSelectedObject:(id)object;
- (NSArray *)selectedObjects; - (NSArray *)selectedObjects;
- (NSArray *)selectionIndexes; - (NSArray *)selectionIndexes;
- (id)selectFirst;
- (id)selectNext; - (id)selectNext;
- (BOOL)selectObject:(id)object; - (BOOL)selectObject:(id)object;
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects; - (BOOL)selectObjectsIdenticalTo:(NSArray *)objects;

View file

@ -660,7 +660,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart(); LOGObjectFnStart();
[self deleteSelection]; [self deleteSelection];
LOGObjectFnStop(); LOGObjectFnStop();
return nil;//FIXME return nil;//return nil for direct .gswd actions ==> same page
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -732,33 +732,33 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
} }
if (result) if (result)
{ {
NS_DURING NS_DURING
{ {
enumerator = [_selectedObjects objectEnumerator]; enumerator = [_selectedObjects objectEnumerator];
while((object = [enumerator nextObject])) while((object = [enumerator nextObject]))
{ {
[_dataSource deleteObject:object]; [_dataSource deleteObject:object];
[_displayedObjects removeObjectIdenticalTo:object]; [_displayedObjects removeObjectIdenticalTo:object];
[_allObjects removeObjectIdenticalTo:object]; [_allObjects removeObjectIdenticalTo:object];
if(_delegateRespondsTo.didDeleteObject == YES) if(_delegateRespondsTo.didDeleteObject == YES)
[delegate displayGroup:self [delegate displayGroup:self
didDeleteObject:object]; didDeleteObject:object];
} }
} }
NS_HANDLER NS_HANDLER
{ {
NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object"); NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object");
NSLog(@"object : %@", object); NSLog(@"object : %@", object);
NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n", NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n",
localException, localException,
[localException description], [localException description],
[localException name], [localException name],
[localException reason]); [localException reason]);
delete = NO; delete = NO;
} }
NS_ENDHANDLER; NS_ENDHANDLER;
}; };
[self clearSelection]; [self clearSelection];
@ -841,7 +841,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[self clearSelection]; [self clearSelection];
LOGObjectFnStop(); LOGObjectFnStop();
return nil;//FIXME return nil;//return nil for direct .gswd actions ==> same page
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -884,7 +884,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[self clearSelection]; [self clearSelection];
LOGObjectFnStop(); LOGObjectFnStop();
return nil;//FIXME return nil;//return nil for direct .gswd actions ==> same page
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -903,7 +903,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart(); LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop(); LOGObjectFnStop();
return nil; return nil;//return nil for direct .gswd actions ==> same page
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -919,9 +919,9 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[[NSNotificationCenter defaultCenter] [[NSNotificationCenter defaultCenter]
postNotificationName:@"WODisplayGroupWillFetch" //TODO Name postNotificationName:@"WODisplayGroupWillFetch" //TODO Name
object:self]; object:self];
undoManager=[self undoManager];//<EOUndoManager: 0x1832190> //WO45P3 undoManager=[self undoManager];
[undoManager removeAllActionsWithTarget:self];//WO45P3 [undoManager removeAllActionsWithTarget:self];
[_dataSource setQualifierBindings:_queryBindings];//WO45P3 [_dataSource setQualifierBindings:_queryBindings];
if(_delegateRespondsTo.shouldFetchObjects == YES) if(_delegateRespondsTo.shouldFetchObjects == YES)
fetch = [delegate displayGroupShouldFetch:self]; fetch = [delegate displayGroupShouldFetch:self];
@ -930,7 +930,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
{ {
NSArray *objects=nil; NSArray *objects=nil;
objects = [_dataSource fetchObjects];//OK WO45P3 objects = [_dataSource fetchObjects];
[self setObjectArray:objects];//OK [self setObjectArray:objects];//OK
[self _notify:@selector(displayGroup:didFetchObjects:) [self _notify:@selector(displayGroup:didFetchObjects:)
with:self with:self
@ -941,7 +941,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
*/ */
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return nil;//FIXME ?? return nil;//return nil for direct .gswd actions ==> same page
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1040,15 +1040,22 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
if([_selection count]) if([_selection count])
index = [[_selection objectAtIndex:0] unsignedIntValue]+1; index = [[_selection objectAtIndex:0] unsignedIntValue]+1;
if(!count) index=max(0,index);
index = 0; index=min(count,index);
if((count <= index) && count>0)
index = count - 1;
NSDebugMLog(@"INSERT Index=%d",index);
[self insertObjectAtIndex:index]; [self insertObjectAtIndex:index];
LOGObjectFnStop(); 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: <EOKeyValueUnarchiver: 0x1a84d20>
[delegate displayGroup:self [delegate displayGroup:self
didInsertObject:anObject]; didInsertObject:anObject];
[self setSelectionIndexes: [self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
}; };
} }
@ -1266,7 +1272,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
NSDebugMLLog(@"gswdisplaygroup",@"_dataSource=%@",_dataSource); NSDebugMLLog(@"gswdisplaygroup",@"_dataSource=%@",_dataSource);
[_dataSource setAuxiliaryQualifier:qualifier];//OK [_dataSource setAuxiliaryQualifier:qualifier];//OK
NSDebugMLLog0(@"gswdisplaygroup",@"Will fetch"); NSDebugMLLog0(@"gswdisplaygroup",@"Will fetch");
[self fetch];//OK use ret Value ? [self fetch];//OK use ret Value ?
NSDebugMLLog0(@"gswdisplaygroup",@"End fetch"); NSDebugMLLog0(@"gswdisplaygroup",@"End fetch");
@ -1400,6 +1406,20 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
return _selection; 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 // selectNext
@ -1412,8 +1432,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
if([_allObjects count]>0) if([_allObjects count]>0)
{ {
if(![_selectedObjects count]) if(![_selectedObjects count])
[self setSelectionIndexes: [self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]];
[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]];
else else
{ {
obj = [_selectedObjects objectAtIndex:0]; obj = [_selectedObjects objectAtIndex:0];
@ -1441,7 +1460,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
}; };
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return nil;//FIXME return nil;//return nil for direct .gswd actions ==> same page
} }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -1911,7 +1930,7 @@ STOP ?
BOOL stop = NO; BOOL stop = NO;
BOOL retValue=NO; BOOL retValue=NO;
LOGObjectFnStart(); LOGObjectFnStart();
//call selectedObjects //0x1a38b78 //call selectedObjects //
if(_delegateRespondsTo.shouldChangeSelection == YES if(_delegateRespondsTo.shouldChangeSelection == YES
&& [delegate displayGroup:self && [delegate displayGroup:self
shouldChangeSelectionToIndexes:selection_] == NO) shouldChangeSelectionToIndexes:selection_] == NO)
@ -2006,9 +2025,10 @@ STOP ?
NSEnumerator *objsEnum=nil; NSEnumerator *objsEnum=nil;
id object=nil; id object=nil;
LOGObjectFnStart(); LOGObjectFnStart();
//TODO //TODO
//self selectedObjects //() 0x1a38b78 //self selectedObjects //()
//self allObjects 0x27cadf8 //self allObjects
//self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0 //self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0
//self redisplay //self redisplay
//STOP //STOP
@ -2016,30 +2036,29 @@ STOP ?
if(_delegateRespondsTo.displayArrayForObjects == YES) if(_delegateRespondsTo.displayArrayForObjects == YES)
{ {
[_displayedObjects [_displayedObjects addObjectsFromArray:[delegate displayGroup:self
addObjectsFromArray:[delegate displayGroup:self displayArrayForObjects:_allObjects]];
displayArrayForObjects:_allObjects]];
return;
}
if(_qualifier)
{
objsEnum = [_allObjects objectEnumerator];
while((object = [objsEnum nextObject]))
{
if([_qualifier evaluateWithObject:object] == YES)
[_displayedObjects addObject:object];
}
} }
else else
{ {
_batchIndex = [self batchCount]; if(_qualifier)
[self displayNextBatch]; {
} objsEnum = [_allObjects objectEnumerator];
while((object = [objsEnum nextObject]))
if(_sortOrdering) {
[_displayedObjects sortUsingKeyOrderArray:_sortOrdering]; if([_qualifier evaluateWithObject:object] == YES)
[_displayedObjects addObject:object];
}
}
else
{
_batchIndex = [self batchCount];
[self displayNextBatch];
}
if(_sortOrdering)
[_displayedObjects sortUsingKeyOrderArray:_sortOrdering];
};
LOGObjectFnStop(); LOGObjectFnStop();
} }

View file

@ -36,7 +36,6 @@
//==================================================================== //====================================================================
@interface GSWDynamicElement : GSWElement @interface GSWDynamicElement : GSWElement
{ {
NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose
}; };
-(id)initWithName:(NSString*)name -(id)initWithName:(NSString*)name

View file

@ -55,26 +55,11 @@ static char rcsId[] = "$Id$";
GSWLogAssertGood(self); GSWLogAssertGood(self);
GSWLogC("Dealloc GSWDynamicElement"); GSWLogC("Dealloc GSWDynamicElement");
GSWLogC("Dealloc GSWDynamicElement: name"); GSWLogC("Dealloc GSWDynamicElement: name");
DESTROY(_definitionName);
GSWLogC("Dealloc GSWDynamicElement Super"); GSWLogC("Dealloc GSWDynamicElement Super");
[super dealloc]; [super dealloc];
GSWLogC("End Dealloc GSWDynamicElement"); 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 @end
//==================================================================== //====================================================================
@implementation GSWDynamicElement (GSWDynamicElement) @implementation GSWDynamicElement (GSWDynamicElement)

View file

@ -43,28 +43,53 @@ extern BYTE ElementsMap_attributeElement;
#ifndef NDEBBUG #ifndef NDEBBUG
{ {
NSString* _appendToResponseElementID; NSString* _appendToResponseElementID;
NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose
}; };
#endif #endif
#ifndef NDEBBUG #ifndef NDEBBUG
-(void)saveAppendToResponseElementIDInContext:(id)context; -(void)saveAppendToResponseElementIDInContext:(id)context;
-(void)assertCorrectElementIDInContext:(id)context -(void)assertCorrectElementIDInContext:(id)context
inCLass:(Class)class
method:(SEL)method method:(SEL)method
file:(const char*)file file:(const char*)file
line:(int)line; 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 #endif
-(NSString*)definitionName; //return nil (for non dynamic element) -(NSString*)definitionName;
@end @end
#ifdef NDEBBUG #ifdef NDEBBUG
#define GSWSaveAppendToResponseElementID(context_); {}; #define GSWSaveAppendToResponseElementID(TheContext); {};
#define GSWAssertCorrectElementID(context_); {}; #define GSWAssertCorrectElementID(TheContext); {};
#define GSWAssertIsElementID(TheContext); {};
#define GSWStartElement(TheContext); {};
#define GSWStopElement(TheContext); {};
#define GSWAddElementToDocStructure(TheContext); {};
#else #else
#define GSWSaveAppendToResponseElementID(context_); [self saveAppendToResponseElementIDInContext:context_]; #define GSWSaveAppendToResponseElementID(TheContext); [self saveAppendToResponseElementIDInContext:TheContext];
#define GSWAssertCorrectElementID(context_); \ #define GSWAssertCorrectElementID(TheContext); \
([self assertCorrectElementIDInContext:context_ inCLass:[self class] method:_cmd file:__FILE__ line:__LINE__]); ([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 #endif

View file

@ -42,46 +42,148 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
#ifndef NDEBBUG #ifndef NDEBBUG
-(void)saveAppendToResponseElementIDInContext:(id)context -(void)saveAppendToResponseElementIDInContext:(id)context
{ {
NSString* elementID=[context elementID]; NSString* elementID=nil;
ASSIGN(_appendToResponseElementID,elementID); 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 -(void)assertCorrectElementIDInContext:(id)context
inCLass:(Class)class
method:(SEL)method method:(SEL)method
file:(const char*)file file:(const char*)file
line:(int)line 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) if ([_appendToResponseElementID length]>0)
{ {
NSString* elementID=[context elementID]; NSString* elementID=[context elementID];
BOOL appendToResponseElementIDIsFirst=NO; BOOL appendToResponseElementIDIsFirst=NO;
BOOL elementIDIsFirst=NO; BOOL elementIDIsFirst=NO;
BOOL OK=YES; BOOL OK=YES;
/* if ([elementID length]==0)
elementID=@"MARKER";*/
appendToResponseElementIDIsFirst=([_appendToResponseElementID length]==0 || [_appendToResponseElementID isEqualToString:@"0"]); appendToResponseElementIDIsFirst=([_appendToResponseElementID length]==0 || [_appendToResponseElementID isEqualToString:@"0"]);
elementIDIsFirst=([elementID length]==0 || [elementID isEqualToString:@"0"]); elementIDIsFirst=([elementID length]==0 || [elementID isEqualToString:@"0"]);
if (appendToResponseElementIDIsFirst!=elementIDIsFirst) if (!appendToResponseElementIDIsFirst || appendToResponseElementIDIsFirst!=elementIDIsFirst)
{ {
OK=[_appendToResponseElementID isEqualToString:elementID]; 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 %@", NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), id '%@' (%p) in %@ is not the same than in appendToResponse '%@' (%p)",
NSStringFromClass(class), self,
[self class],
[self definitionName],
file, file,
line, line,
[context elementID], [context elementID],
[context elementID],
NSStringFromSelector(method), NSStringFromSelector(method),
_appendToResponseElementID,
_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 #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 -(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 @end
@ -94,8 +196,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
-(void)takeValuesFromRequest:(GSWRequest*)request -(void)takeValuesFromRequest:(GSWRequest*)request
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
GSWStartElement(context);
GSWAddElementToDocStructure(context);
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);// Debug Only
//Does Nothing //Does Nothing
GSWStopElement(context);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -104,10 +209,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request -(GSWElement*)invokeActionForRequest:(GSWRequest*)request
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", GSWStartElement(context);
[self class],[context elementID],[context senderID]); GSWAddElementToDocStructure(context);
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);// Debug Only
//Does Nothing //Does Nothing
GSWStopElement(context);
return nil; return nil;
}; };
@ -118,6 +224,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
GSWSaveAppendToResponseElementID(context);//Debug Only GSWSaveAppendToResponseElementID(context);//Debug Only
GSWAddElementToDocStructure(context);
//Does Nothing //Does Nothing
}; };
@ -125,13 +232,14 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
//NDFN //NDFN
-(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context -(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context
{ {
BOOL match=NO;
NSString* senderID=[context senderID]; NSString* senderID=[context senderID];
NSString* elementID=[context elementID]; NSString* elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); NSDebugMLLog(@"gswdync",@" senderID=%@",senderID);
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID); 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 @end

View file

@ -223,11 +223,12 @@ static char rcsId[] = "$Id$";
else else
finished=YES; finished=YES;
}; };
if (!over && !finished) /* if (!over && !finished)
{ {
if (selfElementsCount>senderIDElementsCount) if (selfElementsCount>senderIDElementsCount)
over=YES; over=YES;
}; };
*/
}; };
return over; return over;
} }

View file

@ -98,7 +98,8 @@ static char rcsId[] = "$Id$";
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request -(GSWElement*)invokeActionForRequest:(GSWRequest*)request
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
GSWAssertCorrectElementID(context);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
//Bypass GSWInput //Bypass GSWInput
return nil; return nil;
}; };
@ -110,7 +111,8 @@ static char rcsId[] = "$Id$";
//OK //OK
BOOL disabledValue=NO; BOOL disabledValue=NO;
LOGObjectFnStartC("GSWFileUpload"); LOGObjectFnStartC("GSWFileUpload");
GSWAssertCorrectElementID(context);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
disabledValue=[self disabledInContext:context]; disabledValue=[self disabledInContext:context];
if (!disabledValue) if (!disabledValue)
{ {

View file

@ -211,9 +211,11 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStartC("GSWForm"); LOGObjectFnStartC("GSWForm");
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);
GSWSaveAppendToResponseElementID(context);//Debug Only [response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",
[self definitionName],
[context elementID]]];
if (!WOStrictFlag) if (!WOStrictFlag)
{ {
@ -227,18 +229,19 @@ static char rcsId[] = "$Id$";
[self appendToResponse:response [self appendToResponse:response
inContext:context inContext:context
elementsFromIndex:0 elementsFromIndex:0
toIndex:[elementsMap length]-2]; toIndex:[_elementsMap length]-2];
[self _appendHiddenFieldsToResponse:response [self _appendHiddenFieldsToResponse:response
inContext:context]; inContext:context];
[self appendToResponse:response [self appendToResponse:response
inContext:context inContext:context
elementsFromIndex:[elementsMap length]-1 elementsFromIndex:[_elementsMap length]-1
toIndex:[elementsMap length]-1]; toIndex:[_elementsMap length]-1];
[context setInForm:NO]; [context setInForm:NO];
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], NSAssert3(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWForm appendToResponse: bad elementID"); @"GSWForm appendToResponse: bad elementID: elementsNb=%d [context elementID]=%@ [(GSWElementIDString*)[context elementID]elementsNb]=%d",
elementsNb,[context elementID],[(GSWElementIDString*)[context elementID]elementsNb]);
#endif #endif
LOGObjectFnStopC("GSWForm"); LOGObjectFnStopC("GSWForm");
}; };
@ -258,10 +261,10 @@ static char rcsId[] = "$Id$";
BOOL multipleSubmitValue=NO; BOOL multipleSubmitValue=NO;
int i=0; int i=0;
LOGObjectFnStartC("GSWForm"); LOGObjectFnStartC("GSWForm");
GSWStartElement(context);
senderID=[context senderID]; senderID=[context senderID];
elementID=[context elementID]; elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", NSDebugMLLog(@"gswdync",@"senderId=%@",senderID);
[self class],[self definitionName],elementID,senderID);
NS_DURING NS_DURING
{ {
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);// Debug Only
@ -269,9 +272,10 @@ static char rcsId[] = "$Id$";
{ {
BOOL searchIsOver=NO; BOOL searchIsOver=NO;
isFormSubmited=[elementID isEqualToString:senderID]; isFormSubmited=[elementID isEqualToString:senderID];
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s", NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nisFormSubmited=%s",
[self class], [self class],
elementID, [self definitionName],
elementID,
senderID, senderID,
(isFormSubmited ? "YES" : "NO")); (isFormSubmited ? "YES" : "NO"));
if (!WOStrictFlag && isFormSubmited && [self disabledInContext:context]) if (!WOStrictFlag && isFormSubmited && [self disabledInContext:context])
@ -283,21 +287,20 @@ static char rcsId[] = "$Id$";
[context _setFormSubmitted:YES]; [context _setFormSubmitted:YES];
multipleSubmitValue=[self evaluateCondition:_multipleSubmit multipleSubmitValue=[self evaluateCondition:_multipleSubmit
inContext:context]; inContext:context];
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ multipleSubmit=%s", NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nmultipleSubmit=%s",
[self class], [self class],
elementID, [self definitionName],
elementID,
senderID, senderID,
(multipleSubmitValue ? "YES" : "NO")); (multipleSubmitValue ? "YES" : "NO"));
[context _setIsMultipleSubmitForm:multipleSubmitValue]; [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=%@", NSDebugMLLog(@"gswdync",@"i=%d",i);
[[dynamicChildren objectAtIndex:i] class], element=[[_dynamicChildren objectAtIndex:i] invokeActionForRequest:request
[context elementID]); inContext:context];
element=[[dynamicChildren objectAtIndex:i] invokeActionForRequest:request
inContext:context];
// if (![context _wasFormSubmitted] && [[context elementID] compare:senderID]==NSOrderedDescending) // if (![context _wasFormSubmitted] && [[context elementID] compare:senderID]==NSOrderedDescending)
if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID]) if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
{ {
@ -308,7 +311,9 @@ static char rcsId[] = "$Id$";
}; };
[context incrementLastElementIDComponent]; [context incrementLastElementIDComponent];
}; };
[context deleteLastElementIDComponent]; */
element=[super invokeActionForRequest:request
inContext:context];
if (isFormSubmited) if (isFormSubmited)
{ {
if ([context _wasActionInvoked]) if ([context _wasActionInvoked])
@ -321,15 +326,13 @@ static char rcsId[] = "$Id$";
[context _setFormSubmitted:NO]; [context _setFormSubmitted:NO];
}; };
elementID=[context elementID]; elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"END ET=%@ def name=%@ id=%@", GSWStopElement(context);
[self class],
[self definitionName],
elementID);
#ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)elementID elementsNb],
@"GSWForm invokeActionForRequest: bad elementID");
#endif
}; };
#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 NS_HANDLER
{ {
@ -369,12 +372,12 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStartC("GSWForm"); LOGObjectFnStartC("GSWForm");
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);
senderID=[context senderID]; senderID=[context senderID];
elementID=[context elementID]; elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
if ([self prefixMatchSenderIDInContext:context]) //Avoid taking values if we are not the good form if ([self prefixMatchSenderIDInContext:context]) //Avoid taking values if we are not the good form
{ {
isFormSubmited=[elementID isEqualToString:senderID]; isFormSubmited=[elementID isEqualToString:senderID];
@ -388,25 +391,19 @@ static char rcsId[] = "$Id$";
[context setInForm:YES]; [context setInForm:YES];
[context _setFormSubmitted:YES]; [context _setFormSubmitted:YES];
}; };
[context appendZeroElementIDComponent]; NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",_dynamicChildren);
NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",dynamicChildren); NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[_dynamicChildren count]);
NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[dynamicChildren count]);
for(i=0;i<[dynamicChildren count];i++) [super takeValuesFromRequest:request
{ inContext:context];
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];
if (isFormSubmited) if (isFormSubmited)
{ {
[context setInForm:NO]; [context setInForm:NO];
[context _setFormSubmitted:NO]; [context _setFormSubmitted:NO];
}; };
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb], NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWForm takeValuesFromRequest: bad elementID"); @"GSWForm takeValuesFromRequest: bad elementID");

View file

@ -1,11 +1,18 @@
/* GSWHTMLDynamicElement.h - GSWeb: Class GSWHTMLDynamicElement /** GSWHTMLDynamicElement.h - <title>GSWeb: Class GSWHTMLDynamicElement</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999 Date: Feb 1999
This file is part of the GNUstep Web Library. $Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -30,10 +38,10 @@
//==================================================================== //====================================================================
@interface GSWHTMLDynamicElement: GSWDynamicElement @interface GSWHTMLDynamicElement: GSWDynamicElement
{ {
NSData* elementsMap; NSData* _elementsMap;
NSArray* htmlBareStrings; NSArray* _htmlBareStrings;
NSArray* dynamicChildren; NSArray* _dynamicChildren;
NSArray* attributeAssociations; NSArray* _attributeAssociations;
}; };
-(NSString*)elementName; -(NSString*)elementName;
-(NSArray*)dynamicChildren; -(NSArray*)dynamicChildren;
@ -41,64 +49,64 @@
-(NSData*)elementsMap; -(NSData*)elementsMap;
-(NSArray*)attributeAssociations; -(NSArray*)attributeAssociations;
-(id)_initWithElementsMap:(NSData*)_elementsMap -(id)_initWithElementsMap:(NSData*)elementsMap
htmlBareStrings:(NSArray*)_htmlBareStrings htmlBareStrings:(NSArray*)htmlBareStrings
dynamicChildren:(NSArray*)_dynamicChildren dynamicChildren:(NSArray*)dynamicChildren
attributeAssociations:(NSArray*)_attributeAssociations; attributeAssociations:(NSArray*)attributeAssociations;
-(id) initWithName:(NSString*)elementName_ -(id)initWithName:(NSString*)elementName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)elements_; contentElements:(NSArray*)elements;
-(id) initWithName:(NSString*)elementName_ -(id)initWithName:(NSString*)elementName
attributeAssociations:(NSDictionary*)attributeAssociations_ attributeAssociations:(NSDictionary*)attributeAssociations
contentElements:(NSArray*)elements_; contentElements:(NSArray*)elements;
-(id) initWithName:(NSString*)elementName_ -(id)initWithName:(NSString*)elementName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
template:(GSWElement*)templateElement_; template:(GSWElement*)templateElement;
-(void)dealloc; -(void)dealloc;
-(void)_setEndOfHTMLTag:(unsigned int)_unknown; -(void)_setEndOfHTMLTag:(unsigned int)unknown;
-(NSString*)description; -(NSString*)description;
-(void)setHtmlBareStrings:(NSArray*)_htmlBareStrings; -(void)setHtmlBareStrings:(NSArray*)htmlBareStrings;
@end @end
//==================================================================== //====================================================================
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementA) @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementA)
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_ -(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(unsigned int)GSWebObjectsAssociationsCount; -(unsigned int)GSWebObjectsAssociationsCount;
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_ inContext:(GSWContext*)aContext
elementsFromIndex:(unsigned int)_fromIndex elementsFromIndex:(unsigned int)fromIndex
toIndex:(unsigned int)_toIndex; toIndex:(unsigned int)toIndex;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
@end @end
//==================================================================== //====================================================================
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementB) @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementB)
-(BOOL)compactHTMLTags; -(BOOL)compactHTMLTags;
-(BOOL)appendStringAtRight:(id)_unkwnon -(BOOL)appendStringAtRight:(id)unkwnon
withMapping:(char*)_mapping; withMapping:(char*)mapping;
-(BOOL)appendStringAtLeft:(id)_unkwnon -(BOOL)appendStringAtLeft:(id)unkwnon
withMapping:(char*)_mapping; withMapping:(char*)mapping;
-(BOOL)canBeFlattenedAtInitialization; -(BOOL)canBeFlattenedAtInitialization;
@end @end
//==================================================================== //====================================================================
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementC) @interface GSWHTMLDynamicElement (GSWHTMLDynamicElementC)
+(void)setDynamicElementCompaction:(BOOL)_flag; +(void)setDynamicElementCompaction:(BOOL)flag;
+(BOOL)escapeHTML; +(BOOL)escapeHTML;
+(BOOL)hasGSWebObjectsAssociations; +(BOOL)hasGSWebObjectsAssociations;
@end @end

File diff suppressed because it is too large Load diff

View file

@ -276,13 +276,9 @@ static char rcsId[] = "$Id$";
-(NSString*)description -(NSString*)description
{ {
return [NSString stringWithFormat:@"<%@ %p elementsMap:%@>", return [NSString stringWithFormat:@"<%@ %p elementsMap:%@>",
/* htmlBareStrings:%@ dynamicChildren:%@ elementName:%@>",*/
[self class], [self class],
(void*)self, (void*)self,
_elementsMap]; _elementsMap];
/* _htmlBareStrings,
_dynamicChildren,
_elementName];*/
}; };
@end @end
@ -294,12 +290,11 @@ static char rcsId[] = "$Id$";
-(void)appendToResponse:(GSWResponse*)response -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
//OK (verifier avec GSWSession appendToR //OK
GSWRequest* request=[context request]; GSWRequest* request=[context request];
BOOL isFromClientComponent=[request isFromClientComponent]; //bis repetitam BOOL isFromClientComponent=[request isFromClientComponent]; //bis repetitam
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ self=%p", GSWStartElement(context);
[self class],[context elementID],self); GSWSaveAppendToResponseElementID(context);
GSWSaveAppendToResponseElementID(context);//Debug Only
if ([_elementsMap length]>0) if ([_elementsMap length]>0)
{ {
[self appendToResponse:response [self appendToResponse:response
@ -307,8 +302,8 @@ static char rcsId[] = "$Id$";
elementsFromIndex:0 elementsFromIndex:0
toIndex:[_elementsMap length]-1]; toIndex:[_elementsMap length]-1];
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@ self=%p", GSWAssertIsElementID(context);
[self class],[context elementID],self); GSWStopElement(context);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -332,11 +327,10 @@ static char rcsId[] = "$Id$";
fromIndex,toIndex); fromIndex,toIndex);
for(elementN=0;elementN<=toIndex;elementN++) for(elementN=0;elementN<=toIndex;elementN++)
{ {
NSDebugMLog(@"appendTo self=%p elementN=%d [context elementID]=%@",self,elementN,[context elementID]);
element=(BYTE)elements[elementN]; element=(BYTE)elements[elementN];
if (element==ElementsMap_htmlBareString) if (element==ElementsMap_htmlBareString)
{ {
NSDebugMLLog(@"gswdync",@"%d:htmlBareString : %@",
elementN,[_htmlBareStrings objectAtIndex:elementsN[0]]);
if (elementN>=fromIndex) if (elementN>=fromIndex)
[response appendContentData:[[_htmlBareStrings objectAtIndex:elementsN[0]] [response appendContentData:[[_htmlBareStrings objectAtIndex:elementsN[0]]
dataUsingEncoding:encoding]]; dataUsingEncoding:encoding]];
@ -346,11 +340,6 @@ static char rcsId[] = "$Id$";
{ {
if (elementN>=fromIndex) 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 [[aDynamicChildrensArray objectAtIndex:elementsN[1]] appendToResponse:response
inContext:context]; inContext:context];
[context incrementLastElementIDComponent]; [context incrementLastElementIDComponent];
@ -360,10 +349,10 @@ static char rcsId[] = "$Id$";
else if (element==ElementsMap_attributeElement) else if (element==ElementsMap_attributeElement)
{ {
//TODO //TODO
NSDebugMLLog(@"gswdync",@"%d:attributeElement",elementN);
elementsN[2]++; elementsN[2]++;
}; };
}; };
GSWStopElement(context);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -372,46 +361,42 @@ static char rcsId[] = "$Id$";
{ {
//OK //OK
GSWElement* element=nil; 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; BOOL searchIsOver=NO;
NSString* senderID=nil; NSString* senderID=nil;
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", GSWStartElement(context);
[self class],[context elementID],[context senderID]);
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);// Debug Only
senderID=[context senderID]; senderID=[context senderID];
for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++) if ([_elementsMap length]>0)
{ {
elementIndic=(BYTE)elements[elementN]; NSArray* aDynamicChildrensArray=[self dynamicChildren];
if (elementIndic==ElementsMap_htmlBareString) const BYTE* elements=[_elementsMap bytes];
elementsN[0]++; BYTE elementIndic=0;
else if (elementIndic==ElementsMap_dynamicElement) int elementsN[3]={0,0,0};
int elementN=0;
for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++)
{ {
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", elementIndic=(BYTE)elements[elementN];
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] class], if (elementIndic==ElementsMap_htmlBareString)
[context elementID]); elementsN[0]++;
element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request else if (elementIndic==ElementsMap_dynamicElement)
inContext:context];
//if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending)
if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
{ {
NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request
[context elementID], inContext:context];
senderID); if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
searchIsOver=YES; {
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; return element;
}; };
@ -420,41 +405,37 @@ static char rcsId[] = "$Id$";
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
//OK //OK
int elementN=0;
NSArray* aDynamicChildrensArray=[self dynamicChildren];
const BYTE* elements=[_elementsMap bytes];
BYTE elementIndic=0;
int elementsN[3]={0,0,0};
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", GSWStartElement(context);
[self class],[context elementID]); GSWAssertCorrectElementID(context);
GSWAssertCorrectElementID(context);// Debug Only if ([_elementsMap length]>0)
for(elementN=0;elementN<[_elementsMap length];elementN++)
{ {
NSDebugMLLog(@"gswdync",@"elementN=%d",elementN); int elementN=0;
elementIndic=(BYTE)elements[elementN]; NSArray* aDynamicChildrensArray=[self dynamicChildren];
NSDebugMLLog(@"gswdync",@"element=%x",(unsigned int)elementIndic); const BYTE* elements=[_elementsMap bytes];
if (elementIndic==ElementsMap_htmlBareString) BYTE elementIndic=0;
elementsN[0]++; int elementsN[3]={0,0,0};
else if (elementIndic==ElementsMap_dynamicElement)
for(elementN=0;elementN<[_elementsMap length];elementN++)
{ {
NSDebugMLLog(@"gswdync",@"\n[aDynamicChildrensArray objectAtIndex:elementsN[1]=%@", elementIndic=(BYTE)elements[elementN];
[aDynamicChildrensArray objectAtIndex:elementsN[1]]); if (elementIndic==ElementsMap_htmlBareString)
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", elementsN[0]++;
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] class], else if (elementIndic==ElementsMap_dynamicElement)
[context elementID]); {
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request [[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request
inContext:context]; inContext:context];
[context incrementLastElementIDComponent]; [context incrementLastElementIDComponent];
elementsN[1]++; elementsN[1]++;
} }
else if (elementIndic==ElementsMap_attributeElement) else if (elementIndic==ElementsMap_attributeElement)
{ {
elementsN[2]++; elementsN[2]++;
};
}; };
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@", GSWAssertIsElementID(context);
[self class],[context elementID]); GSWStopElement(context);
LOGObjectFnStop(); LOGObjectFnStop();
}; };

View file

@ -67,6 +67,8 @@ static char rcsId[] = "$Id$";
-(void)appendToResponse:(GSWResponse*)response -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
LOGObjectFnStart();
GSWStartElement(context);
if (_documentTypeString) if (_documentTypeString)
{ {
NSStringEncoding encoding=[response contentEncoding]; NSStringEncoding encoding=[response contentEncoding];
@ -76,6 +78,8 @@ static char rcsId[] = "$Id$";
[super appendToResponse:response [super appendToResponse:response
inContext:context]; inContext:context];
GSWStopElement(context);
LOGObjectFnStop();
}; };
@end @end

View file

@ -222,8 +222,8 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);//Debug Only GSWSaveAppendToResponseElementID(context);
if (_disabled) if (_disabled)
disabledValue=[self evaluateCondition:_disabled disabledValue=[self evaluateCondition:_disabled
inContext:context]; inContext:context];
@ -553,10 +553,8 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", GSWStartElement(context);
[self class],[self definitionName], GSWAssertCorrectElementID(context);
[context elementID],[context senderID]);
GSWAssertCorrectElementID(context);// Debug Only
senderID=[context senderID]; senderID=[context senderID];
elementID=[context elementID]; elementID=[context elementID];
if ([elementID isEqualToString:senderID]) if ([elementID isEqualToString:senderID])

View file

@ -120,6 +120,7 @@ static char rcsId[] = "$Id$";
GSWComponent* component=nil; GSWComponent* component=nil;
NSString* nameValue=nil; NSString* nameValue=nil;
LOGObjectFnStartC("GSWInput"); LOGObjectFnStartC("GSWInput");
GSWAssertIsElementID(context);
if (_name) if (_name)
{ {
component=[context component]; component=[context component];
@ -130,6 +131,7 @@ static char rcsId[] = "$Id$";
nameValue=[context elementID]; nameValue=[context elementID];
NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]); NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]);
}; };
GSWAssertIsElementID(context);
LOGObjectFnStopC("GSWInput"); LOGObjectFnStopC("GSWInput");
return nameValue; return nameValue;
}; };
@ -193,7 +195,8 @@ static int countAutoValue = 0;
//OK //OK
BOOL disabledInContext=NO; BOOL disabledInContext=NO;
LOGObjectFnStartC("GSWInput"); LOGObjectFnStartC("GSWInput");
GSWAssertCorrectElementID(context);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
disabledInContext=[self disabledInContext:context]; //return 0 disabledInContext=[self disabledInContext:context]; //return 0
if (!disabledInContext) if (!disabledInContext)
{ {
@ -227,6 +230,7 @@ static int countAutoValue = 0;
NS_ENDHANDLER; NS_ENDHANDLER;
}; };
}; };
GSWAssertIsElementID(context);
LOGObjectFnStopC("GSWInput"); LOGObjectFnStopC("GSWInput");
}; };
@ -259,7 +263,6 @@ static int countAutoValue = 0;
//OK //OK
GSWComponent* component=nil; GSWComponent* component=nil;
LOGObjectFnStartC("GSWInput"); LOGObjectFnStartC("GSWInput");
GSWSaveAppendToResponseElementID(context);//Debug Only
component=[context component]; component=[context component];
if (_value) if (_value)
{ {

View file

@ -170,6 +170,8 @@ static char rcsId[] = "$Id$";
#endif #endif
int countValue=0; int countValue=0;
LOGObjectFnStartC("GSWPopUpButton"); LOGObjectFnStartC("GSWPopUpButton");
GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);
[self resetAutoValue]; [self resetAutoValue];
_autoValue = NO; _autoValue = NO;
request=[context request]; request=[context request];
@ -391,6 +393,8 @@ static char rcsId[] = "$Id$";
inOptGroup=NO; inOptGroup=NO;
}; };
[response _appendContentAsciiString:@"</SELECT>"]; [response _appendContentAsciiString:@"</SELECT>"];
GSWStopElement(context);
GSWAssertIsElementID(context);
LOGObjectFnStopC("GSWPopUpButton"); LOGObjectFnStopC("GSWPopUpButton");
}; };
@ -408,8 +412,12 @@ static char rcsId[] = "$Id$";
{ {
//OK //OK
LOGObjectFnStartC("GSWPopUpButton"); LOGObjectFnStartC("GSWPopUpButton");
GSWStartElement(context);
GSWAssertCorrectElementID(context);
[self _slowTakeValuesFromRequest:request [self _slowTakeValuesFromRequest:request
inContext:context]; inContext:context];
GSWAssertIsElementID(context);
GSWStopElement(context);
LOGObjectFnStopC("GSWPopUpButton"); LOGObjectFnStopC("GSWPopUpButton");
}; };
@ -428,6 +436,8 @@ static char rcsId[] = "$Id$";
BOOL disabledValue=NO; BOOL disabledValue=NO;
BOOL wasFormSubmitted=NO; BOOL wasFormSubmitted=NO;
LOGObjectFnStartC("GSWPopUpButton"); LOGObjectFnStartC("GSWPopUpButton");
GSWStartElement(context);
GSWAssertCorrectElementID(context);
[self resetAutoValue]; [self resetAutoValue];
disabledValue=[self disabledInContext:context]; disabledValue=[self disabledInContext:context];
if (!disabledValue) if (!disabledValue)
@ -450,7 +460,7 @@ static char rcsId[] = "$Id$";
NSDebugMLLog(@"gswdync",@"name=%@",name); NSDebugMLLog(@"gswdync",@"name=%@",name);
formValues=[request formValuesForKey:name]; formValues=[request formValuesForKey:name];
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues); NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
if (formValues && [formValues count]) if (formValues && [formValues count]>0)
{ {
BOOL isEqual=NO; BOOL isEqual=NO;
formValue=[formValues objectAtIndex:0]; formValue=[formValues objectAtIndex:0];
@ -604,6 +614,8 @@ static char rcsId[] = "$Id$";
}; };
}; };
}; };
GSWStopElement(context);
GSWAssertIsElementID(context);
LOGObjectFnStopC("GSWPopUpButton"); LOGObjectFnStopC("GSWPopUpButton");
}; };

View file

@ -136,6 +136,8 @@ static char rcsId[] = "$Id$";
//OK //OK
BOOL disabledInContext=NO; BOOL disabledInContext=NO;
LOGObjectFnStart(); LOGObjectFnStart();
GSWStartElement(context);
GSWAssertCorrectElementID(context);
disabledInContext=[self disabledInContext:context]; disabledInContext=[self disabledInContext:context];
if (!disabledInContext) if (!disabledInContext)
{ {

View file

@ -1,11 +1,18 @@
/* GSWRepetition.h - GSWeb: Class GSWRepetition /** GSWRepetition.h - <title>GSWeb: Class GSWRepetition</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -37,12 +45,12 @@
GSWHTMLStaticGroup* _childrenGroup; GSWHTMLStaticGroup* _childrenGroup;
}; };
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)elements_; contentElements:(NSArray*)elements;
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
template:(GSWElement*)templateElement_; template:(GSWElement*)templateElement;
-(NSString*)description; -(NSString*)description;
-(void)dealloc; -(void)dealloc;
@ -51,28 +59,28 @@
//==================================================================== //====================================================================
@interface GSWRepetition (GSWRepetitionA) @interface GSWRepetition (GSWRepetitionA)
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)request_ -(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)stopOneIterationWithIndex:(int)index_ -(void)stopOneIterationWithIndex:(int)index
count:(int)count_ count:(int)count
isLastOne:(BOOL)isLastOne_ isLastOne:(BOOL)isLastOne
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
-(void)startOneIterationWithIndex:(unsigned int)index_ -(void)startOneIterationWithIndex:(unsigned int)index
list:(NSArray*)list_ list:(NSArray*)aList
inContext:(GSWContext*)context_; inContext:(GSWContext*)aContext;
@end @end

View file

@ -1,11 +1,18 @@
/* GSWRepetition.m - GSWeb: Class GSWRepetition /** GSWRepetition.m - <title>GSWeb: Class GSWRepetition</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
This file is part of the GNUstep Web Library. $Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
static char rcsId[] = "$Id$"; static char rcsId[] = "$Id$";
@ -96,6 +104,14 @@ static char rcsId[] = "$Id$";
[super dealloc]; [super dealloc];
} }
//--------------------------------------------------------------------
-(void)setDefinitionName:(NSString*)definitionName
{
[super setDefinitionName:definitionName];
if (definitionName && _childrenGroup)
[_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]];
};
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(NSString*)description -(NSString*)description
{ {
@ -120,7 +136,8 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);
component=[context component]; component=[context component];
NSDebugMLLog(@"gswdync",@"_list=%@",_list); NSDebugMLLog(@"gswdync",@"_list=%@",_list);
if (_list) if (_list)
@ -151,6 +168,7 @@ static char rcsId[] = "$Id$";
}; };
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue); NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
[context incrementLoopLevel];
for(i=0;i<countValue;i++) for(i=0;i<countValue;i++)
{ {
#ifndef NDEBUG #ifndef NDEBUG
@ -170,14 +188,17 @@ static char rcsId[] = "$Id$";
#ifndef NDEBUG #ifndef NDEBUG
if (![debugElementID isEqualToString:[context elementID]]) if (![debugElementID isEqualToString:[context elementID]])
{ {
NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",[self class],debugElementID,[context elementID]); NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",
[self class],debugElementID,[context elementID]);
}; };
#endif #endif
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); [context decrementLoopLevel];
GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion appendToResponse: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWRepetion appendToResponse: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -193,7 +214,7 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
isInForm=[context isInForm]; isInForm=[context isInForm];
NSDebugMLLog(@"gswdync",@"isInForm=%s",isInForm ? "YES" : "NO"); NSDebugMLLog(@"gswdync",@"isInForm=%s",isInForm ? "YES" : "NO");
if (isInForm) if (isInForm)
@ -203,9 +224,10 @@ static char rcsId[] = "$Id$";
element=[self _fastInvokeActionForRequest:request element=[self _fastInvokeActionForRequest:request
inContext:context]; inContext:context];
NSDebugMLLog(@"gswdync",@"element=%@",element); NSDebugMLLog(@"gswdync",@"element=%@",element);
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion invokeActionForRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWRepetion invokeActionForRequest: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
return element; return element;
@ -225,7 +247,8 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWAssertCorrectElementID(context);
component=[context component]; component=[context component];
if (_list) if (_list)
{ {
@ -250,6 +273,7 @@ static char rcsId[] = "$Id$";
else else
countValue=tmpCount; countValue=tmpCount;
}; };
[context incrementLoopLevel];
for(i=0;i<countValue;i++) for(i=0;i<countValue;i++)
{ {
#ifndef NDEBUG #ifndef NDEBUG
@ -261,22 +285,25 @@ static char rcsId[] = "$Id$";
[context appendZeroElementIDComponent]; [context appendZeroElementIDComponent];
[_childrenGroup takeValuesFromRequest:request [_childrenGroup takeValuesFromRequest:request
inContext:context]; inContext:context];
[context deleteLastElementIDComponent]; [context deleteLastElementIDComponent];
[self stopOneIterationWithIndex:i [self stopOneIterationWithIndex:i
count:countValue count:countValue
isLastOne:NO isLastOne:NO
inContext:context]; inContext:context];
#ifndef NDEBUG #ifndef NDEBUG
if (![debugElementID isEqualToString:[context elementID]]) if (![debugElementID isEqualToString:[context elementID]])
{ {
NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",[self class],debugElementID,[context elementID]); NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",
[self class],debugElementID,[context elementID]);
};
};
#endif #endif
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); [context decrementLoopLevel];
GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion takeValuesFromRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
@"GSWRepetion takeValuesFromRequest: bad elementID");
#endif #endif
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -295,7 +322,7 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
component=[context component]; component=[context component];
if (_list) if (_list)
{ {
@ -320,6 +347,7 @@ static char rcsId[] = "$Id$";
else else
countValue=tmpCount; countValue=tmpCount;
}; };
[context incrementLoopLevel];
for(i=0;!element && i<countValue;i++) for(i=0;!element && i<countValue;i++)
{ {
#ifndef NDEBUG #ifndef NDEBUG
@ -343,7 +371,8 @@ static char rcsId[] = "$Id$";
}; };
#endif #endif
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); [context decrementLoopLevel];
GSWStopElement(context);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _slowInvokeActionForRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _slowInvokeActionForRequest: bad elementID");
#endif #endif
@ -363,11 +392,10 @@ static char rcsId[] = "$Id$";
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb]; int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
#endif #endif
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
senderID=[context senderID]; senderID=[context senderID];
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
elementID=[context elementID]; elementID=[context elementID];
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
if ([senderID hasPrefix:elementID]) if ([senderID hasPrefix:elementID])
{ {
#ifndef NDEBUG #ifndef NDEBUG
@ -400,6 +428,7 @@ static char rcsId[] = "$Id$";
else else
countValue=tmpCount; countValue=tmpCount;
}; };
[context incrementLoopLevel];
for(i=0;!element && i<countValue;i++) for(i=0;!element && i<countValue;i++)
{ {
[self startOneIterationWithIndex:i [self startOneIterationWithIndex:i
@ -421,9 +450,9 @@ static char rcsId[] = "$Id$";
}; };
#endif #endif
}; };
[context decrementLoopLevel];
}; };
NSDebugMLLog(@"gswdync",@"element=%@",element); GSWStopElement(context);
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
#ifndef NDEBBUG #ifndef NDEBBUG
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _fastInvokeActionForRequest: bad elementID"); NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _fastInvokeActionForRequest: bad elementID");
#endif #endif

View file

@ -1,11 +1,16 @@
/* GSWResetButton.h - GSWeb: Class GSWResetButton /** GSWResetButton.h - <title>GSWeb: Class GSWResetButton</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -29,12 +35,12 @@
//OK //OK
//==================================================================== //====================================================================
@interface GSWResetButton: GSWInput @interface GSWResetButton: GSWInput
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)elements_; contentElements:(NSArray*)elements;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)request
inContext:(GSWContext*)context_; inContext:(GSWContext*)context;
@end @end

View file

@ -1,11 +1,16 @@
/* GSWResetButton.m - GSWeb: Class GSWResetButton /** GSWResetButton.m - <title>GSWeb: Class GSWResetButton</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
static char rcsId[] = "$Id$"; static char rcsId[] = "$Id$";
@ -28,34 +34,35 @@ static char rcsId[] = "$Id$";
//==================================================================== //====================================================================
@implementation GSWResetButton @implementation GSWResetButton
-(id)initWithName:(NSString*)name_ -(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations_ associations:(NSDictionary*)associations
contentElements:(NSArray*)elements_ contentElements:(NSArray*)elements
{ {
NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_]; NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
LOGObjectFnStartC("GSWResetButton"); LOGObjectFnStartC("GSWResetButton");
NSDebugMLLog(@"gswdync",@"name_=%@ associations_:%@ _elements=%@",name_,associations_,elements_); NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
[_associations setObject:[GSWAssociation associationWithValue:@"reset"] [tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"]
forKey:@"type"]; forKey:@"type"];
if (![_associations objectForKey:value__Key]) if (![tmpAssociations objectForKey:value__Key])
[_associations setObject:[GSWAssociation associationWithValue:@"reset"] [tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"]
forKey:value__Key]; forKey:value__Key];
if ((self=[super initWithName:name_ if ((self=[super initWithName:aName
associations:_associations associations:tmpAssociations
contentElements:nil])) contentElements:nil]))
{ {
}; };
LOGObjectFnStopC("GSWResetButton"); LOGObjectFnStopC("GSWResetButton");
return self; return self;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)request
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
GSWAssertCorrectElementID(context_);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
//Does Nothing and don't call its parent GSWInput ! //Does Nothing and don't call its parent GSWInput !
}; };

View file

@ -81,6 +81,7 @@
length:(unsigned)length; length:(unsigned)length;
-(void)appendContentCharacter:(char)aChar; -(void)appendContentCharacter:(char)aChar;
-(void)appendContentString:(NSString*)string; -(void)appendContentString:(NSString*)string;
-(void)appendDebugCommentContentString:(NSString*)string;
-(void)appendContentData:(NSData*)contentData; -(void)appendContentData:(NSData*)contentData;
-(void)setContentEncoding:(NSStringEncoding)encoding; -(void)setContentEncoding:(NSStringEncoding)encoding;
-(NSStringEncoding)contentEncoding; -(NSStringEncoding)contentEncoding;

View file

@ -397,7 +397,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding;
-(void)appendDebugCommentContentString:(NSString*)string -(void)appendDebugCommentContentString:(NSString*)string
{ {
#ifndef NDEBUG #ifndef NDEBUG
[self appendContentString:[NSString stringWithFormat:@"<!-- %@ -->",string]]; [self appendContentString:[NSString stringWithFormat:@"\n<!-- %@ -->\n",string]];
#endif #endif
}; };
@ -584,6 +584,16 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding;
NSString* _dataLengthString=nil; NSString* _dataLengthString=nil;
LOGObjectFnStart(); LOGObjectFnStart();
NSAssert(!isFinalizeInContextHasBeenCalled,@"GSWResponse _finalizeInContext: already called"); 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 //TODOV: if !session in request and session created: no client cache
if (![self _isClientCachingDisabled] && [_context hasSession] && ![_context _requestSessionID]) if (![self _isClientCachingDisabled] && [_context hasSession] && ![_context _requestSessionID])
[self disableClientCaching]; [self disableClientCaching];

View file

@ -1093,6 +1093,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
LOGObjectFnStart(); LOGObjectFnStart();
_pageElement=[context_ _pageElement]; _pageElement=[context_ _pageElement];
_pageComponent=[context_ _pageComponent]; _pageComponent=[context_ _pageComponent];
#ifndef NDEBUG
[context_ addDocStructureStep:@"Take Values From Request"];
#endif
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? [context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
[_pageComponent takeValuesFromRequest:request_ [_pageComponent takeValuesFromRequest:request_
inContext:context_]; //_pageComponent ?? inContext:context_]; //_pageComponent ??
@ -1113,6 +1116,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
{ {
_pageElement=[context_ _pageElement]; _pageElement=[context_ _pageElement];
_pageComponent=[context_ _pageComponent]; _pageComponent=[context_ _pageComponent];
#ifndef NDEBUG
[context_ addDocStructureStep:@"Invoke Action For Request"];
#endif
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? [context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
_element=[_pageComponent invokeActionForRequest:request_ _element=[_pageComponent invokeActionForRequest:request_
inContext:context_]; //_pageComponent inContext:context_]; //_pageComponent
@ -1152,6 +1158,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
_statisticsStore=[[GSWApplication application] statisticsStore]; _statisticsStore=[[GSWApplication application] statisticsStore];
_pageElement=[context_ _pageElement]; _pageElement=[context_ _pageElement];
_pageComponent=[context_ _pageComponent]; _pageComponent=[context_ _pageComponent];
#ifndef NDEBUG
[context_ addDocStructureStep:@"Append To Response"];
#endif
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? [context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
[_pageComponent appendToResponse:response_ [_pageComponent appendToResponse:response_
inContext:context_]; //_pageComponent?? inContext:context_]; //_pageComponent??

View file

@ -121,7 +121,8 @@ static char rcsId[] = "$Id$";
GSWComponent* component=nil; GSWComponent* component=nil;
id valueValue = nil; id valueValue = nil;
LOGObjectFnStartC("GSWString"); LOGObjectFnStartC("GSWString");
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]); GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);
request=[context request]; request=[context request];
isFromClientComponent=[request isFromClientComponent]; isFromClientComponent=[request isFromClientComponent];
component=[context component]; component=[context component];
@ -177,7 +178,7 @@ static char rcsId[] = "$Id$";
else else
[response appendContentString:formattedValue]; [response appendContentString:formattedValue];
}; };
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]); GSWStopElement(context);
LOGObjectFnStopC("GSWString"); LOGObjectFnStopC("GSWString");
}; };

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc. Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$ $Revision$
@ -92,9 +92,11 @@ static char rcsId[] = "$Id$";
{ {
//OK //OK
LOGObjectFnStart(); LOGObjectFnStart();
GSWSaveAppendToResponseElementID(context);//Debug Only GSWStartElement(context);
GSWSaveAppendToResponseElementID(context);
[super appendToResponse:response [super appendToResponse:response
inContext:context]; inContext:context];
GSWStopElement(context);
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -106,16 +108,16 @@ static char rcsId[] = "$Id$";
GSWElement* element=nil; GSWElement* element=nil;
BOOL disabledValue=NO; BOOL disabledValue=NO;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@", GSWStartElement(context);
[self class],[context elementID],[context senderID]);
NS_DURING NS_DURING
{ {
GSWAssertCorrectElementID(context);// Debug Only GSWAssertCorrectElementID(context);
disabledValue=[self disabledInContext:context]; disabledValue=[self disabledInContext:context];
NSDebugMLLog(@"gswdync",@"disabledValue=%s",(disabledValue ? "YES" : "NO")); NSDebugMLLog(@"gswdync",@"disabledValue=%s",(disabledValue ? "YES" : "NO"));
if (!disabledValue) if (!disabledValue)
{ {
BOOL wasFormSubmitted=[context _wasFormSubmitted]; BOOL wasFormSubmitted=[context _wasFormSubmitted];
NSDebugMLLog(@"gswdync",@"wasFormSubmitted=%s",(wasFormSubmitted ? "YES" : "NO"));
if (wasFormSubmitted) if (wasFormSubmitted)
{ {
BOOL invoked=NO; BOOL invoked=NO;
@ -162,7 +164,7 @@ static char rcsId[] = "$Id$";
{ {
if (![element isKindOfClass:[GSWComponent class]]) //TODO GSWComponent or Element ? 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 else
{ {
@ -204,6 +206,7 @@ static char rcsId[] = "$Id$";
[context elementID], [context elementID],
[context senderID]); [context senderID]);
}; };
GSWStopElement(context);
LOGObjectFnStop(); LOGObjectFnStop();
return element; return element;
}; };
@ -213,7 +216,9 @@ static char rcsId[] = "$Id$";
inContext:(GSWContext*)context inContext:(GSWContext*)context
{ {
//Does Nothing ? //Does Nothing ?
GSWAssertCorrectElementID(context);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
GSWStopElement(context);
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------

View file

@ -51,13 +51,13 @@
@end @end
@interface GSWSwitchComponent (GSWSwitchComponentA) @interface GSWSwitchComponent (GSWSwitchComponentA)
-(void)appendToResponse:(GSWResponse*)response -(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext; inContext:(GSWContext*)aContext;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request -(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext; inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_ -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext; inContext:(GSWContext*)aContext;
-(GSWElement*)_realComponentWithName:(NSString*)name -(GSWElement*)_realComponentWithName:(NSString*)name
inContext:(GSWContext*)aContext; inContext:(GSWContext*)aContext;

View file

@ -111,6 +111,8 @@ static char rcsId[] = "$Id$";
GSWElement* element=nil; GSWElement* element=nil;
NSString* elementNameInContext=nil; NSString* elementNameInContext=nil;
LOGObjectFnStartC("GSWSwitchComponent"); LOGObjectFnStartC("GSWSwitchComponent");
GSWStartElement(aContext);
GSWSaveAppendToResponseElementID(aContext);
elementNameInContext=[self _elementNameInContext:aContext]; elementNameInContext=[self _elementNameInContext:aContext];
[aContext appendElementIDComponent:elementNameInContext]; [aContext appendElementIDComponent:elementNameInContext];
element=[self _realComponentWithName:elementNameInContext element=[self _realComponentWithName:elementNameInContext
@ -129,6 +131,8 @@ static char rcsId[] = "$Id$";
GSWElement* element=nil; GSWElement* element=nil;
NSString* elementNameInContext=nil; NSString* elementNameInContext=nil;
LOGObjectFnStartC("GSWSwitchComponent"); LOGObjectFnStartC("GSWSwitchComponent");
GSWStartElement(aContext);
GSWAssertCorrectElementID(aContext);
elementNameInContext=[self _elementNameInContext:aContext]; elementNameInContext=[self _elementNameInContext:aContext];
[aContext appendElementIDComponent:elementNameInContext]; [aContext appendElementIDComponent:elementNameInContext];
element=[self _realComponentWithName:elementNameInContext element=[self _realComponentWithName:elementNameInContext
@ -141,17 +145,19 @@ static char rcsId[] = "$Id$";
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)takeValuesFromRequest:(GSWRequest*)request -(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext inContext:(GSWContext*)aContext
{ {
GSWElement* element=nil; GSWElement* element=nil;
NSString* elementNameInContext=nil; NSString* elementNameInContext=nil;
LOGObjectFnStartC("GSWSwitchComponent"); LOGObjectFnStartC("GSWSwitchComponent");
GSWStartElement(aContext);
GSWAssertCorrectElementID(aContext);
elementNameInContext=[self _elementNameInContext:aContext]; elementNameInContext=[self _elementNameInContext:aContext];
[aContext appendElementIDComponent:elementNameInContext]; [aContext appendElementIDComponent:elementNameInContext];
element=[self _realComponentWithName:elementNameInContext element=[self _realComponentWithName:elementNameInContext
inContext:aContext]; inContext:aContext];
[element takeValuesFromRequest:request [element takeValuesFromRequest:aRequest
inContext:aContext]; inContext:aContext];
[aContext deleteLastElementIDComponent]; [aContext deleteLastElementIDComponent];
LOGObjectFnStopC("GSWSwitchComponent"); LOGObjectFnStopC("GSWSwitchComponent");

View file

@ -236,7 +236,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
NSRange docTypeRangeEnd=NSMakeRange(NSNotFound,0); NSRange docTypeRangeEnd=NSMakeRange(NSNotFound,0);
_template=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements]; _template=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
[_template setDefinitionName:[NSString stringWithFormat:@"Template - %@",_templateName]];
NSDebugMLog(@"template %p=%@",_template,_template);
//NSLog(@"_string = %@", _string); //NSLog(@"_string = %@", _string);
docTypeRangeStart=[_string rangeOfString:@"<!DOCTYPE"]; docTypeRangeStart=[_string rangeOfString:@"<!DOCTYPE"];

View file

@ -807,6 +807,7 @@ text [Type:XML_TEXT_NODE] [{}] ####
} }
else else
{ {
GSWHTMLStaticGroup* aStaticGroup=nil;
NSDebugMLLog(@"low",@"node=%p associations:%@",currentNode,_associations); NSDebugMLLog(@"low",@"node=%p associations:%@",currentNode,_associations);
{ {
NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator]; NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator];
@ -839,11 +840,12 @@ text [Type:XML_TEXT_NODE] [{}] ####
[currentNode typeDescription], [currentNode typeDescription],
[currentNode propertiesAsDictionary], [currentNode propertiesAsDictionary],
[[currentNode content] lossyCString]); [[currentNode content] lossyCString]);
aStaticGroup=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease];
elem=[GSWApp dynamicElementWithName:className elem=[GSWApp dynamicElementWithName:className
associations:_associations associations:_associations
template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease] template:aStaticGroup
languages:_languages]; languages:_languages];
NSDebugMLog(@"node=%p element=%@",currentNode,elem); NSDebugMLog(@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup);
if (elem) if (elem)
[elem setDefinitionName:[definitionsElement elementName]]; [elem setDefinitionName:[definitionsElement elementName]];
else else

View file

@ -86,7 +86,8 @@ static char rcsId[] = "$Id$";
//OK //OK
BOOL disabledValue=NO; BOOL disabledValue=NO;
LOGObjectFnStartC("GSWTextField"); LOGObjectFnStartC("GSWTextField");
GSWAssertCorrectElementID(context);// Debug Only GSWStartElement(context);
GSWAssertCorrectElementID(context);
disabledValue=[self disabledInContext:context]; disabledValue=[self disabledInContext:context];
if (!disabledValue) if (!disabledValue)
{ {
@ -106,9 +107,19 @@ static char rcsId[] = "$Id$";
if (formatter) if (formatter)
{ {
NSString* errorDscr=nil; NSString* errorDscr=nil;
if (![formatter getObjectValue:&resultValue if ([formatter getObjectValue:&resultValue
forString:value forString:value
errorDescription:&errorDscr]) errorDescription:&errorDscr])
{
if (value && !resultValue)
{
NSWarnLog(@"There's a value (%@ of class %@) but no formattedValue with formater %@",
value,
[value class],
formatter);
};
}
else
{ {
NSException* exception=nil; NSException* exception=nil;
NSString* valueKeyPath=[_value keyPath]; NSString* valueKeyPath=[_value keyPath];
@ -162,6 +173,7 @@ static char rcsId[] = "$Id$";
}; };
}; };
}; };
GSWStopElement(context);
LOGObjectFnStopC("GSWTextField"); LOGObjectFnStopC("GSWTextField");
}; };
@ -265,8 +277,16 @@ static char rcsId[] = "$Id$";
if (!formatter) if (!formatter)
formattedValue=valueValue; formattedValue=valueValue;
else else
formattedValue=[formatter stringForObjectValue:valueValue]; {
formattedValue=[formatter stringForObjectValue:valueValue];
if (valueValue && !formattedValue)
{
NSWarnLog(@"There's a value (%@ of class %@) but no formattedValue with formater %@",
valueValue,
[valueValue class],
formatter);
};
};
if (formattedValue && [newFormattedValue isEqualToString:formattedValue]) if (formattedValue && [newFormattedValue isEqualToString:formattedValue])
{ {
NSLog(@"### GSWTextField : are EQUAL ###"); NSLog(@"### GSWTextField : are EQUAL ###");

View file

@ -1,11 +1,17 @@
/* GSWURLValuedElementData.h - GSWeb: Class GSWURLValuedElementData /** GSWURLValuedElementData.h - <title>GSWeb: Class GSWURLValuedElementData</title>
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Apr 1999 Date: Apr 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
// $Id$ // $Id$
@ -29,21 +36,21 @@
@interface GSWURLValuedElementData: NSObject @interface GSWURLValuedElementData: NSObject
{ {
NSString* key; NSString* _key;
NSString* mimeType; NSString* _mimeType;
NSData * data; NSData * _data;
BOOL temporaryKey; BOOL _temporaryKey;
}; };
-(id)initWithData:(NSData*)data_ -(id)initWithData:(NSData*)data
mimeType:(NSString*)type_ mimeType:(NSString*)type
key:(NSString*)key_; key:(NSString*)key;
-(void)dealloc; -(void)dealloc;
-(void)appendDataURLToResponse:(GSWResponse*)response_ -(void)appendDataURLToResponse:(GSWResponse*)response
inContext:(GSWContext*)context_; inContext:(GSWContext*)context;
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context_; inContext:(GSWContext*)context;
-(NSString*)description; -(NSString*)description;
-(BOOL)isTemporary; -(BOOL)isTemporary;
-(NSData*)data; -(NSData*)data;

View file

@ -1,11 +1,18 @@
/* GSWURLValuedElementData.m - GSWeb: Class GSWURLValuedElementData /** GSWURLValuedElementData.m - <title>GSWeb: Class GSWURLValuedElementData</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com> Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999 Date: Jan 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library. This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either 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 You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ </license>
**/
static char rcsId[] = "$Id$"; static char rcsId[] = "$Id$";
@ -28,29 +36,29 @@ static char rcsId[] = "$Id$";
//==================================================================== //====================================================================
@implementation GSWURLValuedElementData @implementation GSWURLValuedElementData
-(id)initWithData:(NSData*)data_ -(id)initWithData:(NSData*)data
mimeType:(NSString*)type_ mimeType:(NSString*)type
key:(NSString*)key_ key:(NSString*)key
{ {
LOGObjectFnStart(); LOGObjectFnStart();
if ((self=[super init])) if ((self=[super init]))
{ {
ASSIGN(data,data_); ASSIGN(_data,data);
NSDebugMLog(@"data=%@",data); NSDebugMLog(@"data=%@",_data);
ASSIGN(mimeType,type_); ASSIGN(_mimeType,type);
NSDebugMLog(@"mimeType=%@",mimeType); NSDebugMLog(@"mimeType=%@",_mimeType);
NSDebugMLog(@"key_=%@",key_); NSDebugMLog(@"key=%@",key);
if (key_) if (key)
{ {
ASSIGN(key,key_); ASSIGN(_key,key);
} }
else else
{ {
temporaryKey=YES; _temporaryKey=YES;
ASSIGN(key,[NSString stringUniqueIdWithLength:4]); ASSIGN(_key,[NSString stringUniqueIdWithLength:4]);
}; };
NSDebugMLog(@"key=%@",key); NSDebugMLog(@"key=%@",_key);
}; };
LOGObjectFnStop(); LOGObjectFnStop();
return self; return self;
}; };
@ -58,50 +66,52 @@ static char rcsId[] = "$Id$";
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)dealloc -(void)dealloc
{ {
DESTROY(data); DESTROY(_data);
DESTROY(mimeType); DESTROY(_mimeType);
DESTROY(key); DESTROY(_key);
[super dealloc]; [super dealloc];
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)appendDataURLToResponse:(GSWResponse*)response_ -(void)appendDataURLToResponse:(GSWResponse*)response
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
NSString* _queryString=nil; NSString* queryString=nil;
GSWDynamicURLString* _url=nil; GSWDynamicURLString* url=nil;
LOGObjectFnStart(); LOGObjectFnStart();
_queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]]; queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]];
NSDebugMLog(@"_queryString=%@",_queryString); NSDebugMLog(@"queryString=%@",queryString);
_url=[context_ urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv] url=[context urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv]
path:nil path:nil
queryString:_queryString]; queryString:queryString];
NSDebugMLog(@"_url=%@",_url); NSDebugMLog(@"url=%@",url);
[response_ _appendContentAsciiString:(NSString*)_url]; [response _appendContentAsciiString:(NSString*)url];
LOGObjectFnStop(); LOGObjectFnStop();
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
-(void)appendToResponse:(GSWResponse*)response_ -(void)appendToResponse:(GSWResponse*)response
inContext:(GSWContext*)context_ inContext:(GSWContext*)context
{ {
//OK //OK
NSData* _data=data; NSData* data=_data;
LOGObjectFnStart(); LOGObjectFnStart();
NSDebugMLog(@"_data=%@",_data); GSWStartElement(context);
[response_ setHeader:[NSString stringWithFormat:@"%u",[data length]] GSWSaveAppendToResponseElementID(context);
forKey:@"content-length"]; NSDebugMLog(@"data=%@",data);
if (!_data) if (!data)
{ {
NSDebugMLog(@"key=%@",key); NSDebugMLog(@"key=%@",_key);
_data=[NSData dataWithContentsOfFile:key]; data=[NSData dataWithContentsOfFile:_key];
NSDebugMLog(@"_data=%@",_data); NSDebugMLog(@"data=%@",data);
} }
else else
[response_ setContent:_data]; [response setContent:data];
[response setHeader:[NSString stringWithFormat:@"%u",[data length]]
forKey:@"content-length"];
[response_ setHeader:mimeType [response setHeader:_mimeType
forKey:@"content-type"]; forKey:@"content-type"];
LOGObjectFnStop(); LOGObjectFnStop();
}; };
@ -109,8 +119,8 @@ static char rcsId[] = "$Id$";
-(NSString*)description -(NSString*)description
{ {
return [NSString stringWithFormat:@"<%s %p>", return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self), object_get_class_name(self),
(void*)self]; (void*)self];
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -118,7 +128,7 @@ static char rcsId[] = "$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
LOGObjectFnStop(); LOGObjectFnStop();
return temporaryKey; return _temporaryKey;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -126,7 +136,7 @@ static char rcsId[] = "$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
LOGObjectFnStop(); LOGObjectFnStop();
return data; return _data;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -134,7 +144,7 @@ static char rcsId[] = "$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
LOGObjectFnStop(); LOGObjectFnStop();
return mimeType; return _mimeType;
}; };
//-------------------------------------------------------------------- //--------------------------------------------------------------------
@ -142,7 +152,7 @@ static char rcsId[] = "$Id$";
{ {
LOGObjectFnStart(); LOGObjectFnStart();
LOGObjectFnStop(); LOGObjectFnStop();
return key; return _key;
}; };
@end @end