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>
|
2001-12-11 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
|
||||||
* GSWeb.framework/GSWResourceManager.m: logs
|
* GSWeb.framework/GSWResourceManager.m: logs
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<b>Application:</b>
|
<b>Application:</b>
|
||||||
</td>
|
</td>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<gsweb name="ApplicationNameString"></gsweb>
|
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<b>Erreur:</b>
|
<b>Erreur:</b>
|
||||||
</td>
|
</td>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<gsweb name="ExceptionNameString"></gsweb>
|
<PRE><gsweb name="ExceptionNameString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<gsweb name="ReasonRepetition">
|
<gsweb name="ReasonRepetition">
|
||||||
<gsweb name="ReasonString"></gsweb><br>
|
<PRE><gsweb name="ReasonString"></gsweb></PRE><br>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -53,10 +53,10 @@
|
||||||
<gsweb name="UserInfoRowRepetition">
|
<gsweb name="UserInfoRowRepetition">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right" valign="top">
|
<td align="right" valign="top">
|
||||||
<b><gsweb name="UserInfoKeyString"></gsweb>:</b>
|
<b><PRE><gsweb name="UserInfoKeyString"></gsweb>:</PRE></b>
|
||||||
</td>
|
</td>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<gsweb name="UserInfoValueString"></gsweb>
|
<PRE><gsweb name="UserInfoValueString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
|
|
|
@ -72,24 +72,24 @@ French
|
||||||
GSWExtensions_RESOURCE_DIRS =
|
GSWExtensions_RESOURCE_DIRS =
|
||||||
|
|
||||||
GSWExtensions_WEBSERVER_RESOURCE_FILES = \
|
GSWExtensions_WEBSERVER_RESOURCE_FILES = \
|
||||||
Ascending.gif \
|
Ascending.png \
|
||||||
Descending.gif \
|
Descending.png \
|
||||||
DownTriangle.gif \
|
DownTriangle.png \
|
||||||
PoweredByGNUstep.gif \
|
PoweredByGNUstep.png \
|
||||||
PoweredByGNUstepWeb.gif \
|
PoweredByGNUstepWeb.png \
|
||||||
RightTriangle.gif \
|
RightTriangle.png \
|
||||||
Unsorted.gif \
|
Unsorted.png \
|
||||||
appOff.gif \
|
appOff.png \
|
||||||
appOn.gif \
|
appOn.png \
|
||||||
back.gif \
|
back.png \
|
||||||
dir.gif \
|
dir.png \
|
||||||
exclamation.gif \
|
exclamation.gif \
|
||||||
eye.gif \
|
eye.png \
|
||||||
lft-OSarw.gif \
|
lft-OSarw.png \
|
||||||
rt-OSarw.gif \
|
rt-OSarw.png \
|
||||||
text.gif \
|
text.png \
|
||||||
gswapp.gif \
|
gswapp.png \
|
||||||
gswappsrv.gif \
|
gswappsrv.png \
|
||||||
warning.gif \
|
warning.gif \
|
||||||
error.gif
|
error.gif
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@
|
||||||
else if ([self hasBinding:@"helpString"])
|
else if ([self hasBinding:@"helpString"])
|
||||||
ASSIGN(openedImageFileName,[self valueForBinding:@"helpString"]);
|
ASSIGN(openedImageFileName,[self valueForBinding:@"helpString"]);
|
||||||
else
|
else
|
||||||
ASSIGN(openedImageFileName,@"DownTriangle.gif");
|
ASSIGN(openedImageFileName,@"DownTriangle.png");
|
||||||
};
|
};
|
||||||
_image=openedImageFileName;
|
_image=openedImageFileName;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
else if ([self hasBinding:@"helpString"])
|
else if ([self hasBinding:@"helpString"])
|
||||||
ASSIGN(closedImageFileName,[self valueForBinding:@"helpString"]);
|
ASSIGN(closedImageFileName,[self valueForBinding:@"helpString"]);
|
||||||
else
|
else
|
||||||
ASSIGN(closedImageFileName,@"RightTriangle.gif");
|
ASSIGN(closedImageFileName,@"RightTriangle.png");
|
||||||
};
|
};
|
||||||
_image=closedImageFileName;
|
_image=closedImageFileName;
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<b>Application:</b>
|
<b>Application:</b>
|
||||||
</td>
|
</td>
|
||||||
<td align="LEFT" Valign="TOP">
|
<td align="LEFT" Valign="TOP">
|
||||||
<gsweb name="ApplicationNameString"></gsweb>
|
<PRE><gsweb name="ApplicationNameString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<b>Error:</b>
|
<b>Error:</b>
|
||||||
</td>
|
</td>
|
||||||
<td align="LEFT" Valign="TOP">
|
<td align="LEFT" Valign="TOP">
|
||||||
<gsweb name="ExceptionNameString"></gsweb>
|
<PRE><gsweb name="ExceptionNameString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td align="LEFT" Valign="TOP">
|
<td align="LEFT" Valign="TOP">
|
||||||
<gsweb name="ReasonRepetition">
|
<gsweb name="ReasonRepetition">
|
||||||
<gsweb name="ReasonString"></gsweb><br>
|
<PRE><gsweb name="ReasonString"></gsweb></PRE><br>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -53,10 +53,10 @@
|
||||||
<gsweb name="UserInfoRowRepetition">
|
<gsweb name="UserInfoRowRepetition">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="RIGHT" Valign="TOP">
|
<td align="RIGHT" Valign="TOP">
|
||||||
<b><gsweb name="UserInfoKeyString"></gsweb>:</b>
|
<b><PRE><gsweb name="UserInfoKeyString"></gsweb>:</PRE></b>
|
||||||
</td>
|
</td>
|
||||||
<td align="LEFT" Valign="TOP">
|
<td align="LEFT" Valign="TOP">
|
||||||
<gsweb name="UserInfoValueString"></gsweb>
|
<PRE><gsweb name="UserInfoValueString"></gsweb></PRE>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
{
|
{
|
||||||
if (!reasons)
|
if (!reasons)
|
||||||
{
|
{
|
||||||
ASSIGN(reasons,[[exception description] componentsSeparatedByString:@"\n"]);
|
ASSIGN(reasons,[[exception reason] componentsSeparatedByString:@"\n"]);
|
||||||
};
|
};
|
||||||
return reasons;
|
return reasons;
|
||||||
};
|
};
|
||||||
|
@ -69,4 +69,12 @@
|
||||||
ASSIGN(exception,exception_);
|
ASSIGN(exception,exception_);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
-(id)getTmpUserInfoValue
|
||||||
|
{
|
||||||
|
//If array, print it nicely
|
||||||
|
if ([tmpUserInfoValue isKindOfClass:[NSArray class]])
|
||||||
|
return [tmpUserInfoValue componentsJoinedByString:@"\n"];
|
||||||
|
else
|
||||||
|
return tmpUserInfoValue;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -224,7 +224,7 @@ PoweredByImage: GSWImage
|
||||||
BORDER = 0;
|
BORDER = 0;
|
||||||
HEIGHT = 49;
|
HEIGHT = 49;
|
||||||
WIDTH = 221;
|
WIDTH = 221;
|
||||||
filename = "PoweredByGNUstepWeb.gif";
|
filename = "PoweredByGNUstepWeb.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
REFRESH: GSWSubmitButton
|
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();
|
LOGObjectFnStart();
|
||||||
NSDebugMLog(@"user=%@ password=%@",user,password);
|
NSDebugMLog(@"user=%@ password=%@",user,password);
|
||||||
NSDebugMLog(@"associationsKeys=%@",associationsKeys);
|
NSDebugMLog(@"associationsKeys=%@",associationsKeys);
|
||||||
if ([self hasBinding:@"password"])
|
NS_DURING
|
||||||
|
{
|
||||||
|
if ([self hasBinding:@"password"])
|
||||||
{
|
{
|
||||||
if ([self hasBinding:@"user"])
|
if ([self hasBinding:@"user"])
|
||||||
{
|
{
|
||||||
_bindingOk=YES;
|
_bindingOk=YES;
|
||||||
[self setValue:user
|
[self setValue:user
|
||||||
forBinding:@"user"];
|
forBinding:@"user"];
|
||||||
}
|
}
|
||||||
else if ([self hasBinding:@"login"])
|
else if ([self hasBinding:@"login"])
|
||||||
{
|
{
|
||||||
_bindingOk=YES;
|
_bindingOk=YES;
|
||||||
[self setValue:user
|
[self setValue:user
|
||||||
forBinding:@"login"];
|
forBinding:@"login"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLog(@"_bindingOk=%s",(_bindingOk ? "YES" : "NO"));
|
NSDebugMLog(@"_bindingOk=%s",(_bindingOk ? "YES" : "NO"));
|
||||||
if (_bindingOk)
|
if (_bindingOk)
|
||||||
{
|
{
|
||||||
[self setValue:password
|
[self setValue:password
|
||||||
forBinding:@"password"];
|
forBinding:@"password"];
|
||||||
_nextPage=[[self parent] validateLogin];
|
_nextPage=[[self parent] validateLogin];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_nextPage=[[self parent] validateLoginUser:user
|
_nextPage=[[self parent] validateLoginUser:user
|
||||||
password:password];
|
password:password];
|
||||||
if ([self hasBinding:@"message"])
|
if ([self hasBinding:@"message"])
|
||||||
{
|
{
|
||||||
message=[self valueForBinding:@"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();
|
LOGObjectFnStop();
|
||||||
return _nextPage;
|
return _nextPage;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1106,7 +1106,7 @@ int GSWApplicationMain(NSString* applicationClassName,
|
||||||
};
|
};
|
||||||
|
|
||||||
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)_name
|
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)_name
|
||||||
languages:(NSArray*)_languages
|
languages:(NSArray*)_languages
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
BOOL isCachedComponent=NO;
|
BOOL isCachedComponent=NO;
|
||||||
|
@ -1114,87 +1114,88 @@ int GSWApplicationMain(NSString* applicationClassName,
|
||||||
NSString* _language=nil;
|
NSString* _language=nil;
|
||||||
int iLanguage=0;
|
int iLanguage=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"application",@"_Name=%@",_name);
|
NSDebugMLLog(@"application",@"_Name %p=%@",_name,_name);
|
||||||
for(iLanguage=0;iLanguage<[_languages count] && !_componentDefinition;iLanguage++)
|
for(iLanguage=0;iLanguage<[_languages count] && !_componentDefinition;iLanguage++)
|
||||||
{
|
{
|
||||||
_language=[_languages objectAtIndex:iLanguage];
|
_language=[_languages objectAtIndex:iLanguage];
|
||||||
if (_language)
|
if (_language)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswcomponents",@"trying _language=%@",_language);
|
NSDebugMLLog(@"gswcomponents",@"trying _language=%@",_language);
|
||||||
NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO"));
|
NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO"));
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
_componentDefinition=[componentDefinitionCache objectForKeys:_name,_language,nil];
|
_componentDefinition=[componentDefinitionCache objectForKeys:_name,_language,nil];
|
||||||
if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker)
|
if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker)
|
||||||
_componentDefinition=nil;
|
_componentDefinition=nil;
|
||||||
else if (_componentDefinition)
|
else if (_componentDefinition)
|
||||||
isCachedComponent=YES;
|
isCachedComponent=YES;
|
||||||
};
|
};
|
||||||
if (!_componentDefinition)
|
if (!_componentDefinition)
|
||||||
{
|
{
|
||||||
_componentDefinition=[self lockedLoadComponentDefinitionWithName:_name
|
_componentDefinition=[self lockedLoadComponentDefinitionWithName:_name
|
||||||
language:_language];
|
language:_language];
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
if (_componentDefinition)
|
if (_componentDefinition)
|
||||||
[componentDefinitionCache setObject:_componentDefinition
|
[componentDefinitionCache setObject:_componentDefinition
|
||||||
forKeys:_name,_language,nil];
|
forKeys:_name,_language,nil];
|
||||||
else
|
else
|
||||||
[componentDefinitionCache setObject:GSNotFoundMarker
|
[componentDefinitionCache setObject:GSNotFoundMarker
|
||||||
forKeys:_name,_language,nil];
|
forKeys:_name,_language,nil];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_componentDefinition)
|
if (!_componentDefinition)
|
||||||
{
|
{
|
||||||
_language=nil;
|
_language=nil;
|
||||||
NSDebugMLLog0(@"application",@"trying no language");
|
NSDebugMLLog0(@"application",@"trying no language");
|
||||||
NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO"));
|
NSDebugMLLog(@"gswcomponents",@"[self isCachingEnabled]=%s",([self isCachingEnabled] ? "YES" : "NO"));
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
_componentDefinition=[componentDefinitionCache objectForKeys:_name,nil];
|
_componentDefinition=[componentDefinitionCache objectForKeys:_name,nil];
|
||||||
if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker)
|
if (_componentDefinition==(GSWComponentDefinition*)GSNotFoundMarker)
|
||||||
_componentDefinition=nil;
|
_componentDefinition=nil;
|
||||||
else if (_componentDefinition)
|
else if (_componentDefinition)
|
||||||
isCachedComponent=YES;
|
isCachedComponent=YES;
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswcomponents",@"D componentDefinition for %@ %s cached",_name,(_componentDefinition ? "" : "NOT"));
|
NSDebugMLLog(@"gswcomponents",@"D componentDefinition for %@ %s cached",_name,(_componentDefinition ? "" : "NOT"));
|
||||||
if (!_componentDefinition)
|
if (!_componentDefinition)
|
||||||
{
|
{
|
||||||
_componentDefinition=[self lockedLoadComponentDefinitionWithName:_name
|
_componentDefinition=[self lockedLoadComponentDefinitionWithName:_name
|
||||||
language:_language];
|
language:_language];
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
if (_componentDefinition)
|
if (_componentDefinition)
|
||||||
[componentDefinitionCache setObject:_componentDefinition
|
[componentDefinitionCache setObject:_componentDefinition
|
||||||
forKeys:_name,nil];
|
forKeys:_name,nil];
|
||||||
else
|
else
|
||||||
[componentDefinitionCache setObject:GSNotFoundMarker
|
[componentDefinitionCache setObject:GSNotFoundMarker
|
||||||
forKeys:_name,nil];
|
forKeys:_name,nil];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_componentDefinition)
|
if (!_componentDefinition)
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWApplication",
|
ExceptionRaise(@"GSWApplication",
|
||||||
@"Unable to create component definition for %@ for languages: %@ (no componentDefinition).",
|
@"Unable to create component definition for %@ for languages: %@ (no componentDefinition).",
|
||||||
_name,
|
_name,
|
||||||
_languages);
|
_languages);
|
||||||
};
|
};
|
||||||
if (_componentDefinition)
|
if (_componentDefinition)
|
||||||
{
|
{
|
||||||
[self statusDebugWithFormat:@"Component %@ %s language %@ (%sCached)",
|
[self statusDebugWithFormat:@"Component %@ %s language %@ (%sCached)",
|
||||||
_name,
|
_name,
|
||||||
(_language ? "" : "no"),
|
(_language ? "" : "no"),
|
||||||
(_language ? _language : @""),
|
(_language ? _language : @""),
|
||||||
(isCachedComponent ? "" : "Not ")];
|
(isCachedComponent ? "" : "Not ")];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"application",@"%s componentDefinition for %@ class=%@ %s",
|
NSDebugMLLog(@"application",@"%s componentDefinition (%p) for %@ class=%@ %s",
|
||||||
(_componentDefinition ? "FOUND" : "NOTFOUND"),
|
(_componentDefinition ? "FOUND" : "NOTFOUND"),
|
||||||
_name,
|
_componentDefinition,
|
||||||
(_componentDefinition ? [[_componentDefinition class] description]: @""),
|
_name,
|
||||||
(_componentDefinition ? (isCachedComponent ? "(Cached)" : "(Not Cached)") : ""));
|
(_componentDefinition ? [[_componentDefinition class] description]: @""),
|
||||||
|
(_componentDefinition ? (isCachedComponent ? "(Cached)" : "(Not Cached)") : ""));
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _componentDefinition;
|
return _componentDefinition;
|
||||||
};
|
};
|
||||||
|
@ -2007,60 +2008,63 @@ int GSWApplicationMain(NSString* applicationClassName,
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWComponent*)_pageWithName:(NSString*)name_
|
-(GSWComponent*)_pageWithName:(NSString*)name_
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)context_
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponent* _component=nil;
|
GSWComponent* _component=nil;
|
||||||
GSWComponentDefinition* _componentDefinition=nil;
|
GSWComponentDefinition* _componentDefinition=nil;
|
||||||
NSArray* _languages=nil;
|
NSArray* _languages=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"info",@"name_=%@",name_);
|
NSDebugMLLog(@"info",@"name_ %p=%@",name_,name_);
|
||||||
NSAssert(context_,@"No Context");
|
NSAssert(context_,@"No Context");
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
if ([name_ length]<=0)
|
if ([name_ length]<=0)
|
||||||
name_=[self defaultPageName];//NDFN
|
name_=[self defaultPageName];//NDFN
|
||||||
if ([name_ length]<=0)
|
if ([name_ length]<=0)
|
||||||
name_=GSWMainPageName;
|
name_=GSWMainPageName;
|
||||||
_languages=[context_ languages];
|
_languages=[context_ languages];
|
||||||
_componentDefinition=[self lockedComponentDefinitionWithName:name_
|
_componentDefinition=[self lockedComponentDefinitionWithName:name_
|
||||||
languages:_languages];
|
languages:_languages];
|
||||||
NSDebugMLLog(@"application",@"_componentDefinition=%@ (%@)",_componentDefinition,[_componentDefinition class]);
|
NSDebugMLLog(@"info",@"_componentDefinition %p=%@ (%@)",
|
||||||
}
|
_componentDefinition,
|
||||||
|
_componentDefinition,
|
||||||
|
[_componentDefinition class]);
|
||||||
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedComponentDefinitionWithName:");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedComponentDefinitionWithName:");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
if (!_componentDefinition)
|
if (!_componentDefinition)
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
NSDebugMLLog0(@"application",@"GSWApplication _pageWithName no _componentDefinition");
|
NSDebugMLLog0(@"info",@"GSWApplication _pageWithName no _componentDefinition");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSAssert(context_,@"No Context");
|
NSAssert(context_,@"No Context");
|
||||||
_component=[_componentDefinition componentInstanceInContext:context_];
|
_component=[_componentDefinition componentInstanceInContext:context_];
|
||||||
NSAssert(context_,@"No Context");
|
NSAssert(context_,@"No Context");
|
||||||
[_component awakeInContext:context_];
|
[_component awakeInContext:context_];
|
||||||
[_component _setIsPage:YES];
|
[_component _setIsPage:YES];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In componentInstanceInContext:");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In componentInstanceInContext:");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -2073,9 +2077,9 @@ int GSWApplicationMain(NSString* applicationClassName,
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)dynamicElementWithName:(NSString*)name_
|
-(GSWElement*)dynamicElementWithName:(NSString*)name_
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations_
|
||||||
template:(GSWElement*)templateElement_
|
template:(GSWElement*)templateElement_
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages_
|
||||||
{
|
{
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
[self lock];
|
[self lock];
|
||||||
|
@ -2099,47 +2103,47 @@ int GSWApplicationMain(NSString* applicationClassName,
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)lockedDynamicElementWithName:(NSString*)name_
|
-(GSWElement*)lockedDynamicElementWithName:(NSString*)name_
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations_
|
||||||
template:(GSWElement*)templateElement_
|
template:(GSWElement*)templateElement_
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages_
|
||||||
{
|
{
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
Class _elementClass=nil;
|
Class _elementClass=nil;
|
||||||
//lock bundle
|
//lock bundle
|
||||||
//unlock bundle
|
//unlock bundle
|
||||||
if ([associations_ isAssociationDebugEnabledInComponent:nil])
|
if ([associations_ isAssociationDebugEnabledInComponent:nil])
|
||||||
[associations_ associationsSetDebugEnabled];
|
[associations_ associationsSetDebugEnabled];
|
||||||
_elementClass=NSClassFromString(name_);
|
_elementClass=NSClassFromString(name_);
|
||||||
NSDebugMLLog(@"application",@"_elementClass:%@",_elementClass);
|
NSDebugMLLog(@"info",@"_elementClass %p:%@",_elementClass,_elementClass);
|
||||||
NSDebugMLLog(@"application",@"_elementClass superClass:%@",[_elementClass superClass]);
|
NSDebugMLLog(@"info",@"_elementClass superClass:%@",[_elementClass superClass]);
|
||||||
if (_elementClass && !ClassIsKindOfClass(_elementClass,NSClassFromString(@"GSWComponent")))
|
if (_elementClass && !ClassIsKindOfClass(_elementClass,NSClassFromString(@"GSWComponent")))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"application",@"CREATE Element of Class:%@",name_);
|
NSDebugMLLog(@"info",@"CREATE Element of Class %p:%@",name_,name_);
|
||||||
_element=[[[_elementClass alloc] initWithName:name_
|
_element=[[[_elementClass alloc] initWithName:name_
|
||||||
associations:associations_
|
associations:associations_
|
||||||
template:templateElement_]
|
template:templateElement_]
|
||||||
autorelease];
|
autorelease];
|
||||||
NSDebugMLLog(@"application",@"Created Element: %@",_element);
|
NSDebugMLLog(@"info",@"Created Element %p: %@",_element,_element);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSWComponentDefinition* _componentDefinition=nil;
|
GSWComponentDefinition* _componentDefinition=nil;
|
||||||
_componentDefinition=[self lockedComponentDefinitionWithName:name_
|
_componentDefinition=[self lockedComponentDefinitionWithName:name_
|
||||||
languages:languages_];
|
languages:languages_];
|
||||||
if (_componentDefinition)
|
if (_componentDefinition)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"application",@"CREATE SubComponent:%@",name_);
|
NSDebugMLLog(@"info",@"CREATE SubComponent %p:%@",name_,name_);
|
||||||
_element=[_componentDefinition componentReferenceWithAssociations:associations_
|
_element=[_componentDefinition componentReferenceWithAssociations:associations_
|
||||||
template:templateElement_];
|
template:templateElement_];
|
||||||
NSDebugMLLog(@"application",@"Created SubComponent: %@",_element);
|
NSDebugMLLog(@"info",@"Created SubComponent %p: %@",_element,_element);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWApplication",
|
ExceptionRaise(@"GSWApplication",
|
||||||
@"GSWApplication: Component Definition named '%@' not found or can't be created",
|
@"GSWApplication: Component Definition named '%@' not found or can't be created",
|
||||||
name_);
|
name_);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return _element;
|
return _element;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -653,23 +653,33 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
||||||
for(i=0;!v && i<count;i++)
|
for(i=0;!v && i<count;i++)
|
||||||
{
|
{
|
||||||
id language=[languages objectAtIndex:i];
|
id language=[languages objectAtIndex:i];
|
||||||
v=[retValue getIVarNamed:language];
|
//MGNEW v=[retValue getIVarNamed:language];
|
||||||
|
v=[retValue valueForKey:language];
|
||||||
};
|
};
|
||||||
retValue=v;
|
retValue=v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BOOL skipping = NO;
|
BOOL skipping = NO;
|
||||||
NS_DURING
|
NSDebugMLLog(@"associations",@"call %@ valueForKey:%@",
|
||||||
|
[retValue class],
|
||||||
retValue=[retValue getIVarNamed:_part];
|
_part);
|
||||||
|
NS_DURING
|
||||||
NS_HANDLER
|
{
|
||||||
NSLog(@"Attempt to get %@/%@ raised an exception (%@)",[retValue class],_part,localException);
|
//MGNEW retValue=[retValue getIVarNamed:_part];
|
||||||
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods" format:@"-[%@ %@]",[retValue class],_part];
|
retValue=[retValue valueForKey:_part];
|
||||||
[localException raise];
|
}
|
||||||
NS_ENDHANDLER
|
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)
|
if (retValue==EONullNull)
|
||||||
retValue=nil;
|
retValue=nil;
|
||||||
};
|
};
|
||||||
|
@ -740,17 +750,22 @@ if (retValue) {
|
||||||
_object=nil;
|
_object=nil;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_object=[_object getIVarNamed:_part];
|
//MGNEW _object=[_object getIVarNamed:_part];
|
||||||
|
_object=[_object valueForKey:_part];//MGNEW
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSWLogAssertGood(_object);
|
GSWLogAssertGood(_object);
|
||||||
[_object setIVarNamed:_part
|
/* //MGNEW [_object setIVarNamed:_part
|
||||||
withValue:value_];
|
withValue:value_];*/
|
||||||
|
[_object takeValue:value_
|
||||||
|
forKey:_part];//MGNEW
|
||||||
#ifdef GDL2
|
#ifdef GDL2
|
||||||
|
NSDebugMLLog(@"associations",@"object_ class=%@",[object_ class]);
|
||||||
|
NSDebugMLLog(@"associations",@"_object class=%@",[_object class]);
|
||||||
// Turbocat
|
// Turbocat
|
||||||
if (object_ && [object_ isKindOfClass:[GSWComponent class]]) {
|
if (_object && [_object isKindOfClass:[GSWComponent class]]) {
|
||||||
NSException* _exp = [_object validateValue:&value_ forKey:_part];
|
NSException* _exp = [_object validateValue:&value_ forKey:_part];
|
||||||
|
|
||||||
if (_exp) {
|
if (_exp) {
|
||||||
|
|
|
@ -372,26 +372,42 @@ objectForReference:(NSString*)keyPath
|
||||||
NSDictionary* variables=nil;
|
NSDictionary* variables=nil;
|
||||||
NSEnumerator* variablesEnum=nil;
|
NSEnumerator* variablesEnum=nil;
|
||||||
id variableName=nil;
|
id variableName=nil;
|
||||||
//NSDebugMLLog(@"bundles",@"archive_:%@",archive_);
|
NSDebugMLLog(@"bundles",@"archive_ %p:%@",archive_,archive_);
|
||||||
unarchiver=[[[EOKeyValueUnarchiver alloc] initWithDictionary:archive_]
|
unarchiver=[[[EOKeyValueUnarchiver alloc] initWithDictionary:archive_]
|
||||||
autorelease];
|
autorelease];
|
||||||
//NSDebugMLLog(@"bundles",@"unarchiver:%@",unarchiver);
|
NSDebugMLLog(@"bundles",@"unarchiver %p:%@",unarchiver,unarchiver);
|
||||||
bundleDelegate=[[[GSWBundleUnarchiverDelegate alloc] initWithObject:object_]
|
bundleDelegate=[[[GSWBundleUnarchiverDelegate alloc] initWithObject:object_]
|
||||||
autorelease];
|
autorelease];
|
||||||
//NSDebugMLLog(@"bundles",@"bundleDelegate:%@",bundleDelegate);
|
NSDebugMLLog(@"bundles",@"bundleDelegate %p:%@",bundleDelegate,bundleDelegate);
|
||||||
[unarchiver setDelegate:bundleDelegate];
|
[unarchiver setDelegate:bundleDelegate];
|
||||||
//NSDebugMLLog(@"bundles",@"decodevar");
|
NSDebugMLLog(@"bundles",@"decodevar here=%p",[NSString string]);
|
||||||
variables=[unarchiver decodeObjectForKey:@"variables"];
|
variables=[unarchiver decodeObjectForKey:@"variables"];
|
||||||
//NSDebugMLLog(@"bundles",@"variables:%@",variables);
|
NSDebugMLLog(@"bundles",@"variables %p:%@",variables,variables);
|
||||||
[unarchiver finishInitializationOfObjects];
|
[unarchiver finishInitializationOfObjects];
|
||||||
|
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
||||||
[unarchiver awakeObjects];
|
[unarchiver awakeObjects];
|
||||||
variablesEnum=[variables keyEnumerator];
|
variablesEnum=[variables keyEnumerator];
|
||||||
|
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
||||||
|
NSDebugMLLog0(@"bundles",@"Will set variables");
|
||||||
while ((variableName = [variablesEnum nextObject]))
|
while ((variableName = [variablesEnum nextObject]))
|
||||||
{
|
{
|
||||||
id variableValue=[variables objectForKey:variableName];
|
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
|
[object_ takeValue:variableValue
|
||||||
forKey:variableName];
|
forKey:variableName];
|
||||||
|
NSDebugMLLog(@"bundles",@"AFT variableValue %p:%@ [RC=%d]",
|
||||||
|
variableValue,
|
||||||
|
variableValue,
|
||||||
|
[variableValue retainCount]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -258,45 +258,10 @@ static char rcsId[] = "$Id$";
|
||||||
//TODO
|
//TODO
|
||||||
NSString* _dscr=nil;
|
NSString* _dscr=nil;
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
// GSWLogC("GSWComponent description A");
|
NSDebugMLLog(@"gswcomponents",@"GSWComponent description self=%p",self);
|
||||||
NSDebugMLLog(@"gswcomponents",@"GSWComponent description Self=%p",self);
|
_dscr=[NSString stringWithFormat:@"<%s %p>",
|
||||||
_dscr=[NSString stringWithFormat:@"<%s %p - ",
|
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)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;
|
return _dscr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -372,7 +337,9 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
parent=_parent;
|
parent=_parent;
|
||||||
NSDebugMLLog(@"gswcomponents",@"parent=%p (%@)",(void*)parent,[parent class]);
|
NSDebugMLLog(@"gswcomponents",@"name=%@ parent=%p (%@)",
|
||||||
|
[self definitionName],
|
||||||
|
(void*)parent,[parent class]);
|
||||||
ASSIGN(associations,_associations);
|
ASSIGN(associations,_associations);
|
||||||
NSDebugMLLog(@"gswcomponents",@"associations=%@",associations);
|
NSDebugMLLog(@"gswcomponents",@"associations=%@",associations);
|
||||||
ASSIGN(associationsKeys,_associationsKeys);
|
ASSIGN(associationsKeys,_associationsKeys);
|
||||||
|
@ -395,7 +362,8 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
id _value=nil;
|
id _value=nil;
|
||||||
id _logValue=[self valueForBinding:@"GSWDebug"];
|
id _logValue=[self valueForBinding:@"GSWDebug"];
|
||||||
BOOL _log=boolValueWithDefaultFor(_logValue,NO);
|
BOOL _log=boolValueWithDefaultFor(_logValue,NO);
|
||||||
NSDebugMLog0(@"Synchro SubComponent->Component");
|
NSDebugMLog(@"defName=%@ - Synchro SubComponent->Component",
|
||||||
|
[self definitionName]);
|
||||||
for(i=0;i<[associationsKeys count];i++)
|
for(i=0;i<[associationsKeys count];i++)
|
||||||
{
|
{
|
||||||
_key=[associationsKeys objectAtIndex:i];
|
_key=[associationsKeys objectAtIndex:i];
|
||||||
|
@ -404,7 +372,8 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
if ([_assoc isValueSettable]
|
if ([_assoc isValueSettable]
|
||||||
&& ![_assoc isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
&& ![_assoc isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
||||||
{
|
{
|
||||||
_value=[self getIVarNamed:_key];
|
//MGNEW _value=[self getIVarNamed:_key];
|
||||||
|
_value=[self valueForKey:_key];//MGNEW
|
||||||
NSDebugMLLog(@"gswcomponents",@"_value=%@",_value);
|
NSDebugMLLog(@"gswcomponents",@"_value=%@",_value);
|
||||||
if (_log)
|
if (_log)
|
||||||
[_assoc logSynchronizeComponentToParentForValue:_value
|
[_assoc logSynchronizeComponentToParentForValue:_value
|
||||||
|
@ -429,7 +398,8 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
id _value=nil;
|
id _value=nil;
|
||||||
id _logValue=[self valueForBinding:@"GSWDebug"];
|
id _logValue=[self valueForBinding:@"GSWDebug"];
|
||||||
BOOL _log=boolValueWithDefaultFor(_logValue,NO);
|
BOOL _log=boolValueWithDefaultFor(_logValue,NO);
|
||||||
NSDebugMLog0(@"Synchro Component->SubComponent");
|
NSDebugMLog(@"Nme=%@ - Synchro Component->SubComponent",
|
||||||
|
[self definitionName]);
|
||||||
for(i=0;i<[associationsKeys count];i++)
|
for(i=0;i<[associationsKeys count];i++)
|
||||||
{
|
{
|
||||||
_key=[associationsKeys objectAtIndex:i];
|
_key=[associationsKeys objectAtIndex:i];
|
||||||
|
@ -442,8 +412,10 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
if (_log)
|
if (_log)
|
||||||
[_assoc logSynchronizeParentToComponentForValue:_value
|
[_assoc logSynchronizeParentToComponentForValue:_value
|
||||||
inComponent:self];
|
inComponent:self];
|
||||||
[self setIVarNamed:_key
|
/*//MGNEW [self setIVarNamed:_key
|
||||||
withValue:_value];
|
withValue:_value];*/
|
||||||
|
[self takeValue:_value
|
||||||
|
forKey:_key];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -768,7 +740,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
unsigned int _index=NSNotFound;
|
unsigned int _index=NSNotFound;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"associationsKeys=%@",associationsKeys);
|
NSDebugMLLog(@"gswcomponents",@"associationsKeys=%@",associationsKeys);
|
||||||
NSDebugMLLog(@"gswcomponents",@"associations=%@",associations);
|
//NSDebugMLLog(@"gswcomponents",@"associations=%@",[associations description]);
|
||||||
if (associationsKeys)
|
if (associationsKeys)
|
||||||
{
|
{
|
||||||
_index=[associationsKeys indexOfObject:_name];
|
_index=[associationsKeys indexOfObject:_name];
|
||||||
|
@ -796,14 +768,18 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
//OK
|
//OK
|
||||||
BOOL _hasBinding=NO;
|
BOOL _hasBinding=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_);
|
NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@",
|
||||||
|
[self definitionName],
|
||||||
|
parentBindingName_);
|
||||||
if (associationsKeys)
|
if (associationsKeys)
|
||||||
{
|
{
|
||||||
int _index=[associationsKeys indexOfObject:parentBindingName_];
|
int _index=[associationsKeys indexOfObject:parentBindingName_];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_index=%u",_index);
|
NSDebugMLLog(@"gswcomponents",@"_index=%u",_index);
|
||||||
_hasBinding=(_index!=NSNotFound);
|
_hasBinding=(_index!=NSNotFound);
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswcomponents",@"hasBinding=%s",(_hasBinding ? "YES" : "NO"));
|
NSDebugMLLog(@"gswcomponents",@"defName=%@ - hasBinding=%s",
|
||||||
|
[self definitionName],
|
||||||
|
(_hasBinding ? "YES" : "NO"));
|
||||||
if (!WOStrictFlag && !_hasBinding)
|
if (!WOStrictFlag && !_hasBinding)
|
||||||
{
|
{
|
||||||
_hasBinding=([defaultAssociations objectForKey:parentBindingName_]!=nil);
|
_hasBinding=([defaultAssociations objectForKey:parentBindingName_]!=nil);
|
||||||
|
@ -819,7 +795,9 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
//OK
|
//OK
|
||||||
GSWAssociation* _assoc=nil;
|
GSWAssociation* _assoc=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_);
|
NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@",
|
||||||
|
[self definitionName],
|
||||||
|
parentBindingName_);
|
||||||
NSDebugMLLog(@"gswcomponents",@"value_=%@",value_);
|
NSDebugMLLog(@"gswcomponents",@"value_=%@",value_);
|
||||||
NSDebugMLLog(@"gswcomponents",@"parent=%p",(void*)parent);
|
NSDebugMLLog(@"gswcomponents",@"parent=%p",(void*)parent);
|
||||||
if (parent)
|
if (parent)
|
||||||
|
@ -829,15 +807,23 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
if(_assoc)
|
if(_assoc)
|
||||||
[_assoc setValue:value_
|
[_assoc setValue:value_
|
||||||
inComponent:parent];
|
inComponent:parent];
|
||||||
|
/* // Why doing this ? Be carefull: it may make a loop !
|
||||||
#if GDL2
|
#if GDL2
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
[self takeValue:value_ forKey:parentBindingName_];
|
{
|
||||||
|
[self takeValue:value_
|
||||||
|
forKey:parentBindingName_];
|
||||||
|
}
|
||||||
NS_HANDLER;
|
NS_HANDLER;
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
@ -849,7 +835,10 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
id _value=nil;
|
id _value=nil;
|
||||||
GSWAssociation* _assoc=nil;
|
GSWAssociation* _assoc=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",parentBindingName_);
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",
|
||||||
|
[self definitionName]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"parentBindingName_=%@",
|
||||||
|
parentBindingName_);
|
||||||
NSDebugMLLog(@"gswcomponents",@"parent=%p of class %@",(void*)parent,[parent class]);
|
NSDebugMLLog(@"gswcomponents",@"parent=%p of class %@",(void*)parent,[parent class]);
|
||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
|
@ -857,15 +846,22 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
NSDebugMLLog(@"gswcomponents",@"_assoc=%@",_assoc);
|
NSDebugMLLog(@"gswcomponents",@"_assoc=%@",_assoc);
|
||||||
if(_assoc)
|
if(_assoc)
|
||||||
_value=[_assoc valueInComponent:parent];
|
_value=[_assoc valueInComponent:parent];
|
||||||
|
/* // Why doing this ? Be carefull: it may make a loop !
|
||||||
#if GDL2
|
#if GDL2
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
_value = [self valueForKey:parentBindingName_];
|
{
|
||||||
NS_HANDLER;
|
_value = [self valueForKey:parentBindingName_];
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
NSDebugMLLog(@"gswcomponents",@"_value=%@",_value);
|
NSDebugMLLog(@"gswcomponents",@"_value=%@",_value);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -879,7 +875,9 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
NSDictionary* _userDictionary=[self userDictionary];
|
NSDictionary* _userDictionary=[self userDictionary];
|
||||||
id _synchronizesVariablesWithBindingsValue=[_userDictionary objectForKey:@"synchronizesVariablesWithBindings"];
|
id _synchronizesVariablesWithBindingsValue=[_userDictionary objectForKey:@"synchronizesVariablesWithBindings"];
|
||||||
BOOL _synchronizesVariablesWithBindings=YES;
|
BOOL _synchronizesVariablesWithBindings=YES;
|
||||||
NSDebugMLLog(@"gswcomponents",@"userDictionary _synchronizesVariablesWithBindingsValue=%@",_synchronizesVariablesWithBindingsValue);
|
NSDebugMLLog(@"gswcomponents",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
||||||
|
[self definitionName],
|
||||||
|
_synchronizesVariablesWithBindingsValue);
|
||||||
//NDFN
|
//NDFN
|
||||||
if (_synchronizesVariablesWithBindingsValue)
|
if (_synchronizesVariablesWithBindingsValue)
|
||||||
{
|
{
|
||||||
|
@ -923,7 +921,9 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
[_componentDefinition sleep];
|
[_componentDefinition sleep];
|
||||||
[self sleep];
|
[self sleep];
|
||||||
[self _setContext:nil];
|
[self _setContext:nil];
|
||||||
NSDebugMLLog(@"gswcomponents",@"subComponents=%@",subComponents);
|
NSDebugMLLog(@"gswcomponents",@"defName=%@ - subComponents=%@",
|
||||||
|
[self definitionName],
|
||||||
|
subComponents);
|
||||||
[subComponents makeObjectsPerformSelector:@selector(sleepInContext:)
|
[subComponents makeObjectsPerformSelector:@selector(sleepInContext:)
|
||||||
withObject:context_];
|
withObject:context_];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -945,6 +945,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
GSWSaveAppendToResponseElementID(context_);//Debug Only
|
GSWSaveAppendToResponseElementID(context_);//Debug Only
|
||||||
|
|
||||||
_template=[self _template];
|
_template=[self _template];
|
||||||
|
@ -960,6 +961,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
[context_ deleteLastElementIDComponent];
|
[context_ deleteLastElementIDComponent];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (![debugElementID isEqualToString:[context_ elementID]])
|
if (![debugElementID isEqualToString:[context_ elementID]])
|
||||||
{
|
{
|
||||||
|
@ -987,6 +989,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
|
@ -1007,6 +1010,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (![debugElementID isEqualToString:[context_ elementID]])
|
if (![debugElementID isEqualToString:[context_ elementID]])
|
||||||
{
|
{
|
||||||
|
@ -1014,7 +1018,8 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#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=%@",
|
LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@",
|
||||||
[self class],
|
[self class],
|
||||||
|
@ -1044,12 +1049,14 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
_oldValidateFlag=[context_ isValidate];
|
_oldValidateFlag=[context_ isValidate];
|
||||||
[context_ setValidate:YES];
|
[context_ setValidate:YES];
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
_template=[self _template];
|
_template=[self _template];
|
||||||
[context_ appendZeroElementIDComponent];
|
[context_ appendZeroElementIDComponent];
|
||||||
[_template takeValuesFromRequest:request_
|
[_template takeValuesFromRequest:request_
|
||||||
inContext:context_];
|
inContext:context_];
|
||||||
[context_ deleteLastElementIDComponent];
|
[context_ deleteLastElementIDComponent];
|
||||||
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswcomponents",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (![debugElementID isEqualToString:[context_ elementID]])
|
if (![debugElementID isEqualToString:[context_ elementID]])
|
||||||
{
|
{
|
||||||
|
@ -1159,6 +1166,7 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
GSWComponentDefinition* _componentDefinition=nil;
|
GSWComponentDefinition* _componentDefinition=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"context_=%@",context_);
|
NSDebugMLLog(@"gswcomponents",@"context_=%@",context_);
|
||||||
|
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||||
NSAssert(context_,@"No Context");
|
NSAssert(context_,@"No Context");
|
||||||
[self _setContext:context_];
|
[self _setContext:context_];
|
||||||
_componentDefinition=[self _componentDefinition];
|
_componentDefinition=[self _componentDefinition];
|
||||||
|
@ -1185,7 +1193,9 @@ associationsKeys:(NSArray*)_associationsKeys
|
||||||
id _ret=nil;
|
id _ret=nil;
|
||||||
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents", @"parent=%p", (void*)parent);
|
NSDebugMLLog(@"gswcomponents", @"name=%@ - parent=%p",
|
||||||
|
[self definitionName],
|
||||||
|
(void*)parent);
|
||||||
if (parent)
|
if (parent)
|
||||||
{
|
{
|
||||||
_assoc = [self _associationWithName:attribute];
|
_assoc = [self _associationWithName:attribute];
|
||||||
|
|
|
@ -103,6 +103,13 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"elementID=%@",[context_ elementID]);
|
||||||
if (_negate)
|
if (_negate)
|
||||||
_doIt=!_doIt;
|
_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)
|
if (_doIt)
|
||||||
{
|
{
|
||||||
GSWRequest* _request=[context_ request];
|
GSWRequest* _request=[context_ request];
|
||||||
|
@ -118,7 +125,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)context_
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
|
@ -129,24 +136,30 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
_condition=[self evaluateCondition:condition
|
_condition=[self evaluateCondition:condition
|
||||||
inContext:context_];
|
inContext:context_];
|
||||||
_negate=[self evaluateCondition:negate
|
_negate=[self evaluateCondition:negate
|
||||||
inContext:context_];
|
inContext:context_];
|
||||||
_doIt=_condition;
|
_doIt=_condition;
|
||||||
if (_negate)
|
if (_negate)
|
||||||
_doIt=!_doIt;
|
_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)
|
if (_doIt)
|
||||||
{
|
{
|
||||||
GSWRequest* _request=[context_ request];
|
GSWRequest* _request=[context_ request];
|
||||||
BOOL _isFromClientComponent=[_request isFromClientComponent];
|
BOOL _isFromClientComponent=[_request isFromClientComponent];
|
||||||
[context_ appendZeroElementIDComponent];
|
[context_ appendZeroElementIDComponent];
|
||||||
NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup);
|
NSDebugMLLog(@"gswdync",@"childrenGroup=%@",childrenGroup);
|
||||||
_element=[childrenGroup invokeActionForRequest:request_
|
_element=[childrenGroup invokeActionForRequest:request_
|
||||||
inContext:context_];
|
inContext:context_];
|
||||||
NSDebugMLLog(@"gswdync",@"_element=%@",_element);
|
NSDebugMLLog(@"gswdync",@"_element=%@",_element);
|
||||||
[context_ deleteLastElementIDComponent];
|
[context_ deleteLastElementIDComponent];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _element;
|
return _element;
|
||||||
|
@ -172,7 +185,13 @@ static char rcsId[] = "$Id$";
|
||||||
_doIt=_condition;
|
_doIt=_condition;
|
||||||
if (_negate)
|
if (_negate)
|
||||||
_doIt=!_doIt;
|
_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)
|
if (_doIt)
|
||||||
{
|
{
|
||||||
GSWRequest* _request=[context_ request];
|
GSWRequest* _request=[context_ request];
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
@class EOUndoManager;
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWDisplayGroup
|
@implementation GSWDisplayGroup
|
||||||
|
@ -102,6 +102,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
if ((self=[self init]))
|
if ((self=[self init]))
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"GSWDisplayGroup %p",self);
|
||||||
[self setNumberOfObjectsPerBatch:
|
[self setNumberOfObjectsPerBatch:
|
||||||
[unarchiver decodeIntForKey:@"numberOfObjectsPerBatch"]];
|
[unarchiver decodeIntForKey:@"numberOfObjectsPerBatch"]];
|
||||||
[self setFetchesOnLoad:
|
[self setFetchesOnLoad:
|
||||||
|
@ -210,21 +211,85 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)_addQualifiersToArray:(id)array_
|
-(void)_addQualifiersToArray:(NSMutableArray*)array
|
||||||
forValues:(id)values_
|
forValues:(NSDictionary*)values
|
||||||
operatorSelector:(SEL)selector_
|
operatorSelector:(SEL)sel
|
||||||
{
|
{
|
||||||
|
//OK
|
||||||
|
NSEnumerator *enumerator=nil;
|
||||||
|
NSString *key=nil;
|
||||||
|
NSString *op=nil;
|
||||||
LOGObjectFnStart();
|
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();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)_qualifierForKey:(id)key
|
-(EOQualifier*)_qualifierForKey:(id)key
|
||||||
value:(id)value
|
value:(id)value
|
||||||
operatorSelector:(SEL)selector_
|
operatorSelector:(SEL)sel
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
//near OK (see VERIFY)
|
||||||
return nil;
|
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_
|
-(BOOL)_deleteObjectsAtIndexes:(id)indexes_
|
||||||
|
@ -271,7 +336,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
-(void)_notifySelectionChanged
|
-(void)_notifySelectionChanged
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
[EOObserverCenter notifyObserversObjectWillChange:nil];//OK ?
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -280,7 +345,8 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
-(void)_notifyRowChanged:(int)row_
|
-(void)_notifyRowChanged:(int)row_
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
//-1 ==> nil ?
|
||||||
|
[EOObserverCenter notifyObserversObjectWillChange:nil]; //VERIFY
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -292,9 +358,20 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
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();
|
LOGObjectFnStop();
|
||||||
return nil;
|
return self; //??
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,12 +385,13 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(id)undoManager
|
-(EOUndoManager*)undoManager
|
||||||
{
|
{
|
||||||
|
EOUndoManager* undoManager=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
undoManager=[[_dataSource editingContext] undoManager];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return nil;
|
return undoManager;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)objectsInvalidatedInEditingContext:(id)object_
|
-(void)objectsInvalidatedInEditingContext:(id)object_
|
||||||
|
@ -595,30 +673,30 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
if(delete)
|
if(delete)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_dataSource deleteObject:object];
|
[_dataSource deleteObject:object];
|
||||||
|
|
||||||
[_displayedObjects removeObjectIdenticalTo:object];
|
[_displayedObjects removeObjectIdenticalTo:object];
|
||||||
[_allObjects removeObjectIdenticalTo:object];
|
[_allObjects removeObjectIdenticalTo:object];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didDeleteObject == YES)
|
if(_delegateRespondsTo.didDeleteObject == YES)
|
||||||
[delegate displayGroup:self didDeleteObject:object];
|
[delegate displayGroup:self didDeleteObject:object];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSLog(@"GSWDisplayGroup (deleteObjectAtIndex:) Can't delete object at index : %d", index);
|
NSLog(@"GSWDisplayGroup (deleteObjectAtIndex:) Can't delete object at index : %d", index);
|
||||||
NSLog(@"object : %@", object);
|
NSLog(@"object : %@", object);
|
||||||
NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n",
|
NSLog(@"Exception : %@ %@ Name:%@ Reason:%@\n",
|
||||||
localException,
|
localException,
|
||||||
[localException description],
|
[localException description],
|
||||||
[localException name],
|
[localException name],
|
||||||
[localException reason]);
|
[localException reason]);
|
||||||
delete = NO;
|
delete = NO;
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
|
|
||||||
[self clearSelection];
|
[self clearSelection];
|
||||||
|
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -714,6 +792,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (NSArray *)displayedObjects
|
- (NSArray *)displayedObjects
|
||||||
{
|
{
|
||||||
|
//OK
|
||||||
return _displayedObjects;
|
return _displayedObjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -825,10 +904,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
// fetch
|
// fetch
|
||||||
|
|
||||||
- (id)fetch
|
- (id)fetch
|
||||||
|
//Near OK
|
||||||
{
|
{
|
||||||
BOOL fetch = YES;
|
BOOL fetch = YES;
|
||||||
|
EOUndoManager* undoManager=nil;
|
||||||
LOGObjectFnStart();
|
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)
|
if(_delegateRespondsTo.shouldFetchObjects == YES)
|
||||||
fetch = [delegate displayGroupShouldFetch:self];
|
fetch = [delegate displayGroupShouldFetch:self];
|
||||||
|
@ -837,20 +924,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
{
|
{
|
||||||
NSArray *objects=nil;
|
NSArray *objects=nil;
|
||||||
|
|
||||||
objects = [_dataSource fetchObjects];
|
objects = [_dataSource fetchObjects];//OK WO45P3
|
||||||
[self setObjectArray:objects];
|
[self setObjectArray:objects];//OK
|
||||||
|
[self _notify:@selector(displayGroup:didFetchObjects:)
|
||||||
if(_delegateRespondsTo.didFetchObjects == YES)
|
with:self
|
||||||
[delegate displayGroup:self
|
with:_allObjects];
|
||||||
didFetchObjects:_allObjects];
|
/*IN setObjectArray: // selection
|
||||||
// selection
|
if ([self selectsFirstObjectAfterFetch] == YES) {
|
||||||
if ([self selectsFirstObjectAfterFetch] == YES) {
|
|
||||||
[self setCurrentBatchIndex:1];
|
[self setCurrentBatchIndex:1];
|
||||||
}
|
*/
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
return nil;//FIXME ??
|
||||||
return nil;//FIXME
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -1112,50 +1197,38 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (EOQualifier *)qualifierFromQueryValues
|
- (EOQualifier *)qualifierFromQueryValues
|
||||||
{
|
{
|
||||||
|
//Near OK
|
||||||
EOQualifier* resultQualifier=nil;
|
EOQualifier* resultQualifier=nil;
|
||||||
NSMutableArray *array=nil;
|
NSMutableArray *array=nil;
|
||||||
NSEnumerator *enumerator=nil;
|
|
||||||
NSString *key=nil;
|
|
||||||
NSString *op=nil;
|
|
||||||
SEL operatorSelector=nil;
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"_queryMatch=%@",
|
||||||
|
_queryMatch);
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p",
|
||||||
|
_defaultStringMatchOperator,
|
||||||
|
(void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]);
|
||||||
|
|
||||||
array = [NSMutableArray arrayWithCapacity:8];
|
array = [NSMutableArray arrayWithCapacity:8];
|
||||||
|
|
||||||
enumerator = [_queryMatch keyEnumerator];
|
[self _addQualifiersToArray:array
|
||||||
while((key = [enumerator nextObject]))
|
forValues:_queryMax
|
||||||
{
|
operatorSelector:EOQualifierOperatorLessThan];//LessThan ??
|
||||||
op = [_queryOperator objectForKey:key];
|
[self _addQualifiersToArray:array
|
||||||
|
forValues:_queryMin
|
||||||
|
operatorSelector:EOQualifierOperatorGreaterThan];//GreaterThan ??
|
||||||
|
|
||||||
if(op == nil)
|
NSDebugMLLog(@"gswdisplaygroup",@"_defaultStringMatchOperator=%@ EOQualifier sel:%p",
|
||||||
operatorSelector = EOQualifierOperatorEqual;
|
_defaultStringMatchOperator,
|
||||||
else
|
(void*)[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]);
|
||||||
operatorSelector = [EOQualifier operatorSelectorForString:op];
|
[self _addQualifiersToArray:array
|
||||||
|
forValues:_queryMatch
|
||||||
|
operatorSelector:[EOQualifier operatorSelectorForString:_defaultStringMatchOperator]];//VERIFY
|
||||||
|
|
||||||
[array addObject:[[[EOKeyValueQualifier alloc]
|
NSDebugMLLog(@"gswdisplaygroup",@"array=%@",array);
|
||||||
initWithKey:key
|
if ([array count]==1)
|
||||||
operatorSelector:operatorSelector
|
resultQualifier=[array objectAtIndex:0];
|
||||||
value:[_queryMatch objectForKey:key]] autorelease]];
|
else if ([array count]>1)
|
||||||
}
|
resultQualifier=[[[EOAndQualifier alloc] initWithQualifierArray:array] autorelease];
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"resultQualifier=%@",resultQualifier);
|
||||||
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];
|
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return resultQualifier;
|
return resultQualifier;
|
||||||
}
|
}
|
||||||
|
@ -1165,13 +1238,29 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (void)qualifyDataSource
|
- (void)qualifyDataSource
|
||||||
{
|
{
|
||||||
|
// near OK
|
||||||
|
EOQualifier* qualifier=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[_dataSource setQualifier:[self qualifierFromQueryValues]];
|
NS_DURING //for trace purpose
|
||||||
|
{
|
||||||
_flags.queryMode = NO;
|
//TODO
|
||||||
[self fetch];
|
//[self endEditing];//WO45P3 ret 1 //TODO if NO ?
|
||||||
|
[self setInQueryMode:NO];
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
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();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1180,11 +1269,15 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (void)qualifyDisplayGroup
|
- (void)qualifyDisplayGroup
|
||||||
{
|
{
|
||||||
|
EOQualifier* qualifier=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self setQualifier:[self qualifierFromQueryValues]];
|
[self setInQueryMode:NO];
|
||||||
|
qualifier=[self qualifierFromQueryValues];
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"qualifier=%@",qualifier);
|
||||||
|
[self setQualifier:qualifier];
|
||||||
|
|
||||||
|
NSDebugMLLog0(@"gswdisplaygroup",@"updateDisplayedObjects");
|
||||||
[self updateDisplayedObjects];
|
[self updateDisplayedObjects];
|
||||||
_flags.queryMode = NO;
|
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1233,8 +1326,9 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
-(void)redisplay
|
-(void)redisplay
|
||||||
{
|
{
|
||||||
|
//VERIFY
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
[self _notifyRowChanged:-1]; // -1 ??
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1264,8 +1358,10 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
{
|
{
|
||||||
id obj=nil;
|
id obj=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"_selectedObjects count=%d",[_selectedObjects count]);
|
||||||
if([_selectedObjects count])
|
if([_selectedObjects count])
|
||||||
obj=[_selectedObjects objectAtIndex:0];
|
obj=[_selectedObjects objectAtIndex:0];
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"selectedObject=%@",obj);
|
||||||
|
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -1338,7 +1434,11 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
{
|
{
|
||||||
BOOL result=NO;
|
BOOL result=NO;
|
||||||
LOGObjectFnStart();
|
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;
|
result=NO;
|
||||||
else
|
else
|
||||||
result=[self setSelectionIndexes:
|
result=[self setSelectionIndexes:
|
||||||
|
@ -1346,13 +1446,13 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[NSNumber numberWithUnsignedInt:
|
[NSNumber numberWithUnsignedInt:
|
||||||
[_allObjects
|
[_allObjects
|
||||||
indexOfObject:object]]]];
|
indexOfObject:object]]]];
|
||||||
|
NSDebugMLLog(@"gswdisplaygroup",@"result=%d",(int)result);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// selectObjectsIdenticalTo:
|
// selectObjectsIdenticalTo:
|
||||||
|
|
||||||
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects
|
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects
|
||||||
{
|
{
|
||||||
BOOL result=NO;
|
BOOL result=NO;
|
||||||
|
@ -1363,22 +1463,32 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
id dispObj=nil;
|
id dispObj=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
|
// Array of new selected indexes
|
||||||
array = [NSMutableArray arrayWithCapacity:8];
|
array = [NSMutableArray arrayWithCapacity:8];
|
||||||
|
|
||||||
|
// ENumeratoe Objects to select
|
||||||
objsEnum = [objects objectEnumerator];
|
objsEnum = [objects objectEnumerator];
|
||||||
|
|
||||||
|
// For each object to select
|
||||||
while((object = [objsEnum nextObject]))
|
while((object = [objsEnum nextObject]))
|
||||||
{
|
{
|
||||||
|
//Enumerated displayed objects
|
||||||
dispEnum = [_displayedObjects objectEnumerator];
|
dispEnum = [_displayedObjects objectEnumerator];
|
||||||
|
|
||||||
|
// For each already displayed object
|
||||||
while((dispObj = [dispEnum nextObject]))
|
while((dispObj = [dispEnum nextObject]))
|
||||||
{
|
{
|
||||||
|
//if object to select is displayed
|
||||||
if(dispObj == object)
|
if(dispObj == object)
|
||||||
{
|
{
|
||||||
|
// Add it to array of selected indexes
|
||||||
[array addObject:[NSNumber numberWithUnsignedInt:
|
[array addObject:[NSNumber numberWithUnsignedInt:
|
||||||
[_allObjects indexOfObject:object]]];
|
[_allObjects indexOfObject:object]]];
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//???
|
||||||
if(dispObj == nil)
|
if(dispObj == nil)
|
||||||
{
|
{
|
||||||
[array removeAllObjects];
|
[array removeAllObjects];
|
||||||
|
@ -1396,6 +1506,20 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects
|
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects
|
||||||
selectFirstOnNoMatch:(BOOL)flag
|
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;
|
BOOL result=NO;
|
||||||
unsigned index=0;
|
unsigned index=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
@ -1601,6 +1725,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
- (void)setInQueryMode:(BOOL)flag
|
- (void)setInQueryMode:(BOOL)flag
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
//[self inQueryMode]//WO45P3
|
||||||
_flags.queryMode = flag;
|
_flags.queryMode = flag;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
@ -1661,12 +1786,21 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
- (void)setObjectArray:(NSArray *)objects
|
- (void)setObjectArray:(NSArray *)objects
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
//self selectedObjects
|
||||||
|
// self updateDisplayedObjects
|
||||||
NSDebugMLog(@"objects=%@",objects);
|
NSDebugMLog(@"objects=%@",objects);
|
||||||
[_allObjects removeAllObjects];
|
[_allObjects removeAllObjects];
|
||||||
[_allObjects addObjectsFromArray:objects];
|
[_allObjects addObjectsFromArray:objects];
|
||||||
|
|
||||||
[self updateDisplayedObjects];
|
[self updateDisplayedObjects];
|
||||||
|
|
||||||
|
if ([self selectsFirstObjectAfterFetch])
|
||||||
|
{
|
||||||
|
[self selectObjectsIdenticalTo:_selection //TODO _selection ??
|
||||||
|
selectFirstOnNoMatch:1];
|
||||||
|
[self redisplay];
|
||||||
|
}
|
||||||
|
|
||||||
// TODO selection
|
// TODO selection
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
@ -1721,54 +1855,71 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (BOOL)setSelectionIndexes:(NSArray *)selection_
|
- (BOOL)setSelectionIndexes:(NSArray *)selection_
|
||||||
{
|
{
|
||||||
NSEnumerator *objsEnum;
|
//(0) object 0x2859148
|
||||||
NSNumber *number;
|
/*
|
||||||
|
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 stop = NO;
|
||||||
|
BOOL retValue=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
//call selectedObjects //0x1a38b78
|
||||||
if(_delegateRespondsTo.shouldChangeSelection == YES)
|
if(_delegateRespondsTo.shouldChangeSelection == YES
|
||||||
if([delegate displayGroup:self
|
&& [delegate displayGroup:self
|
||||||
shouldChangeSelectionToIndexes:selection_] == NO)
|
shouldChangeSelectionToIndexes:selection_] == NO)
|
||||||
return NO;
|
retValue=NO;
|
||||||
|
else
|
||||||
objsEnum = [selection_ objectEnumerator];
|
|
||||||
while((number = [objsEnum nextObject]))
|
|
||||||
{
|
{
|
||||||
NS_DURING
|
objsEnum = [selection_ objectEnumerator];
|
||||||
|
while((number = [objsEnum nextObject]))
|
||||||
{
|
{
|
||||||
// check for objects
|
NS_DURING
|
||||||
[_allObjects objectAtIndex:[number unsignedIntValue]];
|
{
|
||||||
|
// check for objects
|
||||||
|
[_allObjects objectAtIndex:[number unsignedIntValue]];
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
//return NO;
|
||||||
|
stop = YES;
|
||||||
|
retValue=NO;
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
|
||||||
|
if (!stop)
|
||||||
{
|
{
|
||||||
//return NO;
|
[_selectedObjects removeAllObjects];
|
||||||
stop = YES;
|
|
||||||
}
|
objsEnum = [selection_ objectEnumerator];
|
||||||
return NO;
|
while((number = [objsEnum nextObject]))
|
||||||
NS_ENDHANDLER;
|
{
|
||||||
}
|
[_selectedObjects addObject:[_allObjects objectAtIndex:[number unsignedIntValue]]];
|
||||||
|
}
|
||||||
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];
|
|
||||||
|
|
||||||
|
ASSIGN(_selection, selection_);
|
||||||
|
|
||||||
|
if(_delegateRespondsTo.didChangeSelection == YES)
|
||||||
|
[delegate displayGroupDidChangeSelection:self];
|
||||||
|
|
||||||
|
if(_delegateRespondsTo.didChangeSelectedObjects == YES)
|
||||||
|
[delegate displayGroupDidChangeSelectedObjects:self];
|
||||||
|
};
|
||||||
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return YES;
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -1819,7 +1970,12 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
NSEnumerator *objsEnum=nil;
|
NSEnumerator *objsEnum=nil;
|
||||||
id object=nil;
|
id object=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
//TODO
|
||||||
|
//self selectedObjects //() 0x1a38b78
|
||||||
|
//self allObjects 0x27cadf8
|
||||||
|
//self selectObjectsIdenticalTo:_selection selectFirstOnNoMatch:0
|
||||||
|
//self redisplay
|
||||||
|
//STOP
|
||||||
[_displayedObjects removeAllObjects];
|
[_displayedObjects removeAllObjects];
|
||||||
|
|
||||||
if(_delegateRespondsTo.displayArrayForObjects == YES)
|
if(_delegateRespondsTo.displayArrayForObjects == YES)
|
||||||
|
|
|
@ -30,12 +30,14 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWDynamicElement : GSWElement
|
@interface GSWDynamicElement : GSWElement
|
||||||
{
|
{
|
||||||
|
NSString* _definitionName; // Name of element in def file (.gswd) - Mainly for debugging purpose
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)name_
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations_
|
||||||
template:(GSWElement*)template_;
|
template:(GSWElement*)template_;
|
||||||
|
-(NSString*)definitionName;
|
||||||
|
-(void)setDefinitionName:(NSString*)definitionName;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
|
@ -43,7 +43,31 @@ static char rcsId[] = "$Id$";
|
||||||
return self;
|
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)
|
@implementation GSWDynamicElement (GSWDynamicElement)
|
||||||
|
|
||||||
|
@ -54,7 +78,8 @@ static char rcsId[] = "$Id$";
|
||||||
//OK
|
//OK
|
||||||
BOOL _result=NO;
|
BOOL _result=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswdync",@"condition_=%@",condition_);
|
NSDebugMLLog(@"gswdync",@"condition_=%@",
|
||||||
|
condition_);
|
||||||
if (condition_)
|
if (condition_)
|
||||||
{
|
{
|
||||||
GSWComponent* _component=[_context component];
|
GSWComponent* _component=[_context component];
|
||||||
|
@ -68,6 +93,8 @@ static char rcsId[] = "$Id$";
|
||||||
#endif
|
#endif
|
||||||
_result=boolValueWithDefaultFor(_value,YES);
|
_result=boolValueWithDefaultFor(_value,YES);
|
||||||
};
|
};
|
||||||
|
NSDebugMLLog(@"gswdync",@"result=%s",
|
||||||
|
(_result ? "YES" : "NO"));
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _result;
|
return _result;
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,6 +48,8 @@ extern BYTE ElementsMap_attributeElement;
|
||||||
file:(const char*)file_
|
file:(const char*)file_
|
||||||
line:(int)line_;
|
line:(int)line_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
-(NSString*)definitionName; //return nil (for non dynamic element)
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#ifdef NDEBBUG
|
#ifdef NDEBBUG
|
||||||
|
|
|
@ -72,6 +72,11 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
-(NSString*)definitionName
|
||||||
|
{
|
||||||
|
return nil; //return nil (for non dynamic element)
|
||||||
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
|
@ -108,11 +108,11 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
GSWLogAssertGood(_string);
|
GSWLogAssertGood(_string);
|
||||||
//GSWLogC("_string deallocate");
|
GSWLogC("_string deallocate");
|
||||||
DESTROY(_string);
|
DESTROY(_string);
|
||||||
//GSWLogC("_string deallocated");
|
GSWLogC("_string deallocated");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
//GSWLogC("GSWElementIDString end of dealloc");
|
GSWLogC("GSWElementIDString end of dealloc");
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)getCString:(char*)buffer
|
-(void)getCString:(char*)buffer
|
||||||
|
@ -180,6 +180,110 @@ static char rcsId[] = "$Id$";
|
||||||
return obj;
|
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
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
|
@ -234,7 +234,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)context_
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
|
@ -249,80 +249,98 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStartC("GSWForm");
|
LOGObjectFnStartC("GSWForm");
|
||||||
_senderID=[context_ senderID];
|
_senderID=[context_ senderID];
|
||||||
_elementID=[context_ elementID];
|
_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
|
NS_DURING
|
||||||
{
|
{
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component
|
if ([self prefixMatchSenderIDInContext:context_]) //Avoid trying to find action if we are not the good component
|
||||||
{
|
{
|
||||||
_isFormSubmited=[_elementID isEqualToString:_senderID];
|
BOOL searchIsOver=NO;
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s",
|
_isFormSubmited=[_elementID isEqualToString:_senderID];
|
||||||
[self class],
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _isFormSubmited=%s",
|
||||||
_elementID,
|
[self class],
|
||||||
_senderID,
|
_elementID,
|
||||||
(_isFormSubmited ? "YES" : "NO"));
|
_senderID,
|
||||||
if (!WOStrictFlag && _isFormSubmited && [self disabledInContext:context_])
|
(_isFormSubmited ? "YES" : "NO"));
|
||||||
_isFormSubmited=NO;
|
if (!WOStrictFlag && _isFormSubmited && [self disabledInContext:context_])
|
||||||
|
_isFormSubmited=NO;
|
||||||
if (_isFormSubmited)
|
|
||||||
{
|
if (_isFormSubmited)
|
||||||
[context_ setInForm:YES];
|
{
|
||||||
[context_ _setFormSubmitted:YES];
|
[context_ setInForm:YES];
|
||||||
_multipleSubmit=[self evaluateCondition:multipleSubmit
|
[context_ _setFormSubmitted:YES];
|
||||||
inContext:context_];
|
_multipleSubmit=[self evaluateCondition:multipleSubmit
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _multipleSubmit=%s",
|
inContext:context_];
|
||||||
[self class],
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@ _multipleSubmit=%s",
|
||||||
_elementID,
|
[self class],
|
||||||
_senderID,
|
_elementID,
|
||||||
(_multipleSubmit ? "YES" : "NO"));
|
_senderID,
|
||||||
[context_ _setIsMultipleSubmitForm:_multipleSubmit];
|
(_multipleSubmit ? "YES" : "NO"));
|
||||||
};
|
[context_ _setIsMultipleSubmitForm:_multipleSubmit];
|
||||||
[context_ appendZeroElementIDComponent];
|
};
|
||||||
for(i=0;!_element && i<[dynamicChildren count];i++)
|
[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_
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||||
inContext:context_];
|
[[dynamicChildren objectAtIndex:i] class],
|
||||||
[context_ incrementLastElementIDComponent];
|
[context_ elementID]);
|
||||||
};
|
_element=[[dynamicChildren objectAtIndex:i] invokeActionForRequest:request_
|
||||||
[context_ deleteLastElementIDComponent];
|
inContext:context_];
|
||||||
if (_isFormSubmited)
|
// if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending)
|
||||||
{
|
if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID])
|
||||||
if ([context_ _wasActionInvoked])
|
{
|
||||||
[context_ _setIsMultipleSubmitForm:NO];
|
NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over",
|
||||||
else
|
[context_ elementID],
|
||||||
{
|
_senderID);
|
||||||
NSDebugMLLog0(@"gswdync",@"formSubmitted but no action was invoked!");
|
searchIsOver=YES;
|
||||||
};
|
};
|
||||||
[context_ setInForm:NO];
|
[context_ incrementLastElementIDComponent];
|
||||||
[context_ _setFormSubmitted:NO];
|
};
|
||||||
};
|
[context_ deleteLastElementIDComponent];
|
||||||
_elementID=[context_ elementID];
|
if (_isFormSubmited)
|
||||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],_elementID);
|
{
|
||||||
|
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
|
#ifndef NDEBBUG
|
||||||
NSAssert(elementsNb==[(GSWElementIDString*)_elementID elementsNb],@"GSWForm invokeActionForRequest: bad elementID");
|
NSAssert(elementsNb==[(GSWElementIDString*)_elementID elementsNb],
|
||||||
|
@"GSWForm invokeActionForRequest: bad elementID");
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException0(@"exception in GSWForm invokeActionForRequest:inContext");
|
LOGException0(@"exception in GSWForm invokeActionForRequest:inContext");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
||||||
@"In GSWForm invokeActionForRequest:inContext");
|
@"In GSWForm invokeActionForRequest:inContext");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
[localException raise];
|
[localException raise];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
_senderID=[context_ senderID];
|
_senderID=[context_ senderID];
|
||||||
_elementID=[context_ elementID];
|
_elementID=[context_ elementID];
|
||||||
if (![context_ _wasActionInvoked] && [_elementID compare:_senderID]!=NSOrderedAscending)
|
//if (![context_ _wasActionInvoked] && [_elementID compare:_senderID]!=NSOrderedAscending)
|
||||||
{
|
if (![context_ _wasActionInvoked] && [_elementID isSearchOverForSenderID:_senderID])
|
||||||
LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@",
|
{
|
||||||
[self class],
|
LOGError(@"Action not invoked at the end of %@ (def name=%@) (id=%@) senderId=%@",
|
||||||
_elementID,
|
[self class],
|
||||||
_senderID);
|
[self definitionName],
|
||||||
};
|
_elementID,
|
||||||
|
_senderID);
|
||||||
|
};
|
||||||
LOGObjectFnStopC("GSWForm");
|
LOGObjectFnStopC("GSWForm");
|
||||||
return _element;
|
return _element;
|
||||||
};
|
};
|
||||||
|
|
|
@ -490,7 +490,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)context_
|
||||||
{
|
{
|
||||||
//???
|
//???
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
|
@ -500,6 +500,8 @@ static char rcsId[] = "$Id$";
|
||||||
BYTE element=0;
|
BYTE element=0;
|
||||||
int elementsN[4]={0,0,0,0};
|
int elementsN[4]={0,0,0,0};
|
||||||
BOOL inChildren=NO;
|
BOOL inChildren=NO;
|
||||||
|
BOOL searchIsOver=NO;
|
||||||
|
NSString* _senderID=nil;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
NSString* debugElementID=nil;
|
NSString* debugElementID=nil;
|
||||||
#endif
|
#endif
|
||||||
|
@ -507,62 +509,76 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
for(elementN=0;!_element && elementN<[elementsMap length];elementN++)
|
_senderID=[context_ senderID];
|
||||||
{
|
for(elementN=0;!_element && !searchIsOver && elementN<[elementsMap length];elementN++)
|
||||||
element=(BYTE)elements[elementN];
|
{
|
||||||
if (element==ElementsMap_dynamicElement)
|
element=(BYTE)elements[elementN];
|
||||||
{
|
if (element==ElementsMap_dynamicElement)
|
||||||
if (!inChildren)
|
{
|
||||||
{
|
if (!inChildren)
|
||||||
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
debugElementID=[context_ elementID];
|
debugElementID=[context_ elementID];
|
||||||
#endif
|
#endif
|
||||||
[context_ appendZeroElementIDComponent];
|
[context_ appendZeroElementIDComponent];
|
||||||
inChildren=YES;
|
inChildren=YES;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (inChildren)
|
if (inChildren)
|
||||||
{
|
{
|
||||||
[context_ deleteLastElementIDComponent];
|
[context_ deleteLastElementIDComponent];
|
||||||
inChildren=NO;
|
inChildren=NO;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (![debugElementID isEqualToString:[context_ elementID]])
|
if (![debugElementID isEqualToString:[context_ elementID]])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",
|
||||||
|
[self class],
|
||||||
};
|
debugElementID,
|
||||||
|
[context_ elementID]);
|
||||||
|
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (element==ElementsMap_htmlBareString)
|
if (element==ElementsMap_htmlBareString)
|
||||||
elementsN[0]++;
|
elementsN[0]++;
|
||||||
else if (element==ElementsMap_gswebElement)
|
else if (element==ElementsMap_gswebElement)
|
||||||
elementsN[1]++;
|
elementsN[1]++;
|
||||||
else if (element==ElementsMap_dynamicElement)
|
else if (element==ElementsMap_dynamicElement)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[2]] class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",
|
||||||
_element=[[_dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:request_
|
[[_dynamicChildren objectAtIndex:elementsN[2]] class],
|
||||||
inContext:context_];
|
[context_ elementID]);
|
||||||
[context_ incrementLastElementIDComponent];
|
_element=[[_dynamicChildren objectAtIndex:elementsN[2]] invokeActionForRequest:request_
|
||||||
elementsN[2]++;
|
inContext:context_];
|
||||||
}
|
//if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending)
|
||||||
else if (element==ElementsMap_attributeElement)
|
if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID])
|
||||||
elementsN[3]++;
|
{
|
||||||
};
|
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)
|
if (inChildren)
|
||||||
{
|
{
|
||||||
[context_ deleteLastElementIDComponent];
|
[context_ deleteLastElementIDComponent];
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if (![debugElementID isEqualToString:[context_ elementID]])
|
if (![debugElementID isEqualToString:[context_ elementID]])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"ERROR class=%@ debugElementID=%@ [context_ elementID]=%@",[self class],debugElementID,[context_ elementID]);
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
||||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
|
|
|
@ -354,7 +354,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)context_
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWElement* _element=nil;
|
GSWElement* _element=nil;
|
||||||
|
@ -363,26 +363,37 @@ static char rcsId[] = "$Id$";
|
||||||
const BYTE* elements=[elementsMap bytes];
|
const BYTE* elements=[elementsMap bytes];
|
||||||
BYTE element=0;
|
BYTE element=0;
|
||||||
int elementsN[3]={0,0,0};
|
int elementsN[3]={0,0,0};
|
||||||
|
BOOL searchIsOver=NO;
|
||||||
|
NSString* _senderID=nil;
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
for(elementN=0;!_element && elementN<[elementsMap length];elementN++)
|
_senderID=[context_ senderID];
|
||||||
{
|
for(elementN=0;!_element && !searchIsOver && elementN<[elementsMap length];elementN++)
|
||||||
element=(BYTE)elements[elementN];
|
{
|
||||||
if (element==ElementsMap_htmlBareString)
|
element=(BYTE)elements[elementN];
|
||||||
elementsN[0]++;
|
if (element==ElementsMap_htmlBareString)
|
||||||
else if (element==ElementsMap_dynamicElement)
|
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_
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[[_dynamicChildren objectAtIndex:elementsN[1]] class],[context_ elementID]);
|
||||||
inContext:context_];
|
_element=[[_dynamicChildren objectAtIndex:elementsN[1]] invokeActionForRequest:request_
|
||||||
[context_ incrementLastElementIDComponent];
|
inContext:context_];
|
||||||
elementsN[1]++;
|
// if (![context_ _wasFormSubmitted] && [[context_ elementID] compare:_senderID]==NSOrderedDescending)
|
||||||
}
|
if (![context_ _wasFormSubmitted] && [[context_ elementID] isSearchOverForSenderID:_senderID])
|
||||||
else if (element==ElementsMap_attributeElement)
|
{
|
||||||
{
|
NSDebugMLLog(@"gswdync",@"id=%@ senderid=%@ => search is over",
|
||||||
elementsN[2]++;
|
[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]);
|
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
||||||
return _element;
|
return _element;
|
||||||
};
|
};
|
||||||
|
|
|
@ -547,7 +547,9 @@ static char rcsId[] = "$Id$";
|
||||||
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb];
|
int elementsNb=[(GSWElementIDString*)[context_ elementID]elementsNb];
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@ senderId=%@",[self class],[context_ elementID],[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ definition name=%@ id=%@ senderId=%@",
|
||||||
|
[self class],[self definitionName],
|
||||||
|
[context_ elementID],[context_ senderID]);
|
||||||
GSWAssertCorrectElementID(context_);// Debug Only
|
GSWAssertCorrectElementID(context_);// Debug Only
|
||||||
_senderID=[context_ senderID];
|
_senderID=[context_ senderID];
|
||||||
_elementID=[context_ elementID];
|
_elementID=[context_ elementID];
|
||||||
|
@ -646,7 +648,8 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
|
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
|
||||||
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
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
|
#ifndef NDEBBUG
|
||||||
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWHyperlink invokeActionForRequest: bad elementID");
|
NSAssert(elementsNb==[(GSWElementIDString*)[context_ elementID]elementsNb],@"GSWHyperlink invokeActionForRequest: bad elementID");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -201,7 +201,8 @@ static char rcsId[] = "$Id$";
|
||||||
_disabledInContext=[self disabledInContext:context_];
|
_disabledInContext=[self disabledInContext:context_];
|
||||||
[response_ _appendContentAsciiString:@" type=image"];
|
[response_ _appendContentAsciiString:@" type=image"];
|
||||||
_name=[self nameInContext:context_];
|
_name=[self nameInContext:context_];
|
||||||
NSDebugMLLog(@"gswdync",@"_name=%@",_name);
|
NSDebugMLLog(@"gswdync",@"definition name=%@ _name=%@",
|
||||||
|
[self definitionName],_name);
|
||||||
[response_ _appendContentAsciiString:@" name=\""];
|
[response_ _appendContentAsciiString:@" name=\""];
|
||||||
[response_ appendContentHTMLAttributeValue:_name];
|
[response_ appendContentHTMLAttributeValue:_name];
|
||||||
[response_ appendContentCharacter:'"'];
|
[response_ appendContentCharacter:'"'];
|
||||||
|
@ -337,7 +338,8 @@ static char rcsId[] = "$Id$";
|
||||||
_senderID=[context_ senderID];
|
_senderID=[context_ senderID];
|
||||||
NSDebugMLog(@"_senderID=%@",_senderID);
|
NSDebugMLog(@"_senderID=%@",_senderID);
|
||||||
_elementID=[context_ elementID];
|
_elementID=[context_ elementID];
|
||||||
NSDebugMLog(@"_elementID=%@",_elementID);
|
NSDebugMLog(@"definition name=%@ _elementID=%@",
|
||||||
|
[self definitionName],_elementID);
|
||||||
if ([_elementID isEqualToString:_senderID])
|
if ([_elementID isEqualToString:_senderID])
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
|
|
|
@ -107,11 +107,14 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)description
|
-(NSString*)description
|
||||||
{
|
{
|
||||||
|
NSString* dscr=nil;
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
return [NSString stringWithFormat:@"<%s %p - keyPath=%@>",
|
dscr=[NSString stringWithFormat:@"<%s %p -",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self];
|
||||||
keyPath];
|
dscr=[dscr stringByAppendingFormat:@" keyPath=%@>",
|
||||||
|
keyPath];
|
||||||
|
return dscr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -246,6 +246,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLLog(@"sessions",@"newflag=%d",(int)_flag);
|
||||||
storesIDsInCookies=_flag;
|
storesIDsInCookies=_flag;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
|
@ -186,7 +186,8 @@ static char rcsId[] = "$Id$";
|
||||||
[localException raise];
|
[localException raise];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
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=%@",
|
LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@",
|
||||||
[self class],
|
[self class],
|
||||||
|
|
|
@ -35,24 +35,26 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStartC("GSWSwitchComponent");
|
LOGObjectFnStartC("GSWSwitchComponent");
|
||||||
if ((self=[super initWithName:name_
|
if ((self=[super initWithName:name_
|
||||||
associations:associations_
|
associations:associations_
|
||||||
template:nil]))
|
template:nil]))
|
||||||
{
|
{
|
||||||
NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_];
|
NSMutableDictionary* _associations=[NSMutableDictionary dictionaryWithDictionary:associations_];
|
||||||
[_associations removeObjectForKey:GSWComponentName__Key];
|
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
|
ASSIGN(componentAttributes,[NSDictionary dictionaryWithDictionary:_associations]);
|
||||||
withDefaultObject:[componentName autorelease]] retain];
|
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentAttributes=%@",componentAttributes);
|
||||||
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentName=%@",componentName);
|
|
||||||
|
ASSIGN(template,templateElement_);
|
||||||
ASSIGN(componentAttributes,[NSDictionary dictionaryWithDictionary:_associations]);
|
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: template=%@",template);
|
||||||
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: componentAttributes=%@",componentAttributes);
|
|
||||||
|
componentCache=[NSMutableDictionary new];
|
||||||
ASSIGN(template,templateElement_);
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent: template=%@",template);
|
|
||||||
|
|
||||||
componentCache=[NSMutableDictionary new];
|
|
||||||
};
|
|
||||||
LOGObjectFnStopC("GSWSwitchComponent");
|
LOGObjectFnStopC("GSWSwitchComponent");
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
|
@ -397,7 +397,9 @@ static char rcsId[] = "$Id$";
|
||||||
associations:_associations
|
associations:_associations
|
||||||
template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]
|
template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]
|
||||||
languages:_languages];
|
languages:_languages];
|
||||||
if (!element)
|
if (element)
|
||||||
|
[element setDefinitionName:[pageDefElement elementName]];
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"GSWTemplateParser: Creation failed for element named:%@ className:%@ in template named %@",
|
@"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]
|
template:[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]
|
||||||
languages:_languages];
|
languages:_languages];
|
||||||
NSDebugMLog(@"node=%p element=%@",currentNode,elem);
|
NSDebugMLog(@"node=%p element=%@",currentNode,elem);
|
||||||
if (!elem)
|
if (elem)
|
||||||
|
[elem setDefinitionName:[definitionsElement elementName]];
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"%@ Creation failed for element named:%@ className:%@",
|
@"%@ Creation failed for element named:%@ className:%@",
|
||||||
|
|
|
@ -1737,7 +1737,7 @@ NSData* HexStringToData(NSString* _string)
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)description
|
-(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),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
_searchList,
|
_searchList,
|
||||||
|
@ -1746,8 +1746,6 @@ NSData* HexStringToData(NSString* _string)
|
||||||
_changedDomains,
|
_changedDomains,
|
||||||
_dictionaryRep,
|
_dictionaryRep,
|
||||||
_defaultsDatabase,
|
_defaultsDatabase,
|
||||||
_defaultsDatabaseLockName,
|
|
||||||
_defaultsDatabaseLock,
|
|
||||||
_tickingTimer];
|
_tickingTimer];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -179,18 +179,27 @@ const char* GSGetInstanceVariableType(id obj,
|
||||||
|
|
||||||
- (id)getIVarNamed:(NSString *)name_
|
- (id)getIVarNamed:(NSString *)name_
|
||||||
{
|
{
|
||||||
id value;
|
id value=nil;
|
||||||
SEL sel = @selector(valueForKey:);//NEW NSSelectorFromString(@"valueForKey:");
|
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(@"%@",name_);
|
||||||
//NSLog(@"sel (valueForKey <NSObject>) : %d", (int)sel);
|
//NSLog(@"sel (valueForKey <NSObject>) : %d", (int)sel);
|
||||||
|
|
||||||
NS_DURING
|
NS_DURING
|
||||||
//value = [self valueForKey:name_];
|
value = [self valueForKey:name_];//MGNEW
|
||||||
value = (*imp)(self, sel, name_);
|
//MGNEW value = (*imp)(self, sel, name_);
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
NSDebugMLLog(@"low",@"getIVarNamed %@ in %@ %p (superClass:%@). valueForKey: exception",
|
||||||
|
name_,
|
||||||
|
[self class],
|
||||||
|
self,
|
||||||
|
[self superclass]);
|
||||||
if([self respondsToSelector:@selector(objectForKey:)] == YES) {
|
if([self respondsToSelector:@selector(objectForKey:)] == YES) {
|
||||||
if (name_) {
|
if (name_) {
|
||||||
value = [self objectForKey:name_];
|
value = [self objectForKey:name_];
|
||||||
|
@ -219,7 +228,7 @@ const char* GSGetInstanceVariableType(id obj,
|
||||||
withValue:(id)value_
|
withValue:(id)value_
|
||||||
{
|
{
|
||||||
SEL sel = @selector(takeValue:forKey:);//NEW NSSelectorFromString(@"takeValue:forKey:");
|
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);
|
//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 : self = %@", NSStringFromClass([self class]));
|
||||||
//NSLog(@"setIVarNamed : name_ = %@ (%@)", name_, NSStringFromClass([name_ class]));
|
//NSLog(@"setIVarNamed : name_ = %@ (%@)", name_, NSStringFromClass([name_ class]));
|
||||||
//NSLog(@"setIVarNamed : value_ = %@ (%@)", value_, NSStringFromClass([value_ class]));
|
//NSLog(@"setIVarNamed : value_ = %@ (%@)", value_, NSStringFromClass([value_ class]));
|
||||||
//[self takeValue:value_ forKey:name_];
|
[self takeValue:value_ forKey:name_];//MGNEW
|
||||||
(*imp)(self, sel, value_, name_);
|
//MGNEW (*imp)(self, sel, value_, name_);
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
if (![name_ isEqualToString:@"self"]) {
|
if (![name_ isEqualToString:@"self"]) {
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
DYNAMIC_LINKER=simple
|
DYNAMIC_LINKER=simple
|
||||||
GDL2=yes
|
GDL2=no
|
||||||
|
|