2002-01-26 Manuel Guesdon <mguesdon@orange-concept.com>
* 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 git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@12219 72102866-910b-0410-8b05-ffd578937521
53
ChangeLog
|
@ -1,3 +1,56 @@
|
|||
2002-01-26 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
|
||||
* 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 <mguesdon@orange-concept.com>
|
||||
|
||||
* GSWeb.framework/GSWResourceManager.m: logs
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<b>Application:</b>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<gsweb name="ApplicationNameString"></gsweb>
|
||||
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<b>Erreur:</b>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<gsweb name="ExceptionNameString"></gsweb>
|
||||
<PRE><gsweb name="ExceptionNameString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -39,7 +39,7 @@
|
|||
</td>
|
||||
<td align="left" valign="top">
|
||||
<gsweb name="ReasonRepetition">
|
||||
<gsweb name="ReasonString"></gsweb><br>
|
||||
<PRE><gsweb name="ReasonString"></gsweb></PRE><br>
|
||||
</gsweb>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -53,10 +53,10 @@
|
|||
<gsweb name="UserInfoRowRepetition">
|
||||
<tr>
|
||||
<td align="right" valign="top">
|
||||
<b><gsweb name="UserInfoKeyString"></gsweb>:</b>
|
||||
<b><PRE><gsweb name="UserInfoKeyString"></gsweb>:</PRE></b>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<gsweb name="UserInfoValueString"></gsweb>
|
||||
<PRE><gsweb name="UserInfoValueString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
</gsweb>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<b>Application:</b>
|
||||
</td>
|
||||
<td align="LEFT" Valign="TOP">
|
||||
<gsweb name="ApplicationNameString"></gsweb>
|
||||
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<b>Error:</b>
|
||||
</td>
|
||||
<td align="LEFT" Valign="TOP">
|
||||
<gsweb name="ExceptionNameString"></gsweb>
|
||||
<PRE><gsweb name="ExceptionNameString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -39,7 +39,7 @@
|
|||
</td>
|
||||
<td align="LEFT" Valign="TOP">
|
||||
<gsweb name="ReasonRepetition">
|
||||
<gsweb name="ReasonString"></gsweb><br>
|
||||
<PRE><gsweb name="ReasonString"></gsweb></PRE><br>
|
||||
</gsweb>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -53,10 +53,10 @@
|
|||
<gsweb name="UserInfoRowRepetition">
|
||||
<tr>
|
||||
<td align="RIGHT" Valign="TOP">
|
||||
<b><gsweb name="UserInfoKeyString"></gsweb>:</b>
|
||||
<b><PRE><gsweb name="UserInfoKeyString"></gsweb>:</PRE></b>
|
||||
</td>
|
||||
<td align="LEFT" Valign="TOP">
|
||||
<gsweb name="UserInfoValueString"></gsweb>
|
||||
<PRE><gsweb name="UserInfoValueString"></gsweb></PRE>
|
||||
</td>
|
||||
</tr>
|
||||
</gsweb>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -224,7 +224,7 @@ PoweredByImage: GSWImage
|
|||
BORDER = 0;
|
||||
HEIGHT = 49;
|
||||
WIDTH = 221;
|
||||
filename = "PoweredByGNUstepWeb.gif";
|
||||
filename = "PoweredByGNUstepWeb.png";
|
||||
}
|
||||
|
||||
REFRESH: GSWSubmitButton
|
||||
|
|
BIN
GSWExtensions.framework/WebServerResources/Ascending.png
Normal file
After Width: | Height: | Size: 179 B |
BIN
GSWExtensions.framework/WebServerResources/Descending.png
Normal file
After Width: | Height: | Size: 177 B |
BIN
GSWExtensions.framework/WebServerResources/DownTriangle.png
Normal file
After Width: | Height: | Size: 477 B |
BIN
GSWExtensions.framework/WebServerResources/PoweredByGNUstep.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 5.3 KiB |
BIN
GSWExtensions.framework/WebServerResources/RightTriangle.png
Normal file
After Width: | Height: | Size: 485 B |
BIN
GSWExtensions.framework/WebServerResources/Unsorted.png
Normal file
After Width: | Height: | Size: 166 B |
BIN
GSWExtensions.framework/WebServerResources/appOff.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
GSWExtensions.framework/WebServerResources/appOn.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
GSWExtensions.framework/WebServerResources/back.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
GSWExtensions.framework/WebServerResources/dir.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
GSWExtensions.framework/WebServerResources/eye.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
GSWExtensions.framework/WebServerResources/gswapp.png
Normal file
After Width: | Height: | Size: 629 B |
BIN
GSWExtensions.framework/WebServerResources/gswappsrv.png
Normal file
After Width: | Height: | Size: 278 B |
BIN
GSWExtensions.framework/WebServerResources/lft-OSarw.png
Normal file
After Width: | Height: | Size: 252 B |
BIN
GSWExtensions.framework/WebServerResources/rt-OSarw.png
Normal file
After Width: | Height: | Size: 253 B |
BIN
GSWExtensions.framework/WebServerResources/text.png
Normal file
After Width: | Height: | Size: 285 B |
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -653,23 +653,33 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
for(i=0;!v && i<count;i++)
|
||||
{
|
||||
id language=[languages objectAtIndex:i];
|
||||
v=[retValue getIVarNamed:language];
|
||||
//MGNEW v=[retValue getIVarNamed:language];
|
||||
v=[retValue valueForKey:language];
|
||||
};
|
||||
retValue=v;
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL skipping = NO;
|
||||
NS_DURING
|
||||
|
||||
retValue=[retValue getIVarNamed:_part];
|
||||
|
||||
NS_HANDLER
|
||||
NSLog(@"Attempt to get %@/%@ raised an exception (%@)",[retValue class],_part,localException);
|
||||
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods" format:@"-[%@ %@]",[retValue class],_part];
|
||||
[localException raise];
|
||||
NS_ENDHANDLER
|
||||
};
|
||||
{
|
||||
BOOL skipping = NO;
|
||||
NSDebugMLLog(@"associations",@"call %@ valueForKey:%@",
|
||||
[retValue class],
|
||||
_part);
|
||||
NS_DURING
|
||||
{
|
||||
//MGNEW retValue=[retValue getIVarNamed:_part];
|
||||
retValue=[retValue valueForKey:_part];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Attempt to get %@ -%@ raised an exception (%@)",
|
||||
[retValue class],
|
||||
_part,
|
||||
localException);
|
||||
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods" format:@"-[%@ %@]",[retValue class],_part];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
};
|
||||
if (retValue==EONullNull)
|
||||
retValue=nil;
|
||||
};
|
||||
|
@ -740,17 +750,22 @@ if (retValue) {
|
|||
_object=nil;
|
||||
}
|
||||
else {
|
||||
_object=[_object getIVarNamed:_part];
|
||||
//MGNEW _object=[_object getIVarNamed:_part];
|
||||
_object=[_object valueForKey:_part];//MGNEW
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GSWLogAssertGood(_object);
|
||||
[_object setIVarNamed:_part
|
||||
withValue:value_];
|
||||
/* //MGNEW [_object setIVarNamed:_part
|
||||
withValue:value_];*/
|
||||
[_object takeValue:value_
|
||||
forKey:_part];//MGNEW
|
||||
#ifdef GDL2
|
||||
NSDebugMLLog(@"associations",@"object_ class=%@",[object_ class]);
|
||||
NSDebugMLLog(@"associations",@"_object class=%@",[_object class]);
|
||||
// Turbocat
|
||||
if (object_ && [object_ isKindOfClass:[GSWComponent class]]) {
|
||||
if (_object && [_object isKindOfClass:[GSWComponent class]]) {
|
||||
NSException* _exp = [_object validateValue:&value_ forKey:_part];
|
||||
|
||||
if (_exp) {
|
||||
|
|
|
@ -372,26 +372,42 @@ objectForReference:(NSString*)keyPath
|
|||
NSDictionary* variables=nil;
|
||||
NSEnumerator* variablesEnum=nil;
|
||||
id variableName=nil;
|
||||
//NSDebugMLLog(@"bundles",@"archive_:%@",archive_);
|
||||
NSDebugMLLog(@"bundles",@"archive_ %p:%@",archive_,archive_);
|
||||
unarchiver=[[[EOKeyValueUnarchiver alloc] initWithDictionary:archive_]
|
||||
autorelease];
|
||||
//NSDebugMLLog(@"bundles",@"unarchiver:%@",unarchiver);
|
||||
NSDebugMLLog(@"bundles",@"unarchiver %p:%@",unarchiver,unarchiver);
|
||||
bundleDelegate=[[[GSWBundleUnarchiverDelegate alloc] initWithObject:object_]
|
||||
autorelease];
|
||||
//NSDebugMLLog(@"bundles",@"bundleDelegate:%@",bundleDelegate);
|
||||
NSDebugMLLog(@"bundles",@"bundleDelegate %p:%@",bundleDelegate,bundleDelegate);
|
||||
[unarchiver setDelegate:bundleDelegate];
|
||||
//NSDebugMLLog(@"bundles",@"decodevar");
|
||||
NSDebugMLLog(@"bundles",@"decodevar here=%p",[NSString string]);
|
||||
variables=[unarchiver decodeObjectForKey:@"variables"];
|
||||
//NSDebugMLLog(@"bundles",@"variables:%@",variables);
|
||||
NSDebugMLLog(@"bundles",@"variables %p:%@",variables,variables);
|
||||
[unarchiver finishInitializationOfObjects];
|
||||
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
||||
[unarchiver awakeObjects];
|
||||
variablesEnum=[variables keyEnumerator];
|
||||
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
||||
NSDebugMLLog0(@"bundles",@"Will set variables");
|
||||
while ((variableName = [variablesEnum nextObject]))
|
||||
{
|
||||
id variableValue=[variables objectForKey:variableName];
|
||||
//NSDebugMLLog(@"bundles",@"variableName:%@ variableValue:%@",variableName,variableValue);
|
||||
NSDebugMLLog(@"bundles",@"ObjectClas=%@ variableName %p:%@ variableValue %p:%@",
|
||||
[object_ class],
|
||||
variableName,
|
||||
variableName,
|
||||
variableValue,
|
||||
variableValue);
|
||||
NSDebugMLLog(@"bundles",@"BEF variableValue %p:%@ [RC=%d]",
|
||||
variableValue,
|
||||
variableValue,
|
||||
[variableValue retainCount]);
|
||||
[object_ takeValue:variableValue
|
||||
forKey:variableName];
|
||||
NSDebugMLLog(@"bundles",@"AFT variableValue %p:%@ [RC=%d]",
|
||||
variableValue,
|
||||
variableValue,
|
||||
[variableValue retainCount]);
|
||||
};
|
||||
};
|
||||
#else
|
||||
|
|
|
@ -258,45 +258,10 @@ static char rcsId[] = "$Id$";
|
|||
//TODO
|
||||
NSString* _dscr=nil;
|
||||
GSWLogAssertGood(self);
|
||||
// GSWLogC("GSWComponent description A");
|
||||
NSDebugMLLog(@"gswcomponents",@"GSWComponent description Self=%p",self);
|
||||
_dscr=[NSString stringWithFormat:@"<%s %p - ",
|
||||
NSDebugMLLog(@"gswcomponents",@"GSWComponent description self=%p",self);
|
||||
_dscr=[NSString stringWithFormat:@"<%s %p>",
|
||||
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];
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
static char rcsId[] = "$Id$";
|
||||
|
||||
#include <GSWeb/GSWeb.h>
|
||||
|
||||
@class EOUndoManager;
|
||||
|
||||
//====================================================================
|
||||
@implementation GSWDisplayGroup
|
||||
|
@ -102,6 +102,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
if ((self=[self init]))
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswdisplaygroup",@"GSWDisplayGroup %p",self);
|
||||
[self setNumberOfObjectsPerBatch:
|
||||
[unarchiver decodeIntForKey:@"numberOfObjectsPerBatch"]];
|
||||
[self setFetchesOnLoad:
|
||||
|
@ -210,21 +211,85 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
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]: <EOEntityClassDescription: 0x1a3c7b0>
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
-(void)_notifySelectionChanged
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
[EOObserverCenter notifyObserversObjectWillChange:nil];//OK ?
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -280,7 +345,8 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
-(void)_notifyRowChanged:(int)row_
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
//-1 ==> nil ?
|
||||
[EOObserverCenter notifyObserversObjectWillChange:nil]; //VERIFY
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -292,9 +358,20 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
{
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
};
|
||||
|
||||
|
||||
-(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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
- (NSArray *)displayedObjects
|
||||
{
|
||||
//OK
|
||||
return _displayedObjects;
|
||||
}
|
||||
|
||||
|
@ -825,10 +904,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
// 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];//<EOUndoManager: 0x1832190> //WO45P3
|
||||
[undoManager removeAllActionsWithTarget:self];//WO45P3
|
||||
[_dataSource setQualifierBindings:_queryBindings];//WO45P3
|
||||
|
||||
if(_delegateRespondsTo.shouldFetchObjects == YES)
|
||||
fetch = [delegate displayGroupShouldFetch:self];
|
||||
|
@ -837,20 +924,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
{
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
-(void)redisplay
|
||||
{
|
||||
//VERIFY
|
||||
LOGObjectFnStart();
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
[self _notifyRowChanged:-1]; // -1 ??
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -1264,8 +1358,10 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
{
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
{
|
||||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
[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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
- (void)setInQueryMode:(BOOL)flag
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
//[self inQueryMode]//WO45P3
|
||||
_flags.queryMode = flag;
|
||||
LOGObjectFnStop();
|
||||
}
|
||||
|
@ -1661,12 +1786,21 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
|
||||
- (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: <EOKeyValueUnarchiver: 0x1a84d20>
|
|||
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)
|
||||
|
|
|
@ -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
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -72,6 +72,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
-(NSString*)definitionName
|
||||
{
|
||||
return nil; //return nil (for non dynamic element)
|
||||
};
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -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;i<count && !over && !finished;i++)
|
||||
{
|
||||
NSString* selfElement=[selfElements objectAtIndex:i];
|
||||
NSString* senderIDElement=[senderIDElements objectAtIndex:i];
|
||||
BOOL selfElementIsNumeric=[selfElement rangeOfCharacterFromSet:nonNumericSet].length==0;
|
||||
BOOL selfAStringIsNumeric=[senderIDElement rangeOfCharacterFromSet:nonNumericSet].length==0;
|
||||
if (selfElementIsNumeric && selfAStringIsNumeric) //Numeric comparison
|
||||
{
|
||||
int selfIntValue=[selfElement intValue];
|
||||
int senderIDIntValue=[senderIDElement intValue];
|
||||
if (selfIntValue>senderIDIntValue)
|
||||
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;i<count && result==NSOrderedSame;i++)
|
||||
{
|
||||
NSString* selfElement=[selfElements objectAtIndex:i];
|
||||
NSString* aStringElement=[aStringElements objectAtIndex:i];
|
||||
BOOL selfElementIsNumeric=[selfElement rangeOfCharacterFromSet:nonNumericSet].length==0;
|
||||
BOOL selfAStringIsNumeric=[aStringElement rangeOfCharacterFromSet:nonNumericSet].length==0;
|
||||
if (selfElementIsNumeric && selfAStringIsNumeric) //Numeric comparison
|
||||
{
|
||||
int selfIntValue=[selfElement intValue];
|
||||
int aStringIntValue=[aStringElement intValue];
|
||||
result=(selfIntValue==aStringIntValue ? 0 : (selfIntValue>aStringIntValue ? 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 (selfElementsCount<aStringElementsCount)
|
||||
result=NSOrderedAscending;
|
||||
else if (selfElementsCount>aStringElementsCount)
|
||||
result=NSOrderedDescending;
|
||||
};
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -246,6 +246,7 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"sessions",@"newflag=%d",(int)_flag);
|
||||
storesIDsInCookies=_flag;
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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 %@",
|
||||
|
|
|
@ -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:%@",
|
||||
|
|
|
@ -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];
|
||||
};
|
||||
|
||||
|
|
|
@ -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 <NSObject>) : %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: <NSObject>) : %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"]) {
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
#
|
||||
#
|
||||
DYNAMIC_LINKER=simple
|
||||
GDL2=yes
|
||||
GDL2=no
|
||||
|
|