mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-04-23 15:33:43 +00:00
* GSWeb.framework/GSWDefaultAdaptorThread.m
o trace request uri * GSWeb.framework/GSWTemplateParserXML.m o Changed NSDebugMLog to NSDebugMLLog o changes to conform to GSXML modifications * GSWeb.framework/GSWTemplateParser.m o Changed NSDebugMLog to NSDebugMLLog * GSWeb.framework/GSWBundle.m o Changed NSDebugMLog to NSDebugMLLog * GSWeb.framework/GSWComponent.m o Changed NSDebugMLog to NSDebugMLLog * GSWeb.framework/GSWElement.m o Changed NSDebugMLog to NSDebugMLLog * GSWeb.framework/GSWHTMLStaticElement.m o Changed NSDebugMLog to NSDebugMLLog * GSWeb.framework/GSWAssociations.m o fixes in !GDL2 variables names (reported by Piter Punk <piterpk@terra.com.br>) * GSWeb.framework/GSWRadioButtonList.m o fix _name/name in appendToResponse:inContext: * GSWeb.framework/GSWSwitchComponent.m: o fix ExceptionRaise call * GSWeb.framework/GSWDebug.m/.h: o fix ifdef and functions defs * GSWeb.framework/GSWSessionTimeOutManager.m/.h: o add parentheses around assignment used as truth value o ivar names changes to conform to coding standards * GSWeb.framework/GSWDeployedBundle.m: o cast to avoid compiler warning * GSWeb.framework/GSWJavaScript.h/.m: o ivar names changes to conform to coding standards * GSWeb.framework/GSWEmbeddedObject.h/.m: o ivar names changes to conform to coding standards * GSWeb.framework/GSWClientSideScript.h/.m: o ivar names changes to conform to coding standards * GSWeb.framework/GSWApplet.h/.m: o ivar names changes to conform to coding standards * GSWeb.framework/GSWParam.h/.m: o ivar names changes to conform to coding standards git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@14026 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
74a9ee8f16
commit
689335f599
27 changed files with 826 additions and 714 deletions
40
ChangeLog
40
ChangeLog
|
@ -1,3 +1,43 @@
|
|||
2002-07-04 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* GSWeb.framework/GSWDefaultAdaptorThread.m
|
||||
o trace request uri
|
||||
* GSWeb.framework/GSWTemplateParserXML.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
o changes to conform to GSXML modifications
|
||||
* GSWeb.framework/GSWTemplateParser.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
* GSWeb.framework/GSWBundle.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
* GSWeb.framework/GSWComponent.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
* GSWeb.framework/GSWElement.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
* GSWeb.framework/GSWHTMLStaticElement.m
|
||||
o Changed NSDebugMLog to NSDebugMLLog
|
||||
* GSWeb.framework/GSWAssociations.m
|
||||
o fixes in !GDL2 variables names (reported by Piter Punk <piterpk@terra.com.br>)
|
||||
* GSWeb.framework/GSWRadioButtonList.m
|
||||
o fix _name/name in appendToResponse:inContext:
|
||||
* GSWeb.framework/GSWSwitchComponent.m:
|
||||
o fix ExceptionRaise call
|
||||
* GSWeb.framework/GSWDebug.m/.h:
|
||||
o fix ifdef and functions defs
|
||||
* GSWeb.framework/GSWSessionTimeOutManager.m/.h:
|
||||
o add parentheses around assignment used as truth value
|
||||
o ivar names changes to conform to coding standards
|
||||
* GSWeb.framework/GSWDeployedBundle.m:
|
||||
o cast to avoid compiler warning
|
||||
* GSWeb.framework/GSWJavaScript.h/.m:
|
||||
o ivar names changes to conform to coding standards
|
||||
* GSWeb.framework/GSWEmbeddedObject.h/.m:
|
||||
o ivar names changes to conform to coding standards
|
||||
* GSWeb.framework/GSWClientSideScript.h/.m:
|
||||
o ivar names changes to conform to coding standards
|
||||
* GSWeb.framework/GSWApplet.h/.m:
|
||||
o ivar names changes to conform to coding standards
|
||||
* GSWeb.framework/GSWParam.h/.m:
|
||||
o ivar names changes to conform to coding standards
|
||||
|
||||
2002-06-03 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||
* GSWeb.framework/GSWBundle.m:
|
||||
o use smartTakeValue:forKey: instead of takeValue:forKey:
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWApplet.h - GSWeb: Class GSWApplet
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWApplet.h - <title>GSWeb: Class GSWApplet</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,61 +36,61 @@
|
|||
//====================================================================
|
||||
@interface GSWApplet: GSWHTMLDynamicElement
|
||||
{
|
||||
NSMutableDictionary* clientSideAttributes;
|
||||
NSString* elementID;
|
||||
NSString* url;
|
||||
NSString* contextID;
|
||||
NSMutableDictionary* snapshots;
|
||||
GSWAssociation* archive;
|
||||
GSWAssociation* archiveNames;
|
||||
GSWAssociation* agcArchive;
|
||||
GSWAssociation* agcArchiveNames;
|
||||
GSWAssociation* codeBase;
|
||||
NSMutableDictionary* _clientSideAttributes;
|
||||
NSString* _elementID;
|
||||
NSString* _url;
|
||||
NSString* _contextID;
|
||||
NSMutableDictionary* _snapshots;
|
||||
GSWAssociation* _archive;
|
||||
GSWAssociation* _archiveNames;
|
||||
GSWAssociation* _agcArchive;
|
||||
GSWAssociation* _agcArchiveNames;
|
||||
GSWAssociation* _codeBase;
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
|
||||
-(void)dealloc;
|
||||
|
||||
-(BOOL)appendStringAtRight:(id)_unkwnon
|
||||
withMapping:(char*)_mapping;
|
||||
-(BOOL)appendStringAtRight:(id)unkwnon
|
||||
withMapping:(char*)mapping;
|
||||
|
||||
-(id) paramWithName:(id)name_
|
||||
value:(id)value_
|
||||
target:(id)target_
|
||||
key:(id)key_
|
||||
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull_;
|
||||
-(id) paramWithName:(id)name
|
||||
value:(id)value
|
||||
target:(id)target
|
||||
key:(id)key
|
||||
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull;
|
||||
|
||||
-(NSString*)elementName;
|
||||
-(id)contextID;
|
||||
-(void)setContextID:(id)contextID_;
|
||||
-(void)setContextID:(id)contextID;
|
||||
-(id)url;
|
||||
-(void)setURL:(id)url_;
|
||||
-(void)setURL:(id)url;
|
||||
-(NSString*)elementID;
|
||||
-(void)setElementID:(NSString*)elementID_;
|
||||
-(void)setElementID:(NSString*)elementID;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWApplet (GSWAppletA)
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)_computeAgcArchiveStringInContext:(GSWContext*)context_;
|
||||
-(id)_agcArchiveURLsListInContext:(GSWContext*)context_;
|
||||
-(id)_archiveURLsListInContext:(GSWContext*)context_;
|
||||
-(id)_agcArchiveNamesListInContext:(GSWContext*)context_;
|
||||
-(id)_archiveNamesListInContext:(GSWContext*)context_;
|
||||
-(void)_deallocForComponent:(id)component_;
|
||||
-(void)_awakeForComponent:(id)component_;
|
||||
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
-(void)_computeAgcArchiveStringInContext:(GSWContext*)aContext;
|
||||
-(id)_agcArchiveURLsListInContext:(GSWContext*)aContext;
|
||||
-(id)_archiveURLsListInContext:(GSWContext*)aContext;
|
||||
-(id)_agcArchiveNamesListInContext:(GSWContext*)aContext;
|
||||
-(id)_archiveNamesListInContext:(GSWContext*)aContext;
|
||||
-(void)_deallocForComponent:(id)component;
|
||||
-(void)_awakeForComponent:(id)component;
|
||||
|
||||
+(BOOL)hasGSWebObjectsAssociations;
|
||||
@end
|
||||
|
|
|
@ -522,8 +522,9 @@ extern BOOL WOStrictFlag;
|
|||
+(void)setDirectActionRequestHandlerKey:(NSString*)key_;
|
||||
+(NSString*)resourceRequestHandlerKey;
|
||||
+(void)setResourceRequestHandlerKey:(NSString*)key_;
|
||||
+(void)setSessionTimeOut:(id)timeOut_;
|
||||
+(id)sessionTimeOut;
|
||||
+(void)setSessionTimeOut:(NSNumber*)timeOut_;
|
||||
+(NSNumber*)sessionTimeOut;
|
||||
+(void)setSessionTimeOutValue:(NSTimeInterval)timeOutValue_;
|
||||
+(NSTimeInterval)sessionTimeOutValue;
|
||||
+(NSString*)debugSetConfigFilePath;//NDFN
|
||||
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath_;//NDFN
|
||||
|
|
|
@ -4014,17 +4014,17 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)setSessionTimeOut:(id)timeOut_
|
||||
+(void)setSessionTimeOut:(NSNumber*)timeOut_
|
||||
{
|
||||
LOGClassFnStart();
|
||||
NSDebugMLLog(@"sessions",@"_sessionTimeOut=%@",timeOut_);
|
||||
NSDebugMLLog(@"sessions",@"timeOut_=%@",timeOut_);
|
||||
[[NSUserDefaults standardUserDefaults] setObject:timeOut_
|
||||
forKey:GSWOPT_SessionTimeOut[GSWebNamingConv]];
|
||||
LOGClassFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(id)sessionTimeOut
|
||||
+(NSNumber*)sessionTimeOut
|
||||
{
|
||||
id _sessionTimeOut=nil;
|
||||
LOGClassFnStart();
|
||||
|
@ -4034,6 +4034,16 @@ int GSWApplicationMain(NSString* applicationClassName,
|
|||
return _sessionTimeOut;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
+(void)setSessionTimeOutValue:(NSTimeInterval)timeOutValue_
|
||||
{
|
||||
LOGClassFnStart();
|
||||
NSDebugMLLog(@"sessions",@"timeOutValue_=%f",timeOutValue_);
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithDouble:timeOutValue_]
|
||||
forKey:GSWOPT_SessionTimeOut[GSWebNamingConv]];
|
||||
LOGClassFnStop();
|
||||
};
|
||||
|
||||
+(NSTimeInterval)sessionTimeOutValue
|
||||
{
|
||||
id _sessionTimeOut=nil;
|
||||
|
|
|
@ -636,7 +636,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
if (retValue==EONullNull)
|
||||
retValue=nil;
|
||||
#else
|
||||
NSMutableArray* keys=[[keyPath_ componentsSeparatedByString:@"."] mutableCopy];
|
||||
NSMutableArray* keys=[[keyPath componentsSeparatedByString:@"."] mutableCopy];
|
||||
id part=nil;
|
||||
Class handlerClass=Nil;
|
||||
retValue=object;
|
||||
|
@ -666,7 +666,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
break;
|
||||
}
|
||||
else
|
||||
part=[_part stringByAppendingFormat:@".%@",tmpPart];
|
||||
part=[part stringByAppendingFormat:@".%@",tmpPart];
|
||||
}
|
||||
}
|
||||
NSDebugMLLog(@"associations",@"part=%@",part);
|
||||
|
@ -695,7 +695,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
else
|
||||
retValue=nil;
|
||||
}
|
||||
else if ([_part isEqualToString:GSASK_Language])
|
||||
else if ([part isEqualToString:GSASK_Language])
|
||||
{
|
||||
NSArray* languages=[[GSWApp _context] languages];
|
||||
int count=[languages count];
|
||||
|
@ -717,7 +717,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
part);
|
||||
NS_DURING
|
||||
{
|
||||
//MGNEW retValue=[retValue getIVarNamed:_part];
|
||||
//MGNEW retValue=[retValue getIVarNamed:part];
|
||||
retValue=[retValue valueForKey:part];
|
||||
}
|
||||
NS_HANDLER
|
||||
|
@ -766,7 +766,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
[object smartTakeValue:value
|
||||
forKeyPath:keyPath];
|
||||
#else
|
||||
NSMutableArray* keys=[[keyPath_ componentsSeparatedByString:@"."] mutableCopy];
|
||||
NSMutableArray* keys=[[keyPath componentsSeparatedByString:@"."] mutableCopy];
|
||||
id part=nil;
|
||||
id tmpObject=object;
|
||||
Class handlerClass=Nil;
|
||||
|
@ -779,7 +779,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
NSDebugMLLog(@"associations",@"part class=%@",NSStringFromClass([part class]));
|
||||
if ([part hasPrefix:@"\""])
|
||||
{
|
||||
part=[_part stringWithoutPrefix:@"\""];
|
||||
part=[part stringWithoutPrefix:@"\""];
|
||||
while([keys count]>0)
|
||||
{
|
||||
id tmpPart=[keys objectAtIndex:0];
|
||||
|
@ -791,7 +791,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
break;
|
||||
}
|
||||
else
|
||||
part=[_part stringByAppendingFormat:@".%@",tmpPart];
|
||||
part=[part stringByAppendingFormat:@".%@",tmpPart];
|
||||
}
|
||||
}
|
||||
NSDebugMLLog(@"associations",@"part=%@",part);
|
||||
|
@ -829,14 +829,14 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
|||
tmpObject=nil;
|
||||
}
|
||||
else {
|
||||
//MGNEW tmpObject=[tmpObject getIVarNamed:_part];
|
||||
//MGNEW tmpObject=[tmpObject getIVarNamed:part];
|
||||
tmpObject=[tmpObject valueForKey:part];//MGNEW
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GSWLogAssertGood(tmpObject);
|
||||
//MGNEW [tmpObject setIVarNamed:_part
|
||||
//MGNEW [tmpObject setIVarNamed:part
|
||||
// withValue:value_];
|
||||
[tmpObject takeValue:value
|
||||
forKey:part];//MGNEW
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWBundle.m - GSWeb: Class GSWBundle
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWBundle.m - <title>GSWeb: Class GSWBundle</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Mar 1999
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
<abstract></abstract>
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -258,13 +266,13 @@ objectForReference:(NSString*)keyPath
|
|||
int _languagesNb=nil;
|
||||
BOOL _exists=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"type=%@",type_);
|
||||
NSDebugMLLog(@"bundles",@"type=%@",type_);
|
||||
_languagesNb=[languages_ count];
|
||||
|
||||
_fileManager=[NSFileManager defaultManager];
|
||||
|
||||
_fileName=[NSString stringWithFormat:@"%@.%@",name_,type_];
|
||||
NSDebugMLog(@"fileName=%@",_fileName);
|
||||
NSDebugMLLog(@"bundles",@"fileName=%@",_fileName);
|
||||
for(_languageIndex=0;!_resource && !_path && _languageIndex<=_languagesNb;_languageIndex++)
|
||||
{
|
||||
_language=nil;
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWClientSideScript.h - GSWeb: Class GSWClientSideScript
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWClientSideScript.h - <title>GSWeb: Class GSWClientSideScript</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Feb 1999
|
||||
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -28,27 +34,27 @@
|
|||
|
||||
//OK
|
||||
//====================================================================
|
||||
@interface GSWClientSideScript: GSWHTMLDynamicElement
|
||||
@interface GSWClientSideScript: GSWDynamicElement
|
||||
{
|
||||
GSWAssociation* scriptFile;
|
||||
GSWAssociation* scriptString;
|
||||
GSWAssociation* scriptSource;
|
||||
GSWAssociation* hideInComment;
|
||||
GSWAssociation* language;
|
||||
NSDictionary* otherAttributes;
|
||||
GSWAssociation* _scriptFile;
|
||||
GSWAssociation* _scriptString;
|
||||
GSWAssociation* _scriptSource;
|
||||
GSWAssociation* _hideInComment;
|
||||
GSWAssociation* _language;
|
||||
NSDictionary* _otherAttributes;
|
||||
};
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement;
|
||||
-(void)dealloc;
|
||||
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWClientSideScript (GSWClientSideScriptA)
|
||||
-(void)appendToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
#endif //GSWClientSideScript
|
||||
|
|
|
@ -52,16 +52,16 @@ static char rcsId[] = "$Id$";
|
|||
NSAssert(aComponentDefinition,@"No ComponentDefinition in GSWComponent Init");
|
||||
ASSIGN(_componentDefinition,aComponentDefinition);
|
||||
_name=[[NSString stringWithCString:object_get_class_name(self)]retain];
|
||||
NSDebugMLLog(@"gswcomponents",@"_name=%@",_name);
|
||||
NSDebugMLLog(@"GSWComponent",@"_name=%@",_name);
|
||||
_isCachingEnabled=YES;
|
||||
[self _setContext:aContext];
|
||||
NSDebugMLLog(@"gswcomponents",@"_context=%@",_context);
|
||||
NSDebugMLLog(@"GSWComponent",@"_context=%@",_context);
|
||||
_templateName=[[self _templateNameFromClass:[self class]] retain];
|
||||
NSDebugMLLog(@"gswcomponents",@"_templateName=%@",_templateName);
|
||||
NSDebugMLLog(@"GSWComponent",@"_templateName=%@",_templateName);
|
||||
[self setCachingEnabled:[GSWApp isCachingEnabled]];
|
||||
[_componentDefinition _finishInitializingComponent:self];
|
||||
_isSynchronized=[self synchronizesVariablesWithBindings];
|
||||
NSDebugMLLog(@"gswcomponents",@"_isSynchronized=%s",(_isSynchronized ? "YES" : "NO"));
|
||||
NSDebugMLLog(@"GSWComponent",@"_isSynchronized=%s",(_isSynchronized ? "YES" : "NO"));
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return self;
|
||||
|
@ -200,7 +200,7 @@ static char rcsId[] = "$Id$";
|
|||
LOGObjectFnStart();
|
||||
aComponentDefinition=[self _componentDefinition];
|
||||
aFrameworkName=[aComponentDefinition frameworkName];
|
||||
NSDebugMLLog(@"gswcomponents",@"aFrameworkName=%@",aFrameworkName);
|
||||
NSDebugMLLog(@"GSWComponent",@"aFrameworkName=%@",aFrameworkName);
|
||||
LOGObjectFnStop();
|
||||
return aFrameworkName;
|
||||
};
|
||||
|
@ -267,7 +267,7 @@ static char rcsId[] = "$Id$";
|
|||
//TODO
|
||||
NSString* dscr=nil;
|
||||
GSWLogAssertGood(self);
|
||||
NSDebugMLLog(@"gswcomponents",@"GSWComponent description self=%p",self);
|
||||
NSDebugMLLog(@"GSWComponent",@"GSWComponent description self=%p",self);
|
||||
dscr=[NSString stringWithFormat:@"<%s %p>",
|
||||
object_get_class_name(self),
|
||||
(void*)self];
|
||||
|
@ -283,7 +283,7 @@ static char rcsId[] = "$Id$";
|
|||
-(void)setUserDictionary:(NSDictionary*)aUserDictionary
|
||||
{
|
||||
ASSIGN(_userDictionary,aUserDictionary);
|
||||
NSDebugMLLog(@"gswcomponents",@"userDictionary:%@",_userDictionary);
|
||||
NSDebugMLLog(@"GSWComponent",@"userDictionary:%@",_userDictionary);
|
||||
};
|
||||
|
||||
-(NSDictionary*)userAssociations
|
||||
|
@ -294,7 +294,7 @@ static char rcsId[] = "$Id$";
|
|||
-(void)setUserAssociations:(NSDictionary*)userAssociations
|
||||
{
|
||||
ASSIGN(_userAssociations,userAssociations);
|
||||
NSDebugMLLog(@"gswcomponents",@"userAssociations:%@",_userAssociations);
|
||||
NSDebugMLLog(@"GSWComponent",@"userAssociations:%@",_userAssociations);
|
||||
};
|
||||
|
||||
-(NSDictionary*)defaultAssociations
|
||||
|
@ -305,7 +305,7 @@ static char rcsId[] = "$Id$";
|
|||
-(void)setDefaultAssociations:(NSDictionary*)defaultAssociations
|
||||
{
|
||||
ASSIGN(_defaultAssociations,defaultAssociations);
|
||||
NSDebugMLLog(@"gswcomponents",@"defaultAssociations:%@",_defaultAssociations);
|
||||
NSDebugMLLog(@"GSWComponent",@"defaultAssociations:%@",_defaultAssociations);
|
||||
};
|
||||
// }
|
||||
|
||||
|
@ -346,15 +346,15 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//OK
|
||||
LOGObjectFnStart();
|
||||
_parent=parent;
|
||||
NSDebugMLLog(@"gswcomponents",@"name=%@ parent=%p (%@)",
|
||||
NSDebugMLLog(@"GSWComponent",@"name=%@ parent=%p (%@)",
|
||||
[self definitionName],
|
||||
(void*)parent,[parent class]);
|
||||
NSDebugMLLog(@"gswcomponents",@"associations=%@",_associations);
|
||||
NSDebugMLLog(@"GSWComponent",@"associations=%@",_associations);
|
||||
ASSIGN(_associations,associations);
|
||||
ASSIGN(_associationsKeys,associationsKeys);
|
||||
NSDebugMLLog(@"gswcomponents",@"associationsKeys=%@",_associationsKeys);
|
||||
NSDebugMLLog(@"GSWComponent",@"associationsKeys=%@",_associationsKeys);
|
||||
ASSIGN(_childTemplate,template);
|
||||
NSDebugMLLog(@"gswcomponents",@"template=%@",_childTemplate);
|
||||
NSDebugMLLog(@"GSWComponent",@"template=%@",_childTemplate);
|
||||
[self validateAPIAssociations];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -364,7 +364,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"Name=%@ - isSynchronized=%s",
|
||||
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
||||
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
||||
if (_isSynchronized)
|
||||
{
|
||||
|
@ -374,19 +374,19 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
id aValue=nil;
|
||||
id logValue=[self valueForBinding:@"GSWDebug"];
|
||||
BOOL doLog=boolValueWithDefaultFor(logValue,NO);
|
||||
NSDebugMLog(@"defName=%@ - Synchro SubComponent->Component",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - Synchro SubComponent->Component",
|
||||
[self definitionName]);
|
||||
for(i=0;i<[_associationsKeys count];i++)
|
||||
{
|
||||
aKey=[_associationsKeys objectAtIndex:i];
|
||||
anAssociation=[_associations objectAtIndex:i];
|
||||
NSDebugMLLog(@"gswcomponents",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
||||
NSDebugMLLog(@"GSWComponent",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
||||
if ([anAssociation isValueSettable]
|
||||
&& ![anAssociation isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
||||
{
|
||||
//MGNEW aValue=[self getIVarNamed:aKey];
|
||||
aValue=[self valueForKey:aKey];//MGNEW
|
||||
NSDebugMLLog(@"gswcomponents",@"aValue=%@",aValue);
|
||||
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
||||
if (doLog)
|
||||
[anAssociation logSynchronizeComponentToParentForValue:aValue
|
||||
inComponent:_parent];
|
||||
|
@ -403,7 +403,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"Name=%@ - isSynchronized=%s",
|
||||
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
||||
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
||||
if (_isSynchronized)
|
||||
{
|
||||
|
@ -414,17 +414,17 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
id aValue=nil;
|
||||
id logValue=[self valueForBinding:@"GSWDebug"];
|
||||
BOOL doLog=boolValueWithDefaultFor(logValue,NO);
|
||||
NSDebugMLog(@"Name=%@ - Synchro Component->SubComponent",
|
||||
NSDebugMLLog(@"GSWComponent",@"Name=%@ - Synchro Component->SubComponent",
|
||||
[self definitionName]);
|
||||
for(i=0;i<[_associationsKeys count];i++)
|
||||
{
|
||||
aKey=[_associationsKeys objectAtIndex:i];
|
||||
anAssociation=[_associations objectAtIndex:i];
|
||||
NSDebugMLLog(@"gswcomponents",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
||||
NSDebugMLLog(@"GSWComponent",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
||||
if (![anAssociation isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
||||
{
|
||||
aValue=[anAssociation valueInComponent:_parent];
|
||||
NSDebugMLLog(@"gswcomponents",@"aValue=%@",aValue);
|
||||
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
||||
if (doLog)
|
||||
[anAssociation logSynchronizeParentToComponentForValue:aValue
|
||||
inComponent:self];
|
||||
|
@ -521,7 +521,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"aContext=%p",(void*)aContext);
|
||||
NSDebugMLLog(@"GSWComponent",@"aContext=%p",(void*)aContext);
|
||||
_context=aContext;//NO retain !
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -545,7 +545,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
aComponentDefinition=[self _componentDefinition];
|
||||
template=[aComponentDefinition templateWithName:aName
|
||||
languages:languages];
|
||||
NSDebugMLLog(@"gswcomponents",@"template=%@",template);
|
||||
NSDebugMLLog(@"GSWComponent",@"template=%@",template);
|
||||
LOGObjectFnStop();
|
||||
return template;
|
||||
};
|
||||
|
@ -560,11 +560,11 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//OK
|
||||
GSWComponent* subc=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"_elementId=%@",elementId);
|
||||
NSDebugMLLog(@"gswcomponents",@"subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"_elementId=%@",elementId);
|
||||
NSDebugMLLog(@"GSWComponent",@"subComponents=%@",_subComponents);
|
||||
subc=[_subComponents objectForKey:elementId];
|
||||
NSDebugMLLog(@"gswcomponents",@"subc=%@",subc);
|
||||
NSDebugMLog(@"subComponent %@ for _elementId=%@",[subc class],elementId);
|
||||
NSDebugMLLog(@"GSWComponent",@"subc=%@",subc);
|
||||
NSDebugMLLog(@"GSWComponent",@"subComponent %@ for _elementId=%@",[subc class],elementId);
|
||||
LOGObjectFnStop();
|
||||
return subc;
|
||||
};
|
||||
|
@ -575,15 +575,15 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"setSubComponent %@ for _elementId=%@",[component class],elementId);
|
||||
NSDebugMLLog(@"gswcomponents",@"elementId=%@",elementId);
|
||||
NSDebugMLLog(@"gswcomponents",@"component=%@",component);
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"setSubComponent %@ for _elementId=%@",[component class],elementId);
|
||||
NSDebugMLLog(@"GSWComponent",@"elementId=%@",elementId);
|
||||
NSDebugMLLog(@"GSWComponent",@"component=%@",component);
|
||||
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
||||
if (!_subComponents)
|
||||
_subComponents=[NSMutableDictionary new];
|
||||
[_subComponents setObject:component
|
||||
forKey:elementId];
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -594,7 +594,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSArray* parents=nil;
|
||||
LOGObjectFnStart();
|
||||
parents=[self parents];
|
||||
NSDebugMLLog(@"gswcomponents",@"parents=%@",parents);
|
||||
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
||||
[parents makeObjectsPerformSelectorIfPossible:aSelector];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
@ -607,7 +607,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSArray* parents=nil;
|
||||
LOGObjectFnStart();
|
||||
parents=[self parents];
|
||||
NSDebugMLLog(@"gswcomponents",@"parents=%@",parents);
|
||||
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
||||
[parents makeObjectsPerformSelectorIfPossible:aSelector
|
||||
withObject:object];
|
||||
LOGObjectFnStop();
|
||||
|
@ -622,7 +622,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSArray* parents=nil;
|
||||
LOGObjectFnStart();
|
||||
parents=[self parents];
|
||||
NSDebugMLLog(@"gswcomponents",@"parents=%@",parents);
|
||||
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
||||
[parents makeObjectsPerformSelectorIfPossible:aSelector
|
||||
withObject:object1
|
||||
withObject:object2];
|
||||
|
@ -705,7 +705,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSEnumerator* enumerator=nil;
|
||||
id component=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
||||
enumerator= [_subComponents objectEnumerator];
|
||||
while ((component=[enumerator nextObject]))
|
||||
{
|
||||
|
@ -723,7 +723,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSEnumerator* enumerator=nil;
|
||||
id component=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
||||
enumerator= [_subComponents objectEnumerator];
|
||||
while ((component=[enumerator nextObject]))
|
||||
{
|
||||
|
@ -744,7 +744,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSEnumerator* enumerator=nil;
|
||||
id component=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"_subComponents=%@",_subComponents);
|
||||
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
||||
enumerator= [_subComponents objectEnumerator];
|
||||
while ((component=[enumerator nextObject]))
|
||||
{
|
||||
|
@ -769,12 +769,12 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
GSWAssociation* assoc=nil;
|
||||
unsigned int index=NSNotFound;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"_associationsKeys=%@",_associationsKeys);
|
||||
//NSDebugMLLog(@"gswcomponents",@"_associations=%@",[_associations description]);
|
||||
NSDebugMLLog(@"GSWComponent",@"_associationsKeys=%@",_associationsKeys);
|
||||
//NSDebugMLLog(@"GSWComponent",@"_associations=%@",[_associations description]);
|
||||
if (_associationsKeys)
|
||||
{
|
||||
index=[_associationsKeys indexOfObject:aName];
|
||||
NSDebugMLLog(@"gswcomponents",@"index=%u",index);
|
||||
NSDebugMLLog(@"GSWComponent",@"index=%u",index);
|
||||
if (index!=NSNotFound)
|
||||
assoc=[_associations objectAtIndex:index];
|
||||
};
|
||||
|
@ -782,7 +782,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
{
|
||||
assoc=[_defaultAssociations objectForKey:aName];
|
||||
};
|
||||
NSDebugMLLog(@"gswcomponents",@"assoc=%@",assoc);
|
||||
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
||||
LOGObjectFnStop();
|
||||
return assoc;
|
||||
};
|
||||
|
@ -798,16 +798,16 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//OK
|
||||
BOOL hasBinding=NO;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - parentBindingName_=%@",
|
||||
[self definitionName],
|
||||
parentBindingName);
|
||||
if (_associationsKeys)
|
||||
{
|
||||
int index=[_associationsKeys indexOfObject:parentBindingName];
|
||||
NSDebugMLLog(@"gswcomponents",@"index=%u",index);
|
||||
NSDebugMLLog(@"GSWComponent",@"index=%u",index);
|
||||
hasBinding=(index!=NSNotFound);
|
||||
};
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@ - hasBinding=%s",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - hasBinding=%s",
|
||||
[self definitionName],
|
||||
(hasBinding ? "YES" : "NO"));
|
||||
if (!WOStrictFlag && !hasBinding)
|
||||
|
@ -825,15 +825,15 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//OK
|
||||
GSWAssociation* assoc=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@ - parentBindingName_=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - parentBindingName_=%@",
|
||||
[self definitionName],
|
||||
parentBindingName);
|
||||
NSDebugMLLog(@"gswcomponents",@"value_=%@",value);
|
||||
NSDebugMLLog(@"gswcomponents",@"_parent=%p",(void*)_parent);
|
||||
NSDebugMLLog(@"GSWComponent",@"value_=%@",value);
|
||||
NSDebugMLLog(@"GSWComponent",@"_parent=%p",(void*)_parent);
|
||||
if (_parent)
|
||||
{
|
||||
assoc=[self _associationWithName:parentBindingName];
|
||||
NSDebugMLLog(@"gswcomponents",@"assoc=%@",assoc);
|
||||
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
||||
if(assoc)
|
||||
[assoc setValue:value
|
||||
inComponent:_parent];
|
||||
|
@ -865,15 +865,15 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
id aValue=nil;
|
||||
GSWAssociation* assoc=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@",
|
||||
[self definitionName]);
|
||||
NSDebugMLLog(@"gswcomponents",@"parentBindingName=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"parentBindingName=%@",
|
||||
parentBindingName);
|
||||
NSDebugMLLog(@"gswcomponents",@"parent=%p of class %@",(void*)_parent,[_parent class]);
|
||||
NSDebugMLLog(@"GSWComponent",@"parent=%p of class %@",(void*)_parent,[_parent class]);
|
||||
if (_parent)
|
||||
{
|
||||
assoc=[self _associationWithName:parentBindingName];
|
||||
NSDebugMLLog(@"gswcomponents",@"assoc=%@",assoc);
|
||||
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
||||
if(assoc)
|
||||
aValue=[assoc valueInComponent:_parent];
|
||||
/* // Why doing this ? Be carefull: it may make a loop !
|
||||
|
@ -892,7 +892,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
}
|
||||
#endif
|
||||
*/
|
||||
NSDebugMLLog(@"gswcomponents",@"aValue=%@",aValue);
|
||||
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
return aValue;
|
||||
|
@ -908,14 +908,14 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
LOGObjectFnStart();
|
||||
userDictionary=[self userDictionary];
|
||||
synchronizesVariablesWithBindingsValue=[userDictionary objectForKey:@"synchronizesVariablesWithBindings"];
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
||||
[self definitionName],
|
||||
synchronizesVariablesWithBindingsValue);
|
||||
//NDFN
|
||||
if (synchronizesVariablesWithBindingsValue)
|
||||
{
|
||||
synchronizesVariablesWithBindings=[synchronizesVariablesWithBindingsValue boolValue];
|
||||
NSDebugMLLog(@"gswcomponents",@"userDictionary synchronizesVariablesWithBindings=%s",
|
||||
NSDebugMLLog(@"GSWComponent",@"userDictionary synchronizesVariablesWithBindings=%s",
|
||||
(synchronizesVariablesWithBindings ? "YES" : "NO"));
|
||||
};
|
||||
LOGObjectFnStop();
|
||||
|
@ -957,7 +957,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[aComponentDefinition sleep];
|
||||
[self sleep];
|
||||
[self _setContext:nil];
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@ - subComponents=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@ - subComponents=%@",
|
||||
[self definitionName],
|
||||
_subComponents);
|
||||
[_subComponents makeObjectsPerformSelector:@selector(sleepInContext:)
|
||||
|
@ -1005,7 +1005,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NS_DURING
|
||||
{
|
||||
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",[self definitionName],[aContext elementID]]];
|
||||
NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
NSDebugMLLog(@"GSWComponent",@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
[template appendToResponse:aResponse
|
||||
inContext:aContext];
|
||||
}
|
||||
|
@ -1025,7 +1025,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
[self class],debugElementID,[aContext elementID]);
|
||||
};
|
||||
#endif
|
||||
|
@ -1074,7 +1074,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
[self class],debugElementID,[aContext elementID]);
|
||||
|
||||
};
|
||||
|
@ -1114,7 +1114,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
[aContext setValidate:YES];
|
||||
template=[self _template];
|
||||
[aContext appendZeroElementIDComponent];
|
||||
NSDebugMLog(@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
NSDebugMLLog(@"GSWComponent",@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
||||
[template takeValuesFromRequest:aRequest
|
||||
inContext:aContext];
|
||||
[aContext deleteLastElementIDComponent];
|
||||
|
@ -1122,7 +1122,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
#ifndef NDEBUG
|
||||
if (![debugElementID isEqualToString:[aContext elementID]])
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
||||
[self class],debugElementID,[aContext elementID]);
|
||||
|
||||
};
|
||||
|
@ -1178,18 +1178,18 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
NSEnumerator* subComponentsEnum=nil;
|
||||
GSWComponent* component=nil;
|
||||
LOGObjectFnStart();
|
||||
// NSDebugMLLog(@"gswcomponents",@"validationFailureMessages=%@",validationFailureMessages);
|
||||
// NSDebugMLLog(@"GSWComponent",@"validationFailureMessages=%@",validationFailureMessages);
|
||||
[msgs addObjectsFromArray:[[self validationFailureMessages] allValues]];
|
||||
// NSDebugMLLog(@"gswcomponents",@"_msgs=%@",_msgs);
|
||||
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
||||
subComponentsEnum=[_subComponents objectEnumerator];
|
||||
while((component=[subComponentsEnum nextObject]))
|
||||
{
|
||||
// NSDebugMLLog(@"gswcomponents",@"_component=%@",_component);
|
||||
// NSDebugMLLog(@"GSWComponent",@"_component=%@",_component);
|
||||
[msgs addObjectsFromArray:[component allValidationFailureMessages]];
|
||||
// NSDebugMLLog(@"gswcomponents",@"_msgs=%@",_msgs);
|
||||
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
||||
};
|
||||
msgs=[NSArray arrayWithArray:msgs];
|
||||
// NSDebugMLLog(@"gswcomponents",@"_msgs=%@",_msgs);
|
||||
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
||||
LOGObjectFnStop();
|
||||
return msgs;
|
||||
};
|
||||
|
@ -1203,14 +1203,14 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
LOGObjectFnStart();
|
||||
if (![self context])
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"component sleeps, we awake it = %@",self);
|
||||
NSDebugMLLog(@"GSWComponent",@"component sleeps, we awake it = %@",self);
|
||||
[self awakeInContext:aContext];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self context] != aContext)
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",
|
||||
NSDebugMLLog(@"GSWComponent",
|
||||
@"component is already awaken, but has not the current context, we awake it twice with current context = %@",
|
||||
self);
|
||||
[self awakeInContext:aContext];
|
||||
|
@ -1235,8 +1235,8 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//OK
|
||||
GSWComponentDefinition* aComponentDefinition=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
|
||||
NSDebugMLLog(@"gswcomponents",@"defName=%@",[self definitionName]);
|
||||
NSDebugMLLog(@"GSWComponent",@"aContext=%@",aContext);
|
||||
NSDebugMLLog(@"GSWComponent",@"defName=%@",[self definitionName]);
|
||||
NSAssert(aContext,@"No Context");
|
||||
[self _setContext:aContext];
|
||||
aComponentDefinition=[self _componentDefinition];
|
||||
|
@ -1263,13 +1263,13 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
id ret=nil;
|
||||
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"gswcomponents", @"name=%@ - parent=%p",
|
||||
NSDebugMLLog(@"GSWComponent", @"name=%@ - parent=%p",
|
||||
[self definitionName],
|
||||
(void*)_parent);
|
||||
if (_parent)
|
||||
{
|
||||
assoc = [self _associationWithName:attribute];
|
||||
NSDebugMLLog(@"gswcomponents", @"assoc=%@", assoc);
|
||||
NSDebugMLLog(@"GSWComponent", @"assoc=%@", assoc);
|
||||
|
||||
if(assoc && [assoc isValueConstant] == YES)
|
||||
{
|
||||
|
@ -1423,14 +1423,14 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
LOGObjectFnStart();
|
||||
if (![self context])
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"component sleeps, we awake it = %@",self);
|
||||
NSDebugMLLog(@"GSWComponent",@"component sleeps, we awake it = %@",self);
|
||||
[self awakeInContext:aContext];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([self context] != aContext)
|
||||
{
|
||||
NSDebugMLLog(@"gswcomponents",@"component is already awaken, but has not the current context, we awake it twice with current context = %@",self);
|
||||
NSDebugMLLog(@"GSWComponent",@"component is already awaken, but has not the current context, we awake it twice with current context = %@",self);
|
||||
[self awakeInContext:aContext];
|
||||
};
|
||||
};
|
||||
|
@ -1492,7 +1492,7 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
LOGObjectFnStart();
|
||||
response=[[GSWResponse new]autorelease];
|
||||
session=[aContext existingSession];
|
||||
NSDebugMLog(@"session=%@",session);
|
||||
NSDebugMLLog(@"GSWComponent",@"session=%@",session);
|
||||
if (session)
|
||||
{
|
||||
//TODO
|
||||
|
@ -1520,8 +1520,8 @@ associationsKeys:(NSArray*)associationsKeys
|
|||
//----------------
|
||||
//==>10
|
||||
session=[aContext session];
|
||||
NSDebugMLog(@"session=%@",session);
|
||||
NSDebugMLog(@"sessionID=%@",[session sessionID]);
|
||||
NSDebugMLLog(@"GSWComponent",@"session=%@",session);
|
||||
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
||||
[session appendCookieToResponse:response];
|
||||
//==>11
|
||||
[session _saveCurrentPage];
|
||||
|
|
|
@ -279,11 +279,11 @@ static int dontTraceComponentActionURL=0;
|
|||
NSString* string=nil;
|
||||
int elementIDNb=[[self elementID] elementsNb];
|
||||
NSMutableData* data=[NSMutableData dataWithCapacity:elementIDNb+1];
|
||||
char* ptab=(char*)[data bytes];
|
||||
if (!_docStructure)
|
||||
_docStructure=[NSMutableString new];
|
||||
if (!_docStructureElements)
|
||||
_docStructureElements=[NSMutableSet new];
|
||||
char* ptab=(char*)[data bytes];
|
||||
memset(ptab,'\t',elementIDNb);
|
||||
ptab[elementIDNb]='\0';
|
||||
string=[NSString stringWithFormat:@"%s %@ Element %p Class %@ defName=%@\n",
|
||||
|
|
|
@ -26,15 +26,16 @@
|
|||
#ifndef _GSWebDebug_h__
|
||||
#define _GSWebDebug_h__
|
||||
|
||||
|
||||
#ifdef GSWDEBUG
|
||||
#ifdef DEBUG
|
||||
extern void GSWLogC_(CONST char* file,int line,CONST char* string);
|
||||
extern void GSWLogDumpObject_(CONST char* file,int line,id object,int deep);
|
||||
extern void GSWLogAssertGood_(CONST char* file,int line,NSObject* object);
|
||||
extern void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep);
|
||||
extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||
#endif
|
||||
#ifdef GSWDEBUG
|
||||
|
||||
#define GSWLogC(cString); GSWLogC_(__FILE__,__LINE__,cString);
|
||||
#define GSWLogDumpObject(object,deep); GSWLogDumpObject_(__FILE__,__LINE__,object,deep);
|
||||
#define GSWLogAssertGood(object); GSWLogAssertGood_(__FILE__,__LINE__,object);
|
||||
#define GSWLogDumpObject(object,deep); GSWLogDumpObjectFn(__FILE__,__LINE__,object,deep);
|
||||
#define GSWLogAssertGood(object); GSWLogAssertGoodFn(__FILE__,__LINE__,object);
|
||||
|
||||
//Log Memory Alloc/Dealloc
|
||||
#ifdef GSWDEBUG_MEM
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
static char rcsId[] = "$Id$";
|
||||
|
||||
#include <GSWeb/GSWeb.h>
|
||||
#include <GSWeb/GSWDebug.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <unistd.h>
|
||||
|
@ -305,14 +306,14 @@ void DumpIVar(id object,struct objc_ivar* ivar,int deep)
|
|||
pIVar);
|
||||
if (deep>0 && ivar->ivar_type && *ivar->ivar_type==_C_ID && pValue)
|
||||
{
|
||||
GSWLogDumpObject_(NULL,0,*((id*)pValue),deep);
|
||||
GSWLogDumpObjectFn(NULL,0,*((id*)pValue),deep);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
//Dump object
|
||||
void GSWLogDumpObject_(CONST char* file,int line,id object,int deep)
|
||||
void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep)
|
||||
{
|
||||
USTART
|
||||
if (object && deep>0)
|
||||
|
@ -347,7 +348,7 @@ void GSWLogDumpObject_(CONST char* file,int line,id object,int deep)
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
void GSWLogAssertGood_(CONST char* file,int line,NSObject* object)
|
||||
void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object)
|
||||
{
|
||||
if (object)
|
||||
{
|
||||
|
|
|
@ -575,6 +575,8 @@ static char rcsId[] = "$Id$";
|
|||
NSString* method=[requestLineArray objectAtIndex:0];
|
||||
NSString* url=[requestLineArray objectAtIndex:1];
|
||||
NSArray* http=[[requestLineArray objectAtIndex:2] componentsSeparatedByString:@"/"];
|
||||
[GSWApplication statusLogWithFormat:@"Request uri=%@",url];
|
||||
|
||||
NSDebugDeepMLLog(@"info",@"method=%@",method);
|
||||
NSDebugDeepMLLog(@"info",@"url=%@",url);
|
||||
NSDebugDeepMLLog(@"info",@"http=%@",http);
|
||||
|
|
|
@ -118,7 +118,7 @@ static char rcsId[] = "$Id$";
|
|||
isFramework:_isFramework];
|
||||
NSDebugMLLog(@"bundles",@"_projectBundle=%@",_projectBundle);
|
||||
LOGObjectFnStop();
|
||||
return _projectBundle;
|
||||
return (GSWProjectBundle*)_projectBundle;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
@ -47,9 +47,9 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
elementID=[context elementID];
|
||||
/* if ([elementID length]==0)
|
||||
elementID=@"MARKER";*/
|
||||
NSDebugMLog(@"self=%p definitionName=%@ elementID=%@ %p",self,[self definitionName],elementID,elementID);
|
||||
NSDebugMLLog(@"GSWElement",@"self=%p definitionName=%@ elementID=%@ %p",self,[self definitionName],elementID,elementID);
|
||||
ASSIGNCOPY(_appendToResponseElementID,elementID);
|
||||
NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p",self,[self definitionName],_appendToResponseElementID,_appendToResponseElementID);
|
||||
NSDebugMLLog(@"GSWElement",@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p",self,[self definitionName],_appendToResponseElementID,_appendToResponseElementID);
|
||||
GSWAssertIsElementID(context);
|
||||
LOGObjectFnStopC("GSWElement");
|
||||
};
|
||||
|
@ -60,7 +60,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
line:(int)line
|
||||
{
|
||||
LOGObjectFnStartC("GSWElement");
|
||||
/* NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
/* NSDebugMLLog(@"GSWElement",@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
|
@ -70,7 +70,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
method:method
|
||||
file:file
|
||||
line:line];
|
||||
/* NSDebugMLog(@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
/* NSDebugMLLog(@"GSWElement",@"In Object %p Class %@ definitionName=%@ _appendToResponseElementID=%@ [_appendToResponseElementID length]=%d",
|
||||
self,
|
||||
[self class],
|
||||
[self definitionName],
|
||||
|
@ -118,7 +118,7 @@ BYTE ElementsMap_attributeElement = (BYTE)0x41;
|
|||
line:(int)line
|
||||
{
|
||||
LOGObjectFnStartC("GSWElement");
|
||||
/* NSDebugMLog(@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@",
|
||||
/* NSDebugMLLog(@"GSWElement",@"self=%p definitionName=%@ _appendToResponseElementID=%@ %p / [context elementID]=%@",
|
||||
self,
|
||||
[self definitionName],
|
||||
_appendToResponseElementID,_appendToResponseElementID,[context elementID]);
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWEmbeddedObject.h - GSWeb: Class GSWEmbeddedObject
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWEmbeddedObject.h - <title>GSWeb: Class GSWEmbeddedObject</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,9 +36,9 @@
|
|||
//====================================================================
|
||||
@interface GSWEmbeddedObject: GSWHTMLURLValuedElement
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
-(NSString*)valueAttributeName;
|
||||
-(NSString*)urlAttributeName;
|
||||
-(NSString*)elementName;
|
||||
|
|
|
@ -118,9 +118,9 @@ static char rcsId[] = "$Id$";
|
|||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(id) initWithName:(NSString*)anElementName
|
||||
attributeString:(NSString*)attributeString
|
||||
contentElements:(NSArray*)anElementsArray
|
||||
-(id)initWithName:(NSString*)anElementName
|
||||
attributeString:(NSString*)attributeString
|
||||
contentElements:(NSArray*)anElementsArray
|
||||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
|
@ -327,7 +327,7 @@ static char rcsId[] = "$Id$";
|
|||
fromIndex,toIndex);
|
||||
for(elementN=0;elementN<=toIndex;elementN++)
|
||||
{
|
||||
NSDebugMLog(@"appendTo self=%p elementN=%d [context elementID]=%@",self,elementN,[context elementID]);
|
||||
NSDebugMLLog(@"GSWElement",@"appendTo self=%p elementN=%d [context elementID]=%@",self,elementN,[context elementID]);
|
||||
element=(BYTE)elements[elementN];
|
||||
if (element==ElementsMap_htmlBareString)
|
||||
{
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWJavaScript.h - GSWeb: Class GSWJavaScript
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWJavaScript.h - <title>GSWeb: Class GSWJavaScript</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -29,9 +35,9 @@
|
|||
//OK
|
||||
//====================================================================
|
||||
@interface GSWJavaScript: GSWClientSideScript
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement;
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWJavaScript.m - GSWeb: Class GSWJavaScript
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWJavaScript.m - <title>GSWeb: Class GSWJavaScript</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -27,9 +33,9 @@ static char rcsId[] = "$Id$";
|
|||
|
||||
//====================================================================
|
||||
@implementation GSWJavaScript
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
template:(GSWElement*)templateElement_
|
||||
-(id)initWithName:(NSString*)aName
|
||||
associations:(NSDictionary*)associations
|
||||
template:(GSWElement*)templateElement
|
||||
{
|
||||
LOGObjectFnNotImplemented(); //TODOFN
|
||||
return nil;
|
||||
|
|
|
@ -1,25 +1,31 @@
|
|||
/* GSWParam.h - GSWeb: Class GSWParam
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWParam.h - <title>GSWeb: Class GSWParam</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Jan 1999
|
||||
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,23 +36,23 @@
|
|||
//====================================================================
|
||||
@interface GSWParam: GSWHTMLDynamicElement
|
||||
{
|
||||
GSWAssociation* action;
|
||||
GSWAssociation* value;
|
||||
BOOL treatNilValueAsGSWNull;
|
||||
id target;
|
||||
NSString* targetKey;
|
||||
GSWAssociation* _action;
|
||||
GSWAssociation* _value;
|
||||
BOOL _treatNilValueAsGSWNull;
|
||||
id _target;
|
||||
NSString* _targetKey;
|
||||
};
|
||||
|
||||
-(id) initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_
|
||||
target:(id)target_
|
||||
key:(NSString*)key_
|
||||
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements
|
||||
target:(id)target
|
||||
key:(NSString*)key
|
||||
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull;
|
||||
|
||||
-(id)initWithName:(NSString*)name_
|
||||
associations:(NSDictionary*)associations_
|
||||
contentElements:(NSArray*)elements_;
|
||||
-(id)initWithName:(NSString*)name
|
||||
associations:(NSDictionary*)associations
|
||||
contentElements:(NSArray*)elements;
|
||||
|
||||
-(void)dealloc;
|
||||
|
||||
|
@ -57,16 +63,16 @@
|
|||
|
||||
//====================================================================
|
||||
@interface GSWParam (GSWParamA)
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||
inContext:(GSWContext*)aContext;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
@interface GSWParam (GSWParamB)
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
||||
inContext:(GSWContext*)context_;
|
||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||
inContext:(GSWContext*)aContext;
|
||||
|
||||
-(id)valueInComponent:(id)component_;
|
||||
-(id)valueInComponent:(id)component;
|
||||
@end
|
||||
|
||||
//====================================================================
|
||||
|
|
|
@ -282,7 +282,7 @@ static char rcsId[] = "$Id$";
|
|||
inComponent:component];
|
||||
displayStringValue=[_displayString valueInComponent:component];
|
||||
[response appendContentString:@"<INPUT NAME=\""];
|
||||
[response appendContentString:_name];
|
||||
[response appendContentString:name];
|
||||
[response appendContentString:@"\" TYPE=radio VALUE=\""];
|
||||
valueValue=[self valueInContext:context];
|
||||
[response appendContentHTMLAttributeValue:valueValue];
|
||||
|
|
|
@ -160,7 +160,7 @@ static char rcsId[] = "$Id$";
|
|||
tmpCountValue,
|
||||
[tmpCountValue class]);
|
||||
tmpCount=[tmpCountValue intValue];
|
||||
NSDebugMLog(@"tmpCount=%d",tmpCount);
|
||||
NSDebugMLLog(@"gswdync",@"tmpCount=%d",tmpCount);
|
||||
if (_list)
|
||||
countValue=min(tmpCount,countValue);
|
||||
else
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWSessionTimeOutManager.h - GSWeb: Class GSWSessionTimeOutManager
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWSessionTimeOutManager.h - <title>GSWeb: Class GSWSessionTimeOutManager</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Mar 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
// $Id$
|
||||
|
||||
|
@ -30,29 +36,28 @@
|
|||
//====================================================================
|
||||
@interface GSWSessionTimeOutManager : NSObject
|
||||
{
|
||||
//NSMutableOrderedArray* sessionOrderedTimeOuts;
|
||||
NSMutableArray* sessionOrderedTimeOuts;
|
||||
NSMutableDictionary* sessionTimeOuts;
|
||||
id target;
|
||||
SEL callback;
|
||||
NSTimer* timer;
|
||||
// NSRecursiveLock* selfLock;
|
||||
NSLock* selfLock;
|
||||
NSMutableArray* _sessionOrderedTimeOuts;
|
||||
NSMutableDictionary* _sessionTimeOuts;
|
||||
id _target;
|
||||
SEL _callback;
|
||||
NSTimer* _timer;
|
||||
// NSRecursiveLock* _selfLock;
|
||||
NSLock* _selfLock;
|
||||
#ifndef NDEBUG
|
||||
int selfLockn;
|
||||
int _selfLockn;
|
||||
#endif
|
||||
};
|
||||
|
||||
-(id)init;
|
||||
-(void)dealloc;
|
||||
-(void)updateTimeOutForSessionWithID:(NSString*)sessionID_
|
||||
timeOut:(NSTimeInterval)timeOut_;
|
||||
-(void)handleTimer:(NSTimer*)timer_;
|
||||
-(void)updateTimeOutForSessionWithID:(NSString*)sessionID
|
||||
timeOut:(NSTimeInterval)timeOut;
|
||||
-(void)handleTimer:(NSTimer*)timer;
|
||||
-(NSTimer*)resetTimer;
|
||||
-(void)addTimer:(id)timer_;
|
||||
-(void)addTimer:(id)timer;
|
||||
-(void)removeCallBack;
|
||||
-(void)setCallBack:(SEL)callback_
|
||||
target:(id)target_;
|
||||
-(void)setCallBack:(SEL)callback
|
||||
target:(id)target;
|
||||
-(void)lock;
|
||||
-(void)unlock;
|
||||
@end
|
||||
|
@ -61,8 +66,8 @@
|
|||
@interface GSWSessionTimeOutManager (GSWSessionRefused)
|
||||
|
||||
-(void)startHandleTimerRefusingSessions;
|
||||
-(void)handleTimerKillingApplication:(id)timer_;
|
||||
-(void)handleTimerRefusingSessions:(id)timer_;
|
||||
-(void)handleTimerKillingApplication:(id)timer;
|
||||
-(void)handleTimerRefusingSessions:(id)timer;
|
||||
|
||||
@end
|
||||
#endif //_GSWSessionTimeOutManager_h__
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
/* GSWSessionTimeOutManager.m - GSWeb: Class GSWSessionTimeOutManager
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWSessionTimeOutManager.m - <title>GSWeb: Class GSWSessionTimeOutManager</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Mar 1999
|
||||
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +24,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -32,12 +38,11 @@ static char rcsId[] = "$Id$";
|
|||
{
|
||||
//OK
|
||||
if ((self=[super init]))
|
||||
{
|
||||
//sessionOrderedTimeOuts=[[NSMutableOrderedArray alloc]initWithCompareSelector:@selector(compareTimeOutDate:)];
|
||||
sessionOrderedTimeOuts=[NSMutableArray new];
|
||||
sessionTimeOuts=[NSMutableDictionary new];
|
||||
// selfLock=[NSRecursiveLock new];
|
||||
selfLock=[NSLock new];
|
||||
{
|
||||
_sessionOrderedTimeOuts=[NSMutableArray new];
|
||||
_sessionTimeOuts=[NSMutableDictionary new];
|
||||
// selfLock=[NSRecursiveLock new];
|
||||
_selfLock=[NSLock new];
|
||||
};
|
||||
return self;
|
||||
};
|
||||
|
@ -45,193 +50,193 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
{
|
||||
DESTROY(sessionOrderedTimeOuts);
|
||||
DESTROY(sessionTimeOuts);
|
||||
DESTROY(_sessionOrderedTimeOuts);
|
||||
DESTROY(_sessionTimeOuts);
|
||||
//Do Not Retain ! DESTROY(target);
|
||||
DESTROY(timer);
|
||||
DESTROY(selfLock);
|
||||
DESTROY(_timer);
|
||||
DESTROY(_selfLock);
|
||||
[super dealloc];
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)updateTimeOutForSessionWithID:(NSString*)sessionID_
|
||||
timeOut:(NSTimeInterval)timeOut_
|
||||
-(void)updateTimeOutForSessionWithID:(NSString*)sessionID
|
||||
timeOut:(NSTimeInterval)timeOut
|
||||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
NSTimer* _timer=nil;
|
||||
GSWSessionTimeOut* _sessionTimeOut=nil;
|
||||
NSDebugMLLog(@"sessions",@"timeOut_=%ld",(long)timeOut_);
|
||||
_sessionTimeOut=[sessionTimeOuts objectForKey:sessionID_];
|
||||
NSDebugMLLog(@"sessions",@"_sessionTimeOut=%@",_sessionTimeOut);
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
if (_sessionTimeOut)
|
||||
{
|
||||
[_sessionTimeOut retain];
|
||||
[sessionOrderedTimeOuts removeObject:_sessionTimeOut];
|
||||
[_sessionTimeOut setLastAccessTime:[NSDate timeIntervalSinceReferenceDate]];
|
||||
if (timeOut_!=[_sessionTimeOut sessionTimeOut])
|
||||
[_sessionTimeOut setSessionTimeOut:timeOut_];
|
||||
[sessionOrderedTimeOuts addObject:_sessionTimeOut];
|
||||
[_sessionTimeOut release];
|
||||
}
|
||||
else
|
||||
{
|
||||
_sessionTimeOut=[GSWSessionTimeOut timeOutWithSessionID:sessionID_
|
||||
lastAccessTime:[NSDate timeIntervalSinceReferenceDate]
|
||||
sessionTimeOut:timeOut_];
|
||||
[sessionTimeOuts setObject:_sessionTimeOut
|
||||
forKey:sessionID_];
|
||||
[sessionOrderedTimeOuts addObject:_sessionTimeOut];
|
||||
};
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
NSDebugMLLog(@"sessions",@"_sessionTimeOut=%@",_sessionTimeOut);
|
||||
_timer=[self resetTimer];
|
||||
NSDebugMLLog(@"sessions",@"_timer=%@",_timer);
|
||||
if (_timer)
|
||||
{
|
||||
[GSWApplication logWithFormat:@"lock Target..."];
|
||||
[target lock];
|
||||
NS_DURING
|
||||
{
|
||||
[self addTimer:_timer];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"### exception from ... addTimer... %@", [localException reason]);
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
NSLog(@"### exception ... %@", [localException reason]);
|
||||
//TODO
|
||||
[target unlock];
|
||||
[self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
[GSWApplication logWithFormat:@"unlock Target..."];
|
||||
[target unlock];
|
||||
};
|
||||
}
|
||||
{
|
||||
NSTimer* timer=nil;
|
||||
GSWSessionTimeOut* sessionTimeOut=nil;
|
||||
NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut);
|
||||
sessionTimeOut=[_sessionTimeOuts objectForKey:sessionID];
|
||||
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
|
||||
NSDebugMLLog(@"sessions",@"_sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
if (sessionTimeOut)
|
||||
{
|
||||
[sessionTimeOut retain];
|
||||
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
|
||||
[sessionTimeOut setLastAccessTime:[NSDate timeIntervalSinceReferenceDate]];
|
||||
if (timeOut!=[sessionTimeOut sessionTimeOut])
|
||||
[sessionTimeOut setSessionTimeOut:timeOut];
|
||||
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
|
||||
[sessionTimeOut release];
|
||||
}
|
||||
else
|
||||
{
|
||||
sessionTimeOut=[GSWSessionTimeOut timeOutWithSessionID:sessionID
|
||||
lastAccessTime:[NSDate timeIntervalSinceReferenceDate]
|
||||
sessionTimeOut:timeOut];
|
||||
[_sessionTimeOuts setObject:sessionTimeOut
|
||||
forKey:sessionID];
|
||||
[_sessionOrderedTimeOuts addObject:sessionTimeOut];
|
||||
};
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
|
||||
timer=[self resetTimer];
|
||||
NSDebugMLLog(@"sessions",@"timer=%@",timer);
|
||||
if (timer)
|
||||
{
|
||||
[GSWApplication logWithFormat:@"lock Target..."];
|
||||
[_target lock];
|
||||
NS_DURING
|
||||
{
|
||||
[self addTimer:timer];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"### exception from ... addTimer... %@", [localException reason]);
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
NSLog(@"### exception ... %@", [localException reason]);
|
||||
//TODO
|
||||
[_target unlock];
|
||||
[self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
|
||||
[GSWApplication logWithFormat:@"unlock Target..."];
|
||||
[_target unlock];
|
||||
};
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"### exception ... %@", [localException reason]);
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
{
|
||||
NSLog(@"### exception ... %@", [localException reason]);
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
[self unlock];
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)handleTimer:(id)timer_
|
||||
-(void)handleTimer:(id)aTimer
|
||||
{
|
||||
//OK
|
||||
[GSWApplication statusLogWithFormat:@"Start HandleTimer"];
|
||||
// LOGObjectFnStart();
|
||||
[GSWApp lockRequestHandling];
|
||||
NS_DURING
|
||||
{
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
NSEnumerator *_sessionTimeOutEnum = nil;
|
||||
GSWSessionTimeOut* _sessionTimeOut=nil;
|
||||
NSTimeInterval _now=[NSDate timeIntervalSinceReferenceDate];
|
||||
NSTimer* _timer=nil;
|
||||
int _removedNb=0;
|
||||
{
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
NSEnumerator *sessionTimeOutEnum = nil;
|
||||
GSWSessionTimeOut* sessionTimeOut=nil;
|
||||
NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate];
|
||||
NSTimer* timer=nil;
|
||||
int removedNb=0;
|
||||
|
||||
/*
|
||||
if ([sessionOrderedTimeOuts count]>0)
|
||||
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
|
||||
if ([sessionOrderedTimeOuts count]>0)
|
||||
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
|
||||
*/
|
||||
|
||||
_sessionTimeOutEnum = [sessionOrderedTimeOuts objectEnumerator];
|
||||
sessionTimeOutEnum = [_sessionOrderedTimeOuts objectEnumerator];
|
||||
|
||||
while (/*_removedNb<20 && *//*_sessionTimeOut && [_sessionTimeOut timeOutTime]<_now*/
|
||||
_sessionTimeOut = [_sessionTimeOutEnum nextObject])
|
||||
{
|
||||
if ([_sessionTimeOut timeOutTime]<_now)
|
||||
{
|
||||
id _session=nil;
|
||||
[target lock];
|
||||
NS_DURING
|
||||
{
|
||||
_session=[target performSelector:callback
|
||||
withObject:[_sessionTimeOut sessionID]];
|
||||
NSDebugMLLog(@"sessions",@"_session=%@",_session);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[target unlock];
|
||||
while (/*_removedNb<20 && *//*sessionTimeOut && [sessionTimeOut timeOutTime]<_now*/
|
||||
(sessionTimeOut = [sessionTimeOutEnum nextObject]))
|
||||
{
|
||||
if ([sessionTimeOut timeOutTime]<now)
|
||||
{
|
||||
id session=nil;
|
||||
[_target lock];
|
||||
NS_DURING
|
||||
{
|
||||
session=[_target performSelector:_callback
|
||||
withObject:[sessionTimeOut sessionID]];
|
||||
NSDebugMLLog(@"sessions",@"session=%@",session);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[_target unlock];
|
||||
|
||||
timer=[self resetTimer];
|
||||
if (timer)
|
||||
[self addTimer:timer];
|
||||
|
||||
[self unlock];
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
[_target unlock];
|
||||
|
||||
_timer=[self resetTimer];
|
||||
if (_timer)
|
||||
[self addTimer:_timer];
|
||||
if (session)
|
||||
{
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
[session terminate];
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
|
||||
[self unlock];
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
[target unlock];
|
||||
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut);
|
||||
|
||||
if (_session)
|
||||
{
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
[_session terminate];
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
/* [_sessionOrderedTimeOuts removeObjectAtIndex:0]; */
|
||||
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
|
||||
[_sessionTimeOuts removeObjectForKey:[session sessionID]];
|
||||
|
||||
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", _sessionTimeOut);
|
||||
|
||||
/* [sessionOrderedTimeOuts removeObjectAtIndex:0]; */
|
||||
[sessionOrderedTimeOuts removeObject:_sessionTimeOut];
|
||||
[sessionTimeOuts removeObjectForKey:[_session sessionID]];
|
||||
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
_removedNb++;
|
||||
/*
|
||||
if ([sessionOrderedTimeOuts count]>0)
|
||||
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
|
||||
else
|
||||
_sessionTimeOut=nil;
|
||||
*/
|
||||
}
|
||||
else
|
||||
_sessionTimeOut=nil;
|
||||
};
|
||||
};
|
||||
|
||||
_timer=[self resetTimer];
|
||||
if (_timer)
|
||||
[self addTimer:_timer];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
[self unlock];
|
||||
}
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
removedNb++;
|
||||
/*
|
||||
if ([sessionOrderedTimeOuts count]>0)
|
||||
_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
|
||||
else
|
||||
_sessionTimeOut=nil;
|
||||
*/
|
||||
}
|
||||
else
|
||||
sessionTimeOut=nil;
|
||||
};
|
||||
};
|
||||
|
||||
timer=[self resetTimer];
|
||||
if (timer)
|
||||
[self addTimer:timer];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
[self unlock];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
[GSWApp unlockRequestHandling];
|
||||
// LOGObjectFnStop();
|
||||
|
@ -241,95 +246,90 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(NSTimer*)resetTimer
|
||||
{
|
||||
NSTimer* _newTimer=nil;
|
||||
GSWSessionTimeOut* _sessionTimeOut=nil;
|
||||
NSTimer* newTimer=nil;
|
||||
GSWSessionTimeOut* sessionTimeOut=nil;
|
||||
LOGObjectFnStart();
|
||||
// [self lock];
|
||||
NS_DURING
|
||||
{
|
||||
NSTimeInterval _now=[NSDate timeIntervalSinceReferenceDate];
|
||||
NSTimeInterval _timerFireTimeInterval=[[timer fireDate]timeIntervalSinceReferenceDate];
|
||||
{
|
||||
NSTimeInterval now=[NSDate timeIntervalSinceReferenceDate];
|
||||
NSTimeInterval timerFireTimeInterval=[[_timer fireDate]timeIntervalSinceReferenceDate];
|
||||
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
if ([sessionOrderedTimeOuts count]>0)
|
||||
{
|
||||
NSEnumerator * sessionOrderedTimeOutsEnum = [sessionOrderedTimeOuts objectEnumerator];
|
||||
GSWSessionTimeOut* sessionTimeOutObject=nil;
|
||||
NSTimeInterval _minTimeOut;
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
if ([_sessionOrderedTimeOuts count]>0)
|
||||
{
|
||||
NSEnumerator* sessionOrderedTimeOutsEnum = [_sessionOrderedTimeOuts objectEnumerator];
|
||||
GSWSessionTimeOut* sessionTimeOutObject=nil;
|
||||
NSTimeInterval minTimeOut;
|
||||
|
||||
_sessionTimeOut = [sessionOrderedTimeOuts objectAtIndex:0];
|
||||
_minTimeOut = [_sessionTimeOut timeOutTime];
|
||||
while (sessionTimeOutObject = [sessionOrderedTimeOutsEnum nextObject]) {
|
||||
if ([sessionTimeOutObject timeOutTime] < _minTimeOut) {
|
||||
_sessionTimeOut = sessionTimeOutObject;
|
||||
_minTimeOut = [_sessionTimeOut timeOutTime];
|
||||
}
|
||||
}
|
||||
sessionTimeOut = [_sessionOrderedTimeOuts objectAtIndex:0];
|
||||
minTimeOut = [sessionTimeOut timeOutTime];
|
||||
while ((sessionTimeOutObject = [sessionOrderedTimeOutsEnum nextObject]))
|
||||
{
|
||||
if ([sessionTimeOutObject timeOutTime]<minTimeOut)
|
||||
{
|
||||
sessionTimeOut = sessionTimeOutObject;
|
||||
minTimeOut = [sessionTimeOut timeOutTime];
|
||||
}
|
||||
}
|
||||
|
||||
//sessionTimeOut=[_sessionOrderedTimeOuts objectAtIndex:0];
|
||||
|
||||
// search for minimum timeouts
|
||||
|
||||
//_sessionTimeOut=[sessionOrderedTimeOuts objectAtIndex:0];
|
||||
NSDebugMLLog(@"sessions",@"sessionTimeOut=%@",sessionTimeOut);
|
||||
NSDebugMLLog(@"sessions",@"[_timer fireDate]=%@",[_timer fireDate]);
|
||||
NSDebugMLLog(@"sessions",@"[old timer isValide]=%s",
|
||||
[_timer isValid] ? "YES" : "NO");
|
||||
if (sessionTimeOut
|
||||
&& (![_timer isValid]
|
||||
|| [sessionTimeOut timeOutTime]<timerFireTimeInterval
|
||||
|| timerFireTimeInterval<now))
|
||||
{
|
||||
NSTimeInterval timerTimeInterval=[sessionTimeOut timeOutTime]-now;
|
||||
|
||||
// search for minimum timeouts
|
||||
NSDebugMLLog(@"sessions",@"timerTimeInterval=%ld",(long)timerTimeInterval);
|
||||
timerTimeInterval=max(timerTimeInterval,1);//20s minimum
|
||||
NSDebugMLLog(@"sessions",@"timerTimeInterval=%ld",(long)timerTimeInterval);
|
||||
NSLog(@"new timerTimeInterval=%ld",(long)timerTimeInterval);
|
||||
|
||||
NSDebugMLLog(@"sessions",@"_sessionTimeOut=%@",_sessionTimeOut);
|
||||
NSDebugMLLog(@"sessions",@"[timer fireDate]=%@",[timer fireDate]);
|
||||
NSDebugMLLog(@"sessions",@"[old timer isValide]=%s",
|
||||
[timer isValid] ? "YES" : "NO");
|
||||
newTimer=[NSTimer timerWithTimeInterval:timerTimeInterval
|
||||
target:self
|
||||
selector:@selector(handleTimer:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
NSDebugMLLog(@"sessions",@"old timer=%@",_timer);
|
||||
NSDebugMLLog(@"sessions",@"new timer=%@",newTimer);
|
||||
//If timer is a repeat one (anormal) or will be fired in the future
|
||||
NSDebugMLLog(@"sessions",@"[old timer fireDate]=%@",
|
||||
[_timer fireDate]);
|
||||
NSDebugMLLog(@"sessions",@"[old timer isValide]=%s",
|
||||
[_timer isValid] ? "YES" : "NO");
|
||||
/*
|
||||
NSLog(@"_sessionTimeOut=%@",_sessionTimeOut);
|
||||
NSLog(@"[old timer isValide]=%s", [timer isValid] ? "YES" : "NO");
|
||||
NSLog(@"[_sessionTimeOut timeOutTime] = %ld",(long)[_sessionTimeOut timeOutTime]);
|
||||
NSLog(@"_timerFireTimeInterval = %ld",(long) _timerFireTimeInterval);
|
||||
NSLog(@"_now = %ld",(long) _now);
|
||||
if (timer && [[timer fireDate]compare:[NSDate date]]==NSOrderedDescending)
|
||||
[timer invalidate];
|
||||
*/
|
||||
if (_sessionTimeOut
|
||||
&& (![timer isValid]
|
||||
|| [_sessionTimeOut timeOutTime]<_timerFireTimeInterval
|
||||
|| _timerFireTimeInterval<_now))
|
||||
{
|
||||
NSTimeInterval _timerTimeInterval=[_sessionTimeOut timeOutTime]-_now;
|
||||
|
||||
NSDebugMLLog(@"sessions",@"_timerTimeInterval=%ld",(long)_timerTimeInterval);
|
||||
_timerTimeInterval=max(_timerTimeInterval,1);//20s minimum
|
||||
NSDebugMLLog(@"sessions",@"_timerTimeInterval=%ld",(long)_timerTimeInterval);
|
||||
NSLog(@"new _timerTimeInterval=%ld",(long)_timerTimeInterval);
|
||||
|
||||
_newTimer=[NSTimer timerWithTimeInterval:_timerTimeInterval
|
||||
target:self
|
||||
selector:@selector(handleTimer:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
NSDebugMLLog(@"sessions",@"old timer=%@",timer);
|
||||
NSDebugMLLog(@"sessions",@"new timer=%@",_newTimer);
|
||||
//If timer is a repeat one (anormal) or will be fired in the future
|
||||
NSDebugMLLog(@"sessions",@"[old timer fireDate]=%@",
|
||||
[timer fireDate]);
|
||||
NSDebugMLLog(@"sessions",@"[old timer isValide]=%s",
|
||||
[timer isValid] ? "YES" : "NO");
|
||||
/*
|
||||
if (timer && [[timer fireDate]compare:[NSDate date]]==NSOrderedDescending)
|
||||
[timer invalidate];
|
||||
*/
|
||||
ASSIGN(timer,_newTimer);
|
||||
};
|
||||
}
|
||||
else
|
||||
ASSIGN(timer,_newTimer);
|
||||
}
|
||||
ASSIGN(_timer,newTimer);
|
||||
};
|
||||
}
|
||||
else
|
||||
ASSIGN(_timer,newTimer);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
// [self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
// [self unlock];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
// [self unlock];
|
||||
// [self unlock];
|
||||
LOGObjectFnStop();
|
||||
return _newTimer;
|
||||
return newTimer;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)addTimer:(NSTimer*)timer_
|
||||
-(void)addTimer:(NSTimer*)timer
|
||||
{
|
||||
//OK
|
||||
LOGObjectFnStart();
|
||||
|
@ -340,29 +340,29 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)removeCallBack
|
||||
{
|
||||
target=nil;
|
||||
callback=NULL;
|
||||
_target=nil;
|
||||
_callback=NULL;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)setCallBack:(SEL)callback_
|
||||
target:(id)target_
|
||||
-(void)setCallBack:(SEL)callback
|
||||
target:(id)target
|
||||
{
|
||||
//OK
|
||||
target=target_; //Do not retain !
|
||||
callback=callback_;
|
||||
_target=target; //Do not retain !
|
||||
_callback=callback;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)lock
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",selfLockn);
|
||||
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
|
||||
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
||||
#ifndef NDEBUG
|
||||
selfLockn++;
|
||||
_selfLockn++;
|
||||
#endif
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",selfLockn);
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -370,12 +370,12 @@ static char rcsId[] = "$Id$";
|
|||
-(void)unlock
|
||||
{
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",selfLockn);
|
||||
TmpUnlock(selfLock);
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
|
||||
TmpUnlock(_selfLock);
|
||||
#ifndef NDEBUG
|
||||
selfLockn--;
|
||||
_selfLockn--;
|
||||
#endif
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",selfLockn);
|
||||
NSDebugMLLog(@"sessions",@"selfLockn=%d",_selfLockn);
|
||||
LOGObjectFnStop();
|
||||
};
|
||||
|
||||
|
@ -387,159 +387,158 @@ static char rcsId[] = "$Id$";
|
|||
//--------------------------------------------------------------------
|
||||
-(void)startHandleTimerRefusingSessions
|
||||
{
|
||||
NSTimer* _newTimer = nil;
|
||||
NSTimer* newTimer = nil;
|
||||
|
||||
NSLog(@"---Start startHandleTimerRefusingSessions");
|
||||
//[GSWApplication statusLogWithFormat:@"Start startHandleTimerRefusingSessions"];
|
||||
//LOGObjectFnStart();
|
||||
[self lock];
|
||||
/*
|
||||
_newTimer=[NSTimer timerWithTimeInterval:5 // first time after 5 seconds
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
if (_newTimer) {
|
||||
[GSWApp addTimer:_newTimer];
|
||||
}
|
||||
NSLog(@"---Start startHandleTimerRefusingSessions");
|
||||
//[GSWApplication statusLogWithFormat:@"Start startHandleTimerRefusingSessions"];
|
||||
//LOGObjectFnStart();
|
||||
[self lock];
|
||||
/*
|
||||
newTimer=[NSTimer timerWithTimeInterval:5 // first time after 5 seconds
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
if (newTimer)
|
||||
[GSWApp addTimer:newTimer];
|
||||
|
||||
*/
|
||||
|
||||
_newTimer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
[self unlock];
|
||||
//LOGObjectFnStop();
|
||||
//[GSWApplication statusLogWithFormat:@"Stop startHandleTimerRefusingSessions"];
|
||||
NSLog(@"---Stop startHandleTimerRefusingSessions");
|
||||
newTimer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
[self unlock];
|
||||
//LOGObjectFnStop();
|
||||
//[GSWApplication statusLogWithFormat:@"Stop startHandleTimerRefusingSessions"];
|
||||
NSLog(@"---Stop startHandleTimerRefusingSessions");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)handleTimerKillingApplication:(id)timer_
|
||||
-(void)handleTimerKillingApplication:(id)timer
|
||||
{
|
||||
NSLog(@"application is shutting down...");
|
||||
[GSWApp lock];
|
||||
[GSWApp lockRequestHandling];
|
||||
[self lock];
|
||||
[GSWApp dealloc];
|
||||
[GSWApplication dealloc]; // call class method , not instance method
|
||||
exit(0);
|
||||
NSLog(@"application is shutting down...");
|
||||
[GSWApp lock];
|
||||
[GSWApp lockRequestHandling];
|
||||
[self lock];
|
||||
[GSWApp dealloc];
|
||||
[GSWApplication dealloc]; // call class method , not instance method
|
||||
exit(0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)handleTimerRefusingSessions:(id)timer_
|
||||
-(void)handleTimerRefusingSessions:(id)aTimer
|
||||
{
|
||||
//OK
|
||||
//NSLog(@"-Start HandleTimerRefusingSessions");
|
||||
//NSLog(@"-Start HandleTimerRefusingSessions");
|
||||
//[GSWApplication statusLogWithFormat:@"-Start HandleTimerRefusingSessions"];
|
||||
//[GSWApp lockRequestHandling];
|
||||
NS_DURING
|
||||
{
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
GSWApplication *ourApp = [GSWApplication application];
|
||||
NSTimer *_timer=nil;
|
||||
{
|
||||
[self lock];
|
||||
NS_DURING
|
||||
{
|
||||
GSWApplication* ourApp = [GSWApplication application];
|
||||
NSTimer *timer=nil;
|
||||
|
||||
if (ourApp && [ourApp isRefusingNewSessions] && ([sessionOrderedTimeOuts count] <= [ourApp minimumActiveSessionsCount])) {
|
||||
if (ourApp && [ourApp isRefusingNewSessions] && ([_sessionOrderedTimeOuts count] <= [ourApp minimumActiveSessionsCount]))
|
||||
{
|
||||
// okay , soft-shutdown for all avtive sessions
|
||||
|
||||
GSWSessionTimeOut* sessionTimeOut=nil;
|
||||
|
||||
// okay , soft-shutdown for all avtive sessions
|
||||
while ([_sessionOrderedTimeOuts count] > 0)
|
||||
{
|
||||
sessionTimeOut = [_sessionOrderedTimeOuts lastObject];
|
||||
if (sessionTimeOut)
|
||||
{
|
||||
id session=nil;
|
||||
[_target lock];
|
||||
NS_DURING
|
||||
{
|
||||
session=[_target performSelector:_callback
|
||||
withObject:[sessionTimeOut sessionID]];
|
||||
NSDebugMLLog(@"sessions",@"session=%@",session);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[_target unlock];
|
||||
timer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
GSWSessionTimeOut *_sessionTimeOut=nil;
|
||||
[self unlock];
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
[_target unlock];
|
||||
|
||||
while ([sessionOrderedTimeOuts count] > 0) {
|
||||
if (session)
|
||||
{
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
[session terminate]; // ???
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
|
||||
_sessionTimeOut = [sessionOrderedTimeOuts lastObject];
|
||||
if (_sessionTimeOut) {
|
||||
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", sessionTimeOut);
|
||||
|
||||
id _session=nil;
|
||||
[target lock];
|
||||
NS_DURING
|
||||
{
|
||||
_session=[target performSelector:callback
|
||||
withObject:[_sessionTimeOut sessionID]];
|
||||
NSDebugMLLog(@"sessions",@"_session=%@",_session);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[target unlock];
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
[_sessionOrderedTimeOuts removeObject:sessionTimeOut];
|
||||
[_sessionTimeOuts removeObjectForKey:[session sessionID]];
|
||||
|
||||
[self unlock];
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
[target unlock];
|
||||
|
||||
if (_session)
|
||||
{
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
[_session terminate]; // ???
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
|
||||
NSLog(@"GSWSessionTimeOutMananger : removeObject = %@", _sessionTimeOut);
|
||||
|
||||
[sessionOrderedTimeOuts removeObject:_sessionTimeOut];
|
||||
[sessionTimeOuts removeObjectForKey:[_session sessionID]];
|
||||
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// app terminate
|
||||
NSLog(@"application is preparing to shut down in 10 sec...");
|
||||
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:10
|
||||
target:self
|
||||
selector:@selector(handleTimerKillingApplication:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
} else
|
||||
{
|
||||
// new timer, app does not terminate
|
||||
_timer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",sessionOrderedTimeOuts);
|
||||
[self unlock];
|
||||
}
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
}
|
||||
}
|
||||
}
|
||||
// app terminate
|
||||
NSLog(@"application is preparing to shut down in 10 sec...");
|
||||
|
||||
timer = [NSTimer scheduledTimerWithTimeInterval:10
|
||||
target:self
|
||||
selector:@selector(handleTimerKillingApplication:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// new timer, app does not terminate
|
||||
timer = [NSTimer scheduledTimerWithTimeInterval:5
|
||||
target:self
|
||||
selector:@selector(handleTimerRefusingSessions:)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
[self unlock];
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
NSDebugMLLog(@"sessions",@"sessionOrderedTimeOuts=%@",_sessionOrderedTimeOuts);
|
||||
[self unlock];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
{
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
//TODO
|
||||
//[GSWApp unlockRequestHandling];
|
||||
[localException raise];
|
||||
};
|
||||
NS_ENDHANDLER;
|
||||
//[GSWApp unlockRequestHandling];
|
||||
//[GSWApplication statusLogWithFormat:@"-Stop HandleTimerRefusingSessions"];
|
||||
//NSLog(@"-Stop HandleTimerRefusingSessions");
|
||||
//NSLog(@"-Stop HandleTimerRefusingSessions");
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ static char rcsId[] = "$Id$";
|
|||
else
|
||||
{
|
||||
formattedValue=[formatter stringForObjectValue:valueValue];
|
||||
NSDebugMLog(@"valueValue=%@ formattedValue=%@",valueValue,formattedValue);
|
||||
NSDebugMLLog(@"gswdync",@"valueValue=%@ formattedValue=%@",valueValue,formattedValue);
|
||||
};
|
||||
|
||||
if (!WOStrictFlag && _convertHTML)
|
||||
|
@ -208,7 +208,7 @@ static char rcsId[] = "$Id$";
|
|||
LOGObjectFnStartC("GSWString");
|
||||
if (_dateFormat)
|
||||
{
|
||||
NSDebugMLog0(@"DateFormat");
|
||||
NSDebugMLLog(@"gswdync",@"DateFormat");
|
||||
formatValue=[_dateFormat valueInComponent:component];
|
||||
if (formatValue)
|
||||
formatter=[[[NSDateFormatter alloc]initWithDateFormat:formatValue
|
||||
|
@ -216,7 +216,7 @@ static char rcsId[] = "$Id$";
|
|||
}
|
||||
else if (_numberFormat)
|
||||
{
|
||||
NSDebugMLog0(@"NumberFormat");
|
||||
NSDebugMLLog(@"gswdync",@"NumberFormat");
|
||||
formatValue=[_numberFormat valueInComponent:component];
|
||||
if (formatValue)
|
||||
{
|
||||
|
@ -228,10 +228,10 @@ static char rcsId[] = "$Id$";
|
|||
}
|
||||
else
|
||||
{
|
||||
NSDebugMLog0(@"Formatter");
|
||||
NSDebugMLLog(@"gswdync",@"Formatter");
|
||||
formatter=[_formatter valueInComponent:component];
|
||||
};
|
||||
NSDebugMLog(@"formatter=%@",formatter);
|
||||
NSDebugMLLog(@"gswdync",@"formatter=%@",formatter);
|
||||
LOGObjectFnStopC("GSWString");
|
||||
return formatter;
|
||||
};
|
||||
|
|
|
@ -198,7 +198,8 @@ if the component has already been created, it get it from the cache; otherwise,
|
|||
}
|
||||
else
|
||||
{
|
||||
ExceptionRaise(@"GSWSwitchComponent %p (defName=%@): Creation failed for element named:%@",
|
||||
ExceptionRaise(@"GSWSwitchComponent",
|
||||
@"GSWSwitchComponent %p (defName=%@): Creation failed for element named:%@",
|
||||
self,[self definitionName],aName);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
/* GSWTemplateParser.m - GSWeb: Class GSWTemplateParser
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
/** GSWTemplateParser.m - <title>GSWeb: Class GSWTemplateParser</title>
|
||||
|
||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
||||
Date: Mar 1999
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
$Revision$
|
||||
$Date$
|
||||
|
||||
<abstract></abstract>
|
||||
|
||||
This file is part of the GNUstep Web Library.
|
||||
|
||||
<license>
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
|
@ -19,7 +26,8 @@
|
|||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
</license>
|
||||
**/
|
||||
|
||||
static char rcsId[] = "$Id$";
|
||||
|
||||
|
@ -77,7 +85,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
GSWElement* resultTemplate=nil;
|
||||
Class parserClass=Nil;
|
||||
LOGClassFnStart();
|
||||
NSDebugMLLog(@"low",@"definitionPath_=%@",definitionPath_);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
|
||||
if (parserClassName)
|
||||
{
|
||||
parserClass=NSClassFromString(parserClassName);
|
||||
|
@ -110,8 +118,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
GSWElement* resultTemplate=nil;
|
||||
GSWTemplateParser* templateParser=nil;
|
||||
LOGClassFnStart();
|
||||
NSDebugMLLog(@"low",@"template named:%@ frameworkName:%@ pageDefString=%@",name_,frameworkName_,pageDefString);
|
||||
NSDebugMLLog(@"low",@"definitionPath_=%@",definitionPath_);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ frameworkName:%@ pageDefString=%@",name_,frameworkName_,pageDefString);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
|
||||
if (!parserClass)
|
||||
{
|
||||
parserClass=[self defaultParserClass];
|
||||
|
@ -202,7 +210,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
NSEnumerator* _enum = [definitionsElements objectEnumerator];
|
||||
id _obj=nil;
|
||||
NSString* _className=nil;
|
||||
NSDebugMLLog(@"low",@"template named:%@ definitionsElements=%@",name_,definitionsElements);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ definitionsElements=%@",name_,definitionsElements);
|
||||
while ((_obj = [_enum nextObject]))
|
||||
{
|
||||
_className=[_obj className];
|
||||
|
@ -237,7 +245,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
|
||||
_template=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
|
||||
[_template setDefinitionName:[NSString stringWithFormat:@"Template - %@",_templateName]];
|
||||
NSDebugMLog(@"template %p=%@",_template,_template);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"template %p=%@",_template,_template);
|
||||
//NSLog(@"_string = %@", _string);
|
||||
|
||||
docTypeRangeStart=[_string rangeOfString:@"<!DOCTYPE"];
|
||||
|
@ -271,7 +279,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
LOGObjectFnStart();
|
||||
if (!_definitions)
|
||||
{
|
||||
NSDebugMLLog(@"low",@"_definitionFilePath=%@",_definitionFilePath);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"_definitionFilePath=%@",_definitionFilePath);
|
||||
if ([_definitionsString length]==0)
|
||||
{
|
||||
ASSIGN(_definitions,[NSDictionary dictionary]);
|
||||
|
@ -315,8 +323,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
definitionsTokenBuffer=[ANTLRTokenBuffer tokenBufferWithTokenizer:definitionsLexer];
|
||||
definitionsParser=[[[GSWPageDefParser alloc] initWithTokenBuffer:definitionsTokenBuffer]
|
||||
autorelease];
|
||||
NSDebugMLLog(@"low",@"processedFiles=%@",processedFiles);
|
||||
NSDebugMLLog(@"low",@"name:%@ definitionsString=%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles=%@",processedFiles);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ definitionsString=%@",
|
||||
localDefinitionName_,
|
||||
localDefinitionstring_);
|
||||
NS_DURING
|
||||
|
@ -339,8 +347,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
tmpDefinitions=[[[definitionsParser elements] mutableCopy] autorelease];
|
||||
definitionsIncludes=[definitionsParser includes];
|
||||
NSDebugMLLog0(@"low",@"Definitions Parse OK!");
|
||||
NSDebugMLLog(@"low",@"localDefinitions=%@",tmpDefinitions);
|
||||
NSDebugMLLog(@"low",@"definitionsIncludes=%@",definitionsIncludes);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions=%@",tmpDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionsIncludes=%@",definitionsIncludes);
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
@ -369,15 +377,15 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
localDefinitions=[NSMutableDictionary dictionaryWithDictionary:tmpDefinitions];
|
||||
if (localDefinitions)
|
||||
{
|
||||
NSDebugMLLog(@"low",@"definitionsIncludes:%@\n",definitionsIncludes);
|
||||
NSDebugMLLog(@"low",@"localDefinitionName_:%@\n",localDefinitionName_);
|
||||
NSDebugMLLog(@"low",@"localFrameworkName_:%@\n",localFrameworkName_);
|
||||
NSDebugMLLog(@"low",@"processedFiles:%@\n",processedFiles);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionsIncludes:%@\n",definitionsIncludes);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitionName_:%@\n",localDefinitionName_);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localFrameworkName_:%@\n",localFrameworkName_);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles:%@\n",processedFiles);
|
||||
tmpDefinitions=[self processIncludes:definitionsIncludes
|
||||
named:localDefinitionName_
|
||||
inFrameworkNamed:localFrameworkName_
|
||||
processedFiles:processedFiles];
|
||||
NSDebugMLLog(@"low",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||
if (tmpDefinitions)
|
||||
[localDefinitions addDefaultEntriesFromDictionary:tmpDefinitions];
|
||||
else
|
||||
|
@ -388,9 +396,9 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
localDefinitionName_,
|
||||
definitionsIncludes);
|
||||
};
|
||||
NSDebugMLLog(@"low",@"localDefinitions:%@\n",localDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||
};
|
||||
NSDebugMLLog(@"low",@"localDefinitions:%@\n",localDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||
if (localDefinitions)
|
||||
returnedLocalDefinitions=[NSDictionary dictionaryWithDictionary:localDefinitions];
|
||||
LOGObjectFnStop();
|
||||
|
@ -490,19 +498,19 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
if (_path)
|
||||
{
|
||||
NSString* _pageDefString=nil;
|
||||
NSDebugMLLog(@"low",@"_path=%@",_path);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"_path=%@",_path);
|
||||
[processedFiles addObject:_path];
|
||||
//NSString* pageDefPath=[path stringByAppendingString:_definitionPath];
|
||||
//TODO use encoding !
|
||||
_pageDefString=[NSString stringWithContentsOfFile:_path];
|
||||
NSDebugMLLog(@"low",@"path=%@: _pageDefString:%@\n",_path,_pageDefString);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"path=%@: _pageDefString:%@\n",_path,_pageDefString);
|
||||
if (_pageDefString)
|
||||
{
|
||||
tmpDefinitions=[self parseDefinitionsString:_pageDefString
|
||||
named:includeName_
|
||||
inFrameworkNamed:localFrameworkName
|
||||
processedFiles:processedFiles];
|
||||
NSDebugMLLog(@"low",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||
if (tmpDefinitions)
|
||||
localDefinitions=[NSMutableDictionary dictionaryWithDictionary:tmpDefinitions];
|
||||
else
|
||||
|
@ -513,7 +521,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
localFrameworkName,
|
||||
processedFiles);
|
||||
};
|
||||
NSDebugMLLog(@"low",@"localDefinitions:%@\n",localDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -534,7 +542,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
localFrameworkName,
|
||||
processedFiles);
|
||||
};
|
||||
NSDebugMLLog(@"low",@"localDefinitions:%@\n",localDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||
if (localDefinitions)
|
||||
returnedLocalDefinitions=[NSDictionary dictionaryWithDictionary:localDefinitions];
|
||||
LOGObjectFnStop();
|
||||
|
@ -551,7 +559,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
NSDictionary* returnedLocalDefinitions=nil;
|
||||
NSMutableDictionary* localDefinitions=nil;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLLog(@"low",@"name:%@ frameworkName_=%@ definitionsIncludes_=%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ frameworkName_=%@ definitionsIncludes_=%@",
|
||||
localDefinitionsName_,
|
||||
localFrameworkName_,
|
||||
definitionsIncludes_);
|
||||
|
@ -565,12 +573,12 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
for(i=_count-1;localDefinitions && i>=0;i--)
|
||||
{
|
||||
_includeName=[definitionsIncludes_ objectAtIndex:i];
|
||||
NSDebugMLLog(@"low",@"Template componentDefinition _includeName:%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@",
|
||||
_includeName);
|
||||
tmpDefinitions=[self parseDefinitionInclude:_includeName
|
||||
fromFrameworkNamed:localFrameworkName_
|
||||
processedFiles:processedFiles];
|
||||
NSDebugMLLog(@"low",@"Template componentDefinition _includeName:%@ tmpDefinitions=%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@ tmpDefinitions=%@",
|
||||
_includeName,
|
||||
tmpDefinitions);
|
||||
if (tmpDefinitions)
|
||||
|
@ -584,7 +592,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
|||
};
|
||||
};
|
||||
};
|
||||
NSDebugMLLog(@"low",@"localDefinitions:%@\n",localDefinitions);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||
if (localDefinitions)
|
||||
returnedLocalDefinitions=[NSDictionary dictionaryWithDictionary:localDefinitions];
|
||||
LOGObjectFnStop();
|
||||
|
|
|
@ -222,7 +222,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
NSString* externalContent=nil;
|
||||
xmlParserInputPtr result = 0;
|
||||
LOGObjectFnStart();
|
||||
NSDebugMLog(@"resolveEntity:%@ systemID:%@ inParserContext:%p\n",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"resolveEntity:%@ systemID:%@ inParserContext:%p\n",
|
||||
publicIdEntity,
|
||||
systemIdEntity,
|
||||
lib);
|
||||
|
@ -241,7 +241,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
pathForResource:resourceName
|
||||
ofType:@"dtd"
|
||||
inDirectory:@"DTDs"];
|
||||
NSDebugMLog(@"systemIdEntity: fileName=%@ for Resource:%@",fileName,resourceName);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"systemIdEntity: fileName=%@ for Resource:%@",fileName,resourceName);
|
||||
if (fileName)
|
||||
{
|
||||
externalContent=[NSString stringWithContentsOfFile:fileName];
|
||||
|
@ -254,7 +254,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
%attrs;
|
||||
>\n";
|
||||
// name NMTOKEN; #IMPLIED
|
||||
NSDebugMLog(@"gswebTag=\n%@",gswebTag);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"gswebTag=\n%@",gswebTag);
|
||||
externalContent=[externalContent stringByAppendingString:gswebTag];
|
||||
|
||||
[[self class] setCachedDTDContent:externalContent
|
||||
|
@ -301,7 +301,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
pathForResource:resourceName
|
||||
ofType:@"dtd"
|
||||
inDirectory:@"DTDs"];
|
||||
NSDebugMLog(@"systemIdEntity: fileName=%@ for Resource:%@",fileName,publicIdEntity);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"systemIdEntity: fileName=%@ for Resource:%@",fileName,publicIdEntity);
|
||||
if (fileName)
|
||||
{
|
||||
externalContent=[NSString stringWithContentsOfFile:fileName];
|
||||
|
@ -330,7 +330,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
pathForResource:resourceName
|
||||
ofType:@"ent"
|
||||
inDirectory:@"DTDs"];
|
||||
NSDebugMLog(@"systemIdEntity: fileName=%@ for Resource:%@",fileName,publicIdEntity);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"systemIdEntity: fileName=%@ for Resource:%@",fileName,publicIdEntity);
|
||||
if (fileName)
|
||||
{
|
||||
externalContent=[NSString stringWithContentsOfFile:fileName];
|
||||
|
@ -361,7 +361,7 @@ xmlParserInputPtr GSWTemplateParserSAXHandler_ExternalLoader(const char *systemI
|
|||
result=xmlNewStringInputStream(lib,[externalContent cString]);
|
||||
};
|
||||
NSAssert2(result,@"Can't load external (publicIdEntity:%@ systemIdEntity:%@)",publicIdEntity,systemIdEntity);
|
||||
NSDebugMLog(@"LOADED: resolveEntity:%@ systemID:%@ inParserContext:%p\n",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"LOADED: resolveEntity:%@ systemID:%@ inParserContext:%p\n",
|
||||
publicIdEntity,
|
||||
systemIdEntity,
|
||||
lib);
|
||||
|
@ -450,11 +450,11 @@ static NSString* TabsForLevel(int level)
|
|||
TabsForLevel(level),
|
||||
[node name],
|
||||
[node typeDescription],
|
||||
[node propertiesAsDictionary],
|
||||
[node propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
(content ? ":\n" : ""),
|
||||
(content ? content : "")];
|
||||
if ([node children])
|
||||
dumpString=[dumpString stringByAppendingString:[self dumpNode:[node children]
|
||||
if ([node firstChild])
|
||||
dumpString=[dumpString stringByAppendingString:[self dumpNode:[node firstChild]
|
||||
atLevel:level+1]];
|
||||
node=[node next];
|
||||
};
|
||||
|
@ -483,12 +483,12 @@ static NSString* TabsForLevel(int level)
|
|||
NSRange tagRange=NSMakeRange(NSNotFound,0);
|
||||
tagRange=[_string rangeOfString:@"<HTML"
|
||||
options:NSCaseInsensitiveSearch];
|
||||
//NSDebugMLog(@"HTML Tag Range length=%d",tagRange.length);
|
||||
//NSDebugMLLog(@"GSWTemplateParser",@"HTML Tag Range length=%d",tagRange.length);
|
||||
if (tagRange.length>0)
|
||||
_isHTMLTag=YES;
|
||||
tagRange=[_string rangeOfString:@"<BODY"
|
||||
options:NSCaseInsensitiveSearch];
|
||||
//NSDebugMLog(@"BODY Tag Range length=%d",tagRange.length);
|
||||
//NSDebugMLLog(@"GSWTemplateParser",@"BODY Tag Range length=%d",tagRange.length);
|
||||
if (tagRange.length>0)
|
||||
_isBodyTag=YES;
|
||||
parser=[GSHTMLParser parserWithSAXHandler:sax
|
||||
|
@ -539,18 +539,18 @@ static NSString* TabsForLevel(int level)
|
|||
NS_ENDHANDLER;
|
||||
if (!parseOk)
|
||||
{
|
||||
NSDebugMLog(@"######Parse FAILED errNo=%d [parser doc]=%p",
|
||||
[parser errNo],
|
||||
[parser doc]);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"######Parse FAILED errNo=%d [parser document]=%p",
|
||||
[parser errNo],
|
||||
[parser document]);
|
||||
// May be validity errors only (like no HTML root)
|
||||
if ([parser doc])
|
||||
if ([parser document])
|
||||
parseOk=YES;
|
||||
};
|
||||
if (parseOk)
|
||||
{
|
||||
GSXMLNode* node=nil;
|
||||
NSDebugMLog(@"Root");
|
||||
ASSIGN(_xmlDocument,[parser doc]);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"Root");
|
||||
ASSIGN(_xmlDocument,[parser document]);
|
||||
node=[_xmlDocument root];
|
||||
NSAssert1(node,@"%@ Empty Document (root)",
|
||||
[self logPrefix]);
|
||||
|
@ -559,7 +559,7 @@ static NSString* TabsForLevel(int level)
|
|||
NSString* dumpString=[self dumpNode:node
|
||||
atLevel:0];
|
||||
NSDebugMLLog0(@"low",@"Will dump _xmlDocument");
|
||||
NSDebugMLLog(@"low",@"%@ _xmlDocument=\n%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"%@ _xmlDocument=\n%@",
|
||||
[self logPrefix],
|
||||
dumpString);
|
||||
NSDebugMLLog0(@"low",@"_xmlDocument dumped");
|
||||
|
@ -574,7 +574,7 @@ static NSString* TabsForLevel(int level)
|
|||
node,
|
||||
[node name],
|
||||
[node typeDescription],
|
||||
[node propertiesAsDictionary],
|
||||
[node propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
[[node content] lossyCString]);
|
||||
*/
|
||||
|
||||
|
@ -585,16 +585,16 @@ static NSString* TabsForLevel(int level)
|
|||
[nodeTypes objectForKey:[NSString stringWithFormat:@"%d",(int)XML_DTD_NODE]]);
|
||||
};
|
||||
*/
|
||||
// NSDebugMLog(@"Test Root");
|
||||
// NSDebugMLLog(@"GSWTemplateParser",@"Test Root");
|
||||
if ([node type]!=XML_ELEMENT_NODE)
|
||||
node=[node children];
|
||||
// NSDebugMLog(@"Test Root children");
|
||||
NSAssert1(node,@"%@ Empty Document ([root children])",
|
||||
node=[node firstChild];
|
||||
// NSDebugMLLog(@"GSWTemplateParser",@"Test Root children");
|
||||
NSAssert1(node,@"%@ Empty Document ([root firstChild])",
|
||||
[self logPrefix]);
|
||||
if ([node type]!=XML_ELEMENT_NODE)
|
||||
node=[node next];
|
||||
// NSDebugMLog(@"Test Root children Next");
|
||||
NSAssert1(node,@"%@ Empty Document ([[root children] next])",
|
||||
// NSDebugMLLog(@"GSWTemplateParser",@"Test Root children Next");
|
||||
NSAssert1(node,@"%@ Empty Document ([[root firstChild] next])",
|
||||
[self logPrefix]);
|
||||
//Remove html and body node when they have been added by html parser
|
||||
if (!_isHTMLTag || !_isBodyTag)
|
||||
|
@ -606,8 +606,8 @@ static NSString* TabsForLevel(int level)
|
|||
if ([node type]==XML_ELEMENT_NODE)
|
||||
{
|
||||
NSString* nodeName=[node name];
|
||||
//NSDebugMLog(@"node name=%@",nodeName);
|
||||
/*NSDebugMLog(@"_isHTMLTag=%s _isBodyTag=%s",
|
||||
//NSDebugMLLog(@"GSWTemplateParser",@"node name=%@",nodeName);
|
||||
/*NSDebugMLLog(@"GSWTemplateParser",@"_isHTMLTag=%s _isBodyTag=%s",
|
||||
(_isHTMLTag ? "YES" : "NO"),
|
||||
(_isBodyTag ? "YES" : "NO"));
|
||||
*/
|
||||
|
@ -616,14 +616,14 @@ static NSString* TabsForLevel(int level)
|
|||
node,
|
||||
[node name],
|
||||
[node typeDescription],
|
||||
[node propertiesAsDictionary],
|
||||
[node propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
[[node content] lossyCString]);
|
||||
*/
|
||||
if ((!_isHTMLTag && [nodeName caseInsensitiveCompare:@"html"]==NSOrderedSame)
|
||||
|| (!_isBodyTag && [nodeName caseInsensitiveCompare:@"body"]==NSOrderedSame))
|
||||
{
|
||||
//NSDebugMLog(@"==> Children");
|
||||
node=[node children];
|
||||
//NSDebugMLLog(@"GSWTemplateParser",@"==> Children");
|
||||
node=[node firstChild];
|
||||
cont=YES;
|
||||
};
|
||||
};
|
||||
|
@ -631,7 +631,7 @@ static NSString* TabsForLevel(int level)
|
|||
};
|
||||
if (node)
|
||||
{
|
||||
//NSDebugMLog(@"Call createElementsFromNode:");
|
||||
//NSDebugMLLog(@"GSWTemplateParser",@"Call createElementsFromNode:");
|
||||
NS_DURING
|
||||
{
|
||||
gswebTagN=0;
|
||||
|
@ -690,11 +690,11 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
while(currentNode)
|
||||
{
|
||||
GSWElement* elem=nil;
|
||||
NSDebugMLog(@"BEGIN node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"BEGIN node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
currentNode,
|
||||
[currentNode name],
|
||||
[currentNode typeDescription],
|
||||
[currentNode propertiesAsDictionary],
|
||||
[currentNode propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
/* ((xmlNodePtr)[currentNode lib])->content,
|
||||
[currentNode content],*/
|
||||
[[currentNode content] lossyCString]);
|
||||
|
@ -716,22 +716,22 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
elem = nil;
|
||||
}
|
||||
|
||||
NSDebugMLog(@"TEXT element=%@",elem);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"TEXT element=%@",elem);
|
||||
};
|
||||
break;
|
||||
case XML_CDATA_SECTION_NODE:
|
||||
{
|
||||
NSDebugMLog0(@"CDATA_SECTION");
|
||||
NSDebugMLog(@"CDATA_SECTION content=%s",[[currentNode content] lossyCString]);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"CDATA_SECTION content=%s",[[currentNode content] lossyCString]);
|
||||
elem=[GSWHTMLBareString elementWithString:[currentNode content]];
|
||||
NSDebugMLog(@"CDATA_SECTION element=%@",elem);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"CDATA_SECTION element=%@",elem);
|
||||
};
|
||||
break;
|
||||
case XML_COMMENT_NODE:
|
||||
{
|
||||
NSDebugMLog0(@"COMMENT");
|
||||
elem=[GSWHTMLBareString elementWithString:[NSString stringWithFormat:@"<!-- %s -->",[[currentNode content] lossyCString]]];
|
||||
NSDebugMLog(@"COMMENT element=%@",elem);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"COMMENT element=%@",elem);
|
||||
};
|
||||
break;
|
||||
default:
|
||||
|
@ -743,23 +743,23 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
NSString* nodeName=nil;
|
||||
NSString* nodeNameAttribute=nil;
|
||||
nodeName=[currentNode name];
|
||||
NSDebugMLog(@"DEFAULT (name=%@ type=%@)",nodeName,[currentNode typeDescription]);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"DEFAULT (name=%@ type=%@)",nodeName,[currentNode typeDescription]);
|
||||
//if (currentNode->type==XML_ELEMENT_NODE)
|
||||
{
|
||||
nodeAttributes=[currentNode propertiesAsDictionaryWithKeyTransformationSel:@selector(lowercaseString)];
|
||||
nodeNameAttribute=[nodeAttributes objectForKey:@"name"];
|
||||
NSDebugMLog(@"node=%p nodeAttributes=%@",currentNode,nodeAttributes);
|
||||
NSDebugMLog(@"node=%p nodeNameAttribute=%@",currentNode,nodeNameAttribute);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p nodeAttributes=%@",currentNode,nodeAttributes);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p nodeNameAttribute=%@",currentNode,nodeNameAttribute);
|
||||
tagN++;
|
||||
if ([nodeName caseInsensitiveCompare:GSWTag_Name[GSWNAMES_INDEX]]==NSOrderedSame
|
||||
||[nodeName caseInsensitiveCompare:GSWTag_Name[WONAMES_INDEX]]==NSOrderedSame)
|
||||
gswebTagN++;
|
||||
currentGSWebTagN=gswebTagN;
|
||||
currentTagN=tagN;
|
||||
if ([currentNode children])
|
||||
if ([currentNode firstChild])
|
||||
{
|
||||
children=[self createElementsFromNode:[currentNode children]];
|
||||
NSDebugMLog(@"node=%p children=%@",currentNode,children);
|
||||
children=[self createElementsFromNode:[currentNode firstChild]];
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p children=%@",currentNode,children);
|
||||
};
|
||||
if ([nodeName caseInsensitiveCompare:GSWTag_Name[GSWNAMES_INDEX]]==NSOrderedSame
|
||||
||[nodeName caseInsensitiveCompare:GSWTag_Name[WONAMES_INDEX]]==NSOrderedSame)
|
||||
|
@ -777,9 +777,9 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
else
|
||||
{
|
||||
definitionsElement=[_definitions objectForKey:nodeNameAttribute];
|
||||
NSDebugMLLog(@"low",@"definitionsElement:[%@]",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionsElement:[%@]",
|
||||
definitionsElement);
|
||||
NSDebugMLLog(@"low",@"GSWeb Tag definitionsElement:[%@]",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"GSWeb Tag definitionsElement:[%@]",
|
||||
definitionsElement);
|
||||
if (!definitionsElement)
|
||||
{
|
||||
|
@ -794,7 +794,7 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
{
|
||||
NSDictionary* _associations=[definitionsElement associations];
|
||||
NSString* className=[definitionsElement className];
|
||||
NSDebugMLLog(@"low",@"node=%p GSWeb Tag className:[%@]",currentNode,className);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p GSWeb Tag className:[%@]",currentNode,className);
|
||||
if (!className)
|
||||
{
|
||||
ExceptionRaise(@"GSWTemplateParser",
|
||||
|
@ -808,7 +808,7 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
else
|
||||
{
|
||||
GSWHTMLStaticGroup* aStaticGroup=nil;
|
||||
NSDebugMLLog(@"low",@"node=%p associations:%@",currentNode,_associations);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p associations:%@",currentNode,_associations);
|
||||
{
|
||||
NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator];
|
||||
id _tagAttrKey=nil;
|
||||
|
@ -830,22 +830,22 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
_associations=[_associations dictionaryByAddingEntriesFromDictionary:_addedAssoc];
|
||||
};
|
||||
};
|
||||
NSDebugMLog(@"node=%p gsweb name=%@ dynamicElementWithName: children=%@",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p gsweb name=%@ dynamicElementWithName: children=%@",
|
||||
currentNode,
|
||||
nodeNameAttribute,
|
||||
children);
|
||||
NSDebugMLog(@"node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
currentNode,
|
||||
[currentNode name],
|
||||
[currentNode typeDescription],
|
||||
[currentNode propertiesAsDictionary],
|
||||
[currentNode propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
[[currentNode content] lossyCString]);
|
||||
aStaticGroup=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease];
|
||||
elem=[GSWApp dynamicElementWithName:className
|
||||
associations:_associations
|
||||
template:aStaticGroup
|
||||
languages:_languages];
|
||||
NSDebugMLog(@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup);
|
||||
if (elem)
|
||||
[elem setDefinitionName:[definitionsElement elementName]];
|
||||
else
|
||||
|
@ -870,11 +870,11 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
&& [nodeName caseInsensitiveCompare:@"body"]==NSOrderedSame
|
||||
&& [nodeAttributes count]==0))
|
||||
{
|
||||
NSDebugMLog(@"node=%p StaticElement: children=%@",currentNode,children);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p StaticElement: children=%@",currentNode,children);
|
||||
elem=[[[GSWHTMLStaticElement alloc]initWithName:nil
|
||||
attributeDictionary:nil
|
||||
contentElements:children]autorelease];
|
||||
NSDebugMLog(@"node=%p element=%@",currentNode,elem);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p element=%@",currentNode,elem);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -883,7 +883,7 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
id _tagAttrKey=nil;
|
||||
id _tagAttrValue=nil;
|
||||
NSMutableDictionary* _addedAssoc=nil;
|
||||
NSDebugMLog(@"node=%p Create nodeName=%@",currentNode,nodeName);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p Create nodeName=%@",currentNode,nodeName);
|
||||
while ((_tagAttrKey = [_nodeAttributesEnum nextObject]))
|
||||
{
|
||||
if (![_tagAttrKey isEqualToString:@"name"] && ![_associations objectForKey:_tagAttrKey])
|
||||
|
@ -911,11 +911,11 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
children=[NSArray array];
|
||||
};
|
||||
};
|
||||
NSDebugMLog(@"node=%p StaticElement: children=%@",currentNode,children);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p StaticElement: children=%@",currentNode,children);
|
||||
elem=[[[GSWHTMLStaticElement alloc]initWithName:nodeName
|
||||
attributeDictionary:_associations
|
||||
contentElements:children]autorelease];
|
||||
NSDebugMLog(@"node=%p element=%@",currentNode,elem);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p element=%@",currentNode,elem);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -924,17 +924,17 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
|||
};
|
||||
if (elem)
|
||||
[_elements addObject:elem];
|
||||
NSDebugMLog(@"END node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"END node=%p %@ [Type:%@] [%@] ##%s##\n",
|
||||
currentNode,
|
||||
[currentNode name],
|
||||
[currentNode typeDescription],
|
||||
[currentNode propertiesAsDictionary],
|
||||
[currentNode propertiesAsDictionaryWithKeyTransformationSel:NULL],
|
||||
[[currentNode content] lossyCString]);
|
||||
currentNode=[currentNode next];
|
||||
};
|
||||
DESTROY(arp);
|
||||
LOGObjectFnStop();
|
||||
NSDebugMLog(@"_elements=%@",_elements);
|
||||
NSDebugMLLog(@"GSWTemplateParser",@"_elements=%@",_elements);
|
||||
return _elements;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue