diff --git a/ChangeLog b/ChangeLog index 32c5864..1130c30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +2002-01-26 Manuel Guesdon + + * GSWeb.framework/GSWSwitchComponent.m: + o logs + o corected bug: use GSWComponentName__Key[] + * GSWeb.framework/GSWSession.m: + o logs + * GSWExtensions.framework/GSWExtensions.m: + o added better formatting + * GSWExtensions.framework/GSWExtensions.gswc/GSWExtensions.HTML: + o added better formatting + * GSWExtensions.framework/French.lproj/GSWExtensions.gswc/GSWExtensions.HTML: + o added better formatting + * GSWExtensionsGSW.framework/GSWLogin.m: + o added -login exception cataching to add exception verbosity. + * GSWeb.framework/GSWDynamicElement.m/.h: + o logs + o added ivar _definitionName and associated methods + * GSWeb.framework/GSWElement.m/.h: + o added ivar -definitionName + * GSWeb.framework/GSWTemplateParserANTLR.m: + o set dynamic element definition name + * GSWeb.framework/GSWTemplateParserXML.m: + o set dynamic element definition name + * GSWeb.framework/GSWConditional.m: + o logs + * GSWeb.framework/GSWComponent.m: + o logs + o remove GDL2 code in -valueForBinding: and setValue:forBinding: + I don't see a reason for this code and it may make a loop + * GSWeb.framework/GSWAssociation.m: + o logs + o Fix in validateValue:forKeyPath: test & call + * GSWeb.framework/GSWDisplayGroup.m: + o logs + * GSWeb.framework/GSWBundle.m: + o logs + * GSWeb.framework/GSWImageButton.m: + o logs (element definition name) + * GSWeb.framework/GSWForm.m: + o logs (element definition name) + o stop invokeActionForRequest:inContext: when the current Id is after senderID + * GSWeb.framework: GSWElementIDString.m + o added -compare:options:range: + * GSWeb.framework: GSWHTMLDynamicElement.m + o stop invokeActionForRequest:inContext: when the current Id is after senderID + * GSWeb.framework: GSWHTMLStaticElement.m + o stop invokeActionForRequest:inContext: when the current Id is after senderID + * GSWExtensions.framework/WebServerResources: + o converted .gif to .png + * GSWeb.framework/GSWUtils.m: + o removed members in NSUserDefaults description + 2001-12-11 Manuel Guesdon * GSWeb.framework/GSWResourceManager.m: logs diff --git a/GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html b/GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html index fda84a0..4ad07e9 100644 --- a/GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html +++ b/GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html @@ -22,7 +22,7 @@ Application: - +
@@ -30,7 +30,7 @@ Erreur: - +
@@ -39,7 +39,7 @@ -
+

@@ -53,10 +53,10 @@ - : +
:
- +
diff --git a/GSWExtensions.framework/GNUmakefile b/GSWExtensions.framework/GNUmakefile index 9d0e2d3..ab7fa69 100644 --- a/GSWExtensions.framework/GNUmakefile +++ b/GSWExtensions.framework/GNUmakefile @@ -72,24 +72,24 @@ French GSWExtensions_RESOURCE_DIRS = GSWExtensions_WEBSERVER_RESOURCE_FILES = \ -Ascending.gif \ -Descending.gif \ -DownTriangle.gif \ -PoweredByGNUstep.gif \ -PoweredByGNUstepWeb.gif \ -RightTriangle.gif \ -Unsorted.gif \ -appOff.gif \ -appOn.gif \ -back.gif \ -dir.gif \ +Ascending.png \ +Descending.png \ +DownTriangle.png \ +PoweredByGNUstep.png \ +PoweredByGNUstepWeb.png \ +RightTriangle.png \ +Unsorted.png \ +appOff.png \ +appOn.png \ +back.png \ +dir.png \ exclamation.gif \ -eye.gif \ -lft-OSarw.gif \ -rt-OSarw.gif \ -text.gif \ -gswapp.gif \ -gswappsrv.gif \ +eye.png \ +lft-OSarw.png \ +rt-OSarw.png \ +text.png \ +gswapp.png \ +gswappsrv.png \ warning.gif \ error.gif diff --git a/GSWExtensions.framework/GSWCollapsibleComponentContent.m b/GSWExtensions.framework/GSWCollapsibleComponentContent.m index e54d74e..d083aef 100644 --- a/GSWExtensions.framework/GSWCollapsibleComponentContent.m +++ b/GSWExtensions.framework/GSWCollapsibleComponentContent.m @@ -95,7 +95,7 @@ else if ([self hasBinding:@"helpString"]) ASSIGN(openedImageFileName,[self valueForBinding:@"helpString"]); else - ASSIGN(openedImageFileName,@"DownTriangle.gif"); + ASSIGN(openedImageFileName,@"DownTriangle.png"); }; _image=openedImageFileName; } @@ -109,7 +109,7 @@ else if ([self hasBinding:@"helpString"]) ASSIGN(closedImageFileName,[self valueForBinding:@"helpString"]); else - ASSIGN(closedImageFileName,@"RightTriangle.gif"); + ASSIGN(closedImageFileName,@"RightTriangle.png"); }; _image=closedImageFileName; }; diff --git a/GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html b/GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html index f0b38aa..44fcda3 100644 --- a/GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html +++ b/GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html @@ -22,7 +22,7 @@ Application: - +
@@ -30,7 +30,7 @@ Error: - +
@@ -39,7 +39,7 @@ -
+

@@ -53,10 +53,10 @@ - : +
:
- +
diff --git a/GSWExtensions.framework/GSWExceptionPage.m b/GSWExtensions.framework/GSWExceptionPage.m index a2d7bcd..fbea62d 100644 --- a/GSWExtensions.framework/GSWExceptionPage.m +++ b/GSWExtensions.framework/GSWExceptionPage.m @@ -51,7 +51,7 @@ { if (!reasons) { - ASSIGN(reasons,[[exception description] componentsSeparatedByString:@"\n"]); + ASSIGN(reasons,[[exception reason] componentsSeparatedByString:@"\n"]); }; return reasons; }; @@ -69,4 +69,12 @@ ASSIGN(exception,exception_); }; +-(id)getTmpUserInfoValue +{ + //If array, print it nicely + if ([tmpUserInfoValue isKindOfClass:[NSArray class]]) + return [tmpUserInfoValue componentsJoinedByString:@"\n"]; + else + return tmpUserInfoValue; +} @end diff --git a/GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd b/GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd index 6d65ecd..c99c4d9 100644 --- a/GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd +++ b/GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd @@ -224,7 +224,7 @@ PoweredByImage: GSWImage BORDER = 0; HEIGHT = 49; WIDTH = 221; - filename = "PoweredByGNUstepWeb.gif"; + filename = "PoweredByGNUstepWeb.png"; } REFRESH: GSWSubmitButton diff --git a/GSWExtensions.framework/WebServerResources/Ascending.png b/GSWExtensions.framework/WebServerResources/Ascending.png new file mode 100644 index 0000000..cbe754a Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/Ascending.png differ diff --git a/GSWExtensions.framework/WebServerResources/Descending.png b/GSWExtensions.framework/WebServerResources/Descending.png new file mode 100644 index 0000000..3715fa9 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/Descending.png differ diff --git a/GSWExtensions.framework/WebServerResources/DownTriangle.png b/GSWExtensions.framework/WebServerResources/DownTriangle.png new file mode 100644 index 0000000..cbb5299 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/DownTriangle.png differ diff --git a/GSWExtensions.framework/WebServerResources/PoweredByGNUstep.png b/GSWExtensions.framework/WebServerResources/PoweredByGNUstep.png new file mode 100644 index 0000000..47ca9b1 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/PoweredByGNUstep.png differ diff --git a/GSWExtensions.framework/WebServerResources/PoweredByGNUstepWeb.png b/GSWExtensions.framework/WebServerResources/PoweredByGNUstepWeb.png new file mode 100644 index 0000000..24894a0 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/PoweredByGNUstepWeb.png differ diff --git a/GSWExtensions.framework/WebServerResources/RightTriangle.png b/GSWExtensions.framework/WebServerResources/RightTriangle.png new file mode 100644 index 0000000..9deb0c2 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/RightTriangle.png differ diff --git a/GSWExtensions.framework/WebServerResources/Unsorted.png b/GSWExtensions.framework/WebServerResources/Unsorted.png new file mode 100644 index 0000000..9854068 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/Unsorted.png differ diff --git a/GSWExtensions.framework/WebServerResources/appOff.png b/GSWExtensions.framework/WebServerResources/appOff.png new file mode 100644 index 0000000..e10711c Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/appOff.png differ diff --git a/GSWExtensions.framework/WebServerResources/appOn.png b/GSWExtensions.framework/WebServerResources/appOn.png new file mode 100644 index 0000000..dc72d37 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/appOn.png differ diff --git a/GSWExtensions.framework/WebServerResources/back.png b/GSWExtensions.framework/WebServerResources/back.png new file mode 100644 index 0000000..7efa59b Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/back.png differ diff --git a/GSWExtensions.framework/WebServerResources/dir.png b/GSWExtensions.framework/WebServerResources/dir.png new file mode 100644 index 0000000..4f4b653 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/dir.png differ diff --git a/GSWExtensions.framework/WebServerResources/eye.png b/GSWExtensions.framework/WebServerResources/eye.png new file mode 100644 index 0000000..42c22d9 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/eye.png differ diff --git a/GSWExtensions.framework/WebServerResources/gswapp.png b/GSWExtensions.framework/WebServerResources/gswapp.png new file mode 100644 index 0000000..52317da Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/gswapp.png differ diff --git a/GSWExtensions.framework/WebServerResources/gswappsrv.png b/GSWExtensions.framework/WebServerResources/gswappsrv.png new file mode 100644 index 0000000..af47be0 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/gswappsrv.png differ diff --git a/GSWExtensions.framework/WebServerResources/lft-OSarw.png b/GSWExtensions.framework/WebServerResources/lft-OSarw.png new file mode 100644 index 0000000..dc439b1 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/lft-OSarw.png differ diff --git a/GSWExtensions.framework/WebServerResources/rt-OSarw.png b/GSWExtensions.framework/WebServerResources/rt-OSarw.png new file mode 100644 index 0000000..ffa8858 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/rt-OSarw.png differ diff --git a/GSWExtensions.framework/WebServerResources/text.png b/GSWExtensions.framework/WebServerResources/text.png new file mode 100644 index 0000000..8a8d763 Binary files /dev/null and b/GSWExtensions.framework/WebServerResources/text.png differ diff --git a/GSWExtensionsGSW.framework/GSWLogin.m b/GSWExtensionsGSW.framework/GSWLogin.m index 3420350..27c9be6 100644 --- a/GSWExtensionsGSW.framework/GSWLogin.m +++ b/GSWExtensionsGSW.framework/GSWLogin.m @@ -75,36 +75,49 @@ LOGObjectFnStart(); NSDebugMLog(@"user=%@ password=%@",user,password); NSDebugMLog(@"associationsKeys=%@",associationsKeys); - if ([self hasBinding:@"password"]) + NS_DURING + { + if ([self hasBinding:@"password"]) { if ([self hasBinding:@"user"]) - { - _bindingOk=YES; - [self setValue:user - forBinding:@"user"]; - } + { + _bindingOk=YES; + [self setValue:user + forBinding:@"user"]; + } else if ([self hasBinding:@"login"]) - { - _bindingOk=YES; - [self setValue:user - forBinding:@"login"]; - }; + { + _bindingOk=YES; + [self setValue:user + forBinding:@"login"]; + }; }; - NSDebugMLog(@"_bindingOk=%s",(_bindingOk ? "YES" : "NO")); - if (_bindingOk) + NSDebugMLog(@"_bindingOk=%s",(_bindingOk ? "YES" : "NO")); + if (_bindingOk) { [self setValue:password - forBinding:@"password"]; + forBinding:@"password"]; _nextPage=[[self parent] validateLogin]; } - else + else _nextPage=[[self parent] validateLoginUser:user - password:password]; - if ([self hasBinding:@"message"]) + password:password]; + if ([self hasBinding:@"message"]) { message=[self valueForBinding:@"message"]; }; - NSDebugMLog(@"message=%@",message); + NSDebugMLog(@"message=%@",message); + } + NS_HANDLER + { + LOGException0(@"exception in GSWLogin login action"); + LOGException(@"exception=%@",localException); + localException=ExceptionByAddingUserInfoObjectFrameInfo(localException, + @"In GSWLogin login action"); + LOGException(@"exception=%@",localException); + [localException raise]; + } + NS_ENDHANDLER; LOGObjectFnStop(); return _nextPage; }; diff --git a/GSWeb.framework/GSWApplication.m b/GSWeb.framework/GSWApplication.m index ed52bc2..61d47e8 100644 --- a/GSWeb.framework/GSWApplication.m +++ b/GSWeb.framework/GSWApplication.m @@ -1106,7 +1106,7 @@ int GSWApplicationMain(NSString* applicationClassName, }; -(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)_name - languages:(NSArray*)_languages + languages:(NSArray*)_languages { //OK BOOL isCachedComponent=NO; @@ -1114,87 +1114,88 @@ int GSWApplicationMain(NSString* applicationClassName, NSString* _language=nil; int iLanguage=0; LOGObjectFnStart(); - NSDebugMLLog(@"application",@"_Name=%@",_name); + NSDebugMLLog(@"application",@"_Name %p=%@",_name,_name); for(iLanguage=0;iLanguage<[_languages count] && !_componentDefinition;iLanguage++) - { - _language=[_languages objectAtIndex:iLanguage]; - if (_language) - { - NSDebugMLLog(@"gswcomponents",@"trying _language=%@",_language); - NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO")); - if ([self isCachingEnabled]) - { - _componentDefinition=[componentDefinitionCache objectForKeys:_name,_language,nil]; - if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker) - _componentDefinition=nil; - else if (_componentDefinition) - isCachedComponent=YES; - }; - if (!_componentDefinition) - { - _componentDefinition=[self lockedLoadComponentDefinitionWithName:_name - language:_language]; - if ([self isCachingEnabled]) - { - if (_componentDefinition) - [componentDefinitionCache setObject:_componentDefinition - forKeys:_name,_language,nil]; - else - [componentDefinitionCache setObject:GSNotFoundMarker - forKeys:_name,_language,nil]; - }; - }; - }; - }; + { + _language=[_languages objectAtIndex:iLanguage]; + if (_language) + { + NSDebugMLLog(@"gswcomponents",@"trying _language=%@",_language); + NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO")); + if ([self isCachingEnabled]) + { + _componentDefinition=[componentDefinitionCache objectForKeys:_name,_language,nil]; + if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker) + _componentDefinition=nil; + else if (_componentDefinition) + isCachedComponent=YES; + }; + if (!_componentDefinition) + { + _componentDefinition=[self lockedLoadComponentDefinitionWithName:_name + language:_language]; + if ([self isCachingEnabled]) + { + if (_componentDefinition) + [componentDefinitionCache setObject:_componentDefinition + forKeys:_name,_language,nil]; + else + [componentDefinitionCache setObject:GSNotFoundMarker + forKeys:_name,_language,nil]; + }; + }; + }; + }; if (!_componentDefinition) - { - _language=nil; - NSDebugMLLog0(@"application",@"trying no language"); - NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO")); - if ([self isCachingEnabled]) - { - _componentDefinition=[componentDefinitionCache objectForKeys:_name,nil]; - if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker) - _componentDefinition=nil; - else if (_componentDefinition) - isCachedComponent=YES; - }; - NSDebugMLLog(@"gswcomponents",@"D componentDefinition for %@ %s cached",_name,(_componentDefinition ? "" : "NOT")); - if (!_componentDefinition) - { - _componentDefinition=[self lockedLoadComponentDefinitionWithName:_name - language:_language]; - if ([self isCachingEnabled]) - { - if (_componentDefinition) - [componentDefinitionCache setObject:_componentDefinition - forKeys:_name,nil]; - else - [componentDefinitionCache setObject:GSNotFoundMarker - forKeys:_name,nil]; - }; - }; - }; + { + _language=nil; + NSDebugMLLog0(@"application",@"trying no language"); + NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO")); + if ([self isCachingEnabled]) + { + _componentDefinition=[componentDefinitionCache objectForKeys:_name,nil]; + if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker) + _componentDefinition=nil; + else if (_componentDefinition) + isCachedComponent=YES; + }; + NSDebugMLLog(@"gswcomponents",@"D componentDefinition for %@ %s cached",_name,(_componentDefinition ? "" : "NOT")); + if (!_componentDefinition) + { + _componentDefinition=[self lockedLoadComponentDefinitionWithName:_name + language:_language]; + if ([self isCachingEnabled]) + { + if (_componentDefinition) + [componentDefinitionCache setObject:_componentDefinition + forKeys:_name,nil]; + else + [componentDefinitionCache setObject:GSNotFoundMarker + forKeys:_name,nil]; + }; + }; + }; if (!_componentDefinition) - { - ExceptionRaise(@"GSWApplication", - @"Unable to create component definition for %@ for languages: %@ (no componentDefinition).", - _name, - _languages); - }; + { + ExceptionRaise(@"GSWApplication", + @"Unable to create component definition for %@ for languages: %@ (no componentDefinition).", + _name, + _languages); + }; if (_componentDefinition) - { - [self statusDebugWithFormat:@"Component %@ %s language %@ (%sCached)", - _name, - (_language ? "" : "no"), - (_language ? _language : @""), - (isCachedComponent ? "" : "Not ")]; - }; - NSDebugMLLog(@"application",@"%s componentDefinition for %@ class=%@ %s", - (_componentDefinition ? "FOUND" : "NOTFOUND"), - _name, - (_componentDefinition ? [[_componentDefinition class] description]: @""), - (_componentDefinition ? (isCachedComponent ? "(Cached)" : "(Not Cached)") : "")); + { + [self statusDebugWithFormat:@"Component %@ %s language %@ (%sCached)", + _name, + (_language ? "" : "no"), + (_language ? _language : @""), + (isCachedComponent ? "" : "Not ")]; + }; + NSDebugMLLog(@"application",@"%s componentDefinition (%p) for %@ class=%@ %s", + (_componentDefinition ? "FOUND" : "NOTFOUND"), + _componentDefinition, + _name, + (_componentDefinition ? [[_componentDefinition class] description]: @""), + (_componentDefinition ? (isCachedComponent ? "(Cached)" : "(Not Cached)") : "")); LOGObjectFnStop(); return _componentDefinition; }; @@ -2007,60 +2008,63 @@ int GSWApplicationMain(NSString* applicationClassName, //-------------------------------------------------------------------- -(GSWComponent*)_pageWithName:(NSString*)name_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { //OK GSWComponent* _component=nil; GSWComponentDefinition* _componentDefinition=nil; NSArray* _languages=nil; LOGObjectFnStart(); - NSDebugMLLog(@"info",@"name_=%@",name_); + NSDebugMLLog(@"info",@"name_ %p=%@",name_,name_); NSAssert(context_,@"No Context"); [self lock]; NS_DURING - { - if ([name_ length]<=0) - name_=[self defaultPageName];//NDFN - if ([name_ length]<=0) - name_=GSWMainPageName; - _languages=[context_ languages]; - _componentDefinition=[self lockedComponentDefinitionWithName:name_ - languages:_languages]; - NSDebugMLLog(@"application",@"_componentDefinition=%@ (%@)",_componentDefinition,[_componentDefinition class]); - } + { + if ([name_ length]<=0) + name_=[self defaultPageName];//NDFN + if ([name_ length]<=0) + name_=GSWMainPageName; + _languages=[context_ languages]; + _componentDefinition=[self lockedComponentDefinitionWithName:name_ + languages:_languages]; + NSDebugMLLog(@"info",@"_componentDefinition %p=%@ (%@)", + _componentDefinition, + _componentDefinition, + [_componentDefinition class]); + } NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedComponentDefinitionWithName:"); - LOGException(@"exception=%@",localException); - //TODO - [self unlock]; - [localException raise]; - }; + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedComponentDefinitionWithName:"); + LOGException(@"exception=%@",localException); + //TODO + [self unlock]; + [localException raise]; + }; NS_ENDHANDLER; NS_DURING - { - if (!_componentDefinition) - { - //TODO - NSDebugMLLog0(@"application",@"GSWApplication _pageWithName no _componentDefinition"); - } - else - { - NSAssert(context_,@"No Context"); - _component=[_componentDefinition componentInstanceInContext:context_]; - NSAssert(context_,@"No Context"); - [_component awakeInContext:context_]; - [_component _setIsPage:YES]; - }; - } + { + if (!_componentDefinition) + { + //TODO + NSDebugMLLog0(@"info",@"GSWApplication _pageWithName no _componentDefinition"); + } + else + { + NSAssert(context_,@"No Context"); + _component=[_componentDefinition componentInstanceInContext:context_]; + NSAssert(context_,@"No Context"); + [_component awakeInContext:context_]; + [_component _setIsPage:YES]; + }; + } NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In componentInstanceInContext:"); - LOGException(@"exception=%@",localException); - //TODO - [self unlock]; - [localException raise]; - }; + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In componentInstanceInContext:"); + LOGException(@"exception=%@",localException); + //TODO + [self unlock]; + [localException raise]; + }; NS_ENDHANDLER; [self unlock]; LOGObjectFnStop(); @@ -2073,9 +2077,9 @@ int GSWApplicationMain(NSString* applicationClassName, //-------------------------------------------------------------------- -(GSWElement*)dynamicElementWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_ - languages:(NSArray*)languages_ + associations:(NSDictionary*)associations_ + template:(GSWElement*)templateElement_ + languages:(NSArray*)languages_ { GSWElement* _element=nil; [self lock]; @@ -2099,47 +2103,47 @@ int GSWApplicationMain(NSString* applicationClassName, //-------------------------------------------------------------------- -(GSWElement*)lockedDynamicElementWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_ - languages:(NSArray*)languages_ + associations:(NSDictionary*)associations_ + template:(GSWElement*)templateElement_ + languages:(NSArray*)languages_ { GSWElement* _element=nil; Class _elementClass=nil; //lock bundle //unlock bundle if ([associations_ isAssociationDebugEnabledInComponent:nil]) - [associations_ associationsSetDebugEnabled]; + [associations_ associationsSetDebugEnabled]; _elementClass=NSClassFromString(name_); - NSDebugMLLog(@"application",@"_elementClass:%@",_elementClass); - NSDebugMLLog(@"application",@"_elementClass superClass:%@",[_elementClass superClass]); + NSDebugMLLog(@"info",@"_elementClass %p:%@",_elementClass,_elementClass); + NSDebugMLLog(@"info",@"_elementClass superClass:%@",[_elementClass superClass]); if (_elementClass && !ClassIsKindOfClass(_elementClass,NSClassFromString(@"GSWComponent"))) - { - NSDebugMLLog(@"application",@"CREATE Element of Class:%@",name_); - _element=[[[_elementClass alloc] initWithName:name_ - associations:associations_ - template:templateElement_] - autorelease]; - NSDebugMLLog(@"application",@"Created Element: %@",_element); - } + { + NSDebugMLLog(@"info",@"CREATE Element of Class %p:%@",name_,name_); + _element=[[[_elementClass alloc] initWithName:name_ + associations:associations_ + template:templateElement_] + autorelease]; + NSDebugMLLog(@"info",@"Created Element %p: %@",_element,_element); + } else - { - GSWComponentDefinition* _componentDefinition=nil; - _componentDefinition=[self lockedComponentDefinitionWithName:name_ - languages:languages_]; - if (_componentDefinition) - { - NSDebugMLLog(@"application",@"CREATE SubComponent:%@",name_); - _element=[_componentDefinition componentReferenceWithAssociations:associations_ - template:templateElement_]; - NSDebugMLLog(@"application",@"Created SubComponent: %@",_element); - } - else - { - ExceptionRaise(@"GSWApplication", - @"GSWApplication: Component Definition named '%@' not found or can't be created", - name_); - }; - }; + { + GSWComponentDefinition* _componentDefinition=nil; + _componentDefinition=[self lockedComponentDefinitionWithName:name_ + languages:languages_]; + if (_componentDefinition) + { + NSDebugMLLog(@"info",@"CREATE SubComponent %p:%@",name_,name_); + _element=[_componentDefinition componentReferenceWithAssociations:associations_ + template:templateElement_]; + NSDebugMLLog(@"info",@"Created SubComponent %p: %@",_element,_element); + } + else + { + ExceptionRaise(@"GSWApplication", + @"GSWApplication: Component Definition named '%@' not found or can't be created", + name_); + }; + }; return _element; }; diff --git a/GSWeb.framework/GSWAssociation.m b/GSWeb.framework/GSWAssociation.m index 04be7d8..0dcc2c0 100644 --- a/GSWeb.framework/GSWAssociation.m +++ b/GSWeb.framework/GSWAssociation.m @@ -653,23 +653,33 @@ static NSMutableArray* associationsLogsHandlerClasses=nil; for(i=0;!v && i", object_get_class_name(self), (void*)self]; -/* -// GSWLogC("GSWComponent description B"); - _dscr=[_dscr stringByAppendingFormat:@"name:[%@] subComponents:[%@] templateName:[%@] ", - name, - subComponents, - templateName]; -// GSWLogC("GSWComponent description C"); - _dscr=[_dscr stringByAppendingFormat:@"template:[%@] ", - template]; -// GSWLogC("GSWComponent description D"); - _dscr=[_dscr stringByAppendingFormat:@"componentDefinition:[%p] ", - (void*)componentDefinition]; -// GSWLogC("GSWComponent description D2"); - _dscr=[_dscr stringByAppendingFormat:@"[%@] ", - componentDefinition]; -// GSWLogC("GSWComponent description E"); - _dscr=[_dscr stringByAppendingFormat:@"parent:[%p] ", - (void*)parent]; -// GSWLogC("GSWComponent description F"); - _dscr=[_dscr stringByAppendingFormat:@"associationsKeys:[%@] associations:[%@] childTemplate:[%@] ", - associationsKeys, - associations, - childTemplate]; -// GSWLogC("GSWComponent description G"); - _dscr=[_dscr stringByAppendingFormat:@"context:[%p] session:[%p] ", - (void*)context, - (void*)session]; -// GSWLogC("GSWComponent description H"); - _dscr=[_dscr stringByAppendingFormat:@"isPage:[%s] isCachingEnabled:[%s] isSynchronized:[%s]>", - isPage ? "YES" : "NO", - isCachingEnabled ? "YES" : "NO", - isSynchronized ? "YES" : "NO"]; -// GSWLogC("GSWComponent description I"); -*/ return _dscr; }; @@ -372,7 +337,9 @@ associationsKeys:(NSArray*)_associationsKeys //OK LOGObjectFnStart(); parent=_parent; - NSDebugMLLog(@"gswcomponents",@"parent=%p (%@)",(void*)parent,[parent class]); + NSDebugMLLog(@"gswcomponents",@"name=%@ parent=%p (%@)", + [self definitionName], + (void*)parent,[parent class]); ASSIGN(associations,_associations); NSDebugMLLog(@"gswcomponents",@"associations=%@",associations); ASSIGN(associationsKeys,_associationsKeys); @@ -395,7 +362,8 @@ associationsKeys:(NSArray*)_associationsKeys id _value=nil; id _logValue=[self valueForBinding:@"GSWDebug"]; BOOL _log=boolValueWithDefaultFor(_logValue,NO); - NSDebugMLog0(@"Synchro SubComponent->Component"); + NSDebugMLog(@"defName=%@ - Synchro SubComponent->Component", + [self definitionName]); for(i=0;i<[associationsKeys count];i++) { _key=[associationsKeys objectAtIndex:i]; @@ -404,7 +372,8 @@ associationsKeys:(NSArray*)_associationsKeys if ([_assoc isValueSettable] && ![_assoc isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV { - _value=[self getIVarNamed:_key]; + //MGNEW _value=[self getIVarNamed:_key]; + _value=[self valueForKey:_key];//MGNEW NSDebugMLLog(@"gswcomponents",@"_value=%@",_value); if (_log) [_assoc logSynchronizeComponentToParentForValue:_value @@ -429,7 +398,8 @@ associationsKeys:(NSArray*)_associationsKeys id _value=nil; id _logValue=[self valueForBinding:@"GSWDebug"]; BOOL _log=boolValueWithDefaultFor(_logValue,NO); - NSDebugMLog0(@"Synchro Component->SubComponent"); + NSDebugMLog(@"Nme=%@ - Synchro Component->SubComponent", + [self definitionName]); for(i=0;i<[associationsKeys count];i++) { _key=[associationsKeys objectAtIndex:i]; @@ -442,8 +412,10 @@ associationsKeys:(NSArray*)_associationsKeys if (_log) [_assoc logSynchronizeParentToComponentForValue:_value inComponent:self]; - [self setIVarNamed:_key - withValue:_value]; + /*//MGNEW [self setIVarNamed:_key + withValue:_value];*/ + [self takeValue:_value + forKey:_key]; }; }; }; @@ -768,7 +740,7 @@ associationsKeys:(NSArray*)_associationsKeys unsigned int _index=NSNotFound; LOGObjectFnStart(); NSDebugMLLog(@"gswcomponents",@"associationsKeys=%@",associationsKeys); - NSDebugMLLog(@"gswcomponents",@"associations=%@",associations); + //NSDebugMLLog(@"gswcomponents",@"associations=%@",[associations description]); if (associationsKeys) { _index=[associationsKeys indexOfObject:_name]; @@ -796,14 +768,18 @@ associationsKeys:(NSArray*)_associationsKeys //OK BOOL _hasBinding=NO; LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_); + NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@", + [self definitionName], + parentBindingName_); if (associationsKeys) { int _index=[associationsKeys indexOfObject:parentBindingName_]; NSDebugMLLog(@"gswcomponents",@"_index=%u",_index); _hasBinding=(_index!=NSNotFound); }; - NSDebugMLLog(@"gswcomponents",@"hasBinding=%s",(_hasBinding ? "YES" : "NO")); + NSDebugMLLog(@"gswcomponents",@"defName=%@ - hasBinding=%s", + [self definitionName], + (_hasBinding ? "YES" : "NO")); if (!WOStrictFlag && !_hasBinding) { _hasBinding=([defaultAssociations objectForKey:parentBindingName_]!=nil); @@ -819,7 +795,9 @@ associationsKeys:(NSArray*)_associationsKeys //OK GSWAssociation* _assoc=nil; LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_); + NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@", + [self definitionName], + parentBindingName_); NSDebugMLLog(@"gswcomponents",@"value_=%@",value_); NSDebugMLLog(@"gswcomponents",@"parent=%p",(void*)parent); if (parent) @@ -829,15 +807,23 @@ associationsKeys:(NSArray*)_associationsKeys if(_assoc) [_assoc setValue:value_ inComponent:parent]; +/* // Why doing this ? Be carefull: it may make a loop ! #if GDL2 else { NS_DURING - [self takeValue:value_ forKey:parentBindingName_]; + { + [self takeValue:value_ + forKey:parentBindingName_]; + } NS_HANDLER; + { + //TODO + } NS_ENDHANDLER; } #endif +*/ }; LOGObjectFnStop(); }; @@ -849,7 +835,10 @@ associationsKeys:(NSArray*)_associationsKeys id _value=nil; GSWAssociation* _assoc=nil; LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_); + NSDebugMLLog(@"gswcomponents",@"defName=%@", + [self definitionName]); + NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@", + parentBindingName_); NSDebugMLLog(@"gswcomponents",@"parent=%p of class %@",(void*)parent,[parent class]); if (parent) { @@ -857,15 +846,22 @@ associationsKeys:(NSArray*)_associationsKeys NSDebugMLLog(@"gswcomponents",@"_assoc=%@",_assoc); if(_assoc) _value=[_assoc valueInComponent:parent]; +/* // Why doing this ? Be carefull: it may make a loop ! #if GDL2 else { NS_DURING - _value = [self valueForKey:parentBindingName_]; - NS_HANDLER; + { + _value = [self valueForKey:parentBindingName_]; + } + NS_HANDLER + { + //TODO + } NS_ENDHANDLER; } #endif +*/ NSDebugMLLog(@"gswcomponents",@"_value=%@",_value); }; LOGObjectFnStop(); @@ -879,7 +875,9 @@ associationsKeys:(NSArray*)_associationsKeys NSDictionary* _userDictionary=[self userDictionary]; id _synchronizesVariablesWithBindingsValue=[_userDictionary objectForKey:@"synchronizesVariablesWithBindings"]; BOOL _synchronizesVariablesWithBindings=YES; - NSDebugMLLog(@"gswcomponents",@"userDictionary _synchronizesVariablesWithBindingsValue=%@",_synchronizesVariablesWithBindingsValue); + NSDebugMLLog(@"gswcomponents",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@", + [self definitionName], + _synchronizesVariablesWithBindingsValue); //NDFN if (_synchronizesVariablesWithBindingsValue) { @@ -923,7 +921,9 @@ associationsKeys:(NSArray*)_associationsKeys [_componentDefinition sleep]; [self sleep]; [self _setContext:nil]; - NSDebugMLLog(@"gswcomponents",@"subComponents=%@",subComponents); + NSDebugMLLog(@"gswcomponents",@"defName=%@ - subComponents=%@", + [self definitionName], + subComponents); [subComponents makeObjectsPerformSelector:@selector(sleepInContext:) withObject:context_]; LOGObjectFnStop(); @@ -945,6 +945,7 @@ associationsKeys:(NSArray*)_associationsKeys #endif LOGObjectFnStart(); NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); GSWSaveAppendToResponseElementID(context_);//Debug Only _template=[self _template]; @@ -960,6 +961,7 @@ associationsKeys:(NSArray*)_associationsKeys [context_ deleteLastElementIDComponent]; NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); #ifndef NDEBUG if (![debugElementID isEqualToString:[context_ elementID]]) { @@ -987,6 +989,7 @@ associationsKeys:(NSArray*)_associationsKeys #endif LOGObjectFnStart(); NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); NS_DURING { GSWAssertCorrectElementID(context_);// Debug Only @@ -1007,6 +1010,7 @@ associationsKeys:(NSArray*)_associationsKeys } NS_ENDHANDLER; NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); #ifndef NDEBUG if (![debugElementID isEqualToString:[context_ elementID]]) { @@ -1014,7 +1018,8 @@ associationsKeys:(NSArray*)_associationsKeys }; #endif - if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]==NSOrderedDescending) +// if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]==NSOrderedDescending) + if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] isSearchOverForSenderID:[context_ senderID]]) { LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", [self class], @@ -1044,12 +1049,14 @@ associationsKeys:(NSArray*)_associationsKeys _oldValidateFlag=[context_ isValidate]; [context_ setValidate:YES]; NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); _template=[self _template]; [context_ appendZeroElementIDComponent]; [_template takeValuesFromRequest:request_ inContext:context_]; [context_ deleteLastElementIDComponent]; NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); #ifndef NDEBUG if (![debugElementID isEqualToString:[context_ elementID]]) { @@ -1159,6 +1166,7 @@ associationsKeys:(NSArray*)_associationsKeys GSWComponentDefinition* _componentDefinition=nil; LOGObjectFnStart(); NSDebugMLLog(@"gswcomponents",@"context_=%@",context_); + NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]); NSAssert(context_,@"No Context"); [self _setContext:context_]; _componentDefinition=[self _componentDefinition]; @@ -1185,7 +1193,9 @@ associationsKeys:(NSArray*)_associationsKeys id _ret=nil; LOGObjectFnStart(); - NSDebugMLLog(@"gswcomponents", @"parent=%p", (void*)parent); + NSDebugMLLog(@"gswcomponents", @"name=%@ - parent=%p", + [self definitionName], + (void*)parent); if (parent) { _assoc = [self _associationWithName:attribute]; diff --git a/GSWeb.framework/GSWConditional.m b/GSWeb.framework/GSWConditional.m index d5e78d8..ab789f6 100644 --- a/GSWeb.framework/GSWConditional.m +++ b/GSWeb.framework/GSWConditional.m @@ -103,6 +103,13 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ 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]; @@ -118,7 +125,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { //OK GSWElement* _element=nil; @@ -129,24 +136,30 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); GSWAssertCorrectElementID(context_);// Debug Only _condition=[self evaluateCondition:condition - inContext:context_]; + inContext:context_]; _negate=[self evaluateCondition:negate - inContext:context_]; + inContext:context_]; _doIt=_condition; if (_negate) - _doIt=!_doIt; - NSDebugMLLog(@"gswdync",@"_doIt=%s",_doIt ? "YES" : "NO"); + _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]; - NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup); - _element=[childrenGroup invokeActionForRequest:request_ - inContext:context_]; - NSDebugMLLog(@"gswdync",@"_element=%@",_element); - [context_ deleteLastElementIDComponent]; - }; + { + 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]; + }; NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); LOGObjectFnStop(); return _element; @@ -172,7 +185,13 @@ static char rcsId[] = "$Id$"; _doIt=_condition; if (_negate) _doIt=!_doIt; - NSDebugMLLog(@"gswdync",@"_doIt=%s",_doIt ? "YES" : "NO"); + 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]; diff --git a/GSWeb.framework/GSWDisplayGroup.m b/GSWeb.framework/GSWDisplayGroup.m index 56d11ce..c6d24f3 100644 --- a/GSWeb.framework/GSWDisplayGroup.m +++ b/GSWeb.framework/GSWDisplayGroup.m @@ -25,7 +25,7 @@ static char rcsId[] = "$Id$"; #include - +@class EOUndoManager; //==================================================================== @implementation GSWDisplayGroup @@ -102,6 +102,7 @@ Description: if ((self=[self init])) { LOGObjectFnStart(); + NSDebugMLLog(@"gswdisplaygroup",@"GSWDisplayGroup %p",self); [self setNumberOfObjectsPerBatch: [unarchiver decodeIntForKey:@"numberOfObjectsPerBatch"]]; [self setFetchesOnLoad: @@ -210,21 +211,85 @@ Description: LOGObjectFnStop(); }; --(void)_addQualifiersToArray:(id)array_ - forValues:(id)values_ - operatorSelector:(SEL)selector_ +-(void)_addQualifiersToArray:(NSMutableArray*)array + forValues:(NSDictionary*)values + operatorSelector:(SEL)sel { + //OK + NSEnumerator *enumerator=nil; + NSString *key=nil; + NSString *op=nil; LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN + NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array); + NSDebugMLLog(@"gswdisplaygroup",@"values=%@",values); + NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@", + (void*)sel, + NSStringFromSelector(sel)); + enumerator = [values keyEnumerator]; + while((key = [enumerator nextObject])) + { + EOQualifier* qualifier=nil; + id value=[values objectForKey:key]; + NSDebugMLLog(@"gswdisplaygroup",@"key=%@ value=%@",key,value); + qualifier=[self _qualifierForKey:key + value:value + operatorSelector:sel]; + NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); + if (qualifier) + [array addObject:qualifier]; + }; + NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array); LOGObjectFnStop(); }; --(id)_qualifierForKey:(id)key - value:(id)value - operatorSelector:(SEL)selector_ +-(EOQualifier*)_qualifierForKey:(id)key + value:(id)value + operatorSelector:(SEL)sel { - LOGObjectFnNotImplemented(); //TODOFN - return nil; + //near OK (see VERIFY) + EOClassDescription* cd=nil; + EOQualifier* qualifier=nil; + NSException* validateException=nil; + LOGObjectFnStart(); + NSDebugMLLog(@"gswdisplaygroup",@"value=%@",value); + NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@", + (void*)sel, + NSStringFromSelector(sel)); + cd=[_dataSource classDescriptionForObjects];// //ret [EOEntityClassDescription]: + validateException=[cd validateValue:value + forKey:key]; + NSDebugMLLog(@"gswdisplaygroup",@"validateException=%@",validateException); + if (validateException) + { + [validateException raise]; //VERIFY + } + else + { + NSString* op=nil; + NSString* fvalue=value; + + //VERIFY!! + op = [_queryOperator objectForKey:key]; + NSDebugMLLog(@"gswdisplaygroup",@"op=%@",op); + if(op) + sel = [EOQualifier operatorSelectorForString:op]; + NSDebugMLLog(@"gswdisplaygroup",@"operatorSelector=%p: %@", + (void*)sel, + NSStringFromSelector(sel)); + + NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchFormat=%@",_defaultStringMatchFormat); + + if (_defaultStringMatchFormat) + fvalue=[NSString stringWithFormat:_defaultStringMatchFormat, + value];//VERIFY !!! + NSDebugMLLog(@"gswdisplaygroup",@"fvalue=%@",fvalue); + qualifier=[[[EOKeyValueQualifier alloc] + initWithKey:key + operatorSelector:sel + value:fvalue] autorelease]; + }; + NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); + return qualifier; }; -(BOOL)_deleteObjectsAtIndexes:(id)indexes_ @@ -271,7 +336,7 @@ Description: -(void)_notifySelectionChanged { LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN + [EOObserverCenter notifyObserversObjectWillChange:nil];//OK ? LOGObjectFnStop(); }; @@ -280,7 +345,8 @@ Description: -(void)_notifyRowChanged:(int)row_ { LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN +//-1 ==> nil ? + [EOObserverCenter notifyObserversObjectWillChange:nil]; //VERIFY LOGObjectFnStop(); }; @@ -292,9 +358,20 @@ Description: { LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN + //TODOFN + if (selector_==@selector(displayGroup:didFetchObjects:)) //TODO ???? + { + //Do it on object1 + if(_delegateRespondsTo.didFetchObjects) + [delegate displayGroup:object1 + didFetchObjects:object2]; + } + else + { + LOGObjectFnNotImplemented(); //TODOFN + }; LOGObjectFnStop(); - return nil; + return self; //?? }; @@ -308,12 +385,13 @@ Description: }; --(id)undoManager +-(EOUndoManager*)undoManager { + EOUndoManager* undoManager=nil; LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN + undoManager=[[_dataSource editingContext] undoManager]; LOGObjectFnStop(); - return nil; + return undoManager; }; -(void)objectsInvalidatedInEditingContext:(id)object_ @@ -595,30 +673,30 @@ Description: if(delete) { - NS_DURING - { - [_dataSource deleteObject:object]; - - [_displayedObjects removeObjectIdenticalTo:object]; - [_allObjects removeObjectIdenticalTo:object]; - - if(_delegateRespondsTo.didDeleteObject == YES) - [delegate displayGroup:self didDeleteObject:object]; - } - NS_HANDLER - { - NSLog(@"GSWDisplayGroup (deleteObjectAtIndex:) Can't delete object at index : %d", index); - NSLog(@"object : %@", object); - NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n", - localException, - [localException description], - [localException name], - [localException reason]); - delete = NO; - } - NS_ENDHANDLER; + NS_DURING + { + [_dataSource deleteObject:object]; + + [_displayedObjects removeObjectIdenticalTo:object]; + [_allObjects removeObjectIdenticalTo:object]; + + if(_delegateRespondsTo.didDeleteObject == YES) + [delegate displayGroup:self didDeleteObject:object]; + } + NS_HANDLER + { + NSLog(@"GSWDisplayGroup (deleteObjectAtIndex:) Can't delete object at index : %d", index); + NSLog(@"object : %@", object); + NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n", + localException, + [localException description], + [localException name], + [localException reason]); + delete = NO; + } + NS_ENDHANDLER; }; - + [self clearSelection]; LOGObjectFnStop(); @@ -714,6 +792,7 @@ Description: - (NSArray *)displayedObjects { + //OK return _displayedObjects; } @@ -825,10 +904,18 @@ Description: // fetch - (id)fetch + //Near OK { BOOL fetch = YES; - + EOUndoManager* undoManager=nil; LOGObjectFnStart(); + //[self endEditing];//WO45P3 ret 1 //TODO if NO ? + [[NSNotificationCenter defaultCenter] + postNotificationName:@"WODisplayGroupWillFetch" //TODO Name + object:self]; + undoManager=[self undoManager];// //WO45P3 + [undoManager removeAllActionsWithTarget:self];//WO45P3 + [_dataSource setQualifierBindings:_queryBindings];//WO45P3 if(_delegateRespondsTo.shouldFetchObjects == YES) fetch = [delegate displayGroupShouldFetch:self]; @@ -837,20 +924,18 @@ Description: { NSArray *objects=nil; - objects = [_dataSource fetchObjects]; - [self setObjectArray:objects]; - - if(_delegateRespondsTo.didFetchObjects == YES) - [delegate displayGroup:self - didFetchObjects:_allObjects]; - // selection - if ([self selectsFirstObjectAfterFetch] == YES) { + objects = [_dataSource fetchObjects];//OK WO45P3 + [self setObjectArray:objects];//OK + [self _notify:@selector(displayGroup:didFetchObjects:) + with:self + with:_allObjects]; + /*IN setObjectArray: // selection + if ([self selectsFirstObjectAfterFetch] == YES) { [self setCurrentBatchIndex:1]; - } + */ }; LOGObjectFnStop(); - - return nil;//FIXME + return nil;//FIXME ?? } //-------------------------------------------------------------------- @@ -1112,50 +1197,38 @@ Description: - (EOQualifier *)qualifierFromQueryValues { + //Near OK EOQualifier* resultQualifier=nil; NSMutableArray *array=nil; - NSEnumerator *enumerator=nil; - NSString *key=nil; - NSString *op=nil; - SEL operatorSelector=nil; LOGObjectFnStart(); + NSDebugMLLog(@"gswdisplaygroup",@"_queryMatch=%@", + _queryMatch); + NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", + _defaultStringMatchOperator, + (void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]); array = [NSMutableArray arrayWithCapacity:8]; - enumerator = [_queryMatch keyEnumerator]; - while((key = [enumerator nextObject])) - { - op = [_queryOperator objectForKey:key]; + [self _addQualifiersToArray:array + forValues:_queryMax + operatorSelector:EOQualifierOperatorLessThan];//LessThan ?? + [self _addQualifiersToArray:array + forValues:_queryMin + operatorSelector:EOQualifierOperatorGreaterThan];//GreaterThan ?? - if(op == nil) - operatorSelector = EOQualifierOperatorEqual; - else - operatorSelector = [EOQualifier operatorSelectorForString:op]; + NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p", + _defaultStringMatchOperator, + (void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]); + [self _addQualifiersToArray:array + forValues:_queryMatch + operatorSelector:[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]];//VERIFY - [array addObject:[[[EOKeyValueQualifier alloc] - initWithKey:key - operatorSelector:operatorSelector - value:[_queryMatch objectForKey:key]] autorelease]]; - } - - enumerator = [_queryMax keyEnumerator]; - while((key = [enumerator nextObject])) - { - [array addObject:[[[EOKeyValueQualifier alloc] - initWithKey:key - operatorSelector:EOQualifierOperatorLessThan - value:[_queryMax objectForKey:key]] autorelease]]; - } - - enumerator = [_queryMin keyEnumerator]; - while((key = [enumerator nextObject])) - { - [array addObject:[[[EOKeyValueQualifier alloc] - initWithKey:key - operatorSelector:EOQualifierOperatorGreaterThan - value:[_queryMin objectForKey:key]] autorelease]]; - } - resultQualifier=[[[EOAndQualifier alloc] initWithQualifierArray:array] autorelease]; + NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array); + if ([array count]==1) + resultQualifier=[array objectAtIndex:0]; + else if ([array count]>1) + resultQualifier=[[[EOAndQualifier alloc] initWithQualifierArray:array] autorelease]; + NSDebugMLLog(@"gswdisplaygroup",@"resultQualifier=%@",resultQualifier); LOGObjectFnStop(); return resultQualifier; } @@ -1165,13 +1238,29 @@ Description: - (void)qualifyDataSource { + // near OK + EOQualifier* qualifier=nil; LOGObjectFnStart(); - [_dataSource setQualifier:[self qualifierFromQueryValues]]; - - _flags.queryMode = NO; - [self fetch]; - - LOGObjectFnNotImplemented(); //TODOFN + NS_DURING //for trace purpose + { + //TODO + //[self endEditing];//WO45P3 ret 1 //TODO if NO ? + [self setInQueryMode:NO]; + qualifier=[self qualifierFromQueryValues];//OK + NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); + [_dataSource setAuxiliaryQualifier:qualifier];//OK + + NSDebugMLLog0(@"gswdisplaygroup",@"Will fetch"); + [self fetch];//OK use ret Value ? + NSDebugMLLog0(@"gswdisplaygroup",@"End fetch"); + } + NS_HANDLER + { + NSLog(@"%@ (%@)",localException,[localException reason]); + LOGException(@"%@ (%@)",localException,[localException reason]); + [localException raise]; + } + NS_ENDHANDLER; LOGObjectFnStop(); }; @@ -1180,11 +1269,15 @@ Description: - (void)qualifyDisplayGroup { + EOQualifier* qualifier=nil; LOGObjectFnStart(); - [self setQualifier:[self qualifierFromQueryValues]]; + [self setInQueryMode:NO]; + qualifier=[self qualifierFromQueryValues]; + NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier); + [self setQualifier:qualifier]; + NSDebugMLLog0(@"gswdisplaygroup",@"updateDisplayedObjects"); [self updateDisplayedObjects]; - _flags.queryMode = NO; LOGObjectFnStop(); } @@ -1233,8 +1326,9 @@ Description: -(void)redisplay { + //VERIFY LOGObjectFnStart(); - LOGObjectFnNotImplemented(); //TODOFN + [self _notifyRowChanged:-1]; // -1 ?? LOGObjectFnStop(); }; @@ -1264,8 +1358,10 @@ Description: { id obj=nil; LOGObjectFnStart(); + NSDebugMLLog(@"gswdisplaygroup",@"_selectedObjects count=%d",[_selectedObjects count]); if([_selectedObjects count]) obj=[_selectedObjects objectAtIndex:0]; + NSDebugMLLog(@"gswdisplaygroup",@"selectedObject=%@",obj); LOGObjectFnStop(); return obj; @@ -1338,7 +1434,11 @@ Description: { BOOL result=NO; LOGObjectFnStart(); - if([_allObjects containsObject:object] == NO) + NSDebugMLLog(@"gswdisplaygroup",@"object=%@",object); + NSDebugMLLog(@"gswdisplaygroup",@"_allObjects=%@",_allObjects); + NSDebugMLLog(@"gswdisplaygroup",@"[_allObjects containsObject:object]=%d", + (int)[_allObjects containsObject:object]); + if(![_allObjects containsObject:object]) result=NO; else result=[self setSelectionIndexes: @@ -1346,13 +1446,13 @@ Description: [NSNumber numberWithUnsignedInt: [_allObjects indexOfObject:object]]]]; + NSDebugMLLog(@"gswdisplaygroup",@"result=%d",(int)result); LOGObjectFnStop(); return result; } //-------------------------------------------------------------------- // selectObjectsIdenticalTo: - - (BOOL)selectObjectsIdenticalTo:(NSArray *)objects { BOOL result=NO; @@ -1363,22 +1463,32 @@ Description: id dispObj=nil; LOGObjectFnStart(); + // Array of new selected indexes array = [NSMutableArray arrayWithCapacity:8]; + // ENumeratoe Objects to select objsEnum = [objects objectEnumerator]; + + // For each object to select while((object = [objsEnum nextObject])) { + //Enumerated displayed objects dispEnum = [_displayedObjects objectEnumerator]; + + // For each already displayed object while((dispObj = [dispEnum nextObject])) { + //if object to select is displayed if(dispObj == object) { + // Add it to array of selected indexes [array addObject:[NSNumber numberWithUnsignedInt: [_allObjects indexOfObject:object]]]; break; }; }; + //??? if(dispObj == nil) { [array removeAllObjects]; @@ -1396,6 +1506,20 @@ Description: - (BOOL)selectObjectsIdenticalTo:(NSArray *)objects selectFirstOnNoMatch:(BOOL)flag { + + +/* +//-------------------------------------------------------------------- +// selectObjectsIdenticalTo:selectFirstOnNoMatch: //WO45 +-(BOOL)selectObjectsIdenticalTo:(NSArray*)objects //0x1962ca8 + + selectFirstOnNoMatch:(int)index //0 +{ +self setSelectionIndexes:indexes of objects in objects? //ret 1 + return 1; ?? +} +*/ + BOOL result=NO; unsigned index=0; LOGObjectFnStart(); @@ -1601,6 +1725,7 @@ Description: - (void)setInQueryMode:(BOOL)flag { LOGObjectFnStart(); +//[self inQueryMode]//WO45P3 _flags.queryMode = flag; LOGObjectFnStop(); } @@ -1661,12 +1786,21 @@ Description: - (void)setObjectArray:(NSArray *)objects { LOGObjectFnStart(); +//self selectedObjects +// self updateDisplayedObjects NSDebugMLog(@"objects=%@",objects); [_allObjects removeAllObjects]; [_allObjects addObjectsFromArray:objects]; [self updateDisplayedObjects]; + if ([self selectsFirstObjectAfterFetch]) + { + [self selectObjectsIdenticalTo:_selection //TODO _selection ?? + selectFirstOnNoMatch:1]; + [self redisplay]; + } + // TODO selection LOGObjectFnStop(); } @@ -1721,54 +1855,71 @@ Description: - (BOOL)setSelectionIndexes:(NSArray *)selection_ { - NSEnumerator *objsEnum; - NSNumber *number; +//(0) object 0x2859148 +/* +if objects to selet and no prev selection +{ +[self endEditing]//ret 1 +ASSIGN(_selection,selection_); //Array of indexes +[self _notifySelectionChanged] +STOP ? +} + + +*/ + + + + NSEnumerator *objsEnum=nil; + NSNumber *number=nil; BOOL stop = NO; + BOOL retValue=NO; LOGObjectFnStart(); - - if(_delegateRespondsTo.shouldChangeSelection == YES) - if([delegate displayGroup:self - shouldChangeSelectionToIndexes:selection_] == NO) - return NO; - - objsEnum = [selection_ objectEnumerator]; - while((number = [objsEnum nextObject])) +//call selectedObjects //0x1a38b78 + if(_delegateRespondsTo.shouldChangeSelection == YES + && [delegate displayGroup:self + shouldChangeSelectionToIndexes:selection_] == NO) + retValue=NO; + else { - NS_DURING + objsEnum = [selection_ objectEnumerator]; + while((number = [objsEnum nextObject])) { - // check for objects - [_allObjects objectAtIndex:[number unsignedIntValue]]; + NS_DURING + { + // check for objects + [_allObjects objectAtIndex:[number unsignedIntValue]]; + } + NS_HANDLER + { + //return NO; + stop = YES; + retValue=NO; + } + NS_ENDHANDLER; } - NS_HANDLER + + if (!stop) { - //return NO; - stop = YES; - } - return NO; - NS_ENDHANDLER; - } - - if (stop) { - return NO; - } - [_selectedObjects removeAllObjects]; - - objsEnum = [selection_ objectEnumerator]; - while((number = [objsEnum nextObject])) - { - [_selectedObjects addObject:[_allObjects objectAtIndex:[number unsignedIntValue]]]; - } - - ASSIGN(_selection, selection_); - - if(_delegateRespondsTo.didChangeSelection == YES) - [delegate displayGroupDidChangeSelection:self]; - - if(_delegateRespondsTo.didChangeSelectedObjects == YES) - [delegate displayGroupDidChangeSelectedObjects:self]; + [_selectedObjects removeAllObjects]; + + objsEnum = [selection_ objectEnumerator]; + while((number = [objsEnum nextObject])) + { + [_selectedObjects addObject:[_allObjects objectAtIndex:[number unsignedIntValue]]]; + } + ASSIGN(_selection, selection_); + + if(_delegateRespondsTo.didChangeSelection == YES) + [delegate displayGroupDidChangeSelection:self]; + + if(_delegateRespondsTo.didChangeSelectedObjects == YES) + [delegate displayGroupDidChangeSelectedObjects:self]; + }; + }; LOGObjectFnStop(); - return YES; + return retValue; } //-------------------------------------------------------------------- @@ -1819,7 +1970,12 @@ Description: NSEnumerator *objsEnum=nil; id object=nil; LOGObjectFnStart(); - +//TODO +//self selectedObjects //() 0x1a38b78 +//self allObjects 0x27cadf8 +//self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0 +//self redisplay +//STOP [_displayedObjects removeAllObjects]; if(_delegateRespondsTo.displayArrayForObjects == YES) diff --git a/GSWeb.framework/GSWDynamicElement.h b/GSWeb.framework/GSWDynamicElement.h index 8a41451..4c8d4f6 100644 --- a/GSWeb.framework/GSWDynamicElement.h +++ b/GSWeb.framework/GSWDynamicElement.h @@ -30,12 +30,14 @@ //==================================================================== @interface GSWDynamicElement : GSWElement { + NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose }; -(id)initWithName:(NSString*)name_ associations:(NSDictionary*)associations_ template:(GSWElement*)template_; - +-(NSString*)definitionName; +-(void)setDefinitionName:(NSString*)definitionName; @end //==================================================================== diff --git a/GSWeb.framework/GSWDynamicElement.m b/GSWeb.framework/GSWDynamicElement.m index 0c7549c..d2cb3fc 100644 --- a/GSWeb.framework/GSWDynamicElement.m +++ b/GSWeb.framework/GSWDynamicElement.m @@ -43,7 +43,31 @@ static char rcsId[] = "$Id$"; return self; }; +//-------------------------------------------------------------------- +-(void)dealloc +{ + 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) @@ -54,7 +78,8 @@ static char rcsId[] = "$Id$"; //OK BOOL _result=NO; LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"condition_=%@",condition_); + NSDebugMLLog(@"gswdync",@"condition_=%@", + condition_); if (condition_) { GSWComponent* _component=[_context component]; @@ -68,6 +93,8 @@ static char rcsId[] = "$Id$"; #endif _result=boolValueWithDefaultFor(_value,YES); }; + NSDebugMLLog(@"gswdync",@"result=%s", + (_result ? "YES" : "NO")); LOGObjectFnStop(); return _result; }; diff --git a/GSWeb.framework/GSWElement.h b/GSWeb.framework/GSWElement.h index 382b36d..140755b 100644 --- a/GSWeb.framework/GSWElement.h +++ b/GSWeb.framework/GSWElement.h @@ -48,6 +48,8 @@ extern BYTE ElementsMap_attributeElement; file:(const char*)file_ line:(int)line_; #endif + +-(NSString*)definitionName; //return nil (for non dynamic element) @end #ifdef NDEBBUG diff --git a/GSWeb.framework/GSWElement.m b/GSWeb.framework/GSWElement.m index fc16a24..52f0e40 100644 --- a/GSWeb.framework/GSWElement.m +++ b/GSWeb.framework/GSWElement.m @@ -72,6 +72,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41; }; }; #endif + +-(NSString*)definitionName +{ + return nil; //return nil (for non dynamic element) +}; @end //==================================================================== diff --git a/GSWeb.framework/GSWElementIDString.m b/GSWeb.framework/GSWElementIDString.m index fa6694f..f3bcacc 100644 --- a/GSWeb.framework/GSWElementIDString.m +++ b/GSWeb.framework/GSWElementIDString.m @@ -108,11 +108,11 @@ static char rcsId[] = "$Id$"; LOGObjectFnStart(); GSWLogAssertGood(self); GSWLogAssertGood(_string); - //GSWLogC("_string deallocate"); + GSWLogC("_string deallocate"); DESTROY(_string); - //GSWLogC("_string deallocated"); + GSWLogC("_string deallocated"); [super dealloc]; - //GSWLogC("GSWElementIDString end of dealloc"); + GSWLogC("GSWElementIDString end of dealloc"); }; -(void)getCString:(char*)buffer @@ -180,6 +180,110 @@ static char rcsId[] = "$Id$"; return obj; }; +-(BOOL)isSearchOverForSenderID:senderID +{ + BOOL over=NO; + if (senderID == nil) + [NSException raise:NSInvalidArgumentException + format:@"compare with nil"]; + else + { + BOOL finished=NO; + NSCharacterSet* nonNumericSet=[[NSCharacterSet decimalDigitCharacterSet] invertedSet]; + NSArray* selfElements=[self componentsSeparatedByString:@"."]; + NSArray* senderIDElements=[senderID componentsSeparatedByString:@"."]; + int i=0; + int selfElementsCount=[selfElements count]; + int senderIDElementsCount=[senderIDElements count]; + int count=min(selfElementsCount,senderIDElementsCount); + for(i=0;isenderIDIntValue) + over=YES; + } + else if (!selfElementIsNumeric && !selfAStringIsNumeric)//string comparison + { + if ([selfElement compare:senderIDElement]==NSOrderedDescending) + over=YES; + } + else + finished=YES; + }; + if (!over && !finished) + { + if (selfElementsCount>senderIDElementsCount) + over=YES; + }; + }; + return over; +} +/* +{ + NSComparisonResult result=NSOrderedSame; + if (aString == nil) + [NSException raise:NSInvalidArgumentException + format:@"compare with nil"]; + else if (mask!=0) //TODO + [NSException raise:NSInvalidArgumentException + format:@"no options are allowed in GSWElementIDString compare"]; + else if (aRange.location!=0) + [NSException raise:NSInvalidArgumentException + format:@"GSWElementIDString compare only on full string (range.location=%d instead of 0)", + aRange.location]; + else if (aRange.length!=[self length]) + [NSException raise:NSInvalidArgumentException + format:@"GSWElementIDString compare only on full string (range.length=%d instead of %d)", + aRange.length, + [self length]]; + else + { + NSCharacterSet* nonNumericSet=[[NSCharacterSet decimalDigitCharacterSet] invertedSet]; + NSArray* selfElements=[self componentsSeparatedByString:@"."]; + NSArray* aStringElements=[aString componentsSeparatedByString:@"."]; + int i=0; + int selfElementsCount=[selfElements count]; + int aStringElementsCount=[aStringElements count]; + int count=min(selfElementsCount,aStringElementsCount); + for(i=0;iaStringIntValue ? NSOrderedDescending : NSOrderedAscending)); + } + else if (selfElementIsNumeric) //we consider strictly num < string + result=NSOrderedAscending; + else if (selfAStringIsNumeric) //we consider strictly num < string + result=NSOrderedDescending; + else //string comparison + result=[selfElement compare:aStringElement]; + }; + if (result==NSOrderedSame) + { + if (selfElementsCountaStringElementsCount) + result=NSOrderedDescending; + }; + }; + return result; +} + +*/ + @end //==================================================================== diff --git a/GSWeb.framework/GSWForm.m b/GSWeb.framework/GSWForm.m index 1073407..3426f14 100644 --- a/GSWeb.framework/GSWForm.m +++ b/GSWeb.framework/GSWForm.m @@ -234,7 +234,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { //OK GSWElement* _element=nil; @@ -249,80 +249,98 @@ static char rcsId[] = "$Id$"; LOGObjectFnStartC("GSWForm"); _senderID=[context_ senderID]; _elementID=[context_ elementID]; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],_elementID,_senderID); + NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", + [self class],[self definitionName],_elementID,_senderID); NS_DURING - { - GSWAssertCorrectElementID(context_);// Debug Only - if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component - { - _isFormSubmited=[_elementID isEqualToString:_senderID]; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s", - [self class], - _elementID, - _senderID, - (_isFormSubmited ? "YES" : "NO")); - if (!WOStrictFlag && _isFormSubmited && [self disabledInContext:context_]) - _isFormSubmited=NO; - - if (_isFormSubmited) - { - [context_ setInForm:YES]; - [context_ _setFormSubmitted:YES]; - _multipleSubmit=[self evaluateCondition:multipleSubmit - inContext:context_]; - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _multipleSubmit=%s", - [self class], - _elementID, - _senderID, - (_multipleSubmit ? "YES" : "NO")); - [context_ _setIsMultipleSubmitForm:_multipleSubmit]; - }; - [context_ appendZeroElementIDComponent]; - for(i=0;!_element && i<[dynamicChildren count];i++) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[dynamicChildren objectAtIndex:i] class],[context_ elementID]); - _element=[[dynamicChildren objectAtIndex:i] invokeActionForRequest:request_ - inContext:context_]; - [context_ incrementLastElementIDComponent]; - }; - [context_ deleteLastElementIDComponent]; - if (_isFormSubmited) - { - if ([context_ _wasActionInvoked]) - [context_ _setIsMultipleSubmitForm:NO]; - else - { - NSDebugMLLog0(@"gswdync",@"formSubmitted but no action was invoked!"); - }; - [context_ setInForm:NO]; - [context_ _setFormSubmitted:NO]; - }; - _elementID=[context_ elementID]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],_elementID); + { + GSWAssertCorrectElementID(context_);// Debug Only + if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component + { + BOOL searchIsOver=NO; + _isFormSubmited=[_elementID isEqualToString:_senderID]; + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s", + [self class], + _elementID, + _senderID, + (_isFormSubmited ? "YES" : "NO")); + if (!WOStrictFlag && _isFormSubmited && [self disabledInContext:context_]) + _isFormSubmited=NO; + + if (_isFormSubmited) + { + [context_ setInForm:YES]; + [context_ _setFormSubmitted:YES]; + _multipleSubmit=[self evaluateCondition:multipleSubmit + inContext:context_]; + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _multipleSubmit=%s", + [self class], + _elementID, + _senderID, + (_multipleSubmit ? "YES" : "NO")); + [context_ _setIsMultipleSubmitForm:_multipleSubmit]; + }; + [context_ appendZeroElementIDComponent]; + 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_]; +// if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending) + if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID]) + { + NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", + [context_ elementID], + _senderID); + searchIsOver=YES; + }; + [context_ incrementLastElementIDComponent]; + }; + [context_ deleteLastElementIDComponent]; + if (_isFormSubmited) + { + if ([context_ _wasActionInvoked]) + [context_ _setIsMultipleSubmitForm:NO]; + else + { + NSDebugMLLog0(@"gswdync",@"formSubmitted but no action was invoked!"); + }; + [context_ setInForm:NO]; + [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"); + NSAssert(elementsNb==[(GSWElementIDString*)_elementID elementsNb], + @"GSWForm invokeActionForRequest: bad elementID"); #endif - }; - } + }; + } NS_HANDLER - { - LOGException0(@"exception in GSWForm invokeActionForRequest:inContext"); - LOGException(@"exception=%@",localException); - localException=ExceptionByAddingUserInfoObjectFrameInfo(localException, - @"In GSWForm invokeActionForRequest:inContext"); - LOGException(@"exception=%@",localException); - [localException raise]; - } + { + LOGException0(@"exception in GSWForm invokeActionForRequest:inContext"); + LOGException(@"exception=%@",localException); + localException=ExceptionByAddingUserInfoObjectFrameInfo(localException, + @"In GSWForm invokeActionForRequest:inContext"); + LOGException(@"exception=%@",localException); + [localException raise]; + } NS_ENDHANDLER; _senderID=[context_ senderID]; _elementID=[context_ elementID]; - if (![context_ _wasActionInvoked] && [_elementID compare:_senderID]!=NSOrderedAscending) - { - LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", - [self class], - _elementID, - _senderID); - }; + //if (![context_ _wasActionInvoked] && [_elementID compare:_senderID]!=NSOrderedAscending) + if (![context_ _wasActionInvoked] && [_elementID isSearchOverForSenderID:_senderID]) + { + LOGError(@"Action not invoked at the end of %@ (def name=%@) (id=%@) senderId=%@", + [self class], + [self definitionName], + _elementID, + _senderID); + }; LOGObjectFnStopC("GSWForm"); return _element; }; diff --git a/GSWeb.framework/GSWHTMLDynamicElement.m b/GSWeb.framework/GSWHTMLDynamicElement.m index 2e481d0..2347122 100644 --- a/GSWeb.framework/GSWHTMLDynamicElement.m +++ b/GSWeb.framework/GSWHTMLDynamicElement.m @@ -490,7 +490,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { //??? GSWElement* _element=nil; @@ -500,6 +500,8 @@ static char rcsId[] = "$Id$"; BYTE element=0; int elementsN[4]={0,0,0,0}; BOOL inChildren=NO; + BOOL searchIsOver=NO; + NSString* _senderID=nil; #ifndef NDEBUG NSString* debugElementID=nil; #endif @@ -507,62 +509,76 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); GSWAssertCorrectElementID(context_);// Debug Only - for(elementN=0;!_element && elementN<[elementsMap length];elementN++) - { - element=(BYTE)elements[elementN]; - if (element==ElementsMap_dynamicElement) - { - if (!inChildren) - { + _senderID=[context_ senderID]; + for(elementN=0;!_element && !searchIsOver && elementN<[elementsMap length];elementN++) + { + element=(BYTE)elements[elementN]; + if (element==ElementsMap_dynamicElement) + { + if (!inChildren) + { #ifndef NDEBUG - debugElementID=[context_ elementID]; + debugElementID=[context_ elementID]; #endif - [context_ appendZeroElementIDComponent]; - inChildren=YES; - }; - } - else - { - if (inChildren) - { - [context_ deleteLastElementIDComponent]; - inChildren=NO; + [context_ appendZeroElementIDComponent]; + inChildren=YES; + }; + } + else + { + if (inChildren) + { + [context_ deleteLastElementIDComponent]; + inChildren=NO; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; + if (![debugElementID isEqualToString:[context_ elementID]]) + { + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@", + [self class], + debugElementID, + [context_ elementID]); + + }; #endif - }; - }; - - if (element==ElementsMap_htmlBareString) - elementsN[0]++; - else if (element==ElementsMap_gswebElement) - elementsN[1]++; - else if (element==ElementsMap_dynamicElement) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[2]] class],[context_ elementID]); - _element=[[_dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:request_ - inContext:context_]; - [context_ incrementLastElementIDComponent]; - elementsN[2]++; - } - else if (element==ElementsMap_attributeElement) - elementsN[3]++; - }; + }; + }; + + if (element==ElementsMap_htmlBareString) + elementsN[0]++; + else if (element==ElementsMap_gswebElement) + elementsN[1]++; + else if (element==ElementsMap_dynamicElement) + { + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@", + [[_dynamicChildren objectAtIndex:elementsN[2]] class], + [context_ elementID]); + _element=[[_dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:request_ + inContext:context_]; + //if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending) + if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID]) + { + NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", + [context_ elementID], + _senderID); + searchIsOver=YES; + }; + [context_ incrementLastElementIDComponent]; + elementsN[2]++; + } + else if (element==ElementsMap_attributeElement) + elementsN[3]++; + }; if (inChildren) - { - [context_ deleteLastElementIDComponent]; + { + [context_ deleteLastElementIDComponent]; #ifndef NDEBUG - if (![debugElementID isEqualToString:[context_ elementID]]) - { - NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); - - }; + if (![debugElementID isEqualToString:[context_ elementID]]) + { + NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]); + + }; #endif - }; + }; NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); diff --git a/GSWeb.framework/GSWHTMLStaticElement.m b/GSWeb.framework/GSWHTMLStaticElement.m index 25918c7..3b2115b 100644 --- a/GSWeb.framework/GSWHTMLStaticElement.m +++ b/GSWeb.framework/GSWHTMLStaticElement.m @@ -354,7 +354,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ + inContext:(GSWContext*)context_ { //OK GSWElement* _element=nil; @@ -363,26 +363,37 @@ static char rcsId[] = "$Id$"; const BYTE* elements=[elementsMap bytes]; BYTE element=0; int elementsN[3]={0,0,0}; + BOOL searchIsOver=NO; + NSString* _senderID=nil; NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); GSWAssertCorrectElementID(context_);// Debug Only - for(elementN=0;!_element && elementN<[elementsMap length];elementN++) - { - element=(BYTE)elements[elementN]; - if (element==ElementsMap_htmlBareString) - elementsN[0]++; - else if (element==ElementsMap_dynamicElement) - { - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[1]] class],[context_ elementID]); - _element=[[_dynamicChildren objectAtIndex:elementsN[1]] invokeActionForRequest:request_ - inContext:context_]; - [context_ incrementLastElementIDComponent]; - elementsN[1]++; - } - else if (element==ElementsMap_attributeElement) - { - elementsN[2]++; - }; - }; + _senderID=[context_ senderID]; + for(elementN=0;!_element && !searchIsOver && elementN<[elementsMap length];elementN++) + { + element=(BYTE)elements[elementN]; + if (element==ElementsMap_htmlBareString) + elementsN[0]++; + else if (element==ElementsMap_dynamicElement) + { + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[1]] class],[context_ elementID]); + _element=[[_dynamicChildren objectAtIndex:elementsN[1]] invokeActionForRequest:request_ + inContext:context_]; +// if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending) + if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID]) + { + NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over", + [context_ elementID], + _senderID); + searchIsOver=YES; + }; + [context_ incrementLastElementIDComponent]; + elementsN[1]++; + } + else if (element==ElementsMap_attributeElement) + { + elementsN[2]++; + }; + }; NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); return _element; }; diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index e277932..aedb126 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -547,7 +547,9 @@ static char rcsId[] = "$Id$"; int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb]; #endif LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]); + NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@", + [self class],[self definitionName], + [context_ elementID],[context_ senderID]); GSWAssertCorrectElementID(context_);// Debug Only _senderID=[context_ senderID]; _elementID=[context_ elementID]; @@ -646,7 +648,8 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element); NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"END ET=%@ definition name=%@ id=%@", + [self class],[self definitionName],[context_ elementID]); #ifndef NDEBBUG NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWHyperlink invokeActionForRequest: bad elementID"); #endif diff --git a/GSWeb.framework/GSWImageButton.m b/GSWeb.framework/GSWImageButton.m index fa27c90..4c95bcf 100644 --- a/GSWeb.framework/GSWImageButton.m +++ b/GSWeb.framework/GSWImageButton.m @@ -201,7 +201,8 @@ static char rcsId[] = "$Id$"; _disabledInContext=[self disabledInContext:context_]; [response_ _appendContentAsciiString:@" type=image"]; _name=[self nameInContext:context_]; - NSDebugMLLog(@"gswdync",@"_name=%@",_name); + NSDebugMLLog(@"gswdync",@"definition name=%@ _name=%@", + [self definitionName],_name); [response_ _appendContentAsciiString:@" name=\""]; [response_ appendContentHTMLAttributeValue:_name]; [response_ appendContentCharacter:'"']; @@ -337,7 +338,8 @@ static char rcsId[] = "$Id$"; _senderID=[context_ senderID]; NSDebugMLog(@"_senderID=%@",_senderID); _elementID=[context_ elementID]; - NSDebugMLog(@"_elementID=%@",_elementID); + NSDebugMLog(@"definition name=%@ _elementID=%@", + [self definitionName],_elementID); if ([_elementID isEqualToString:_senderID]) { //TODO diff --git a/GSWeb.framework/GSWKeyValueAssociation.m b/GSWeb.framework/GSWKeyValueAssociation.m index bc9fa4a..aebdabc 100644 --- a/GSWeb.framework/GSWKeyValueAssociation.m +++ b/GSWeb.framework/GSWKeyValueAssociation.m @@ -107,11 +107,14 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(NSString*)description { + NSString* dscr=nil; GSWLogAssertGood(self); - return [NSString stringWithFormat:@"<%s %p - keyPath=%@>", - object_get_class_name(self), - (void*)self, - keyPath]; + dscr=[NSString stringWithFormat:@"<%s %p -", + object_get_class_name(self), + (void*)self]; + dscr=[dscr stringByAppendingFormat:@" keyPath=%@>", + keyPath]; + return dscr; }; @end diff --git a/GSWeb.framework/GSWSession.m b/GSWeb.framework/GSWSession.m index 3e920e8..8659a88 100644 --- a/GSWeb.framework/GSWSession.m +++ b/GSWeb.framework/GSWSession.m @@ -246,6 +246,7 @@ static char rcsId[] = "$Id$"; { //OK LOGObjectFnStart(); + NSDebugMLLog(@"sessions",@"newflag=%d",(int)_flag); storesIDsInCookies=_flag; LOGObjectFnStop(); }; diff --git a/GSWeb.framework/GSWSubmitButton.m b/GSWeb.framework/GSWSubmitButton.m index 805e3cf..a261d51 100644 --- a/GSWeb.framework/GSWSubmitButton.m +++ b/GSWeb.framework/GSWSubmitButton.m @@ -186,7 +186,8 @@ static char rcsId[] = "$Id$"; [localException raise]; } NS_ENDHANDLER; - if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]!=NSOrderedAscending) + //if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] compare:[context_ senderID]]!=NSOrderedAscending) + if (![context_ _wasActionInvoked] && [[[context_ elementID] parentElementIDString] isSearchOverForSenderID:[context_ senderID]]) { LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@", [self class], diff --git a/GSWeb.framework/GSWSwitchComponent.m b/GSWeb.framework/GSWSwitchComponent.m index 4bf6e2f..3cfa91f 100644 --- a/GSWeb.framework/GSWSwitchComponent.m +++ b/GSWeb.framework/GSWSwitchComponent.m @@ -35,24 +35,26 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStartC("GSWSwitchComponent"); if ((self=[super initWithName:name_ - associations:associations_ - template:nil])) - { - NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_]; - [_associations removeObjectForKey:GSWComponentName__Key]; + associations:associations_ + template:nil])) + { + NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_]; + NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: _associations=%@",_associations); + NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: GSWComponentName__Key=%@",GSWComponentName__Key[GSWebNamingConv]); + [_associations removeObjectForKey:GSWComponentName__Key[GSWebNamingConv]]; + + componentName = [[associations_ objectForKey:GSWComponentName__Key[GSWebNamingConv] + withDefaultObject:[componentName autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentName=%@",componentName); - componentName = [[associations_ objectForKey:GSWComponentName__Key - withDefaultObject:[componentName autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentName=%@",componentName); - - ASSIGN(componentAttributes,[NSDictionary dictionaryWithDictionary:_associations]); - NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentAttributes=%@",componentAttributes); - - ASSIGN(template,templateElement_); - NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: template=%@",template); - - componentCache=[NSMutableDictionary new]; - }; + ASSIGN(componentAttributes,[NSDictionary dictionaryWithDictionary:_associations]); + NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentAttributes=%@",componentAttributes); + + ASSIGN(template,templateElement_); + NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: template=%@",template); + + componentCache=[NSMutableDictionary new]; + }; LOGObjectFnStopC("GSWSwitchComponent"); return self; }; diff --git a/GSWeb.framework/GSWTemplateParserANTLR.m b/GSWeb.framework/GSWTemplateParserANTLR.m index db2b551..f45395e 100644 --- a/GSWeb.framework/GSWTemplateParserANTLR.m +++ b/GSWeb.framework/GSWTemplateParserANTLR.m @@ -397,7 +397,9 @@ static char rcsId[] = "$Id$"; associations:_associations template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease] languages:_languages]; - if (!element) + if (element) + [element setDefinitionName:[pageDefElement elementName]]; + else { ExceptionRaise(@"GSWTemplateParser", @"GSWTemplateParser: Creation failed for element named:%@ className:%@ in template named %@", diff --git a/GSWeb.framework/GSWTemplateParserXML.m b/GSWeb.framework/GSWTemplateParserXML.m index da50dcb..97a10be 100644 --- a/GSWeb.framework/GSWTemplateParserXML.m +++ b/GSWeb.framework/GSWTemplateParserXML.m @@ -834,7 +834,9 @@ text [Type:XML_TEXT_NODE] [{}] #### template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease] languages:_languages]; NSDebugMLog(@"node=%p element=%@",currentNode,elem); - if (!elem) + if (elem) + [elem setDefinitionName:[definitionsElement elementName]]; + else { ExceptionRaise(@"GSWTemplateParser", @"%@ Creation failed for element named:%@ className:%@", diff --git a/GSWeb.framework/GSWUtils.m b/GSWeb.framework/GSWUtils.m index c851b6d..8a6fc6b 100644 --- a/GSWeb.framework/GSWUtils.m +++ b/GSWeb.framework/GSWUtils.m @@ -1737,7 +1737,7 @@ NSData* HexStringToData(NSString* _string) //-------------------------------------------------------------------- -(NSString*)description { - return [NSString stringWithFormat:@"<%s %p - searchList:\n%@\n persDomains:\n%@\n tempDomains:\n%@\n changedDomains:\n%@\n dictionaryRep:\n%@\n defaultsDatabase:\n%@\n defaultsDatabaseLockName:\n%@\n defaultsDatabaseLock:\n%@\n tickingTimer:\n%@\n>", + return [NSString stringWithFormat:@"<%s %p - searchList:\n%@\n persDomains:\n%@\n tempDomains:\n%@\n changedDomains:\n%@\n dictionaryRep:\n%@\n defaultsDatabase:\n%@\n tickingTimer:\n%@\n>", object_get_class_name(self), (void*)self, _searchList, @@ -1746,8 +1746,6 @@ NSData* HexStringToData(NSString* _string) _changedDomains, _dictionaryRep, _defaultsDatabase, - _defaultsDatabaseLockName, - _defaultsDatabaseLock, _tickingTimer]; }; diff --git a/GSWeb.framework/NSObject+IVarAccess+PerformSel.m b/GSWeb.framework/NSObject+IVarAccess+PerformSel.m index ad6eeff..448cb12 100644 --- a/GSWeb.framework/NSObject+IVarAccess+PerformSel.m +++ b/GSWeb.framework/NSObject+IVarAccess+PerformSel.m @@ -179,18 +179,27 @@ const char* GSGetInstanceVariableType(id obj, - (id)getIVarNamed:(NSString *)name_ { - id value; + id value=nil; SEL sel = @selector(valueForKey:);//NEW NSSelectorFromString(@"valueForKey:"); - id (*imp)(id, SEL, id) = (id (*)(id, SEL, id))[NSObject instanceMethodForSelector: sel]; - +//MGNEW id (*imp)(id, SEL, id) = (id (*)(id, SEL, id))[NSObject instanceMethodForSelector: sel]; + NSDebugMLLog(@"low",@"getIVarNamed %@ in %@ %p (superClass:%@)", + name_, + [self class], + self, + [self superclass]); //NSLog(@"%@",name_); //NSLog(@"sel (valueForKey ) : %d", (int)sel); NS_DURING - //value = [self valueForKey:name_]; - value = (*imp)(self, sel, name_); + value = [self valueForKey:name_];//MGNEW + //MGNEW value = (*imp)(self, sel, name_); NS_HANDLER { + NSDebugMLLog(@"low",@"getIVarNamed %@ in %@ %p (superClass:%@). valueForKey: exception", + name_, + [self class], + self, + [self superclass]); if([self respondsToSelector:@selector(objectForKey:)] == YES) { if (name_) { value = [self objectForKey:name_]; @@ -219,7 +228,7 @@ const char* GSGetInstanceVariableType(id obj, withValue:(id)value_ { SEL sel = @selector(takeValue:forKey:);//NEW NSSelectorFromString(@"takeValue:forKey:"); - id (*imp)(id, SEL, id, id) = (id (*)(id, SEL, id, id))[NSObject instanceMethodForSelector: sel]; +//MGNEW id (*imp)(id, SEL, id, id) = (id (*)(id, SEL, id, id))[NSObject instanceMethodForSelector: sel]; //NSLog(@"sel (takeValue:forKey: ) : %d", (int)sel); @@ -227,8 +236,8 @@ const char* GSGetInstanceVariableType(id obj, //NSLog(@"setIVarNamed : self = %@", NSStringFromClass([self class])); //NSLog(@"setIVarNamed : name_ = %@ (%@)", name_, NSStringFromClass([name_ class])); //NSLog(@"setIVarNamed : value_ = %@ (%@)", value_, NSStringFromClass([value_ class])); - //[self takeValue:value_ forKey:name_]; - (*imp)(self, sel, value_, name_); + [self takeValue:value_ forKey:name_];//MGNEW + //MGNEW (*imp)(self, sel, value_, name_); NS_HANDLER { if (![name_ isEqualToString:@"self"]) { diff --git a/config.mak b/config.mak index 1d52d20..2e8a4ee 100644 --- a/config.mak +++ b/config.mak @@ -2,4 +2,4 @@ # # DYNAMIC_LINKER=simple -GDL2=yes +GDL2=no