From 363901665f9b065fc94b37ee725939cb511cf88a Mon Sep 17 00:00:00 2001 From: Manuel Guesdon Date: Sat, 27 Jul 2002 23:48:47 +0000 Subject: [PATCH] 2002-07-28 Manuel Guesdon * GSWeb.framework/GSWJavaScript.h/.m: o implementation * GSWeb.framework/GSWClientSideScript.h/.m: o implementation * GSWeb.framework/GSWVBScript.h/.m: o implementation * TODO: o updated * GSWeb.framework/GSWConstants.h/.m: o added language__Key * GSWeb.framework/GSWRadioButton.m: o logs o bug fix for checked case * GSWeb.framework/GSWDirectAction.m: o added -existingSessionWithSessionID: * GSWeb.framework/PageDef.g o Handle function references (@ in values) * GSWeb.framework/GSWPageDefLexer.h/.m: o re-generated after PageDef.g change * GSWeb.framework/GSWPageDefParserTokenTypes.h o re-generated after PageDef.g change * GSWeb.framework/GSWPageDefParser.h/.m: o re-generated after PageDef.g change * GSWeb.framework/GSWPageDefParserTokenTypes.txt o re-generated after PageDef.g change * GSWeb.framework/GSWContext.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWDirectAction.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWResponse.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWCookie.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWNestedList.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWSessionTimeOut.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWSessionStore.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWServerSessionStore.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWTransactionRecord.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWSession.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWRequest.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWToggle.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWHTMLComment.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWHTMLBareString.m/.h: o ivar names changes to conform to coding standards * GSWeb.framework/GSWMailDelivery.m/.h: o ivar names changes to conform to coding standards git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@14202 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 57 + GSWeb.framework/GSWApplet.h | 2 +- GSWeb.framework/GSWApplet.m | 72 +- GSWeb.framework/GSWApplication.m | 6 +- GSWeb.framework/GSWClientSideScript.m | 178 +- GSWeb.framework/GSWComponentDefinition.m | 40 +- GSWeb.framework/GSWConstants.h | 1 + GSWeb.framework/GSWConstants.m | 1 + GSWeb.framework/GSWContext.h | 138 +- GSWeb.framework/GSWContext.m | 771 ++++---- GSWeb.framework/GSWCookie.h | 68 +- GSWeb.framework/GSWCookie.m | 218 +-- GSWeb.framework/GSWDeployedBundle.m | 4 +- GSWeb.framework/GSWDirectAction.h | 43 +- GSWeb.framework/GSWDirectAction.m | 337 ++-- GSWeb.framework/GSWHTMLBareString.h | 30 +- GSWeb.framework/GSWHTMLBareString.m | 56 +- GSWeb.framework/GSWHTMLComment.h | 30 +- GSWeb.framework/GSWHTMLComment.m | 58 +- GSWeb.framework/GSWHyperlink.m | 2 + GSWeb.framework/GSWJavaScript.h | 2 +- GSWeb.framework/GSWJavaScript.m | 21 +- GSWeb.framework/GSWMailDelivery.h | 76 +- GSWeb.framework/GSWMailDelivery.m | 220 +-- GSWeb.framework/GSWNestedList.h | 74 +- GSWeb.framework/GSWNestedList.m | 50 +- GSWeb.framework/GSWPageDefLexer.h | 9 +- GSWeb.framework/GSWPageDefLexer.m | 328 +++- GSWeb.framework/GSWPageDefParser.h | 2 +- GSWeb.framework/GSWPageDefParser.m | 141 +- GSWeb.framework/GSWProjectBundle.m | 7 +- GSWeb.framework/GSWRadioButton.m | 11 + GSWeb.framework/GSWRequest.h | 124 +- GSWeb.framework/GSWRequest.m | 2127 +++++++++++----------- GSWeb.framework/GSWResourceManager.m | 2 + GSWeb.framework/GSWResponse.h | 34 +- GSWeb.framework/GSWResponse.m | 602 +++--- GSWeb.framework/GSWServerSessionStore.h | 32 +- GSWeb.framework/GSWServerSessionStore.m | 140 +- GSWeb.framework/GSWSession.h | 128 +- GSWeb.framework/GSWSession.m | 1037 +++++------ GSWeb.framework/GSWSessionStore.h | 52 +- GSWeb.framework/GSWSessionStore.m | 323 ++-- GSWeb.framework/GSWSessionTimeOut.h | 40 +- GSWeb.framework/GSWSessionTimeOut.m | 104 +- GSWeb.framework/GSWTemplateParserXML.m | 8 +- GSWeb.framework/GSWToggle.h | 44 +- GSWeb.framework/GSWToggle.m | 277 +-- GSWeb.framework/GSWTransactionRecord.h | 34 +- GSWeb.framework/GSWTransactionRecord.m | 92 +- GSWeb.framework/GSWVBScript.h | 23 +- GSWeb.framework/GSWVBScript.m | 42 +- GSWeb.framework/PageDef.g | 16 +- TODO | 13 +- 54 files changed, 4548 insertions(+), 3799 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce5e98b..f8e783d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,60 @@ +2002-07-28 Manuel Guesdon + * GSWeb.framework/GSWJavaScript.h/.m: + o implementation + * GSWeb.framework/GSWClientSideScript.h/.m: + o implementation + * GSWeb.framework/GSWVBScript.h/.m: + o implementation + * TODO: + o updated + * GSWeb.framework/GSWConstants.h/.m: + o added language__Key + * GSWeb.framework/GSWRadioButton.m: + o logs + o bug fix for checked case + * GSWeb.framework/GSWDirectAction.m: + o added -existingSessionWithSessionID: + * GSWeb.framework/PageDef.g + o Handle function references (@ in values) + * GSWeb.framework/GSWPageDefLexer.h/.m: + o re-generated after PageDef.g change + * GSWeb.framework/GSWPageDefParserTokenTypes.h + o re-generated after PageDef.g change + * GSWeb.framework/GSWPageDefParser.h/.m: + o re-generated after PageDef.g change + * GSWeb.framework/GSWPageDefParserTokenTypes.txt + o re-generated after PageDef.g change + * GSWeb.framework/GSWContext.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWDirectAction.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWResponse.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWCookie.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWNestedList.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWSessionTimeOut.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWSessionStore.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWServerSessionStore.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWTransactionRecord.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWSession.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWRequest.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWToggle.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWHTMLComment.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWHTMLBareString.m/.h: + o ivar names changes to conform to coding standards + * GSWeb.framework/GSWMailDelivery.m/.h: + o ivar names changes to conform to coding standards + 2002-07-04 Manuel Guesdon * GSWeb.framework/GSWDefaultAdaptorThread.m o trace request uri diff --git a/GSWeb.framework/GSWApplet.h b/GSWeb.framework/GSWApplet.h index ba8a6a1..e80cc72 100644 --- a/GSWeb.framework/GSWApplet.h +++ b/GSWeb.framework/GSWApplet.h @@ -2,7 +2,7 @@ Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 $Revision$ diff --git a/GSWeb.framework/GSWApplet.m b/GSWeb.framework/GSWApplet.m index 3ea375d..14cf6a8 100644 --- a/GSWeb.framework/GSWApplet.m +++ b/GSWeb.framework/GSWApplet.m @@ -1,11 +1,16 @@ -/* GSWApplet.m - GSWeb: Class GSWApplet - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWApplet.m - GSWeb: Class GSWApplet + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - + + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -28,9 +34,9 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWApplet --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - contentElements:(NSArray*)elements_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + contentElements:(NSArray*)elements { LOGObjectFnNotImplemented(); //TODOFN return nil; @@ -44,8 +50,8 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(BOOL)appendStringAtRight:(id)_unkwnon - withMapping:(char*)_mapping +-(BOOL)appendStringAtRight:(id)unkwnon + withMapping:(char*)mapping { LOGObjectFnNotImplemented(); //TODOFN return NO; @@ -53,11 +59,11 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(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 { LOGObjectFnNotImplemented(); //TODOFN return nil; @@ -79,7 +85,7 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)setContextID:(id)contextID_ +-(void)setContextID:(id)contextID { LOGObjectFnNotImplemented(); //TODOFN }; @@ -93,7 +99,7 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)setURL:(id)url_ +-(void)setURL:(id)url { LOGObjectFnNotImplemented(); //TODOFN }; @@ -106,7 +112,7 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)setElementID:(NSString*)elementID_ +-(void)setElementID:(NSString*)elementID { LOGObjectFnNotImplemented(); //TODOFN }; @@ -116,16 +122,16 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWApplet (GSWAppletA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; @@ -133,61 +139,61 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_computeAgcArchiveStringInContext:(GSWContext*)context_ +-(void)_computeAgcArchiveStringInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(id)_agcArchiveURLsListInContext:(GSWContext*)context_ +-(id)_agcArchiveURLsListInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(id)_archiveURLsListInContext:(GSWContext*)context_ +-(id)_archiveURLsListInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(id)_agcArchiveNamesListInContext:(GSWContext*)context_ +-(id)_agcArchiveNamesListInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(id)_archiveNamesListInContext:(GSWContext*)context_ +-(id)_archiveNamesListInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(void)_deallocForComponent:(id)component_ +-(void)_deallocForComponent:(id)aComponent { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_awakeForComponent:(id)component_ +-(void)_awakeForComponent:(id)aComponent { LOGObjectFnNotImplemented(); //TODOFN }; diff --git a/GSWeb.framework/GSWApplication.m b/GSWeb.framework/GSWApplication.m index 30131ef..a20f20f 100644 --- a/GSWeb.framework/GSWApplication.m +++ b/GSWeb.framework/GSWApplication.m @@ -4178,8 +4178,12 @@ int GSWApplicationMain(NSString* applicationClassName, //-------------------------------------------------------------------- +(NSBundle*)mainBundle { + NSBundle* mainBundle=nil; // LOGClassFnNotImplemented(); //TODOFN - return [NSBundle mainBundle]; + mainBundle=[NSBundle mainBundle]; + NSDebugMLog(@"[mainBundle bundlePath]:%@",[mainBundle bundlePath]); + return mainBundle; + /* _flags=unsigned int UINT:104005633 _infoDictionary=id object:11365312 Description:{ diff --git a/GSWeb.framework/GSWClientSideScript.m b/GSWeb.framework/GSWClientSideScript.m index fa08141..0bb9de5 100644 --- a/GSWeb.framework/GSWClientSideScript.m +++ b/GSWeb.framework/GSWClientSideScript.m @@ -1,11 +1,16 @@ -/* GSWClientSideScript.m - GSWeb: Class GSWClientSideScript - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWClientSideScript.m - GSWeb: Class GSWClientSideScript + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: May 1999 - + + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -28,18 +34,53 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWClientSideScript --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement { - LOGObjectFnNotImplemented(); //TODOFN - return nil; + NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations]; + LOGObjectFnStartC("GSWClientSideScript"); + NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ templateElement=%@",aName,associations,templateElement); + [tmpAssociations removeObjectForKey:scriptFile__Key]; + [tmpAssociations removeObjectForKey:scriptString__Key]; + [tmpAssociations removeObjectForKey:scriptSource__Key]; + [tmpAssociations removeObjectForKey:hideInComment__Key]; + [tmpAssociations removeObjectForKey:language__Key]; + _otherAttributes=[NSDictionary dictionaryWithDictionary:tmpAssociations]; + RETAIN(_otherAttributes); + if ((self=[super initWithName:aName + associations:nil + template:templateElement])) + { + _scriptFile = [[associations objectForKey:scriptFile__Key + withDefaultObject:[_scriptFile autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWClientSideScript: scriptFile=%@",_scriptFile); + _scriptString = [[associations objectForKey:scriptString__Key + withDefaultObject:[_scriptString autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWClientSideScript: scriptString=%@",_scriptString); + _scriptSource = [[associations objectForKey:scriptSource__Key + withDefaultObject:[_scriptSource autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWClientSideScript: scriptSource=%@",_scriptSource); + _hideInComment = [[associations objectForKey:hideInComment__Key + withDefaultObject:[_hideInComment autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWClientSideScript: hideInComment=%@",_hideInComment); + _language = [[associations objectForKey:language__Key + withDefaultObject:[_language autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"GSWClientSideScript: language=%@",_language); + }; + return self; }; //-------------------------------------------------------------------- -(void)dealloc { - LOGObjectFnNotImplemented(); //TODOFN + DESTROY(_scriptFile); + DESTROY(_scriptString); + DESTROY(_scriptSource); + DESTROY(_hideInComment); + DESTROY(_language); + DESTROY(_otherAttributes); + [super dealloc]; }; //-------------------------------------------------------------------- @@ -48,10 +89,119 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWClientSideScript (GSWClientSideScriptA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { - LOGObjectFnNotImplemented(); //TODOFN + GSWComponent* component=nil; + BOOL hideInCommentValue=NO; + id languageValue=nil; + id scriptValue=nil; + LOGObjectFnStartC("GSWClientSideScript"); + GSWStartElement(aContext); + GSWSaveAppendToResponseElementID(aContext); + component=[aContext component]; + [super appendToResponse:aResponse + inContext:aContext]; + //hideInCommentValue=[_hideInComment valueInComponent:component]; + hideInCommentValue=[self evaluateCondition:_hideInComment + inContext:aContext]; + [aResponse _appendContentAsciiString:@""]; + GSWStopElement(aContext); + LOGObjectFnStopC("GSWClientSideScript"); }; //-------------------------------------------------------------------- diff --git a/GSWeb.framework/GSWComponentDefinition.m b/GSWeb.framework/GSWComponentDefinition.m index 042f8b9..a0deaf4 100644 --- a/GSWeb.framework/GSWComponentDefinition.m +++ b/GSWeb.framework/GSWComponentDefinition.m @@ -30,29 +30,29 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(id)initWithName:(NSString*)name_ - path:(NSString*)path_ - baseURL:(NSString*)baseURL_ - frameworkName:(NSString*)frameworkName_ + path:(NSString*)path_ + baseURL:(NSString*)baseURL_ + frameworkName:(NSString*)frameworkName_ { LOGObjectFnStart(); if ((self=[super init])) - { - NSDebugMLLog(@"gswcomponents",@"name_=%@ frameworkName_=%@",name_,frameworkName_); - ASSIGN(name,name_); - bundle=[[GSWBundle alloc] initWithPath:path_ - baseURL:baseURL_ - inFrameworkNamed:frameworkName_]; - observers=nil; - ASSIGN(frameworkName,frameworkName_); - NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",frameworkName); - ASSIGN(templateName,name_);//TODOV - NSDebugMLLog(@"gswcomponents",@"templateName=%@",templateName); - componentClass=Nil; - isScriptedClass=NO; - isCachingEnabled=NO; - isAwake=NO; - [self setCachingEnabled:[GSWApplication isCachingEnabled]]; - }; + { + NSDebugMLLog(@"gswcomponents",@"name_=%@ frameworkName_=%@",name_,frameworkName_); + ASSIGN(name,name_); + bundle=[[GSWBundle alloc] initWithPath:path_ + baseURL:baseURL_ + inFrameworkNamed:frameworkName_]; + observers=nil; + ASSIGN(frameworkName,frameworkName_); + NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",frameworkName); + ASSIGN(templateName,name_);//TODOV + NSDebugMLLog(@"gswcomponents",@"templateName=%@",templateName); + componentClass=Nil; + isScriptedClass=NO; + isCachingEnabled=NO; + isAwake=NO; + [self setCachingEnabled:[GSWApplication isCachingEnabled]]; + }; LOGObjectFnStop(); return self; }; diff --git a/GSWeb.framework/GSWConstants.h b/GSWeb.framework/GSWConstants.h index 2053cd0..ca896d6 100644 --- a/GSWeb.framework/GSWConstants.h +++ b/GSWeb.framework/GSWConstants.h @@ -285,6 +285,7 @@ extern id selectedValue__Key; extern id noSelectionString__Key; extern id displayString__Key; extern id filePath__Key; +extern id language__Key; //GSWeb Additions extern id redirectURL__Key; diff --git a/GSWeb.framework/GSWConstants.m b/GSWeb.framework/GSWConstants.m index 22985f6..5f7a8e4 100644 --- a/GSWeb.framework/GSWConstants.m +++ b/GSWeb.framework/GSWConstants.m @@ -291,6 +291,7 @@ id selectedValue__Key = @"selectedValue"; id noSelectionString__Key = @"noSelectionString"; id displayString__Key = @"displayString"; id filePath__Key = @"filePath"; +id language__Key= @"language"; //GSWeb additions id redirectURL__Key = @"redirectURL"; diff --git a/GSWeb.framework/GSWContext.h b/GSWeb.framework/GSWContext.h index 106025d..60c55b0 100644 --- a/GSWeb.framework/GSWContext.h +++ b/GSWeb.framework/GSWContext.h @@ -1,11 +1,16 @@ -/* GSWContext.h - GSWeb: Class GSWContext - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWContext.h - GSWeb: Class GSWContext + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -31,29 +37,29 @@ @interface GSWContext : NSObject { @private - unsigned contextID; - NSString* senderID; - NSString* requestSessionID; - GSWElementIDString* elementID; - GSWSession* session; - GSWRequest* request; - GSWResponse* response; - GSWElement* pageElement; - GSWComponent* pageComponent; - GSWComponent* currentComponent; - GSWDynamicURLString* url; - NSMutableArray* awakePageComponents; - int urlApplicationNumber; - int isClientComponentRequest; - BOOL distributionEnabled; - BOOL pageChanged; - BOOL pageReplaced; - BOOL generateCompleteURLs; - BOOL isInForm; - BOOL actionInvoked; - BOOL formSubmitted; - BOOL isMultipleSubmitForm; - BOOL isValidate; + unsigned _contextID; + NSString* _senderID; + NSString* _requestSessionID; + GSWElementIDString* _elementID; + GSWSession* _session; + GSWRequest* _request; + GSWResponse* _response; + GSWElement* _pageElement; + GSWComponent* _pageComponent; + GSWComponent* _currentComponent; + GSWDynamicURLString* _url; + NSMutableArray* _awakePageComponents; + int _urlApplicationNumber; + int _isClientComponentRequest; + BOOL _distributionEnabled; + BOOL _pageChanged; + BOOL _pageReplaced; + BOOL _generateCompleteURLs; + BOOL _isInForm; + BOOL _actionInvoked; + BOOL _formSubmitted; + BOOL _isMultipleSubmitForm; + BOOL _isValidate; #ifndef NDEBUG int _loopLevel; //ForDebugging purpose: each repetition increment and next decrement it NSMutableString* _docStructure; //ForDebugging purpose: array of all objects if the document during appendResponse, takeValues, invokeAction @@ -63,11 +69,11 @@ -(id)init; -(void)dealloc; -+(GSWContext*)contextWithRequest:(GSWRequest*)request_; ++(GSWContext*)contextWithRequest:(GSWRequest*)aRequest; --(id)copyWithZone:(NSZone*)zone_; +-(id)copyWithZone:(NSZone*)zone; --(void)setInForm:(BOOL)_flag; +-(void)setInForm:(BOOL)flag; -(BOOL)isInForm; -(GSWElementIDString*)elementID; -(GSWComponent*)component; @@ -78,7 +84,7 @@ -(BOOL)hasSession; -(NSString*)senderID; -(NSString*)contextID; --(id)initWithRequest:(GSWRequest*)_request; +-(id)initWithRequest:(GSWRequest*)aRequest; #ifndef NDEBUG -(void)incrementLoopLevel; //ForDebugging purpose: each repetition increment and next decrement it @@ -92,62 +98,62 @@ //==================================================================== @interface GSWContext (GSWURLGeneration) --(GSWDynamicURLString*)directActionURLForActionNamed:(NSString*)actionName_ - queryDictionary:(NSDictionary*)queryDictionary_; +-(GSWDynamicURLString*)directActionURLForActionNamed:(NSString*)actionName + queryDictionary:(NSDictionary*)queryDictionary; -(GSWDynamicURLString*)componentActionURL; --(GSWDynamicURLString*)urlWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_; +-(GSWDynamicURLString*)urlWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString; //NDFN --(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_; --(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_ - isSecure:(BOOL)isSecure_ - port:(int)port_; +-(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString; +-(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString + isSecure:(BOOL)isSecure + port:(int)port; @end //==================================================================== @interface GSWContext (GSWContextA) --(id)_initWithContextID:(unsigned int)context_ID; +-(id)_initWithContextID:(unsigned int)contextID; @end //==================================================================== @interface GSWContext (GSWContextB) -(BOOL)_isMultipleSubmitForm; --(void)_setIsMultipleSubmitForm:(BOOL)_flag; +-(void)_setIsMultipleSubmitForm:(BOOL)flag; -(BOOL)_wasActionInvoked; --(void)_setActionInvoked:(BOOL)_flag; +-(void)_setActionInvoked:(BOOL)flag; -(BOOL)_wasFormSubmitted; --(void)_setFormSubmitted:(BOOL)_flag; +-(void)_setFormSubmitted:(BOOL)flag; -(void)_putAwakeComponentsToSleep; -(void)_generateCompleteURLs; --(GSWDynamicURLString*)_directActionURLForActionNamed:(NSString*)_actionName - queryDictionary:(NSDictionary*)_dict - url:(id)_url; +-(GSWDynamicURLString*)_directActionURLForActionNamed:(NSString*)actionName + queryDictionary:(NSDictionary*)dict + url:(id)url; -(NSArray*)languages; -(GSWComponent*)_pageComponent; -(GSWElement*)_pageElement; --(void)_setPageElement:(GSWElement*)_element; --(void)_setPageComponent:(GSWComponent*)_component; --(void)_setResponse:(GSWResponse*)response_; --(void)_setRequest:(GSWRequest*)_request; --(void)_setSession:(GSWSession*)_session; --(void)_setSenderID:(NSString*)_senderID; +-(void)_setPageElement:(GSWElement*)element; +-(void)_setPageComponent:(GSWComponent*)component; +-(void)_setResponse:(GSWResponse*)aResponse; +-(void)_setRequest:(GSWRequest*)aRequest; +-(void)_setSession:(GSWSession*)aSession; +-(void)_setSenderID:(NSString*)aSenderID; -(void)_synchronizeForDistribution; -(void)_incrementContextID; -(GSWSession*)existingSession; --(void)_setCurrentComponent:(GSWComponent*)_component; --(void)_setPageReplaced:(BOOL)_flag; +-(void)_setCurrentComponent:(GSWComponent*)aComponent; +-(void)_setPageReplaced:(BOOL)flag; -(BOOL)_pageReplaced; --(void)_setPageChanged:(BOOL)_flag; +-(void)_setPageChanged:(BOOL)flag; -(BOOL)_pageChanged; --(void)_setRequestSessionID:(NSString*)_sessionID; +-(void)_setRequestSessionID:(NSString*)sessionID; -(NSString*)_requestSessionID; --(void)_takeAwakeComponentsFromArray:(id)_unknwon; --(void)_takeAwakeComponent:(GSWComponent*)_component; +-(void)_takeAwakeComponentsFromArray:(id)unknwon; +-(void)_takeAwakeComponent:(GSWComponent*)aComponent; @end @@ -156,7 +162,7 @@ -(void)deleteAllElementIDComponents; -(void)deleteLastElementIDComponent; -(void)incrementLastElementIDComponent; --(void)appendElementIDComponent:(NSString*)string_; +-(void)appendElementIDComponent:(NSString*)string; -(void)appendZeroElementIDComponent; @end @@ -165,14 +171,14 @@ -(NSString*)url; -(NSString*)urlSessionPrefix; -(GSWApplication*)application; --(void)setDistributionEnabled:(BOOL)flag_; +-(void)setDistributionEnabled:(BOOL)flag; -(BOOL)isDistributionEnabled; @end //==================================================================== @interface GSWContext (GSWContextGSWeb) -(BOOL)isValidate; --(void)setValidate:(BOOL)isValidate_; +-(void)setValidate:(BOOL)isValidate; @end #endif //_GSWContext_h__ diff --git a/GSWeb.framework/GSWContext.m b/GSWeb.framework/GSWContext.m index 57079e0..58934bb 100644 --- a/GSWeb.framework/GSWContext.m +++ b/GSWeb.framework/GSWContext.m @@ -1,11 +1,16 @@ -/* GSWContext.m - GSWeb: Class GSWContext - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWContext.m - GSWeb: Class GSWContext + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -37,9 +43,9 @@ static int dontTraceComponentActionURL=0; //OK LOGObjectFnStart(); if ((self=[super init])) - { - [self _initWithContextID:(unsigned int)-1]; - }; + { + [self _initWithContextID:(unsigned int)-1]; + }; LOGObjectFnStop(); return self; }; @@ -50,31 +56,31 @@ static int dontTraceComponentActionURL=0; GSWLogAssertGood(self); NSDebugFLog(@"Dealloc GSWContext %p",(void*)self); NSDebugFLog0(@"Release GSWContext senderID"); - DESTROY(senderID); + DESTROY(_senderID); NSDebugFLog0(@"Release GSWContext requestSessionID"); - DESTROY(requestSessionID); + DESTROY(_requestSessionID); NSDebugFLog0(@"Release GSWContext elementID"); - DESTROY(elementID); - if (session) + DESTROY(_elementID); + if (_session) { - NSDebugFLog(@"sessionCount=%u",[session retainCount]); + NSDebugFLog(@"sessionCount=%u",[_session retainCount]); }; NSDebugFLog0(@"Release GSWContext session"); - DESTROY(session); + DESTROY(_session); NSDebugFLog0(@"Release GSWContext request"); - DESTROY(request); + DESTROY(_request); NSDebugFLog0(@"Release GSWContext Response"); - DESTROY(response); + DESTROY(_response); NSDebugFLog0(@"Release GSWContext pageElement"); - DESTROY(pageElement); + DESTROY(_pageElement); NSDebugFLog0(@"Release GSWContext pageComponent"); - DESTROY(pageComponent); + DESTROY(_pageComponent); NSDebugFLog0(@"Release GSWContext currentComponent"); - DESTROY(currentComponent); + DESTROY(_currentComponent); NSDebugFLog0(@"Release GSWContext url"); - DESTROY(url); + DESTROY(_url); NSDebugFLog0(@"Release GSWContext awakePageComponents"); - DESTROY(awakePageComponents); + DESTROY(_awakePageComponents); #ifndef NDEBUG DESTROY(_docStructure); DESTROY(_docStructureElements); @@ -85,60 +91,60 @@ static int dontTraceComponentActionURL=0; } //-------------------------------------------------------------------- --(id)initWithRequest:(GSWRequest*)_request; +-(id)initWithRequest:(GSWRequest*)aRequest { //OK LOGObjectFnStart(); if ((self=[self init])) - { - [self _setRequest:_request]; - }; + { + [self _setRequest:aRequest]; + }; LOGObjectFnStop(); return self; }; //-------------------------------------------------------------------- -+(GSWContext*)contextWithRequest:(GSWRequest*)request_ ++(GSWContext*)contextWithRequest:(GSWRequest*)aRequest { //OK - GSWContext* _context=nil; + GSWContext* context=nil; LOGObjectFnStart(); - _context=[[[GSWContext alloc] - initWithRequest:request_] - autorelease]; + context=[[[GSWContext alloc] + initWithRequest:aRequest] + autorelease]; LOGObjectFnStop(); - return _context; + return context; }; //-------------------------------------------------------------------- --(id)copyWithZone:(NSZone*)zone_ +-(id)copyWithZone:(NSZone*)zone { - GSWContext* clone = [[isa allocWithZone:zone_] init]; + GSWContext* clone = [[isa allocWithZone:zone] init]; if (clone) - { - clone->contextID=contextID; - ASSIGNCOPY(clone->senderID,senderID); - ASSIGNCOPY(clone->requestSessionID,requestSessionID); - ASSIGNCOPY(clone->elementID,elementID); - ASSIGN(clone->session,session); //TODOV - ASSIGN(clone->request,request); //TODOV - ASSIGN(clone->response,response); //TODOV - ASSIGN(clone->pageElement,pageElement); - ASSIGN(clone->pageComponent,pageComponent); - ASSIGN(clone->currentComponent,currentComponent); - ASSIGNCOPY(clone->url,url); - ASSIGNCOPY(clone->awakePageComponents,awakePageComponents); - clone->urlApplicationNumber=urlApplicationNumber; - clone->isClientComponentRequest=isClientComponentRequest; - clone->distributionEnabled=distributionEnabled; - clone->pageChanged=pageChanged; - clone->pageReplaced=pageReplaced; - clone->generateCompleteURLs=generateCompleteURLs; - clone->isInForm=isInForm; - clone->actionInvoked=actionInvoked; - clone->formSubmitted=formSubmitted; - clone->isMultipleSubmitForm=isMultipleSubmitForm; - }; + { + clone->_contextID=_contextID; + ASSIGNCOPY(clone->_senderID,_senderID); + ASSIGNCOPY(clone->_requestSessionID,_requestSessionID); + ASSIGNCOPY(clone->_elementID,_elementID); + ASSIGN(clone->_session,_session); //TODOV + ASSIGN(clone->_request,_request); //TODOV + ASSIGN(clone->_response,_response); //TODOV + ASSIGN(clone->_pageElement,_pageElement); + ASSIGN(clone->_pageComponent,_pageComponent); + ASSIGN(clone->_currentComponent,_currentComponent); + ASSIGNCOPY(clone->_url,_url); + ASSIGNCOPY(clone->_awakePageComponents,_awakePageComponents); + clone->_urlApplicationNumber=_urlApplicationNumber; + clone->_isClientComponentRequest=_isClientComponentRequest; + clone->_distributionEnabled=_distributionEnabled; + clone->_pageChanged=_pageChanged; + clone->_pageReplaced=_pageReplaced; + clone->_generateCompleteURLs=_generateCompleteURLs; + clone->_isInForm=_isInForm; + clone->_actionInvoked=_actionInvoked; + clone->_formSubmitted=_formSubmitted; + clone->_isMultipleSubmitForm=_isMultipleSubmitForm; + }; return clone; }; @@ -146,116 +152,116 @@ static int dontTraceComponentActionURL=0; -(NSString*)description { //OK - NSString* _desc=nil; + NSString* desc=nil; dontTraceComponentActionURL++; - _desc= [NSString stringWithFormat: - @"%s: %p contextID=%@ senderID=%@ elementID=%@ session=%p request=%p response=%p pageElement=%p pageComponent=%p currentComponent=%p url=%@ urlApplicationNumber=%d isClientComponentRequest=%s distributionEnabled=%s pageChanged=%s pageReplaced=%s", - object_get_class_name(self), - (void*)self, - [self contextID], - [self senderID], - [self elementID], - (void*)[self existingSession], - (void*)[self request], - (void*)[self response], - (void*)pageElement, - (void*)pageComponent, - (void*)currentComponent, - url, - urlApplicationNumber, - isClientComponentRequest ? "YES" : "NO", - distributionEnabled ? "YES" : "NO", - pageChanged ? "YES" : "NO", - pageReplaced ? "YES" : "NO"]; + desc= [NSString stringWithFormat: + @"%s: %p contextID=%@ senderID=%@ elementID=%@ session=%p request=%p response=%p pageElement=%p pageComponent=%p currentComponent=%p url=%@ urlApplicationNumber=%d isClientComponentRequest=%s distributionEnabled=%s pageChanged=%s pageReplaced=%s", + object_get_class_name(self), + (void*)self, + [self contextID], + [self senderID], + [self elementID], + (void*)[self existingSession], + (void*)[self request], + (void*)[self response], + (void*)_pageElement, + (void*)_pageComponent, + (void*)_currentComponent, + _url, + _urlApplicationNumber, + _isClientComponentRequest ? "YES" : "NO", + _distributionEnabled ? "YES" : "NO", + _pageChanged ? "YES" : "NO", + _pageReplaced ? "YES" : "NO"]; dontTraceComponentActionURL--; - return _desc; + return desc; }; //-------------------------------------------------------------------- --(void)setInForm:(BOOL)_flag +-(void)setInForm:(BOOL)flag { - isInForm=_flag; + _isInForm=flag; }; //-------------------------------------------------------------------- -(BOOL)isInForm { - return isInForm; + return _isInForm; }; //-------------------------------------------------------------------- // elementID -(GSWElementIDString*)elementID { - return elementID; + return _elementID; }; //-------------------------------------------------------------------- -(GSWComponent*)component { - GSWComponent* _component=nil; + GSWComponent* component=nil; // LOGObjectFnStart(); - _component=currentComponent; + component=_currentComponent; // LOGObjectFnStop(); - return _component; + return component; }; //-------------------------------------------------------------------- -(NSString*)contextID { //OK - if (contextID==(unsigned int)-1) - return nil; + if (_contextID==(unsigned int)-1) + return nil; else - return [NSString stringWithFormat:@"%u",contextID]; + return [NSString stringWithFormat:@"%u",_contextID]; }; //-------------------------------------------------------------------- -(GSWComponent*)page { - if ([pageComponent _isPage]) //TODOV - return pageComponent; + if ([_pageComponent _isPage]) //TODOV + return _pageComponent; else - return nil;//TODOV + return nil;//TODOV }; //-------------------------------------------------------------------- -(GSWRequest*)request { - return request; + return _request; }; //-------------------------------------------------------------------- -(GSWResponse*)response { - return response; + return _response; }; //-------------------------------------------------------------------- -(BOOL)hasSession { - return (session!=nil); + return (_session!=nil); }; //-------------------------------------------------------------------- -(GSWSession*)session { - GSWSession* _session=nil; + GSWSession* session=nil; LOGObjectFnStart(); - if (session) - _session=session; + if (_session) + session=_session; else - { - _session=[GSWApp _initializeSessionInContext:self]; - }; + { + session=[GSWApp _initializeSessionInContext:self]; + }; LOGObjectFnStop(); - return _session; + return session; }; //-------------------------------------------------------------------- -(NSString*)senderID { - return senderID; + return _senderID; }; #ifndef NDEBUG @@ -267,6 +273,7 @@ static int dontTraceComponentActionURL=0; { _loopLevel--; }; + -(BOOL)isInLoop { return _loopLevel>0; @@ -326,178 +333,178 @@ static int dontTraceComponentActionURL=0; @implementation GSWContext (GSWURLGeneration) //-------------------------------------------------------------------- --(GSWDynamicURLString*)directActionURLForActionNamed:(NSString*)actionName_ - queryDictionary:(NSDictionary*)queryDictionary_ +-(GSWDynamicURLString*)directActionURLForActionNamed:(NSString*)actionName + queryDictionary:(NSDictionary*)queryDictionary { //OK - GSWSession* _session=nil; - GSWDynamicURLString* _url=nil; + GSWSession* session=nil; + GSWDynamicURLString* url=nil; LOGObjectFnStart(); - _session=[self existingSession]; + session=[self existingSession]; NSDebugMLog(@"url=%@",url); - _url=[self _directActionURLForActionNamed:actionName_ - queryDictionary:queryDictionary_ - url:url]; + url=[self _directActionURLForActionNamed:actionName + queryDictionary:queryDictionary + url:url]; LOGObjectFnStop(); - return _url; + return url; }; //-------------------------------------------------------------------- -(GSWDynamicURLString*)componentActionURL { //OK - BOOL _storesIDsInURLs=NO; - GSWDynamicURLString* _url=nil; - GSWSession* _session=nil; - NSString* _elementID=nil; - NSString* _componentRequestHandlerKey=nil; - NSString* _requestHandlerKey=nil; - NSString* _requestHandlerPath=nil; + BOOL storesIDsInURLs=NO; + GSWDynamicURLString* url=nil; + GSWSession* session=nil; + NSString* elementID=nil; + NSString* componentRequestHandlerKey=nil; + NSString* requestHandlerKey=nil; + NSString* requestHandlerPath=nil; LOGObjectFnStartCond(dontTraceComponentActionURL==0); - NSDebugMLogCond(dontTraceComponentActionURL==0,@"contextID=%u",contextID); + NSDebugMLogCond(dontTraceComponentActionURL==0,@"contextID=%u",_contextID); /* - _url=[[url copy] autorelease]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_url=%@",_url); - NSDebugMLogCond(dontTraceComponentActionURL==0,@"urlApplicationNumber=%d",urlApplicationNumber); - NSDebugMLogCond(dontTraceComponentActionURL==0,@"[_url urlApplicationNumber]=%d",[_url urlApplicationNumber]); - _session=[self session]; //OK - NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"_session=%@",_session); - NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"_sessionID=%@",[_session sessionID]); - _elementID=[self elementID]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_elementID=%@",_elementID); - _componentRequestHandlerKey=[GSWApplication componentRequestHandlerKey]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_componentRequestHandlerKey=%@",_componentRequestHandlerKey); - [_url setURLRequestHandlerKey:_componentRequestHandlerKey]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_url=%@",_url); + url=[[url copy] autorelease]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"url=%@",url); + NSDebugMLogCond(dontTraceComponentActionURL==0,@"urlApplicationNumber=%d",_urlApplicationNumber); + NSDebugMLogCond(dontTraceComponentActionURL==0,@"[url urlApplicationNumber]=%d",[url urlApplicationNumber]); + session=[self session]; //OK + NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"session=%@",session); + NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"sessionID=%@",[session sessionID]); + elementID=[self elementID]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"elementID=%@",elementID); + componentRequestHandlerKey=[GSWApplication componentRequestHandlerKey]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"componentRequestHandlerKey=%@",componentRequestHandlerKey); + [url setURLRequestHandlerKey:componentRequestHandlerKey]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"url=%@",url); //call application pageCacheSize - _storesIDsInURLs=[_session storesIDsInURLs]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_storesIDsInURLs=%s",(_storesIDsInURLs ? "YES" : "NO")); - if (_storesIDsInURLs) + storesIDsInURLs=[session storesIDsInURLs]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"storesIDsInURLs=%s",(storesIDsInURLs ? "YES" : "NO")); + if (storesIDsInURLs) { - NSString* _sessionID=[_session sessionID]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_sessionID=%@",_sessionID); - [_url setURLRequestHandlerPath:[NSString stringWithFormat:@"%@/%u.%@", - _sessionID, - contextID, - _elementID]]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_url=%@",_url); + NSString* sessionID=[session sessionID]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"sessionID=%@",sessionID); + [url setURLRequestHandlerPath:[NSString stringWithFormat:@"%@/%u.%@", + sessionID, + contextID, + elementID]]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"url=%@",url); } else { - [_url setURLRequestHandlerPath:[NSString stringWithFormat:@"/%u.%@", //?? - contextID, - _elementID]]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_url=%@",_url); + [url setURLRequestHandlerPath:[NSString stringWithFormat:@"/%u.%@", //?? + _contextID, + elementID]]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"url=%@",url); }; - [_url setURLQueryString:nil]; //??? + [url setURLQueryString:nil]; //??? */ - NSDebugMLogCond(dontTraceComponentActionURL==0,@"urlApplicationNumber=%d",urlApplicationNumber); - _session=[self session]; //OK - NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"_session=%@",_session); - NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"_sessionID=%@",[_session sessionID]); - _elementID=[self elementID]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_elementID=%@",_elementID); - _componentRequestHandlerKey=[GSWApplication componentRequestHandlerKey]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_componentRequestHandlerKey=%@",_componentRequestHandlerKey); + NSDebugMLogCond(dontTraceComponentActionURL==0,@"urlApplicationNumber=%d",_urlApplicationNumber); + session=[self session]; //OK + NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"session=%@",session); + NSDebugMLLogCond(dontTraceComponentActionURL==0,@"sessions",@"sessionID=%@",[session sessionID]); + elementID=[self elementID]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"elementID=%@",elementID); + componentRequestHandlerKey=[GSWApplication componentRequestHandlerKey]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"componentRequestHandlerKey=%@",componentRequestHandlerKey); - _requestHandlerKey=_componentRequestHandlerKey; - _storesIDsInURLs=[_session storesIDsInURLs]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_storesIDsInURLs=%s",(_storesIDsInURLs ? "YES" : "NO")); - if (_storesIDsInURLs) - { - NSString* _sessionID=[_session sessionID]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_sessionID=%@",_sessionID); - _requestHandlerPath=[NSString stringWithFormat:@"%@/%u.%@", - _sessionID, - contextID, - _elementID]; - } + requestHandlerKey=componentRequestHandlerKey; + storesIDsInURLs=[session storesIDsInURLs]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"storesIDsInURLs=%s",(storesIDsInURLs ? "YES" : "NO")); + if (storesIDsInURLs) + { + NSString* sessionID=[_session sessionID]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"sessionID=%@",sessionID); + requestHandlerPath=[NSString stringWithFormat:@"%@/%u.%@", + sessionID, + _contextID, + elementID]; + } else - _requestHandlerPath=[NSString stringWithFormat:@"/%u.%@", //?? - contextID, - _elementID]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_requestHandlerPath=%@",_requestHandlerPath); - _url=[self urlWithRequestHandlerKey:_requestHandlerKey - path:_requestHandlerPath - queryString:nil]; - NSDebugMLogCond(dontTraceComponentActionURL==0,@"_url=%@",_url); + requestHandlerPath=[NSString stringWithFormat:@"/%u.%@", //?? + _contextID, + elementID]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"requestHandlerPath=%@",requestHandlerPath); + url=[self urlWithRequestHandlerKey:requestHandlerKey + path:requestHandlerPath + queryString:nil]; + NSDebugMLogCond(dontTraceComponentActionURL==0,@"url=%@",url); LOGObjectFnStopCond(dontTraceComponentActionURL==0); - return _url; + return url; }; //-------------------------------------------------------------------- --(GSWDynamicURLString*)urlWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_ +-(GSWDynamicURLString*)urlWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString { //OK - GSWDynamicURLString* _url=nil; - GSWRequest* _request=[self request]; + GSWDynamicURLString* url=nil; + GSWRequest* request=[self request]; LOGObjectFnStartCond(dontTraceComponentActionURL==0); NSDebugMLogCond(dontTraceComponentActionURL==0, @"generateCompleteURLs=%s", - (generateCompleteURLs ? "YES" : "NO")); - if (generateCompleteURLs) - _url=[self completeURLWithRequestHandlerKey:requestHandlerKey_ - path:requestHandlerPath_ - queryString:queryString_]; + (_generateCompleteURLs ? "YES" : "NO")); + if (_generateCompleteURLs) + url=[self completeURLWithRequestHandlerKey:requestHandlerKey + path:requestHandlerPath + queryString:queryString]; else - _url=[_request _urlWithRequestHandlerKey:requestHandlerKey_ - path:requestHandlerPath_ - queryString:queryString_]; + url=[request _urlWithRequestHandlerKey:requestHandlerKey + path:requestHandlerPath + queryString:queryString]; NSDebugMLogCond(dontTraceComponentActionURL==0, - @"url=%@",_url); + @"url=%@",url); LOGObjectFnStopCond(dontTraceComponentActionURL==0); - return _url; + return url; }; //-------------------------------------------------------------------- //NDFN --(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_ +-(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString { - GSWRequest* _request=nil; - _request=[self request]; - return [self completeURLWithRequestHandlerKey:requestHandlerKey_ - path:requestHandlerPath_ - queryString:queryString_ - isSecure:[_request isSecure] - port:[_request urlPort]]; + GSWRequest* request=nil; + request=[self request]; + return [self completeURLWithRequestHandlerKey:requestHandlerKey + path:requestHandlerPath + queryString:queryString + isSecure:[request isSecure] + port:[request urlPort]]; }; //-------------------------------------------------------------------- --(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey_ - path:(NSString*)requestHandlerPath_ - queryString:(NSString*)queryString_ - isSecure:(BOOL)isSecure_ - port:(int)port_ +-(GSWDynamicURLString*)completeURLWithRequestHandlerKey:(NSString*)requestHandlerKey + path:(NSString*)requestHandlerPath + queryString:(NSString*)queryString + isSecure:(BOOL)isSecure + port:(int)port { NSString* host=nil; - GSWDynamicURLString* _url=nil; - GSWRequest* _request=nil; + GSWDynamicURLString* url=nil; + GSWRequest* request=nil; LOGObjectFnStart(); - _request=[self request]; - _url=[_request _urlWithRequestHandlerKey:requestHandlerKey_ - path:requestHandlerPath_ - queryString:queryString_]; - NSDebugMLLog(@"low",@"_url=%@",_url); - if (isSecure_) - [_url setURLProtocol:GSWProtocol_HTTPS]; + request=[self request]; + url=[_request _urlWithRequestHandlerKey:requestHandlerKey + path:requestHandlerPath + queryString:queryString]; + NSDebugMLLog(@"low",@"url=%@",url); + if (isSecure) + [url setURLProtocol:GSWProtocol_HTTPS]; else - [_url setURLProtocol:GSWProtocol_HTTP]; + [url setURLProtocol:GSWProtocol_HTTP]; - if (port_) - [_url setURLPort:port_]; - NSDebugMLLog(@"low",@"_url=%@",_url); - host=[_request urlHost]; + if (port) + [url setURLPort:port]; + NSDebugMLLog(@"low",@"url=%@",url); + host=[request urlHost]; NSAssert(host,@"No host !"); NSDebugMLLog(@"low",@"host=%@",host); - [_url setURLHost:host]; - NSDebugMLLog(@"low",@"_url=%@",_url); + [url setURLHost:host]; + NSDebugMLLog(@"low",@"url=%@",url); LOGObjectFnStop(); - return _url; + return url; }; @end @@ -506,16 +513,16 @@ static int dontTraceComponentActionURL=0; @implementation GSWContext (GSWContextA) //-------------------------------------------------------------------- --(id)_initWithContextID:(unsigned int)_contextID +-(id)_initWithContextID:(unsigned int)contextID { LOGObjectFnStart(); - NSDebugMLLog(@"low",@"_contextID=%u",_contextID); - contextID=_contextID; - DESTROY(url); - url=[GSWDynamicURLString new]; - DESTROY(awakePageComponents); - awakePageComponents=[NSMutableArray new]; - urlApplicationNumber=-1; + NSDebugMLLog(@"low",@"contextID=%u",contextID); + _contextID=contextID; + DESTROY(_url); + _url=[GSWDynamicURLString new]; + DESTROY(_awakePageComponents); + _awakePageComponents=[NSMutableArray new]; + _urlApplicationNumber=-1; LOGObjectFnStop(); return self; }; @@ -528,37 +535,37 @@ static int dontTraceComponentActionURL=0; //-------------------------------------------------------------------- -(BOOL)_isMultipleSubmitForm { - return isMultipleSubmitForm; + return _isMultipleSubmitForm; }; //-------------------------------------------------------------------- --(void)_setIsMultipleSubmitForm:(BOOL)_flag +-(void)_setIsMultipleSubmitForm:(BOOL)flag { - isMultipleSubmitForm=_flag; + _isMultipleSubmitForm=flag; }; //-------------------------------------------------------------------- -(BOOL)_wasActionInvoked { - return actionInvoked; + return _actionInvoked; }; //-------------------------------------------------------------------- --(void)_setActionInvoked:(BOOL)_flag +-(void)_setActionInvoked:(BOOL)flag { - actionInvoked=_flag; + _actionInvoked=flag; }; //-------------------------------------------------------------------- -(BOOL)_wasFormSubmitted { - return formSubmitted; + return _formSubmitted; }; //-------------------------------------------------------------------- --(void)_setFormSubmitted:(BOOL)_flag +-(void)_setFormSubmitted:(BOOL)flag { - formSubmitted=_flag; + _formSubmitted=flag; }; //-------------------------------------------------------------------- @@ -566,170 +573,170 @@ static int dontTraceComponentActionURL=0; { //OK TODOV int i=0; - GSWComponent* _component=nil; + GSWComponent* component=nil; LOGObjectFnStart(); - NSDebugMLLog(@"low",@"awakePageComponents=%@",awakePageComponents); - for(i=0;i<[awakePageComponents count];i++) - { - _component=[awakePageComponents objectAtIndex:i]; - [_component sleepInContext:self]; - }; + NSDebugMLLog(@"low",@"awakePageComponents=%@",_awakePageComponents); + for(i=0;i<[_awakePageComponents count];i++) + { + component=[_awakePageComponents objectAtIndex:i]; + [component sleepInContext:self]; + }; LOGObjectFnStop(); }; //-------------------------------------------------------------------- -(void)_generateCompleteURLs { - generateCompleteURLs=YES; + _generateCompleteURLs=YES; }; //-------------------------------------------------------------------- //_url is a semi complete one: line /cgi/WebObjects.exe/ObjCTest3.woa --(id)_directActionURLForActionNamed:(NSString*)_actionName - queryDictionary:(NSDictionary*)_dict - url:(id)_url +-(id)_directActionURLForActionNamed:(NSString*)actionName + queryDictionary:(NSDictionary*)dict + url:(id)anURL { //OK - NSString* _queryString=nil; - NSEnumerator* _enumerator =nil; - id _key=nil; + NSString* queryString=nil; + NSEnumerator* enumerator =nil; + id key=nil; LOGObjectFnStart(); NSDebugMLogCond(dontTraceComponentActionURL==0, - @"url=%@",_url); + @"anURL=%@",anURL); // _url=[[_url copy] autorelease]; //TODOV - _enumerator = [_dict keyEnumerator]; - while ((_key = [_enumerator nextObject])) - { - if (!_queryString) - _queryString=[[NSString new] autorelease]; - else - _queryString=[_queryString stringByAppendingString:@"&"]; - _queryString=[_queryString stringByAppendingFormat:@"%@=%@", - _key, - [_dict objectForKey:_key]]; - }; + enumerator = [dict keyEnumerator]; + while ((key = [enumerator nextObject])) + { + if (!queryString) + queryString=[[NSString new] autorelease]; + else + queryString=[queryString stringByAppendingString:@"&"]; + queryString=[queryString stringByAppendingFormat:@"%@=%@", + key, + [dict objectForKey:key]]; + }; /* - [_url setURLRequestHandlerKey:GSWDirectActionRequestHandlerKey[GSWebNamingConv]]; - [_url setURLRequestHandlerPath:_actionName]; - [_url setURLQueryString:_queryString]; + [anURL setURLRequestHandlerKey:GSWDirectActionRequestHandlerKey[GSWebNamingConv]]; + [anURL setURLRequestHandlerPath:actionName]; + [anURL setURLQueryString:queryString]; */ - _url=[self completeURLWithRequestHandlerKey:GSWDirectActionRequestHandlerKey[GSWebNamingConv] - path:_actionName - queryString:_queryString]; + anURL=[self completeURLWithRequestHandlerKey:GSWDirectActionRequestHandlerKey[GSWebNamingConv] + path:actionName + queryString:queryString]; NSDebugMLogCond(dontTraceComponentActionURL==0, - @"url=%@",_url); + @"url=%@",anURL); LOGObjectFnStop(); - return _url; + return anURL; }; //-------------------------------------------------------------------- -(NSArray*)languages { - NSArray* _languages=nil; - if (request) - { - _languages=[request browserLanguages]; - if (!_languages) - { - LOGError0(@"No languages in request"); - }; - }; - if (!_languages && session) - { - _languages=[session languages]; - if (!_languages) - { - LOGError0(@"No languages in session"); - }; - }; + NSArray* languages=nil; + if (_request) + { + languages=[_request browserLanguages]; + if (!languages) + { + LOGError0(@"No languages in request"); + }; + }; + if (!languages && _session) + { + languages=[_session languages]; + if (!languages) + { + LOGError0(@"No languages in session"); + }; + }; //Not WO: It enable application languages filtering - _languages=[GSWApp filterLanguages:_languages]; - return _languages; + languages=[GSWApp filterLanguages:languages]; + return languages; }; //-------------------------------------------------------------------- -(GSWComponent*)_pageComponent { - return pageComponent; + return _pageComponent; }; //-------------------------------------------------------------------- -(GSWElement*)_pageElement { - return pageElement; + return _pageElement; }; //-------------------------------------------------------------------- --(void)_setPageElement:(GSWElement*)_element +-(void)_setPageElement:(GSWElement*)element { LOGObjectFnStart(); - ASSIGN(pageElement,_element); + ASSIGN(_pageElement,element); //TODOV - [self _setPageComponent:(GSWComponent*)_element]; + [self _setPageComponent:(GSWComponent*)element]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setPageComponent:(GSWComponent*)_component +-(void)_setPageComponent:(GSWComponent*)component { LOGObjectFnStart(); - ASSIGN(pageComponent,_component); - if (_component) - [self _takeAwakeComponent:_component]; + ASSIGN(_pageComponent,component); + if (component) + [self _takeAwakeComponent:component]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setResponse:(GSWResponse*)_response; +-(void)_setResponse:(GSWResponse*)aResponse { //OK LOGObjectFnStart(); - ASSIGN(response,_response); + ASSIGN(_response,aResponse); LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setRequest:(GSWRequest*)_request; +-(void)_setRequest:(GSWRequest*)aRequest { //OK - NSString* _adaptorPrefix=nil; - NSString* _applicationName=nil; + NSString* adaptorPrefix=nil; + NSString* applicationName=nil; LOGObjectFnStart(); - NSDebugMLLog(@"low",@"_request=%@",_request); - NSDebugMLLog(@"low",@"url=%@",url); - _adaptorPrefix=[_request adaptorPrefix]; - NSDebugMLLog(@"low",@"_adaptorPrefix=%@",_adaptorPrefix); - [url setURLPrefix:_adaptorPrefix]; - NSDebugMLLog(@"low",@"url=%@",url); - _applicationName=[_request applicationName]; - NSDebugMLLog(@"low",@"_applicationName=%@",_applicationName); - [url setURLApplicationName:_applicationName]; - NSDebugMLLog(@"low",@"url=%@",url); - ASSIGN(request,_request); + NSDebugMLLog(@"low",@"aRequest=%@",aRequest); + NSDebugMLLog(@"low",@"url=%@",_url); + adaptorPrefix=[aRequest adaptorPrefix]; + NSDebugMLLog(@"low",@"adaptorPrefix=%@",adaptorPrefix); + [_url setURLPrefix:adaptorPrefix]; + NSDebugMLLog(@"low",@"url=%@",_url); + applicationName=[aRequest applicationName]; + NSDebugMLLog(@"low",@"applicationName=%@",applicationName); + [_url setURLApplicationName:applicationName]; + NSDebugMLLog(@"low",@"url=%@",_url); + ASSIGN(_request,aRequest); [self _synchronizeForDistribution]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setSession:(GSWSession*)_session +-(void)_setSession:(GSWSession*)aSession { //OK LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"_session ID:%@",[_session sessionID]); - ASSIGN(session,_session); + NSDebugMLLog(@"sessions",@"aSession ID:%@",[aSession sessionID]); + ASSIGN(_session,aSession); [self _synchronizeForDistribution]; - NSDebugMLLog(@"low",@"contextID=%u",contextID); - contextID=[session _contextCounter]; - NSDebugMLLog(@"low",@"contextID=%u",contextID); + NSDebugMLLog(@"low",@"contextID=%u",_contextID); + _contextID=[_session _contextCounter]; + NSDebugMLLog(@"low",@"contextID=%u",_contextID); LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setSenderID:(NSString*)_senderID +-(void)_setSenderID:(NSString*)aSenderID { LOGObjectFnStart(); - ASSIGNCOPY(senderID,_senderID); + ASSIGNCOPY(_senderID,aSenderID); LOGObjectFnStop(); }; @@ -738,91 +745,91 @@ static int dontTraceComponentActionURL=0; { //OK LOGObjectFnStart(); - if (session) - { - //call session storesIDsInURLs [ret 1] - //call session isDistributionEnabled [ret 0] - [url setURLApplicationNumber:[request applicationNumber]];//OK - } + if (_session) + { + //call session storesIDsInURLs [ret 1] + //call session isDistributionEnabled [ret 0] + [_url setURLApplicationNumber:[_request applicationNumber]];//OK + } else - [url setURLApplicationNumber:-1];//OK + [_url setURLApplicationNumber:-1];//OK LOGObjectFnStop(); }; //-------------------------------------------------------------------- -(void)_incrementContextID { - [session _contextDidIncrementContextID]; + [_session _contextDidIncrementContextID]; }; //-------------------------------------------------------------------- //oldname= _session -(GSWSession*)existingSession { - return session; + return _session; }; //-------------------------------------------------------------------- --(void)_setCurrentComponent:(GSWComponent*)_component +-(void)_setCurrentComponent:(GSWComponent*)component { //OK LOGObjectFnStart(); - ASSIGN(currentComponent,_component); + ASSIGN(_currentComponent,component); LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_setPageReplaced:(BOOL)_flag +-(void)_setPageReplaced:(BOOL)flag { - pageReplaced=_flag; + _pageReplaced=flag; }; //-------------------------------------------------------------------- -(BOOL)_pageReplaced { - return pageReplaced; + return _pageReplaced; }; //-------------------------------------------------------------------- --(void)_setPageChanged:(BOOL)_flag +-(void)_setPageChanged:(BOOL)flag { - pageChanged=_flag; + _pageChanged=flag; }; //-------------------------------------------------------------------- -(BOOL)_pageChanged { - return pageChanged; + return _pageChanged; }; //-------------------------------------------------------------------- --(void)_setRequestSessionID:(NSString*)_sessionID +-(void)_setRequestSessionID:(NSString*)aSessionID { LOGObjectFnStart(); - ASSIGNCOPY(requestSessionID,_sessionID); + ASSIGNCOPY(_requestSessionID,aSessionID); LOGObjectFnStop(); }; //-------------------------------------------------------------------- -(NSString*)_requestSessionID { - return requestSessionID; + return _requestSessionID; }; //-------------------------------------------------------------------- --(void)_takeAwakeComponentsFromArray:(id)_unknwon +-(void)_takeAwakeComponentsFromArray:(id)unknwon { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_takeAwakeComponent:(GSWComponent*)_component +-(void)_takeAwakeComponent:(GSWComponent*)component { //OK LOGObjectFnStart(); - if (!awakePageComponents) - awakePageComponents=[NSMutableArray new]; - [awakePageComponents addObject:_component]; + if (!_awakePageComponents) + _awakePageComponents=[NSMutableArray new]; + [_awakePageComponents addObject:component]; LOGObjectFnStop(); }; @@ -836,9 +843,9 @@ static int dontTraceComponentActionURL=0; -(void)incrementLastElementIDComponent { // LOGObjectFnStart(); - if (!elementID) - elementID=[GSWElementIDString new]; - [elementID incrementLastElementIDComponent]; + if (!_elementID) + _elementID=[GSWElementIDString new]; + [_elementID incrementLastElementIDComponent]; // LOGObjectFnStop(); }; @@ -846,12 +853,12 @@ static int dontTraceComponentActionURL=0; //-------------------------------------------------------------------- // appendElementIDComponent: --(void)appendElementIDComponent:(NSString*)string_ +-(void)appendElementIDComponent:(NSString*)string { // LOGObjectFnStart(); - if (!elementID) - elementID=[GSWElementIDString new]; - [elementID appendElementIDComponent:string_]; + if (!_elementID) + _elementID=[GSWElementIDString new]; + [_elementID appendElementIDComponent:string]; // LOGObjectFnStop(); }; @@ -860,9 +867,9 @@ static int dontTraceComponentActionURL=0; -(void)appendZeroElementIDComponent { // LOGObjectFnStart(); - if (!elementID) - elementID=[GSWElementIDString new]; - [elementID appendZeroElementIDComponent]; + if (!_elementID) + _elementID=[GSWElementIDString new]; + [_elementID appendZeroElementIDComponent]; // LOGObjectFnStop(); }; @@ -871,7 +878,7 @@ static int dontTraceComponentActionURL=0; -(void)deleteAllElementIDComponents { // LOGObjectFnStart(); - [elementID deleteAllElementIDComponents]; + [_elementID deleteAllElementIDComponents]; // LOGObjectFnStop(); }; @@ -880,9 +887,9 @@ static int dontTraceComponentActionURL=0; -(void)deleteLastElementIDComponent { // LOGObjectFnStart(); - if (!elementID) - elementID=[GSWElementIDString new]; - [elementID deleteLastElementIDComponent]; + if (!_elementID) + _elementID=[GSWElementIDString new]; + [_elementID deleteLastElementIDComponent]; // LOGObjectFnStop(); }; @@ -894,11 +901,11 @@ static int dontTraceComponentActionURL=0; -(NSString*)url { //OK - GSWDynamicURLString* _componentActionURL=nil; + GSWDynamicURLString* componentActionURL=nil; LOGObjectFnStart(); - _componentActionURL=[self componentActionURL]; + componentActionURL=[self componentActionURL]; LOGObjectFnStop(); - return (NSString*)_componentActionURL; + return (NSString*)componentActionURL; }; //-------------------------------------------------------------------- @@ -908,16 +915,16 @@ static int dontTraceComponentActionURL=0; -(NSString*)urlSessionPrefix { LOGObjectFnNotImplemented(); //TODOFN - NSDebugMLLog(@"low",@"[request urlProtocolHorstPort]=%@",[request urlProtocolHostPort]); - NSDebugMLLog(@"low",@"[request adaptorPrefix]=%@",[request adaptorPrefix]); - NSDebugMLLog(@"low",@"[request applicationName]=%@",[request applicationName]); - NSDebugMLLog(@"low",@"[session sessionID]=%@",[session sessionID]); + NSDebugMLLog(@"low",@"[request urlProtocolHorstPort]=%@",[_request urlProtocolHostPort]); + NSDebugMLLog(@"low",@"[request adaptorPrefix]=%@",[_request adaptorPrefix]); + NSDebugMLLog(@"low",@"[request applicationName]=%@",[_request applicationName]); + NSDebugMLLog(@"low",@"[session sessionID]=%@",[_session sessionID]); return [NSString stringWithFormat:@"%@%@/%@.%@/%@", - [request urlProtocolHostPort], - [request adaptorPrefix], - [request applicationName], + [_request urlProtocolHostPort], + [_request adaptorPrefix], + [_request applicationName], GSWApplicationSuffix[GSWebNamingConv], - [session sessionID]]; + [_session sessionID]]; }; //-------------------------------------------------------------------- @@ -931,15 +938,15 @@ static int dontTraceComponentActionURL=0; -(BOOL)isDistributionEnabled { - return distributionEnabled; + return _distributionEnabled; }; //-------------------------------------------------------------------- // setDistributionEnabled: --(void)setDistributionEnabled:(BOOL)isDistributionEnabled_ +-(void)setDistributionEnabled:(BOOL)isDistributionEnabled { - distributionEnabled=isDistributionEnabled_; + _distributionEnabled=isDistributionEnabled; }; @end @@ -947,13 +954,13 @@ static int dontTraceComponentActionURL=0; @implementation GSWContext (GSWContextGSWeb) -(BOOL)isValidate { - return isValidate; + return _isValidate; }; //-------------------------------------------------------------------- --(void)setValidate:(BOOL)isValidate_ +-(void)setValidate:(BOOL)isValidate { - isValidate = isValidate_; - NSDebugMLLog(@"low",@"isValidate_=%d\n",(int)isValidate_); + _isValidate = isValidate; + NSDebugMLLog(@"low",@"isValidate=%d\n",(int)isValidate); }; @end diff --git a/GSWeb.framework/GSWCookie.h b/GSWeb.framework/GSWCookie.h index 1227b21..42b6923 100644 --- a/GSWeb.framework/GSWCookie.h +++ b/GSWeb.framework/GSWCookie.h @@ -1,11 +1,16 @@ -/* GSWCookie.h - GSWeb: Class GSWCookie - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWCookie.h - GSWeb: Class GSWResponse + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Feb 1999 + Written by: Manuel Guesdon + Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -31,41 +37,41 @@ @interface GSWCookie : NSObject { @private - NSString* name; - NSString* value; - NSString* domain; - NSString* path; - NSDate* expires; - BOOL isSecure; + NSString* _name; + NSString* _value; + NSString* _domain; + NSString* _path; + NSDate* _expires; + BOOL _isSecure; }; -+(GSWCookie*)cookieWithName:(NSString*)name_ - value:(NSString*)value_; -+(GSWCookie*)cookieWithName:(NSString*)name_ - value:(NSString*)value_ - path:(NSString*)path_ - domain:(NSString*)domain_ - expires:(NSDate*)expireDate_ - isSecure:(BOOL)isSecure_; --(id)initWithName:(NSString*)name_ - value:(NSString*)value_ - path:(NSString*)path_ - domain:(NSString*)domain_ - expires:(NSDate*)expireDate_ - isSecure:(BOOL)isSecure_; ++(GSWCookie*)cookieWithName:(NSString*)aName + value:(NSString*)aValue; ++(GSWCookie*)cookieWithName:(NSString*)aName + value:(NSString*)aValue + path:(NSString*)aPath + domain:(NSString*)aDomain + expires:(NSDate*)anExpireDate + isSecure:(BOOL)isSecureFlag; +-(id)initWithName:(NSString*)aName + value:(NSString*)aValue + path:(NSString*)aPath + domain:(NSString*)aDomain + expires:(NSDate*)anExpireDate + isSecure:(BOOL)isSecureFlag; -(NSString*)description; -(NSString*)name; --(void)setName:(NSString*)name_; +-(void)setName:(NSString*)aName; -(NSString*)value; --(void)setValue:(NSString*)value_; +-(void)setValue:(NSString*)aValue; -(NSString*)domain; --(void)setDomain:(NSString*)domain_; +-(void)setDomain:(NSString*)aDomain; -(NSString*)path; --(void)setPath:(NSString*)path_; +-(void)setPath:(NSString*)aPath; -(NSDate*)expires; --(void)setExpires:(NSDate*)expireDate_; +-(void)setExpires:(NSDate*)anExpireDate; -(BOOL)isSecure; --(void)setIsSecure:(BOOL)isSecure_; +-(void)setIsSecure:(BOOL)isSecureFlag; -(NSString*)headerString; -(NSString*)headerKey; -(NSString*)headerValue; diff --git a/GSWeb.framework/GSWCookie.m b/GSWeb.framework/GSWCookie.m index 0cd9e90..9202cb4 100644 --- a/GSWeb.framework/GSWCookie.m +++ b/GSWeb.framework/GSWCookie.m @@ -1,11 +1,16 @@ -/* GSWCookie.m - GSWeb: Class GSWCookie - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWCookie.m - GSWeb: Class GSWResponse + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Feb 1999 + Written by: Manuel Guesdon + Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -30,33 +36,33 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- // cookieWithName:value: -+(GSWCookie*)cookieWithName:(NSString*)name_ - value:(NSString*)value_ ++(GSWCookie*)cookieWithName:(NSString*)aName + value:(NSString*)aValue { - return [GSWCookie cookieWithName:name_ - value:value_ - path:nil - domain:nil - expires:nil - isSecure:NO]; + return [GSWCookie cookieWithName:aName + value:aValue + path:nil + domain:nil + expires:nil + isSecure:NO]; }; //-------------------------------------------------------------------- // cookieWithName:value:path:domain:expires:isSecure: -+(GSWCookie*)cookieWithName:(NSString*)name_ - value:(NSString*)value_ - path:(NSString*)path_ - domain:(NSString*)domain_ - expires:(NSDate*)expireDate_ - isSecure:(BOOL)isSecure_ ++(GSWCookie*)cookieWithName:(NSString*)aName + value:(NSString*)aValue + path:(NSString*)aPath + domain:(NSString*)aDomain + expires:(NSDate*)anExpireDate + isSecure:(BOOL)isSecureFlag { - return [[[GSWCookie alloc] initWithName:name_ - value:value_ - path:path_ - domain:domain_ - expires:expireDate_ - isSecure:isSecure_] - autorelease]; + return [[[GSWCookie alloc] initWithName:aName + value:aValue + path:aPath + domain:aDomain + expires:anExpireDate + isSecure:isSecureFlag] + autorelease]; }; //-------------------------------------------------------------------- @@ -64,36 +70,36 @@ static char rcsId[] = "$Id$"; -(id)init { if ((self=[super init])) - { - }; + { + }; return self; }; //-------------------------------------------------------------------- // initWithName:value:path:domain:expires:isSecure: --(id)initWithName:(NSString*)name_ - value:(NSString*)value_ - path:(NSString*)path_ - domain:(NSString*)domain_ - expires:(NSDate*)expireDate_ - isSecure:(BOOL)isSecure_ +-(id)initWithName:(NSString*)aName + value:(NSString*)aValue + path:(NSString*)aPath + domain:(NSString*)aDomain + expires:(NSDate*)anExpireDate + isSecure:(BOOL)isSecureFlag { LOGObjectFnStart(); if ((self=[self init])) - { - NSDebugMLLog(@"low",@"name_:%@",name_); - NSDebugMLLog(@"low",@"value_:%@",value_); - NSDebugMLLog(@"low",@"path_:%@",path_); - NSDebugMLLog(@"low",@"domain_:%@",domain_); - NSDebugMLLog(@"low",@"expireDate_:%@",expireDate_); - NSDebugMLLog(@"low",@"isSecure:%d",isSecure); - [self setName:name_]; - [self setValue:value_]; - [self setPath:path_]; - [self setDomain:domain_]; - [self setExpires:expireDate_]; - [self setIsSecure:isSecure_]; - }; + { + NSDebugMLLog(@"low",@"aName:%@",aName); + NSDebugMLLog(@"low",@"aValue:%@",aValue); + NSDebugMLLog(@"low",@"aPath:%@",aPath); + NSDebugMLLog(@"low",@"aDomain:%@",aDomain); + NSDebugMLLog(@"low",@"anExpireDate:%@",anExpireDate); + NSDebugMLLog(@"low",@"isSecure:%d",isSecureFlag); + [self setName:aName]; + [self setValue:aValue]; + [self setPath:aPath]; + [self setDomain:aDomain]; + [self setExpires:anExpireDate]; + [self setIsSecure:isSecureFlag]; + }; LOGObjectFnStop(); return self; }; @@ -101,11 +107,11 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(name); - DESTROY(value); - DESTROY(domain); - DESTROY(path); - DESTROY(expires); + DESTROY(_name); + DESTROY(_value); + DESTROY(_domain); + DESTROY(_path); + DESTROY(_expires); [super dealloc]; } @@ -113,34 +119,34 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"name=%@; value=%@; expires=%@; path=%@; domain=%@; %@", - name, - value, - [expires htmlDescription], - path, - domain, - (isSecure ? @"secure;" : @"")]; + _name, + _value, + [_expires htmlDescription], + _path, + _domain, + (_isSecure ? @"secure;" : @"")]; }; //-------------------------------------------------------------------- --(NSString*)name { return name; }; --(void)setName:(NSString*)name_ { ASSIGNCOPY(name,name_); }; --(NSString*)value { return value; }; --(void)setValue:(NSString*)value_ { ASSIGNCOPY(value,value_); }; --(NSString*)domain { return domain; }; --(void)setDomain:(NSString*)domain_ { ASSIGNCOPY(domain,domain_); }; --(NSString*)path { return path; }; --(void)setPath:(NSString*)path_ { ASSIGNCOPY(path,path_); }; --(NSDate*)expires { return expires; }; --(void)setExpires:(NSDate*)expireDate_ { ASSIGNCOPY(expires,expireDate_); }; --(BOOL)isSecure { return isSecure; }; --(void)setIsSecure:(BOOL)isSecure_ { isSecure=isSecure_; }; +-(NSString*)name { return _name; }; +-(void)setName:(NSString*)aName { ASSIGNCOPY(_name,aName); }; +-(NSString*)value { return _value; }; +-(void)setValue:(NSString*)aValue { ASSIGNCOPY(_value,aValue); }; +-(NSString*)domain { return _domain; }; +-(void)setDomain:(NSString*)aDomain { ASSIGNCOPY(_domain,aDomain); }; +-(NSString*)path { return _path; }; +-(void)setPath:(NSString*)aPath { ASSIGNCOPY(_path,aPath); }; +-(NSDate*)expires { return _expires; }; +-(void)setExpires:(NSDate*)anExpireDate { ASSIGNCOPY(_expires,anExpireDate); }; +-(BOOL)isSecure { return _isSecure; }; +-(void)setIsSecure:(BOOL)isSecureFlag { _isSecure=isSecureFlag; }; //-------------------------------------------------------------------- -(NSString*)headerString { return [NSString stringWithFormat:@"%@: %@", - [self headerKey], - [self headerValue]]; + [self headerKey], + [self headerValue]]; }; //-------------------------------------------------------------------- @@ -152,42 +158,42 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(NSString*)headerValue { - NSString* _header=nil; - NSString* _domainString=nil; - NSString* _pathString=nil; - NSDate* _expires=nil; + NSString* header=nil; + NSString* domainString=nil; + NSString* pathString=nil; + NSDate* expires=nil; LOGObjectFnStart(); - NSDebugMLLog(@"low",@"name:%@",name); - NSDebugMLLog(@"low",@"value:%@",value); - NSDebugMLLog(@"low",@"path:%@",path); - NSDebugMLLog(@"low",@"domain:%@",domain); + NSDebugMLLog(@"low",@"name:%@",_name); + NSDebugMLLog(@"low",@"value:%@",_value); + NSDebugMLLog(@"low",@"path:%@",_path); + NSDebugMLLog(@"low",@"domain:%@",_domain); + NSDebugMLLog(@"low",@"expires:%@",_expires); + NSDebugMLLog(@"low",@"isSecure:%d",_isSecure); + if (_domain) + domainString=[NSString stringWithFormat:@" domain=%@;",_domain]; + else + domainString=@""; + if (_path) + pathString=[NSString stringWithFormat:@" path=%@;",_path]; + else + pathString=@"/"; + if (_expires) + expires=_expires; + else + expires=[NSDate dateWithTimeIntervalSinceNow:24L*60L*60L*365L];//1 Year + NSDebugMLLog(@"low",@"pathString:%@",pathString); + NSDebugMLLog(@"low",@"domainString:%@",domainString); NSDebugMLLog(@"low",@"expires:%@",expires); - NSDebugMLLog(@"low",@"isSecure:%d",isSecure); - if (domain) - _domainString=[NSString stringWithFormat:@" domain=%@;",domain]; - else - _domainString=@""; - if (path) - _pathString=[NSString stringWithFormat:@" path=%@;",path]; - else - _pathString=@"/"; - if (expires) - _expires=expires; - else - _expires=[NSDate dateWithTimeIntervalSinceNow:24L*60L*60L*365L];//1 Year - NSDebugMLLog(@"low",@"_pathString:%@",_pathString); - NSDebugMLLog(@"low",@"_domainString:%@",_domainString); - NSDebugMLLog(@"low",@"_expires:%@",_expires); - _header=[NSString stringWithFormat:@"%@=%@; expires=%@;%@%@%@", - name, - (value ? value : @""), - [_expires htmlDescription], - _pathString, - _domainString, - (isSecure ? @" secure;" : @"")]; - NSDebugMLLog(@"low",@"_header=%@",_header); + header=[NSString stringWithFormat:@"%@=%@; expires=%@;%@%@%@", + _name, + (_value ? _value : @""), + [expires htmlDescription], + pathString, + domainString, + (_isSecure ? @" secure;" : @"")]; + NSDebugMLLog(@"low",@"header=%@",header); LOGObjectFnStop(); - return _header; + return header; }; @end diff --git a/GSWeb.framework/GSWDeployedBundle.m b/GSWeb.framework/GSWDeployedBundle.m index 9b9d86a..2a2f747 100644 --- a/GSWeb.framework/GSWDeployedBundle.m +++ b/GSWeb.framework/GSWDeployedBundle.m @@ -504,7 +504,9 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- +(id)bundleWithPath:(NSString*)path_ { - id _bundle=[[[GSWDeployedBundle alloc]initWithPath:path_]autorelease]; + id _bundle=nil; + NSDebugMLLog(@"bundles",@"path_=%@",path_); + _bundle=[[[GSWDeployedBundle alloc]initWithPath:path_]autorelease]; return _bundle; }; diff --git a/GSWeb.framework/GSWDirectAction.h b/GSWeb.framework/GSWDirectAction.h index 4440eb4..0c61936 100644 --- a/GSWeb.framework/GSWDirectAction.h +++ b/GSWeb.framework/GSWDirectAction.h @@ -1,11 +1,16 @@ -/* GSWDirectAction.h - GSWeb: Class GSWDirectAction - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWDirectAction.h - GSWeb: Class GSWDirectAction + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -31,19 +37,20 @@ @interface GSWDirectAction : NSObject { @private - GSWContext* context; + GSWContext* _context; }; -(void)dealloc; --(id)initWithRequest:(GSWRequest*)request_; +-(id)initWithRequest:(GSWRequest*)aRequest; -(GSWRequest*)request; -(GSWSession*)existingSession; +-(GSWSession*)existingSessionWithSessionID:(NSString*)aSessionID; -(GSWSession*)session; -(GSWApplication*)application;//NDFN --(GSWComponent*)pageWithName:(NSString*)pageName_; --(id )performActionNamed:(NSString*)actionName_; +-(GSWComponent*)pageWithName:(NSString*)pageName; +-(id )performActionNamed:(NSString*)actionName; -(id)defaultAction; -(id)existingSession; --(void)_initializeRequestSessionIDInContext:(GSWContext*)context_; +-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext; @end //==================================================================== @@ -53,19 +60,19 @@ @end //==================================================================== @interface GSWDirectAction (GSWTakeValuesConvenience) --(void)takeFormValueArraysForKeyArray:(NSArray*)keys_; --(void)takeFormValuesForKeyArray:(NSArray*)keys_; --(void)takeFormValueArraysForKeys:(NSString*)firstKey_, ...; --(void)takeFormValuesForKeys:(NSString*)firstKey_, ...; +-(void)takeFormValueArraysForKeyArray:(NSArray*)keys; +-(void)takeFormValuesForKeyArray:(NSArray*)keys; +-(void)takeFormValueArraysForKeys:(NSString*)firstKey,...; +-(void)takeFormValuesForKeys:(NSString*)firstKey,...; @end //==================================================================== @interface GSWDirectAction (GSWDebugging) --(void)logWithString:(NSString*)string_; --(void)logWithFormat:(NSString*)format_,...; -+(void)logWithFormat:(NSString*)format_,...; --(void)_debugWithString:(NSString*)string_; --(void)debugWithFormat:(NSString*)format_,...; +-(void)logWithString:(NSString*)string; +-(void)logWithFormat:(NSString*)format,...; ++(void)logWithFormat:(NSString*)format,...; +-(void)_debugWithString:(NSString*)string; +-(void)debugWithFormat:(NSString*)format,...; @end #endif //_GSWDirectAction_h__ diff --git a/GSWeb.framework/GSWDirectAction.m b/GSWeb.framework/GSWDirectAction.m index 9f9cdf6..9403aaf 100644 --- a/GSWeb.framework/GSWDirectAction.m +++ b/GSWeb.framework/GSWDirectAction.m @@ -1,11 +1,16 @@ -/* GSWDirectAction.m - GSWeb: Class GSWDirectAction - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWDirectAction.m - GSWeb: Class GSWDirectAction + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -29,15 +35,15 @@ static char rcsId[] = "$Id$"; @implementation GSWDirectAction //-------------------------------------------------------------------- --(id)initWithRequest:(GSWRequest*)request_ +-(id)initWithRequest:(GSWRequest*)aRequest { LOGObjectFnStart(); if ((self=[super init])) - { - context=[GSWContext contextWithRequest:request_]; - [GSWApp _setContext:context]; //NDFN - [self _initializeRequestSessionIDInContext:context]; - }; + { + _context=[GSWContext contextWithRequest:aRequest]; + [GSWApp _setContext:_context]; //NDFN + [self _initializeRequestSessionIDInContext:_context]; + }; LOGObjectFnStop(); return self; }; @@ -45,95 +51,130 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(context); + DESTROY(_context); [super dealloc]; }; //-------------------------------------------------------------------- -(GSWRequest*)request { - return [context request]; + return [_context request]; }; //-------------------------------------------------------------------- -(GSWSession*)existingSession { //OK - GSWSession* _session=nil; - BOOL _hasSession=NO; + GSWSession* session=nil; + BOOL hasSession=NO; LOGObjectFnStart(); - _hasSession=[context hasSession]; - if (_hasSession) - _session=[context existingSession]; - if (!_session) - { - NSString* _sessionID=nil; - _sessionID=[[self request] sessionID]; - if (_sessionID) - { - NS_DURING - { - NSDebugMLLog(@"requests",@"_sessionID=%@",_sessionID); - _session=[GSWApp restoreSessionWithID:_sessionID - inContext:context]; - //No Exception if session can't be restored ! - } - NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore"); - LOGException(@"exception=%@",localException); - //No Exception if session can't be restored ! - _session=nil; - } - NS_ENDHANDLER; - }; - }; + hasSession=[_context hasSession]; + if (hasSession) + session=[_context existingSession]; + if (!session) + { + NSString* sessionID=nil; + sessionID=[[self request] sessionID]; + if (sessionID) + { + NS_DURING + { + NSDebugMLLog(@"requests",@"sessionID=%@",sessionID); + session=[GSWApp restoreSessionWithID:sessionID + inContext:_context]; + //No Exception if session can't be restored ! + } + NS_HANDLER + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore"); + LOGException(@"exception=%@",localException); + //No Exception if session can't be restored ! + session=nil; + } + NS_ENDHANDLER; + }; + }; LOGObjectFnStop(); - return _session; + return session; +}; + +//-------------------------------------------------------------------- +-(GSWSession*)existingSessionWithSessionID:(NSString*)aSessionID +{ + //OK + GSWSession* session=nil; + BOOL hasSession=NO; + LOGObjectFnStart(); + hasSession=[_context hasSession]; + if (hasSession) + session=[_context existingSession]; + if (!session) + { + if (aSessionID) + { + NS_DURING + { + NSDebugMLLog(@"requests",@"aSessionID=%@",aSessionID); + session=[GSWApp restoreSessionWithID:aSessionID + inContext:_context]; + //No Exception if session can't be restored ! + } + NS_HANDLER + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore"); + LOGException(@"exception=%@",localException); + //No Exception if session can't be restored ! + session=nil; + } + NS_ENDHANDLER; + }; + }; + LOGObjectFnStop(); + return session; }; //-------------------------------------------------------------------- -(GSWSession*)session { - BOOL _hasSession=NO; - GSWSession* _session=nil; + BOOL hasSession=NO; + GSWSession* session=nil; LOGObjectFnStart(); - _hasSession=[context hasSession]; - if (_hasSession) - _session=[context existingSession]; - if (!_session) - { - NSString* _sessionID=nil; - _sessionID=[[self request] sessionID]; - if (_sessionID) - { - NS_DURING - { - _session=[GSWApp restoreSessionWithID:_sessionID - inContext:context]; - } - NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore"); - LOGException(@"exception=%@",localException); - [localException raise]; - }; - NS_ENDHANDLER; - if (!_session) - { - ExceptionRaise(@"GSWDirectAction", - @"Unable to restore sessionID %@.", - _sessionID); - }; - } - else - { - // No Session ID: Create a new Session - _session=[context session]; - }; - }; + hasSession=[_context hasSession]; + if (hasSession) + session=[_context existingSession]; + if (!session) + { + NSString* sessionID=nil; + sessionID=[[self request] sessionID]; + if (sessionID) + { + NS_DURING + { + session=[GSWApp restoreSessionWithID:sessionID + inContext:_context]; + } + NS_HANDLER + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore"); + LOGException(@"exception=%@",localException); + [localException raise]; + }; + NS_ENDHANDLER; + if (!session) + { + ExceptionRaise(@"GSWDirectAction", + @"Unable to restore sessionID %@.", + sessionID); + }; + } + else + { + // No Session ID: Create a new Session + session=[_context session]; + }; + }; LOGObjectFnStop(); - return _session; + return session; }; //-------------------------------------------------------------------- @@ -145,68 +186,68 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(GSWComponent*)pageWithName:(NSString*)pageName_ +-(GSWComponent*)pageWithName:(NSString*)pageName { //OK - GSWComponent* _component=nil; + GSWComponent* component=nil; LOGObjectFnStart(); NS_DURING - { - _component=[[GSWApplication application]pageWithName:pageName_ - inContext:context]; - } + { + component=[[GSWApplication application]pageWithName:pageName + inContext:_context]; + } NS_HANDLER - { - LOGException(@"%@ (%@)", - localException, - [localException reason]); - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In pageWithName:inContext:"); - [localException raise]; - }; + { + LOGException(@"%@ (%@)", + localException, + [localException reason]); + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In pageWithName:inContext:"); + [localException raise]; + }; NS_ENDHANDLER; LOGObjectFnStop(); - return _component; + return component; }; //-------------------------------------------------------------------- --(id )performActionNamed:(NSString*)actionName_ +-(id )performActionNamed:(NSString*)actionName { //OK - id _actionResult=nil; - NSString* _actionSelName=nil; - SEL _actionSel=NULL; + id actionResult=nil; + NSString* actionSelName=nil; + SEL actionSel=NULL; LOGObjectFnStart(); - _actionSelName=[NSString stringWithFormat:@"%@Action",actionName_]; - NSDebugMLLog(@"requests",@"_actionSelName=%@",_actionSelName); - _actionSel=NSSelectorFromString(_actionSelName); - NSDebugMLLog(@"requests",@"_actionSel=%p",(void*)_actionSel); - if (_actionSel) - { - NS_DURING - { - _actionResult=[self performSelector:_actionSel]; - NSDebugMLLog(@"requests", - @"_actionResult=%@ class=%@", - _actionResult, - [_actionResult class]); - } - NS_HANDLER - { - LOGException(@"%@ (%@)", - localException, - [localException reason]); - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In performSelector:"); - [localException raise]; - }; - NS_ENDHANDLER; - } + actionSelName=[NSString stringWithFormat:@"%@Action",actionName]; + NSDebugMLLog(@"requests",@"actionSelName=%@",actionSelName); + actionSel=NSSelectorFromString(actionSelName); + NSDebugMLLog(@"requests",@"actionSel=%p",(void*)actionSel); + if (actionSel) + { + NS_DURING + { + actionResult=[self performSelector:actionSel]; + NSDebugMLLog(@"requests", + @"_actionResult=%@ class=%@", + actionResult, + [actionResult class]); + } + NS_HANDLER + { + LOGException(@"%@ (%@)", + localException, + [localException reason]); + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In performSelector:"); + [localException raise]; + }; + NS_ENDHANDLER; + } else - { - LOGError(@"No selector for: %@",_actionSelName);//TODO - _actionResult=[self defaultAction];//No ?? - }; + { + LOGError(@"No selector for: %@",actionSelName);//TODO + actionResult=[self defaultAction];//No ?? + }; LOGObjectFnStop(); - return _actionResult; + return actionResult; }; //-------------------------------------------------------------------- @@ -218,22 +259,22 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)_initializeRequestSessionIDInContext:(GSWContext*)_context +-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext { //OK - GSWRequest* _request=nil; - NSString* _gswsid=nil; + GSWRequest* request=nil; + NSString* gswsid=nil; LOGObjectFnStart(); - _request=[_context request]; - _gswsid=[_request formValueForKey:GSWKey_SessionID[GSWebNamingConv]]; - if (!_gswsid) - { - _gswsid=[_request cookieValueForKey:GSWKey_SessionID[GSWebNamingConv]]; - }; - if (_gswsid) - { - //TODO - }; + request=[aContext request]; + gswsid=[request formValueForKey:GSWKey_SessionID[GSWebNamingConv]]; + if (!gswsid) + { + gswsid=[request cookieValueForKey:GSWKey_SessionID[GSWebNamingConv]]; + }; + if (gswsid) + { + //TODO + }; LOGObjectFnStop(); }; @@ -244,7 +285,7 @@ static char rcsId[] = "$Id$"; -(GSWContext*)_context { //OK - return context; + return _context; }; //-------------------------------------------------------------------- @@ -259,25 +300,25 @@ static char rcsId[] = "$Id$"; @implementation GSWDirectAction (GSWTakeValuesConvenience) //-------------------------------------------------------------------- --(void)takeFormValueArraysForKeyArray:(NSArray*)keyArray_ +-(void)takeFormValueArraysForKeyArray:(NSArray*)keyArray { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)takeFormValuesForKeyArray:(NSArray*)keyArray_ +-(void)takeFormValuesForKeyArray:(NSArray*)keyArray { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)takeFormValueArraysForKeys:(NSString*)firstKey_, ... +-(void)takeFormValueArraysForKeys:(NSString*)firstKey,... { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)takeFormValuesForKeys:(NSString*)firstKey_, ... +-(void)takeFormValuesForKeys:(NSString*)firstKey,... { LOGObjectFnNotImplemented(); //TODOFN }; @@ -288,31 +329,31 @@ static char rcsId[] = "$Id$"; @implementation GSWDirectAction (GSWDebugging) //-------------------------------------------------------------------- --(void)logWithString:(NSString*)_string +-(void)logWithString:(NSString*)string { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)logWithFormat:(NSString*)format_,... +-(void)logWithFormat:(NSString*)format,... { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- -+(void)logWithFormat:(NSString*)format_,... ++(void)logWithFormat:(NSString*)format,... { LOGClassFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_debugWithString:(NSString*)_string +-(void)_debugWithString:(NSString*)string { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)debugWithFormat:(NSString*)format_,... +-(void)debugWithFormat:(NSString*)format,... { LOGObjectFnNotImplemented(); //TODOFN }; diff --git a/GSWeb.framework/GSWHTMLBareString.h b/GSWeb.framework/GSWHTMLBareString.h index 18e2b3d..3dc132b 100644 --- a/GSWeb.framework/GSWHTMLBareString.h +++ b/GSWeb.framework/GSWHTMLBareString.h @@ -1,11 +1,16 @@ -/* GSWHTMLBareString.h - GSWeb: Class GSWHTMLBareString - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLBareString.h - GSWeb: Class GSWHTMLBareString + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -29,25 +35,25 @@ //==================================================================== @interface GSWHTMLBareString: GSWElement { - NSString* string; - NSData* data; - NSStringEncoding encoding; + NSString* _string; + NSData* _data; + NSStringEncoding _encoding; }; --(id)initWithString:(NSString*)_string; +-(id)initWithString:(NSString*)aString; -(void)dealloc; -(NSString*)description; @end //==================================================================== @interface GSWHTMLBareString (GSWHTMLBareStringA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; @end //==================================================================== @interface GSWHTMLBareString (GSWHTMLBareStringB) -+(id)elementWithString:(NSString*)_string; ++(id)elementWithString:(NSString*)aString; @end #endif //_GSWHTMLBareString_h__ diff --git a/GSWeb.framework/GSWHTMLBareString.m b/GSWeb.framework/GSWHTMLBareString.m index 6fd54d8..2c3f2c5 100644 --- a/GSWeb.framework/GSWHTMLBareString.m +++ b/GSWeb.framework/GSWHTMLBareString.m @@ -1,11 +1,16 @@ -/* GSWHTMLBareString.m - GSWeb: Class GSWHTMLBareString - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLBareString.m - GSWeb: Class GSWHTMLBareString + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -32,27 +38,27 @@ static char rcsId[] = "$Id$"; -(id)init { if ((self=[super init])) - { - encoding=NSISOLatin1StringEncoding; - }; + { + _encoding=NSISOLatin1StringEncoding; + }; return self; }; //-------------------------------------------------------------------- --(id)initWithString:(NSString*)_string +-(id)initWithString:(NSString*)aString { if ((self=[self init])) - { - ASSIGN(string,_string); - }; + { + ASSIGN(_string,aString); + }; return self; }; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(string); - DESTROY(data); + DESTROY(_string); + DESTROY(_data); [super dealloc]; } @@ -60,9 +66,9 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%s %p - String:[%s]>", - object_get_class_name(self), - (void*)self, - [string lossyCString]]; + object_get_class_name(self), + (void*)self, + [_string lossyCString]]; }; @end @@ -71,14 +77,14 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLBareString (GSWHTMLBareStringA) //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - GSWSaveAppendToResponseElementID(context_);//Debug Only - [response_ appendContentString:string]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[aContext elementID]); + GSWSaveAppendToResponseElementID(aContext);//Debug Only + [aResponse appendContentString:_string]; + NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[aContext elementID]); LOGObjectFnStop(); }; @@ -88,8 +94,8 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLBareString (GSWHTMLBareStringB) //-------------------------------------------------------------------- -+(id)elementWithString:(NSString*)_string ++(id)elementWithString:(NSString*)aString { - return [[[GSWHTMLBareString alloc]initWithString:_string] autorelease]; + return [[[GSWHTMLBareString alloc]initWithString:aString] autorelease]; }; @end diff --git a/GSWeb.framework/GSWHTMLComment.h b/GSWeb.framework/GSWHTMLComment.h index d8f2a78..f14f5b5 100644 --- a/GSWeb.framework/GSWHTMLComment.h +++ b/GSWeb.framework/GSWHTMLComment.h @@ -1,11 +1,16 @@ -/* GSWHTMLComment.h - GSWeb: Class GSWHTMLComment - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLComment.h - GSWeb: Class GSWRequest + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -29,25 +35,25 @@ //==================================================================== @interface GSWHTMLComment: GSWElement { - NSString* string; - NSData* data; - NSStringEncoding encoding; + NSString* _string; + NSData* _data; + NSStringEncoding _encoding; }; --(id)initWithString:(NSString*)_string; +-(id)initWithString:(NSString*)aString; -(void)dealloc; -(NSString*)description; @end //==================================================================== @interface GSWHTMLComment (GSWHTMLCommentA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; @end //==================================================================== @interface GSWHTMLComment (GSWHTMLCommentB) -+(id)elementWithString:(NSString*)_string; ++(id)elementWithString:(NSString*)aString; @end #endif //_GSWHTMLComment_h__ diff --git a/GSWeb.framework/GSWHTMLComment.m b/GSWeb.framework/GSWHTMLComment.m index ab4b578..642754e 100644 --- a/GSWeb.framework/GSWHTMLComment.m +++ b/GSWeb.framework/GSWHTMLComment.m @@ -1,11 +1,16 @@ -/* GSWHTMLComment.m - GSWeb: Class GSWHTMLComment - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWHTMLComment.m - GSWeb: Class GSWRequest + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Sept 1999 + Written by: Manuel Guesdon + Date: Sept 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -32,27 +38,27 @@ static char rcsId[] = "$Id$"; -(id)init { if ((self=[super init])) - { - encoding=NSISOLatin1StringEncoding; - }; + { + _encoding=NSISOLatin1StringEncoding; + }; return self; }; //-------------------------------------------------------------------- --(id)initWithString:(NSString*)_string +-(id)initWithString:(NSString*)aString { if ((self=[self init])) - { - ASSIGN(string,_string); - }; + { + ASSIGN(_string,aString); + }; return self; }; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(string); - DESTROY(data); + DESTROY(_string); + DESTROY(_data); [super dealloc]; } @@ -60,9 +66,9 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%s %p - String:[%@]>", - object_get_class_name(self), - (void*)self, - string]; + object_get_class_name(self), + (void*)self, + _string]; }; @end @@ -71,15 +77,15 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLComment (GSWHTMLCommentA) //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]); - [response_ _appendContentAsciiString:@""]; - NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]); + NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[aContext elementID]); + [aResponse _appendContentAsciiString:@""]; + NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[aContext elementID]); LOGObjectFnStop(); }; @@ -89,8 +95,8 @@ static char rcsId[] = "$Id$"; @implementation GSWHTMLComment (GSWHTMLCommentB) //-------------------------------------------------------------------- -+(id)elementWithString:(NSString*)_string ++(id)elementWithString:(NSString*)aString { - return [[[GSWHTMLComment alloc]initWithString:_string] autorelease]; + return [[[GSWHTMLComment alloc]initWithString:aString] autorelease]; }; @end diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index 50ed06d..60db01f 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -148,6 +148,7 @@ static char rcsId[] = "$Id$"; removeFrom:tmpOtherAssociations]; if ([tmpPageSetVarAssociations count]>0) _pageSetVarAssociations=[tmpPageSetVarAssociations retain]; + NSDebugMLLog(@"gswdync",@"_pageSetVarAssociations=%@",_pageSetVarAssociations); _pageSetVarAssociationsDynamic=[[anAssociationsDict objectForKey:pageSetVars__Key withDefaultObject:[_pageSetVarAssociationsDynamic autorelease]] retain]; @@ -158,6 +159,7 @@ static char rcsId[] = "$Id$"; if ([tmpOtherAssociations count]>0) _otherAssociations=[[NSDictionary dictionaryWithDictionary:tmpOtherAssociations] retain]; + NSDebugMLLog(@"gswdync",@"_otherAssociations=%@",_otherAssociations); //TODO NSDictionary* otherQueryAssociations; if ((self=[super initWithName:aName diff --git a/GSWeb.framework/GSWJavaScript.h b/GSWeb.framework/GSWJavaScript.h index 37756b7..628d458 100644 --- a/GSWeb.framework/GSWJavaScript.h +++ b/GSWeb.framework/GSWJavaScript.h @@ -2,7 +2,7 @@ Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 $Revision$ diff --git a/GSWeb.framework/GSWJavaScript.m b/GSWeb.framework/GSWJavaScript.m index 6d49678..29dbdb5 100644 --- a/GSWeb.framework/GSWJavaScript.m +++ b/GSWeb.framework/GSWJavaScript.m @@ -2,7 +2,7 @@ Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 $Revision$ @@ -37,8 +37,23 @@ static char rcsId[] = "$Id$"; associations:(NSDictionary*)associations template:(GSWElement*)templateElement { - LOGObjectFnNotImplemented(); //TODOFN - return nil; + GSWAssociation* languageAssociation=nil; + NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations]; + LOGObjectFnStartC("GSWJavaScript"); + NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ templateElement=%@",aName,associations,templateElement); + if (![tmpAssociations objectForKey:language__Key]) + { + // Create and set the language (Javascript) + languageAssociation=[GSWConstantValueAssociation associationWithValue:@"JavaScript"]; + [tmpAssociations setObject:languageAssociation + forKey:language__Key]; + }; + if ((self=[super initWithName:aName + associations:tmpAssociations + template:templateElement])) + { + }; + return self; }; //-------------------------------------------------------------------- diff --git a/GSWeb.framework/GSWMailDelivery.h b/GSWeb.framework/GSWMailDelivery.h index 2ac6df5..68d0387 100644 --- a/GSWeb.framework/GSWMailDelivery.h +++ b/GSWeb.framework/GSWMailDelivery.h @@ -1,11 +1,16 @@ -/* GSWMailDelivery.h - GSWeb: Class GSWMailDelivery - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWMailDelivery.h - GSWeb: Class GSWMailDelivery + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Feb 1999 + Written by: Manuel Guesdon + Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -33,37 +39,39 @@ }; +(GSWMailDelivery*)sharedInstance; --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - subject:(NSString*)subject_ - plainText:(NSString*)plainTextMessage_ - send:(BOOL)sendNow_; --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - subject:(NSString*)subject_ - component:(GSWComponent*)component_ - send:(BOOL)sendNow_; +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + subject:(NSString*)subject + plainText:(NSString*)plainTextMessage + send:(BOOL)sendNow; + +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + subject:(NSString*)subject + component:(GSWComponent*)component + send:(BOOL)sendNow; //NDFN --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - bcc:(NSArray*)bcc_ - subject:(NSString*)subject_ - plainText:(NSString*)plainTextMessage_ - send:(BOOL)sendNow_; +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + bcc:(NSArray*)bcc + subject:(NSString*)subject + plainText:(NSString*)plainTextMessage + send:(BOOL)sendNow; //NDFN --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - bcc:(NSArray*)bcc_ - subject:(NSString*)subject_ - component:(GSWComponent*)component_ - send:(BOOL)sendNow_; --(void)sendEmail:(NSString*)emailString_; --(void)_invokeGSWSendMailAt:(id)at_ - withEmail:(id)email_; +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + bcc:(NSArray*)bcc + subject:(NSString*)subject + component:(GSWComponent*)component + send:(BOOL)sendNow; + +-(void)sendEmail:(NSString*)emailString; +-(void)_invokeGSWSendMailAt:(id)at + withEmail:(id)email; @end diff --git a/GSWeb.framework/GSWMailDelivery.m b/GSWeb.framework/GSWMailDelivery.m index 1406aa7..bf8c067 100644 --- a/GSWeb.framework/GSWMailDelivery.m +++ b/GSWeb.framework/GSWMailDelivery.m @@ -1,11 +1,16 @@ -/* GSWMailDelivery.m - GSWeb: Class GSWMailDelivery - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWMailDelivery.m - GSWeb: Class GSWMailDelivery + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Feb 1999 + Written by: Manuel Guesdon + Date: Feb 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -41,117 +47,117 @@ static GSWMailDelivery *sharedInstance; return sharedInstance; }; --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - subject:(NSString*)subject_ - plainText:(NSString*)plainTextMessage_ - send:(BOOL)sendNow_ +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + subject:(NSString*)subject + plainText:(NSString*)plainTextMessage + send:(BOOL)sendNow { - NSDebugMLog(@"sender_=%@",sender_); - NSDebugMLog(@"to_=%@",to_); - NSDebugMLog(@"cc_=%@",cc_); - NSDebugMLog(@"subject_=%@",subject_); - NSDebugMLog(@"plainTextMessage_=%@",plainTextMessage_); - NSDebugMLog(@"sendNow_=%d",(int)sendNow_); - return [self composeEmailFrom:sender_ - to:to_ - cc:cc_ - bcc:nil - subject:subject_ - plainText:plainTextMessage_ - send:sendNow_]; + NSDebugMLog(@"sender=%@",sender); + NSDebugMLog(@"to=%@",to); + NSDebugMLog(@"cc=%@",cc); + NSDebugMLog(@"subject=%@",subject); + NSDebugMLog(@"plainTextMessage=%@",plainTextMessage); + NSDebugMLog(@"sendNow=%d",(int)sendNow); + return [self composeEmailFrom:sender + to:to + cc:cc + bcc:nil + subject:subject + plainText:plainTextMessage + send:sendNow]; }; --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - subject:(NSString*)subject_ - component:(GSWComponent*)component_ - send:(BOOL)sendNow_ +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + subject:(NSString*)subject + component:(GSWComponent*)component + send:(BOOL)sendNow { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //NDFN --(NSString*)composeEmailFrom:(NSString*)sender_ - to:(NSArray*)to_ - cc:(NSArray*)cc_ - bcc:(NSArray*)bcc_ - subject:(NSString*)subject_ - plainText:(NSString*)plainTextMessage_ - send:(BOOL)sendNow_ +-(NSString*)composeEmailFrom:(NSString*)sender + to:(NSArray*)to + cc:(NSArray*)cc + bcc:(NSArray*)bcc + subject:(NSString*)subject + plainText:(NSString*)plainTextMessage + send:(BOOL)sendNow { - NSString* _msg=nil; - NSMutableString* _to=nil; + NSString* messageString=nil; + NSMutableString* toString=nil; int i=0; - int _count=0; + int count=0; - _count=[to_ count]; - NSDebugMLog(@"sender_=%@",sender_); - NSDebugMLog(@"to_=%@",to_); - NSDebugMLog(@"cc_=%@",cc_); - NSDebugMLog(@"bcc_=%@",bcc_); - NSDebugMLog(@"subject_=%@",subject_); - NSDebugMLog(@"plainTextMessage_=%@",plainTextMessage_); - NSDebugMLog(@"sendNow_=%d",(int)sendNow_); + count=[to count]; + NSDebugMLog(@"sender=%@",sender); + NSDebugMLog(@"to=%@",to); + NSDebugMLog(@"cc=%@",cc); + NSDebugMLog(@"bcc=%@",bcc); + NSDebugMLog(@"subject=%@",subject); + NSDebugMLog(@"plainTextMessage=%@",plainTextMessage); + NSDebugMLog(@"sendNow=%d",(int)sendNow); - for(i=0;i<_count;i++) - { - if (!_to) - _to=(NSMutableString*)[NSMutableString stringWithFormat:@"%@",[to_ objectAtIndex:i]]; - else - [_to appendFormat:@", %@",[to_ objectAtIndex:i]]; - }; - NSDebugMLog(@"_to=%@",_to); - _msg=[NSString stringWithFormat:@"From: %@\nTo: %@\n",sender_,_to]; - NSDebugMLog(@"_msg=%@",_msg); - _count=[cc_ count]; - if (_count) - { - NSMutableString* _cc=nil; - for(i=0;i<_count;i++) - { - if (!_cc) - _cc=(NSMutableString*)[NSMutableString stringWithFormat:@"%@",[cc_ objectAtIndex:i]]; - else - [_cc appendFormat:@", %@",[cc_ objectAtIndex:i]]; - }; - NSDebugMLog(@"_cc=%@",_cc); - _msg=[_msg stringByAppendingFormat:@"Cc: %@\n",_cc]; - NSDebugMLog(@"_msg=%@",_msg); - }; - _count=[bcc_ count]; - if (_count) - { - NSMutableString* _bcc=nil; - for(i=0;i<_count;i++) - { - if (!_bcc) - _bcc=(NSMutableString*)[NSMutableString stringWithFormat:@"%@",[bcc_ objectAtIndex:i]]; - else - [_bcc appendFormat:@", %@",[bcc_ objectAtIndex:i]]; - }; - NSDebugMLog(@"_bcc=%@",_bcc); - _msg=[_msg stringByAppendingFormat:@"Bcc: %@\n",_bcc]; - NSDebugMLog(@"_msg=%@",_msg); - }; - _msg=[_msg stringByAppendingFormat:@"Subject: %@\n\n%@",subject_,plainTextMessage_]; - NSDebugMLog(@"_msg=%@",_msg); - if (sendNow_) - [self sendEmail:_msg]; - return _msg; + for(i=0;iGSWeb: Class GSWNestedList + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -30,42 +36,42 @@ //==================================================================== @interface GSWNestedList: GSWDynamicElement { - GSWAssociation* list; - GSWAssociation* item; - GSWAssociation* displayString; - GSWAssociation* sublist; - GSWAssociation* action; - GSWAssociation* selection; - GSWAssociation* index; - GSWAssociation* level; - GSWAssociation* isOrdered; - GSWAssociation* prefix; - GSWAssociation* suffix; - BOOL defaultEscapeHTML; + GSWAssociation* _list; + GSWAssociation* _item; + GSWAssociation* _displayString; + GSWAssociation* _sublist; + GSWAssociation* _action; + GSWAssociation* _selection; + GSWAssociation* _index; + GSWAssociation* _level; + GSWAssociation* _isOrdered; + GSWAssociation* _prefix; + GSWAssociation* _suffix; + BOOL _defaultEscapeHTML; }; -(void)dealloc; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; --(void)_appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ - orderedList:(id)orderedList_ - level:(int)level_; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; +-(void)_appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext + orderedList:(id)orderedList + level:(int)level; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(id)objectAtIndexPath:(id)indexPath_ - inList:(id)list_ - inComponent:(id)component_; --(id)_objectAtIndexPath:(id)indexPath_ - inList:(id)list_ - currentIndex:(unsigned int)index_ - inComponent:(id)component_; +-(id)objectAtIndexPath:(id)indexPath + inList:(id)list + inComponent:(id)component; +-(id)_objectAtIndexPath:(id)indexPath + inList:(id)list + currentIndex:(unsigned int)index + inComponent:(id)component; @end #endif //_GSWNestedList_h__ diff --git a/GSWeb.framework/GSWNestedList.m b/GSWeb.framework/GSWNestedList.m index 084878d..1e2758b 100644 --- a/GSWeb.framework/GSWNestedList.m +++ b/GSWeb.framework/GSWNestedList.m @@ -1,11 +1,16 @@ -/* GSWNestedList.m - GSWeb: Class GSWNestedList - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWNestedList.m - GSWeb: Class GSWNestedList + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -35,9 +41,9 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement { LOGObjectFnNotImplemented(); //TODOFN return nil; @@ -45,24 +51,24 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ - orderedList:(id)orderedList_ - level:(int)level_ +-(void)_appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext + orderedList:(id)orderedList + level:(int)level { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN return nil; @@ -70,19 +76,19 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- --(id)objectAtIndexPath:(id)indexPath_ - inList:(id)list_ - inComponent:(id)component_ +-(id)objectAtIndexPath:(id)indexPath + inList:(id)list + inComponent:(id)component { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(id)_objectAtIndexPath:(id)indexPath_ - inList:(id)list_ - currentIndex:(unsigned int)index_ - inComponent:(id)component_ +-(id)_objectAtIndexPath:(id)indexPath + inList:(id)list + currentIndex:(unsigned int)index + inComponent:(id)component { LOGObjectFnNotImplemented(); //TODOFN return nil; diff --git a/GSWeb.framework/GSWPageDefLexer.h b/GSWeb.framework/GSWPageDefLexer.h index 701a3a2..475cb35 100644 --- a/GSWeb.framework/GSWPageDefLexer.h +++ b/GSWeb.framework/GSWPageDefLexer.h @@ -7,7 +7,7 @@ * Terence Parr, MageLang Institute * with John Lilley, Empathy Software * and Manuel Guesdon, Software Builders - * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000 + * ANTLR Version 2.5.0; 1996,1997,1998,1999 */ @@ -19,7 +19,6 @@ #include "gsantlr/ANTLRCharBuffer.h" #include "gsantlr/ANTLRBitSet.h" #include "gsantlr/ANTLRCharScanner.h" - @interface GSWPageDefLexer : ANTLRCharScanner { }; @@ -37,6 +36,8 @@ /*public: */-(void) mPIDENTWithCreateToken:(BOOL)_createToken ; /*public: */-(void) mPOINTWithCreateToken:(BOOL)_createToken ; /*public: */-(void) mSTRINGWithCreateToken:(BOOL)_createToken ; + /*public: */-(void) mIDENTREFWithCreateToken:(BOOL)_createToken ; + /*public: */-(void) mPIDENTREFWithCreateToken:(BOOL)_createToken ; /*public: */-(void) mYESWithCreateToken:(BOOL)_createToken ; /*public: */-(void) mNOWithCreateToken:(BOOL)_createToken ; /*public: */-(void) mLCURLYWithCreateToken:(BOOL)_createToken ; @@ -71,5 +72,9 @@ extern CONST unsigned long GSWPageDefLexer___tokenSet_5_data_[]; extern ANTLRBitSet* GSWPageDefLexer___tokenSet_5; extern CONST unsigned long GSWPageDefLexer___tokenSet_6_data_[]; extern ANTLRBitSet* GSWPageDefLexer___tokenSet_6; +extern CONST unsigned long GSWPageDefLexer___tokenSet_7_data_[]; +extern ANTLRBitSet* GSWPageDefLexer___tokenSet_7; +extern CONST unsigned long GSWPageDefLexer___tokenSet_8_data_[]; +extern ANTLRBitSet* GSWPageDefLexer___tokenSet_8; #endif /*INC_GSWPageDefLexer_h_*/ diff --git a/GSWeb.framework/GSWPageDefLexer.m b/GSWeb.framework/GSWPageDefLexer.m index 6fdc0a7..dae05d3 100644 --- a/GSWeb.framework/GSWPageDefLexer.m +++ b/GSWeb.framework/GSWPageDefLexer.m @@ -4,17 +4,16 @@ * Terence Parr, MageLang Institute * with John Lilley, Empathy Software * and Manuel Guesdon, Software Builders - * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000 + * ANTLR Version 2.5.0; 1996,1997,1998,1999 */ #include - #include "gsantlr/ANTLRCommon.h" #include "gsantlr/ANTLRException.h" #include "GSWPageDefLexer.h" -#include "GSWPageDefTokenTypes.h" +#include "GSWPageDefParserTokenTypes.h" @implementation GSWPageDefLexer @@ -50,12 +49,12 @@ -(ANTLRDefToken) nextToken { - ANTLRDefToken theRetToken=nil; + ANTLRDefToken _rettoken=nil; BOOL end=NO; //LOGObjectFnStart(); for (;!end;) { - ANTLRDefToken theRetToken; + ANTLRDefToken _rettoken; ANTLRTokenType _ttype = ANTLRToken_INVALID_TYPE; [self resetText]; NS_DURING // for error handling @@ -65,55 +64,55 @@ case ((unichar)('"')): case ((unichar)('\'')): { [self mSTRINGWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('{')): { [self mLCURLYWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('}')): { [self mRCURLYWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)(';')): { [self mSEMIWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('^')): { [self mCIRCWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('~')): { [self mTILDEWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)(':')): { [self mCOLUMNWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('=')): { [self mASSIGNWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('\t')): case ((unichar)('\n')): case ((unichar)('\r')): case ((unichar)(' ')): { [self mWSWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } case ((unichar)('0')): case ((unichar)('1')): case ((unichar)('2')): case ((unichar)('3')): @@ -121,54 +120,64 @@ case ((unichar)('8')): case ((unichar)('9')): { [self mINTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; break; } default: if (([self LA:1]==((unichar)('Y'))) && ([self LA:2]==((unichar)('E'))) && ([self LA:3]==((unichar)('S')))) { [self mYESWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('/'))) && ([self LA:2]==((unichar)('/')))) { [self mSL_COMMENTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('/'))) && ([self LA:2]==((unichar)('*')))) { [self mML_COMMENTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('#'))) && ([self LA:2]==((unichar)('i')))) { [self mINCLUDEWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('.'))) && ([GSWPageDefLexer___tokenSet_0 isMember:[self LA:2]])) { [self mPIDENTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; + } + else if (([self LA:1]==((unichar)('.'))) && ([GSWPageDefLexer___tokenSet_1 isMember:[self LA:2]])) + { + [self mPIDENTREFWithCreateToken:YES]; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('N'))) && ([self LA:2]==((unichar)('O')))) { [self mNOWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } - else if (([self LA:1]==((unichar)('#'))) && ([GSWPageDefLexer___tokenSet_1 isMember:[self LA:2]])) + else if (([self LA:1]==((unichar)('#'))) && ([GSWPageDefLexer___tokenSet_2 isMember:[self LA:2]])) { [self mHEXNUMWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } - else if (([GSWPageDefLexer___tokenSet_2 isMember:[self LA:1]])) + else if (([GSWPageDefLexer___tokenSet_3 isMember:[self LA:1]])) { [self mIDENTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; } else if (([self LA:1]==((unichar)('.')))) { [self mPOINTWithCreateToken:YES]; - theRetToken=_returnToken; + _rettoken=_returnToken; + } + else if (([GSWPageDefLexer___tokenSet_4 isMember:[self LA:1]])) + { + [self mIDENTREFWithCreateToken:YES]; + _rettoken=_returnToken; } else { @@ -199,7 +208,7 @@ { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_SL_COMMENT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_SL_COMMENT; int _saveIndex; //LOGObjectFnStart(); @@ -207,10 +216,10 @@ int _begin=[text length]; { do { - if (([GSWPageDefLexer___tokenSet_3 isMember:[self LA:1]])) + if (([GSWPageDefLexer___tokenSet_5 isMember:[self LA:1]])) { { - [self matchCharSet:GSWPageDefLexer___tokenSet_3]; + [self matchCharSet:GSWPageDefLexer___tokenSet_5]; } } else @@ -264,7 +273,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_ML_COMMENT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_ML_COMMENT; int _saveIndex; //LOGObjectFnStart(); @@ -345,7 +354,7 @@ int _begin=[text length]; case ((unichar)(0xfe)): case ((unichar)(0xff)): { { - [self matchCharSet:GSWPageDefLexer___tokenSet_4]; + [self matchCharSet:GSWPageDefLexer___tokenSet_6]; } break; } @@ -388,7 +397,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_INCLUDE; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_INCLUDE; int _saveIndex; //LOGObjectFnStart(); @@ -406,7 +415,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_IDENT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_IDENT; int _saveIndex; //LOGObjectFnStart(); @@ -497,7 +506,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_LETTER; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_LETTER; int _saveIndex; //LOGObjectFnStart(); @@ -543,7 +552,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_DIGIT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_DIGIT; int _saveIndex; //LOGObjectFnStart(); @@ -561,7 +570,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_PIDENT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_PIDENT; int _saveIndex; //LOGObjectFnStart(); @@ -612,7 +621,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_POINT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_POINT; int _saveIndex; //LOGObjectFnStart(); @@ -630,7 +639,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_STRING; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_STRING; int _saveIndex; //LOGObjectFnStart(); @@ -714,17 +723,17 @@ int _begin=[text length]; case ((unichar)(0xfd)): case ((unichar)(0xfe)): case ((unichar)(0xff)): { { - [self matchCharSet:GSWPageDefLexer___tokenSet_5]; + [self matchCharSet:GSWPageDefLexer___tokenSet_7]; } break; } default: { - goto _loop60; + goto _loop66; } } } while (YES); - _loop60:; + _loop66:; } [self matchCharacter:'\'']; break; @@ -807,17 +816,17 @@ int _begin=[text length]; case ((unichar)(0xfd)): case ((unichar)(0xfe)): case ((unichar)(0xff)): { { - [self matchCharSet:GSWPageDefLexer___tokenSet_6]; + [self matchCharSet:GSWPageDefLexer___tokenSet_8]; } break; } default: { - goto _loop63; + goto _loop69; } } } while (YES); - _loop63:; + _loop69:; } [self matchCharacter:'"']; break; @@ -836,11 +845,158 @@ int _begin=[text length]; //LOGObjectFnStop(); } +-(void) mIDENTREFWithCreateToken:(BOOL)_createToken +{ + ANTLRDefToken _token=nil; +int _begin=[text length]; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_IDENTREF; + int _saveIndex; + + //LOGObjectFnStart(); + { + switch ( [self LA:1]) + { + case ((unichar)('A')): case ((unichar)('B')): case ((unichar)('C')): case ((unichar)('D')): + case ((unichar)('E')): case ((unichar)('F')): case ((unichar)('G')): case ((unichar)('H')): + case ((unichar)('I')): case ((unichar)('J')): case ((unichar)('K')): case ((unichar)('L')): + case ((unichar)('M')): case ((unichar)('N')): case ((unichar)('O')): case ((unichar)('P')): + case ((unichar)('Q')): case ((unichar)('R')): case ((unichar)('S')): case ((unichar)('T')): + case ((unichar)('U')): case ((unichar)('V')): case ((unichar)('W')): case ((unichar)('X')): + case ((unichar)('Y')): case ((unichar)('Z')): case ((unichar)('a')): case ((unichar)('b')): + case ((unichar)('c')): case ((unichar)('d')): case ((unichar)('e')): case ((unichar)('f')): + case ((unichar)('g')): case ((unichar)('h')): case ((unichar)('i')): case ((unichar)('j')): + case ((unichar)('k')): case ((unichar)('l')): case ((unichar)('m')): case ((unichar)('n')): + case ((unichar)('o')): case ((unichar)('p')): case ((unichar)('q')): case ((unichar)('r')): + case ((unichar)('s')): case ((unichar)('t')): case ((unichar)('u')): case ((unichar)('v')): + case ((unichar)('w')): case ((unichar)('x')): case ((unichar)('y')): case ((unichar)('z')): + { + [self mLETTERWithCreateToken:NO]; + break; + } + case ((unichar)('_')): + { + [self matchCharacter:'_']; + break; + } + case ((unichar)('@')): + { + [self matchCharacter:'@']; + break; + } + default: + { + [ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]]; + } + } + } + { + do + { + switch ( [self LA:1]) + { + case ((unichar)('A')): case ((unichar)('B')): case ((unichar)('C')): case ((unichar)('D')): + case ((unichar)('E')): case ((unichar)('F')): case ((unichar)('G')): case ((unichar)('H')): + case ((unichar)('I')): case ((unichar)('J')): case ((unichar)('K')): case ((unichar)('L')): + case ((unichar)('M')): case ((unichar)('N')): case ((unichar)('O')): case ((unichar)('P')): + case ((unichar)('Q')): case ((unichar)('R')): case ((unichar)('S')): case ((unichar)('T')): + case ((unichar)('U')): case ((unichar)('V')): case ((unichar)('W')): case ((unichar)('X')): + case ((unichar)('Y')): case ((unichar)('Z')): case ((unichar)('a')): case ((unichar)('b')): + case ((unichar)('c')): case ((unichar)('d')): case ((unichar)('e')): case ((unichar)('f')): + case ((unichar)('g')): case ((unichar)('h')): case ((unichar)('i')): case ((unichar)('j')): + case ((unichar)('k')): case ((unichar)('l')): case ((unichar)('m')): case ((unichar)('n')): + case ((unichar)('o')): case ((unichar)('p')): case ((unichar)('q')): case ((unichar)('r')): + case ((unichar)('s')): case ((unichar)('t')): case ((unichar)('u')): case ((unichar)('v')): + case ((unichar)('w')): case ((unichar)('x')): case ((unichar)('y')): case ((unichar)('z')): + { + [self mLETTERWithCreateToken:NO]; + break; + } + case ((unichar)('_')): + { + [self matchCharacter:'_']; + break; + } + case ((unichar)('0')): case ((unichar)('1')): case ((unichar)('2')): case ((unichar)('3')): + case ((unichar)('4')): case ((unichar)('5')): case ((unichar)('6')): case ((unichar)('7')): + case ((unichar)('8')): case ((unichar)('9')): + { + [self mDIGITWithCreateToken:NO]; + break; + } + default: + { + goto _loop49; + } + } + } while (YES); + _loop49:; + } + _ttype = [self testLiteralsTable:_ttype]; + if ( _createToken && _token==0 ) + { + _token = [self makeToken:_ttype]; + [_token setText:[text substringFromIndex:_begin]]; + } + ASSIGN(_returnToken,_token); + //LOGObjectFnStop(); +} + +-(void) mPIDENTREFWithCreateToken:(BOOL)_createToken +{ + ANTLRDefToken _token=nil; +int _begin=[text length]; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_PIDENTREF; + int _saveIndex; + + //LOGObjectFnStart(); + [self mPOINTWithCreateToken:NO]; + { + switch ( [self LA:1]) + { + case ((unichar)('@')): case ((unichar)('A')): case ((unichar)('B')): case ((unichar)('C')): + case ((unichar)('D')): case ((unichar)('E')): case ((unichar)('F')): case ((unichar)('G')): + case ((unichar)('H')): case ((unichar)('I')): case ((unichar)('J')): case ((unichar)('K')): + case ((unichar)('L')): case ((unichar)('M')): case ((unichar)('N')): case ((unichar)('O')): + case ((unichar)('P')): case ((unichar)('Q')): case ((unichar)('R')): case ((unichar)('S')): + case ((unichar)('T')): case ((unichar)('U')): case ((unichar)('V')): case ((unichar)('W')): + case ((unichar)('X')): case ((unichar)('Y')): case ((unichar)('Z')): case ((unichar)('_')): + case ((unichar)('a')): case ((unichar)('b')): case ((unichar)('c')): case ((unichar)('d')): + case ((unichar)('e')): case ((unichar)('f')): case ((unichar)('g')): case ((unichar)('h')): + case ((unichar)('i')): case ((unichar)('j')): case ((unichar)('k')): case ((unichar)('l')): + case ((unichar)('m')): case ((unichar)('n')): case ((unichar)('o')): case ((unichar)('p')): + case ((unichar)('q')): case ((unichar)('r')): case ((unichar)('s')): case ((unichar)('t')): + case ((unichar)('u')): case ((unichar)('v')): case ((unichar)('w')): case ((unichar)('x')): + case ((unichar)('y')): case ((unichar)('z')): + { + [self mIDENTREFWithCreateToken:NO]; + break; + } + case ((unichar)('"')): case ((unichar)('\'')): + { + [self mSTRINGWithCreateToken:NO]; + break; + } + default: + { + [ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]]; + } + } + } + _ttype = [self testLiteralsTable:_ttype]; + if ( _createToken && _token==0 ) + { + _token = [self makeToken:_ttype]; + [_token setText:[text substringFromIndex:_begin]]; + } + ASSIGN(_returnToken,_token); + //LOGObjectFnStop(); +} + -(void) mYESWithCreateToken:(BOOL)_createToken { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_YES; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_YES; int _saveIndex; //LOGObjectFnStart(); @@ -859,7 +1015,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_NO; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_NO; int _saveIndex; //LOGObjectFnStart(); @@ -878,7 +1034,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_LCURLY; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_LCURLY; int _saveIndex; //LOGObjectFnStart(); @@ -896,7 +1052,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_RCURLY; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_RCURLY; int _saveIndex; //LOGObjectFnStart(); @@ -914,7 +1070,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_SEMI; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_SEMI; int _saveIndex; //LOGObjectFnStart(); @@ -932,7 +1088,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_CIRC; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_CIRC; int _saveIndex; //LOGObjectFnStart(); @@ -950,7 +1106,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_TILDE; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_TILDE; int _saveIndex; //LOGObjectFnStart(); @@ -968,7 +1124,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_COLUMN; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_COLUMN; int _saveIndex; //LOGObjectFnStart(); @@ -986,7 +1142,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_ASSIGN; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_ASSIGN; int _saveIndex; //LOGObjectFnStart(); @@ -1004,7 +1160,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_WS; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_WS; int _saveIndex; //LOGObjectFnStart(); @@ -1058,7 +1214,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_ESC; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_ESC; int _saveIndex; //LOGObjectFnStart(); @@ -1109,7 +1265,7 @@ int _begin=[text length]; case ((unichar)('u')): { { - int _cnt72=0; + int _cnt78=0; do { if (([self LA:1]==((unichar)('u')))) @@ -1118,12 +1274,12 @@ int _begin=[text length]; } else { - if ( _cnt72>=1 ) { goto _loop72; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} + if ( _cnt78>=1 ) { goto _loop78; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} } - _cnt72++; + _cnt78++; } while (YES); - _loop72:; + _loop78:; } [self mHEXDIGITWithCreateToken:NO]; [self mHEXDIGITWithCreateToken:NO]; @@ -1210,12 +1366,12 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_INT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_INT; int _saveIndex; //LOGObjectFnStart(); { - int _cnt67=0; + int _cnt73=0; do { if ((([self LA:1] >= ((unichar)('0')) && [self LA:1] <= ((unichar)('9'))))) @@ -1224,12 +1380,12 @@ int _begin=[text length]; } else { - if ( _cnt67>=1 ) { goto _loop67; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} + if ( _cnt73>=1 ) { goto _loop73; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} } - _cnt67++; + _cnt73++; } while (YES); - _loop67:; + _loop73:; } if ( _createToken && _token==0 ) { @@ -1244,7 +1400,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_HEXNUM; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_HEXNUM; int _saveIndex; //LOGObjectFnStart(); @@ -1263,26 +1419,26 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_HEXINT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_HEXINT; int _saveIndex; //LOGObjectFnStart(); { - int _cnt82=0; + int _cnt88=0; do { - if (([GSWPageDefLexer___tokenSet_1 isMember:[self LA:1]])) + if (([GSWPageDefLexer___tokenSet_2 isMember:[self LA:1]])) { [self mHEXDIGITWithCreateToken:NO]; } else { - if ( _cnt82>=1 ) { goto _loop82; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} + if ( _cnt88>=1 ) { goto _loop88; } else {[ANTLRScannerException raiseWithReason:[NSString stringWithFormat:@"no viable alt for char: %@",[ANTLRCharScanner charName:[self LA:1]]] line:[self line]];} } - _cnt82++; + _cnt88++; } while (YES); - _loop82:; + _loop88:; } if ( _createToken && _token==0 ) { @@ -1297,7 +1453,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_HEXDIGIT; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_HEXDIGIT; int _saveIndex; //LOGObjectFnStart(); @@ -1342,7 +1498,7 @@ int _begin=[text length]; { ANTLRDefToken _token=nil; int _begin=[text length]; - ANTLRTokenType _ttype = GSWPageDefTokenType_LCLETTER; + ANTLRTokenType _ttype = GSWPageDefParserTokenType_LCLETTER; int _saveIndex; //LOGObjectFnStart(); @@ -1359,18 +1515,22 @@ int _begin=[text length]; CONST unsigned long GSWPageDefLexer___tokenSet_0_data_[] = { 0UL, 132UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_0=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_1_data_[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_1_data_[] = { 0UL, 132UL, 2281701375UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_1=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_2_data_[] = { 0UL, 0UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_2_data_[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_2=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_3_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_3_data_[] = { 0UL, 0UL, 2281701374UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_3=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_4_data_[] = { 4294958072UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_4_data_[] = { 0UL, 0UL, 2281701375UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_4=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_5_data_[] = { 4294967288UL, 4294967167UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_5_data_[] = { 4294958072UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_5=nil; -CONST unsigned long GSWPageDefLexer___tokenSet_6_data_[] = { 4294967288UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +CONST unsigned long GSWPageDefLexer___tokenSet_6_data_[] = { 4294958072UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; static ANTLRBitSet* GSWPageDefLexer___tokenSet_6=nil; +CONST unsigned long GSWPageDefLexer___tokenSet_7_data_[] = { 4294967288UL, 4294967167UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +static ANTLRBitSet* GSWPageDefLexer___tokenSet_7=nil; +CONST unsigned long GSWPageDefLexer___tokenSet_8_data_[] = { 4294967288UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL }; +static ANTLRBitSet* GSWPageDefLexer___tokenSet_8=nil; +(void)initialize { if (!GSWPageDefLexer___tokenSet_0) @@ -1380,13 +1540,17 @@ static ANTLRBitSet* GSWPageDefLexer___tokenSet_6=nil; if (!GSWPageDefLexer___tokenSet_2) GSWPageDefLexer___tokenSet_2=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_2_data_ length:20] retain]; if (!GSWPageDefLexer___tokenSet_3) - GSWPageDefLexer___tokenSet_3=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_3_data_ length:32] retain]; + GSWPageDefLexer___tokenSet_3=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_3_data_ length:20] retain]; if (!GSWPageDefLexer___tokenSet_4) - GSWPageDefLexer___tokenSet_4=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_4_data_ length:32] retain]; + GSWPageDefLexer___tokenSet_4=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_4_data_ length:20] retain]; if (!GSWPageDefLexer___tokenSet_5) GSWPageDefLexer___tokenSet_5=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_5_data_ length:32] retain]; if (!GSWPageDefLexer___tokenSet_6) GSWPageDefLexer___tokenSet_6=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_6_data_ length:32] retain]; + if (!GSWPageDefLexer___tokenSet_7) + GSWPageDefLexer___tokenSet_7=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_7_data_ length:32] retain]; + if (!GSWPageDefLexer___tokenSet_8) + GSWPageDefLexer___tokenSet_8=[[ANTLRBitSet bitSetWithULongBits:GSWPageDefLexer___tokenSet_8_data_ length:32] retain]; } +(void)dealloc { @@ -1397,6 +1561,8 @@ static ANTLRBitSet* GSWPageDefLexer___tokenSet_6=nil; DESTROY(GSWPageDefLexer___tokenSet_4); DESTROY(GSWPageDefLexer___tokenSet_5); DESTROY(GSWPageDefLexer___tokenSet_6); + DESTROY(GSWPageDefLexer___tokenSet_7); + DESTROY(GSWPageDefLexer___tokenSet_8); [[self superclass] dealloc]; } @end diff --git a/GSWeb.framework/GSWPageDefParser.h b/GSWeb.framework/GSWPageDefParser.h index 350faaf..8304f5b 100644 --- a/GSWeb.framework/GSWPageDefParser.h +++ b/GSWeb.framework/GSWPageDefParser.h @@ -7,7 +7,7 @@ * Terence Parr, MageLang Institute * with John Lilley, Empathy Software * and Manuel Guesdon, Software Builders - * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000 + * ANTLR Version 2.5.0; 1996,1997,1998,1999 */ diff --git a/GSWeb.framework/GSWPageDefParser.m b/GSWeb.framework/GSWPageDefParser.m index defadae..9007e8f 100644 --- a/GSWeb.framework/GSWPageDefParser.m +++ b/GSWeb.framework/GSWPageDefParser.m @@ -4,16 +4,15 @@ * Terence Parr, MageLang Institute * with John Lilley, Empathy Software * and Manuel Guesdon, Software Builders - * ANTLR Version 2.7.1; 1996,1997,1998,1999,2000 + * ANTLR Version 2.5.0; 1996,1997,1998,1999 */ #include - #include "gsantlr/ANTLRCommon.h" #include "GSWPageDefParser.h" -#include "GSWPageDefTokenTypes.h" +#include "GSWPageDefParserTokenTypes.h" #include "gsantlr/ANTLRNoViableAltException.h" #include "gsantlr/ANTLRBitSet.h" #include "gsantlr/ANTLRAST.h" @@ -79,7 +78,7 @@ { switch ( [self LA:1]) { - case GSWPageDefTokenType_IDENT: + case GSWPageDefParserTokenType_IDENT: { { [self object]; @@ -88,7 +87,7 @@ } break; } - case GSWPageDefTokenType_INCLUDE: + case GSWPageDefParserTokenType_INCLUDE: { { [self include]; @@ -135,14 +134,14 @@ objectId_AST = [astFactory create:objectId]; [astFactory makeASTRoot:objectId_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_IDENT]; + [self matchTokenType:GSWPageDefParserTokenType_IDENT]; currentElement=[[GSWPageDefElement new] autorelease]; [currentElement setElementName:[objectId_AST text]]; { ANTLRDefAST tmp1_AST = ANTLRnullAST; tmp1_AST = [astFactory create:[self LT:1]]; [astFactory makeASTRoot:tmp1_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_COLUMN]; + [self matchTokenType:GSWPageDefParserTokenType_COLUMN]; { [self definition]; [astFactory addASTChild:returnAST in:currentAST]; @@ -178,18 +177,18 @@ tmp2_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp2_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_INCLUDE]; + [self matchTokenType:GSWPageDefParserTokenType_INCLUDE]; { do { - if (([self LA:1]==GSWPageDefTokenType_WS)) + if (([self LA:1]==GSWPageDefParserTokenType_WS)) { { ANTLRDefAST tmp3_AST = ANTLRnullAST; tmp3_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp3_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_WS]; + [self matchTokenType:GSWPageDefParserTokenType_WS]; } else { @@ -205,7 +204,7 @@ includeObj_AST = [astFactory create:includeObj]; [astFactory addASTChild:includeObj_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_STRING]; + [self matchTokenType:GSWPageDefParserTokenType_STRING]; [includes addObject:[self unescapedString:[[[includeObj text] stringWithoutPrefix:@"\""] stringWithoutSuffix:@"\""]]]; include_AST = [currentAST root]; } @@ -239,11 +238,11 @@ tmp4_AST = [astFactory create:[self LT:1]]; [astFactory makeASTRoot:tmp4_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_LCURLY]; + [self matchTokenType:GSWPageDefParserTokenType_LCURLY]; { do { - if (([self LA:1]==GSWPageDefTokenType_IDENT)) + if (([self LA:1]==GSWPageDefParserTokenType_IDENT)) { [self member]; [astFactory addASTChild:returnAST in:currentAST]; @@ -261,23 +260,23 @@ ANTLRDefAST tmp5_AST = ANTLRnullAST; tmp5_AST = [astFactory create:[self LT:1]]; } - [self matchTokenType:GSWPageDefTokenType_RCURLY]; + [self matchTokenType:GSWPageDefParserTokenType_RCURLY]; { switch ( [self LA:1]) { - case GSWPageDefTokenType_SEMI: + case GSWPageDefParserTokenType_SEMI: { { ANTLRDefAST tmp6_AST = ANTLRnullAST; tmp6_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp6_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_SEMI]; + [self matchTokenType:GSWPageDefParserTokenType_SEMI]; break; } case ANTLRToken_EOF_TYPE: - case GSWPageDefTokenType_INCLUDE: - case GSWPageDefTokenType_IDENT: + case GSWPageDefParserTokenType_INCLUDE: + case GSWPageDefParserTokenType_IDENT: { break; } @@ -317,7 +316,7 @@ objectClass_AST = [astFactory create:objectClass]; [astFactory addASTChild:objectClass_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_IDENT]; + [self matchTokenType:GSWPageDefParserTokenType_IDENT]; [currentElement setClassName:[objectClass text]]; classname_AST = [currentAST root]; } @@ -349,14 +348,14 @@ memberName_AST = [astFactory create:memberName]; [astFactory makeASTRoot:memberName_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_IDENT]; + [self matchTokenType:GSWPageDefParserTokenType_IDENT]; ASSIGN(currentMemberName,[memberName text]); { ANTLRDefAST tmp7_AST = ANTLRnullAST; tmp7_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp7_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_ASSIGN]; + [self matchTokenType:GSWPageDefParserTokenType_ASSIGN]; { [self mvalue]; [astFactory addASTChild:returnAST in:currentAST]; @@ -364,14 +363,14 @@ { do { - if (([self LA:1]==GSWPageDefTokenType_SEMI)) + if (([self LA:1]==GSWPageDefParserTokenType_SEMI)) { { ANTLRDefAST tmp8_AST = ANTLRnullAST; tmp8_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp8_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_SEMI]; + [self matchTokenType:GSWPageDefParserTokenType_SEMI]; } else { @@ -414,9 +413,10 @@ { switch ( [self LA:1]) { - case GSWPageDefTokenType_IDENT: - case GSWPageDefTokenType_CIRC: - case GSWPageDefTokenType_TILDE: + case GSWPageDefParserTokenType_IDENT: + case GSWPageDefParserTokenType_CIRC: + case GSWPageDefParserTokenType_TILDE: + case GSWPageDefParserTokenType_IDENTREF: { [self idref]; assocKeyPath_AST = returnAST; @@ -425,62 +425,62 @@ ASSIGN(currentAssociation,assoc); }; break; } - case GSWPageDefTokenType_INT: + case GSWPageDefParserTokenType_INT: { assocConstantInt = [self LT:1]; { assocConstantInt_AST = [astFactory create:assocConstantInt]; [astFactory addASTChild:assocConstantInt_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_INT]; + [self matchTokenType:GSWPageDefParserTokenType_INT]; { GSWAssociation* assoc=[GSWAssociation associationWithValue:[NSNumber valueFromString:[assocConstantInt text]]]; ASSIGN(currentAssociation,assoc); }; break; } - case GSWPageDefTokenType_YES: + case GSWPageDefParserTokenType_YES: { { ANTLRDefAST tmp9_AST = ANTLRnullAST; tmp9_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp9_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_YES]; + [self matchTokenType:GSWPageDefParserTokenType_YES]; { GSWAssociation* assoc=[GSWAssociation associationWithValue:[NSNumber numberWithBool:YES]]; ASSIGN(currentAssociation,assoc); }; break; } - case GSWPageDefTokenType_NO: + case GSWPageDefParserTokenType_NO: { { ANTLRDefAST tmp10_AST = ANTLRnullAST; tmp10_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp10_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_NO]; + [self matchTokenType:GSWPageDefParserTokenType_NO]; { GSWAssociation* assoc=[GSWAssociation associationWithValue:[NSNumber numberWithBool:NO]]; ASSIGN(currentAssociation,assoc); }; break; } - case GSWPageDefTokenType_STRING: + case GSWPageDefParserTokenType_STRING: { assocConstantString = [self LT:1]; { assocConstantString_AST = [astFactory create:assocConstantString]; [astFactory addASTChild:assocConstantString_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_STRING]; + [self matchTokenType:GSWPageDefParserTokenType_STRING]; { GSWAssociation* assoc=[GSWAssociation associationWithValue:[self unescapedString:[[[assocConstantString text] stringWithoutPrefix:@"\""] stringWithoutSuffix:@"\""]]]; ASSIGN(currentAssociation,assoc); }; break; } - case GSWPageDefTokenType_HEXNUM: + case GSWPageDefParserTokenType_HEXNUM: { assocConstantHexNum = [self LT:1]; { assocConstantHexNum_AST = [astFactory create:assocConstantHexNum]; [astFactory addASTChild:assocConstantHexNum_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_HEXNUM]; + [self matchTokenType:GSWPageDefParserTokenType_HEXNUM]; { GSWAssociation* assoc=[GSWAssociation associationWithValue:[NSNumber valueFromString:[assocConstantHexNum text]]]; ASSIGN(currentAssociation,assoc); }; break; @@ -517,27 +517,28 @@ { switch ( [self LA:1]) { - case GSWPageDefTokenType_CIRC: + case GSWPageDefParserTokenType_CIRC: { { ANTLRDefAST tmp11_AST = ANTLRnullAST; tmp11_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp11_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_CIRC]; + [self matchTokenType:GSWPageDefParserTokenType_CIRC]; break; } - case GSWPageDefTokenType_TILDE: + case GSWPageDefParserTokenType_TILDE: { { ANTLRDefAST tmp12_AST = ANTLRnullAST; tmp12_AST = [astFactory create:[self LT:1]]; [astFactory addASTChild:tmp12_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_TILDE]; + [self matchTokenType:GSWPageDefParserTokenType_TILDE]; break; } - case GSWPageDefTokenType_IDENT: + case GSWPageDefParserTokenType_IDENT: + case GSWPageDefParserTokenType_IDENTREF: { break; } @@ -548,30 +549,64 @@ } } { + switch ( [self LA:1]) { - ANTLRDefAST tmp13_AST = ANTLRnullAST; - tmp13_AST = [astFactory create:[self LT:1]]; - [astFactory addASTChild:tmp13_AST in:currentAST]; + case GSWPageDefParserTokenType_IDENT: + { + { + ANTLRDefAST tmp13_AST = ANTLRnullAST; + tmp13_AST = [astFactory create:[self LT:1]]; + [astFactory addASTChild:tmp13_AST in:currentAST]; + } + [self matchTokenType:GSWPageDefParserTokenType_IDENT]; + break; + } + case GSWPageDefParserTokenType_IDENTREF: + { + { + ANTLRDefAST tmp14_AST = ANTLRnullAST; + tmp14_AST = [astFactory create:[self LT:1]]; + [astFactory addASTChild:tmp14_AST in:currentAST]; + } + [self matchTokenType:GSWPageDefParserTokenType_IDENTREF]; + break; + } + default: + { + [ANTLRNoViableAltException raiseWithToken:[self LT:1]]; + } } - [self matchTokenType:GSWPageDefTokenType_IDENT]; } { do { - if (([self LA:1]==GSWPageDefTokenType_PIDENT)) + switch ( [self LA:1]) + { + case GSWPageDefParserTokenType_PIDENT: { { - ANTLRDefAST tmp14_AST = ANTLRnullAST; - tmp14_AST = [astFactory create:[self LT:1]]; - [astFactory addASTChild:tmp14_AST in:currentAST]; + ANTLRDefAST tmp15_AST = ANTLRnullAST; + tmp15_AST = [astFactory create:[self LT:1]]; + [astFactory addASTChild:tmp15_AST in:currentAST]; } - [self matchTokenType:GSWPageDefTokenType_PIDENT]; + [self matchTokenType:GSWPageDefParserTokenType_PIDENT]; + break; } - else + case GSWPageDefParserTokenType_PIDENTREF: + { + { + ANTLRDefAST tmp16_AST = ANTLRnullAST; + tmp16_AST = [astFactory create:[self LT:1]]; + [astFactory addASTChild:tmp16_AST in:currentAST]; + } + [self matchTokenType:GSWPageDefParserTokenType_PIDENTREF]; + break; + } + default: { goto _loop28; } - + } } while (YES); _loop28:; } @@ -608,7 +643,9 @@ static CONST NSString* GSWPageDefParser___tokenNames[] = { @"HEXNUM", @"CIRC", @"TILDE", + @"IDENTREF", @"PIDENT", + @"PIDENTREF", @"SL_COMMENT", @"ML_COMMENT", @"POINT", diff --git a/GSWeb.framework/GSWProjectBundle.m b/GSWeb.framework/GSWProjectBundle.m index d88435a..0e198c4 100644 --- a/GSWeb.framework/GSWProjectBundle.m +++ b/GSWeb.framework/GSWProjectBundle.m @@ -41,10 +41,11 @@ static char rcsId[] = "$Id$"; -(id)initWithPath:(NSString*)path_ { LOGObjectFnStart(); + NSDebugMLLog(@"bundles",@"path_=%@",path_); if ((self=[super initWithPath:path_])) - { - //TODO - }; + { + //TODO + }; LOGObjectFnStop(); return nil; }; diff --git a/GSWeb.framework/GSWRadioButton.m b/GSWeb.framework/GSWRadioButton.m index 7c7b941..390eb9b 100644 --- a/GSWeb.framework/GSWRadioButton.m +++ b/GSWeb.framework/GSWRadioButton.m @@ -152,12 +152,16 @@ static char rcsId[] = "$Id$"; name=[self nameInContext:context]; NSDebugMLLog(@"gswdync",@"name=%@",name); formValue=[request formValueForKey:name]; + NSDebugMLLog(@"gswdync",@"formValue=%@",formValue); valueValue=[_value valueInComponent:component]; + NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue); //TODO if checked ! isEqual=SBIsValueEqual(formValue,valueValue); + NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO")); if (isEqual) { checkChecked=YES; + NSDebugMLLog(@"gswdync",@"_selection=%@",_selection); if (_selection) { if (!WOStrictFlag) @@ -178,11 +182,18 @@ static char rcsId[] = "$Id$"; [_selection setValue:valueValue inComponent:component]; }; + } + else if (_checked) + { + if ([formValue caseInsensitiveCompare:@"on"]==NSOrderedSame + || [formValue caseInsensitiveCompare:@"yes"]==NSOrderedSame) + checkChecked=YES; }; if (_checked) { id checkedValue=[NSNumber numberWithBool:checkChecked]; NSDebugMLLog(@"gswdync",@"checkedValue=%@",checkedValue); + NSDebugMLLog(@"gswdync",@"_checked=%@",_checked); if (!WOStrictFlag) { NS_DURING diff --git a/GSWeb.framework/GSWRequest.h b/GSWeb.framework/GSWRequest.h index 37ff8cd..94e1354 100644 --- a/GSWeb.framework/GSWRequest.h +++ b/GSWeb.framework/GSWRequest.h @@ -1,11 +1,16 @@ -/* GSWRequest.h - GSWeb: Class GSWRequest - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWRequest.h - GSWeb: Class GSWRequest + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -31,40 +37,40 @@ @interface GSWRequest : NSObject { @private - NSString* method; - GSWDynamicURLString* uri; - NSString* httpVersion; - NSDictionary* headers; - NSData* content; - NSDictionary* userInfo; - NSStringEncoding defaultFormValueEncoding; - NSStringEncoding formValueEncoding; - NSDictionary* formValues; - NSDictionary* cookie; - NSString* applicationURLPrefix; - NSArray* requestHandlerPathArray; - NSArray* browserLanguages; - int requestType; - BOOL isUsingWebServer; - BOOL formValueEncodingDetectionEnabled; - int applicationNumber; + NSString* _method; + GSWDynamicURLString* _uri; + NSString* _httpVersion; + NSDictionary* _headers; + NSData* _content; + NSDictionary* _userInfo; + NSStringEncoding _defaultFormValueEncoding; + NSStringEncoding _formValueEncoding; + NSDictionary* _formValues; + NSDictionary* _cookie; + NSString* _applicationURLPrefix; + NSArray* _requestHandlerPathArray; + NSArray* _browserLanguages; + int _requestType; + BOOL _isUsingWebServer; + BOOL _formValueEncodingDetectionEnabled; + int _applicationNumber; }; --(id)initWithMethod:(NSString*)method_ - uri:(NSString*)url_ - httpVersion:(NSString*)httpVersion_ - headers:(NSDictionary*)headers_ - content:(NSData*)content_ - userInfo:(NSDictionary*)userInfo_; +-(id)initWithMethod:(NSString*)aMethod + uri:(NSString*)anURL + httpVersion:(NSString*)aVersion + headers:(NSDictionary*)headers + content:(NSData*)content + userInfo:(NSDictionary*)userInfo; -(void)dealloc; --(id)copyWithZone:(NSZone*)zone_; +-(id)copyWithZone:(NSZone*)zone; -(NSData*)content; -(NSDictionary*)headers; --(NSString*)headerForKey:(NSString*)key_; +-(NSString*)headerForKey:(NSString*)key; -(NSArray*)headerKeys; --(NSArray*)headersForKey:(NSString*)key_; +-(NSArray*)headersForKey:(NSString*)key; -(NSString*)httpVersion; -(NSString*)method; -(NSArray*)browserLanguages; @@ -84,16 +90,16 @@ //==================================================================== @interface GSWRequest (GSWFormValueReporting) --(void)setDefaultFormValueEncoding:(NSStringEncoding)encoding_; +-(void)setDefaultFormValueEncoding:(NSStringEncoding)encoding; -(NSStringEncoding)defaultFormValueEncoding; --(void)setFormValueEncodingDetectionEnabled:(BOOL)flag_; +-(void)setFormValueEncodingDetectionEnabled:(BOOL)flag; -(BOOL)isFormValueEncodingDetectionEnabled; -(NSStringEncoding)formValueEncoding; -(NSArray*)formValueKeys; --(NSArray*)formValuesForKey:(NSString*)key_; --(id)formValueForKey:(NSString*)key_; // return id because GSWFileUpload +-(NSArray*)formValuesForKey:(NSString*)key; +-(id)formValueForKey:(NSString*)key; // return id because GSWFileUpload -(NSDictionary*)formValues; @end @@ -108,8 +114,8 @@ //NDFN -(void)setCookieFromHeaders; --(NSArray*)cookieValuesForKey:(NSString*)key_; --(NSString*)cookieValueForKey:(NSString*)key_; +-(NSArray*)cookieValuesForKey:(NSString*)key; +-(NSString*)cookieValueForKey:(NSString*)key; -(NSDictionary*)cookieValues; -(NSDictionary*)_initCookieDictionary; @@ -129,9 +135,9 @@ @end //==================================================================== @interface GSWRequest (GSWRequestB) --(NSDictionary*)_extractValuesFromFormData:(NSData*)_formData - withEncoding:(NSStringEncoding)_encoding; --(NSStringEncoding)_formValueEncodingFromFormData:(NSData*)_formData; +-(NSDictionary*)_extractValuesFromFormData:(NSData*)formData + withEncoding:(NSStringEncoding)encoding; +-(NSStringEncoding)_formValueEncodingFromFormData:(NSData*)formData; -(NSData*)_formData; -(NSString*)_contentType; -(NSString*)_urlQueryString; @@ -147,14 +153,14 @@ -(BOOL)_isSessionIDinRequest; -(BOOL)_isSessionIDinCookies; -(BOOL)_isSessionIDinFormValues; --(id)_completeURLWithRequestHandlerKey:(NSString*)_key - path:(NSString*)_path - queryString:(NSString*)_queryString - isSecure:(BOOL)_isSecure - port:(int)_port; --(GSWDynamicURLString*)_urlWithRequestHandlerKey:(NSString*)_key - path:(NSString*)_path - queryString:(NSString*)_queryString; +-(id)_completeURLWithRequestHandlerKey:(NSString*)key + path:(NSString*)path + queryString:(NSString*)queryString + isSecure:(BOOL)isSecure + port:(int)port; +-(GSWDynamicURLString*)_urlWithRequestHandlerKey:(NSString*)key + path:(NSString*)path + queryString:(NSString*)queryString; -(GSWDynamicURLString*)_applicationURLPrefix; -(NSDictionary*)_formValues; -(void)_getFormValuesFromURLEncoding; @@ -164,26 +170,26 @@ //==================================================================== @interface GSWRequest (GSWRequestH) -(void)_getFormValuesFromMultipartFormData; --(NSArray*)_decodeMultipartBody:(NSData*)_body - boundary:(NSString*)_boundary; --(NSArray*)_parseData:(NSData*)_data; --(NSDictionary*)_parseOneHeader:(NSString*)_header; +-(NSArray*)_decodeMultipartBody:(NSData*)body + boundary:(NSString*)boundary; +-(NSArray*)_parseData:(NSData*)data; +-(NSDictionary*)_parseOneHeader:(NSString*)header; @end //==================================================================== @interface GSWRequest (GSWRequestI) --(id)nonNilFormValueForKey:(NSString*)_key; +-(id)nonNilFormValueForKey:(NSString*)key; @end //==================================================================== @interface GSWRequest (GSWRequestJ) --(id)dictionaryWithKeys:(id)_unknown; +-(id)dictionaryWithKeys:(id)unknown; -(NSString*)selectedButtonName; --(id)valueFromImageMapNamed:(NSString*)_name; --(id)valueFromImageMapNamed:(NSString*)_name - inFramework:(NSString*)_framework; --(id)valueFromImageMap:(id)_unknown; +-(id)valueFromImageMapNamed:(NSString*)aName; +-(id)valueFromImageMapNamed:(NSString*)aName + inFramework:(NSString*)aFramework; +-(id)valueFromImageMap:(id)unknown; -(id)yCoord; -(id)xCoord; --(id)formKeyWithSuffix:(NSString*)_suffix; +-(id)formKeyWithSuffix:(NSString*)suffix; @end //==================================================================== @interface GSWRequest (GSWRequestK) diff --git a/GSWeb.framework/GSWRequest.m b/GSWeb.framework/GSWRequest.m index 61cd5fc..ad74394 100644 --- a/GSWeb.framework/GSWRequest.m +++ b/GSWeb.framework/GSWRequest.m @@ -1,11 +1,16 @@ -/* GSWRequest.m - GSWeb: Class GSWRequest - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWRequest.m - GSWeb: Class GSWRequest + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -33,46 +39,46 @@ static char rcsId[] = "$Id$"; // initWithMethod:uri:httpVersion:headers:content:userInfo: // may raise exception --(id)initWithMethod:(NSString*)method_ - uri:(NSString*)url_ - httpVersion:(NSString*)httpVersion_ - headers:(NSDictionary*)headers_ - content:(NSData*)content_ - userInfo:(NSDictionary*)userInfo_ +-(id)initWithMethod:(NSString*)aMethod + uri:(NSString*)anURL + httpVersion:(NSString*)aVersion + headers:(NSDictionary*)headers + content:(NSData*)content + userInfo:(NSDictionary*)userInfo { LOGObjectFnStart(); if ((self=[super init])) - { - ASSIGNCOPY(method,method_); - NSDebugMLLog(@"requests",@"method=%@",method); - ASSIGNCOPY(httpVersion,httpVersion_); - ASSIGNCOPY(headers,headers_); - defaultFormValueEncoding=NSISOLatin1StringEncoding; - formValueEncoding=NSISOLatin1StringEncoding; - [self _initCookieDictionary];//NDFN - applicationNumber=-9999; - { - NSString* _adaptorVersion=[self headerForKey:GSWHTTPHeader_AdaptorVersion[GSWebNamingConv]]; - if (!_adaptorVersion) - _adaptorVersion=[self headerForKey:GSWHTTPHeader_AdaptorVersion[GSWebNamingConvInversed]]; - NSDebugMLLog(@"requests",@"_adaptorVersion=%@",_adaptorVersion); - [self _setIsUsingWebServer:(_adaptorVersion!=nil)];//?? - }; - NSDebugMLLog(@"requests",@"url_=%@",url_); - uri=[[GSWDynamicURLString alloc]initWithCString:[url_ cString] - length:[url_ length]]; - NSDebugMLLog(@"requests",@"uri=%@",uri); - [uri checkURL]; - ASSIGNCOPY(content,content_); - ASSIGNCOPY(userInfo,userInfo_); + { + ASSIGNCOPY(_method,aMethod); + NSDebugMLLog(@"requests",@"method=%@",_method); + ASSIGNCOPY(_httpVersion,aVersion); + ASSIGNCOPY(_headers,headers); + _defaultFormValueEncoding=NSISOLatin1StringEncoding; + _formValueEncoding=NSISOLatin1StringEncoding; + [self _initCookieDictionary];//NDFN + _applicationNumber=-9999; + { + NSString* adaptorVersion=[self headerForKey:GSWHTTPHeader_AdaptorVersion[GSWebNamingConv]]; + if (!adaptorVersion) + adaptorVersion=[self headerForKey:GSWHTTPHeader_AdaptorVersion[GSWebNamingConvInversed]]; + NSDebugMLLog(@"requests",@"adaptorVersion=%@",adaptorVersion); + [self _setIsUsingWebServer:(adaptorVersion!=nil)];//?? + }; + NSDebugMLLog(@"requests",@"anURL=%@",anURL); + _uri=[[GSWDynamicURLString alloc]initWithCString:[anURL cString] + length:[anURL length]]; + NSDebugMLLog(@"requests",@"uri=%@",_uri); + [_uri checkURL]; + ASSIGNCOPY(_content,content); + ASSIGNCOPY(_userInfo,userInfo); - if (!method_ || !url_) - { - LOGException0(@"NSGenericException GSWRequest: no method and no url"); - [NSException raise:NSGenericException - format:@"GSWRequest: no method and no url"]; - }; - }; + if (!aMethod || !anURL) + { + LOGException0(@"NSGenericException GSWRequest: no method and no url"); + [NSException raise:NSGenericException + format:@"GSWRequest: no method and no url"]; + }; + }; LOGObjectFnStop(); return self; }; @@ -83,55 +89,55 @@ static char rcsId[] = "$Id$"; GSWLogAssertGood(self); NSDebugFLog0(@"dealloc GSWRequest"); NSDebugFLog0(@"Release GSWRequest method"); - DESTROY(method); + DESTROY(_method); NSDebugFLog0(@"Release GSWRequest uri"); - DESTROY(uri); + DESTROY(_uri); NSDebugFLog0(@"Release GSWRequest httpVersion"); - DESTROY(httpVersion); + DESTROY(_httpVersion); NSDebugFLog0(@"Release GSWRequest headers"); - DESTROY(headers); + DESTROY(_headers); NSDebugFLog0(@"Release GSWRequest content"); - DESTROY(content); + DESTROY(_content); NSDebugFLog0(@"Release GSWRequest userInfo"); - DESTROY(userInfo); + DESTROY(_userInfo); NSDebugFLog0(@"Release GSWRequest formValues"); - DESTROY(formValues); + DESTROY(_formValues); NSDebugFLog0(@"Release GSWRequest cookie"); - DESTROY(cookie); + DESTROY(_cookie); NSDebugFLog0(@"Release GSWRequest applicationURLPrefix"); - DESTROY(applicationURLPrefix); + DESTROY(_applicationURLPrefix); NSDebugFLog0(@"Release GSWRequest requestHandlerPathArray"); - DESTROY(requestHandlerPathArray); + DESTROY(_requestHandlerPathArray); NSDebugFLog0(@"Release GSWRequest browserLanguages"); - DESTROY(browserLanguages); + DESTROY(_browserLanguages); NSDebugFLog0(@"Release GSWRequest super"); [super dealloc]; }; //-------------------------------------------------------------------- --(id)copyWithZone:(NSZone*)zone_ +-(id)copyWithZone:(NSZone*)zone { - GSWRequest* clone = [[isa allocWithZone:zone_] init]; + GSWRequest* clone = [[isa allocWithZone:zone] init]; if (clone) - { - ASSIGNCOPY(clone->method,method); - ASSIGNCOPY(clone->uri,uri); - ASSIGNCOPY(clone->httpVersion,httpVersion); - ASSIGNCOPY(clone->headers,headers); - ASSIGNCOPY(clone->content,content); - ASSIGNCOPY(clone->userInfo,userInfo); - clone->defaultFormValueEncoding=defaultFormValueEncoding; - clone->formValueEncoding=formValueEncoding; - ASSIGNCOPY(clone->formValues,formValues); - ASSIGNCOPY(clone->cookie,cookie); - ASSIGNCOPY(clone->applicationURLPrefix,applicationURLPrefix); - ASSIGNCOPY(clone->requestHandlerPathArray,requestHandlerPathArray); - ASSIGNCOPY(clone->browserLanguages,browserLanguages); - clone->requestType=requestType; - clone->isUsingWebServer=isUsingWebServer; - clone->formValueEncodingDetectionEnabled=formValueEncodingDetectionEnabled; - clone->applicationNumber=applicationNumber; - }; + { + ASSIGNCOPY(clone->_method,_method); + ASSIGNCOPY(clone->_uri,_uri); + ASSIGNCOPY(clone->_httpVersion,_httpVersion); + ASSIGNCOPY(clone->_headers,_headers); + ASSIGNCOPY(clone->_content,_content); + ASSIGNCOPY(clone->_userInfo,_userInfo); + clone->_defaultFormValueEncoding=_defaultFormValueEncoding; + clone->_formValueEncoding=_formValueEncoding; + ASSIGNCOPY(clone->_formValues,_formValues); + ASSIGNCOPY(clone->_cookie,_cookie); + ASSIGNCOPY(clone->_applicationURLPrefix,_applicationURLPrefix); + ASSIGNCOPY(clone->_requestHandlerPathArray,_requestHandlerPathArray); + ASSIGNCOPY(clone->_browserLanguages,_browserLanguages); + clone->_requestType=_requestType; + clone->_isUsingWebServer=_isUsingWebServer; + clone->_formValueEncodingDetectionEnabled=_formValueEncodingDetectionEnabled; + clone->_applicationNumber=_applicationNumber; + }; return clone; }; @@ -140,19 +146,19 @@ static char rcsId[] = "$Id$"; -(NSData*)content { - return content; + return _content; }; //-------------------------------------------------------------------- // headerForKey: --(NSString*)headerForKey:(NSString*)key_ +-(NSString*)headerForKey:(NSString*)key { - id value=[self headersForKey:key_]; + id value=[self headersForKey:key]; if (value && [value count]>0) - return [value objectAtIndex:0]; + return [value objectAtIndex:0]; else - return nil; + return nil; }; //-------------------------------------------------------------------- @@ -160,15 +166,15 @@ static char rcsId[] = "$Id$"; -(NSArray*)headerKeys { - return [headers allKeys]; + return [_headers allKeys]; }; //-------------------------------------------------------------------- // headersForKey: --(NSArray*)headersForKey:(NSString*)key_ +-(NSArray*)headersForKey:(NSString*)key { - return [headers objectForKey:key_]; + return [_headers objectForKey:key]; }; //-------------------------------------------------------------------- @@ -176,7 +182,7 @@ static char rcsId[] = "$Id$"; -(NSDictionary*)headers { - return headers; + return _headers; } //-------------------------------------------------------------------- @@ -184,7 +190,7 @@ static char rcsId[] = "$Id$"; -(NSString*)httpVersion { - return httpVersion; + return _httpVersion; }; //-------------------------------------------------------------------- @@ -193,14 +199,14 @@ static char rcsId[] = "$Id$"; -(NSString*)method { - return method; + return _method; }; //-------------------------------------------------------------------- // uri -(NSString*)uri { - return (NSString*)uri; + return (NSString*)_uri; }; //-------------------------------------------------------------------- @@ -208,9 +214,9 @@ static char rcsId[] = "$Id$"; -(NSString*)urlProtocol { //TODO - NSString* urlProtocol=[uri urlProtocol]; + NSString* urlProtocol=[_uri urlProtocol]; if (!urlProtocol) - urlProtocol=GSWProtocol_HTTP; + urlProtocol=GSWProtocol_HTTP; return urlProtocol; }; @@ -218,7 +224,7 @@ static char rcsId[] = "$Id$"; //NDFN -(NSString*)urlHost { - NSString* urlHost=[uri urlHost]; + NSString* urlHost=[_uri urlHost]; if (!urlHost) urlHost=[self headerForKey:GSWHTTPHeader_ServerName[GSWebNamingConv]]; if (!urlHost) @@ -230,7 +236,7 @@ static char rcsId[] = "$Id$"; //NDFN -(NSString*)urlPortString { - NSString* urlPortString=[uri urlPortString]; + NSString* urlPortString=[_uri urlPortString]; if (!urlPortString) urlPortString=[self headerForKey:GSWHTTPHeader_ServerPort[GSWebNamingConv]]; if (!urlPortString) @@ -242,7 +248,7 @@ static char rcsId[] = "$Id$"; //NDFN -(int)urlPort { - int port=[uri urlPort]; + int port=[_uri urlPort]; if (!port) port=[[self headerForKey:GSWHTTPHeader_ServerPort[GSWebNamingConv]]intValue]; if (!port) @@ -254,7 +260,7 @@ static char rcsId[] = "$Id$"; //NDFN -(NSString*)urlProtocolHostPort { - return [uri urlProtocolHostPort]; + return [_uri urlProtocolHostPort]; }; //-------------------------------------------------------------------- @@ -269,95 +275,95 @@ static char rcsId[] = "$Id$"; { //OK LOGObjectFnStart(); - if (!browserLanguages) - { - NSMutableArray* _browserLanguages=nil; - NSString* header=[self headerForKey:GSWHTTPHeader_AcceptLanguage]; - NSDebugMLLog(@"requests",@"lang header:%@",header); - if (header) - { - NSArray* _languages=[header componentsSeparatedByString:@","]; - if (!_languages) - { - LOGError0(@"No languages"); - }; -/* -// NSDebugMLLog(@"requests",@"_languages:%@",_languages); - if ([_languages count]>0) - { - int i=0; - NSString* _fromLanguage=nil; - NSString* _toLanguage=nil; - _browserLanguages=[NSMutableArray array]; - for(i=0;i<[_languages count];i++) - { - _fromLanguage=[[_languages objectAtIndex:i] lowercaseString]; -// NSDebugMLLog(@"requests",@"_fromLanguage:%@",_fromLanguage); - _toLanguage=[globalLanguages objectForKey:_fromLanguage]; -// NSDebugMLLog(@"requests",@"_toLanguage:%@",_toLanguage); - [_browserLanguages addObject:_toLanguage]; - }; - }; - }; - if (_browserLanguages) - _browserLanguages=[NSArray arrayWithArray:_browserLanguages]; + if (!_browserLanguages) + { + NSMutableArray* browserLanguages=nil; + NSString* header=[self headerForKey:GSWHTTPHeader_AcceptLanguage]; + NSDebugMLLog(@"requests",@"lang header:%@",header); + if (header) + { + NSArray* languages=[header componentsSeparatedByString:@","]; + if (!languages) + { + LOGError0(@"No languages"); + }; + /* + // NSDebugMLLog(@"requests",@"languages:%@",languages); + if ([languages count]>0) + { + int i=0; + NSString* fromLanguage=nil; + NSString* toLanguage=nil; + browserLanguages=[NSMutableArray array]; + for(i=0;i<[languages count];i++) + { + fromLanguage=[[languages objectAtIndex:i] lowercaseString]; + // NSDebugMLLog(@"requests",@"fromLanguage:%@",fromLanguage); + toLanguage=[globalLanguages objectForKey:fromLanguage]; + // NSDebugMLLog(@"requests",@"toLanguage:%@",toLanguage); + [browserLanguages addObject:toLanguage]; + }; + }; + }; + if (browserLanguages) + browserLanguages=[NSArray arrayWithArray:browserLanguages]; else - _browserLanguages=[[NSArray new]autorelease]; -*/ - _browserLanguages=(NSMutableArray*)[GSWResourceManager GSLanguagesFromISOLanguages:_languages]; - NSDebugMLLog(@"requests",@"browserLanguages:%@",browserLanguages); - if (_browserLanguages) - { - //Remove Duplicates - int i=0; - _browserLanguages=[_browserLanguages mutableCopy]; - for(i=0;i<[_browserLanguages count];i++) - { - int j=0; - NSString* language=[_browserLanguages objectAtIndex:i]; - for(j=[_browserLanguages count]-1;j>i;j--) - { - NSString* language2=[_browserLanguages objectAtIndex:j]; - if ([language2 isEqual:language]) - [_browserLanguages removeObjectAtIndex:j]; - }; - }; - }; - } - else - { - LOGError0(@"No languages header"); - }; - - if (!_browserLanguages) - { - LOGError0(@"No known languages"); - _browserLanguages=(NSMutableArray*)[NSArray array]; - }; - ASSIGN(browserLanguages,_browserLanguages); - NSDebugMLLog(@"requests",@"browserLanguages:%@",browserLanguages); - }; + browserLanguages=[[NSArray new]autorelease]; + */ + browserLanguages=(NSMutableArray*)[GSWResourceManager GSLanguagesFromISOLanguages:languages]; + NSDebugMLLog(@"requests",@"browserLanguages:%@",browserLanguages); + if (browserLanguages) + { + //Remove Duplicates + int i=0; + browserLanguages=[browserLanguages mutableCopy]; + for(i=0;i<[browserLanguages count];i++) + { + int j=0; + NSString* language=[browserLanguages objectAtIndex:i]; + for(j=[browserLanguages count]-1;j>i;j--) + { + NSString* language2=[browserLanguages objectAtIndex:j]; + if ([language2 isEqual:language]) + [browserLanguages removeObjectAtIndex:j]; + }; + }; + }; + } + else + { + LOGError0(@"No languages header"); + }; + + if (!browserLanguages) + { + LOGError0(@"No known languages"); + browserLanguages=(NSMutableArray*)[NSArray array]; + }; + ASSIGN(_browserLanguages,browserLanguages); + NSDebugMLLog(@"requests",@"browserLanguages:%@",_browserLanguages); + }; LOGObjectFnStop(); - return browserLanguages; + return _browserLanguages; }; //-------------------------------------------------------------------- -(NSArray*)requestHandlerPathArray { - if (!requestHandlerPathArray) - { - NSString* _urlRequestHandlerPath=[uri urlRequestHandlerPath]; - ASSIGN(requestHandlerPathArray, - [_urlRequestHandlerPath componentsSeparatedByString:@"/"]); - }; - return requestHandlerPathArray; + if (!_requestHandlerPathArray) + { + NSString* urlRequestHandlerPath=[_uri urlRequestHandlerPath]; + ASSIGN(_requestHandlerPathArray, + [urlRequestHandlerPath componentsSeparatedByString:@"/"]); + }; + return _requestHandlerPathArray; }; //-------------------------------------------------------------------- // userInfo -(NSDictionary*)userInfo { - return userInfo; + return _userInfo; }; //-------------------------------------------------------------------- @@ -365,25 +371,25 @@ static char rcsId[] = "$Id$"; { return [NSString stringWithFormat:@"<%s %p - method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultFormValueEncoding=%u, formValueEncoding=%u, formValues=%@, cookie=%@, applicationURLPrefix=%@, requestHandlerPathArray=%@, browserLanguages=%@, requestType=%d, isUsingWebServer=%s, formValueEncodingDetectionEnabled=%s, applicationNumber=%d", - object_get_class_name(self), - (void*)self, - method, - uri, - httpVersion, - headers, - content, - userInfo, - defaultFormValueEncoding, - formValueEncoding, - formValues, - cookie, - applicationURLPrefix, - requestHandlerPathArray, - browserLanguages, - requestType, - isUsingWebServer ? "YES" : "NO", - formValueEncodingDetectionEnabled ? "YES" : "NO", - applicationNumber]; + object_get_class_name(self), + (void*)self, + _method, + _uri, + _httpVersion, + _headers, + _content, + _userInfo, + _defaultFormValueEncoding, + _formValueEncoding, + _formValues, + _cookie, + _applicationURLPrefix, + _requestHandlerPathArray, + _browserLanguages, + _requestType, + _isUsingWebServer ? "YES" : "NO", + _formValueEncodingDetectionEnabled ? "YES" : "NO", + _applicationNumber]; }; @end @@ -393,30 +399,30 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF //-------------------------------------------------------------------- // setDefaultFormValueEncoding: --(void)setDefaultFormValueEncoding:(NSStringEncoding)encoding_ +-(void)setDefaultFormValueEncoding:(NSStringEncoding)encoding { - defaultFormValueEncoding=encoding_; + _defaultFormValueEncoding=encoding; }; //-------------------------------------------------------------------- // defaultFormValueEncoding -(NSStringEncoding)defaultFormValueEncoding { - return defaultFormValueEncoding; + return _defaultFormValueEncoding; }; //-------------------------------------------------------------------- // setFormValueEncodingDetectionEnabled: --(void)setFormValueEncodingDetectionEnabled:(BOOL)flag_ +-(void)setFormValueEncodingDetectionEnabled:(BOOL)flag { - formValueEncodingDetectionEnabled=flag_; + _formValueEncodingDetectionEnabled=flag; }; //-------------------------------------------------------------------- // isFormValueEncodingDetectionEnabled -(BOOL)isFormValueEncodingDetectionEnabled { - return formValueEncodingDetectionEnabled; + return _formValueEncodingDetectionEnabled; }; //-------------------------------------------------------------------- @@ -424,7 +430,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(NSStringEncoding)formValueEncoding { - return formValueEncoding; + return _formValueEncoding; }; //-------------------------------------------------------------------- @@ -432,88 +438,90 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(NSArray*)formValueKeys { - NSDictionary* _formValues=nil; - NSArray* _formValueKeys=nil; + NSDictionary* formValues=nil; + NSArray* formValueKeys=nil; LOGObjectFnStart(); NS_DURING { - _formValues=[self _formValues]; + formValues=[self _formValues]; } NS_HANDLER { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"GSWRequest _formValues"); + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"GSWRequest formValueKeys"); LOGException(@"%@ (%@)",localException,[localException reason]); [localException raise]; }; NS_ENDHANDLER; - _formValueKeys=[_formValues allKeys]; + formValueKeys=[formValues allKeys]; LOGObjectFnStop(); - return _formValueKeys; + return formValueKeys; }; //-------------------------------------------------------------------- // formValuesForKey: --(NSArray*)formValuesForKey:(NSString*)key_ +-(NSArray*)formValuesForKey:(NSString*)key { - NSArray* _formValuesForKey=nil; - NSDictionary* _formValues=nil; + NSArray* formValuesForKey=nil; + NSDictionary* formValues=nil; LOGObjectFnStart(); NS_DURING { - _formValues=[self _formValues]; + formValues=[self _formValues]; } NS_HANDLER { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"GSWRequest _formValues"); + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"GSWRequest formValuesForKey"); LOGException(@"%@ (%@)",localException,[localException reason]); [localException raise]; }; NS_ENDHANDLER; - _formValuesForKey=[_formValues objectForKey:key_]; + formValuesForKey=[formValues objectForKey:key]; LOGObjectFnStop(); - return _formValuesForKey; + return formValuesForKey; }; //-------------------------------------------------------------------- // formValueForKey: // return id because GSWFileUpload --(id)formValueForKey:(NSString*)key_ +-(id)formValueForKey:(NSString*)key { //OK - id _formValue=nil; - NSArray* _formValuesForKey=nil; + id formValue=nil; + NSArray* formValuesForKey=nil; LOGObjectFnStart(); - _formValuesForKey=[self formValuesForKey:key_]; - NSAssert3(!_formValuesForKey || [_formValuesForKey isKindOfClass:[NSArray class]],@"formValues:%@ ForKey:%@ is not a NSArray it's a %@", - _formValuesForKey, - key_, - [_formValuesForKey class]); - if (_formValuesForKey && [_formValuesForKey count]>0) - _formValue=[_formValuesForKey objectAtIndex:0]; + formValuesForKey=[self formValuesForKey:key]; + NSAssert3(!formValuesForKey || [formValuesForKey isKindOfClass:[NSArray class]],@"formValues:%@ ForKey:%@ is not a NSArray it's a %@", + formValuesForKey, + key, + [formValuesForKey class]); + if (formValuesForKey && [formValuesForKey count]>0) + formValue=[formValuesForKey objectAtIndex:0]; LOGObjectFnStop(); - return _formValue; + return formValue; }; //-------------------------------------------------------------------- // formValues -(NSDictionary*)formValues { - NSDictionary* _formValues=nil; + NSDictionary* formValues=nil; LOGObjectFnStart(); NS_DURING { - _formValues=[self _formValues]; + formValues=[self _formValues]; } NS_HANDLER { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"GSWRequest _formValues"); + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"GSWRequest formValues"); LOGException(@"%@ (%@)",localException,[localException reason]); [localException raise]; }; NS_ENDHANDLER; LOGObjectFnStop(); - return _formValues; + return formValues; }; @end @@ -527,13 +535,13 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(BOOL)isFromClientComponent { //OK - NSString* _remoteInvocationPost=nil; - BOOL _isFromClientComponent=NO; + NSString* remoteInvocationPost=nil; + BOOL isFromClientComponent=NO; LOGObjectFnStart(); - _remoteInvocationPost=[self formValueForKey:GSWFormValue_RemoteInvocationPost[GSWebNamingConv]]; - _isFromClientComponent=(_remoteInvocationPost!=nil); + remoteInvocationPost=[self formValueForKey:GSWFormValue_RemoteInvocationPost[GSWebNamingConv]]; + isFromClientComponent=(remoteInvocationPost!=nil); LOGObjectFnStop(); - return _isFromClientComponent; + return isFromClientComponent; }; @end @@ -544,85 +552,85 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF //-------------------------------------------------------------------- -(void)setCookieFromHeaders { - NSDictionary* _cookie=nil; + NSDictionary* cookie=nil; NSString* cookieHeader=nil; LOGObjectFnStart(); cookieHeader=[self headerForKey:GSWHTTPHeader_Cookie]; if (cookieHeader) - { - NSDictionary* _cookieStrings=[cookieHeader dictionaryWithSep1:@"; " - withSep2:@"=" - withOptionUnescape:NO]; - if (_cookieStrings) - { - NSMutableDictionary* _cookieTmp=[NSMutableDictionary dictionary]; - NSEnumerator* enumerator = [_cookieStrings keyEnumerator]; - id key; - id value; - NSArray* newValue; - id prevValue; - NSDebugMLLog(@"requests",@"enumerator=%@ _cookieTmp=%@",enumerator,_cookieTmp); - while ((key = [enumerator nextObject])) - { - value=[_cookieStrings objectForKey:key]; - if (value) - { - id cookieValue=nil; - int index=0; - for(index=0;index<[value count];index++) - { - cookieValue=[value objectAtIndex:index]; - if (cookieValue) - { - newValue=nil; - cookieValue=[GSWCookie cookieWithName:key - value:cookieValue]; - prevValue=[_cookieTmp objectForKey:key]; - if (prevValue) - newValue=[prevValue arrayByAddingObject:cookieValue]; - else - newValue=[NSArray arrayWithObject:cookieValue]; - [_cookieTmp setObject:newValue - forKey:key]; - }; - }; - }; - }; - _cookie=[NSDictionary dictionaryWithDictionary:_cookieTmp]; - }; - }; - ASSIGN(cookie,_cookie); - NSDebugMLLog(@"requests",@"Cookie: %@",cookie); + { + NSDictionary* cookieStrings=[cookieHeader dictionaryWithSep1:@"; " + withSep2:@"=" + withOptionUnescape:NO]; + if (cookieStrings) + { + NSMutableDictionary* cookieTmp=[NSMutableDictionary dictionary]; + NSEnumerator* enumerator = [cookieStrings keyEnumerator]; + id key; + id value; + NSArray* newValue; + id prevValue; + NSDebugMLLog(@"requests",@"enumerator=%@ cookieTmp=%@",enumerator,cookieTmp); + while ((key = [enumerator nextObject])) + { + value=[cookieStrings objectForKey:key]; + if (value) + { + id cookieValue=nil; + int index=0; + for(index=0;index<[value count];index++) + { + cookieValue=[value objectAtIndex:index]; + if (cookieValue) + { + newValue=nil; + cookieValue=[GSWCookie cookieWithName:key + value:cookieValue]; + prevValue=[cookie objectForKey:key]; + if (prevValue) + newValue=[prevValue arrayByAddingObject:cookieValue]; + else + newValue=[NSArray arrayWithObject:cookieValue]; + [cookieTmp setObject:newValue + forKey:key]; + }; + }; + }; + }; + cookie=[NSDictionary dictionaryWithDictionary:cookieTmp]; + }; + }; + ASSIGN(_cookie,cookie); + NSDebugMLLog(@"requests",@"Cookie: %@",_cookie); LOGObjectFnStop(); }; //-------------------------------------------------------------------- // cookieValuesForKey: --(NSArray*)cookieValuesForKey:(NSString*)key_ +-(NSArray*)cookieValuesForKey:(NSString*)key { - NSArray* _cookieValuesForKey=nil; + NSArray* cookieValuesForKey=nil; LOGObjectFnStart(); [self _initCookieDictionary]; - _cookieValuesForKey=[cookie objectForKey:key_]; + cookieValuesForKey=[_cookie objectForKey:key]; LOGObjectFnStop(); - return _cookieValuesForKey; + return cookieValuesForKey; }; //-------------------------------------------------------------------- // cookieValueForKey: --(NSString*)cookieValueForKey:(NSString*)key_ +-(NSString*)cookieValueForKey:(NSString*)key { id object=nil; - NSString* _cookieValueForKey=nil; + NSString* cookieValueForKey=nil; //OK LOGObjectFnStart(); [self _initCookieDictionary]; - object=[cookie objectForKey:key_]; + object=[_cookie objectForKey:key]; if (object && [object count]>0) - _cookieValueForKey=[object objectAtIndex:0]; - NSDebugMLLog(@"requests",@"cookieValueForKey:%@=%@",key_,_cookieValueForKey); + cookieValueForKey=[object objectAtIndex:0]; + NSDebugMLLog(@"requests",@"cookieValueForKey:%@=%@",key,cookieValueForKey); LOGObjectFnStop(); - return _cookieValueForKey; + return cookieValueForKey; }; //-------------------------------------------------------------------- @@ -633,7 +641,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF LOGObjectFnStart(); [self _initCookieDictionary]; LOGObjectFnStop(); - return cookie; + return _cookie; }; //-------------------------------------------------------------------- @@ -641,58 +649,58 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF { //ok LOGObjectFnStart(); - NSDebugMLLog(@"low",@"cookie=%@",cookie); - if (!cookie) - { - NSString* _cookieDescription=[self _cookieDescription]; - NSArray* _cookiesArray=[_cookieDescription componentsSeparatedByString:@"; "]; - NSMutableDictionary* _cookies=[NSMutableDictionary dictionary]; - NSString* _cookieString=nil; - NSArray* _cookie=nil; - NSString* _cookieName=nil; - NSString* _cookieValue=nil; - NSArray* _cookieArrayValue=nil; - NSArray* _cookiePrevValue=nil; - int i=0; - NSDebugMLLog(@"low",@"_cookieDescription=%@",_cookieDescription); - NSDebugMLLog(@"low",@"_cookiesArray=%@",_cookiesArray); - for(i=0;i<[_cookiesArray count];i++) - { - _cookieString=[_cookiesArray objectAtIndex:i]; - NSDebugMLLog(@"low",@"_cookieString=%@",_cookieString); - _cookie=[_cookieString componentsSeparatedByString:@"="]; - NSDebugMLLog(@"low",@"_cookie=%@",_cookie); - if ([_cookie count]>0) - { - _cookieName=[_cookie objectAtIndex:0]; - if ([_cookie count]>1) - _cookieValue=[_cookie objectAtIndex:1]; - else - _cookieValue=[NSString string]; - _cookiePrevValue=[_cookies objectForKey:_cookieName]; - if (_cookiePrevValue) - _cookieArrayValue=[_cookiePrevValue arrayByAddingObject:_cookieValue]; - else - _cookieArrayValue=[NSArray arrayWithObject:_cookieValue]; - [_cookies setObject:_cookieArrayValue - forKey:_cookieName]; - }; - }; - ASSIGN(cookie,[NSDictionary dictionaryWithDictionary:_cookies]); - }; + NSDebugMLLog(@"low",@"cookie=%@",_cookie); + if (!_cookie) + { + NSString* cookieDescription=[self _cookieDescription]; + NSArray* cookiesArray=[cookieDescription componentsSeparatedByString:@"; "]; + NSMutableDictionary* cookies=[NSMutableDictionary dictionary]; + NSString* cookieString=nil; + NSArray* cookie=nil; + NSString* cookieName=nil; + NSString* cookieValue=nil; + NSArray* cookieArrayValue=nil; + NSArray* cookiePrevValue=nil; + int i=0; + NSDebugMLLog(@"low",@"cookieDescription=%@",cookieDescription); + NSDebugMLLog(@"low",@"cookiesArray=%@",cookiesArray); + for(i=0;i<[cookiesArray count];i++) + { + cookieString=[cookiesArray objectAtIndex:i]; + NSDebugMLLog(@"low",@"cookieString=%@",cookieString); + cookie=[cookieString componentsSeparatedByString:@"="]; + NSDebugMLLog(@"low",@"cookie=%@",cookie); + if ([cookie count]>0) + { + cookieName=[cookie objectAtIndex:0]; + if ([cookie count]>1) + cookieValue=[cookie objectAtIndex:1]; + else + cookieValue=[NSString string]; + cookiePrevValue=[cookies objectForKey:cookieName]; + if (cookiePrevValue) + cookieArrayValue=[cookiePrevValue arrayByAddingObject:cookieValue]; + else + cookieArrayValue=[NSArray arrayWithObject:cookieValue]; + [cookies setObject:cookieArrayValue + forKey:cookieName]; + }; + }; + ASSIGN(_cookie,[NSDictionary dictionaryWithDictionary:cookies]); + }; LOGObjectFnStop(); - return cookie; + return _cookie; }; //-------------------------------------------------------------------- -(NSString*)_cookieDescription { //OK - NSString* _cookieHeader=nil; + NSString* cookieHeader=nil; LOGObjectFnStart(); - _cookieHeader=[self headerForKey:GSWHTTPHeader_Cookie]; + cookieHeader=[self headerForKey:GSWHTTPHeader_Cookie]; LOGObjectFnStop(); - return _cookieHeader; + return cookieHeader; }; @end @@ -707,21 +715,21 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(NSString*)sessionID { - NSString* _sessionID=nil; - NSDictionary* _uriElements=nil; + NSString* sessionID=nil; + NSDictionary* uriElements=nil; LOGObjectFnStart(); - _uriElements=[self uriOrFormOrCookiesElements]; - _sessionID=[_uriElements objectForKey:GSWKey_SessionID[GSWebNamingConv]]; - if (!_sessionID) - _sessionID=[_uriElements objectForKey:GSWKey_SessionID[GSWebNamingConvInversed]]; + uriElements=[self uriOrFormOrCookiesElements]; + sessionID=[uriElements objectForKey:GSWKey_SessionID[GSWebNamingConv]]; + if (!sessionID) + sessionID=[uriElements objectForKey:GSWKey_SessionID[GSWebNamingConvInversed]]; LOGObjectFnStop(); - return _sessionID; + return sessionID; }; //-------------------------------------------------------------------- -(NSString*)requestHandlerPath { - return [uri urlRequestHandlerPath]; + return [_uri urlRequestHandlerPath]; }; //-------------------------------------------------------------------- @@ -729,7 +737,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(NSString*)adaptorPrefix { - return [uri urlPrefix]; + return [_uri urlPrefix]; }; @@ -738,7 +746,7 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(NSString*)applicationName { - return [uri urlApplicationName]; + return [_uri urlApplicationName]; }; //-------------------------------------------------------------------- @@ -748,23 +756,23 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(int)applicationNumber { //OK - if (applicationNumber==-9999) - { - NSDictionary* _uriElements=[self uriOrFormOrCookiesElements]; - NSString* _applicationNumber=[_uriElements objectForKey:GSWKey_InstanceID[GSWebNamingConv]]; - if (!_applicationNumber) - _applicationNumber=[_uriElements objectForKey:GSWKey_InstanceID[GSWebNamingConvInversed]]; - applicationNumber=[_applicationNumber intValue]; - }; - return applicationNumber; + if (_applicationNumber==-9999) + { + NSDictionary* uriElements=[self uriOrFormOrCookiesElements]; + NSString* applicationNumber=[uriElements objectForKey:GSWKey_InstanceID[GSWebNamingConv]]; + if (!applicationNumber) + applicationNumber=[uriElements objectForKey:GSWKey_InstanceID[GSWebNamingConvInversed]]; + _applicationNumber=[applicationNumber intValue]; + }; + return _applicationNumber; }; //-------------------------------------------------------------------- -(NSString*)requestHandlerKey { - NSString* _requestHandlerKey=[uri urlRequestHandlerKey]; - return _requestHandlerKey; + NSString* requestHandlerKey=[_uri urlRequestHandlerKey]; + return requestHandlerKey; }; @end @@ -773,56 +781,56 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF @implementation GSWRequest (GSWRequestB) //-------------------------------------------------------------------- --(NSDictionary*)_extractValuesFromFormData:(NSData*)formData_ - withEncoding:(NSStringEncoding)encoding_ +-(NSDictionary*)_extractValuesFromFormData:(NSData*)aFormData + withEncoding:(NSStringEncoding)encoding { - NSArray* _allKeys=nil; - NSDictionary* _formData=nil; - NSString* _formString=nil; + NSArray* allKeys=nil; + NSDictionary* tmpFormData=nil; + NSString* formString=nil; LOGObjectFnStart(); - NSDebugMLLog(@"requests",@"formData_=%@",formData_); - NSDebugMLLog(@"requests",@"encoding_=%ld",(long)encoding_); - _formString=[[[NSString alloc]initWithData:formData_ - encoding:encoding_] autorelease]; - NSDebugMLLog(@"requests",@"_formString=%@",_formString); - _formData=[_formString dictionaryQueryString]; - NSDebugMLLog(@"requests",@"_formData=%@",_formData); - _allKeys=[_formData allKeys]; - NSDebugMLLog(@"requests",@"_allKeys=%@",_allKeys); - NSDebugMLLog(@"requests",@"_allKeys count=%d",[_allKeys count]); - if ([_allKeys count]>0) - { - int i=0; - int _count=[_allKeys count]; - NSString* _key=nil; - BOOL ismapCoordsFound=NO; - NSArray* _value=nil; - for(i=0;i<_count && !ismapCoordsFound;i++) - { - _key=[_allKeys objectAtIndex:i]; - NSDebugMLLog(@"requests",@"_key=%@",_key); - _value=[_formData objectForKey:_key]; - if ([_value count]==1 - &&[[_value objectAtIndex:0]length]==0 - &&[_key ismapCoordx:NULL - y:NULL]) - { - NSMutableDictionary* _formDataMutable=[[_formData mutableCopy]autorelease]; - ismapCoordsFound=YES; - [_formDataMutable setObject:[NSArray arrayWithObject:_key] - forKey:GSWKey_IsmapCoords]; - [_formDataMutable removeObjectForKey:_key]; - _formData=[NSDictionary dictionaryWithDictionary:_formDataMutable]; - }; - }; - }; - NSDebugMLLog(@"requests",@"_formData=%@",_formData); + NSDebugMLLog(@"requests",@"aFormData=%@",aFormData); + NSDebugMLLog(@"requests",@"encoding=%ld",(long)encoding); + formString=[[[NSString alloc]initWithData:aFormData + encoding:encoding] autorelease]; + NSDebugMLLog(@"requests",@"formString=%@",formString); + tmpFormData=[formString dictionaryQueryString]; + NSDebugMLLog(@"requests",@"tmpFormData=%@",tmpFormData); + allKeys=[tmpFormData allKeys]; + NSDebugMLLog(@"requests",@"allKeys=%@",allKeys); + NSDebugMLLog(@"requests",@"allKeys count=%d",[allKeys count]); + if ([allKeys count]>0) + { + int i=0; + int count=[allKeys count]; + NSString* key=nil; + BOOL ismapCoordsFound=NO; + NSArray* value=nil; + for(i=0;i0) + range=[contentType rangeOfString:@";"]; + if (range.length>0) { - _contentType=[_contentType substringToIndex:_range.location]; - NSDebugMLLog(@"requests",@"_contentType=%@",_contentType); + contentType=[contentType substringToIndex:range.location]; + NSDebugMLLog(@"requests",@"contentType=%@",contentType); }; }; LOGObjectFnStop(); - return _contentType; + return contentType; }; //-------------------------------------------------------------------- -(NSString*)_urlQueryString { //OK - NSString* _urlQueryString=nil; -// NSArray* _url=nil; + NSString* urlQueryString=nil; +// NSArray* url=nil; LOGObjectFnStart(); - NSDebugMLLog(@"requests",@"uri=%@",uri); - NSDebugMLLog(@"requests",@"uri class=%@",[uri class]); - _urlQueryString=[uri urlQueryString]; + NSDebugMLLog(@"requests",@"uri=%@",_uri); + NSDebugMLLog(@"requests",@"uri class=%@",[_uri class]); + urlQueryString=[_uri urlQueryString]; /* - _url=[uri componentsSeparatedByString:@"?"]; - NSDebugMLLog(@"requests",@"_url=%@",_url); - if ([_url count]>1) - _urlQueryString=[[_url subarrayWithRange:NSMakeRange(1,[_url count])] - componentsJoinedByString:@"?"]; + url=[_uri componentsSeparatedByString:@"?"]; + NSDebugMLLog(@"requests",@"url=%@",url); + if ([url count]>1) + urlQueryString=[[url subarrayWithRange:NSMakeRange(1,[url count])] + componentsJoinedByString:@"?"]; else - _urlQueryString=[NSString string]; + urlQueryString=[NSString string]; */ LOGObjectFnStop(); - return _urlQueryString; + return urlQueryString; }; @@ -908,13 +916,13 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF //-------------------------------------------------------------------- -(BOOL)_isUsingWebServer { - return isUsingWebServer; + return _isUsingWebServer; }; //-------------------------------------------------------------------- --(void)_setIsUsingWebServer:(BOOL)_flag +-(void)_setIsUsingWebServer:(BOOL)flag { - isUsingWebServer=_flag; + _isUsingWebServer=flag; }; @end @@ -926,10 +934,10 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(BOOL)_isSessionIDinRequest { id ID=nil; - NSDictionary* _uriElements=[self uriElements]; - ID=[_uriElements objectForKey:GSWKey_SessionID[GSWebNamingConv]]; + NSDictionary* uriElements=[self uriElements]; + ID=[uriElements objectForKey:GSWKey_SessionID[GSWebNamingConv]]; if (!ID) - ID=[_uriElements objectForKey:GSWKey_SessionID[GSWebNamingConvInversed]]; + ID=[uriElements objectForKey:GSWKey_SessionID[GSWebNamingConvInversed]]; return (ID!=nil); }; @@ -954,38 +962,38 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF }; //-------------------------------------------------------------------- --(id)_completeURLWithRequestHandlerKey:(NSString*)_key - path:(NSString*)_path - queryString:(NSString*)_queryString - isSecure:(BOOL)_isSecure - port:(int)_port +-(id)_completeURLWithRequestHandlerKey:(NSString*)key + path:(NSString*)path + queryString:(NSString*)queryString + isSecure:(BOOL)isSecure + port:(int)port { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(GSWDynamicURLString*)_urlWithRequestHandlerKey:(NSString*)_key - path:(NSString*)_path - queryString:(NSString*)_queryString +-(GSWDynamicURLString*)_urlWithRequestHandlerKey:(NSString*)key + path:(NSString*)path + queryString:(NSString*)queryString { //OK - GSWDynamicURLString* _url=[self _applicationURLPrefix]; - [_url setURLRequestHandlerKey:_key]; - [_url setURLRequestHandlerPath:_path]; - [_url setURLQueryString:_queryString]; - return _url; + GSWDynamicURLString* url=[self _applicationURLPrefix]; + [url setURLRequestHandlerKey:key]; + [url setURLRequestHandlerPath:path]; + [url setURLQueryString:queryString]; + return url; }; //-------------------------------------------------------------------- -(GSWDynamicURLString*)_applicationURLPrefix { //OK - GSWDynamicURLString* _applicationURLPrefix=[[uri copy] autorelease]; - [_applicationURLPrefix setURLRequestHandlerKey:nil]; - [_applicationURLPrefix setURLRequestHandlerPath:nil]; - [_applicationURLPrefix setURLQueryString:nil]; - return _applicationURLPrefix; + GSWDynamicURLString* applicationURLPrefix=[[_uri copy] autorelease]; + [applicationURLPrefix setURLRequestHandlerKey:nil]; + [applicationURLPrefix setURLRequestHandlerPath:nil]; + [applicationURLPrefix setURLQueryString:nil]; + return applicationURLPrefix; }; //-------------------------------------------------------------------- @@ -993,46 +1001,46 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF { //OK LOGObjectFnStart(); - if(!formValues) - { - NSString* _contentType=[self _contentType]; - if (!_contentType || [_contentType isEqualToString:GSWHTTPHeader_FormURLEncoded]) - { - [self _getFormValuesFromURLEncoding]; - } - else if ([_contentType isEqualToString:GSWHTTPHeader_MultipartFormData]) - { - [self _getFormValuesFromMultipartFormData]; - } - else - { - NSDebugMLLog(@"requests",@"_contentType=%@",_contentType); - LOGObjectFnNotImplemented(); //TODO - }; - NSDebugMLLog(@"requests",@"formValues=%@",formValues); - }; + if(!_formValues) + { + NSString* contentType=[self _contentType]; + if (!contentType || [contentType isEqualToString:GSWHTTPHeader_FormURLEncoded]) + { + [self _getFormValuesFromURLEncoding]; + } + else if ([contentType isEqualToString:GSWHTTPHeader_MultipartFormData]) + { + [self _getFormValuesFromMultipartFormData]; + } + else + { + NSDebugMLLog(@"requests",@"contentType=%@",contentType); + LOGObjectFnNotImplemented(); //TODO + }; + NSDebugMLLog(@"requests",@"formValues=%@",_formValues); + }; LOGObjectFnStop(); - return formValues; + return _formValues; }; //-------------------------------------------------------------------- -(void)_getFormValuesFromURLEncoding { //OK - NSData* _formData=nil; + NSData* formData=nil; LOGObjectFnStart(); - _formData=[self _formData]; - NSDebugMLLog(@"requests",@"_formData=%@",_formData); - if (_formData) - { - NSStringEncoding _formValueEncoding=[self _formValueEncodingFromFormData:_formData]; - NSDictionary* _formValues=nil; - NSDebugMLLog(@"requests",@"_formValueEncoding=%d",(int)_formValueEncoding); - _formValues=[self _extractValuesFromFormData:_formData - withEncoding:_formValueEncoding]; - ASSIGN(formValues,_formValues); - NSDebugMLLog(@"requests",@"formValues=%@",formValues); - }; + formData=[self _formData]; + NSDebugMLLog(@"requests",@"formData=%@",formData); + if (formData) + { + NSStringEncoding formValueEncoding=[self _formValueEncodingFromFormData:formData]; + NSDictionary* formValues=nil; + NSDebugMLLog(@"requests",@"formValueEncoding=%d",(int)formValueEncoding); + formValues=[self _extractValuesFromFormData:formData + withEncoding:formValueEncoding]; + ASSIGN(_formValues,formValues); + NSDebugMLLog(@"requests",@"formValues=%@",_formValues); + }; LOGObjectFnStop(); }; @@ -1040,8 +1048,8 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF -(BOOL)_hasFormValues { //OK - NSDictionary* _formValues=[self _formValues]; - return [_formValues count]>0; + NSDictionary* formValues=[self _formValues]; + return [formValues count]>0; }; @@ -1053,158 +1061,170 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF //-------------------------------------------------------------------- -(void)_getFormValuesFromMultipartFormData { - NSMutableDictionary* _formValues=nil; - NSArray* _contentTypes=nil; - int _contentTypeIndex=0; - int _contentTypeCount=0; - NSString* _contentType=nil; - NSData* _content=nil; + NSMutableDictionary* formValues=nil; + NSArray* contentTypes=nil; + int contentTypeIndex=0; + int contentTypeCount=0; + NSString* contentType=nil; + NSData* tmpContentData=nil; LOGObjectFnStart(); - _formValues=[NSMutableDictionary dictionary]; - _contentTypes=[self headersForKey:GSWHTTPHeader_ContentType]; - _contentTypeIndex=0; - _contentTypeCount=[_contentTypes count]; - NSDebugMLLog(@"requests",@"_contentTypes=%@",_contentTypes); - _content=[self content]; + formValues=(NSMutableDictionary*)[NSMutableDictionary dictionary]; + contentTypes=[self headersForKey:GSWHTTPHeader_ContentType]; + contentTypeIndex=0; + contentTypeCount=[contentTypes count]; + NSDebugMLLog(@"requests",@"contentTypes=%@",contentTypes); + tmpContentData=[self content]; NS_DURING { - for(_contentTypeIndex=0;_contentTypeIndex<_contentTypeCount;_contentTypeIndex++) - { - NSDictionary* _parsedContentType=nil; - NSString* _boundary=nil; - NSArray* _decodedParts=nil; - int _decodedPartIndex=0; - int _decodedPartCount=0; - - // get "multipart/form-data; boundary=---------------------------1810101926251" - _contentType=[_contentTypes objectAtIndex:_contentTypeIndex]; - NSDebugMLLog(@"requests",@"_contentType=%@",_contentType); - // convert it into - // { - // boundary = "---------------------------1810101926251"; - // "multipart/form-data" = "multipart/form-data"; - // } - _parsedContentType=[self _parseOneHeader:_contentType]; - NSDebugMLLog(@"requests",@"_parsedContentType=%@",_parsedContentType); - _boundary=[_parsedContentType objectForKey:@"boundary"]; - NSDebugMLLog(@"requests",@"_boundary=%@",_boundary); - NSAssert1(_boundary,@"No boundary in %@",_parsedContentType); - NSDebugMLLog(@"requests",@"_content=%@",_content); - _decodedParts=[self _decodeMultipartBody:_content - boundary:_boundary]; - NSDebugMLLog(@"requests",@"_decodedParts=%@",_decodedParts); - _decodedPartIndex=0; - _decodedPartCount=[_decodedParts count]; - for(_decodedPartIndex=0;_decodedPartIndex<_decodedPartCount;_decodedPartIndex++) - { - NSData* _decodedPart=nil; - NSArray* _parsedParts=nil; - int _parsedPartsCount=0; + for(contentTypeIndex=0;contentTypeIndex - // ) - _parsedPartsCount=[_parsedParts count]; - if (_parsedPartsCount==0) - { - LOGError(@"_parsedPartsCount==0 _decodedPart=%@",_decodedPart); - //TODO error - } - else - { - NSDictionary* _partInfo=nil; - NSString* _parsedPartsContentType=nil; - NSString* _parsedPartsContentDisposition=nil; - NSDictionary* _parsedContentDispositionOfParsedPart=nil; - NSEnumerator* _enum=nil; - NSString* _name=nil; - NSString* _dscrKey=nil; - id _descrValue=nil; + decodedPart=[decodedParts objectAtIndex:decodedPartIndex]; + NSDebugMLLog(@"requests",@"decodedPart=%@",decodedPart); + parsedParts=[self _parseData:decodedPart]; + NSDebugMLLog(@"requests",@"parsedParts=%@",parsedParts); + //return : + // ( + // { + // "content-disposition" = "form-data; name=\"9.1\"; filename=\"C:\\TEMP\\zahn.txt\""; + // "content-type" = text/plain; + // }, + // <41514541 41415177 4d444179 666f3054 6c4e2b58 58684357 69314b50 51635159 73573677 426d336f 52617247 36584633 4c7a6455 5637664e 39654b6b 764b4a43 71715059 67417250 59374863 78397944 36506b66 774a7550 465a4141 2f303463 446c5072 48525670 537a4135 67664738 62364572 44314158 372b7067 734c5075 304b4d77 0d0a0d0a > + // ) + parsedPartsCount=[parsedParts count]; + if (parsedPartsCount==0) + { + LOGError(@"parsedPartsCount==0 decodedPart=%@",decodedPart); + //TODO error + } + else + { + NSDictionary* partInfo=nil; + NSString* parsedPartsContentType=nil; + NSString* parsedPartsContentDisposition=nil; + NSDictionary* parsedContentDispositionOfParsedPart=nil; + NSEnumerator* anEnumerator=nil; + NSString* aName=nil; + NSString* dscrKey=nil; + id descrValue=nil; - _partInfo=[_parsedParts objectAtIndex:0]; - NSDebugMLLog(@"requests",@"_partInfo=%@",_partInfo); - NSAssert1([_partInfo isKindOfClass:[NSDictionary class]],@"partInfo %@ is not a dictionary",_partInfo); - _parsedPartsContentType=[[_partInfo objectForKey:GSWHTTPHeader_ContentType] lowercaseString]; - NSDebugMLLog(@"requests",@"_parsedPartsContentType=%@",_parsedPartsContentType); - _parsedPartsContentDisposition=[_partInfo objectForKey:@"content-disposition"]; - NSDebugMLLog(@"requests",@"_parsedPartsContentDisposition=%@",_parsedPartsContentDisposition); - //Convert: "form-data; name=\"9.1\"; filename=\"C:\\TEMP\\zahn.txt\""; - // into: {filename = "C:\\TEMP\\zahn.txt"; "form-data" = "form-data"; name = 9.1; } - _parsedContentDispositionOfParsedPart=[self _parseOneHeader:_parsedPartsContentDisposition]; - NSDebugMLLog(@"requests",@"_parsedContentDispositionOfParsedPart=%@",_parsedContentDispositionOfParsedPart); - _enum=[_parsedContentDispositionOfParsedPart keyEnumerator]; - _name=[_parsedContentDispositionOfParsedPart objectForKey:@"name"]; - NSDebugMLLog(@"requests",@"_name=%@",_name); - if (!_name) - { - ExceptionRaise(@"GSWRequest", - @"GSWRequest: No name \n%@\n", - _parsedContentDispositionOfParsedPart); - }; - while((_dscrKey=[_enum nextObject])) - { - NSDebugMLLog(@"requests",@"_dscrKey=%@",_dscrKey); - if (![_dscrKey isEqualToString:@"name"] && ![_dscrKey isEqualToString:@"form-data"]) - { - NSString* _key=nil; - _descrValue=[_parsedContentDispositionOfParsedPart objectForKey:_dscrKey]; - NSDebugMLLog(@"requests",@"_descrValue=%@",_descrValue); - _key=[NSString stringWithFormat:@"%@.%@",_name,_dscrKey]; - NSDebugMLLog(@"requests",@"_key=%@",_key); - [_formValues setObject:[NSArray arrayWithObject:_descrValue] - forKey:_key]; - }; - }; - if (_parsedPartsCount>1) - { - NSArray* _values=[_parsedParts subarrayWithRange:NSMakeRange(1,[_parsedParts count]-1)]; - NSMutableArray* _valuesNew=[NSMutableArray array]; - NSDebugMLLog(@"requests",@"_values=%@",_values); - NSDebugMLLog(@"requests",@"_parsedPartsContentType=%@",_parsedPartsContentType); - if (!_parsedPartsContentType || [_parsedPartsContentType isEqualToString:GSWHTTPHeader_MimeType_TextPlain]) - { - int _valueIndex=0; - int _valuesCount=[_values count]; - id _value=nil; - for(_valueIndex=0;_valueIndex<_valuesCount;_valueIndex++) - { - _value=[_values objectAtIndex:_valueIndex]; - NSDebugMLLog(@"requests",@"_value=%@",_value); - _value=[[[NSString alloc]initWithData:_value - encoding:NSISOLatin1StringEncoding]autorelease]; - [_valuesNew addObject:_value]; - }; - _values=[NSArray arrayWithArray:_valuesNew]; - }; - [_formValues setObject:_values - forKey:_name]; - }; - }; - }; - }; + partInfo=[parsedParts objectAtIndex:0]; + + NSDebugMLLog(@"requests",@"partInfo=%@", + partInfo); + NSAssert1([partInfo isKindOfClass:[NSDictionary class]], + @"partInfo %@ is not a dictionary",partInfo); + + parsedPartsContentType=[[partInfo objectForKey:GSWHTTPHeader_ContentType] lowercaseString]; + NSDebugMLLog(@"requests",@"parsedPartsContentType=%@", + parsedPartsContentType); + parsedPartsContentDisposition=[partInfo objectForKey:@"content-disposition"]; + NSDebugMLLog(@"requests",@"parsedPartsContentDisposition=%@", + parsedPartsContentDisposition); + //Convert: "form-data; name=\"9.1\"; filename=\"C:\\TEMP\\zahn.txt\""; + // into: {filename = "C:\\TEMP\\zahn.txt"; "form-data" = "form-data"; name = 9.1; } + parsedContentDispositionOfParsedPart=[self _parseOneHeader:parsedPartsContentDisposition]; + NSDebugMLLog(@"requests",@"parsedContentDispositionOfParsedPart=%@", + parsedContentDispositionOfParsedPart); + anEnumerator=[parsedContentDispositionOfParsedPart keyEnumerator]; + aName=[parsedContentDispositionOfParsedPart objectForKey:@"name"]; + NSDebugMLLog(@"requests",@"aName=%@", + aName); + if (!aName) + { + ExceptionRaise(@"GSWRequest", + @"GSWRequest: No name \n%@\n", + parsedContentDispositionOfParsedPart); + }; + while((dscrKey=[anEnumerator nextObject])) + { + NSDebugMLLog(@"requests",@"dscrKey=%@",dscrKey); + if (![dscrKey isEqualToString:@"name"] + && ![dscrKey isEqualToString:@"form-data"]) + { + NSString* _key=nil; + descrValue=[parsedContentDispositionOfParsedPart objectForKey:dscrKey]; + NSDebugMLLog(@"requests",@"descrValue=%@",descrValue); + _key=[NSString stringWithFormat:@"%@.%@",aName,dscrKey]; + NSDebugMLLog(@"requests",@"_key=%@",_key); + [formValues setObject:[NSArray arrayWithObject:descrValue] + forKey:_key]; + }; + }; + if (parsedPartsCount>1) + { + NSArray* values=[parsedParts subarrayWithRange:NSMakeRange(1,[parsedParts count]-1)]; + NSMutableArray* valuesNew=[NSMutableArray array]; + NSDebugMLLog(@"requests",@"values=%@", + values); + NSDebugMLLog(@"requests",@"parsedPartsContentType=%@", + parsedPartsContentType); + if (!parsedPartsContentType + || [parsedPartsContentType isEqualToString:GSWHTTPHeader_MimeType_TextPlain]) + { + int valueIndex=0; + int valuesCount=[values count]; + id value=nil; + for(valueIndex=0;valueIndex0) - { - _parts=[_parts subarrayWithRange:NSMakeRange(1,[_parts count]-1)]; - }; + if ([parts count]>0) + { + parts=[parts subarrayWithRange:NSMakeRange(1,[parts count]-1)]; + }; // Now deleting last \r\n of each object - _parts=[_parts mutableCopy]; - for(i=0;i<[_parts count];i++) - { - tmpData=[_parts objectAtIndex:i]; - if (i==[_parts count]-1) - { - //Delete the last \r\nseparator--\r\n - _boundary=[NSString stringWithFormat:@"\r\n%@--\r\n",boundary_]; - NSDebugMLLog(@"requests",@"boundary_=%@",boundary_); - _dataBoundary=[_boundary dataUsingEncoding:NSISOLatin1StringEncoding];//TODO - NSDebugMLLog(@"requests",@"tmpData_=%@",tmpData); - tmpData=[tmpData dataByDeletingLastBytesCount:[_dataBoundary length]]; - NSDebugMLLog(@"requests",@"tmpData=%@",tmpData); - } - else - { - tmpData=[tmpData dataByDeletingLastBytesCount:2]; - }; - [(NSMutableArray*)_parts replaceObjectAtIndex:i - withObject:tmpData]; - }; + parts=[parts mutableCopy]; + for(i=0;i<[parts count];i++) + { + tmpData=[parts objectAtIndex:i]; + if (i==[parts count]-1) + { + //Delete the last \r\nseparator--\r\n + boundaryString=[NSString stringWithFormat:@"\r\n%@--\r\n",aBoundary]; + NSDebugMLLog(@"requests",@"aBoundary=%@",aBoundary); + dataBoundary=[boundaryString dataUsingEncoding:NSISOLatin1StringEncoding];//TODO + NSDebugMLLog(@"requests",@"tmpData_=%@",tmpData); + tmpData=[tmpData dataByDeletingLastBytesCount:[dataBoundary length]]; + NSDebugMLLog(@"requests",@"tmpData=%@",tmpData); + } + else + { + tmpData=[tmpData dataByDeletingLastBytesCount:2]; + }; + [(NSMutableArray*)parts replaceObjectAtIndex:i + withObject:tmpData]; + }; { - for(i=0;i<[_parts count];i++) - { - tmpData=[_parts objectAtIndex:i]; - if ([tmpData length]<400) - { - NSString* _dataString=nil; - _dataString=[[[NSString alloc]initWithData:tmpData - encoding:NSISOLatin1StringEncoding]autorelease]; - NSDebugMLLog(@"requests",@"_tmpDataString=%@",_dataString); + for(i=0;i<[parts count];i++) + { + tmpData=[parts objectAtIndex:i]; + if ([tmpData length]<400) + { + NSString* dataString=nil; + dataString=[[[NSString alloc]initWithData:tmpData + encoding:NSISOLatin1StringEncoding]autorelease]; + NSDebugMLLog(@"requests",@"tmpDataString=%@",dataString); - } - else - { - NSDebugMLLog(@"requests",@"tmpData=%@",tmpData); - }; - }; + } + else + { + NSDebugMLLog(@"requests",@"tmpData=%@",tmpData); + }; + }; }; LOGObjectFnStop(); - return _parts; + return parts; }; //-------------------------------------------------------------------- @@ -1337,83 +1357,86 @@ method=%@, uri=%@, httpVersion=%@, headers=%@, content=%@, userInfo=%@, defaultF // }, // <7375626d 6974> // ) --(NSArray*)_parseData:(NSData*)data_ +-(NSArray*)_parseData:(NSData*)aData { - NSArray* _parsedData=nil; - NSMutableDictionary* _headers=[NSMutableDictionary dictionary]; - NSData* _data=nil; + NSArray* parsedData=nil; + NSMutableDictionary* tmpHeaders=[NSMutableDictionary dictionary]; + NSData* tmpData=nil; LOGObjectFnStart(); - if (data_) - { - unsigned int _dataLength=[data_ length]; - const unsigned char* _bytes=(unsigned char*)[data_ bytes]; - BOOL _headersEnd=NO; - int _start=0; - int i=0; - for(i=0;i<_dataLength-1 && !_headersEnd;i++) // -1 for \n - { - //Parse Headers - if (_bytes[i]=='\r' && _bytes[i+1]=='\n') - { - if (i-_start==0)//Empty Line: End Of Headers - _headersEnd=YES; - else - { - NSRange _range; - NSString* _key=@""; - NSString* _value=@""; - NSData* _headerData=[data_ subdataWithRange:NSMakeRange(_start,i-_start)]; - NSString* _headerString=[[[NSString alloc]initWithData:_headerData - encoding:NSISOLatin1StringEncoding]autorelease]; - NSDebugMLLog(@"requests",@"i=%d",i); - NSDebugMLLog(@"requests",@"_start=%d",_start); - NSDebugMLLog(@"requests",@"_headerData=%@",_headerData); - NSDebugMLLog(@"requests",@"_headerString=%@",_headerString); - _range=[_headerString rangeOfString:@": "]; - if (_range.length>0) - { - _key=[_headerString substringToIndex:_range.location]; - _key=[_key lowercaseString]; - if (_range.location+1<[_headerString length]) - { - _value=[_headerString substringFromIndex:_range.location+1]; - _value=[_value stringByTrimmingSpaces]; - }; - }; - [_headers setObject:_value - forKey:_key]; - }; - i++; //Pass the '\n' - _start=i+1; - }; - }; - if (!_headersEnd) - { - //TODO error - NSDebugMLog(@"Error"); - } - else - { - NSDebugMLLog(@"requests",@"i=%d _dataLength=%d _dataLength-i=%d",i,_dataLength,(_dataLength-i)); - _data=[data_ subdataWithRange:NSMakeRange(i,_dataLength-i)]; - //I'm not sure this is good but it avoid 2 bytes datas on an empty input type=file located t the end of the request) - //It may be better to deal with this few lines up, around (_headersEnd=YES;) - - if ([_data length]==2) + if (aData) + { + unsigned int tmpDataLength=[aData length]; + const unsigned char* bytes=(unsigned char*)[aData bytes]; + BOOL tmpHeadersEnd=NO; + int start=0; + int i=0; + for(i=0;i0) { - const unsigned char* _bytes=(unsigned char*)[_data bytes]; - if (_bytes[0]=='\r' && _bytes[1]=='\n') - _data=[NSData data]; + key=[tmpHeaderString substringToIndex:range.location]; + key=[key lowercaseString]; + if (range.location+1<[tmpHeaderString length]) + { + value=[tmpHeaderString substringFromIndex:range.location+1]; + value=[value stringByTrimmingSpaces]; + }; }; - }; - _headers=[NSDictionary dictionaryWithDictionary:_headers]; - _parsedData=[NSArray arrayWithObjects:_headers,_data,nil]; - NSDebugMLLog(@"requests",@"_headers=%@",_headers); - NSDebugMLLog(@"requests",@"_data %p (length=%d)=%@",_data,[_data length],_data); - NSDebugMLLog(@"requests",@"_parsedData %p =%@",_parsedData,_parsedData); - }; + [tmpHeaders setObject:value + forKey:key]; + }; + i++; //Pass the '\n' + start=i+1; + }; + }; + if (!tmpHeadersEnd) + { + //TODO error + NSDebugMLog(@"Error"); + } + else + { + NSDebugMLLog(@"requests",@"i=%d tmpDataLength=%d tmpDataLength-i=%d", + i,tmpDataLength,(tmpDataLength-i)); + tmpData=[aData subdataWithRange:NSMakeRange(i,tmpDataLength-i)]; + //I'm not sure this is good but it avoid 2 bytes datas on an empty input type=file located t the end of the request) + //It may be better to deal with this few lines up, around (tmpHeadersEnd=YES;) + + if ([tmpData length]==2) + { + const unsigned char* bytes=(unsigned char*)[tmpData bytes]; + if (bytes[0]=='\r' && bytes[1]=='\n') + tmpData=[NSData data]; + }; + }; + tmpHeaders=[NSDictionary dictionaryWithDictionary:tmpHeaders]; + parsedData=[NSArray arrayWithObjects:tmpHeaders,tmpData,nil]; + NSDebugMLLog(@"requests",@"tmpHeaders=%@",tmpHeaders); + NSDebugMLLog(@"requests",@"tmpData %p (length=%d)=%@", + tmpData,[tmpData length],tmpData); + NSDebugMLLog(@"requests",@"parsedData %p =%@", + parsedData,parsedData); + }; LOGObjectFnStop(); - return _parsedData; + return parsedData; }; //-------------------------------------------------------------------- @@ -1434,63 +1457,63 @@ into {"form-data" = "form-data"; name = 9.3; } */ --(NSDictionary*)_parseOneHeader:(NSString*)_header +-(NSDictionary*)_parseOneHeader:(NSString*)aHeader { //TODO Process quoted string ! - NSMutableDictionary* _parsedParts=nil; - NSArray* _headerParts=nil; - int _partIndex=0; - int _partCount=0; - NSString* _part=nil; + NSMutableDictionary* parsedParts=nil; + NSArray* headerParts=nil; + int partIndex=0; + int partCount=0; + NSString* part=nil; LOGObjectFnStart(); - NSDebugMLLog(@"requests",@"_header=%@",_header); - _parsedParts=[NSMutableDictionary dictionary]; - NSDebugMLLog(@"requests",@"_parsedParts=%@",_parsedParts); - _headerParts=[_header componentsSeparatedByString:@";"]; - NSDebugMLLog(@"requests",@"_headerParts=%@",_headerParts); - _partCount=[_headerParts count]; - for(_partIndex=0;_partIndex<_partCount;_partIndex++) - { - NSArray* _parsedPart=nil; - int _parsedPartCount=0; - NSString* _key=nil; - NSString* _value=nil; - _part=[_headerParts objectAtIndex:_partIndex]; - NSDebugMLLog(@"requests",@"_part=%@",_part); - _part=[_part stringByTrimmingSpaces]; - NSDebugMLLog(@"requests",@"_part=%@",_part); - _parsedPart=[_part componentsSeparatedByString:@"="]; - NSDebugMLLog(@"requests",@"_parsedPart=%@",_parsedPart); - _parsedPartCount=[_parsedPart count]; - switch(_parsedPartCount) - { - case 1: - _key=[_parsedPart objectAtIndex:0]; - _value=_key; - break; - case 2: - _key=[_parsedPart objectAtIndex:0]; - _value=[_parsedPart objectAtIndex:1]; - break; - default: - NSAssert1(NO,@"objects number != 1 or 2 in %@",_parsedPart); - //TODO Error - break; - }; - NSDebugMLLog(@"requests",@"_key=%@",_key); - NSDebugMLLog(@"requests",@"_value=%@",_value); - if (_key && _value) - { - if ([_value isQuotedWith:@"\""]) - _value=[_value stringWithoutQuote:@"\""]; - [_parsedParts setObject:_value - forKey:_key]; - }; - }; - NSDebugMLLog(@"requests",@"_parsedParts=%@",_parsedParts); - _parsedParts=[NSDictionary dictionaryWithDictionary:_parsedParts]; + NSDebugMLLog(@"requests",@"aHeader=%@",aHeader); + parsedParts=(NSMutableDictionary*)[NSMutableDictionary dictionary]; + NSDebugMLLog(@"requests",@"parsedParts=%@",parsedParts); + headerParts=[aHeader componentsSeparatedByString:@";"]; + NSDebugMLLog(@"requests",@"headerParts=%@",headerParts); + partCount=[headerParts count]; + for(partIndex=0;partIndex_index) - { - tmp=[_requestHandlerPathArray objectAtIndex:_index]; - NSDebugMLLog(@"requests",@"tmp=%@",tmp); - if ([tmp hasSuffix:GSWPagePSuffix[GSWebNamingConv]]) + requestHandlerKey=[((GSWDynamicURLString*)[self uri]) urlRequestHandlerKey]; + NSDebugMLLog(@"requests",@"requestHandlerKey=%@",requestHandlerKey); + if (!requestHandlerKey + || (![requestHandlerKey isEqualToString:GSWDirectActionRequestHandlerKey[GSWebNamingConv]] + &&![requestHandlerKey isEqualToString:GSWDirectActionRequestHandlerKey[GSWebNamingConvInversed]])) + { + requestHandlerPathArray=[self requestHandlerPathArray]; + NSDebugMLLog(@"requests",@"requestHandlerPathArray=%@",requestHandlerPathArray); + if ([requestHandlerPathArray count]>index) + { + tmpString=[requestHandlerPathArray objectAtIndex:index]; + NSDebugMLLog(@"requests",@"tmpString=%@",tmpString); + if ([tmpString hasSuffix:GSWPagePSuffix[GSWebNamingConv]]) + { + gswpage=[tmpString stringWithoutSuffix:GSWPagePSuffix[GSWebNamingConv]]; + NSDebugMLLog(@"requests",@"gswpage=%@",gswpage); + index++; + } + else if ([tmpString hasSuffix:GSWPagePSuffix[GSWebNamingConvInversed]]) + { + gswpage=[tmpString stringWithoutSuffix:GSWPagePSuffix[GSWebNamingConvInversed]]; + NSDebugMLLog(@"requests",@"gswpage=%@",gswpage); + index++; + }; + if ([requestHandlerPathArray count]>index) + { + gswsid=[requestHandlerPathArray objectAtIndex:index]; + NSDebugMLLog(@"requests",@"gswsid=%@",gswsid); + index++; + if ([requestHandlerPathArray count]>index) + { + NSString* senderID=[requestHandlerPathArray objectAtIndex:index]; + NSDebugMLLog(@"requests",@"senderID=%@",senderID); + index++; + if (senderID && [senderID length]>0) { - _gswpage=[tmp stringWithoutSuffix:GSWPagePSuffix[GSWebNamingConv]]; - NSDebugMLLog(@"requests",@"_gswpage=%@",_gswpage); - _index++; - } - else if ([tmp hasSuffix:GSWPagePSuffix[GSWebNamingConvInversed]]) - { - _gswpage=[tmp stringWithoutSuffix:GSWPagePSuffix[GSWebNamingConvInversed]]; - NSDebugMLLog(@"requests",@"_gswpage=%@",_gswpage); - _index++; + NSArray* senderIDParts=[senderID componentsSeparatedByString:@"."]; + NSDebugMLLog(@"requests",@"senderIDParts=%@",senderIDParts); + if ([senderIDParts count]>0) + { + tmpString=[senderIDParts objectAtIndex:0]; + NSDebugMLLog(@"requests",@"tmpString=%@",tmpString); + if (tmpString && [tmpString length]>0) + gswcid=tmpString; + + if ([senderIDParts count]>1) + { + tmpString=[[senderIDParts subarrayWithRange: + NSMakeRange(1,[senderIDParts count]-1)] + componentsJoinedByString:@"."]; + NSDebugMLLog(@"requests",@"tmpString=%@",tmpString); + if (tmpString && [tmpString length]>0) + { + gsweid=tmpString; + NSDebugMLLog(@"requests",@"gsweid=%@",gsweid); + }; + }; + }; }; - if ([_requestHandlerPathArray count]>_index) - { - _gswsid=[_requestHandlerPathArray objectAtIndex:_index]; - NSDebugMLLog(@"requests",@"_gswsid=%@",_gswsid); - _index++; - if ([_requestHandlerPathArray count]>_index) - { - NSString* _senderID=[_requestHandlerPathArray objectAtIndex:_index]; - NSDebugMLLog(@"requests",@"_senderID=%@",_senderID); - _index++; - if (_senderID && [_senderID length]>0) - { - NSArray* _senderIDParts=[_senderID componentsSeparatedByString:@"."]; - NSDebugMLLog(@"requests",@"_senderIDParts=%@",_senderIDParts); - if ([_senderIDParts count]>0) - { - tmp=[_senderIDParts objectAtIndex:0]; - NSDebugMLLog(@"requests",@"tmp=%@",tmp); - if (tmp && [tmp length]>0) - _gswcid=tmp; - - if ([_senderIDParts count]>1) - { - tmp=[[_senderIDParts subarrayWithRange: - NSMakeRange(1,[_senderIDParts count]-1)] - componentsJoinedByString:@"."]; - NSDebugMLLog(@"requests",@"tmp=%@",tmp); - if (tmp && [tmp length]>0) - { - _gsweid=tmp; - NSDebugMLLog(@"requests",@"_gsweid=%@",_gsweid); - }; - }; - }; - }; - }; - }; - }; - }; + }; + }; + }; + }; - if (_gswpage) - [_dict setObject:_gswpage - forKey:GSWKey_PageName[GSWebNamingConv]]; + if (gswpage) + [dict setObject:gswpage + forKey:GSWKey_PageName[GSWebNamingConv]]; - if (_gswsid) - [_dict setObject:_gswsid - forKey:GSWKey_SessionID[GSWebNamingConv]]; + if (gswsid) + [dict setObject:gswsid + forKey:GSWKey_SessionID[GSWebNamingConv]]; - if (_gswcid) - [_dict setObject:_gswcid - forKey:GSWKey_ContextID[GSWebNamingConv]]; - - if (_gsweid) - [_dict setObject:_gsweid - forKey:GSWKey_ElementID[GSWebNamingConv]]; - - _applicationNumber=[uri urlApplicationNumber]; - if (_applicationNumber<0) - { - NSString* _tmp=[self cookieValueForKey:GSWKey_InstanceID[GSWebNamingConv]]; - if (!_tmp) - _tmp=[self cookieValueForKey:GSWKey_InstanceID[GSWebNamingConvInversed]]; - if (_tmp) - _applicationNumber=[_gswinst intValue]; - }; - if (_applicationNumber>=0) - [_dict setObject:[NSString stringWithFormat:@"%d",_applicationNumber] - forKey:GSWKey_InstanceID[GSWebNamingConv]]; - - NSDebugMLLog(@"requests",@"AA _dict=%@",_dict); + if (gswcid) + [dict setObject:gswcid + forKey:GSWKey_ContextID[GSWebNamingConv]]; + + if (gsweid) + [dict setObject:gsweid + forKey:GSWKey_ElementID[GSWebNamingConv]]; + + applicationNumber=[_uri urlApplicationNumber]; + if (applicationNumber<0) + { + NSString* tmpString2=[self cookieValueForKey:GSWKey_InstanceID[GSWebNamingConv]]; + if (!tmpString2) + tmpString2=[self cookieValueForKey:GSWKey_InstanceID[GSWebNamingConvInversed]]; + if (tmpString2) + applicationNumber=[gswinst intValue]; + }; + if (applicationNumber>=0) + [dict setObject:[NSString stringWithFormat:@"%d",applicationNumber] + forKey:GSWKey_InstanceID[GSWebNamingConv]]; + + NSDebugMLLog(@"requests",@"AA dict=%@",dict); LOGObjectFnStop(); - return _dict; + return dict; }; @end diff --git a/GSWeb.framework/GSWResourceManager.m b/GSWeb.framework/GSWResourceManager.m index cb7e205..cfa80d7 100644 --- a/GSWeb.framework/GSWResourceManager.m +++ b/GSWeb.framework/GSWResourceManager.m @@ -60,6 +60,7 @@ NSString* localNotFoundMarker=@"NOTFOUND"; //NSDebugMLLog(@"resmanager",@"mainBundle:%@",mainBundle); bundlePath=[mainBundle bundlePath]; //NSDebugMLLog(@"resmanager",@"bundlePath:%@",bundlePath); + printf("bundlePath:%s",[bundlePath lossyCString]); deployedBundle=[GSWDeployedBundle bundleWithPath:bundlePath]; //NSDebugMLLog(@"resmanager",@"deployedBundle:%@",deployedBundle); @@ -1594,6 +1595,7 @@ NSString* localNotFoundMarker=@"NOTFOUND"; NSDebugMLLog(@"resmanager",@"wrapperName=%@",wrapperName); baseURL=[applicationBaseURL stringByAppendingFormat:@"/%@",wrapperName]; NSDebugMLLog(@"resmanager",@"baseURL=%@",baseURL); + NSDebugMLLog(@"resmanager",@"[globalAppProjectBundle bundlePath]=%@",[globalAppProjectBundle bundlePath]); globalAppGSWBundle=[[GSWBundle alloc]initWithPath:[globalAppProjectBundle bundlePath] baseURL:baseURL]; NSDebugMLLog(@"resmanager",@"globalAppGSWBundle=%@",globalAppGSWBundle); diff --git a/GSWeb.framework/GSWResponse.h b/GSWeb.framework/GSWResponse.h index 2f11085..688a7e6 100644 --- a/GSWeb.framework/GSWResponse.h +++ b/GSWeb.framework/GSWResponse.h @@ -1,11 +1,16 @@ -/** GSWResponse.h - GSWeb: Class GSWResponse +/** GSWResponse.h - GSWeb: Class GSWResponse + Copyright (C) 1999-2002 Free Software Foundation, Inc. Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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,6 +24,7 @@ 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. + **/ // $Id$ @@ -35,17 +41,17 @@ @interface GSWResponse : NSObject { @private - NSString* httpVersion; - unsigned int status; - NSMutableDictionary* headers; - NSMutableArray* contentFaults; - NSMutableData* contentData; - NSStringEncoding contentEncoding; - NSDictionary* userInfo; - NSMutableArray* cookies; - BOOL isClientCachingDisabled; - BOOL contentFaultsHaveBeenResolved; - BOOL isFinalizeInContextHasBeenCalled; + NSString* _httpVersion; + unsigned int _status; + NSMutableDictionary* _headers; + NSMutableArray* _contentFaults; + NSMutableData* _contentData; + NSStringEncoding _contentEncoding; + NSDictionary* _userInfo; + NSMutableArray* _cookies; + BOOL _isClientCachingDisabled; + BOOL _contentFaultsHaveBeenResolved; + BOOL _isFinalizeInContextHasBeenCalled; }; -(id)init; @@ -59,9 +65,9 @@ -(NSString*)httpVersion; -(void)setContent:(NSData*)someData; -(void)setHeader:(NSString*)header - forKey:(NSString*)key; + forKey:(NSString*)key; -(void)setHeaders:(NSArray*)headerList - forKey:(NSString*)key; + forKey:(NSString*)key; -(void)setHeaders:(NSDictionary*)headerList; -(NSMutableDictionary*)headers; -(void)setHTTPVersion:(NSString*)version; diff --git a/GSWeb.framework/GSWResponse.m b/GSWeb.framework/GSWResponse.m index 0712a99..bb4e432 100644 --- a/GSWeb.framework/GSWResponse.m +++ b/GSWeb.framework/GSWResponse.m @@ -1,11 +1,16 @@ -/* GSWResponse.m - GSWeb: Class GSWResponse - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWResponse.m - GSWeb: Class GSWResponse + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -38,13 +44,13 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //OK LOGObjectFnStart(); if ((self=[super init])) - { - httpVersion=@"HTTP/1.0"; - status=200; - headers=[NSMutableDictionary new]; - [self _initContentData]; - contentEncoding=NSISOLatin1StringEncoding; - }; + { + _httpVersion=@"HTTP/1.0"; + _status=200; + _headers=[NSMutableDictionary new]; + [self _initContentData]; + _contentEncoding=NSISOLatin1StringEncoding; + }; LOGObjectFnStop(); return self; }; @@ -55,38 +61,38 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; // GSWLogAssertGood(self); // NSDebugFLog(@"dealloc Response %p",self); // NSDebugFLog0(@"Release Response httpVersion"); - DESTROY(httpVersion); + DESTROY(_httpVersion); // NSDebugFLog0(@"Release Response headers"); - DESTROY(headers); + DESTROY(_headers); // NSDebugFLog0(@"Release Response contentFaults"); - DESTROY(contentFaults); + DESTROY(_contentFaults); // NSDebugFLog0(@"Release Response contentData"); - DESTROY(contentData); + DESTROY(_contentData); // NSDebugFLog0(@"Release Response userInfo"); - DESTROY(userInfo); + DESTROY(_userInfo); //NSDebugFLog0(@"Release Response cookies"); - DESTROY(cookies); + DESTROY(_cookies); // NSDebugFLog0(@"Release Response"); [super dealloc]; }; //-------------------------------------------------------------------- --(id)copyWithZone:(NSZone*)zone_ +-(id)copyWithZone:(NSZone*)zone { - GSWResponse* clone = [[isa allocWithZone:zone_] init]; + GSWResponse* clone = [[isa allocWithZone:zone] init]; if (clone) - { - ASSIGNCOPY(clone->httpVersion,httpVersion); - clone->status=status; - ASSIGNCOPY(clone->headers,headers); - ASSIGNCOPY(clone->contentFaults,contentFaults); - ASSIGNCOPY(clone->contentData,contentData); - clone->contentEncoding=contentEncoding; - ASSIGNCOPY(clone->userInfo,userInfo); - ASSIGNCOPY(clone->cookies,cookies); - clone->isClientCachingDisabled=isClientCachingDisabled; - clone->contentFaultsHaveBeenResolved=contentFaultsHaveBeenResolved; - }; + { + ASSIGNCOPY(clone->_httpVersion,_httpVersion); + clone->_status=_status; + ASSIGNCOPY(clone->_headers,_headers); + ASSIGNCOPY(clone->_contentFaults,_contentFaults); + ASSIGNCOPY(clone->_contentData,_contentData); + clone->_contentEncoding=_contentEncoding; + ASSIGNCOPY(clone->_userInfo,_userInfo); + ASSIGNCOPY(clone->_cookies,_cookies); + clone->_isClientCachingDisabled=_isClientCachingDisabled; + clone->_contentFaultsHaveBeenResolved=_contentFaultsHaveBeenResolved; + }; return clone; }; @@ -96,7 +102,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSData*)content { //TODO exception.. - return contentData; + return _contentData; }; //-------------------------------------------------------------------- @@ -104,12 +110,12 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //NDFN -(void)willSend { - NSAssert(isFinalizeInContextHasBeenCalled,@"GSWResponse _finalizeInContext: not called"); + NSAssert(_isFinalizeInContextHasBeenCalled,@"GSWResponse _finalizeInContext: not called"); }; -(void)forceFinalizeInContext { - isFinalizeInContextHasBeenCalled=YES; + _isFinalizeInContextHasBeenCalled=YES; }; //-------------------------------------------------------------------- @@ -120,13 +126,13 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; // 1st header: if multiple headers for key_ // header: otherwise --(NSString*)headerForKey:(NSString*)key_ +-(NSString*)headerForKey:(NSString*)key { - id object=[headers objectForKey:key_]; + id object=[_headers objectForKey:key]; if (object && [object isKindOfClass:[NSArray class]]) - return [object objectAtIndex:0]; + return [object objectAtIndex:0]; else - return (NSString*)object; + return (NSString*)object; }; //-------------------------------------------------------------------- @@ -135,20 +141,20 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; // return array of header keys or nil if no header -(NSArray*)headerKeys { - return [headers allKeys]; + return [_headers allKeys]; }; //-------------------------------------------------------------------- // headersForKey: //return array of headers of key_ --(NSArray*)headersForKey:(NSString*)key_ +-(NSArray*)headersForKey:(NSString*)key { - id object=[headers objectForKey:key_]; + id object=[_headers objectForKey:key]; if (!object || [object isKindOfClass:[NSArray class]]) - return (NSArray*)object; + return (NSArray*)object; else - return [NSArray arrayWithObject:object]; + return [NSArray arrayWithObject:object]; }; //-------------------------------------------------------------------- @@ -158,51 +164,51 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSString*)httpVersion { - return httpVersion; + return _httpVersion; }; //-------------------------------------------------------------------- // setContent: //Set content with contentData_ --(void)setContent:(NSData*)contentData_ +-(void)setContent:(NSData*)contentData { - if (contentData_) - { - NSMutableData* _void=[[NSMutableData new]autorelease]; - [_void appendData:contentData_]; - contentData_=_void; - }; - ASSIGN(contentData,(NSMutableData*)contentData_); + if (contentData) + { + NSMutableData* aData=[[NSMutableData new]autorelease]; + [aData appendData:contentData]; + contentData=aData; + }; + ASSIGN(_contentData,(NSMutableData*)contentData); }; //-------------------------------------------------------------------- // setHeader:forKey: --(void)setHeader:(NSString*)header_ - forKey:(NSString*)key_ +-(void)setHeader:(NSString*)header + forKey:(NSString*)key { //OK - id object=[headers objectForKey:key_]; + id object=[_headers objectForKey:key]; if (object) - [self setHeaders:[object arrayByAddingObject:header_] - forKey:key_]; + [self setHeaders:[object arrayByAddingObject:header] + forKey:key]; else - [self setHeaders:[NSArray arrayWithObject:header_] - forKey:key_]; + [self setHeaders:[NSArray arrayWithObject:header] + forKey:key]; }; //-------------------------------------------------------------------- // setHeaders:forKey: --(void)setHeaders:(NSArray*)headers_ - forKey:(NSString*)key_ +-(void)setHeaders:(NSArray*)headers + forKey:(NSString*)key { //OK - if (!headers) - headers=[NSMutableDictionary new]; - [headers setObject:headers_ - forKey:key_]; + if (!_headers) + _headers=[NSMutableDictionary new]; + [_headers setObject:headers + forKey:key]; }; //-------------------------------------------------------------------- @@ -210,8 +216,8 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(void)setHeaders:(NSDictionary*)headerDictionary { - if (!headers) - headers=[NSMutableDictionary new]; + if (!_headers) + _headers=[NSMutableDictionary new]; if (headerDictionary) { @@ -231,34 +237,34 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSMutableDictionary*)headers { - return headers; + return _headers; }; //-------------------------------------------------------------------- // setHTTPVersion: //sets the http version (like @"HTTP/1.0"). --(void)setHTTPVersion:(NSString*)version_ +-(void)setHTTPVersion:(NSString*)version { //OK - ASSIGN(httpVersion,version_); + ASSIGN(_httpVersion,version); }; //-------------------------------------------------------------------- // setStatus: //sets http status --(void)setStatus:(unsigned int)status_ +-(void)setStatus:(unsigned int)status { - status=status_; + _status=status; }; //-------------------------------------------------------------------- // setUserInfo: --(void)setUserInfo:(NSDictionary*)userInfo_ +-(void)setUserInfo:(NSDictionary*)userInfo { - ASSIGN(userInfo,userInfo_); + ASSIGN(_userInfo,userInfo); }; //-------------------------------------------------------------------- @@ -266,7 +272,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(unsigned int)status { - return status; + return _status; }; //-------------------------------------------------------------------- @@ -274,22 +280,22 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSDictionary*)userInfo { - return userInfo; + return _userInfo; }; //-------------------------------------------------------------------- -(void)disableClientCaching { //OK - NSString* _dateString=nil; + NSString* dateString=nil; LOGObjectFnStart(); - if (!isClientCachingDisabled) + if (!_isClientCachingDisabled) { - _dateString=[[NSCalendarDate date] htmlDescription]; - NSDebugMLLog(@"low",@"_dateString:%@",_dateString); - [self setHeader:_dateString + dateString=[[NSCalendarDate date] htmlDescription]; + NSDebugMLLog(@"low",@"dateString:%@",dateString); + [self setHeader:dateString forKey:@"date"]; - [self setHeader:_dateString + [self setHeader:dateString forKey:@"expires"]; [self setHeader:@"no-cache" forKey:@"pragma"]; @@ -297,7 +303,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; [self setHeaders:[NSArray arrayWithObjects:@"private",@"no-cache",@"max-age=0",nil] forKey:@"cache-control"]; - isClientCachingDisabled=YES; + _isClientCachingDisabled=YES; }; LOGObjectFnStop(); }; @@ -308,16 +314,16 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; NSString* description=nil; LOGObjectFnStart(); description=[NSString stringWithFormat: - @"<%s %p - httpVersion=%@ status=%d headers=%p contentFaults=%p contentData=%p contentEncoding=%d userInfo=%p>", - object_get_class_name(self), - (void*)self, - httpVersion, - status, - (void*)headers, - (void*)contentFaults, - (void*)contentData, - (int)contentEncoding, - (void*)userInfo]; + @"<%s %p - httpVersion=%@ status=%d headers=%p contentFaults=%p contentData=%p contentEncoding=%d userInfo=%p>", + object_get_class_name(self), + (void*)self, + _httpVersion, + _status, + (void*)_headers, + (void*)_contentFaults, + (void*)_contentData, + (int)_contentEncoding, + (void*)_userInfo]; LOGObjectFnStop(); return description; }; @@ -329,64 +335,64 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //-------------------------------------------------------------------- // appendContentBytes:length: --(void)appendContentBytes:(const void*)bytes_ - length:(unsigned)length_ +-(void)appendContentBytes:(const void*)bytes + length:(unsigned)length { LOGObjectFnStart(); - [contentData appendBytes:bytes_ - length:length_]; + [_contentData appendBytes:bytes + length:length]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- // appendContentCharacter: --(void)appendContentCharacter:(char)char_ +-(void)appendContentCharacter:(char)aChar { LOGObjectFnStart(); - [contentData appendBytes:&char_ - length:1]; + [_contentData appendBytes:&aChar + length:1]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- // appendContentData: --(void)appendContentData:(NSData*)dataObject_ +-(void)appendContentData:(NSData*)dataObject { LOGObjectFnStart(); - NSDebugMLLog(@"low",@"response=%p dataObject_:%@",self,dataObject_); - [contentData appendData:dataObject_]; + NSDebugMLLog(@"low",@"response=%p dataObject:%@",self,dataObject); + [_contentData appendData:dataObject]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- // appendContentString: --(void)appendContentString:(NSString*)string_ +-(void)appendContentString:(NSString*)aString { LOGObjectFnStart(); - NSDebugMLLog(@"low",@"response=%p contentEncoding=%d",self,(int)contentEncoding); - if (string_) + NSDebugMLLog(@"low",@"response=%p contentEncoding=%d",self,(int)_contentEncoding); + if (aString) { NSData* newData=nil; - NSString* _string=nil; - _string=[NSString stringWithObject:string_]; - NSAssert(_string,@"Can't get string from object"); + NSString* string=nil; + string=[NSString stringWithObject:aString]; + NSAssert(string,@"Can't get string from object"); #ifndef NDEBUG - NSAssert3(![_string isKindOfClass:[NSString class]] || [_string canBeConvertedToEncoding:contentEncoding], + NSAssert3(![string isKindOfClass:[NSString class]] || [string canBeConvertedToEncoding:_contentEncoding], @"string %s (of class %@) can't be converted to encoding %d", - [_string lossyCString], - [_string class], - contentEncoding); + [string lossyCString], + [string class], + _contentEncoding); #endif - newData=[_string dataUsingEncoding:contentEncoding]; + newData=[string dataUsingEncoding:_contentEncoding]; NSAssert3(newData,@"Can't create data from %@ \"%s\" using encoding %d", - [_string class], - ([_string isKindOfClass:[NSString class]] ? [_string lossyCString] : @"**Not a string**"), - (int)contentEncoding); + [string class], + ([string isKindOfClass:[NSString class]] ? [string lossyCString] : @"**Not a string**"), + (int)_contentEncoding); NSDebugMLLog(@"low",@"newData=%@",newData); - [contentData appendData:newData]; + [_contentData appendData:newData]; }; LOGObjectFnStop(); }; @@ -394,10 +400,10 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //-------------------------------------------------------------------- // appendDebugCommentContentString: --(void)appendDebugCommentContentString:(NSString*)string +-(void)appendDebugCommentContentString:(NSString*)aString { #ifndef NDEBUG - [self appendContentString:[NSString stringWithFormat:@"\n\n",string]]; + [self appendContentString:[NSString stringWithFormat:@"\n\n",aString]]; #endif }; @@ -406,16 +412,16 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSStringEncoding)contentEncoding { - return contentEncoding; + return _contentEncoding; }; //-------------------------------------------------------------------- // setContentEncoding: --(void)setContentEncoding:(NSStringEncoding)encoding_ +-(void)setContentEncoding:(NSStringEncoding)encoding { - NSDebugMLLog(@"low",@"setContentEncoding:%d",(int)encoding_); - contentEncoding=encoding_; + NSDebugMLLog(@"low",@"setContentEncoding:%d",(int)encoding); + _contentEncoding=encoding; }; @@ -427,65 +433,65 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //-------------------------------------------------------------------- // appendContentHTMLAttributeValue: --(void)appendContentHTMLAttributeValue:(NSString*)value_ +-(void)appendContentHTMLAttributeValue:(NSString*)value { - NSString* _string=nil; + NSString* string=nil; LOGObjectFnStart(); - NSDebugMLLog(@"low",@"response=%p value_=%@",self,value_); - _string=[NSString stringWithObject:value_]; - [self appendContentString:[[self class]stringByEscapingHTMLAttributeValue:_string]]; + NSDebugMLLog(@"low",@"response=%p value=%@",self,value); + string=[NSString stringWithObject:value]; + [self appendContentString:[[self class]stringByEscapingHTMLAttributeValue:string]]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- // appendContentHTMLString: --(void)appendContentHTMLString:(NSString*)string_ +-(void)appendContentHTMLString:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - [self appendContentString:[[self class]stringByEscapingHTMLString:_string]]; + NSString* string=[NSString stringWithObject:aString]; + [self appendContentString:[[self class]stringByEscapingHTMLString:string]]; }; //-------------------------------------------------------------------- --(void)appendContentHTMLConvertString:(NSString*)string_ +-(void)appendContentHTMLConvertString:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - [self appendContentString:[[self class]stringByConvertingToHTML:_string]]; + NSString* string=[NSString stringWithObject:aString]; + [self appendContentString:[[self class]stringByConvertingToHTML:string]]; }; //-------------------------------------------------------------------- --(void)appendContentHTMLEntitiesConvertString:(NSString*)string_ +-(void)appendContentHTMLEntitiesConvertString:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - [self appendContentString:[[self class]stringByConvertingToHTMLEntities:_string]]; + NSString* string=[NSString stringWithObject:aString]; + [self appendContentString:[[self class]stringByConvertingToHTMLEntities:string]]; }; //-------------------------------------------------------------------- -+(NSString*)stringByEscapingHTMLString:(NSString*)string_ ++(NSString*)stringByEscapingHTMLString:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - return [_string stringByEscapingHTMLString]; + NSString* string=[NSString stringWithObject:aString]; + return [string stringByEscapingHTMLString]; }; //-------------------------------------------------------------------- -+(NSString*)stringByEscapingHTMLAttributeValue:(NSString*)string_ ++(NSString*)stringByEscapingHTMLAttributeValue:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - return [_string stringByEscapingHTMLAttributeValue]; + NSString* string=[NSString stringWithObject:aString]; + return [string stringByEscapingHTMLAttributeValue]; }; //-------------------------------------------------------------------- -+(NSString*)stringByConvertingToHTMLEntities:(NSString*)string_ ++(NSString*)stringByConvertingToHTMLEntities:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - return [_string stringByConvertingToHTMLEntities]; + NSString* string=[NSString stringWithObject:aString]; + return [string stringByConvertingToHTMLEntities]; }; //-------------------------------------------------------------------- -+(NSString*)stringByConvertingToHTML:(NSString*)string_ ++(NSString*)stringByConvertingToHTML:(NSString*)aString { - NSString* _string=[NSString stringWithObject:string_]; - return [_string stringByConvertingToHTML]; + NSString* string=[NSString stringWithObject:aString]; + return [string stringByConvertingToHTML]; }; @end @@ -504,60 +510,60 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(NSArray*)allocCookiesIFND { //OK - if (!cookies) - cookies=[NSMutableArray new]; - return cookies; + if (!_cookies) + _cookies=[NSMutableArray new]; + return _cookies; }; //-------------------------------------------------------------------- --(void)addCookie:(GSWCookie*)cookie_ +-(void)addCookie:(GSWCookie*)cookie { //OK - NSMutableArray* _cookies=nil; + NSMutableArray* cookies=nil; LOGObjectFnStart(); - _cookies=[self allocCookiesIFND]; - [_cookies addObject:cookie_]; + cookies=[self allocCookiesIFND]; + [cookies addObject:cookie]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)removeCookie:(GSWCookie*)cookie_ +-(void)removeCookie:(GSWCookie*)cookie { - NSMutableArray* _cookies=nil; + NSMutableArray* cookies=nil; LOGObjectFnStart(); - _cookies=[self allocCookiesIFND]; - [_cookies removeObject:cookie_]; + cookies=[self allocCookiesIFND]; + [cookies removeObject:cookie]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- -(NSArray*)cookies { - NSMutableArray* _cookies=[self allocCookiesIFND]; - return _cookies; + NSMutableArray* cookies=[self allocCookiesIFND]; + return cookies; }; //-------------------------------------------------------------------- //NDFN -(NSArray*)cookiesHeadersValues { - NSMutableArray* _strings=nil; - NSArray* _cookies=[self cookies]; - if ([_cookies count]>0) - { - int i=0; - int _count=[_cookies count]; - GSWCookie* _cookie=nil; - NSString* _cookieString=nil; - _strings=[NSMutableArray array]; - for(i=0;i<_count;i++) - { - _cookie=[_cookies objectAtIndex:i]; - _cookieString=[_cookie headerValue]; - [_strings addObject:_cookieString]; - }; - }; - return (_strings ? [NSArray arrayWithArray:_strings] : nil); + NSMutableArray* strings=nil; + NSArray* cookies=[self cookies]; + if ([cookies count]>0) + { + int i=0; + int count=[cookies count]; + GSWCookie* cookie=nil; + NSString* cookieString=nil; + strings=[NSMutableArray array]; + for(i=0;i0) - { - id _cookiesHeadersValues=[self cookiesHeadersValues]; - NSDebugMLLog(@"low",@"_cookiesHeadersValues=%@",_cookiesHeadersValues); - [self setHeaders:_cookiesHeadersValues - forKey:GSWHTTPHeader_SetCookie]; - }; - _request=[_context request]; - _applicationNumber=[_request applicationNumber]; - NSDebugMLLog(@"low",@"_applicationNumber=%d",_applicationNumber); + [self _resolveContentFaultsInContext:aContext]; + setCookieHeader=[self headersForKey:GSWHTTPHeader_SetCookie]; + if (setCookieHeader) + { + ExceptionRaise(@"GSWResponse", + @"%@ header already exists", + GSWHTTPHeader_SetCookie); + }; + cookies=[self cookies]; + if ([cookies count]>0) + { + id cookiesHeadersValues=[self cookiesHeadersValues]; + NSDebugMLLog(@"low",@"cookiesHeadersValues=%@",cookiesHeadersValues); + [self setHeaders:cookiesHeadersValues + forKey:GSWHTTPHeader_SetCookie]; + }; + request=[aContext request]; + applicationNumber=[request applicationNumber]; + NSDebugMLLog(@"low",@"applicationNumber=%d",applicationNumber); //TODO -/* if (_applicationNumber>=0) - { + /* if (_applicationNumber>=0) + { LOGError(); //TODO - }; */ - _dataLength=[contentData length]; - _dataLengthString=[NSString stringWithFormat:@"%d", - _dataLength]; - [self setHeader:_dataLengthString + }; */ + dataLength=[_contentData length]; + dataLengthString=[NSString stringWithFormat:@"%d", + dataLength]; + [self setHeader:dataLengthString forKey:GSWHTTPHeader_ContentLength]; - NSDebugMLLog(@"low",@"headers:%@",headers); - isFinalizeInContextHasBeenCalled=YES; + NSDebugMLLog(@"low",@"headers:%@",_headers); + _isFinalizeInContextHasBeenCalled=YES; LOGObjectFnStop(); }; @@ -636,21 +642,21 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; -(void)_initContentData { //OK - DESTROY(contentData); - contentData=[NSMutableData new]; + DESTROY(_contentData); + _contentData=[NSMutableData new]; }; //-------------------------------------------------------------------- --(void)_appendContentAsciiString:(NSString*)string_ +-(void)_appendContentAsciiString:(NSString*)aString { NSData* newData=nil; - NSString* _string=nil; + NSString* string=nil; LOGObjectFnStart(); - NSDebugMLLog(@"low",@"string_:%@",string_); - _string=[NSString stringWithObject:string_]; - NSDebugMLLog(@"low",@"_string:%@",_string); - newData=[_string dataUsingEncoding:contentEncoding]; - [contentData appendData:newData]; + NSDebugMLLog(@"low",@"aString:%@",aString); + string=[NSString stringWithObject:aString]; + NSDebugMLLog(@"low",@"_string:%@",string); + newData=[string dataUsingEncoding:_contentEncoding]; + [_contentData appendData:newData]; LOGObjectFnStop(); }; @@ -658,13 +664,13 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //==================================================================== @implementation GSWResponse (GSWResponseB) --(void)_resolveContentFaultsInContext:(GSWContext*)_context +-(void)_resolveContentFaultsInContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(void)_appendContentFault:(id)_unknown +-(void)_appendContentFault:(id)unknown { LOGObjectFnNotImplemented(); //TODOFN }; @@ -677,13 +683,13 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //-------------------------------------------------------------------- -(BOOL)_isClientCachingDisabled { - return isClientCachingDisabled; + return _isClientCachingDisabled; }; //-------------------------------------------------------------------- -(unsigned int)_contentDataLength { - return [contentData length]; + return [_contentData length]; }; @end @@ -692,7 +698,7 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; @implementation GSWResponse (GSWResponseD) //-------------------------------------------------------------------- --(BOOL)_responseIsEqual:(GSWResponse*)_response +-(BOOL)_responseIsEqual:(GSWResponse*)aResponse { LOGObjectFnNotImplemented(); //TODOFN return NO; @@ -716,9 +722,9 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; @implementation GSWResponse (GSWResponseDefaultEncoding) //-------------------------------------------------------------------- -+(void)setDefaultEncoding:(NSStringEncoding)encoding_ ++(void)setDefaultEncoding:(NSStringEncoding)encoding { - globalDefaultEncoding=encoding_; + globalDefaultEncoding=encoding; }; //-------------------------------------------------------------------- @@ -736,44 +742,44 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //NDFN //Last cHance Response -+(GSWResponse*)responseWithMessage:(NSString*)message_ - inContext:(GSWContext*)context_ - forRequest:(GSWRequest*)request_ ++(GSWResponse*)responseWithMessage:(NSString*)aMessage + inContext:(GSWContext*)aContext + forRequest:(GSWRequest*)aRequest { - return [self responseWithMessage:message_ - inContext:context_ - forRequest:request_ + return [self responseWithMessage:aMessage + inContext:aContext + forRequest:aRequest forceFinalize:NO]; }; -+(GSWResponse*)responseWithMessage:(NSString*)message_ - inContext:(GSWContext*)context_ - forRequest:(GSWRequest*)request_ ++(GSWResponse*)responseWithMessage:(NSString*)aMessage + inContext:(GSWContext*)aContext + forRequest:(GSWRequest*)aRequest forceFinalize:(BOOL)forceFinalize { - GSWResponse* _response=nil; - NSString* _httpVersion=nil; + GSWResponse* response=nil; + NSString* httpVersion=nil; LOGClassFnStart(); - _response=[[self new]autorelease]; - if (_response) + response=[[self new]autorelease]; + if (response) { - NSString* _responseString=nil; - if (context_ && [context_ request]) - request_=[context_ request]; - _httpVersion=[request_ httpVersion]; - if (_httpVersion) - [_response setHTTPVersion:_httpVersion]; - [_response setHeader:@"text/html" - forKey:@"content-type"]; - [context_ _setResponse:_response]; - _responseString=[NSString stringWithFormat:@"\nGNUstepWeb Error\n\n\n
\n%@\n
\n\n\n", - [[_response class]stringByEscapingHTMLString:message_]]; - [_response appendContentString:_responseString]; + NSString* responseString=nil; + if (aContext && [aContext request]) + aRequest=[aContext request]; + httpVersion=[aRequest httpVersion]; + if (httpVersion) + [response setHTTPVersion:httpVersion]; + [response setHeader:@"text/html" + forKey:@"content-type"]; + [aContext _setResponse:response]; + responseString=[NSString stringWithFormat:@"\nGNUstepWeb Error\n\n\n
\n%@\n
\n\n\n", + [[response class]stringByEscapingHTMLString:aMessage]]; + [response appendContentString:responseString]; if (forceFinalize) - [_response forceFinalizeInContext]; + [response forceFinalizeInContext]; }; LOGClassFnStop(); - return _response; + return response; }; @end @@ -784,55 +790,61 @@ NSStringEncoding globalDefaultEncoding=NSISOLatin1StringEncoding; //-------------------------------------------------------------------- // //Refuse Response -+(GSWResponse*)generateRefusingResponseInContext:(GSWContext*)context_ - forRequest:(GSWRequest*)request_ ++(GSWResponse*)generateRefusingResponseInContext:(GSWContext*)aContext + forRequest:(GSWRequest*)aRequest { - GSWResponse* _response=nil; - NSString* _httpVersion=nil; + GSWResponse* response=nil; + NSString* httpVersion=nil; LOGClassFnStart(); - _response=[[self new]autorelease]; - if (_response) + response=[[self new]autorelease]; + if (response) { - NSString* _responseString=nil; - NSString* _locationURLString=nil; - NSString* _message=nil; + NSString* responseString=nil; + NSString* locationURLString=nil; + NSString* message=nil; - if (context_ && [context_ request]) + if (aContext && [aContext request]) { - request_=[context_ request]; + aRequest=[aContext request]; } - _httpVersion=[request_ httpVersion]; - if (_httpVersion) + httpVersion=[aRequest httpVersion]; + if (httpVersion) { - [_response setHTTPVersion:_httpVersion]; + [response setHTTPVersion:httpVersion]; } - [_response setStatus:302]; - _locationURLString = [NSString stringWithFormat:@"%@/%@.gswa",[request_ adaptorPrefix], [request_ applicationName]]; - if (_locationURLString) - { - [_response setHeader: _locationURLString forKey:@"location"]; - } - [_response setHeader:@"text/html" forKey:@"content-type"]; - [_response setHeader:@"YES" forKey:@"x-gsweb-refusing-redirection"]; + [response setStatus:302]; + locationURLString = [NSString stringWithFormat:@"%@/%@.gswa", + [aRequest adaptorPrefix], + [aRequest applicationName]]; + if (locationURLString) + [response setHeader:locationURLString + forKey:@"location"]; + + [response setHeader:@"text/html" + forKey:@"content-type"]; + [response setHeader:@"YES" + forKey:@"x-gsweb-refusing-redirection"]; - if (context_) + if (aContext) { - [context_ _setResponse:_response]; + [aContext _setResponse:response]; } - _message = [NSString stringWithFormat:@"Sorry, your request could not immediately be processed. Please try this URL: %@\nConnection closed by foreign host.", - _locationURLString, _locationURLString]; + message = [NSString stringWithFormat:@"Sorry, your request could not immediately be processed. Please try this URL: %@\nConnection closed by foreign host.", + locationURLString, + locationURLString]; - _responseString=[NSString stringWithFormat:@"\nGNUstepWeb\n\n\n
\n%@\n
\n\n\n", - _message]; - //[[_response class]stringByEscapingHTMLString:_message]]; - [_response appendContentString:_responseString]; + responseString=[NSString stringWithFormat:@"\nGNUstepWeb\n\n\n
\n%@\n
\n\n\n", + message]; + //[[response class]stringByEscapingHTMLString:message]]; + [response appendContentString:responseString]; - [_response setHeader:[NSString stringWithFormat:@"%d", [[_response content] length]] forKey:@"content-length"]; + [response setHeader:[NSString stringWithFormat:@"%d",[[response content] length]] + forKey:@"content-length"]; }; LOGClassFnStop(); - return _response; + return response; }; @end diff --git a/GSWeb.framework/GSWServerSessionStore.h b/GSWeb.framework/GSWServerSessionStore.h index b933045..613b84c 100644 --- a/GSWeb.framework/GSWServerSessionStore.h +++ b/GSWeb.framework/GSWServerSessionStore.h @@ -1,11 +1,16 @@ -/* GSWServerSessionStore.h - GSWeb: Class GSWServerSessionStore - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWServerSessionStore.h - GSWeb: Class GSWServerSessionStore + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Mar 1999 + Written by: Manuel Guesdon + Date: Mar 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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,9 +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. -*/ - -// $Id$ + +**/ #ifndef _GSWServerSessionStore_h__ #define _GSWServerSessionStore_h__ @@ -30,23 +34,23 @@ //==================================================================== @interface GSWServerSessionStore : GSWSessionStore { - NSMutableDictionary* sessions; - GSWSessionTimeOutManager* timeOut_manager; + NSMutableDictionary* _sessions; + GSWSessionTimeOutManager* _timeOutManager; }; -(id)init; -(void)dealloc; -(id)description; --(void)saveSessionForContext:(GSWContext*)context_; --(GSWSession*)restoreSessionWithID:(NSString*)_sessionID - request:(GSWRequest*)request_; --(GSWSession*)removeSessionWithID:(NSString*)_sessionID; +-(void)saveSessionForContext:(GSWContext*)aContext; +-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest; +-(GSWSession*)removeSessionWithID:(NSString*)aSessionID; @end //==================================================================== @interface GSWServerSessionStore (GSWServerSessionStoreInfo) --(BOOL)containsSessionID:(NSString*)sessionID_; +-(BOOL)containsSessionID:(NSString*)aSessionID; -(NSArray *)allSessionIDs; @end diff --git a/GSWeb.framework/GSWServerSessionStore.m b/GSWeb.framework/GSWServerSessionStore.m index a292de5..09f3753 100644 --- a/GSWeb.framework/GSWServerSessionStore.m +++ b/GSWeb.framework/GSWServerSessionStore.m @@ -1,11 +1,16 @@ -/* GSWServerSessionStore.m - GSWeb: Class GSWServerSessionStore - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWServerSessionStore.m - GSWeb: Class GSWServerSessionStore + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Mar 1999 + Written by: Manuel Guesdon + Date: Mar 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -32,13 +38,13 @@ static char rcsId[] = "$Id$"; //OK LOGObjectFnStart(); if ((self=[super init])) - { - timeOut_manager=[GSWSessionTimeOutManager new]; - sessions=[NSMutableDictionary new]; - [timeOut_manager setCallBack:@selector(removeSessionWithID:) - target:self]; - [timeOut_manager startHandleTimerRefusingSessions]; - }; + { + _timeOutManager=[GSWSessionTimeOutManager new]; + _sessions=[NSMutableDictionary new]; + [_timeOutManager setCallBack:@selector(removeSessionWithID:) + target:self]; + [_timeOutManager startHandleTimerRefusingSessions]; + }; LOGObjectFnStop(); return self; }; @@ -46,8 +52,8 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(sessions); - DESTROY(timeOut_manager); + DESTROY(_sessions); + DESTROY(_timeOutManager); [super dealloc]; }; @@ -55,98 +61,96 @@ static char rcsId[] = "$Id$"; -(id)description { return [NSString stringWithFormat:@"<%s: %p sessions=%@ manager=%@>", - object_get_class_name(self), - (void*)self, - sessions, - timeOut_manager]; + object_get_class_name(self), + (void*)self, + _sessions, + _timeOutManager]; }; //-------------------------------------------------------------------- --(void)saveSessionForContext:(GSWContext*)context_ +-(void)saveSessionForContext:(GSWContext*)aContext { //OK - GSWSession* _session=nil; - NSString* _sessionID=nil; - NSTimeInterval _sessionTimeOut=0; - BOOL _sessionIsTerminating=NO; + GSWSession* session=nil; + NSString* sessionID=nil; + NSTimeInterval sessionTimeOut=0; + BOOL sessionIsTerminating=NO; LOGObjectFnStart(); - _session=[context_ existingSession]; - NSAssert(_session,@"No session!"); - NSDebugMLLog(@"sessions",@"_session=%@",_session); - _sessionIsTerminating=[_session isTerminating]; //TODO - [_session setDistributionEnabled:NO]; - _sessionID=[_session sessionID]; - NSAssert(_sessionID,@"No _sessionID!"); - NSDebugMLLog(@"sessions",@"_sessionID=%@",_sessionID); - _sessionTimeOut=[_session timeOut]; - [sessions setObject:_session - forKey:_sessionID]; - NSDebugMLLog(@"sessions",@"_session=%@",_session); - NSDebugMLLog(@"sessions",@"_sessionTimeOut=%ld",(long)_sessionTimeOut); - [timeOut_manager updateTimeOutForSessionWithID:_sessionID - timeOut:_sessionTimeOut]; + session=[aContext existingSession]; + NSAssert(session,@"No session!"); + NSDebugMLLog(@"sessions",@"session=%@",session); + sessionIsTerminating=[session isTerminating]; //TODO + [session setDistributionEnabled:NO]; + sessionID=[session sessionID]; + NSAssert(sessionID,@"No _sessionID!"); + NSDebugMLLog(@"sessions",@"_sessionID=%@",sessionID); + sessionTimeOut=[session timeOut]; + [_sessions setObject:session + forKey:sessionID]; + NSDebugMLLog(@"sessions",@"session=%@",session); + NSDebugMLLog(@"sessions",@"sessionTimeOut=%ld",(long)sessionTimeOut); + [_timeOutManager updateTimeOutForSessionWithID:sessionID + timeOut:sessionTimeOut]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(id)restoreSessionWithID:(NSString*)_sessionID - request:(GSWRequest*)request_ +-(id)restoreSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest { - GSWSession* _session=nil; + GSWSession* session=nil; //OK LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"_sessionID=%@",_sessionID); - NSDebugMLLog(@"sessions",@"sessions=%@",sessions); - _session=[sessions objectForKey:_sessionID]; - NSDebugMLLog(@"sessions",@"_session=%@",_session); + NSDebugMLLog(@"sessions",@"aSessionID=%@",aSessionID); + NSDebugMLLog(@"sessions",@"sessions=%@",_sessions); + session=[_sessions objectForKey:aSessionID]; + NSDebugMLLog(@"sessions",@"session=%@",session); LOGObjectFnStop(); - return _session; + return session; }; //-------------------------------------------------------------------- --(GSWSession*)removeSessionWithID:(NSString*)_sessionID +-(GSWSession*)removeSessionWithID:(NSString*)aSessionID { //OK - GSWSession* _session=nil; - BOOL _isSessionIDCheckedOut=NO; + GSWSession* session=nil; + BOOL isSessionIDCheckedOut=NO; LOGObjectFnStart(); - _isSessionIDCheckedOut=[self _isSessionIDCheckedOut:_sessionID]; - if (_isSessionIDCheckedOut) - { - return nil;//Used Session - } + isSessionIDCheckedOut=[self _isSessionIDCheckedOut:aSessionID]; + if (isSessionIDCheckedOut) + { + return nil;//Used Session + } else - { - _session=[sessions objectForKey:_sessionID]; - NSDebugMLLog(@"sessions",@"_session=%@",_session); - [_session retain]; //to avoid discarding it now - [_session autorelease]; //discard it 'later' - [sessions removeObjectForKey:_sessionID]; - }; + { + session=[_sessions objectForKey:aSessionID]; + NSDebugMLLog(@"sessions",@"session=%@",session); + [session retain]; //to avoid discarding it now + [session autorelease]; //discard it 'later' + [_sessions removeObjectForKey:aSessionID]; + }; LOGObjectFnStop(); - return _session; + return session; }; @end //==================================================================== @implementation GSWServerSessionStore (GSWServerSessionStoreInfo) --(BOOL)containsSessionID:(NSString*)sessionID_ +-(BOOL)containsSessionID:(NSString*)aSessionID { BOOL contain = NO; //OK LOGObjectFnStart(); - if([sessions objectForKey:sessionID_]) - { - contain = YES; - } + if([_sessions objectForKey:aSessionID]) + contain = YES; LOGObjectFnStop(); return contain; }; -(NSArray *)allSessionIDs { - return [sessions allKeys]; + return [_sessions allKeys]; } @end diff --git a/GSWeb.framework/GSWSession.h b/GSWeb.framework/GSWSession.h index 214e9a2..f9525bb 100644 --- a/GSWeb.framework/GSWSession.h +++ b/GSWeb.framework/GSWSession.h @@ -1,11 +1,16 @@ -/* GSWSession.h - GSWeb: Class GSWSession - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSession.h - GSWeb: Class GSWSession + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -29,28 +35,28 @@ @interface GSWSession : NSObject { @private - NSString* sessionID; - NSAutoreleasePool* autoreleasePool; - NSTimeInterval timeOut; - NSMutableArray* contextArrayStack; - NSMutableDictionary* contextRecords; - EOEditingContext* editingContext; - NSArray* languages; - NSMutableDictionary* componentState; - NSDate* birthDate; - NSMutableArray* statistics; - NSMutableString* formattedStatistics; - GSWContext* currentContext; - NSMutableDictionary* permanentPageCache; - NSMutableArray* permanentContextIDArray; - int contextCounter; - int requestCounter; - BOOL isAllowedToViewStatistics; - BOOL isTerminating; - BOOL isDistributionEnabled; - BOOL storesIDsInCookies; - BOOL storesIDsInURLs; - BOOL hasSessionLockedEditingContext; + NSString* _sessionID; + NSAutoreleasePool* _autoreleasePool; + NSTimeInterval _timeOut; + NSMutableArray* _contextArrayStack; + NSMutableDictionary* _contextRecords; + EOEditingContext* _editingContext; + NSArray* _languages; + NSMutableDictionary* _componentState; + NSDate* _birthDate; + NSMutableArray* _statistics; + NSMutableString* _formattedStatistics; + GSWContext* _currentContext; + NSMutableDictionary* _permanentPageCache; + NSMutableArray* _permanentContextIDArray; + int _contextCounter; + int _requestCounter; + BOOL _isAllowedToViewStatistics; + BOOL _isTerminating; + BOOL _isDistributionEnabled; + BOOL _storesIDsInCookies; + BOOL _storesIDsInURLs; + BOOL _hasSessionLockedEditingContext; }; @@ -60,12 +66,12 @@ -(NSString*)domainForIDCookies; -(BOOL)storesIDsInURLs; --(void)setStoresIDsInURLs:(BOOL)flag_; +-(void)setStoresIDsInURLs:(BOOL)flag; -(NSDate*)expirationDateForIDCookies; -(BOOL)storesIDsInCookies; --(void)setStoresIDsInCookies:(BOOL)flag_; +-(void)setStoresIDsInCookies:(BOOL)flag; -(BOOL)isDistributionEnabled; --(void)setDistributionEnabled:(BOOL)flag_; +-(void)setDistributionEnabled:(BOOL)flag; -(NSString*)sessionID; -(NSString*)description; @@ -74,7 +80,7 @@ //==================================================================== @interface GSWSession (GSWSessionA) --(id)_initWithSessionID:(NSString*)_sessionID; +-(id)_initWithSessionID:(NSString*)aSessionID; @end @@ -91,32 +97,32 @@ //==================================================================== @interface GSWSession (GSWSessionDebugging) --(void)debugWithFormat:(NSString*)format_, ...; +-(void)debugWithFormat:(NSString*)format,...; @end //==================================================================== @interface GSWSession (GSWSessionD) --(void)_debugWithString:(NSString*)_string; +-(void)_debugWithString:(NSString*)string; @end //==================================================================== @interface GSWSession (GSWPageManagement) --(void)savePage:(GSWComponent*)page_; --(GSWComponent*)restorePageForContextID:(NSString*)contextID_; +-(void)savePage:(GSWComponent*)page; +-(GSWComponent*)restorePageForContextID:(NSString*)aContextID; -(uint)permanentPageCacheSize; --(void)savePageInPermanentCache:(GSWComponent*)page_; +-(void)savePageInPermanentCache:(GSWComponent*)page; @end //==================================================================== @interface GSWSession (GSWSessionF) --(void)clearCookieFromResponse:(GSWResponse*)response_; --(void)appendCookieToResponse:(GSWResponse*)response_; +-(void)clearCookieFromResponse:(GSWResponse*)aResponse; +-(void)appendCookieToResponse:(GSWResponse*)aResponse; @end @@ -125,32 +131,32 @@ -(void)_releaseAutoreleasePool; -(void)_createAutoreleasePool; --(GSWComponent*)_permanentPageWithContextID:(NSString*)contextID_; +-(GSWComponent*)_permanentPageWithContextID:(NSString*)aContextID; -(NSMutableDictionary*)_permanentPageCache; --(GSWContext*)_contextIDMatchingContextID:(NSString*)contextID_ - requestSenderID:(NSString*)_senderID; +-(GSWContext*)_contextIDMatchingContextID:(NSString*)aContextID + requestSenderID:(NSString*)aSenderID; -(void)_rearrangeContextArrayStack; --(NSArray*)_contextArrayForContextID:(NSString*)contextID_ - stackIndex:(unsigned int*)pStackIndex_ - contextArrayIndex:(unsigned int*)pContextArrayIndex_; --(void)_replacePage:(GSWComponent*)_page; --(void)_savePage:(GSWComponent*)_page - forChange:(BOOL)_forChange; +-(NSArray*)_contextArrayForContextID:(NSString*)aContextID + stackIndex:(unsigned int*)pStackIndex + contextArrayIndex:(unsigned int*)pContextArrayIndex; +-(void)_replacePage:(GSWComponent*)page; +-(void)_savePage:(GSWComponent*)page + forChange:(BOOL)forChange; -(uint)pageCacheSize; -(void)_saveCurrentPage; -(int)_requestCounter; -(void)_contextDidIncrementContextID; -(int)_contextCounter; --(void)_setContext:(GSWContext*)context_; --(void)sleepInContext:(GSWContext*)context_; --(void)awakeInContext:(GSWContext*)context_; +-(void)_setContext:(GSWContext*)aContext; +-(void)sleepInContext:(GSWContext*)aContext; +-(void)awakeInContext:(GSWContext*)aContext; @end //==================================================================== @interface GSWSession (GSWLocalization) --(void)setLanguages:(NSArray*)languages_; +-(void)setLanguages:(NSArray*)languages; -(NSArray*)languages; @end @@ -159,10 +165,10 @@ @interface GSWSession (GSWComponentStateManagement) -(void)setObject:(id)object - forKey:(NSString*)key_; + forKey:(NSString*)key; --(id)objectForKey:(NSString*)key_; --(void)removeObjectForKey:(NSString*)key_; +-(id)objectForKey:(NSString*)key; +-(void)removeObjectForKey:(NSString*)key; -(NSMutableDictionary*)componentState;//NDFN @end @@ -179,14 +185,14 @@ -(GSWContext*)context; -(void)awake; --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext *)context_; +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; -(void)sleep; @@ -225,7 +231,7 @@ //==================================================================== @interface GSWSession (GSWSessionClassA) -+(void)__setContextCounterIncrementingEnabled:(BOOL)flag_; ++(void)__setContextCounterIncrementingEnabled:(BOOL)flag; +(int)__counterIncrementingEnabledFlag; @end diff --git a/GSWeb.framework/GSWSession.m b/GSWeb.framework/GSWSession.m index e13838d..8c9cb4a 100644 --- a/GSWeb.framework/GSWSession.m +++ b/GSWeb.framework/GSWSession.m @@ -1,11 +1,16 @@ -/* GSWSession.m - GSWeb: Class GSWSession - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSession.m - GSWeb: Class GSWSession + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -36,12 +42,12 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); if ((self = [super init])) - { - NSTimeInterval _sessionTimeOut=[GSWApplication sessionTimeOutValue]; - NSDebugMLLog(@"sessions",@"_sessionTimeOut=%ld",(long)_sessionTimeOut); - [self setTimeOut:_sessionTimeOut]; - [self _initWithSessionID:[NSString stringUniqueIdWithLength:8]]; //TODO - }; + { + NSTimeInterval sessionTimeOut=[GSWApplication sessionTimeOutValue]; + NSDebugMLLog(@"sessions",@"sessionTimeOut=%ld",(long)sessionTimeOut); + [self setTimeOut:sessionTimeOut]; + [self _initWithSessionID:[NSString stringUniqueIdWithLength:8]]; //TODO + }; LOGObjectFnStop(); return self; }; @@ -62,9 +68,9 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)encodeWithCoder:(NSCoder*)coder_ +-(void)encodeWithCoder:(NSCoder*)coder { - [super encodeWithCoder: coder_]; + [super encodeWithCoder:coder]; LOGObjectFnNotImplemented(); //TODOFN /* [coder_ encodeObject:sessionID]; @@ -76,9 +82,9 @@ static char rcsId[] = "$Id$"; } //-------------------------------------------------------------------- --(id)initWithCoder: (NSCoder*)coder_ +-(id)initWithCoder: (NSCoder*)coder { - self = [super initWithCoder: coder_]; + self = [super initWithCoder: coder]; LOGObjectFnNotImplemented(); //TODOFN /* [coder_ decodeValueOfObjCType: @encode(id) at:&sessionID]; @@ -96,31 +102,31 @@ static char rcsId[] = "$Id$"; GSWLogAssertGood(self); NSDebugFLog0(@"Dealloc GSWSession"); NSDebugFLog0(@"Dealloc GSWSession: sessionID"); - DESTROY(sessionID); + DESTROY(_sessionID); NSDebugFLog0(@"Dealloc GSWSession:autoreleasePool "); - DESTROY(autoreleasePool); + DESTROY(_autoreleasePool); NSDebugFLog0(@"Dealloc GSWSession: contextArrayStack"); - DESTROY(contextArrayStack); + DESTROY(_contextArrayStack); NSDebugFLog0(@"Dealloc GSWSession: contextRecords"); - DESTROY(contextRecords); + DESTROY(_contextRecords); NSDebugFLog0(@"Dealloc GSWSession: editingContext"); - DESTROY(editingContext); + DESTROY(_editingContext); NSDebugFLog0(@"Dealloc GSWSession: languages"); - DESTROY(languages); + DESTROY(_languages); NSDebugFLog0(@"Dealloc GSWSession: componentState"); - DESTROY(componentState); + DESTROY(_componentState); NSDebugFLog0(@"Dealloc GSWSession: birthDate"); - DESTROY(birthDate); + DESTROY(_birthDate); NSDebugFLog0(@"Dealloc GSWSession: statistics"); - DESTROY(statistics); + DESTROY(_statistics); NSDebugFLog0(@"Dealloc GSWSession: formattedStatistics"); - DESTROY(formattedStatistics); + DESTROY(_formattedStatistics); NSDebugFLog0(@"Dealloc GSWSession: currentContext (set to nil)"); - currentContext=nil; + _currentContext=nil; NSDebugFLog0(@"Dealloc GSWSession: permanentPageCache"); - DESTROY(permanentPageCache); + DESTROY(_permanentPageCache); NSDebugFLog0(@"Dealloc GSWSession: permanentContextIDArray"); - DESTROY(permanentContextIDArray); + DESTROY(_permanentContextIDArray); NSDebugFLog0(@"Dealloc GSWSession Super"); [super dealloc]; NSDebugFLog0(@"End Dealloc GSWSession"); @@ -178,56 +184,56 @@ static char rcsId[] = "$Id$"; -(NSString*)sessionID { - return sessionID; + return _sessionID; }; //-------------------------------------------------------------------- -(NSString*)domainForIDCookies { //OK - NSString* _domain=nil; - GSWContext* _context=nil; - GSWRequest* _request=nil; - NSString* _applicationName=nil; - NSString* _adaptorPrefix=nil; + NSString* domain=nil; + GSWContext* context=nil; + GSWRequest* request=nil; + NSString* applicationName=nil; + NSString* adaptorPrefix=nil; LOGObjectFnStart(); [[GSWApplication application]lock]; - _context=[self context]; - _request=[_context request]; - _applicationName=[_request applicationName]; - NSDebugMLLog(@"sessions",@"_applicationName=%@",_applicationName); - _adaptorPrefix=[_request adaptorPrefix]; - NSDebugMLLog(@"sessions",@"_adaptorPrefix=%@",_adaptorPrefix); + context=[self context]; + request=[context request]; + applicationName=[request applicationName]; + NSDebugMLLog(@"sessions",@"applicationName=%@",applicationName); + adaptorPrefix=[request adaptorPrefix]; + NSDebugMLLog(@"sessions",@"adaptorPrefix=%@",adaptorPrefix); [[GSWApplication application]unlock]; - _domain=[NSString stringWithFormat:@"%@/%@.%@", - _adaptorPrefix, - _applicationName, - GSWApplicationSuffix[GSWebNamingConv]]; - NSDebugMLLog(@"sessions",@"_domain=%@",_domain); + domain=[NSString stringWithFormat:@"%@/%@.%@", + adaptorPrefix, + applicationName, + GSWApplicationSuffix[GSWebNamingConv]]; + NSDebugMLLog(@"sessions",@"domain=%@",domain); LOGObjectFnStop(); - return _domain; + return domain; }; //-------------------------------------------------------------------- -(BOOL)storesIDsInURLs { //OK - return storesIDsInURLs; + return _storesIDsInURLs; }; //-------------------------------------------------------------------- --(void)setStoresIDsInURLs:(BOOL)_flag +-(void)setStoresIDsInURLs:(BOOL)flag { //OK - storesIDsInURLs=_flag; + _storesIDsInURLs=flag; }; //-------------------------------------------------------------------- -(NSDate*)expirationDateForIDCookies { NSDate* expirationDateForIDCookies=nil; - NSDebugMLLog(@"sessions",@"timeOut=%f",(double)timeOut); - expirationDateForIDCookies=[NSDate dateWithTimeIntervalSinceNow:timeOut]; + NSDebugMLLog(@"sessions",@"timeOut=%f",(double)_timeOut); + expirationDateForIDCookies=[NSDate dateWithTimeIntervalSinceNow:_timeOut]; NSDebugMLLog(@"sessions",@"expirationDateForIDCookies=%@ (HTML: %@)", expirationDateForIDCookies, [expirationDateForIDCookies htmlDescription]); @@ -238,30 +244,30 @@ static char rcsId[] = "$Id$"; -(BOOL)storesIDsInCookies { //OK - return storesIDsInCookies; + return _storesIDsInCookies; }; //-------------------------------------------------------------------- --(void)setStoresIDsInCookies:(BOOL)_flag +-(void)setStoresIDsInCookies:(BOOL)flag { //OK LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"newflag=%d",(int)_flag); - storesIDsInCookies=_flag; + NSDebugMLLog(@"sessions",@"newflag=%d",(int)flag); + _storesIDsInCookies=flag; LOGObjectFnStop(); }; //-------------------------------------------------------------------- -(BOOL)isDistributionEnabled { - return isDistributionEnabled; + return _isDistributionEnabled; }; //-------------------------------------------------------------------- --(void)setDistributionEnabled:(BOOL)_flag +-(void)setDistributionEnabled:(BOOL)flag { LOGObjectFnStart(); - isDistributionEnabled=_flag; + _isDistributionEnabled=flag; LOGObjectFnStop(); }; @@ -272,29 +278,29 @@ static char rcsId[] = "$Id$"; @implementation GSWSession (GSWSessionA) //-------------------------------------------------------------------- --(id)_initWithSessionID:(NSString*)_sessionID +-(id)_initWithSessionID:(NSString*)aSessionID { //OK - GSWApplication* _application=nil; - GSWStatisticsStore* _statisticsStore=nil; + GSWApplication* application=nil; + GSWStatisticsStore* statisticsStore=nil; LOGObjectFnStart(); - _statisticsStore=[[GSWApplication application]statisticsStore]; - [_statisticsStore _applicationCreatedSession:self]; + statisticsStore=[[GSWApplication application]statisticsStore]; + [statisticsStore _applicationCreatedSession:self]; - ASSIGNCOPY(sessionID,_sessionID); + ASSIGNCOPY(_sessionID,aSessionID); + NSDebugMLLog(@"sessions",@"sessionID=%u",aSessionID); NSDebugMLLog(@"sessions",@"_sessionID=%u",_sessionID); - NSDebugMLLog(@"sessions",@"sessionID=%u",sessionID); - if (sessionID) - { - NSDebugMLLog(@"sessions",@"sessionIDCount=%u",[sessionID retainCount]); - }; - _application=[GSWApplication application]; + if (_sessionID) + { + NSDebugMLLog(@"sessions",@"sessionIDCount=%u",[_sessionID retainCount]); + }; + application=[GSWApplication application]; //applic statisticsStore //applic _activeSessionsCount - ASSIGN(birthDate,[NSDate date]); - ASSIGN(statistics,[NSMutableArray array]); - storesIDsInURLs=YES; - [_application _finishInitializingSession:self]; + ASSIGN(_birthDate,[NSDate date]); + ASSIGN(_statistics,[NSMutableArray array]); + _storesIDsInURLs=YES; + [application _finishInitializingSession:self]; LOGObjectFnStop(); return self; }; @@ -311,7 +317,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(BOOL)isTerminating { - return isTerminating; + return _isTerminating; }; //-------------------------------------------------------------------- @@ -319,15 +325,15 @@ static char rcsId[] = "$Id$"; -(void)terminate { //OK - NSString* _sessionID=nil; - NSNotification* _notification=nil; + NSString* sessionID=nil; + NSNotification* notification=nil; LOGObjectFnStart(); - isTerminating=YES; - _sessionID=[self sessionID]; + _isTerminating=YES; + sessionID=[self sessionID]; [self setTimeOut:(NSTimeInterval) 1]; // forces to call removeSessionWithID in GSWServerSessionStore to dealloc it [[NSNotificationCenter defaultCenter] postNotificationName:GSWNotification__SessionDidTimeOutNotification[GSWebNamingConv] - object:_sessionID]; + object:sessionID]; //TODO: VERIFY [self setTimeOut:(NSTimeInterval) 1]; // forces to call removeSessionWithID in GSWServerSessionStore to dealloc it //goto => GSWApp _sessionDidTimeOutNotification: @@ -345,18 +351,18 @@ static char rcsId[] = "$Id$"; -(NSTimeInterval)timeOut { LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut); + NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)_timeOut); LOGObjectFnStop(); - return timeOut; + return _timeOut; }; //-------------------------------------------------------------------- // setTimeOut: --(void)setTimeOut:(NSTimeInterval)_timeOut +-(void)setTimeOut:(NSTimeInterval)timeOut { - NSDebugMLLog(@"sessions",@"_timeOut=%ld",(long)_timeOut); - timeOut=_timeOut; + NSDebugMLLog(@"sessions",@"timeOut=%ld",(long)timeOut); + _timeOut=timeOut; }; @end @@ -365,7 +371,7 @@ static char rcsId[] = "$Id$"; @implementation GSWSession (GSWSessionDebugging) //-------------------------------------------------------------------- --(void)debugWithFormat:(NSString*)format_,... +-(void)debugWithFormat:(NSString*)format,... { LOGObjectFnNotImplemented(); //TODOFN }; @@ -376,7 +382,7 @@ static char rcsId[] = "$Id$"; @implementation GSWSession (GSWSessionD) //-------------------------------------------------------------------- --(void)_debugWithString:(NSString*)_string +-(void)_debugWithString:(NSString*)string { LOGObjectFnNotImplemented(); //TODOFN }; @@ -388,84 +394,84 @@ static char rcsId[] = "$Id$"; @implementation GSWSession (GSWPageManagement) //-------------------------------------------------------------------- --(void)savePage:(GSWComponent*)page_ +-(void)savePage:(GSWComponent*)page { //OK - GSWContext* _context=nil; - BOOL _pageReplaced=NO; - BOOL _pageChanged=NO; + GSWContext* context=nil; + BOOL pageReplaced=NO; + BOOL pageChanged=NO; LOGObjectFnStart(); - NSAssert(page_,@"No Page"); - _context=[self context]; - _pageReplaced=[_context _pageReplaced]; - if (!_pageReplaced) - [_context _pageChanged]; - [self _savePage:page_ - forChange:_pageChanged || _pageReplaced]; //?? + NSAssert(page,@"No Page"); + context=[self context]; + pageReplaced=[context _pageReplaced]; + if (!pageReplaced) + [context _pageChanged]; + [self _savePage:page + forChange:pageChanged || pageReplaced]; //?? /* - NSData* data=[NSArchiver archivedDataWithRootObject:page_]; + NSData* data=[NSArchiver archivedDataWithRootObject:page]; NSDebugMLLog(@"sessions",@"savePage data=%@",data); [pageCache setObject:data - forKey:[[self context] contextID]//TODO + forKey:[[self context] contextID]//TODO withDuration:60*60];//TODO */ LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(GSWComponent*)restorePageForContextID:(NSString*)contextID_ +-(GSWComponent*)restorePageForContextID:(NSString*)aContextID { //OK - GSWComponent* _page=nil; - NSArray* _contextArray=nil; - GSWTransactionRecord* _transactionRecord=nil; - unsigned int _stackIndex=0; - unsigned int _contextArrayIndex=0; + GSWComponent* page=nil; + NSArray* contextArray=nil; + GSWTransactionRecord* transactionRecord=nil; + unsigned int stackIndex=0; + unsigned int contextArrayIndex=0; LOGObjectFnStart(); GSWLogAssertGood(self); - NSAssert(contextID_,@"No contextID"); - NSAssert([contextID_ length]>0,@"contextID empty"); - NSDebugMLLog(@"sessions",@"contextID=%@",contextID_); + NSAssert(aContextID,@"No contextID"); + NSAssert([aContextID length]>0,@"contextID empty"); + NSDebugMLLog(@"sessions",@"aContextID=%@",aContextID); - if ([permanentPageCache objectForKey:contextID_]) - { - _page=[self _permanentPageWithContextID:contextID_]; - } + if ([_permanentPageCache objectForKey:aContextID]) + { + page=[self _permanentPageWithContextID:aContextID]; + } else - { - _transactionRecord=[contextRecords objectForKey:contextID_]; - NSDebugMLLog(@"sessions",@"_transactionRecord=%@",_transactionRecord); - if (_transactionRecord) - { - NSDebugMLLog(@"sessions",@"_transactionRecord2=%@",_transactionRecord); - _page=[_transactionRecord responsePage]; - GSWLogAssertGood(_page); - }; - NSDebugMLLog(@"sessions",@"_transactionRecord3=%@",_transactionRecord); - NSDebugMLLog(@"sessions",@"_page 1=%@",_page); - _contextArray=[self _contextArrayForContextID:contextID_ - stackIndex:&_stackIndex - contextArrayIndex:&_contextArrayIndex]; - NSDebugMLLog(@"sessions",@"_page 2=%@",_page); - if (_contextArray) - { - if (_stackIndex!=([contextArrayStack count]-1)) - { - [contextArrayStack addObject:_contextArray]; - [contextArrayStack removeObjectAtIndex:_stackIndex]; - //TODO faire pareil avec _contextArray ? - }; - }; - }; + { + transactionRecord=[_contextRecords objectForKey:aContextID]; + NSDebugMLLog(@"sessions",@"transactionRecord=%@",transactionRecord); + if (transactionRecord) + { + NSDebugMLLog(@"sessions",@"transactionRecord2=%@",transactionRecord); + page=[transactionRecord responsePage]; + GSWLogAssertGood(page); + }; + NSDebugMLLog(@"sessions",@"transactionRecord3=%@",transactionRecord); + NSDebugMLLog(@"sessions",@"page 1=%@",page); + contextArray=[self _contextArrayForContextID:aContextID + stackIndex:&stackIndex + contextArrayIndex:&contextArrayIndex]; + NSDebugMLLog(@"sessions",@"page 2=%@",page); + if (contextArray) + { + if (stackIndex!=([_contextArrayStack count]-1)) + { + [_contextArrayStack addObject:contextArray]; + [_contextArrayStack removeObjectAtIndex:stackIndex]; + //TODO faire pareil avec _contextArray ? + }; + }; + }; NSAssert(self,@"self"); - NSDebugMLLog(@"sessions",@"currentContext=%@",currentContext); - NSDebugMLLog(@"sessions",@"_page 3=%@",_page); - [_page awakeInContext:currentContext]; - NSDebugMLLog(@"sessions",@"_page 4=%@",_page); + NSDebugMLLog(@"sessions",@"_currentContext=%@",_currentContext); + NSDebugMLLog(@"sessions",@"page 3=%@",page); + [page awakeInContext:_currentContext]; + NSDebugMLLog(@"sessions",@"page 4=%@",page); LOGObjectFnStop(); - return _page; + return page; }; //-------------------------------------------------------------------- @@ -476,76 +482,80 @@ static char rcsId[] = "$Id$"; }; //-------------------------------------------------------------------- --(void)savePageInPermanentCache:(GSWComponent*)page_ +-(void)savePageInPermanentCache:(GSWComponent*)page { - GSWContext* _context=nil; - NSMutableDictionary* _permanentPageCache=nil; - unsigned int _permanentPageCacheSize=0; - NSString* _contextID=nil; + GSWContext* context=nil; + NSMutableDictionary* permanentPageCache=nil; + unsigned int permanentPageCacheSize=0; + NSString* contextID=nil; LOGObjectFnStart(); - _context=[self context]; - _permanentPageCache=[self _permanentPageCache]; - _permanentPageCacheSize=[self permanentPageCacheSize]; - while([permanentContextIDArray count]>0 && [permanentContextIDArray count]>=_permanentPageCacheSize) - { - id _deletePage=nil; - NSString* _deleteContextID=nil; - [GSWApplication statusLogWithFormat:@"Deleting permanent cached Page"]; - _deleteContextID=[permanentContextIDArray objectAtIndex:0]; - GSWLogAssertGood(_deleteContextID); - [GSWApplication statusLogWithFormat:@"permanentContextIDArray=%@",permanentContextIDArray]; - [GSWApplication statusLogWithFormat:@"contextID=%@",_deleteContextID]; - NSDebugMLLog(@"sessions",@"_deleteContextID=%@",_deleteContextID); - NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0]=%@",[permanentContextIDArray objectAtIndex:0]); - NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0] retainCount=%d",(int)[[permanentContextIDArray objectAtIndex:0] retainCount]); - [permanentContextIDArray removeObjectAtIndex:0]; - _deletePage=[contextRecords objectForKey:_deleteContextID]; - GSWLogAssertGood(_deletePage); - [GSWApplication statusLogWithFormat:@"delete page of class=%@",[_deletePage class]]; - [_permanentPageCache removeObjectForKey:_deleteContextID]; + context=[self context]; + permanentPageCache=[self _permanentPageCache]; + permanentPageCacheSize=[self permanentPageCacheSize]; + while([_permanentContextIDArray count]>0 && [_permanentContextIDArray count]>=permanentPageCacheSize) + { + id deletePage=nil; + NSString* deleteContextID=nil; + [GSWApplication statusLogWithFormat:@"Deleting permanent cached Page"]; + deleteContextID=[_permanentContextIDArray objectAtIndex:0]; + GSWLogAssertGood(deleteContextID); + [GSWApplication statusLogWithFormat:@"permanentContextIDArray=%@", + _permanentContextIDArray]; + [GSWApplication statusLogWithFormat:@"contextID=%@",deleteContextID]; + NSDebugMLLog(@"sessions",@"deleteContextID=%@",deleteContextID); + NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0]=%@", + [_permanentContextIDArray objectAtIndex:0]); + NSDebugMLLog(@"sessions",@"[permanentContextIDArray objectAtIndex:0] retainCount=%d", + (int)[[_permanentContextIDArray objectAtIndex:0] retainCount]); + [_permanentContextIDArray removeObjectAtIndex:0]; + deletePage=[_contextRecords objectForKey:deleteContextID]; + GSWLogAssertGood(deletePage); + [GSWApplication statusLogWithFormat:@"delete page of class=%@", + [deletePage class]]; + [permanentPageCache removeObjectForKey:deleteContextID]; }; - _contextID=[_context contextID]; - NSAssert(_contextID,@"No contextID"); + contextID=[context contextID]; + NSAssert(contextID,@"No contextID"); - if ([permanentContextIDArray containsObject:_contextID]) - { - LOGSeriousError(@"page of class %@ contextID %@ already in permanent cache stack", - [page_ class], - _contextID); - [permanentContextIDArray removeObject:_contextID]; - if (![_permanentPageCache objectForKey:_contextID]) - { - LOGSeriousError0(@"but not present in cache"); - }; - } - else if ([_permanentPageCache objectForKey:_contextID]) - { - LOGSeriousError(@"page of class %@ contextID %@ in permanent cache but not in stack", - [page_ class], - _contextID); - }; + if ([_permanentContextIDArray containsObject:contextID]) + { + LOGSeriousError(@"page of class %@ contextID %@ already in permanent cache stack", + [page class], + contextID); + [_permanentContextIDArray removeObject:contextID]; + if (![permanentPageCache objectForKey:contextID]) + { + LOGSeriousError0(@"but not present in cache"); + }; + } + else if ([permanentPageCache objectForKey:contextID]) + { + LOGSeriousError(@"page of class %@ contextID %@ in permanent cache but not in stack", + [page class], + contextID); + }; - [_permanentPageCache setObject:page_ - forKey:_contextID]; - [permanentContextIDArray addObject:_contextID]; + [permanentPageCache setObject:page + forKey:contextID]; + [_permanentContextIDArray addObject:contextID]; //TODO { - int i=0; - id __object=nil; - id __contextID=nil; - for(i=0;i<[permanentContextIDArray count];i++) - { - __contextID=[permanentContextIDArray objectAtIndex:i]; - __object=[_permanentPageCache objectForKey:__contextID]; - [GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[__object class]]; - }; + int i=0; + id anObject=nil; + id anotherContextID=nil; + for(i=0;i<[_permanentContextIDArray count];i++) + { + anotherContextID=[_permanentContextIDArray objectAtIndex:i]; + anObject=[permanentPageCache objectForKey:anotherContextID]; + [GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,anotherContextID,[anObject class]]; + }; }; - if ([permanentContextIDArray count]!=[_permanentPageCache count]) - { - LOGSeriousError(@"[permanentContextIDArray count] %d != [permanentPageCache count] %d", - (int)[permanentContextIDArray count], - (int)[_permanentPageCache count]); - }; + if ([_permanentContextIDArray count]!=[permanentPageCache count]) + { + LOGSeriousError(@"[permanentContextIDArray count] %d != [permanentPageCache count] %d", + (int)[_permanentContextIDArray count], + (int)[permanentPageCache count]); + }; LOGObjectFnStop(); }; @@ -555,56 +565,56 @@ static char rcsId[] = "$Id$"; @implementation GSWSession (GSWSessionF) //-------------------------------------------------------------------- --(void)clearCookieFromResponse:(GSWResponse*)_response +-(void)clearCookieFromResponse:(GSWResponse*)aResponse { - NSString* _domainForIDCookies=nil; - NSString* _sessionID=nil; + NSString* domainForIDCookies=nil; + NSString* sessionID=nil; LOGObjectFnStart(); - _domainForIDCookies=[self domainForIDCookies]; - _sessionID=[self sessionID]; - [_response addCookie:[GSWCookie cookieWithName:GSWKey_SessionID[GSWebNamingConv] - value:_sessionID - path:_domainForIDCookies - domain:nil - expires:[self expirationDateForIDCookies] - isSecure:NO]]; - [_response addCookie:[GSWCookie cookieWithName:GSWKey_InstanceID[GSWebNamingConv] - value:@"-1" //TODO - path:_domainForIDCookies - domain:nil - expires:[self expirationDateForIDCookies] - isSecure:NO]]; + domainForIDCookies=[self domainForIDCookies]; + sessionID=[self sessionID]; + [aResponse addCookie:[GSWCookie cookieWithName:GSWKey_SessionID[GSWebNamingConv] + value:sessionID + path:domainForIDCookies + domain:nil + expires:[self expirationDateForIDCookies] + isSecure:NO]]; + [aResponse addCookie:[GSWCookie cookieWithName:GSWKey_InstanceID[GSWebNamingConv] + value:@"-1" //TODO + path:domainForIDCookies + domain:nil + expires:[self expirationDateForIDCookies] + isSecure:NO]]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)appendCookieToResponse:(GSWResponse*)_response +-(void)appendCookieToResponse:(GSWResponse*)aResponse { //OK LOGObjectFnStart(); if ([self storesIDsInCookies]) - { - //TODO VERIFY - NSString* _domainForIDCookies=nil; - NSString* _sessionID=nil; - _domainForIDCookies=[self domainForIDCookies]; - _sessionID=[self sessionID]; - [_response addCookie:[GSWCookie cookieWithName:GSWKey_SessionID[GSWebNamingConv] - value:_sessionID - path:_domainForIDCookies - domain:nil - expires:[self expirationDateForIDCookies] - isSecure:NO]]; - - [_response addCookie:[GSWCookie cookieWithName:GSWKey_InstanceID[GSWebNamingConv] - value:@"1" //TODO - path:_domainForIDCookies - domain:nil - expires:[self expirationDateForIDCookies] - isSecure:NO]]; + { + //TODO VERIFY + NSString* domainForIDCookies=nil; + NSString* sessionID=nil; + domainForIDCookies=[self domainForIDCookies]; + sessionID=[self sessionID]; + [aResponse addCookie:[GSWCookie cookieWithName:GSWKey_SessionID[GSWebNamingConv] + value:sessionID + path:domainForIDCookies + domain:nil + expires:[self expirationDateForIDCookies] + isSecure:NO]]; + + [aResponse addCookie:[GSWCookie cookieWithName:GSWKey_InstanceID[GSWebNamingConv] + value:@"1" //TODO + path:domainForIDCookies + domain:nil + expires:[self expirationDateForIDCookies] + isSecure:NO]]; - }; + }; LOGObjectFnStop(); }; @@ -623,7 +633,7 @@ extern id gcObjectsToBeVisited; //TODO-NOW remettre [GarbageCollector collectGarbages]; printf("session %p _releaseAutoreleasePool after garbage",self); fprintf(stderr,"session %p _releaseAutoreleasePool after garbage\n",self); - DESTROY(autoreleasePool); + DESTROY(_autoreleasePool); printf("session %p _releaseAutoreleasePool STOP\n",self); fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); LOGObjectFnStop(); @@ -634,20 +644,20 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); { //OK LOGObjectFnStart(); - if (!autoreleasePool) - autoreleasePool=[NSAutoreleasePool new]; + if (!_autoreleasePool) + _autoreleasePool=[NSAutoreleasePool new]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(GSWComponent*)_permanentPageWithContextID:(NSString*)_contextID +-(GSWComponent*)_permanentPageWithContextID:(NSString*)aContextID { //OK - GSWComponent* _page=nil; + GSWComponent* page=nil; LOGObjectFnStart(); - _page=[permanentPageCache objectForKey:_contextID]; + page=[_permanentPageCache objectForKey:aContextID]; LOGObjectFnStop(); - return _page; + return page; }; //-------------------------------------------------------------------- @@ -655,17 +665,17 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); { //OK LOGObjectFnStart(); - if (!permanentPageCache) - permanentPageCache=[NSMutableDictionary new]; - if (!permanentContextIDArray) - permanentContextIDArray=[NSMutableArray new]; + if (!_permanentPageCache) + _permanentPageCache=[NSMutableDictionary new]; + if (!_permanentContextIDArray) + _permanentContextIDArray=[NSMutableArray new]; LOGObjectFnStop(); - return permanentPageCache; + return _permanentPageCache; }; //-------------------------------------------------------------------- --(GSWContext*)_contextIDMatchingContextID:(NSString*)_contextID - requestSenderID:(NSString*)_senderID +-(GSWContext*)_contextIDMatchingContextID:(NSString*)aContextID + requestSenderID:(NSString*)aSenderID { //avec (0) contextID=0 senderID=1.3 ==> return index=(0) stackIndex=0 contextArrayIndex=0 ==> return nil //avec (0,1) contextID=1 senderID=3 ==> return index=(1) stackIndex=1 contextArrayIndex=0 ==> return nil @@ -679,17 +689,17 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //OK - GSWContext* _context=nil; - if (contextArrayStack) - { - unsigned int _stackIndex=0; - unsigned int _contextArrayIndex=0; - NSArray* _contextArray=[self _contextArrayForContextID:_contextID - stackIndex:&_stackIndex - contextArrayIndex:&_contextArrayIndex]; - }; + GSWContext* context=nil; + if (_contextArrayStack) + { + unsigned int stackIndex=0; + unsigned int contextArrayIndex=0; + NSArray* contextArray=[self _contextArrayForContextID:aContextID + stackIndex:&stackIndex + contextArrayIndex:&contextArrayIndex]; + }; //TODO!! - return _context; + return context; }; //-------------------------------------------------------------------- @@ -716,35 +726,35 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); }; //-------------------------------------------------------------------- --(NSArray*)_contextArrayForContextID:(NSString*)_contextID - stackIndex:(unsigned int*)_pStackIndex - contextArrayIndex:(unsigned int*)_pContextArrayIndex +-(NSArray*)_contextArrayForContextID:(NSString*)aContextID + stackIndex:(unsigned int*)pStackIndex + contextArrayIndex:(unsigned int*)pContextArrayIndex { //OK - NSArray* _contextArray=nil; - unsigned int index=[contextArrayStack indexOfObject:_contextID]; + NSArray* contextArray=nil; + unsigned int index=[_contextArrayStack indexOfObject:aContextID]; LOGObjectFnNotImplemented(); //TODOFN if (index==NSNotFound) - { - if (_pStackIndex) - *_pStackIndex=0; - if (_pContextArrayIndex) - *_pContextArrayIndex=0; - } + { + if (pStackIndex) + *pStackIndex=0; + if (pContextArrayIndex) + *pContextArrayIndex=0; + } else - { - if (_pStackIndex) - *_pStackIndex=index; -/* if (_pContextArrayIndex) - *_pContextArrayIndex=XX;*/ - _contextArray=[contextArrayStack objectAtIndex:index]; - }; - return _contextArray; + { + if (pStackIndex) + *pStackIndex=index; +/* if (pContextArrayIndex) + *pContextArrayIndex=XX;*/ + contextArray=[_contextArrayStack objectAtIndex:index]; + }; + return contextArray; }; //-------------------------------------------------------------------- --(void)_replacePage:(GSWComponent*)_page +-(void)_replacePage:(GSWComponent*)page { LOGObjectFnNotImplemented(); //TODOFN }; @@ -757,118 +767,122 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); }; //-------------------------------------------------------------------- --(void)_savePage:(GSWComponent*)_page - forChange:(BOOL)_forChange +-(void)_savePage:(GSWComponent*)page + forChange:(BOOL)forChange { //OK - GSWResponse* _response=nil; - BOOL _isClientCachingDisabled=NO; - GSWTransactionRecord* _transactionRecord=nil; - unsigned int _pageCacheSize=0; - NSString* _contextID=nil; + GSWResponse* response=nil; + BOOL isClientCachingDisabled=NO; + GSWTransactionRecord* transactionRecord=nil; + unsigned int pageCacheSize=0; + NSString* contextID=nil; LOGObjectFnStart(); - NSAssert(_page,@"No Page"); - if ([contextArrayStack count]>0) // && _forChange!=NO ?? - [self _rearrangeContextArrayStack]; + NSAssert(page,@"No Page"); + if ([_contextArrayStack count]>0) // && _forChange!=NO ?? + [self _rearrangeContextArrayStack]; // Get the response - _response=[currentContext response];//currentContext?? - NSDebugMLLog(@"sessions",@"_response=%@",_response); - _isClientCachingDisabled=[_response _isClientCachingDisabled]; //So what - NSDebugMLLog(@"sessions",@"currentContext=%@",currentContext); + response=[_currentContext response];//currentContext?? + NSDebugMLLog(@"sessions",@"response=%@",response); + isClientCachingDisabled=[response _isClientCachingDisabled]; //So what + NSDebugMLLog(@"sessions",@"currentContext=%@",_currentContext); // Create a new transaction record - _transactionRecord=[[[GSWTransactionRecord alloc] - initWithResponsePage:_page - context:currentContext]//currentContext?? - autorelease]; - NSDebugMLLog(@"sessions",@"_transactionRecord=%@",_transactionRecord); + transactionRecord=[[[GSWTransactionRecord alloc] + initWithResponsePage:page + context:_currentContext]//currentContext?? + autorelease]; + NSDebugMLLog(@"sessions",@"transactionRecord=%@",transactionRecord); // Retrieve the pageCacheSize - _pageCacheSize=[self pageCacheSize]; - NSDebugMLLog(@"sessions",@"_pageCacheSize=%d",_pageCacheSize); + pageCacheSize=[self pageCacheSize]; + NSDebugMLLog(@"sessions",@"pageCacheSize=%d",pageCacheSize); // Create contextArrayStack and contextRecords if not already created - if (!contextArrayStack) - contextArrayStack=[NSMutableArray new]; - if (!contextRecords) - contextRecords=[NSMutableDictionary new]; - NSDebugMLLog(@"sessions",@"contextArrayStack=%@",contextArrayStack); - NSDebugMLLog(@"sessions",@"contextRecords=%@",contextRecords); + if (!_contextArrayStack) + _contextArrayStack=[NSMutableArray new]; + if (!_contextRecords) + _contextRecords=[NSMutableDictionary new]; + NSDebugMLLog(@"sessions",@"contextArrayStack=%@",_contextArrayStack); + NSDebugMLLog(@"sessions",@"contextRecords=%@",_contextRecords); // Remove some pages if page number greater than page cache size - while([contextArrayStack count]>0 && [contextArrayStack count]>=_pageCacheSize) - { - id _deleteRecord=nil; - NSString* _deleteContextID=nil; - [GSWApplication statusLogWithFormat:@"Deleting cached Page"]; - _deleteContextID=[contextArrayStack objectAtIndex:0]; - GSWLogAssertGood(_deleteContextID); - [GSWApplication statusLogWithFormat:@"contextArrayStack=%@",contextArrayStack]; - [GSWApplication statusLogWithFormat:@"contextID=%@",_deleteContextID]; - NSDebugMLLog(@"sessions",@"_deleteContextID=%@",_deleteContextID); - NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0]=%@",[contextArrayStack objectAtIndex:0]); - NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0] retainCount=%d",(int)[[contextArrayStack objectAtIndex:0] retainCount]); - [contextArrayStack removeObjectAtIndex:0]; - _deleteRecord=[contextRecords objectForKey:_deleteContextID]; - GSWLogAssertGood(_deleteRecord); - GSWLogAssertGood([_deleteRecord responsePage]); - [GSWApplication statusLogWithFormat:@"delete page of class=%@",[[_deleteRecord responsePage] class]]; - [contextRecords removeObjectForKey:_deleteContextID]; - }; + while([_contextArrayStack count]>0 && [_contextArrayStack count]>=pageCacheSize) + { + id deleteRecord=nil; + NSString* deleteContextID=nil; + [GSWApplication statusLogWithFormat:@"Deleting cached Page"]; + deleteContextID=[_contextArrayStack objectAtIndex:0]; + GSWLogAssertGood(deleteContextID); + [GSWApplication statusLogWithFormat:@"contextArrayStack=%@",_contextArrayStack]; + [GSWApplication statusLogWithFormat:@"contextID=%@",deleteContextID]; + NSDebugMLLog(@"sessions",@"_deleteContextID=%@",deleteContextID); + NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0]=%@", + [_contextArrayStack objectAtIndex:0]); + NSDebugMLLog(@"sessions",@"[contextArrayStack objectAtIndex:0] retainCount=%d", + (int)[[_contextArrayStack objectAtIndex:0] retainCount]); + [_contextArrayStack removeObjectAtIndex:0]; + deleteRecord=[_contextRecords objectForKey:deleteContextID]; + GSWLogAssertGood(deleteRecord); + GSWLogAssertGood([deleteRecord responsePage]); + [GSWApplication statusLogWithFormat:@"delete page of class=%@", + [[deleteRecord responsePage] class]]; + [_contextRecords removeObjectForKey:deleteContextID]; + }; - GSWLogC("display _page"); - NSDebugMLLog(@"sessions",@"_page=%@",_page); - NSDebugMLLog(@"sessions",@"_page context=%@",[_page context]); + GSWLogC("display page"); + NSDebugMLLog(@"sessions",@"page=%@",page); + NSDebugMLLog(@"sessions",@"page context=%@",[page context]); // Retrieve Page contextID - _contextID=[[_page context]contextID]; - NSDebugMLLog(@"sessions",@"_contextID=%@",_contextID); - NSAssert(_contextID,@"No contextID"); + contextID=[[page context]contextID]; + NSDebugMLLog(@"sessions",@"_contextID=%@",contextID); + NSAssert(contextID,@"No contextID"); - if ([contextArrayStack containsObject:_contextID]) - { - LOGSeriousError(@"page of class %@ contextID %@ already in cache stack", - [_page class], - _contextID); - [contextArrayStack removeObject:_contextID]; - if (![contextRecords objectForKey:_contextID]) - { - LOGSeriousError0(@"but not present in cache"); - }; - } - else if ([contextRecords objectForKey:_contextID]) - { - LOGSeriousError(@"page of class %@ contextID %@ in cache but not in stack", - [_page class], - _contextID); - }; + if ([_contextArrayStack containsObject:contextID]) + { + LOGSeriousError(@"page of class %@ contextID %@ already in cache stack", + [page class], + contextID); + [_contextArrayStack removeObject:contextID]; + if (![_contextRecords objectForKey:contextID]) + { + LOGSeriousError0(@"but not present in cache"); + }; + } + else if ([_contextRecords objectForKey:contextID]) + { + LOGSeriousError(@"page of class %@ contextID %@ in cache but not in stack", + [page class], + contextID); + }; // Add the page contextID in contextArrayStack - [contextArrayStack addObject:_contextID]; + [_contextArrayStack addObject:contextID]; // Add the record for this contextID in contextRecords - [contextRecords setObject:_transactionRecord - forKey:_contextID]; - NSDebugMLLog(@"sessions",@"contextArrayStack=%@",contextArrayStack); + [_contextRecords setObject:transactionRecord + forKey:contextID]; + NSDebugMLLog(@"sessions",@"contextArrayStack=%@",_contextArrayStack); //TODO { - int i=0; - GSWTransactionRecord* __trecord=nil; - id __contextID=nil; - for(i=0;i<[contextArrayStack count];i++) - { - __contextID=[contextArrayStack objectAtIndex:i]; - __trecord=[contextRecords objectForKey:__contextID]; - [GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,__contextID,[[__trecord responsePage] class]]; - }; + int i=0; + GSWTransactionRecord* aTransRecord=nil; + id anotherContextID=nil; + for(i=0;i<[_contextArrayStack count];i++) + { + anotherContextID=[_contextArrayStack objectAtIndex:i]; + aTransRecord=[_contextRecords objectForKey:anotherContextID]; + [GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@", + i,anotherContextID,[[aTransRecord responsePage] class]]; + }; }; - if ([contextArrayStack count]!=[contextRecords count]) - { - LOGSeriousError(@"[contextArrayStack count] %d != [contextRecords count] %d", - (int)[contextArrayStack count], - (int)[contextRecords count]); - }; - NSDebugMLLog(@"sessions",@"contextRecords=%@",contextRecords); + if ([_contextArrayStack count]!=[_contextRecords count]) + { + LOGSeriousError(@"[contextArrayStack count] %d != [contextRecords count] %d", + (int)[_contextArrayStack count], + (int)[_contextRecords count]); + }; + NSDebugMLLog(@"sessions",@"contextRecords=%@",_contextRecords); LOGObjectFnStop(); }; @@ -876,21 +890,21 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); -(void)_saveCurrentPage { //OK - GSWComponent* _component=nil; - unsigned int _pageCacheSize=0; + GSWComponent* component=nil; + unsigned int pageCacheSize=0; LOGObjectFnStart(); LOGObjectFnStart(); - NSAssert(currentContext,@"currentContext"); - _component=[currentContext _pageComponent]; - NSAssert(_component,@"_component"); - _pageCacheSize=[self pageCacheSize]; - if (_pageCacheSize>0) - { - if ([_component _isPage]) - { - [self savePage:_component]; - }; - }; + NSAssert(_currentContext,@"currentContext"); + component=[_currentContext _pageComponent]; + NSAssert(component,@"No component"); + pageCacheSize=[self pageCacheSize]; + if (pageCacheSize>0) + { + if ([component _isPage]) + { + [self savePage:component]; + }; + }; LOGObjectFnStop(); }; @@ -898,34 +912,34 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); -(int)_requestCounter { //OK - return requestCounter; + return _requestCounter; }; //-------------------------------------------------------------------- -(void)_contextDidIncrementContextID { - contextCounter++; + _contextCounter++; }; //-------------------------------------------------------------------- -(int)_contextCounter { //OK - return contextCounter; + return _contextCounter; }; //-------------------------------------------------------------------- --(void)_setContext:(GSWContext*)_context +-(void)_setContext:(GSWContext*)aContext { //OK LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"_context=%p",(void*)_context); - currentContext=_context; + NSDebugMLLog(@"sessions",@"aContext=%p",(void*)aContext); + _currentContext=aContext; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)sleepInContext:(GSWContext*)_context +-(void)sleepInContext:(GSWContext*)aContext { //OK LOGObjectFnStart(); @@ -935,21 +949,21 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); }; //-------------------------------------------------------------------- --(void)awakeInContext:(GSWContext*)_context +-(void)awakeInContext:(GSWContext*)aContext { //OK LOGObjectFnStart(); - [self _setContext:_context]; - NSDebugMLLog(@"sessions",@"contextCounter=%i",contextCounter); - if (_context) - { - if ([[self class] __counterIncrementingEnabledFlag]) //?? - { - contextCounter++; - requestCounter++; - }; - }; - NSDebugMLLog(@"sessions",@"contextCounter=%i",contextCounter); + [self _setContext:aContext]; + NSDebugMLLog(@"sessions",@"contextCounter=%i",_contextCounter); + if (aContext) + { + if ([[self class] __counterIncrementingEnabledFlag]) //?? + { + _contextCounter++; + _requestCounter++; + }; + }; + NSDebugMLLog(@"sessions",@"contextCounter=%i",_contextCounter); [self awake]; LOGObjectFnStop(); }; @@ -964,24 +978,24 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); { //OK if (!someLanguages) - { - LOGError0(@"No languages"); - }; - ASSIGN(languages,someLanguages); + { + LOGError0(@"No languages"); + }; + ASSIGN(_languages,someLanguages); }; //-------------------------------------------------------------------- -(NSArray*)languages { //OK - if (!languages) - { - GSWContext* _context=[self context]; - GSWRequest* _request=[_context request]; - NSArray* _languages=[_request browserLanguages]; - [self setLanguages:_languages]; - }; - return languages; + if (!_languages) + { + GSWContext* aContext=[self context]; + GSWRequest* request=[aContext request]; + NSArray* languages=[request browserLanguages]; + [self setLanguages:languages]; + }; + return _languages; }; @end @@ -991,36 +1005,36 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //-------------------------------------------------------------------- // objectForKey: --(id)objectForKey:(NSString*)key_ +-(id)objectForKey:(NSString*)key { - id _object=nil; + id object=nil; LOGObjectFnStart(); - _object=[componentState objectForKey:key_]; - NSDebugMLLog(@"sessions",@"key_=%@ _object=%@",key_,_object); + object=[_componentState objectForKey:key]; + NSDebugMLLog(@"sessions",@"key=%@ object=%@",key,object); LOGObjectFnStop(); - return _object; + return object; }; //-------------------------------------------------------------------- // setObject:forKey: --(void)setObject:(id)object_ - forKey:(NSString*)key_ +-(void)setObject:(id)object + forKey:(NSString*)key { LOGObjectFnStart(); - if (!componentState) - componentState=[NSMutableDictionary new]; - NSDebugMLLog(@"sessions",@"key_=%@ object_=%@",key_,object_); - [componentState setObject:object_ - forKey:key_]; + if (!_componentState) + _componentState=[NSMutableDictionary new]; + NSDebugMLLog(@"sessions",@"key=%@ object=%@",key,object); + [_componentState setObject:object + forKey:key]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)removeObjectForKey:(NSString*)key_ +-(void)removeObjectForKey:(NSString*)key { LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"key_=%@",key_); - [componentState removeObjectForKey:key_]; + NSDebugMLLog(@"sessions",@"key=%@",key); + [_componentState removeObjectForKey:key]; LOGObjectFnStop(); }; @@ -1028,7 +1042,7 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //NDFN -(NSMutableDictionary*)componentState { - return componentState; + return _componentState; }; @end @@ -1039,19 +1053,19 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); -(EOEditingContext*)defaultEditingContext { #if GDL2 - if(editingContext == nil) + if(!_editingContext) { - ASSIGN(editingContext, [[[EOEditingContext alloc] init] autorelease]); + ASSIGN(_editingContext,[[[EOEditingContext alloc] init] autorelease]); } #endif - return editingContext; + return _editingContext; }; //-------------------------------------------------------------------- --(void)setDefaultEditingContext:(EOEditingContext*)_editingContext +-(void)setDefaultEditingContext:(EOEditingContext*)editingContext { - ASSIGN(editingContext,_editingContext); + ASSIGN(_editingContext,editingContext); }; @end @@ -1062,7 +1076,7 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //-------------------------------------------------------------------- -(GSWContext*)context { - return currentContext; + return _currentContext; }; //-------------------------------------------------------------------- @@ -1081,101 +1095,100 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //Does Nothing }; - //-------------------------------------------------------------------- // takeValuesFromRequest:inContext: --(void)takeValuesFromRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(void)takeValuesFromRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { //OK - GSWElement* _pageElement=nil; - GSWComponent* _pageComponent=nil; + GSWElement* pageElement=nil; + GSWComponent* pageComponent=nil; LOGObjectFnStart(); - _pageElement=[context_ _pageElement]; - _pageComponent=[context_ _pageComponent]; + pageElement=[aContext _pageElement]; + pageComponent=[aContext _pageComponent]; #ifndef NDEBUG - [context_ addDocStructureStep:@"Take Values From Request"]; + [aContext addDocStructureStep:@"Take Values From Request"]; #endif - [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? - [_pageComponent takeValuesFromRequest:request_ - inContext:context_]; //_pageComponent ?? - [context_ _setCurrentComponent:nil]; + [aContext _setCurrentComponent:pageComponent]; //_pageElement ?? + [pageComponent takeValuesFromRequest:aRequest + inContext:aContext]; //_pageComponent ?? + [aContext _setCurrentComponent:nil]; LOGObjectFnStop(); }; //-------------------------------------------------------------------- // invokeActionForRequest:inContext: --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { - GSWElement* _element=nil; - GSWElement* _pageElement=nil; - GSWComponent* _pageComponent=nil; + GSWElement* element=nil; + GSWElement* pageElement=nil; + GSWComponent* pageComponent=nil; LOGObjectFnStart(); NS_DURING - { - _pageElement=[context_ _pageElement]; - _pageComponent=[context_ _pageComponent]; + { + pageElement=[aContext _pageElement]; + pageComponent=[aContext _pageComponent]; #ifndef NDEBUG - [context_ addDocStructureStep:@"Invoke Action For Request"]; + [aContext addDocStructureStep:@"Invoke Action For Request"]; #endif - [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? - _element=[_pageComponent invokeActionForRequest:request_ - inContext:context_]; //_pageComponent - [context_ _setCurrentComponent:nil]; - if (!_element) - _element=[context_ page]; //?? - } + [aContext _setCurrentComponent:pageComponent]; //_pageElement ?? + element=[pageComponent invokeActionForRequest:aRequest + inContext:aContext]; //_pageComponent + [aContext _setCurrentComponent:nil]; + if (!element) + element=[aContext page]; //?? + } NS_HANDLER - { - LOGException0(@"exception in GSWSession invokeActionForRequest:inContext"); - LOGException(@"exception=%@",localException); - localException=ExceptionByAddingUserInfoObjectFrameInfo(localException, - @"In GSWSession invokeActionForRequest:inContext"); - LOGException(@"exception=%@",localException); - [localException raise]; - } + { + LOGException0(@"exception in GSWSession invokeActionForRequest:inContext"); + LOGException(@"exception=%@",localException); + localException=ExceptionByAddingUserInfoObjectFrameInfo(localException, + @"In GSWSession invokeActionForRequest:inContext"); + LOGException(@"exception=%@",localException); + [localException raise]; + } NS_ENDHANDLER; LOGObjectFnStop(); - return _element; + return element; }; //-------------------------------------------------------------------- // appendToResponse:inContext: --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { //OK - GSWStatisticsStore* _statisticsStore=nil; - NSString* _logFile=nil; - GSWSession* _session=nil; - GSWComponent* _page=nil; - NSString* _pageName=nil; - NSString* _description=nil; - GSWElement* _pageElement=nil; - GSWComponent* _pageComponent=nil; + GSWStatisticsStore* statisticsStore=nil; + NSString* logFile=nil; + GSWSession* session=nil; + GSWComponent* page=nil; + NSString* pageName=nil; + NSString* description=nil; + GSWElement* pageElement=nil; + GSWComponent* pageComponent=nil; LOGObjectFnStart(); - _statisticsStore=[[GSWApplication application] statisticsStore]; - _pageElement=[context_ _pageElement]; - _pageComponent=[context_ _pageComponent]; + statisticsStore=[[GSWApplication application] statisticsStore]; + pageElement=[aContext _pageElement]; + pageComponent=[aContext _pageComponent]; #ifndef NDEBUG - [context_ addDocStructureStep:@"Append To Response"]; + [aContext addDocStructureStep:@"Append To Response"]; #endif - [context_ _setCurrentComponent:_pageComponent]; //_pageElement ?? - [_pageComponent appendToResponse:response_ - inContext:context_]; //_pageComponent?? - [context_ _setCurrentComponent:nil]; - _session=[context_ existingSession]; - [_session appendCookieToResponse:response_]; - [_statisticsStore recordStatisticsForResponse:response_ - inContext:context_]; - [_statisticsStore descriptionForResponse:response_ - inContext:context_]; - _logFile=[_statisticsStore logFile]; - if (_logFile) - { - //TODO - }; + [aContext _setCurrentComponent:pageComponent]; //_pageElement ?? + [pageComponent appendToResponse:aResponse + inContext:aContext]; //_pageComponent?? + [aContext _setCurrentComponent:nil]; + session=[aContext existingSession]; + [session appendCookieToResponse:aResponse]; + [statisticsStore recordStatisticsForResponse:aResponse + inContext:aContext]; + [statisticsStore descriptionForResponse:aResponse + inContext:aContext]; + logFile=[statisticsStore logFile]; + if (logFile) + { + //TODO + }; LOGObjectFnStop(); }; @@ -1201,13 +1214,13 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //-------------------------------------------------------------------- -(BOOL)_allowedToViewStatistics { - return isAllowedToViewStatistics; + return _isAllowedToViewStatistics; }; //-------------------------------------------------------------------- -(void)_allowToViewStatistics { - isAllowedToViewStatistics=YES; + _isAllowedToViewStatistics=YES; }; //-------------------------------------------------------------------- @@ -1220,7 +1233,7 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); //-------------------------------------------------------------------- -(NSDate*)_birthDate { - return birthDate; + return _birthDate; }; @end @@ -1251,7 +1264,7 @@ fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self); @implementation GSWSession (GSWSessionClassA) //-------------------------------------------------------------------- -+(void)__setContextCounterIncrementingEnabled:(BOOL)_flag ++(void)__setContextCounterIncrementingEnabled:(BOOL)flag { LOGClassFnNotImplemented(); //TODOFN }; diff --git a/GSWeb.framework/GSWSessionStore.h b/GSWeb.framework/GSWSessionStore.h index 58defd0..dc47634 100644 --- a/GSWeb.framework/GSWSessionStore.h +++ b/GSWeb.framework/GSWSessionStore.h @@ -1,11 +1,16 @@ -/* GSWSessionStore.h - GSWeb: Class GSWSessionStore - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSessionStore.m - GSWeb: Class GSWSessionStore + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -29,10 +35,10 @@ @interface GSWSessionStore : NSObject { - NSMutableSet* usedIDs; - NSRecursiveLock* lock; + NSMutableSet* _usedIDs; + NSRecursiveLock* _lock; #ifndef NDEBUG - int lockn; + int _lockn; #endif //TODO void* sessionCheckedInCondition; }; @@ -40,18 +46,18 @@ -(void)dealloc; -(id)init; --(GSWSession*)restoreSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_; --(void)saveSessionForContext:(GSWContext*)context_; --(GSWSession*)checkOutSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_; --(void)checkInSessionForContext:(GSWContext*)context_; +-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest; +-(void)saveSessionForContext:(GSWContext*)aContext; +-(GSWSession*)checkOutSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest; +-(void)checkInSessionForContext:(GSWContext*)aContext; --(void)_checkInSessionForContext:(GSWContext*)context_; --(GSWSession*)_checkOutSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_; --(void)_checkinSessionID:(NSString*)sessionID_; --(void)_checkoutSessionID:(NSString*)sessionID_; +-(void)_checkInSessionForContext:(GSWContext*)aContext; +-(GSWSession*)_checkOutSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest; +-(void)_checkinSessionID:(NSString*)aSessionID; +-(void)_checkoutSessionID:(NSString*)aSessionID; -(void)unlock; -(BOOL)tryLock; -(void)lock; @@ -65,19 +71,19 @@ //==================================================================== @interface GSWSessionStore (GSWSessionStoreOldFn) -+(GSWSessionStore*)cookieSessionStoreWithDistributionDomain:(NSString*)domain_ - secure:(BOOL)flag_; ++(GSWSessionStore*)cookieSessionStoreWithDistributionDomain:(NSString*)aDomain +secure:(BOOL)flag; +(GSWSessionStore*)pageSessionStore; +(GSWSessionStore*)serverSessionStore; -(GSWSession*)restoreSession; --(void)saveSession:(GSWSession*)session_; +-(void)saveSession:(GSWSession*)session; @end */ //==================================================================== @interface GSWSessionStore (GSWSessionStoreA) --(BOOL)_isSessionIDCheckedOut:(NSString*)sessionID_; +-(BOOL)_isSessionIDCheckedOut:(NSString*)aSessionID; @end diff --git a/GSWeb.framework/GSWSessionStore.m b/GSWeb.framework/GSWSessionStore.m index 04715ae..aeed7e2 100644 --- a/GSWeb.framework/GSWSessionStore.m +++ b/GSWeb.framework/GSWSessionStore.m @@ -1,11 +1,16 @@ -/* GSWSessionStore.m - GSWeb: Class GSWSessionStore - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSessionStore.m - GSWeb: Class GSWSessionStore + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -34,11 +40,11 @@ static char rcsId[] = "$Id$"; { LOGObjectFnStart(); if ((self=[super init])) - { - usedIDs=[NSMutableSet new]; - lock=[NSRecursiveLock new]; - [self _validateAPI]; - }; + { + _usedIDs=[NSMutableSet new]; + _lock=[NSRecursiveLock new]; + [self _validateAPI]; + }; LOGObjectFnStop(); return self; }; @@ -48,214 +54,219 @@ static char rcsId[] = "$Id$"; { GSWLogC("Dealloc GSWSessionStore"); GSWLogC("Dealloc GSWSessionStore: usedIDs"); - DESTROY(usedIDs); + DESTROY(_usedIDs); GSWLogC("Dealloc GSWSessionStore: lock"); - DESTROY(lock); + DESTROY(_lock); GSWLogC("Dealloc GSWSessionStore Super"); [super dealloc]; GSWLogC("End Dealloc GSWSessionStore"); }; //-------------------------------------------------------------------- --(GSWSession*)restoreSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_ +-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest { LOGObjectFnNotImplemented(); //TODOFN return nil; }; //-------------------------------------------------------------------- --(void)saveSessionForContext:(GSWContext*)context_ +-(void)saveSessionForContext:(GSWContext*)aContext { LOGObjectFnNotImplemented(); //TODOFN }; //-------------------------------------------------------------------- --(GSWSession*)checkOutSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_ +-(GSWSession*)checkOutSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest { - GSWSession* _session=nil; - BOOL _sessionUsed=YES; + GSWSession* session=nil; + BOOL sessionUsed=YES; NSDate* limit=[NSDate dateWithTimeIntervalSinceNow:60]; //OK LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"sessionID_=%@",sessionID_); - NSDebugMLLog(@"sessions",@"usedIDs=%@",usedIDs); + NSDebugMLLog(@"sessions",@"aSessionID=%@",aSessionID); + NSDebugMLLog(@"sessions",@"usedIDs=%@",_usedIDs); NSDebugMLLog(@"sessions",@"self=%@",self); NSDebugMLLog(@"sessions",@"[NSDate date]=%@",[NSDate date]); NSDebugMLLog(@"sessions",@"limit=%@",limit); - NSDebugMLLog(@"sessions",@"[[NSDate date]compare:limit]==NSOrderedAscending=%d",(int)([[NSDate date]compare:limit]==NSOrderedAscending)); + NSDebugMLLog(@"sessions",@"[[NSDate date]compare:limit]==NSOrderedAscending=%d", + (int)([[NSDate date]compare:limit]==NSOrderedAscending)); - while(!_session && _sessionUsed && [[NSDate date]compare:limit]==NSOrderedAscending) - { - BOOL _tmpUsed=NO; - if ([self tryLock]) - { - _tmpUsed=[usedIDs containsObject:sessionID_]; - if (_tmpUsed) - [self unlock]; - else - { - NS_DURING - { - _session=[self _checkOutSessionWithID:sessionID_ - request:request_]; - } - NS_HANDLER - { - NSDebugMLLog(@"sessions",@"Can't checkOutSessionID=%@",sessionID_); - if ([[localException name]isEqualToString:@"GSWSessionStoreException"]) - _sessionUsed=YES; - } - NS_ENDHANDLER; - [self unlock]; - _sessionUsed=NO; - NSDebugMLLog(@"sessions",@"_session=%@",_session); - }; - }; - }; - NSDebugMLLog(@"sessions",@"_session=%@",_session); + while(!session && sessionUsed && [[NSDate date]compare:limit]==NSOrderedAscending) + { + BOOL tmpUsed=NO; + if ([self tryLock]) + { + tmpUsed=[_usedIDs containsObject:aSessionID]; + if (tmpUsed) + [self unlock]; + else + { + NS_DURING + { + session=[self _checkOutSessionWithID:aSessionID + request:aRequest]; + } + NS_HANDLER + { + NSDebugMLLog(@"sessions",@"Can't checkOutSessionID=%@",aSessionID); + if ([[localException name]isEqualToString:@"GSWSessionStoreException"]) + sessionUsed=YES; + } + NS_ENDHANDLER; + [self unlock]; + sessionUsed=NO; + NSDebugMLLog(@"sessions",@"session=%@",session); + }; + }; + }; + NSDebugMLLog(@"sessions",@"session=%@",session); LOGObjectFnStop(); - return _session; + return session; }; //-------------------------------------------------------------------- --(void)checkInSessionForContext:(GSWContext*)context_ +-(void)checkInSessionForContext:(GSWContext*)aContext { //OK LOGObjectFnStart(); if ([self tryLock]) - { - NS_DURING - { - [self _checkInSessionForContext:context_]; - } - NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In _checkInSessionForContext:"); - LOGException(@"%@ (%@)",localException,[localException reason]); - //TODO - [self unlock]; - [localException raise]; - } - NS_ENDHANDLER; - [self unlock]; - }; + { + NS_DURING + { + [self _checkInSessionForContext:aContext]; + } + NS_HANDLER + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"In _checkInSessionForContext:"); + LOGException(@"%@ (%@)",localException,[localException reason]); + //TODO + [self unlock]; + [localException raise]; + } + NS_ENDHANDLER; + [self unlock]; + }; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_checkInSessionForContext:(GSWContext*)context_ +-(void)_checkInSessionForContext:(GSWContext*)aContext { //OK - NSString* _sessionID=nil; - GSWSession* _session=nil; + NSString* sessionID=nil; + GSWSession* session=nil; LOGObjectFnStart(); - _session=[context_ existingSession]; - GSWLogAssertGood(_session); - NSDebugMLLog(@"sessions",@"_session=%@",_session); + session=[aContext existingSession]; + GSWLogAssertGood(session); + NSDebugMLLog(@"sessions",@"session=%@",session); NS_DURING - { - [self saveSessionForContext:context_]; - } + { + [self saveSessionForContext:aContext]; + } NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In saveSessionForContext:"); - LOGException(@"%@ (%@)",localException,[localException reason]); - [localException raise]; - } + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"In saveSessionForContext:"); + LOGException(@"%@ (%@)",localException,[localException reason]); + [localException raise]; + } NS_ENDHANDLER; - GSWLogAssertGood(_session); - NSDebugMLLog(@"sessions",@"_session=%@",_session); + GSWLogAssertGood(session); + NSDebugMLLog(@"sessions",@"session=%@",session); NS_DURING - { - [_session _releaseAutoreleasePool]; - } + { + [session _releaseAutoreleasePool]; + } NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In [_session _releaseAutoreleasePool]"); - LOGException(@"%@ (%@)",localException,[localException reason]); - [localException raise]; - } + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"In [_session _releaseAutoreleasePool]"); + LOGException(@"%@ (%@)",localException,[localException reason]); + [localException raise]; + } NS_ENDHANDLER; - GSWLogAssertGood(_session); - NSDebugMLLog(@"sessions",@"_session=%@",_session); - _sessionID=[_session sessionID]; - GSWLogAssertGood(_session); - NSDebugMLLog(@"sessions",@"_sessionID=%@",_sessionID); + GSWLogAssertGood(session); + NSDebugMLLog(@"sessions",@"session=%@",session); + sessionID=[session sessionID]; + GSWLogAssertGood(session); + NSDebugMLLog(@"sessions",@"sessionID=%@",sessionID); NS_DURING - { - [self _checkinSessionID:_sessionID]; - } + { + [self _checkinSessionID:sessionID]; + } NS_HANDLER - { - localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In _checkinSessionID"); - LOGException(@"%@ (%@)",localException,[localException reason]); - [localException raise]; - } + { + localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException, + @"In _checkinSessionID"); + LOGException(@"%@ (%@)",localException,[localException reason]); + [localException raise]; + } NS_ENDHANDLER; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(GSWSession*)_checkOutSessionWithID:(NSString*)sessionID_ - request:(GSWRequest*)request_ +-(GSWSession*)_checkOutSessionWithID:(NSString*)aSessionID + request:(GSWRequest*)aRequest { - GSWSession* _session=nil; + GSWSession* session=nil; LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"sessionID_=%@",sessionID_); + NSDebugMLLog(@"sessions",@"aSessionID=%@",aSessionID); NSDebugMLLog(@"sessions",@"self=%@",self); //OK NSDebugMLog0(@"starting:_checkoutSessionID"); - [self _checkoutSessionID:sessionID_]; + [self _checkoutSessionID:aSessionID]; NSDebugMLog0(@"end of:_checkoutSessionID"); NSDebugMLog0(@"starting:restoreSessionWithID"); - _session=[self restoreSessionWithID:sessionID_ - request:request_]; + session=[self restoreSessionWithID:aSessionID + request:aRequest]; NSDebugMLog0(@"end of:restoreSessionWithID"); - if (_session) - [_session _createAutoreleasePool]; + if (session) + [session _createAutoreleasePool]; else - [self _checkinSessionID:sessionID_]; - NSDebugMLLog(@"sessions",@"_session=%@",_session); + [self checkinSessionID:aSessionID]; + NSDebugMLLog(@"sessions",@"session=%@",session); LOGObjectFnStop(); - return _session; + return session; }; //-------------------------------------------------------------------- --(void)_checkinSessionID:(NSString*)sessionID_ +-(void)_checkinSessionID:(NSString*)aSessionID { LOGObjectFnStart(); //OK -/* if (![usedIDs containsObject:sessionID_]) - { - NSDebugMLLog(@"sessions",@"SessionID=%@ not is use",sessionID_); - } - else - {*/ - [usedIDs removeObject:sessionID_]; -// }; + /* if (![usedIDs containsObject:aSessionID]) + { + NSDebugMLLog(@"sessions",@"SessionID=%@ not is use",aSessionID); + } + else + {*/ + [_usedIDs removeObject:aSessionID]; + // }; LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(void)_checkoutSessionID:(NSString*)sessionID_ +-(void)_checkoutSessionID:(NSString*)aSessionID { //OK LOGObjectFnStart(); - if ([usedIDs containsObject:sessionID_]) - { - NSDebugMLLog(@"sessions",@"SessionID=%@ already in use",sessionID_); - LOGException0(@"NSGenericException session used"); - [NSException raise:@"GSWSessionStoreException" - format:@"Session %@ used", - sessionID_]; - } + if ([_usedIDs containsObject:aSessionID]) + { + NSDebugMLLog(@"sessions",@"SessionID=%@ already in use",aSessionID); + LOGException0(@"NSGenericException session used"); + [NSException raise:@"GSWSessionStoreException" + format:@"Session %@ used", + aSessionID]; + } else - { - [usedIDs addObject:sessionID_]; - }; + { + [_usedIDs addObject:aSessionID]; + }; LOGObjectFnStop(); }; @@ -263,12 +274,12 @@ static char rcsId[] = "$Id$"; -(void)unlock { LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); - TmpUnlock(lock); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); + TmpUnlock(_lock); #ifndef NDEBUG - lockn--; + _lockn--; #endif - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); LOGObjectFnStop(); }; @@ -277,13 +288,13 @@ static char rcsId[] = "$Id$"; { BOOL locked=NO; LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); - locked=TmpTryLockBeforeDate(lock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); + locked=TmpTryLockBeforeDate(_lock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]); #ifndef NDEBUG if (locked) - lockn++; + _lockn++; #endif - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); LOGObjectFnStop(); return locked; }; @@ -292,12 +303,12 @@ static char rcsId[] = "$Id$"; -(void)lock { LOGObjectFnStart(); - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); - TmpLockBeforeDate(lock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); + TmpLockBeforeDate(_lock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]); #ifndef NDEBUG - lockn++; + _lockn++; #endif - NSDebugMLLog(@"sessions",@"lockn=%d",lockn); + NSDebugMLLog(@"sessions",@"lockn=%d",_lockn); LOGObjectFnStop(); }; @@ -356,7 +367,7 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- // saveSession: --(void)saveSession:(GSWSession*)session_ +-(void)saveSession:(GSWSession*)session { //Does Nothing }; @@ -365,14 +376,14 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWSessionStore (GSWSessionStoreA) --(BOOL)_isSessionIDCheckedOut:(NSString*)sessionID_ +-(BOOL)_isSessionIDCheckedOut:(NSString*)aSessionID { //OK - BOOL _checkedOut=NO; + BOOL checkedOut=NO; LOGObjectFnStart(); - _checkedOut=[usedIDs containsObject:sessionID_]; + checkedOut=[_usedIDs containsObject:aSessionID]; LOGObjectFnStop(); - return _checkedOut; + return checkedOut; }; @end diff --git a/GSWeb.framework/GSWSessionTimeOut.h b/GSWeb.framework/GSWSessionTimeOut.h index fbc713c..c797821 100644 --- a/GSWeb.framework/GSWSessionTimeOut.h +++ b/GSWeb.framework/GSWSessionTimeOut.h @@ -1,11 +1,16 @@ -/* GSWSessionTimeOut.h - GSWeb: Class GSWSessionTimeOut - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSessionTimeOut.h - GSWeb: Class GSWSessionTimeOut + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Mar 1999 + Written by: Manuel Guesdon + Date: Mar 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -30,24 +36,24 @@ //==================================================================== @interface GSWSessionTimeOut : NSObject { - NSString* sessionID; - NSTimeInterval lastAccessTime; - NSTimeInterval timeOut; + NSString* _sessionID; + NSTimeInterval _lastAccessTime; + NSTimeInterval _timeOut; }; -(void)dealloc; --(id)initWithSessionID:(NSString*)sessionID_ - lastAccessTime:(NSTimeInterval)lastAccessTime_ - sessionTimeOut:(NSTimeInterval)timeOut; -+(id)timeOutWithSessionID:(NSString*)sessionID_ - lastAccessTime:(NSTimeInterval)lastAccessTime_ - sessionTimeOut:(NSTimeInterval)timeOut; +-(id)initWithSessionID:(NSString*)aSessionID + lastAccessTime:(NSTimeInterval)aTime + sessionTimeOut:(NSTimeInterval)aTimeOutInterval; ++(id)timeOutWithSessionID:(NSString*)aSessionID + lastAccessTime:(NSTimeInterval)aTime + sessionTimeOut:(NSTimeInterval)aTimeOutInterval; -(NSString*)description; --(NSComparisonResult)compareTimeOutDate:(GSWSessionTimeOut*)timeOutObject_; +-(NSComparisonResult)compareTimeOutDate:(GSWSessionTimeOut*)timeOutObject; -(NSTimeInterval)sessionTimeOut; --(void)setSessionTimeOut:(NSTimeInterval)timeOut_; +-(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval; -(NSString*)sessionID; --(void)setLastAccessTime:(NSTimeInterval)lastAccessTime_; +-(void)setLastAccessTime:(NSTimeInterval)aTime; -(NSTimeInterval)lastAccessTime; -(NSTimeInterval)timeOutTime; @end diff --git a/GSWeb.framework/GSWSessionTimeOut.m b/GSWeb.framework/GSWSessionTimeOut.m index d737b83..d0d5c11 100644 --- a/GSWeb.framework/GSWSessionTimeOut.m +++ b/GSWeb.framework/GSWSessionTimeOut.m @@ -1,11 +1,16 @@ -/* GSWSessionTimeOut.m - GSWeb: Class GSWSessionTimeOut - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWSessionTimeOut.m - GSWeb: Class GSWSessionTimeOut + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Mar 1999 + Written by: Manuel Guesdon + Date: Mar 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -30,38 +36,38 @@ static char rcsId[] = "$Id$"; @implementation GSWSessionTimeOut //-------------------------------------------------------------------- --(id)initWithSessionID:(NSString*)sessionID_ - lastAccessTime:(NSTimeInterval)lastAccessTime_ - sessionTimeOut:(NSTimeInterval)timeOut_ +-(id)initWithSessionID:(NSString*)aSessionID + lastAccessTime:(NSTimeInterval)aTime + sessionTimeOut:(NSTimeInterval)aTimeOutInterval { if ((self=[super init])) - { - ASSIGN(sessionID,sessionID_); - lastAccessTime=lastAccessTime_; - timeOut=timeOut_; - }; + { + ASSIGN(_sessionID,aSessionID); + _lastAccessTime=aTime; + _timeOut=aTimeOutInterval; + }; return self; }; //-------------------------------------------------------------------- -+(id)timeOutWithSessionID:(NSString*)sessionID_ - lastAccessTime:(NSTimeInterval)lastAccessTime_ - sessionTimeOut:(NSTimeInterval)timeOut_ ++(id)timeOutWithSessionID:(NSString*)aSessionID + lastAccessTime:(NSTimeInterval)aTime + sessionTimeOut:(NSTimeInterval)aTimeOutInterval { - return [[[self alloc]initWithSessionID:sessionID_ - lastAccessTime:lastAccessTime_ - sessionTimeOut:timeOut_]autorelease]; + return [[[self alloc]initWithSessionID:aSessionID + lastAccessTime:aTime + sessionTimeOut:aTimeOutInterval]autorelease]; }; //-------------------------------------------------------------------- -(void)dealloc { NSDebugFLog0(@"Dealloc GSWSessionTimeOut"); - if (sessionID) - { - NSDebugFLog(@"sessionIDCount=%u",[sessionID retainCount]); - }; - DESTROY(sessionID); + if (_sessionID) + { + NSDebugFLog(@"sessionIDCount=%u",[_sessionID retainCount]); + }; + DESTROY(_sessionID); [super dealloc]; }; @@ -70,64 +76,64 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%s %p - sessionID=%@ timeOutTime=%f lastAccessTime=%f timeOut=%ld", - object_get_class_name(self), - (void*)self, - sessionID, - [self timeOutTime], - lastAccessTime, - (long)timeOut]; + object_get_class_name(self), + (void*)self, + _sessionID, + [self timeOutTime], + _lastAccessTime, + (long)_timeOut]; }; //-------------------------------------------------------------------- --(NSComparisonResult)compareTimeOutDate:(GSWSessionTimeOut*)timeOutObject_ +-(NSComparisonResult)compareTimeOutDate:(GSWSessionTimeOut*)timeOutObject { - if (timeOutObject_) - { - if ([self timeOutTime]<[timeOutObject_ timeOutTime]) - return NSOrderedAscending; - else if ([self timeOutTime]==[timeOutObject_ timeOutTime]) - return NSOrderedSame; - else - return NSOrderedDescending; - } + if (timeOutObject) + { + if ([self timeOutTime]<[timeOutObject timeOutTime]) + return NSOrderedAscending; + else if ([self timeOutTime]==[timeOutObject timeOutTime]) + return NSOrderedSame; + else + return NSOrderedDescending; + } else - return NSOrderedDescending; + return NSOrderedDescending; }; //-------------------------------------------------------------------- -(NSTimeInterval)sessionTimeOut { - return timeOut; + return _timeOut; }; //-------------------------------------------------------------------- --(void)setSessionTimeOut:(NSTimeInterval)timeOut_ +-(void)setSessionTimeOut:(NSTimeInterval)aTimeOutInterval { - timeOut=timeOut_; + _timeOut=aTimeOutInterval; }; //-------------------------------------------------------------------- -(NSString*)sessionID { - return sessionID; + return _sessionID; }; //-------------------------------------------------------------------- --(void)setLastAccessTime:(NSTimeInterval)lastAccessTime_ +-(void)setLastAccessTime:(NSTimeInterval)aTime { - lastAccessTime=lastAccessTime_; + _lastAccessTime=aTime; }; //-------------------------------------------------------------------- -(NSTimeInterval)lastAccessTime { - return lastAccessTime; + return _lastAccessTime; }; //-------------------------------------------------------------------- -(NSTimeInterval)timeOutTime { - return lastAccessTime+timeOut; + return _lastAccessTime+_timeOut; }; @end diff --git a/GSWeb.framework/GSWTemplateParserXML.m b/GSWeb.framework/GSWTemplateParserXML.m index 19541d4..83732d7 100644 --- a/GSWeb.framework/GSWTemplateParserXML.m +++ b/GSWeb.framework/GSWTemplateParserXML.m @@ -606,11 +606,11 @@ static NSString* TabsForLevel(int level) if ([node type]==XML_ELEMENT_NODE) { NSString* nodeName=[node name]; - //NSDebugMLLog(@"GSWTemplateParser",@"node name=%@",nodeName); - /*NSDebugMLLog(@"GSWTemplateParser",@"_isHTMLTag=%s _isBodyTag=%s", +/* NSDebugMLLog(@"GSWTemplateParser",@"node name=%@",nodeName); + NSDebugMLLog(@"GSWTemplateParser",@"_isHTMLTag=%s _isBodyTag=%s", (_isHTMLTag ? "YES" : "NO"), (_isBodyTag ? "YES" : "NO")); - */ +*/ /* NSLog(@"while1 node=%p %@ [Type:%@] [%@] ##%s##\n", node, @@ -622,7 +622,7 @@ static NSString* TabsForLevel(int level) if ((!_isHTMLTag && [nodeName caseInsensitiveCompare:@"html"]==NSOrderedSame) || (!_isBodyTag && [nodeName caseInsensitiveCompare:@"body"]==NSOrderedSame)) { - //NSDebugMLLog(@"GSWTemplateParser",@"==> Children"); +// NSDebugMLLog(@"GSWTemplateParser",@"==> Children"); node=[node firstChild]; cont=YES; }; diff --git a/GSWeb.framework/GSWToggle.h b/GSWeb.framework/GSWToggle.h index 5628f0e..5c81c57 100644 --- a/GSWeb.framework/GSWToggle.h +++ b/GSWeb.framework/GSWToggle.h @@ -1,11 +1,16 @@ -/* GSWToggle.h - GSWeb: Class GSWToggle - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWToggle.h - GSWeb: Class GSWToggle + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -29,27 +35,27 @@ @interface GSWToggle: GSWDynamicElement { - GSWAssociation* action; - GSWAssociation* actionYes; - GSWAssociation* actionNo; - GSWAssociation* condition; - GSWAssociation* disabled; - NSDictionary* otherAssociations; - GSWElement* children; + GSWAssociation* _action; + GSWAssociation* _actionYes; + GSWAssociation* _actionNo; + GSWAssociation* _condition; + GSWAssociation* _disabled; + NSDictionary* _otherAssociations; + GSWElement* _children; }; --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; -(void)dealloc; -(NSString*)description; @end @interface GSWToggle (GSWToggleA) --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_; --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_; +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext; +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext; @end #endif //_GSWToggle_h__ diff --git a/GSWeb.framework/GSWToggle.m b/GSWeb.framework/GSWToggle.m index 0f7dd27..c664041 100644 --- a/GSWeb.framework/GSWToggle.m +++ b/GSWeb.framework/GSWToggle.m @@ -1,11 +1,16 @@ -/* GSWToggle.m - GSWeb: Class GSWToggle - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWToggle.m - GSWeb: Class GSWToggle + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Jan 1999 + Written by: Manuel Guesdon + Date: Jan 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -29,48 +35,48 @@ static char rcsId[] = "$Id$"; @implementation GSWToggle //-------------------------------------------------------------------- --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)someAssociations - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)someAssociations + template:(GSWElement*)templateElement { //OK - NSMutableDictionary* _otherAssociations=nil; + NSMutableDictionary* otherAssociations=nil; LOGObjectFnStart(); - ASSIGN(children,templateElement_); - action = [[someAssociations objectForKey:action__Key - withDefaultObject:[action autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"action=%@",action); + ASSIGN(_children,templateElement); + _action = [[someAssociations objectForKey:action__Key + withDefaultObject:[_action autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"_action=%@",_action); - actionYes = [[someAssociations objectForKey:actionYes__Key - withDefaultObject:[actionYes autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"actionYes=%@",actionYes); + _actionYes = [[someAssociations objectForKey:actionYes__Key + withDefaultObject:[_actionYes autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"_actionYes=%@",_actionYes); - actionNo = [[someAssociations objectForKey:actionNo__Key - withDefaultObject:[actionNo autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"actionNo=%@",actionNo); + _actionNo = [[someAssociations objectForKey:actionNo__Key + withDefaultObject:[_actionNo autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"_actionNo=%@",_actionNo); - condition = [[someAssociations objectForKey:condition__Key - withDefaultObject:[condition autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"condition=%@",condition); + _condition = [[someAssociations objectForKey:condition__Key + withDefaultObject:[_condition autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"_condition=%@",_condition); - disabled = [[someAssociations objectForKey:disabled__Key - withDefaultObject:[disabled autorelease]] retain]; - NSDebugMLLog(@"gswdync",@"disabled=%@",disabled); + _disabled = [[someAssociations objectForKey:disabled__Key + withDefaultObject:[_disabled autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"_disabled=%@",_disabled); - _otherAssociations=[NSMutableDictionary dictionaryWithDictionary:someAssociations]; - [_otherAssociations removeObjectForKey:action__Key]; - [_otherAssociations removeObjectForKey:actionYes__Key]; - [_otherAssociations removeObjectForKey:actionNo__Key]; - [_otherAssociations removeObjectForKey:condition__Key]; - [_otherAssociations removeObjectForKey:disabled__Key]; - if ([_otherAssociations count]>0) - otherAssociations=[[NSDictionary dictionaryWithDictionary:_otherAssociations] retain]; + otherAssociations=[NSMutableDictionary dictionaryWithDictionary:someAssociations]; + [otherAssociations removeObjectForKey:action__Key]; + [otherAssociations removeObjectForKey:actionYes__Key]; + [otherAssociations removeObjectForKey:actionNo__Key]; + [otherAssociations removeObjectForKey:condition__Key]; + [otherAssociations removeObjectForKey:disabled__Key]; + if ([otherAssociations count]>0) + _otherAssociations=[[NSDictionary dictionaryWithDictionary:otherAssociations] retain]; - if ((self=[super initWithName:name_ - associations:nil - template:nil])) - { - }; + if ((self=[super initWithName:aName + associations:nil + template:nil])) + { + }; LOGObjectFnStop(); return self; }; @@ -78,13 +84,13 @@ static char rcsId[] = "$Id$"; //-------------------------------------------------------------------- -(void)dealloc { - DESTROY(action); - DESTROY(actionYes); - DESTROY(actionNo); - DESTROY(condition); - DESTROY(disabled); - DESTROY(otherAssociations); - DESTROY(children); + DESTROY(_action); + DESTROY(_actionYes); + DESTROY(_actionNo); + DESTROY(_condition); + DESTROY(_disabled); + DESTROY(_otherAssociations); + DESTROY(_children); [super dealloc]; } @@ -92,8 +98,8 @@ static char rcsId[] = "$Id$"; -(NSString*)description { return [NSString stringWithFormat:@"<%s %p>", - object_get_class_name(self), - (void*)self]; + object_get_class_name(self), + (void*)self]; }; @end @@ -102,106 +108,107 @@ static char rcsId[] = "$Id$"; @implementation GSWToggle (GSWToggleA) //-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response_ - inContext:(GSWContext*)context_ +-(void)appendToResponse:(GSWResponse*)aResponse + inContext:(GSWContext*)aContext { //OK (condition/action/directActionName) - GSWComponent* _component=[context_ component]; - BOOL _disabled=NO; + GSWComponent* component=[aContext component]; + BOOL disabled=NO; LOGObjectFnStart(); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); - if (disabled) - _disabled=[self evaluateCondition:disabled - inContext:context_]; - if (!_disabled) - { - NSString* _url=nil; - [response_ _appendContentAsciiString:@"']; - }; - [children appendToResponse:response_ - inContext:context_]; - if (!_disabled)//?? - { - [response_ _appendContentAsciiString:@""]; - }; - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); + NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]); + if (_disabled) + disabled=[self evaluateCondition:_disabled + inContext:aContext]; + if (!disabled) + { + NSString* url=nil; + [aResponse _appendContentAsciiString:@"']; + }; + [_children appendToResponse:aResponse + inContext:aContext]; + if (!disabled)//?? + { + [aResponse _appendContentAsciiString:@""]; + }; + NSDebugMLLog(@"gswdync",@"senderID=%@",[aContext senderID]); LOGObjectFnStop(); }; //-------------------------------------------------------------------- --(GSWElement*)invokeActionForRequest:(GSWRequest*)request_ - inContext:(GSWContext*)context_ +-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest + inContext:(GSWContext*)aContext { //OK - GSWElement* _element=nil; - NSString* _senderID=nil; - NSString* _elementID=nil; + GSWElement* element=nil; + NSString* senderID=nil; + NSString* elementID=nil; LOGObjectFnStart(); - _senderID=[context_ senderID]; - NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID); - _elementID=[context_ elementID]; - NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID); - if ([_elementID isEqualToString:_senderID]) - { - GSWComponent* _component=[context_ component]; - BOOL _conditionValue=[self evaluateCondition:condition - inContext:context_]; - _conditionValue=!_conditionValue; - if (action) - [action setValue:[NSNumber numberWithBool:_conditionValue] - inComponent:_component]; - else - { - if (actionYes && _conditionValue) - [actionYes valueInComponent:_component]; - else if (actionNo && !_conditionValue) - [actionNo valueInComponent:_component]; - else - { - //TODO ERROR - }; - }; - //TODOV - if (!_element) - _element=[context_ page]; - } + senderID=[aContext senderID]; + NSDebugMLLog(@"gswdync",@"senderID=%@",senderID); + elementID=[aContext elementID]; + NSDebugMLLog(@"gswdync",@"elementID=%@",elementID); + if ([elementID isEqualToString:senderID]) + { + GSWComponent* component=[aContext component]; + BOOL conditionValue=[self evaluateCondition:_condition + inContext:aContext]; + conditionValue=!conditionValue; + if (_action) + [_action setValue:[NSNumber numberWithBool:conditionValue] + inComponent:component]; + else + { + if (_actionYes && conditionValue) + [_actionYes valueInComponent:component]; + else if (_actionNo && !conditionValue) + [_actionNo valueInComponent:component]; + else + { + //TODO ERROR + }; + }; + //TODOV + if (!element) + element=[aContext page]; + } else - { - _element=[children invokeActionForRequest:request_ - inContext:context_]; - NSDebugMLLog(@"gswdync",@"_element=%@",_element); - }; - NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]); - NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]); + { + element=[_children invokeActionForRequest:aRequest + inContext:aContext]; + NSDebugMLLog(@"gswdync",@"element=%@",element); + }; + NSDebugMLLog(@"gswdync",@"senderID=%@",[aContext senderID]); + NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]); LOGObjectFnStop(); - return _element; + return element; }; diff --git a/GSWeb.framework/GSWTransactionRecord.h b/GSWeb.framework/GSWTransactionRecord.h index 3110bc3..fd750a5 100644 --- a/GSWeb.framework/GSWTransactionRecord.h +++ b/GSWeb.framework/GSWTransactionRecord.h @@ -1,11 +1,16 @@ -/* GSWTransactionRecord.h - GSWeb: Class GSWTransactionRecord - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWTransactionRecord.h - GSWeb: Class GSWTransactionRecord + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Apr 1999 + Written by: Manuel Guesdon + Date: Apr 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ // $Id$ @@ -30,21 +36,21 @@ //==================================================================== @interface GSWTransactionRecord : NSObject { - GSWComponent* responsePage; - NSString* requestSignature; + GSWComponent* _responsePage; + NSString* _requestSignature; }; --(id)initWithResponsePage:(GSWComponent*)responsePage_ - context:(GSWContext*)context_; +-(id)initWithResponsePage:(GSWComponent*)aResponsePage + context:(GSWContext*)aContext; -(void)dealloc; --(id)initWithCoder:(NSCoder*)code_; --(void)encodeWithCoder:(NSCoder*)code_; +-(id)initWithCoder:(NSCoder*)code; +-(void)encodeWithCoder:(NSCoder*)code; -(NSString*)description; --(BOOL)isMatchingContextID:(NSString*)contextID_ - requestSenderID:(NSString*)requestSenderID; --(void)setResponsePage:(GSWComponent*)responsePage_; +-(BOOL)isMatchingContextID:(NSString*)aContextID + requestSenderID:(NSString*)aRequestSenderID; +-(void)setResponsePage:(GSWComponent*)aResponsePage; -(GSWComponent*)responsePage; @end diff --git a/GSWeb.framework/GSWTransactionRecord.m b/GSWeb.framework/GSWTransactionRecord.m index 2293833..3924008 100644 --- a/GSWeb.framework/GSWTransactionRecord.m +++ b/GSWeb.framework/GSWTransactionRecord.m @@ -1,11 +1,16 @@ -/* GSWTransactionRecord.m - GSWeb: Class GSWTransactionRecord - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWTransactionRecord.m - GSWeb: Class GSWTransactionRecord + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon - Date: Apr 1999 + Written by: Manuel Guesdon + Date: Apr 1999 + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -29,24 +35,24 @@ static char rcsId[] = "$Id$"; @implementation GSWTransactionRecord //-------------------------------------------------------------------- --(id)initWithResponsePage:(GSWComponent*)responsePage_ - context:(GSWContext*)context_ +-(id)initWithResponsePage:(GSWComponent*)aResponsePage + context:(GSWContext*)aContext { LOGObjectFnStart(); if ((self=[super init])) - { - NSString* _contextID=nil; - NSString* _senderID=nil; - NSString* _requestSignature=nil; - [self setResponsePage:responsePage_]; - NSDebugMLLog(@"low",@"responsePage=%@",responsePage); - _contextID=[context_ contextID];//Really from here ? - NSDebugMLLog(@"low",@"_contextID=%@",_contextID); - _senderID=[context_ senderID]; - NSDebugMLLog(@"low",@"_senderID=%@",_senderID); - _requestSignature=[NSString stringWithFormat:@"%@.%@",_contextID,_senderID]; - ASSIGN(requestSignature,_requestSignature); - }; + { + NSString* contextID=nil; + NSString* senderID=nil; + NSString* requestSignature=nil; + [self setResponsePage:aResponsePage]; + NSDebugMLLog(@"low",@"responsePage=%@",_responsePage); + contextID=[aContext contextID];//Really from here ? + NSDebugMLLog(@"low",@"contextID=%@",contextID); + senderID=[aContext senderID]; + NSDebugMLLog(@"low",@"senderID=%@",senderID); + requestSignature=[NSString stringWithFormat:@"%@.%@",contextID,senderID]; + ASSIGN(_requestSignature,requestSignature); + }; LOGObjectFnStop(); return self; }; @@ -56,32 +62,32 @@ static char rcsId[] = "$Id$"; { GSWLogC("Dealloc GSWTransactionRecord"); GSWLogC("Dealloc GSWTransactionRecord: responsePage"); - DESTROY(responsePage); + DESTROY(_responsePage); GSWLogC("Dealloc GSWTransactionRecord: requestSignature"); - DESTROY(requestSignature); + DESTROY(_requestSignature); GSWLogC("Dealloc GSWTransactionRecord super"); [super dealloc]; GSWLogC("End Dealloc GSWTransactionRecord"); }; //-------------------------------------------------------------------- --(id)initWithCoder:(NSCoder*)coder_ +-(id)initWithCoder:(NSCoder*)coder { if ((self = [super init])) - { - [coder_ decodeValueOfObjCType:@encode(id) - at:&responsePage]; - [coder_ decodeValueOfObjCType:@encode(id) - at:&requestSignature]; - }; + { + [coder decodeValueOfObjCType:@encode(id) + at:&_responsePage]; + [coder decodeValueOfObjCType:@encode(id) + at:&_requestSignature]; + }; return self; }; //-------------------------------------------------------------------- --(void)encodeWithCoder:(NSCoder*)coder_ +-(void)encodeWithCoder:(NSCoder*)coder { - [coder_ encodeObject:responsePage]; - [coder_ encodeObject:requestSignature]; + [coder encodeObject:_responsePage]; + [coder encodeObject:_requestSignature]; }; //-------------------------------------------------------------------- @@ -90,32 +96,32 @@ static char rcsId[] = "$Id$"; return [NSString stringWithFormat:@"<%s %p - responsePage Name=%@ requestSignature=%@>", object_get_class_name(self), (void*)self, - [responsePage name], - requestSignature]; + [_responsePage name], + _requestSignature]; }; //-------------------------------------------------------------------- --(BOOL)isMatchingContextID:(NSString*)contextID_ - requestSenderID:(NSString*)requestSenderID_ +-(BOOL)isMatchingContextID:(NSString*)aContextID + requestSenderID:(NSString*)aRequestSenderID { //OK? - BOOL _matching=NO; - NSString* _testSignature=[NSString stringWithFormat:@"%@.%@",contextID_,requestSenderID_]; - _matching=[_testSignature isEqualToString:requestSignature]; - return _matching; + BOOL matching=NO; + NSString* testSignature=[NSString stringWithFormat:@"%@.%@",aContextID,aRequestSenderID]; + matching=[testSignature isEqualToString:_requestSignature]; + return matching; }; //-------------------------------------------------------------------- --(void)setResponsePage:(GSWComponent*)responsePage_ +-(void)setResponsePage:(GSWComponent*)aResponsePage { - ASSIGN(responsePage,responsePage_); + ASSIGN(_responsePage,aResponsePage); }; //-------------------------------------------------------------------- -(GSWComponent*)responsePage { GSWLogAssertGood(self); - return responsePage; + return _responsePage; }; @end diff --git a/GSWeb.framework/GSWVBScript.h b/GSWeb.framework/GSWVBScript.h index 787fd88..2c1610f 100644 --- a/GSWeb.framework/GSWVBScript.h +++ b/GSWeb.framework/GSWVBScript.h @@ -1,11 +1,16 @@ -/* GSWVBScript.h - GSWeb: Class GSWVBScript - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWVBScript.h - GSWeb: Class GSWVBScript + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - + + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ #ifndef _GSWVBScript_h__ #define _GSWVBScript_h__ @@ -29,10 +35,9 @@ //OK //==================================================================== @interface GSWVBScript: GSWClientSideScript - --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_; +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement; @end diff --git a/GSWeb.framework/GSWVBScript.m b/GSWeb.framework/GSWVBScript.m index aeb129d..4e7d4db 100644 --- a/GSWeb.framework/GSWVBScript.m +++ b/GSWeb.framework/GSWVBScript.m @@ -1,11 +1,16 @@ -/* GSWVBScript.m - GSWeb: Class GSWVBScript - Copyright (C) 1999 Free Software Foundation, Inc. +/** GSWVBScript.m - GSWeb: Class GSWVBScript + + Copyright (C) 1999-2002 Free Software Foundation, Inc. - Written by: Manuel Guesdon + Written by: Manuel Guesdon Date: Jan 1999 - + + $Revision$ + $Date$ + This file is part of the GNUstep Web Library. + 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. -*/ + +**/ static char rcsId[] = "$Id$"; @@ -28,14 +34,28 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWVBScript --(id)initWithName:(NSString*)name_ - associations:(NSDictionary*)associations_ - template:(GSWElement*)templateElement_ +-(id)initWithName:(NSString*)aName + associations:(NSDictionary*)associations + template:(GSWElement*)templateElement { - LOGObjectFnNotImplemented(); //TODOFN - return nil; + GSWAssociation* languageAssociation=nil; + NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations]; + LOGObjectFnStartC("GSWVBScript"); + NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ templateElement=%@",aName,associations,templateElement); + if (![tmpAssociations objectForKey:language__Key]) + { + // Create and set the language (Javascript) + languageAssociation=[GSWConstantValueAssociation associationWithValue:@"VBScript"]; //??? + [tmpAssociations setObject:languageAssociation + forKey:language__Key]; + }; + if ((self=[super initWithName:aName + associations:tmpAssociations + template:templateElement])) + { + }; + return self; }; - //-------------------------------------------------------------------- @end diff --git a/GSWeb.framework/PageDef.g b/GSWeb.framework/PageDef.g index 4832ab6..539d9cf 100644 --- a/GSWeb.framework/PageDef.g +++ b/GSWeb.framework/PageDef.g @@ -10,7 +10,7 @@ options { class GSWPageDefParser extends Parser; options { - exportVocab=GSWPageDef; + /*exportVocab=GSWPageDef;*/ buildAST=true; k = 4; } @@ -95,13 +95,13 @@ mvalue: ; idref: - (CIRC | TILDE)? (IDENT) (PIDENT)* + (CIRC | TILDE)? (IDENT | IDENTREF ) (PIDENT | PIDENTREF)* ; class GSWPageDefLexer extends Lexer; options { k = 4; - exportVocab=GSWPageDef; + /*exportVocab=GSWPageDef;*/ charVocabulary = '\3'..'\377'; caseSensitive=true; filter=UNDEFINED_TOKEN; @@ -155,6 +155,16 @@ PIDENT : POINT (IDENT | STRING) ; +IDENTREF + options { testLiterals = true; } + : (LETTER|'_'|'@') (LETTER|'_'|DIGIT)* + ; + +PIDENTREF + options { testLiterals = true; } + : POINT (IDENTREF | STRING) + ; + YES options { testLiterals = true; } : "YES" diff --git a/TODO b/TODO index 409ec57..9dc64a1 100644 --- a/TODO +++ b/TODO @@ -74,6 +74,9 @@ information, not that there is nothing to do ! invokeActionForRequest appendToResponse +* GSWClientSideScript.m + OK. Verify + * GSWComponent.m * GSWComponentContent.m @@ -150,10 +153,7 @@ information, not that there is nothing to do ! appendToResponse * GSWJavaScript.m - TODO: - takeValuesFromRequest - invokeActionForRequest - appendToResponse + OK. Verify * GSWKeyValueAssociation @@ -243,10 +243,7 @@ information, not that there is nothing to do ! * GSWTransactionRecord * GSWVBScript.m - TODO: - takeValuesFromRequest - invokeActionForRequest - appendToResponse + OK. Verify * GSWPageDefElement.m OK. Finished