mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-04-23 15:33:43 +00:00
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:
parent
af0f975466
commit
394fe2a8c4
45 changed files with 1807 additions and 1282 deletions
108
ChangeLog
108
ChangeLog
|
@ -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>
|
||||
* GSWeb.framework/GSWSubmitButton.m:
|
||||
o corrected setActionInvoked into _setActionInvoked
|
||||
|
@ -27,7 +133,7 @@
|
|||
* GSWeb.framework/GSWText.m:
|
||||
o handling exception in takeValue
|
||||
* GSWeb.framework/GSWInput.m:
|
||||
o corrected bug in akeValuesFromRequest:inContext:
|
||||
o corrected bug in takeValuesFromRequest:inContext:
|
||||
* GSWExtensionsGSW.framework:
|
||||
o added GSWFileUploadComponent
|
||||
* GSWExtensionsGSW.framework/GNUmakefile
|
||||
|
|
|
@ -29,9 +29,8 @@
|
|||
{
|
||||
LOGObjectFnStart();
|
||||
if ((self=[super init]))
|
||||
{
|
||||
NSDebugMLog(@"associationsKeys=%@",associationsKeys);
|
||||
};
|
||||
{
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
};
|
||||
|
@ -74,7 +73,6 @@
|
|||
BOOL _bindingOk=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"user=%@ password=%@",user,password);
|
||||
NSDebugMLog(@"associationsKeys=%@",associationsKeys);
|
||||
NS_DURING
|
||||
{
|
||||
if ([self hasBinding:@"password"])
|
||||
|
|
|
@ -2605,6 +2605,7 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
GSWResponse* _response=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"application",@"context=%@",context_);
|
||||
NSDebugMLog(@"EXCEPTION=%@",exception_);
|
||||
NS_DURING
|
||||
{
|
||||
_response=[self _handleException:exception_
|
||||
|
|
|
@ -144,6 +144,8 @@ static char rcsId[] = "$Id$";
|
|||
//OK
|
||||
BOOL disabledInContext=NO;
|
||||
LOGObjectFnStartC("GSWCheckBox");
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledInContext=[self disabledInContext:context];
|
||||
if (!disabledInContext)
|
||||
{
|
||||
|
@ -212,6 +214,8 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
};
|
||||
};
|
||||
GSWStopElement(context);
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWCheckBox");
|
||||
};
|
||||
|
||||
|
|
|
@ -559,6 +559,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSDebugMLLog(@"gswcomponents",@"subComponents=%@",_subComponents);
|
||||
subc=[_subComponents objectForKey:elementId];
|
||||
NSDebugMLLog(@"gswcomponents",@"subc=%@",subc);
|
||||
NSDebugMLog(@"subComponent %@ for _elementId=%@",[subc class],elementId);
|
||||
LOGObjectFnStop();
|
||||
return subc;
|
||||
};
|
||||
|
@ -569,6 +570,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"setSubComponent %@ for _elementId=%@",[component class],elementId);
|
||||
NSDebugMLLog(@"gswcomponents",@"elementId=%@",elementId);
|
||||
NSDebugMLLog(@"gswcomponents",@"component=%@",component);
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
|
@ -981,13 +983,15 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
GSWElementIDString* debugElementID=[aContext elementID];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
GSWSaveAppendToResponseElementID(aContext);//Debug Only
|
||||
GSWStartElement(aContext);
|
||||
GSWSaveAppendToResponseElementID(aContext);
|
||||
|
||||
template=[self _template];
|
||||
|
||||
#ifndef NDEBUG
|
||||
if(GSDebugSet(@"gswcomponents") == YES)
|
||||
[aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Start %@ -->\n",[self _templateName]]];//TODO enlever
|
||||
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
|
||||
#endif
|
||||
|
||||
request=[aContext request];
|
||||
isFromClientComponent=[request isFromClientComponent];
|
||||
|
@ -995,6 +999,8 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[aContext appendZeroElementIDComponent];
|
||||
NS_DURING
|
||||
{
|
||||
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",[self definitionName],[aContext elementID]]];
|
||||
NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
[template appendToResponse:aResponse
|
||||
inContext:aContext];
|
||||
}
|
||||
|
@ -1010,8 +1016,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NS_ENDHANDLER;
|
||||
[aContext deleteLastElementIDComponent];
|
||||
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
GSWStopElement(aContext);
|
||||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
|
@ -1023,6 +1028,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Stop %@ -->\n",
|
||||
[self _templateName]]];//TODO enlever
|
||||
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -1039,11 +1045,10 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
GSWElementIDString* debugElementID=[aContext elementID];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
GSWStartElement(aContext);
|
||||
NS_DURING
|
||||
{
|
||||
GSWAssertCorrectElementID(aContext);// Debug Only
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
template=[self _template];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
element=[[self _template] invokeActionForRequest:aRequest
|
||||
|
@ -1060,8 +1065,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
GSWStopElement(aContext);
|
||||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
|
@ -1079,6 +1083,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[aContext elementID],
|
||||
[aContext senderID]);
|
||||
};
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
return element;
|
||||
};
|
||||
|
@ -1096,20 +1101,19 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
GSWElementIDString* debugElementID=[aContext elementID];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
GSWAssertCorrectElementID(aContext);// Debug Only
|
||||
GSWStartElement(aContext);
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
|
||||
[_validationFailureMessages removeAllObjects];
|
||||
oldValidateFlag=[aContext isValidate];
|
||||
[aContext setValidate:YES];
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
template=[self _template];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
[template takeValuesFromRequest:aRequest
|
||||
inContext:aContext];
|
||||
[aContext deleteLastElementIDComponent];
|
||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
GSWStopElement(aContext);
|
||||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
|
@ -1119,6 +1123,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
};
|
||||
#endif
|
||||
[aContext setValidate:oldValidateFlag];
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -1382,8 +1387,6 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
NSArray* languages=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"[self context]=%p",(void*)[self context]);
|
||||
NSDebugMLLog(@"gswcomponents",@"[self context]=%@",[self context]);
|
||||
languages=[[self context] languages];
|
||||
LOGObjectFnStop();
|
||||
return languages;
|
||||
|
|
|
@ -49,6 +49,7 @@ static char rcsId[] = "$Id$";
|
|||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@",
|
||||
[self class],[self definitionName],[aContext elementID]);
|
||||
GSWSaveAppendToResponseElementID(aContext);//Debug Only
|
||||
component=[aContext component];
|
||||
childTemplate=[component _childTemplate];
|
||||
parent=[component parent];
|
||||
|
@ -114,6 +115,7 @@ static char rcsId[] = "$Id$";
|
|||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ id=%@",
|
||||
[self class],[self definitionName],[aContext elementID]);
|
||||
GSWAssertCorrectElementID(aContext);// Debug Only
|
||||
component=[aContext component];
|
||||
childTemplate=[component _childTemplate];
|
||||
parent=[component parent];
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWComponentReference.h - GSWeb: Class GSWComponentReference
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWComponentReference.h - <title>GSWeb: Class GSWComponentReference</title>
|
||||
|
||||
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
|
||||
|
||||
$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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -29,39 +37,39 @@
|
|||
//====================================================================
|
||||
@interface GSWComponentReference: GSWDynamicElement
|
||||
{
|
||||
NSString* name;
|
||||
NSArray* associationsKeys;
|
||||
NSArray* associations;
|
||||
GSWElement* contentElement;
|
||||
NSString* _name;
|
||||
NSArray* _associationsKeys;
|
||||
NSArray* _associations;
|
||||
GSWElement* _contentElement;
|
||||
};
|
||||
|
||||
-(void)dealloc;
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations;
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)template_;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)template;
|
||||
-(NSString*)description;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWComponentReference (GSWComponentReferenceA)
|
||||
-(void)popRefComponentInContext:(GSWContext*)context_;
|
||||
-(void)pushRefComponentInContext:(GSWContext*)context_;
|
||||
-(void)popRefComponentInContext:(GSWContext*)aContext;
|
||||
-(void)pushRefComponentInContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWComponentReference (GSWRequestHandling)
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
#endif //_GSWComponentReference_h__
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWComponentReference.m - GSWeb: Class GSWComponentReference
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/* GSWComponentReference.m - <title>GSWeb: Class GSWComponentReference</title>
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -29,28 +37,28 @@ static char rcsId[] = "$Id$";
|
|||
@implementation GSWComponentReference
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
//OK
|
||||
NSDebugMLLog(@"gswdync",@"name:%@",name);
|
||||
NSDebugMLLog(@"gswdync",@"associations_:%@",associations_);
|
||||
if ((self==[super initWithName:name_
|
||||
associations:associations_
|
||||
NSDebugMLLog(@"gswdync",@"aName:%@",aName);
|
||||
NSDebugMLLog(@"gswdync",@"associations:%@",associations);
|
||||
if ((self==[super initWithName:aName
|
||||
associations:associations
|
||||
template:nil]))
|
||||
{
|
||||
ASSIGN(name,name_);
|
||||
if (associations_ && [associations_ count])
|
||||
ASSIGN(_name,aName);
|
||||
if (associations && [associations count])
|
||||
{
|
||||
NSMutableArray* tmpArray=[NSMutableArray array];
|
||||
int i=0;
|
||||
ASSIGN(associationsKeys,[associations_ allKeys]);
|
||||
for(i=0;i<[associationsKeys count];i++)
|
||||
ASSIGN(_associationsKeys,[associations allKeys]);
|
||||
for(i=0;i<[_associationsKeys count];i++)
|
||||
{
|
||||
[tmpArray addObject:[associations_ objectForKey:[associationsKeys objectAtIndex:i]]];
|
||||
[tmpArray addObject:[associations objectForKey:[_associationsKeys objectAtIndex:i]]];
|
||||
};
|
||||
ASSIGN(associations,[NSArray arrayWithArray:tmpArray]);
|
||||
ASSIGN(_associations,[NSArray arrayWithArray:tmpArray]);
|
||||
};
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
|
@ -58,19 +66,19 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)_template
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)template
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"name:%@",name);
|
||||
NSDebugMLLog(@"gswdync",@"associations_:%@",associations_);
|
||||
NSDebugMLLog(@"gswdync",@"_template:%@",_template);
|
||||
if ((self==[self initWithName:name_
|
||||
associations:associations_]))
|
||||
{
|
||||
ASSIGN(contentElement,_template);
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"aName:%@",aName);
|
||||
NSDebugMLLog(@"gswdync",@"associations:%@",associations);
|
||||
NSDebugMLLog(@"gswdync",@"template:%@",template);
|
||||
if ((self==[self initWithName:aName
|
||||
associations:associations]))
|
||||
{
|
||||
ASSIGN(_contentElement,template);
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
};
|
||||
|
@ -80,13 +88,13 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
GSWLogC("Dealloc GSWComponentReference");
|
||||
GSWLogC("Destroy name");
|
||||
DESTROY(name);
|
||||
DESTROY(_name);
|
||||
GSWLogC("Destroy associationsKeys");
|
||||
DESTROY(associationsKeys);
|
||||
DESTROY(_associationsKeys);
|
||||
GSWLogC("Destroy associations");
|
||||
DESTROY(associations);
|
||||
DESTROY(_associations);
|
||||
GSWLogC("Destroy contentElement");
|
||||
DESTROY(contentElement);
|
||||
DESTROY(_contentElement);
|
||||
GSWLogC("Dealloc GSWComponentReference Super");
|
||||
[super dealloc];
|
||||
GSWLogC("End Dealloc GSWComponentReference");
|
||||
|
@ -96,91 +104,93 @@ static char rcsId[] = "$Id$";
|
|||
-(NSString*)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@ %p name:%@ associationsKeys:%@ associations:%@ contentElement:%@>",
|
||||
[self class],
|
||||
(void*)self,
|
||||
name,
|
||||
associationsKeys,
|
||||
associations,
|
||||
contentElement];
|
||||
[self class],
|
||||
(void*)self,
|
||||
_name,
|
||||
_associationsKeys,
|
||||
_associations,
|
||||
_contentElement];
|
||||
};
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@implementation GSWComponentReference (GSWComponentReferenceA)
|
||||
-(void)popRefComponentInContext:(GSWContext*)_context
|
||||
-(void)popRefComponentInContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
GSWComponent* _subComponent=nil;
|
||||
GSWComponent* _component=nil;
|
||||
GSWComponent* subComponent=nil;
|
||||
GSWComponent* component=nil;
|
||||
LOGObjectFnStart();
|
||||
_subComponent=[_context component];
|
||||
_component=[_subComponent parent];
|
||||
[_subComponent synchronizeComponentToParent];
|
||||
[_context _setCurrentComponent:_component];
|
||||
subComponent=[context component];
|
||||
component=[subComponent parent];
|
||||
[subComponent synchronizeComponentToParent];
|
||||
[context _setCurrentComponent:component];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)pushRefComponentInContext:(GSWContext*)_context
|
||||
-(void)pushRefComponentInContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
GSWComponent* _subComponent=nil;
|
||||
GSWComponentDefinition* _subComponentDefinition=nil;
|
||||
GSWComponent* _component=nil;
|
||||
NSString* _elementID=nil;
|
||||
GSWComponent* subComponent=nil;
|
||||
GSWComponentDefinition* subComponentDefinition=nil;
|
||||
GSWComponent* component=nil;
|
||||
NSString* elementID=nil;
|
||||
LOGObjectFnStart();
|
||||
_component=[_context component];
|
||||
_elementID=[_context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"_elementID:%@",_elementID);
|
||||
_subComponent=[_component subComponentForElementID:_elementID];
|
||||
NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent);
|
||||
if (!_subComponent)
|
||||
{
|
||||
NSArray* _languages=[_context languages];
|
||||
NSDebugMLLog(@"gswdync",@"name:%@",name);
|
||||
NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p",
|
||||
(void*)self,
|
||||
(void*)_component);
|
||||
_subComponentDefinition=[GSWApp componentDefinitionWithName:name
|
||||
languages:_languages];
|
||||
NSDebugMLLog(@"gswdync",@"_subComponentDefinition=%@",_subComponentDefinition);
|
||||
if (_subComponentDefinition)
|
||||
{
|
||||
_subComponent=[_subComponentDefinition componentInstanceInContext:_context];
|
||||
NSDebugMLLog(@"gswdync",@"_subComponent:%@",_subComponent);
|
||||
if (_subComponent)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p",
|
||||
(void*)self,
|
||||
(void*)_component,
|
||||
(void*)_subComponent);
|
||||
[_subComponent setParent:_component
|
||||
associationsKeys:associationsKeys
|
||||
associations:associations
|
||||
template:contentElement];
|
||||
}
|
||||
else
|
||||
{
|
||||
ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'",name);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'",name);
|
||||
};
|
||||
if (_subComponent)
|
||||
{
|
||||
[_component setSubComponent:_subComponent
|
||||
forElementID:_elementID];
|
||||
[_subComponent awakeInContext:_context];
|
||||
};
|
||||
};
|
||||
if (_subComponent)
|
||||
{
|
||||
[_subComponent synchronizeParentToComponent];
|
||||
};
|
||||
[_context _setCurrentComponent:_subComponent];
|
||||
component=[context component];
|
||||
elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"_elementID:%@",elementID);
|
||||
subComponent=[component subComponentForElementID:elementID];
|
||||
NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent);
|
||||
if (!subComponent)
|
||||
{
|
||||
NSArray* languages=[context languages];
|
||||
NSDebugMLLog(@"gswdync",@"name:%@",_name);
|
||||
NSDebugMLLog(@"gswdync",@"pushRefComponentInContext comporef=%p parent=%p",
|
||||
(void*)self,
|
||||
(void*)component);
|
||||
subComponentDefinition=[GSWApp componentDefinitionWithName:_name
|
||||
languages:languages];
|
||||
NSDebugMLLog(@"gswdync",@"subComponentDefinition=%@",subComponentDefinition);
|
||||
if (subComponentDefinition)
|
||||
{
|
||||
subComponent=[subComponentDefinition componentInstanceInContext:context];
|
||||
NSDebugMLLog(@"gswdync",@"subComponent:%@",subComponent);
|
||||
if (subComponent)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"SETPARENT comporef=%p parent=%p component=%p",
|
||||
(void*)self,
|
||||
(void*)component,
|
||||
(void*)subComponent);
|
||||
[subComponent setParent:component
|
||||
associationsKeys:_associationsKeys
|
||||
associations:_associations
|
||||
template:_contentElement];
|
||||
}
|
||||
else
|
||||
{
|
||||
ExceptionRaise(@"GSWComponentReference: subcomponent instance creation failed in '@'",
|
||||
_name);
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
ExceptionRaise(@"GSWComponentReference: can't find subcomponent definition in '@'",
|
||||
_name);
|
||||
};
|
||||
if (subComponent)
|
||||
{
|
||||
[component setSubComponent:subComponent
|
||||
forElementID:elementID];
|
||||
[subComponent awakeInContext:context];
|
||||
};
|
||||
};
|
||||
if (subComponent)
|
||||
{
|
||||
[subComponent synchronizeParentToComponent];
|
||||
};
|
||||
[context _setCurrentComponent:subComponent];
|
||||
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -191,99 +201,105 @@ static char rcsId[] = "$Id$";
|
|||
@implementation GSWComponentReference (GSWRequestHandling)
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)appendToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
GSWComponent* _component=nil;
|
||||
GSWComponent* _componentPrev=nil;
|
||||
GSWComponent* component=nil;
|
||||
GSWComponent* componentPrev=nil;
|
||||
#ifndef NDEBBUG
|
||||
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb];
|
||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
GSWSaveAppendToResponseElementID(context_);//Debug Only
|
||||
_componentPrev=[context_ component];
|
||||
[self pushRefComponentInContext:context_];
|
||||
if ([context_ component])
|
||||
{
|
||||
_component=[context_ component];
|
||||
[_component appendToResponse:response_
|
||||
inContext:context_];
|
||||
[self popRefComponentInContext:context_];
|
||||
}
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
[response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",
|
||||
[self definitionName],
|
||||
[context elementID]]];
|
||||
componentPrev=[context component];
|
||||
[self pushRefComponentInContext:context];
|
||||
if ([context component])
|
||||
{
|
||||
component=[context component];
|
||||
[component appendToResponse:response
|
||||
inContext:context];
|
||||
[self popRefComponentInContext:context];
|
||||
}
|
||||
else
|
||||
[context_ _setCurrentComponent:_componentPrev];
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
[context _setCurrentComponent:componentPrev];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],
|
||||
@"GSWComponentReference appendToResponse: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWComponentReference appendToResponse: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
GSWElement* _element=nil;
|
||||
GSWComponent* _component=nil;
|
||||
GSWComponent* _componentPrev=nil;
|
||||
GSWElement* element=nil;
|
||||
GSWComponent* component=nil;
|
||||
GSWComponent* componentPrev=nil;
|
||||
#ifndef NDEBBUG
|
||||
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb];
|
||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
||||
_componentPrev=[context_ component];
|
||||
GSWAssertCorrectElementID(context_);// Debug Only
|
||||
[self pushRefComponentInContext:context_];
|
||||
if ([context_ component])
|
||||
{
|
||||
if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component
|
||||
{
|
||||
_component=[context_ component];
|
||||
_element=[_component invokeActionForRequest:request_
|
||||
inContext:context_];
|
||||
};
|
||||
[self popRefComponentInContext:context_];
|
||||
}
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
NSDebugMLLog(@"gswdync",@"senderId=%@",[context senderID]);
|
||||
componentPrev=[context component];
|
||||
[self pushRefComponentInContext:context];
|
||||
if ([context component])
|
||||
{
|
||||
if ([self prefixMatchSenderIDInContext:context]) //Avoid trying to find action if we are not the good component
|
||||
{
|
||||
component=[context component];
|
||||
element=[component invokeActionForRequest:request
|
||||
inContext:context];
|
||||
};
|
||||
[self popRefComponentInContext:context];
|
||||
}
|
||||
else
|
||||
[context_ _setCurrentComponent:_componentPrev];
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
[context _setCurrentComponent:componentPrev];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference invokeActionForRequest: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWComponentReference invokeActionForRequest: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
return _element;
|
||||
return element;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
GSWComponent* _component=nil;
|
||||
GSWComponent* _componentPrev=nil;
|
||||
GSWComponent* component=nil;
|
||||
GSWComponent* componentPrev=nil;
|
||||
#ifndef NDEBBUG
|
||||
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb];
|
||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
GSWAssertCorrectElementID(context_);// Debug Only
|
||||
_componentPrev=[context_ component];
|
||||
[self pushRefComponentInContext:context_];
|
||||
if ([context_ component])
|
||||
{
|
||||
_component=[context_ component];
|
||||
[_component takeValuesFromRequest:request_
|
||||
inContext:context_];
|
||||
[self popRefComponentInContext:context_];
|
||||
}
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
componentPrev=[context component];
|
||||
[self pushRefComponentInContext:context];
|
||||
if ([context component])
|
||||
{
|
||||
component=[context component];
|
||||
[component takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
[self popRefComponentInContext:context];
|
||||
}
|
||||
else
|
||||
[context_ _setCurrentComponent:_componentPrev];
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
[context _setCurrentComponent:componentPrev];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWComponentReference takeValuesFromRequest: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWComponentReference takeValuesFromRequest: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWConditional.h - GSWeb: Class GSWConditional
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWConditional.h - <title>GSWeb: Class GSWConditional</title>
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,17 +38,17 @@
|
|||
//====================================================================
|
||||
@interface GSWConditional: GSWDynamicElement
|
||||
{
|
||||
GSWAssociation* condition;
|
||||
GSWAssociation* negate;
|
||||
GSWHTMLStaticGroup* childrenGroup;
|
||||
GSWAssociation* _condition;
|
||||
GSWAssociation* _negate;
|
||||
GSWHTMLStaticGroup* _childrenGroup;
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement;
|
||||
|
||||
-(NSString*)description;
|
||||
-(void)dealloc;
|
||||
|
@ -48,14 +56,14 @@
|
|||
|
||||
//====================================================================
|
||||
@interface GSWConditional (GSWConditionalA)
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWConditional.m - GSWeb: Class GSWConditional
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWConditional.m - <title>GSWeb: Class GSWConditional</title>
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -29,38 +37,41 @@ static char rcsId[] = "$Id$";
|
|||
@implementation GSWConditional
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)someAssociations
|
||||
template:(GSWElement*)templateElement_
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)someAssociations
|
||||
template:(GSWElement*)templateElement
|
||||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
self=[self initWithName:name_
|
||||
associations:someAssociations
|
||||
contentElements:templateElement_ ? [NSArray arrayWithObject:templateElement_] : nil];
|
||||
if ((self=[self initWithName:aName
|
||||
associations:someAssociations
|
||||
contentElements:templateElement ? [NSArray arrayWithObject:templateElement] : nil]))
|
||||
{
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)_elements
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
if ((self=[super initWithName:name_
|
||||
associations:nil
|
||||
template:nil]))
|
||||
{
|
||||
if (_elements)
|
||||
childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:_elements];
|
||||
condition = [[associations_ objectForKey:condition__Key
|
||||
withDefaultObject:[condition autorelease]] retain];
|
||||
NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",condition);
|
||||
negate = [[associations_ objectForKey:negate__Key
|
||||
withDefaultObject:[negate autorelease]] retain];
|
||||
NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",negate);
|
||||
};
|
||||
if ((self=[super initWithName:aName
|
||||
associations:nil
|
||||
template:nil]))
|
||||
{
|
||||
if (elements)
|
||||
_childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
|
||||
|
||||
_condition = [[associations objectForKey:condition__Key
|
||||
withDefaultObject:[_condition autorelease]] retain];
|
||||
NSDebugMLLog(@"gswdync",@"GSWConditional condition=%@",_condition);
|
||||
_negate = [[associations objectForKey:negate__Key
|
||||
withDefaultObject:[_negate autorelease]] retain];
|
||||
NSDebugMLLog(@"gswdync",@"GSWConditional negate=%@",_negate);
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
};
|
||||
|
@ -68,11 +79,20 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
DESTROY(condition);
|
||||
DESTROY(negate);
|
||||
DESTROY(_condition);
|
||||
DESTROY(_negate);
|
||||
DESTROY(_childrenGroup);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)setDefinitionName:(NSString*)definitionName
|
||||
{
|
||||
[super setDefinitionName:definitionName];
|
||||
if (definitionName && _childrenGroup)
|
||||
[_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
{
|
||||
|
@ -85,123 +105,126 @@ static char rcsId[] = "$Id$";
|
|||
@implementation GSWConditional (GSWConditionalA)
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext
|
||||
{
|
||||
//OK
|
||||
BOOL _condition=NO;
|
||||
BOOL _negate=NO;
|
||||
BOOL _doIt=NO;
|
||||
BOOL condition=NO;
|
||||
BOOL negate=NO;
|
||||
BOOL doIt=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
GSWAssertCorrectElementID(context_);// Debug Only
|
||||
_condition=[self evaluateCondition:condition
|
||||
inContext:context_];
|
||||
_negate=[self evaluateCondition:negate
|
||||
inContext:context_];
|
||||
_doIt=_condition;
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ elementID]);
|
||||
if (_negate)
|
||||
_doIt=!_doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s",
|
||||
GSWStartElement(aContext);
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
condition=[self evaluateCondition:_condition
|
||||
inContext:aContext];
|
||||
negate=[self evaluateCondition:_negate
|
||||
inContext:aContext];
|
||||
doIt=condition;
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
|
||||
if (negate)
|
||||
doIt=!doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s",
|
||||
[self definitionName],
|
||||
condition,
|
||||
negate,
|
||||
(_condition ? "YES" : "NO"),
|
||||
(_negate ? "YES" : "NO"),
|
||||
(_doIt ? "YES" : "NO"));
|
||||
if (_doIt)
|
||||
{
|
||||
GSWRequest* _request=[context_ request];
|
||||
BOOL _isFromClientComponent=[_request isFromClientComponent];
|
||||
[context_ appendZeroElementIDComponent];
|
||||
[childrenGroup takeValuesFromRequest:request_
|
||||
inContext:context_];
|
||||
[context_ deleteLastElementIDComponent];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_
|
||||
{
|
||||
//OK
|
||||
GSWElement* _element=nil;
|
||||
BOOL _condition=NO;
|
||||
BOOL _negate=NO;
|
||||
BOOL _doIt=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
||||
GSWAssertCorrectElementID(context_);// Debug Only
|
||||
_condition=[self evaluateCondition:condition
|
||||
inContext:context_];
|
||||
_negate=[self evaluateCondition:negate
|
||||
inContext:context_];
|
||||
_doIt=_condition;
|
||||
if (_negate)
|
||||
_doIt=!_doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s",
|
||||
[self definitionName],
|
||||
condition,
|
||||
negate,
|
||||
(_condition ? "YES" : "NO"),
|
||||
(_negate ? "YES" : "NO"),
|
||||
(_doIt ? "YES" : "NO"));
|
||||
if (_doIt)
|
||||
_condition,
|
||||
_negate,
|
||||
(condition ? "YES" : "NO"),
|
||||
(negate ? "YES" : "NO"),
|
||||
(doIt ? "YES" : "NO"));
|
||||
if (doIt)
|
||||
{
|
||||
GSWRequest* _request=[context_ request];
|
||||
BOOL _isFromClientComponent=[_request isFromClientComponent];
|
||||
[context_ appendZeroElementIDComponent];
|
||||
NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup);
|
||||
_element=[childrenGroup invokeActionForRequest:request_
|
||||
inContext:context_];
|
||||
NSDebugMLLog(@"gswdync",@"_element=%@",_element);
|
||||
[context_ deleteLastElementIDComponent];
|
||||
GSWRequest* _request=[aContext request];
|
||||
BOOL isFromClientComponent=[_request isFromClientComponent];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
[_childrenGroup takeValuesFromRequest:aRequest
|
||||
inContext:aContext];
|
||||
[aContext deleteLastElementIDComponent];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
GSWStopElement(aContext);
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
return _element;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext
|
||||
{
|
||||
//OK
|
||||
BOOL _condition=NO;
|
||||
BOOL _negate=NO;
|
||||
BOOL _doIt=NO;
|
||||
GSWElement* element=nil;
|
||||
BOOL condition=NO;
|
||||
BOOL negate=NO;
|
||||
BOOL doIt=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
GSWSaveAppendToResponseElementID(context_);//Debug Only
|
||||
_condition=[self evaluateCondition:condition
|
||||
inContext:context_];
|
||||
NSDebugMLLog(@"gswdync",@"_condition=%s",_condition ? "YES" : "NO");
|
||||
_negate=[self evaluateCondition:negate
|
||||
inContext:context_];
|
||||
NSDebugMLLog(@"gswdync",@"_negate=%s",_negate ? "YES" : "NO");
|
||||
_doIt=_condition;
|
||||
if (_negate)
|
||||
_doIt=!_doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s _doIt=%s",
|
||||
GSWStartElement(aContext);
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
condition=[self evaluateCondition:_condition
|
||||
inContext:aContext];
|
||||
negate=[self evaluateCondition:_negate
|
||||
inContext:aContext];
|
||||
doIt=condition;
|
||||
if (negate)
|
||||
doIt=!doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s",
|
||||
[self definitionName],
|
||||
condition,
|
||||
negate,
|
||||
(_condition ? "YES" : "NO"),
|
||||
(_negate ? "YES" : "NO"),
|
||||
(_doIt ? "YES" : "NO"));
|
||||
if (_doIt)
|
||||
{
|
||||
GSWRequest* _request=[context_ request];
|
||||
BOOL _isFromClientComponent=[_request isFromClientComponent];
|
||||
[context_ appendZeroElementIDComponent];
|
||||
[childrenGroup appendToResponse:response_
|
||||
inContext:context_];
|
||||
[context_ deleteLastElementIDComponent];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||
_condition,
|
||||
_negate,
|
||||
(condition ? "YES" : "NO"),
|
||||
(negate ? "YES" : "NO"),
|
||||
(doIt ? "YES" : "NO"));
|
||||
if (doIt)
|
||||
{
|
||||
GSWRequest* request=[aContext request];
|
||||
BOOL isFromClientComponent=[request isFromClientComponent];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
NSDebugMLLog(@"gswdync",@"childrenGroup=%@",_childrenGroup);
|
||||
element=[_childrenGroup invokeActionForRequest:aRequest
|
||||
inContext:aContext];
|
||||
NSDebugMLLog(@"gswdync",@"element=%@",element);
|
||||
[aContext deleteLastElementIDComponent];
|
||||
};
|
||||
GSWStopElement(aContext);
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
return element;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext
|
||||
{
|
||||
//OK
|
||||
BOOL condition=NO;
|
||||
BOOL negate=NO;
|
||||
BOOL doIt=NO;
|
||||
LOGObjectFnStart();
|
||||
GSWStartElement(aContext);
|
||||
GSWSaveAppendToResponseElementID(aContext);
|
||||
condition=[self evaluateCondition:_condition
|
||||
inContext:aContext];
|
||||
NSDebugMLLog(@"gswdync",@"condition=%s",condition ? "YES" : "NO");
|
||||
negate=[self evaluateCondition:_negate
|
||||
inContext:aContext];
|
||||
NSDebugMLLog(@"gswdync",@"negate=%s",negate ? "YES" : "NO");
|
||||
doIt=condition;
|
||||
if (negate)
|
||||
doIt=!doIt;
|
||||
NSDebugMLLog(@"gswdync",@"defname=%@ condition=%@ negate=%@ evaluatedCondition=%s evaluatedNegate=%s doIt=%s",
|
||||
[self definitionName],
|
||||
_condition,
|
||||
_negate,
|
||||
(condition ? "YES" : "NO"),
|
||||
(negate ? "YES" : "NO"),
|
||||
(doIt ? "YES" : "NO"));
|
||||
if (doIt)
|
||||
{
|
||||
GSWRequest* request=[aContext request];
|
||||
BOOL isFromClientComponent=[request isFromClientComponent];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
[_childrenGroup appendToResponse:aResponse
|
||||
inContext:aContext];
|
||||
[aContext deleteLastElementIDComponent];
|
||||
};
|
||||
GSWStopElement(aContext);
|
||||
GSWAssertIsElementID(aContext);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
|
|
@ -54,6 +54,11 @@
|
|||
BOOL formSubmitted;
|
||||
BOOL isMultipleSubmitForm;
|
||||
BOOL isValidate;
|
||||
#ifndef NDEBUG
|
||||
int _loopLevel; //ForDebugging purpose: each repetition increment and next decrement it
|
||||
NSMutableString* _docStructure; //ForDebugging purpose: array of all objects if the document during appendResponse, takeValues, invokeAction
|
||||
NSMutableSet* _docStructureElements;
|
||||
#endif
|
||||
};
|
||||
|
||||
-(id)init;
|
||||
|
@ -75,6 +80,14 @@
|
|||
-(NSString*)contextID;
|
||||
-(id)initWithRequest:(GSWRequest*)_request;
|
||||
|
||||
#ifndef NDEBUG
|
||||
-(void)incrementLoopLevel; //ForDebugging purpose: each repetition increment and next decrement it
|
||||
-(void)decrementLoopLevel;
|
||||
-(BOOL)isInLoop;
|
||||
-(void)addToDocStructureElement:(id)element;
|
||||
-(void)addDocStructureStep:(NSString*)stepLabel;
|
||||
-(NSString*)docStructure;
|
||||
#endif
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -75,6 +75,10 @@ static int dontTraceComponentActionURL=0;
|
|||
DESTROY(url);
|
||||
NSDebugFLog0(@"Release GSWContext awakePageComponents");
|
||||
DESTROY(awakePageComponents);
|
||||
#ifndef NDEBUG
|
||||
DESTROY(_docStructure);
|
||||
DESTROY(_docStructureElements);
|
||||
#endif
|
||||
NSDebugFLog0(@"Dealloc GSWContext super");
|
||||
[super dealloc];
|
||||
NSDebugFLog0(@"end Dealloc GSWContext");
|
||||
|
@ -254,6 +258,68 @@ static int dontTraceComponentActionURL=0;
|
|||
return senderID;
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
-(void)incrementLoopLevel //ForDebugging purpose: each repetition increment and next decrement it
|
||||
{
|
||||
_loopLevel++;
|
||||
};
|
||||
-(void)decrementLoopLevel
|
||||
{
|
||||
_loopLevel--;
|
||||
};
|
||||
-(BOOL)isInLoop
|
||||
{
|
||||
return _loopLevel>0;
|
||||
};
|
||||
|
||||
-(void)addToDocStructureElement:(id)element
|
||||
{
|
||||
if(GSDebugSet(@"GSWDocStructure"))
|
||||
{
|
||||
NSString* string=nil;
|
||||
int elementIDNb=[[self elementID] elementsNb];
|
||||
NSMutableData* data=[NSMutableData dataWithCapacity:elementIDNb+1];
|
||||
if (!_docStructure)
|
||||
_docStructure=[NSMutableString new];
|
||||
if (!_docStructureElements)
|
||||
_docStructureElements=[NSMutableSet new];
|
||||
char* ptab=(char*)[data bytes];
|
||||
memset(ptab,'\t',elementIDNb);
|
||||
ptab[elementIDNb]='\0';
|
||||
string=[NSString stringWithFormat:@"%s %@ Element %p Class %@ defName=%@\n",
|
||||
ptab,
|
||||
[self elementID],
|
||||
element,
|
||||
[element class],
|
||||
[element definitionName]];
|
||||
if (![_docStructureElements containsObject:string])
|
||||
{
|
||||
[_docStructure appendString:string];
|
||||
[_docStructureElements addObject:string];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
-(void)addDocStructureStep:(NSString*)stepLabel
|
||||
{
|
||||
if(GSDebugSet(@"GSWDocStructure"))
|
||||
{
|
||||
if (!_docStructure)
|
||||
_docStructure=[NSMutableString new];
|
||||
[_docStructureElements removeAllObjects];
|
||||
[_docStructure appendFormat:@"===== %@ =====\n",stepLabel];
|
||||
};
|
||||
}
|
||||
|
||||
-(NSString*)docStructure
|
||||
{
|
||||
if(GSDebugSet(@"GSWDocStructure"))
|
||||
return _docStructure;
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
- (void)editingContext:(id)editingContext_
|
||||
presentErrorMessage:(id)msg;
|
||||
- (id)insert;
|
||||
- (id)insertAfterLastObject;
|
||||
- (NSDictionary *)insertedObjectDefaultValues;
|
||||
- (void)insertObject:object_
|
||||
atIndex:(unsigned)index;
|
||||
|
@ -175,6 +176,7 @@
|
|||
- (void)setSelectedObject:(id)object;
|
||||
- (NSArray *)selectedObjects;
|
||||
- (NSArray *)selectionIndexes;
|
||||
- (id)selectFirst;
|
||||
- (id)selectNext;
|
||||
- (BOOL)selectObject:(id)object;
|
||||
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects;
|
||||
|
|
|
@ -660,7 +660,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
LOGObjectFnStart();
|
||||
[self deleteSelection];
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -732,33 +732,33 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
}
|
||||
if (result)
|
||||
{
|
||||
NS_DURING
|
||||
{
|
||||
enumerator = [_selectedObjects objectEnumerator];
|
||||
while((object = [enumerator nextObject]))
|
||||
{
|
||||
[_dataSource deleteObject:object];
|
||||
|
||||
[_displayedObjects removeObjectIdenticalTo:object];
|
||||
[_allObjects removeObjectIdenticalTo:object];
|
||||
|
||||
if(_delegateRespondsTo.didDeleteObject == YES)
|
||||
[delegate displayGroup:self
|
||||
didDeleteObject:object];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object");
|
||||
NSLog(@"object : %@", object);
|
||||
NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n",
|
||||
localException,
|
||||
[localException description],
|
||||
[localException name],
|
||||
[localException reason]);
|
||||
delete = NO;
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
NS_DURING
|
||||
{
|
||||
enumerator = [_selectedObjects objectEnumerator];
|
||||
while((object = [enumerator nextObject]))
|
||||
{
|
||||
[_dataSource deleteObject:object];
|
||||
|
||||
[_displayedObjects removeObjectIdenticalTo:object];
|
||||
[_allObjects removeObjectIdenticalTo:object];
|
||||
|
||||
if(_delegateRespondsTo.didDeleteObject == YES)
|
||||
[delegate displayGroup:self
|
||||
didDeleteObject:object];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"GSWDisplayGroup (deleteSelection:) Can't delete object");
|
||||
NSLog(@"object : %@", object);
|
||||
NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n",
|
||||
localException,
|
||||
[localException description],
|
||||
[localException name],
|
||||
[localException reason]);
|
||||
delete = NO;
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
};
|
||||
|
||||
[self clearSelection];
|
||||
|
@ -841,7 +841,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
[self clearSelection];
|
||||
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -884,7 +884,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
[self clearSelection];
|
||||
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -903,7 +903,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
LOGObjectFnStart();
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
LOGObjectFnStop();
|
||||
return nil;
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -919,9 +919,9 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:@"WODisplayGroupWillFetch" //TODO Name
|
||||
object:self];
|
||||
undoManager=[self undoManager];//<EOUndoManager: 0x1832190> //WO45P3
|
||||
[undoManager removeAllActionsWithTarget:self];//WO45P3
|
||||
[_dataSource setQualifierBindings:_queryBindings];//WO45P3
|
||||
undoManager=[self undoManager];
|
||||
[undoManager removeAllActionsWithTarget:self];
|
||||
[_dataSource setQualifierBindings:_queryBindings];
|
||||
|
||||
if(_delegateRespondsTo.shouldFetchObjects == YES)
|
||||
fetch = [delegate displayGroupShouldFetch:self];
|
||||
|
@ -930,7 +930,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
{
|
||||
NSArray *objects=nil;
|
||||
|
||||
objects = [_dataSource fetchObjects];//OK WO45P3
|
||||
objects = [_dataSource fetchObjects];
|
||||
[self setObjectArray:objects];//OK
|
||||
[self _notify:@selector(displayGroup:didFetchObjects:)
|
||||
with:self
|
||||
|
@ -941,7 +941,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
*/
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME ??
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -1040,15 +1040,22 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
if([_selection count])
|
||||
index = [[_selection objectAtIndex:0] unsignedIntValue]+1;
|
||||
|
||||
if(!count)
|
||||
index = 0;
|
||||
if((count <= index) && count>0)
|
||||
index = count - 1;
|
||||
index=max(0,index);
|
||||
index=min(count,index);
|
||||
|
||||
NSDebugMLog(@"INSERT Index=%d",index);
|
||||
[self insertObjectAtIndex:index];
|
||||
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
- (id)insertAfterLastObject
|
||||
{
|
||||
int index= [_allObjects count];
|
||||
return [self insertObjectAtIndex:index];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -1087,8 +1094,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
[delegate displayGroup:self
|
||||
didInsertObject:anObject];
|
||||
|
||||
[self setSelectionIndexes:
|
||||
[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
|
||||
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1266,7 +1272,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
|
||||
NSDebugMLLog(@"gswdisplaygroup",@"_dataSource=%@",_dataSource);
|
||||
[_dataSource setAuxiliaryQualifier:qualifier];//OK
|
||||
|
||||
|
||||
NSDebugMLLog0(@"gswdisplaygroup",@"Will fetch");
|
||||
[self fetch];//OK use ret Value ?
|
||||
NSDebugMLLog0(@"gswdisplaygroup",@"End fetch");
|
||||
|
@ -1400,6 +1406,20 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
return _selection;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// selectFirst
|
||||
|
||||
- (id)selectFirst
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
|
||||
if([_allObjects count]>0)
|
||||
{
|
||||
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]];
|
||||
};
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// selectNext
|
||||
|
||||
|
@ -1412,8 +1432,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
if([_allObjects count]>0)
|
||||
{
|
||||
if(![_selectedObjects count])
|
||||
[self setSelectionIndexes:
|
||||
[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]];
|
||||
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:0]]];
|
||||
else
|
||||
{
|
||||
obj = [_selectedObjects objectAtIndex:0];
|
||||
|
@ -1441,7 +1460,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
};
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return nil;//FIXME
|
||||
return nil;//return nil for direct .gswd actions ==> same page
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -1911,7 +1930,7 @@ STOP ?
|
|||
BOOL stop = NO;
|
||||
BOOL retValue=NO;
|
||||
LOGObjectFnStart();
|
||||
//call selectedObjects //0x1a38b78
|
||||
//call selectedObjects //
|
||||
if(_delegateRespondsTo.shouldChangeSelection == YES
|
||||
&& [delegate displayGroup:self
|
||||
shouldChangeSelectionToIndexes:selection_] == NO)
|
||||
|
@ -2006,9 +2025,10 @@ STOP ?
|
|||
NSEnumerator *objsEnum=nil;
|
||||
id object=nil;
|
||||
LOGObjectFnStart();
|
||||
|
||||
//TODO
|
||||
//self selectedObjects //() 0x1a38b78
|
||||
//self allObjects 0x27cadf8
|
||||
//self selectedObjects //()
|
||||
//self allObjects
|
||||
//self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0
|
||||
//self redisplay
|
||||
//STOP
|
||||
|
@ -2016,30 +2036,29 @@ STOP ?
|
|||
|
||||
if(_delegateRespondsTo.displayArrayForObjects == YES)
|
||||
{
|
||||
[_displayedObjects
|
||||
addObjectsFromArray:[delegate displayGroup:self
|
||||
displayArrayForObjects:_allObjects]];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(_qualifier)
|
||||
{
|
||||
objsEnum = [_allObjects objectEnumerator];
|
||||
while((object = [objsEnum nextObject]))
|
||||
{
|
||||
if([_qualifier evaluateWithObject:object] == YES)
|
||||
[_displayedObjects addObject:object];
|
||||
}
|
||||
[_displayedObjects addObjectsFromArray:[delegate displayGroup:self
|
||||
displayArrayForObjects:_allObjects]];
|
||||
}
|
||||
else
|
||||
{
|
||||
_batchIndex = [self batchCount];
|
||||
[self displayNextBatch];
|
||||
}
|
||||
|
||||
if(_sortOrdering)
|
||||
[_displayedObjects sortUsingKeyOrderArray:_sortOrdering];
|
||||
if(_qualifier)
|
||||
{
|
||||
objsEnum = [_allObjects objectEnumerator];
|
||||
while((object = [objsEnum nextObject]))
|
||||
{
|
||||
if([_qualifier evaluateWithObject:object] == YES)
|
||||
[_displayedObjects addObject:object];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_batchIndex = [self batchCount];
|
||||
[self displayNextBatch];
|
||||
}
|
||||
|
||||
if(_sortOrdering)
|
||||
[_displayedObjects sortUsingKeyOrderArray:_sortOrdering];
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
//====================================================================
|
||||
@interface GSWDynamicElement : GSWElement
|
||||
{
|
||||
NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name
|
||||
|
|
|
@ -55,26 +55,11 @@ static char rcsId[] = "$Id$";
|
|||
GSWLogAssertGood(self);
|
||||
GSWLogC("Dealloc GSWDynamicElement");
|
||||
GSWLogC("Dealloc GSWDynamicElement: name");
|
||||
DESTROY(_definitionName);
|
||||
GSWLogC("Dealloc GSWDynamicElement Super");
|
||||
[super dealloc];
|
||||
GSWLogC("End Dealloc GSWDynamicElement");
|
||||
}
|
||||
|
||||
-(NSString*)definitionName
|
||||
{
|
||||
return _definitionName;
|
||||
};
|
||||
|
||||
-(void)setDefinitionName:(NSString*)definitionName
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"setDefinitionName1 in %p: %p %@",
|
||||
self,definitionName,definitionName);
|
||||
ASSIGN(_definitionName,definitionName);
|
||||
NSDebugMLLog(@"gswdync",@"setDefinitionName2 in %p: %p %@",
|
||||
self,_definitionName,_definitionName);
|
||||
};
|
||||
|
||||
@end
|
||||
//====================================================================
|
||||
@implementation GSWDynamicElement (GSWDynamicElement)
|
||||
|
|
|
@ -43,28 +43,53 @@ extern BYTE ElementsMap_attributeElement;
|
|||
#ifndef NDEBBUG
|
||||
{
|
||||
NSString* _appendToResponseElementID;
|
||||
NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef NDEBBUG
|
||||
-(void)saveAppendToResponseElementIDInContext:(id)context;
|
||||
-(void)assertCorrectElementIDInContext:(id)context
|
||||
inCLass:(Class)class
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line;
|
||||
-(void)assertIsElementIDInContext:(id)context
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line;
|
||||
-(void)logElementInContext:(id)context
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line
|
||||
startFlag:(BOOL)start
|
||||
stopFlag:(BOOL)stop;
|
||||
#endif
|
||||
|
||||
-(NSString*)definitionName; //return nil (for non dynamic element)
|
||||
-(NSString*)definitionName;
|
||||
@end
|
||||
|
||||
#ifdef NDEBBUG
|
||||
#define GSWSaveAppendToResponseElementID(context_); {};
|
||||
#define GSWAssertCorrectElementID(context_); {};
|
||||
#define GSWSaveAppendToResponseElementID(TheContext); {};
|
||||
#define GSWAssertCorrectElementID(TheContext); {};
|
||||
#define GSWAssertIsElementID(TheContext); {};
|
||||
#define GSWStartElement(TheContext); {};
|
||||
#define GSWStopElement(TheContext); {};
|
||||
#define GSWAddElementToDocStructure(TheContext); {};
|
||||
#else
|
||||
#define GSWSaveAppendToResponseElementID(context_); [self saveAppendToResponseElementIDInContext:context_];
|
||||
#define GSWAssertCorrectElementID(context_); \
|
||||
([self assertCorrectElementIDInContext:context_ inCLass:[self class] method:_cmd file:__FILE__ line:__LINE__]);
|
||||
#define GSWSaveAppendToResponseElementID(TheContext); [self saveAppendToResponseElementIDInContext:TheContext];
|
||||
#define GSWAssertCorrectElementID(TheContext); \
|
||||
([self assertCorrectElementIDInContext:TheContext method:_cmd file:__FILE__ line:__LINE__]);
|
||||
#define GSWAssertIsElementID(TheContext); \
|
||||
([self assertIsElementIDInContext:TheContext method:_cmd file:__FILE__ line:__LINE__]);
|
||||
#define GSWStartElement(TheContext); \
|
||||
([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:YES stopFlag:NO]);
|
||||
#define GSWStopElement(TheContext); \
|
||||
([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:NO stopFlag:YES]);
|
||||
#define GSWLogElement(TheContext); \
|
||||
([self logElementInContext:TheContext method:_cmd file:__FILE__ line:__LINE__ startFlag:NO stopFlag:NO]);
|
||||
#define GSWAddElementToDocStructure(TheContext); \
|
||||
([TheContext addToDocStructureElement:self]);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -42,46 +42,148 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
#ifndef NDEBBUG
|
||||
-(void)saveAppendToResponseElementIDInContext:(id)context
|
||||
{
|
||||
NSString* elementID=[context elementID];
|
||||
ASSIGN(_appendToResponseElementID,elementID);
|
||||
NSString* elementID=nil;
|
||||
LOGObjectFnStartC("GSWElement");
|
||||
elementID=[context elementID];
|
||||
/* if ([elementID length]==0)
|
||||
elementID=@"MARKER";*/
|
||||
NSDebugMLog(@"self=%p definitionName=%@ elementID=%@ %p",self,[self definitionName],elementID,elementID);
|
||||
ASSIGNCOPY(_appendToResponseElementID,elementID);
|
||||
NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p",self,[self definitionName],_appendToResponseElementID,_appendToResponseElementID);
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWElement");
|
||||
};
|
||||
|
||||
-(void)assertCorrectElementIDInContext:(id)context
|
||||
inCLass:(Class)class
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line
|
||||
{
|
||||
LOGObjectFnStartC("GSWElement");
|
||||
NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
_appendToResponseElementID,[_appendToResponseElementID length]);
|
||||
[self assertIsElementIDInContext:context
|
||||
method:method
|
||||
file:file
|
||||
line:line];
|
||||
NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
_appendToResponseElementID,[_appendToResponseElementID length]);
|
||||
if ([_appendToResponseElementID length]>0)
|
||||
{
|
||||
NSString* elementID=[context elementID];
|
||||
BOOL appendToResponseElementIDIsFirst=NO;
|
||||
BOOL elementIDIsFirst=NO;
|
||||
BOOL OK=YES;
|
||||
/* if ([elementID length]==0)
|
||||
elementID=@"MARKER";*/
|
||||
appendToResponseElementIDIsFirst=([_appendToResponseElementID length]==0 || [_appendToResponseElementID isEqualToString:@"0"]);
|
||||
elementIDIsFirst=([elementID length]==0 || [elementID isEqualToString:@"0"]);
|
||||
if (appendToResponseElementIDIsFirst!=elementIDIsFirst)
|
||||
if (!appendToResponseElementIDIsFirst || appendToResponseElementIDIsFirst!=elementIDIsFirst)
|
||||
{
|
||||
OK=[_appendToResponseElementID isEqualToString:elementID];
|
||||
NSDebugMLog(@"[context elementID]=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d OK=%d [context isInLoop]=%d",
|
||||
[context elementID],_appendToResponseElementID,[_appendToResponseElementID length],OK,[context isInLoop]);
|
||||
};
|
||||
if (!OK)
|
||||
if (!OK && ![context isInLoop])
|
||||
{
|
||||
NSString* msg=[NSString stringWithFormat:@"In Class %@ (file %s line %d), id %@ in %@ is not the same than in appendToResponse %@",
|
||||
NSStringFromClass(class),
|
||||
NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), id '%@' (%p) in %@ is not the same than in appendToResponse '%@' (%p)",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
file,
|
||||
line,
|
||||
[context elementID],
|
||||
[context elementID],
|
||||
NSStringFromSelector(method),
|
||||
_appendToResponseElementID,
|
||||
_appendToResponseElementID];
|
||||
NSAssert1(OK,@"%@",msg);
|
||||
//No: we may have multiple occurences NSAssert1(OK,@"%@",msg);
|
||||
NSDebugMLog(@"ELEMENT ID WARNING %@",msg);
|
||||
};
|
||||
};
|
||||
LOGObjectFnStopC("GSWElement");
|
||||
};
|
||||
|
||||
-(void)assertIsElementIDInContext:(id)context
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line
|
||||
{
|
||||
LOGObjectFnStartC("GSWElement");
|
||||
NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@",
|
||||
self,
|
||||
[self definitionName],
|
||||
_appendToResponseElementID,_appendToResponseElementID,[context elementID]);
|
||||
if (_appendToResponseElementID && [_appendToResponseElementID length]==0 && [[context elementID] length]>0)
|
||||
{
|
||||
NSString* msg=[NSString stringWithFormat:@"In Object %p Class %@ definitionName=%@ (file %s line %d), in %@ _appendToResponseElementID '%@' (%p) is not set",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
file,
|
||||
line,
|
||||
NSStringFromSelector(method),
|
||||
_appendToResponseElementID,
|
||||
_appendToResponseElementID];
|
||||
NSAssert1(NO,@"%@",msg);
|
||||
};
|
||||
LOGObjectFnStopC("GSWElement");
|
||||
};
|
||||
|
||||
-(void)logElementInContext:(id)context
|
||||
method:(SEL)method
|
||||
file:(const char*)file
|
||||
line:(int)line
|
||||
startFlag:(BOOL)start
|
||||
stopFlag:(BOOL)stop
|
||||
{
|
||||
NSString* senderID=[context senderID];
|
||||
if (start)
|
||||
[context addToDocStructureElement:self];
|
||||
NSDebugMLLog(@"gswdync",@"%s:.%d - %@ %s ELEMENT self=%p class=%@ defName=%@ id=%@ appendID:%@ %s%@",
|
||||
file,line,NSStringFromSelector(method),
|
||||
(start ? "START" : (stop ? "STOP" : "")),
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
[context elementID],
|
||||
_appendToResponseElementID,
|
||||
(senderID ? "senderID:" : ""),
|
||||
(senderID ? senderID : @""));
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
GSWLogAssertGood(self);
|
||||
GSWLogC("Dealloc GSWElement");
|
||||
GSWLogC("Dealloc GSWElement: name");
|
||||
DESTROY(_definitionName);
|
||||
GSWLogC("Dealloc GSWElement Super");
|
||||
[super dealloc];
|
||||
GSWLogC("End Dealloc GSWElement");
|
||||
}
|
||||
|
||||
-(NSString*)definitionName
|
||||
{
|
||||
return nil; //return nil (for non dynamic element)
|
||||
return _definitionName;
|
||||
};
|
||||
|
||||
-(void)setDefinitionName:(NSString*)definitionName
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"setDefinitionName1 in %p: %p %@",
|
||||
self,definitionName,definitionName);
|
||||
ASSIGN(_definitionName,definitionName);
|
||||
NSDebugMLLog(@"gswdync",@"setDefinitionName2 in %p: %p %@",
|
||||
self,_definitionName,_definitionName);
|
||||
};
|
||||
@end
|
||||
|
||||
|
@ -94,8 +196,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
-(void)takeValuesFromRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
GSWStartElement(context);
|
||||
GSWAddElementToDocStructure(context);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
//Does Nothing
|
||||
GSWStopElement(context);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -104,10 +209,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",
|
||||
[self class],[context elementID],[context senderID]);
|
||||
GSWStartElement(context);
|
||||
GSWAddElementToDocStructure(context);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
//Does Nothing
|
||||
GSWStopElement(context);
|
||||
return nil;
|
||||
};
|
||||
|
||||
|
@ -118,6 +224,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
inContext:(GSWContext*)context
|
||||
{
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
GSWAddElementToDocStructure(context);
|
||||
//Does Nothing
|
||||
};
|
||||
|
||||
|
@ -125,13 +232,14 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
//NDFN
|
||||
-(BOOL)prefixMatchSenderIDInContext:(GSWContext*)context
|
||||
{
|
||||
BOOL match=NO;
|
||||
NSString* senderID=[context senderID];
|
||||
NSString* elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
|
||||
NSDebugMLLog(@"gswdync",@" senderID=%@",senderID);
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
|
||||
return ([elementID hasPrefix:senderID] || [senderID hasPrefix:elementID]);
|
||||
match=([elementID hasPrefix:senderID] || [senderID hasPrefix:elementID]);
|
||||
NSDebugMLLog(@"gswdync",@"match=%s",(match ? "YES" : "NO"));
|
||||
return match;
|
||||
};
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -223,11 +223,12 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
finished=YES;
|
||||
};
|
||||
if (!over && !finished)
|
||||
/* if (!over && !finished)
|
||||
{
|
||||
if (selfElementsCount>senderIDElementsCount)
|
||||
over=YES;
|
||||
};
|
||||
*/
|
||||
};
|
||||
return over;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,8 @@ static char rcsId[] = "$Id$";
|
|||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
//Bypass GSWInput
|
||||
return nil;
|
||||
};
|
||||
|
@ -110,7 +111,8 @@ static char rcsId[] = "$Id$";
|
|||
//OK
|
||||
BOOL disabledValue=NO;
|
||||
LOGObjectFnStartC("GSWFileUpload");
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledValue=[self disabledInContext:context];
|
||||
if (!disabledValue)
|
||||
{
|
||||
|
|
|
@ -211,9 +211,11 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStartC("GSWForm");
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
[response appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",
|
||||
[self definitionName],
|
||||
[context elementID]]];
|
||||
|
||||
if (!WOStrictFlag)
|
||||
{
|
||||
|
@ -227,18 +229,19 @@ static char rcsId[] = "$Id$";
|
|||
[self appendToResponse:response
|
||||
inContext:context
|
||||
elementsFromIndex:0
|
||||
toIndex:[elementsMap length]-2];
|
||||
toIndex:[_elementsMap length]-2];
|
||||
[self _appendHiddenFieldsToResponse:response
|
||||
inContext:context];
|
||||
[self appendToResponse:response
|
||||
inContext:context
|
||||
elementsFromIndex:[elementsMap length]-1
|
||||
toIndex:[elementsMap length]-1];
|
||||
inContext:context
|
||||
elementsFromIndex:[_elementsMap length]-1
|
||||
toIndex:[_elementsMap length]-1];
|
||||
[context setInForm:NO];
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWForm appendToResponse: bad elementID");
|
||||
NSAssert3(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWForm appendToResponse: bad elementID: elementsNb=%d [context elementID]=%@ [(GSWElementIDString*)[context elementID]elementsNb]=%d",
|
||||
elementsNb,[context elementID],[(GSWElementIDString*)[context elementID]elementsNb]);
|
||||
#endif
|
||||
LOGObjectFnStopC("GSWForm");
|
||||
};
|
||||
|
@ -258,10 +261,10 @@ static char rcsId[] = "$Id$";
|
|||
BOOL multipleSubmitValue=NO;
|
||||
int i=0;
|
||||
LOGObjectFnStartC("GSWForm");
|
||||
GSWStartElement(context);
|
||||
senderID=[context senderID];
|
||||
elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@",
|
||||
[self class],[self definitionName],elementID,senderID);
|
||||
NSDebugMLLog(@"gswdync",@"senderId=%@",senderID);
|
||||
NS_DURING
|
||||
{
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
|
@ -269,9 +272,10 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
BOOL searchIsOver=NO;
|
||||
isFormSubmited=[elementID isEqualToString:senderID];
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s",
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nisFormSubmited=%s",
|
||||
[self class],
|
||||
elementID,
|
||||
[self definitionName],
|
||||
elementID,
|
||||
senderID,
|
||||
(isFormSubmited ? "YES" : "NO"));
|
||||
if (!WOStrictFlag && isFormSubmited && [self disabledInContext:context])
|
||||
|
@ -283,21 +287,20 @@ static char rcsId[] = "$Id$";
|
|||
[context _setFormSubmitted:YES];
|
||||
multipleSubmitValue=[self evaluateCondition:_multipleSubmit
|
||||
inContext:context];
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ multipleSubmit=%s",
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ defName=%@ \n id=%@ \nsenderId=%@ \nmultipleSubmit=%s",
|
||||
[self class],
|
||||
elementID,
|
||||
[self definitionName],
|
||||
elementID,
|
||||
senderID,
|
||||
(multipleSubmitValue ? "YES" : "NO"));
|
||||
[context _setIsMultipleSubmitForm:multipleSubmitValue];
|
||||
};
|
||||
[context appendZeroElementIDComponent];
|
||||
for(i=0;!element && !searchIsOver && i<[dynamicChildren count];i++)
|
||||
/*
|
||||
for(i=0;!element && !searchIsOver && i<[_dynamicChildren count];i++)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||
[[dynamicChildren objectAtIndex:i] class],
|
||||
[context elementID]);
|
||||
element=[[dynamicChildren objectAtIndex:i] invokeActionForRequest:request
|
||||
inContext:context];
|
||||
NSDebugMLLog(@"gswdync",@"i=%d",i);
|
||||
element=[[_dynamicChildren objectAtIndex:i] invokeActionForRequest:request
|
||||
inContext:context];
|
||||
// if (![context _wasFormSubmitted] && [[context elementID] compare:senderID]==NSOrderedDescending)
|
||||
if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
|
||||
{
|
||||
|
@ -308,7 +311,9 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
[context incrementLastElementIDComponent];
|
||||
};
|
||||
[context deleteLastElementIDComponent];
|
||||
*/
|
||||
element=[super invokeActionForRequest:request
|
||||
inContext:context];
|
||||
if (isFormSubmited)
|
||||
{
|
||||
if ([context _wasActionInvoked])
|
||||
|
@ -321,15 +326,13 @@ static char rcsId[] = "$Id$";
|
|||
[context _setFormSubmitted:NO];
|
||||
};
|
||||
elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ def name=%@ id=%@",
|
||||
[self class],
|
||||
[self definitionName],
|
||||
elementID);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)elementID elementsNb],
|
||||
@"GSWForm invokeActionForRequest: bad elementID");
|
||||
#endif
|
||||
GSWStopElement(context);
|
||||
};
|
||||
#ifndef NDEBBUG
|
||||
NSAssert3(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWForm invokeActionForRequest: bad elementID: elementsNb=%d [context elementID]=%@ [(GSWElementIDString*)[context elementID]elementsNb]=%d",
|
||||
elementsNb,[context elementID],[(GSWElementIDString*)[context elementID]elementsNb]);
|
||||
#endif
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
@ -369,12 +372,12 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStartC("GSWForm");
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
|
||||
senderID=[context senderID];
|
||||
elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
|
||||
if ([self prefixMatchSenderIDInContext:context]) //Avoid taking values if we are not the good form
|
||||
{
|
||||
isFormSubmited=[elementID isEqualToString:senderID];
|
||||
|
@ -388,25 +391,19 @@ static char rcsId[] = "$Id$";
|
|||
[context setInForm:YES];
|
||||
[context _setFormSubmitted:YES];
|
||||
};
|
||||
[context appendZeroElementIDComponent];
|
||||
NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",dynamicChildren);
|
||||
NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[dynamicChildren count]);
|
||||
for(i=0;i<[dynamicChildren count];i++)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[dynamicChildren objectAtIndex:i] class],[context elementID]);
|
||||
NSDebugMLLog(@"gswdync",@"\n[dynamicChildren objectAtIndex:i]=%@",[dynamicChildren objectAtIndex:i]);
|
||||
[[dynamicChildren objectAtIndex:i] takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
[context incrementLastElementIDComponent];
|
||||
};
|
||||
[context deleteLastElementIDComponent];
|
||||
NSDebugMLLog(@"gswdync",@"\n\ndynamicChildren=%@",_dynamicChildren);
|
||||
NSDebugMLLog(@"gswdync",@"[dynamicChildren count]=%d",[_dynamicChildren count]);
|
||||
|
||||
[super takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
|
||||
if (isFormSubmited)
|
||||
{
|
||||
[context setInForm:NO];
|
||||
[context _setFormSubmitted:NO];
|
||||
};
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWForm takeValuesFromRequest: bad elementID");
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWHTMLDynamicElement.h - GSWeb: Class GSWHTMLDynamicElement
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWHTMLDynamicElement.h - <title>GSWeb: Class GSWHTMLDynamicElement</title>
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,10 +38,10 @@
|
|||
//====================================================================
|
||||
@interface GSWHTMLDynamicElement: GSWDynamicElement
|
||||
{
|
||||
NSData* elementsMap;
|
||||
NSArray* htmlBareStrings;
|
||||
NSArray* dynamicChildren;
|
||||
NSArray* attributeAssociations;
|
||||
NSData* _elementsMap;
|
||||
NSArray* _htmlBareStrings;
|
||||
NSArray* _dynamicChildren;
|
||||
NSArray* _attributeAssociations;
|
||||
};
|
||||
-(NSString*)elementName;
|
||||
-(NSArray*)dynamicChildren;
|
||||
|
@ -41,64 +49,64 @@
|
|||
-(NSData*)elementsMap;
|
||||
-(NSArray*)attributeAssociations;
|
||||
|
||||
-(id)_initWithElementsMap:(NSData*)_elementsMap
|
||||
htmlBareStrings:(NSArray*)_htmlBareStrings
|
||||
dynamicChildren:(NSArray*)_dynamicChildren
|
||||
attributeAssociations:(NSArray*)_attributeAssociations;
|
||||
-(id)_initWithElementsMap:(NSData*)elementsMap
|
||||
htmlBareStrings:(NSArray*)htmlBareStrings
|
||||
dynamicChildren:(NSArray*)dynamicChildren
|
||||
attributeAssociations:(NSArray*)attributeAssociations;
|
||||
|
||||
-(id) initWithName:(NSString*)elementName_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)elementName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
|
||||
-(id) initWithName:(NSString*)elementName_
|
||||
attributeAssociations:(NSDictionary*)attributeAssociations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)elementName
|
||||
attributeAssociations:(NSDictionary*)attributeAssociations
|
||||
contentElements:(NSArray*)elements;
|
||||
|
||||
-(id) initWithName:(NSString*)elementName_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_;
|
||||
-(id)initWithName:(NSString*)elementName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement;
|
||||
|
||||
-(void)dealloc;
|
||||
|
||||
-(void)_setEndOfHTMLTag:(unsigned int)_unknown;
|
||||
-(void)_setEndOfHTMLTag:(unsigned int)unknown;
|
||||
|
||||
-(NSString*)description;
|
||||
-(void)setHtmlBareStrings:(NSArray*)_htmlBareStrings;
|
||||
-(void)setHtmlBareStrings:(NSArray*)htmlBareStrings;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementA)
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(unsigned int)GSWebObjectsAssociationsCount;
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_
|
||||
elementsFromIndex:(unsigned int)_fromIndex
|
||||
toIndex:(unsigned int)_toIndex;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext
|
||||
elementsFromIndex:(unsigned int)fromIndex
|
||||
toIndex:(unsigned int)toIndex;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementB)
|
||||
-(BOOL)compactHTMLTags;
|
||||
-(BOOL)appendStringAtRight:(id)_unkwnon
|
||||
withMapping:(char*)_mapping;
|
||||
-(BOOL)appendStringAtLeft:(id)_unkwnon
|
||||
withMapping:(char*)_mapping;
|
||||
-(BOOL)appendStringAtRight:(id)unkwnon
|
||||
withMapping:(char*)mapping;
|
||||
-(BOOL)appendStringAtLeft:(id)unkwnon
|
||||
withMapping:(char*)mapping;
|
||||
-(BOOL)canBeFlattenedAtInitialization;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWHTMLDynamicElement (GSWHTMLDynamicElementC)
|
||||
+(void)setDynamicElementCompaction:(BOOL)_flag;
|
||||
+(void)setDynamicElementCompaction:(BOOL)flag;
|
||||
+(BOOL)escapeHTML;
|
||||
+(BOOL)hasGSWebObjectsAssociations;
|
||||
@end
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -276,13 +276,9 @@ static char rcsId[] = "$Id$";
|
|||
-(NSString*)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%@ %p elementsMap:%@>",
|
||||
/* htmlBareStrings:%@ dynamicChildren:%@ elementName:%@>",*/
|
||||
[self class],
|
||||
(void*)self,
|
||||
_elementsMap];
|
||||
/* _htmlBareStrings,
|
||||
_dynamicChildren,
|
||||
_elementName];*/
|
||||
};
|
||||
|
||||
@end
|
||||
|
@ -294,12 +290,11 @@ static char rcsId[] = "$Id$";
|
|||
-(void)appendToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
//OK (verifier avec GSWSession appendToR
|
||||
//OK
|
||||
GSWRequest* request=[context request];
|
||||
BOOL isFromClientComponent=[request isFromClientComponent]; //bis repetitam
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ self=%p",
|
||||
[self class],[context elementID],self);
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
if ([_elementsMap length]>0)
|
||||
{
|
||||
[self appendToResponse:response
|
||||
|
@ -307,8 +302,8 @@ static char rcsId[] = "$Id$";
|
|||
elementsFromIndex:0
|
||||
toIndex:[_elementsMap length]-1];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@ self=%p",
|
||||
[self class],[context elementID],self);
|
||||
GSWAssertIsElementID(context);
|
||||
GSWStopElement(context);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -332,11 +327,10 @@ static char rcsId[] = "$Id$";
|
|||
fromIndex,toIndex);
|
||||
for(elementN=0;elementN<=toIndex;elementN++)
|
||||
{
|
||||
NSDebugMLog(@"appendTo self=%p elementN=%d [context elementID]=%@",self,elementN,[context elementID]);
|
||||
element=(BYTE)elements[elementN];
|
||||
if (element==ElementsMap_htmlBareString)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"%d:htmlBareString : %@",
|
||||
elementN,[_htmlBareStrings objectAtIndex:elementsN[0]]);
|
||||
if (elementN>=fromIndex)
|
||||
[response appendContentData:[[_htmlBareStrings objectAtIndex:elementsN[0]]
|
||||
dataUsingEncoding:encoding]];
|
||||
|
@ -346,11 +340,6 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
if (elementN>=fromIndex)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"%d:dynamicElement : %@",
|
||||
elementN,[aDynamicChildrensArray objectAtIndex:elementsN[1]]);
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] class],
|
||||
[context elementID]);
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] appendToResponse:response
|
||||
inContext:context];
|
||||
[context incrementLastElementIDComponent];
|
||||
|
@ -360,10 +349,10 @@ static char rcsId[] = "$Id$";
|
|||
else if (element==ElementsMap_attributeElement)
|
||||
{
|
||||
//TODO
|
||||
NSDebugMLLog(@"gswdync",@"%d:attributeElement",elementN);
|
||||
elementsN[2]++;
|
||||
};
|
||||
};
|
||||
GSWStopElement(context);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -372,46 +361,42 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//OK
|
||||
GSWElement* element=nil;
|
||||
int elementN=0;
|
||||
NSArray* aDynamicChildrensArray=[self dynamicChildren];
|
||||
const BYTE* elements=[_elementsMap bytes];
|
||||
BYTE elementIndic=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
BOOL searchIsOver=NO;
|
||||
NSString* senderID=nil;
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",
|
||||
[self class],[context elementID],[context senderID]);
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
senderID=[context senderID];
|
||||
for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++)
|
||||
if ([_elementsMap length]>0)
|
||||
{
|
||||
elementIndic=(BYTE)elements[elementN];
|
||||
if (elementIndic==ElementsMap_htmlBareString)
|
||||
elementsN[0]++;
|
||||
else if (elementIndic==ElementsMap_dynamicElement)
|
||||
NSArray* aDynamicChildrensArray=[self dynamicChildren];
|
||||
const BYTE* elements=[_elementsMap bytes];
|
||||
BYTE elementIndic=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
int elementN=0;
|
||||
for(elementN=0;!element && !searchIsOver && elementN<[_elementsMap length];elementN++)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] class],
|
||||
[context elementID]);
|
||||
element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request
|
||||
inContext:context];
|
||||
//if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending)
|
||||
if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
|
||||
elementIndic=(BYTE)elements[elementN];
|
||||
if (elementIndic==ElementsMap_htmlBareString)
|
||||
elementsN[0]++;
|
||||
else if (elementIndic==ElementsMap_dynamicElement)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over",
|
||||
[context elementID],
|
||||
senderID);
|
||||
searchIsOver=YES;
|
||||
element=[[aDynamicChildrensArray objectAtIndex:elementsN[1]] invokeActionForRequest:request
|
||||
inContext:context];
|
||||
if (![context _wasFormSubmitted] && [[context elementID] isSearchOverForSenderID:senderID])
|
||||
{
|
||||
searchIsOver=YES;
|
||||
};
|
||||
[context incrementLastElementIDComponent];
|
||||
elementsN[1]++;
|
||||
}
|
||||
else if (elementIndic==ElementsMap_attributeElement)
|
||||
{
|
||||
elementsN[2]++;
|
||||
};
|
||||
[context incrementLastElementIDComponent];
|
||||
elementsN[1]++;
|
||||
}
|
||||
else if (elementIndic==ElementsMap_attributeElement)
|
||||
{
|
||||
elementsN[2]++;
|
||||
};
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWAssertIsElementID(context);
|
||||
GSWStopElement(context);
|
||||
return element;
|
||||
};
|
||||
|
||||
|
@ -420,41 +405,37 @@ static char rcsId[] = "$Id$";
|
|||
inContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
int elementN=0;
|
||||
NSArray* aDynamicChildrensArray=[self dynamicChildren];
|
||||
const BYTE* elements=[_elementsMap bytes];
|
||||
BYTE elementIndic=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||
[self class],[context elementID]);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
for(elementN=0;elementN<[_elementsMap length];elementN++)
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
if ([_elementsMap length]>0)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"elementN=%d",elementN);
|
||||
elementIndic=(BYTE)elements[elementN];
|
||||
NSDebugMLLog(@"gswdync",@"element=%x",(unsigned int)elementIndic);
|
||||
if (elementIndic==ElementsMap_htmlBareString)
|
||||
elementsN[0]++;
|
||||
else if (elementIndic==ElementsMap_dynamicElement)
|
||||
int elementN=0;
|
||||
NSArray* aDynamicChildrensArray=[self dynamicChildren];
|
||||
const BYTE* elements=[_elementsMap bytes];
|
||||
BYTE elementIndic=0;
|
||||
int elementsN[3]={0,0,0};
|
||||
|
||||
for(elementN=0;elementN<[_elementsMap length];elementN++)
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"\n[aDynamicChildrensArray objectAtIndex:elementsN[1]=%@",
|
||||
[aDynamicChildrensArray objectAtIndex:elementsN[1]]);
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] class],
|
||||
[context elementID]);
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
[context incrementLastElementIDComponent];
|
||||
elementsN[1]++;
|
||||
}
|
||||
else if (elementIndic==ElementsMap_attributeElement)
|
||||
{
|
||||
elementsN[2]++;
|
||||
elementIndic=(BYTE)elements[elementN];
|
||||
if (elementIndic==ElementsMap_htmlBareString)
|
||||
elementsN[0]++;
|
||||
else if (elementIndic==ElementsMap_dynamicElement)
|
||||
{
|
||||
[[aDynamicChildrensArray objectAtIndex:elementsN[1]] takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
[context incrementLastElementIDComponent];
|
||||
elementsN[1]++;
|
||||
}
|
||||
else if (elementIndic==ElementsMap_attributeElement)
|
||||
{
|
||||
elementsN[2]++;
|
||||
};
|
||||
};
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",
|
||||
[self class],[context elementID]);
|
||||
GSWAssertIsElementID(context);
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ static char rcsId[] = "$Id$";
|
|||
-(void)appendToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
GSWStartElement(context);
|
||||
if (_documentTypeString)
|
||||
{
|
||||
NSStringEncoding encoding=[response contentEncoding];
|
||||
|
@ -76,6 +78,8 @@ static char rcsId[] = "$Id$";
|
|||
|
||||
[super appendToResponse:response
|
||||
inContext:context];
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
@end
|
||||
|
|
|
@ -222,8 +222,8 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
if (_disabled)
|
||||
disabledValue=[self evaluateCondition:_disabled
|
||||
inContext:context];
|
||||
|
@ -553,10 +553,8 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@",
|
||||
[self class],[self definitionName],
|
||||
[context elementID],[context senderID]);
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
senderID=[context senderID];
|
||||
elementID=[context elementID];
|
||||
if ([elementID isEqualToString:senderID])
|
||||
|
|
|
@ -120,6 +120,7 @@ static char rcsId[] = "$Id$";
|
|||
GSWComponent* component=nil;
|
||||
NSString* nameValue=nil;
|
||||
LOGObjectFnStartC("GSWInput");
|
||||
GSWAssertIsElementID(context);
|
||||
if (_name)
|
||||
{
|
||||
component=[context component];
|
||||
|
@ -130,6 +131,7 @@ static char rcsId[] = "$Id$";
|
|||
nameValue=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]);
|
||||
};
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWInput");
|
||||
return nameValue;
|
||||
};
|
||||
|
@ -193,7 +195,8 @@ static int countAutoValue = 0;
|
|||
//OK
|
||||
BOOL disabledInContext=NO;
|
||||
LOGObjectFnStartC("GSWInput");
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledInContext=[self disabledInContext:context]; //return 0
|
||||
if (!disabledInContext)
|
||||
{
|
||||
|
@ -227,6 +230,7 @@ static int countAutoValue = 0;
|
|||
NS_ENDHANDLER;
|
||||
};
|
||||
};
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWInput");
|
||||
};
|
||||
|
||||
|
@ -259,7 +263,6 @@ static int countAutoValue = 0;
|
|||
//OK
|
||||
GSWComponent* component=nil;
|
||||
LOGObjectFnStartC("GSWInput");
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
component=[context component];
|
||||
if (_value)
|
||||
{
|
||||
|
|
|
@ -170,6 +170,8 @@ static char rcsId[] = "$Id$";
|
|||
#endif
|
||||
int countValue=0;
|
||||
LOGObjectFnStartC("GSWPopUpButton");
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
[self resetAutoValue];
|
||||
_autoValue = NO;
|
||||
request=[context request];
|
||||
|
@ -391,6 +393,8 @@ static char rcsId[] = "$Id$";
|
|||
inOptGroup=NO;
|
||||
};
|
||||
[response _appendContentAsciiString:@"</SELECT>"];
|
||||
GSWStopElement(context);
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWPopUpButton");
|
||||
};
|
||||
|
||||
|
@ -408,8 +412,12 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStartC("GSWPopUpButton");
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
[self _slowTakeValuesFromRequest:request
|
||||
inContext:context];
|
||||
GSWAssertIsElementID(context);
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStopC("GSWPopUpButton");
|
||||
};
|
||||
|
||||
|
@ -428,6 +436,8 @@ static char rcsId[] = "$Id$";
|
|||
BOOL disabledValue=NO;
|
||||
BOOL wasFormSubmitted=NO;
|
||||
LOGObjectFnStartC("GSWPopUpButton");
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
[self resetAutoValue];
|
||||
disabledValue=[self disabledInContext:context];
|
||||
if (!disabledValue)
|
||||
|
@ -450,7 +460,7 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
||||
formValues=[request formValuesForKey:name];
|
||||
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
|
||||
if (formValues && [formValues count])
|
||||
if (formValues && [formValues count]>0)
|
||||
{
|
||||
BOOL isEqual=NO;
|
||||
formValue=[formValues objectAtIndex:0];
|
||||
|
@ -604,6 +614,8 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
};
|
||||
};
|
||||
GSWStopElement(context);
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWPopUpButton");
|
||||
};
|
||||
|
||||
|
|
|
@ -136,6 +136,8 @@ static char rcsId[] = "$Id$";
|
|||
//OK
|
||||
BOOL disabledInContext=NO;
|
||||
LOGObjectFnStart();
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledInContext=[self disabledInContext:context];
|
||||
if (!disabledInContext)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWRepetition.h - GSWeb: Class GSWRepetition
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWRepetition.h - <title>GSWeb: Class GSWRepetition</title>
|
||||
|
||||
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
|
||||
|
||||
$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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -37,12 +45,12 @@
|
|||
GSWHTMLStaticGroup* _childrenGroup;
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement;
|
||||
|
||||
-(NSString*)description;
|
||||
-(void)dealloc;
|
||||
|
@ -51,28 +59,28 @@
|
|||
|
||||
//====================================================================
|
||||
@interface GSWRepetition (GSWRepetitionA)
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)_slowInvokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)_fastInvokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)stopOneIterationWithIndex:(int)index_
|
||||
count:(int)count_
|
||||
isLastOne:(BOOL)isLastOne_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)startOneIterationWithIndex:(unsigned int)index_
|
||||
list:(NSArray*)list_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)stopOneIterationWithIndex:(int)index
|
||||
count:(int)count
|
||||
isLastOne:(BOOL)isLastOne
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)startOneIterationWithIndex:(unsigned int)index
|
||||
list:(NSArray*)aList
|
||||
inContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWRepetition.m - GSWeb: Class GSWRepetition
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWRepetition.m - <title>GSWeb: Class GSWRepetition</title>
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -96,6 +104,14 @@ static char rcsId[] = "$Id$";
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)setDefinitionName:(NSString*)definitionName
|
||||
{
|
||||
[super setDefinitionName:definitionName];
|
||||
if (definitionName && _childrenGroup)
|
||||
[_childrenGroup setDefinitionName:[NSString stringWithFormat:@"%@-StaticGroup",definitionName]];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
{
|
||||
|
@ -120,7 +136,8 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
component=[context component];
|
||||
NSDebugMLLog(@"gswdync",@"_list=%@",_list);
|
||||
if (_list)
|
||||
|
@ -151,6 +168,7 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
|
||||
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
|
||||
[context incrementLoopLevel];
|
||||
for(i=0;i<countValue;i++)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
|
@ -170,14 +188,17 @@ static char rcsId[] = "$Id$";
|
|||
#ifndef NDEBUG
|
||||
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
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
[context decrementLoopLevel];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion appendToResponse: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWRepetion appendToResponse: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -193,7 +214,7 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
isInForm=[context isInForm];
|
||||
NSDebugMLLog(@"gswdync",@"isInForm=%s",isInForm ? "YES" : "NO");
|
||||
if (isInForm)
|
||||
|
@ -203,9 +224,10 @@ static char rcsId[] = "$Id$";
|
|||
element=[self _fastInvokeActionForRequest:request
|
||||
inContext:context];
|
||||
NSDebugMLLog(@"gswdync",@"element=%@",element);
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion invokeActionForRequest: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWRepetion invokeActionForRequest: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
return element;
|
||||
|
@ -225,7 +247,8 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
component=[context component];
|
||||
if (_list)
|
||||
{
|
||||
|
@ -250,6 +273,7 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
countValue=tmpCount;
|
||||
};
|
||||
[context incrementLoopLevel];
|
||||
for(i=0;i<countValue;i++)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
|
@ -261,22 +285,25 @@ static char rcsId[] = "$Id$";
|
|||
[context appendZeroElementIDComponent];
|
||||
[_childrenGroup takeValuesFromRequest:request
|
||||
inContext:context];
|
||||
[context deleteLastElementIDComponent];
|
||||
[self stopOneIterationWithIndex:i
|
||||
count:countValue
|
||||
isLastOne:NO
|
||||
inContext:context];
|
||||
[context deleteLastElementIDComponent];
|
||||
[self stopOneIterationWithIndex:i
|
||||
count:countValue
|
||||
isLastOne:NO
|
||||
inContext:context];
|
||||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[context elementID]])
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",[self class],debugElementID,[context elementID]);
|
||||
|
||||
};
|
||||
if (![debugElementID isEqualToString:[context elementID]])
|
||||
{
|
||||
NSDebugMLLog(@"gswdync",@"class=%@ debugElementID=%@ [context elementID]=%@",
|
||||
[self class],debugElementID,[context elementID]);
|
||||
|
||||
};
|
||||
#endif
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
[context decrementLoopLevel];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion takeValuesFromRequest: bad elementID");
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||
@"GSWRepetion takeValuesFromRequest: bad elementID");
|
||||
#endif
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -295,7 +322,7 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
component=[context component];
|
||||
if (_list)
|
||||
{
|
||||
|
@ -320,6 +347,7 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
countValue=tmpCount;
|
||||
};
|
||||
[context incrementLoopLevel];
|
||||
for(i=0;!element && i<countValue;i++)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
|
@ -343,7 +371,8 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
#endif
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
[context decrementLoopLevel];
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _slowInvokeActionForRequest: bad elementID");
|
||||
#endif
|
||||
|
@ -363,11 +392,10 @@ static char rcsId[] = "$Id$";
|
|||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||
#endif
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
senderID=[context senderID];
|
||||
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
|
||||
elementID=[context elementID];
|
||||
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
|
||||
if ([senderID hasPrefix:elementID])
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
|
@ -400,6 +428,7 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
countValue=tmpCount;
|
||||
};
|
||||
[context incrementLoopLevel];
|
||||
for(i=0;!element && i<countValue;i++)
|
||||
{
|
||||
[self startOneIterationWithIndex:i
|
||||
|
@ -421,9 +450,9 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
#endif
|
||||
};
|
||||
[context decrementLoopLevel];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"element=%@",element);
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStopElement(context);
|
||||
#ifndef NDEBBUG
|
||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],@"GSWRepetion _fastInvokeActionForRequest: bad elementID");
|
||||
#endif
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWResetButton.h - GSWeb: Class GSWResetButton
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWResetButton.h - <title>GSWeb: Class GSWResetButton</title>
|
||||
|
||||
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
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -29,12 +35,12 @@
|
|||
//OK
|
||||
//====================================================================
|
||||
@interface GSWResetButton: GSWInput
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWResetButton.m - GSWeb: Class GSWResetButton
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWResetButton.m - <title>GSWeb: Class GSWResetButton</title>
|
||||
|
||||
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
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -28,34 +34,35 @@ static char rcsId[] = "$Id$";
|
|||
//====================================================================
|
||||
@implementation GSWResetButton
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements
|
||||
{
|
||||
NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_];
|
||||
NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
||||
LOGObjectFnStartC("GSWResetButton");
|
||||
NSDebugMLLog(@"gswdync",@"name_=%@ associations_:%@ _elements=%@",name_,associations_,elements_);
|
||||
[_associations setObject:[GSWAssociation associationWithValue:@"reset"]
|
||||
forKey:@"type"];
|
||||
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
|
||||
[tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"]
|
||||
forKey:@"type"];
|
||||
|
||||
if (![_associations objectForKey:value__Key])
|
||||
[_associations setObject:[GSWAssociation associationWithValue:@"reset"]
|
||||
forKey:value__Key];
|
||||
|
||||
if ((self=[super initWithName:name_
|
||||
associations:_associations
|
||||
contentElements:nil]))
|
||||
{
|
||||
};
|
||||
if (![tmpAssociations objectForKey:value__Key])
|
||||
[tmpAssociations setObject:[GSWAssociation associationWithValue:@"reset"]
|
||||
forKey:value__Key];
|
||||
|
||||
if ((self=[super initWithName:aName
|
||||
associations:tmpAssociations
|
||||
contentElements:nil]))
|
||||
{
|
||||
};
|
||||
LOGObjectFnStopC("GSWResetButton");
|
||||
return self;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
GSWAssertCorrectElementID(context_);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
//Does Nothing and don't call its parent GSWInput !
|
||||
};
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
length:(unsigned)length;
|
||||
-(void)appendContentCharacter:(char)aChar;
|
||||
-(void)appendContentString:(NSString*)string;
|
||||
-(void)appendDebugCommentContentString:(NSString*)string;
|
||||
-(void)appendContentData:(NSData*)contentData;
|
||||
-(void)setContentEncoding:(NSStringEncoding)encoding;
|
||||
-(NSStringEncoding)contentEncoding;
|
||||
|
|
|
@ -397,7 +397,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding;
|
|||
-(void)appendDebugCommentContentString:(NSString*)string
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
[self appendContentString:[NSString stringWithFormat:@"<!-- %@ -->",string]];
|
||||
[self appendContentString:[NSString stringWithFormat:@"\n<!-- %@ -->\n",string]];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -584,6 +584,16 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding;
|
|||
NSString* _dataLengthString=nil;
|
||||
LOGObjectFnStart();
|
||||
NSAssert(!isFinalizeInContextHasBeenCalled,@"GSWResponse _finalizeInContext: already called");
|
||||
|
||||
#ifndef NDEBUG
|
||||
if(GSDebugSet(@"GSWDocStructure"))
|
||||
{
|
||||
NSString* docStructure=[_context docStructure];
|
||||
if (docStructure)
|
||||
[self appendDebugCommentContentString:docStructure];
|
||||
}
|
||||
#endif
|
||||
|
||||
//TODOV: if !session in request and session created: no client cache
|
||||
if (![self _isClientCachingDisabled] && [_context hasSession] && ![_context _requestSessionID])
|
||||
[self disableClientCaching];
|
||||
|
|
|
@ -1093,6 +1093,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
|
|||
LOGObjectFnStart();
|
||||
_pageElement=[context_ _pageElement];
|
||||
_pageComponent=[context_ _pageComponent];
|
||||
#ifndef NDEBUG
|
||||
[context_ addDocStructureStep:@"Take Values From Request"];
|
||||
#endif
|
||||
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
|
||||
[_pageComponent takeValuesFromRequest:request_
|
||||
inContext:context_]; //_pageComponent ??
|
||||
|
@ -1113,6 +1116,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
|
|||
{
|
||||
_pageElement=[context_ _pageElement];
|
||||
_pageComponent=[context_ _pageComponent];
|
||||
#ifndef NDEBUG
|
||||
[context_ addDocStructureStep:@"Invoke Action For Request"];
|
||||
#endif
|
||||
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
|
||||
_element=[_pageComponent invokeActionForRequest:request_
|
||||
inContext:context_]; //_pageComponent
|
||||
|
@ -1152,6 +1158,9 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
|
|||
_statisticsStore=[[GSWApplication application] statisticsStore];
|
||||
_pageElement=[context_ _pageElement];
|
||||
_pageComponent=[context_ _pageComponent];
|
||||
#ifndef NDEBUG
|
||||
[context_ addDocStructureStep:@"Append To Response"];
|
||||
#endif
|
||||
[context_ _setCurrentComponent:_pageComponent]; //_pageElement ??
|
||||
[_pageComponent appendToResponse:response_
|
||||
inContext:context_]; //_pageComponent??
|
||||
|
|
|
@ -121,7 +121,8 @@ static char rcsId[] = "$Id$";
|
|||
GSWComponent* component=nil;
|
||||
id valueValue = nil;
|
||||
LOGObjectFnStartC("GSWString");
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
request=[context request];
|
||||
isFromClientComponent=[request isFromClientComponent];
|
||||
component=[context component];
|
||||
|
@ -177,7 +178,7 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
[response appendContentString:formattedValue];
|
||||
};
|
||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context elementID]);
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStopC("GSWString");
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
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
|
||||
|
||||
$Revision$
|
||||
|
@ -92,9 +92,11 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
GSWSaveAppendToResponseElementID(context);//Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
[super appendToResponse:response
|
||||
inContext:context];
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -106,16 +108,16 @@ static char rcsId[] = "$Id$";
|
|||
GSWElement* element=nil;
|
||||
BOOL disabledValue=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",
|
||||
[self class],[context elementID],[context senderID]);
|
||||
GSWStartElement(context);
|
||||
NS_DURING
|
||||
{
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledValue=[self disabledInContext:context];
|
||||
NSDebugMLLog(@"gswdync",@"disabledValue=%s",(disabledValue ? "YES" : "NO"));
|
||||
if (!disabledValue)
|
||||
{
|
||||
BOOL wasFormSubmitted=[context _wasFormSubmitted];
|
||||
NSDebugMLLog(@"gswdync",@"wasFormSubmitted=%s",(wasFormSubmitted ? "YES" : "NO"));
|
||||
if (wasFormSubmitted)
|
||||
{
|
||||
BOOL invoked=NO;
|
||||
|
@ -162,7 +164,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
if (![element isKindOfClass:[GSWComponent class]]) //TODO GSWComponent or Element ?
|
||||
{
|
||||
ExceptionRaise0(@"GSWHyperlink",@"Invoked element return a not GSWComponent element");
|
||||
ExceptionRaise0(@"GSWSubmitButton",@"Invoked element return a not GSWComponent element");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -204,6 +206,7 @@ static char rcsId[] = "$Id$";
|
|||
[context elementID],
|
||||
[context senderID]);
|
||||
};
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStop();
|
||||
return element;
|
||||
};
|
||||
|
@ -213,7 +216,9 @@ static char rcsId[] = "$Id$";
|
|||
inContext:(GSWContext*)context
|
||||
{
|
||||
//Does Nothing ?
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
GSWStopElement(context);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
@ -51,13 +51,13 @@
|
|||
@end
|
||||
|
||||
@interface GSWSwitchComponent (GSWSwitchComponentA)
|
||||
-(void)appendToResponse:(GSWResponse*)response
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(GSWElement*)_realComponentWithName:(NSString*)name
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
|
|
@ -111,6 +111,8 @@ static char rcsId[] = "$Id$";
|
|||
GSWElement* element=nil;
|
||||
NSString* elementNameInContext=nil;
|
||||
LOGObjectFnStartC("GSWSwitchComponent");
|
||||
GSWStartElement(aContext);
|
||||
GSWSaveAppendToResponseElementID(aContext);
|
||||
elementNameInContext=[self _elementNameInContext:aContext];
|
||||
[aContext appendElementIDComponent:elementNameInContext];
|
||||
element=[self _realComponentWithName:elementNameInContext
|
||||
|
@ -129,6 +131,8 @@ static char rcsId[] = "$Id$";
|
|||
GSWElement* element=nil;
|
||||
NSString* elementNameInContext=nil;
|
||||
LOGObjectFnStartC("GSWSwitchComponent");
|
||||
GSWStartElement(aContext);
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
elementNameInContext=[self _elementNameInContext:aContext];
|
||||
[aContext appendElementIDComponent:elementNameInContext];
|
||||
element=[self _realComponentWithName:elementNameInContext
|
||||
|
@ -141,17 +145,19 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext
|
||||
{
|
||||
GSWElement* element=nil;
|
||||
NSString* elementNameInContext=nil;
|
||||
LOGObjectFnStartC("GSWSwitchComponent");
|
||||
GSWStartElement(aContext);
|
||||
GSWAssertCorrectElementID(aContext);
|
||||
elementNameInContext=[self _elementNameInContext:aContext];
|
||||
[aContext appendElementIDComponent:elementNameInContext];
|
||||
element=[self _realComponentWithName:elementNameInContext
|
||||
inContext:aContext];
|
||||
[element takeValuesFromRequest:request
|
||||
[element takeValuesFromRequest:aRequest
|
||||
inContext:aContext];
|
||||
[aContext deleteLastElementIDComponent];
|
||||
LOGObjectFnStopC("GSWSwitchComponent");
|
||||
|
|
|
@ -236,7 +236,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
NSRange docTypeRangeEnd=NSMakeRange(NSNotFound,0);
|
||||
|
||||
_template=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
|
||||
|
||||
[_template setDefinitionName:[NSString stringWithFormat:@"Template - %@",_templateName]];
|
||||
NSDebugMLog(@"template %p=%@",_template,_template);
|
||||
//NSLog(@"_string = %@", _string);
|
||||
|
||||
docTypeRangeStart=[_string rangeOfString:@"<!DOCTYPE"];
|
||||
|
|
|
@ -807,6 +807,7 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
}
|
||||
else
|
||||
{
|
||||
GSWHTMLStaticGroup* aStaticGroup=nil;
|
||||
NSDebugMLLog(@"low",@"node=%p associations:%@",currentNode,_associations);
|
||||
{
|
||||
NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator];
|
||||
|
@ -839,11 +840,12 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
[currentNode typeDescription],
|
||||
[currentNode propertiesAsDictionary],
|
||||
[[currentNode content] lossyCString]);
|
||||
aStaticGroup=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease];
|
||||
elem=[GSWApp dynamicElementWithName:className
|
||||
associations:_associations
|
||||
template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]
|
||||
template:aStaticGroup
|
||||
languages:_languages];
|
||||
NSDebugMLog(@"node=%p element=%@",currentNode,elem);
|
||||
NSDebugMLog(@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup);
|
||||
if (elem)
|
||||
[elem setDefinitionName:[definitionsElement elementName]];
|
||||
else
|
||||
|
|
|
@ -86,7 +86,8 @@ static char rcsId[] = "$Id$";
|
|||
//OK
|
||||
BOOL disabledValue=NO;
|
||||
LOGObjectFnStartC("GSWTextField");
|
||||
GSWAssertCorrectElementID(context);// Debug Only
|
||||
GSWStartElement(context);
|
||||
GSWAssertCorrectElementID(context);
|
||||
disabledValue=[self disabledInContext:context];
|
||||
if (!disabledValue)
|
||||
{
|
||||
|
@ -106,9 +107,19 @@ static char rcsId[] = "$Id$";
|
|||
if (formatter)
|
||||
{
|
||||
NSString* errorDscr=nil;
|
||||
if (![formatter getObjectValue:&resultValue
|
||||
if ([formatter getObjectValue:&resultValue
|
||||
forString:value
|
||||
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;
|
||||
NSString* valueKeyPath=[_value keyPath];
|
||||
|
@ -162,6 +173,7 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
};
|
||||
};
|
||||
GSWStopElement(context);
|
||||
LOGObjectFnStopC("GSWTextField");
|
||||
};
|
||||
|
||||
|
@ -265,8 +277,16 @@ static char rcsId[] = "$Id$";
|
|||
if (!formatter)
|
||||
formattedValue=valueValue;
|
||||
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])
|
||||
{
|
||||
NSLog(@"### GSWTextField : are EQUAL ###");
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
/* GSWURLValuedElementData.h - GSWeb: Class GSWURLValuedElementData
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWURLValuedElementData.h - <title>GSWeb: Class GSWURLValuedElementData</title>
|
||||
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
|
||||
|
||||
$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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +25,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -29,21 +36,21 @@
|
|||
|
||||
@interface GSWURLValuedElementData: NSObject
|
||||
{
|
||||
NSString* key;
|
||||
NSString* mimeType;
|
||||
NSData * data;
|
||||
BOOL temporaryKey;
|
||||
NSString* _key;
|
||||
NSString* _mimeType;
|
||||
NSData * _data;
|
||||
BOOL _temporaryKey;
|
||||
};
|
||||
|
||||
-(id)initWithData:(NSData*)data_
|
||||
mimeType:(NSString*)type_
|
||||
key:(NSString*)key_;
|
||||
-(id)initWithData:(NSData*)data
|
||||
mimeType:(NSString*)type
|
||||
key:(NSString*)key;
|
||||
-(void)dealloc;
|
||||
|
||||
-(void)appendDataURLToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendDataURLToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context;
|
||||
-(void)appendToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context;
|
||||
-(NSString*)description;
|
||||
-(BOOL)isTemporary;
|
||||
-(NSData*)data;
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWURLValuedElementData.m - GSWeb: Class GSWURLValuedElementData
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWURLValuedElementData.m - <title>GSWeb: Class GSWURLValuedElementData</title>
|
||||
|
||||
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
|
||||
|
||||
$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
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -28,29 +36,29 @@ static char rcsId[] = "$Id$";
|
|||
//====================================================================
|
||||
@implementation GSWURLValuedElementData
|
||||
|
||||
-(id)initWithData:(NSData*)data_
|
||||
mimeType:(NSString*)type_
|
||||
key:(NSString*)key_
|
||||
-(id)initWithData:(NSData*)data
|
||||
mimeType:(NSString*)type
|
||||
key:(NSString*)key
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
if ((self=[super init]))
|
||||
{
|
||||
ASSIGN(data,data_);
|
||||
NSDebugMLog(@"data=%@",data);
|
||||
ASSIGN(mimeType,type_);
|
||||
NSDebugMLog(@"mimeType=%@",mimeType);
|
||||
NSDebugMLog(@"key_=%@",key_);
|
||||
if (key_)
|
||||
{
|
||||
ASSIGN(key,key_);
|
||||
}
|
||||
else
|
||||
{
|
||||
temporaryKey=YES;
|
||||
ASSIGN(key,[NSString stringUniqueIdWithLength:4]);
|
||||
};
|
||||
NSDebugMLog(@"key=%@",key);
|
||||
};
|
||||
{
|
||||
ASSIGN(_data,data);
|
||||
NSDebugMLog(@"data=%@",_data);
|
||||
ASSIGN(_mimeType,type);
|
||||
NSDebugMLog(@"mimeType=%@",_mimeType);
|
||||
NSDebugMLog(@"key=%@",key);
|
||||
if (key)
|
||||
{
|
||||
ASSIGN(_key,key);
|
||||
}
|
||||
else
|
||||
{
|
||||
_temporaryKey=YES;
|
||||
ASSIGN(_key,[NSString stringUniqueIdWithLength:4]);
|
||||
};
|
||||
NSDebugMLog(@"key=%@",_key);
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
};
|
||||
|
@ -58,50 +66,52 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
DESTROY(data);
|
||||
DESTROY(mimeType);
|
||||
DESTROY(key);
|
||||
DESTROY(_data);
|
||||
DESTROY(_mimeType);
|
||||
DESTROY(_key);
|
||||
[super dealloc];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)appendDataURLToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)appendDataURLToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
NSString* _queryString=nil;
|
||||
GSWDynamicURLString* _url=nil;
|
||||
NSString* queryString=nil;
|
||||
GSWDynamicURLString* url=nil;
|
||||
LOGObjectFnStart();
|
||||
_queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]];
|
||||
NSDebugMLog(@"_queryString=%@",_queryString);
|
||||
_url=[context_ urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv]
|
||||
path:nil
|
||||
queryString:_queryString];
|
||||
NSDebugMLog(@"_url=%@",_url);
|
||||
[response_ _appendContentAsciiString:(NSString*)_url];
|
||||
queryString=[NSString stringWithFormat:@"%@=%@",GSWKey_Data[GSWebNamingConv],[self key]];
|
||||
NSDebugMLog(@"queryString=%@",queryString);
|
||||
url=[context urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv]
|
||||
path:nil
|
||||
queryString:queryString];
|
||||
NSDebugMLog(@"url=%@",url);
|
||||
[response _appendContentAsciiString:(NSString*)url];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_
|
||||
-(void)appendToResponse:(GSWResponse*)response
|
||||
inContext:(GSWContext*)context
|
||||
{
|
||||
//OK
|
||||
NSData* _data=data;
|
||||
NSData* data=_data;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"_data=%@",_data);
|
||||
[response_ setHeader:[NSString stringWithFormat:@"%u",[data length]]
|
||||
forKey:@"content-length"];
|
||||
if (!_data)
|
||||
{
|
||||
NSDebugMLog(@"key=%@",key);
|
||||
_data=[NSData dataWithContentsOfFile:key];
|
||||
NSDebugMLog(@"_data=%@",_data);
|
||||
}
|
||||
GSWStartElement(context);
|
||||
GSWSaveAppendToResponseElementID(context);
|
||||
NSDebugMLog(@"data=%@",data);
|
||||
if (!data)
|
||||
{
|
||||
NSDebugMLog(@"key=%@",_key);
|
||||
data=[NSData dataWithContentsOfFile:_key];
|
||||
NSDebugMLog(@"data=%@",data);
|
||||
}
|
||||
else
|
||||
[response_ setContent:_data];
|
||||
[response setContent:data];
|
||||
[response setHeader:[NSString stringWithFormat:@"%u",[data length]]
|
||||
forKey:@"content-length"];
|
||||
|
||||
[response_ setHeader:mimeType
|
||||
forKey:@"content-type"];
|
||||
[response setHeader:_mimeType
|
||||
forKey:@"content-type"];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -109,8 +119,8 @@ static char rcsId[] = "$Id$";
|
|||
-(NSString*)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"<%s %p>",
|
||||
object_get_class_name(self),
|
||||
(void*)self];
|
||||
object_get_class_name(self),
|
||||
(void*)self];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -118,7 +128,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnStop();
|
||||
return temporaryKey;
|
||||
return _temporaryKey;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -126,7 +136,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnStop();
|
||||
return data;
|
||||
return _data;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -134,7 +144,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnStop();
|
||||
return mimeType;
|
||||
return _mimeType;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
@ -142,7 +152,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnStop();
|
||||
return key;
|
||||
return _key;
|
||||
};
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue