2002-08-04 Manuel Guesdon <mguesdon@orange-concept.com>

* GSWeb.framework/GSWEmbeddedObject.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWGenericContainer.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWDirectActionRequestHandler.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWDynamicURLString.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWBindingNameAssociation.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWComponentDefinition.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWComponentRequestHandler.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWConstantValueAssociation.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWDisplayGroup.h/.m
		o ivar names changes to conform to coding standards
	 	o include for TCSimpleDB/
	* GSWeb.framework/GSWKeyValueAssociation.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWParam.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWRequestHandler.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWResourceRequestHandler.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/NSString+Trimming.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWStats.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/NSNonBlockingFileHandle.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/NSString+HTML.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWStatisticsStore.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWHTMLURLValuedElement.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWApplication.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWBundle.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWDeployedBundle.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWTemplateParserXML.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWHTMLParserExt.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWMultiKeyDictionary.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWProjectBundle.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWTemplateParser.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWPageDefElement.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWUtils.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWeb.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWWOCompatibility.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWQuickTime.h
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWTemplateParserANTLR.h/.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWDebug.m
		o ivar names changes to conform to coding standards
	* GSWeb.framework/GSWComponent.m
		o NSAsserts


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@14234 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Manuel Guesdon 2002-08-04 18:00:11 +00:00
parent d421bf9a4a
commit 2f71fe907d
77 changed files with 9292 additions and 8659 deletions

View file

@ -1,3 +1,76 @@
2002-08-04 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWEmbeddedObject.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWGenericContainer.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWDirectActionRequestHandler.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWDynamicURLString.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWBindingNameAssociation.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWComponentDefinition.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWComponentRequestHandler.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWConstantValueAssociation.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWDisplayGroup.h/.m
o ivar names changes to conform to coding standards
o include for TCSimpleDB/
* GSWeb.framework/GSWKeyValueAssociation.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWParam.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWRequestHandler.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWResourceRequestHandler.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/NSString+Trimming.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWStats.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/NSNonBlockingFileHandle.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/NSString+HTML.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWStatisticsStore.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWApplication.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWBundle.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWDeployedBundle.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWTemplateParserXML.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWHTMLParserExt.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWMultiKeyDictionary.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWProjectBundle.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWTemplateParser.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWPageDefElement.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWUtils.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWeb.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWWOCompatibility.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWQuickTime.h
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWTemplateParserANTLR.h/.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWDebug.m
o ivar names changes to conform to coding standards
* GSWeb.framework/GSWComponent.m
o NSAsserts
2002-07-28 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/WebObjects:
o added WebObjects headers (suggested by David Wetzel <dave@turbocat.de>)

View file

@ -1,11 +1,16 @@
/* GSWApplication.h - GSWeb: Class GSWApplication
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWApplication.h - <title>GSWeb: Class GSWApplication</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,14 +24,15 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
#ifndef _GSWApplication_h__
#define _GSWApplication_h__
extern void GSWApplicationSetDebugSetOption(NSString* opt_);
extern void GSWApplicationSetDebugSetOption(NSString* opt);
extern int WOApplicationMain(NSString* applicationClassName,
int argc,
const char *argv[]);
@ -42,56 +48,56 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication : NSObject <NSLocking>
{
NSArray* adaptors;
GSWSessionStore* sessionStore;
GSWMultiKeyDictionary* componentDefinitionCache;
NSTimeInterval timeOut;
NSTimer* timer;
NSArray* _adaptors;
GSWSessionStore* _sessionStore;
GSWMultiKeyDictionary* _componentDefinitionCache;
NSTimeInterval _timeOut;
NSTimer* _timer;
// GSWContext* context; // being deprecated
GSWStatisticsStore* statisticsStore;
GSWResourceManager* resourceManager;
NSDistantObject* remoteMonitor;
NSConnection* remoteMonitorConnection;
NSString* instanceNumber;
NSMutableDictionary* requestHandlers;
GSWRequestHandler* defaultRequestHandler;
GSWStatisticsStore* _statisticsStore;
GSWResourceManager* _resourceManager;
NSDistantObject* _remoteMonitor;
NSConnection* _remoteMonitorConnection;
NSString* _instanceNumber;
NSMutableDictionary* _requestHandlers;
GSWRequestHandler* _defaultRequestHandler;
@public //TODO-NOW REMOVE
NSRecursiveLock* selfLock;
NSRecursiveLock* _selfLock;
#ifndef NDEBUG
int selfLockn;
objc_thread_t selfLock_thread_id;
int _selfLockn;
objc_thread_t _selfLock_thread_id;
#endif
NSLock* globalLock;
NSLock* _globalLock;
#ifndef NDEBUG
int globalLockn;
objc_thread_t globalLock_thread_id;
int _globalLockn;
objc_thread_t _globalLock_thread_id;
#endif
NSAutoreleasePool* globalAutoreleasePool;
unsigned pageCacheSize;
unsigned permanentPageCacheSize;
int activeSessionsCount;
int minimumActiveSessionsCount;
BOOL pageRecreationEnabled;
BOOL pageRefreshOnBacktrackEnabled;
BOOL terminating;
BOOL dynamicLoadingEnabled;
BOOL printsHTMLParserDiagnostics;
BOOL refusingNewSessions;
BOOL shouldDieWhenRefusing;
BOOL refusingNewClients;
BOOL refuseThisRequest;
BOOL isMultiThreaded;
BOOL isMTProtected;
BOOL timedRunLoop;
BOOL isTracingEnabled;
BOOL isTracingAssignmentsEnabled;
BOOL isTracingObjectiveCMessagesEnabled;
BOOL isTracingScriptedMessagesEnabled;
BOOL isTracingStatementsEnabled;
NSRunLoop* currentRunLoop;
NSDate* runLoopDate;
NSTimer* initialTimer;
NSLock* activeSessionsCountLock;
NSAutoreleasePool* _globalAutoreleasePool;
unsigned _pageCacheSize;
unsigned _permanentPageCacheSize;
int _activeSessionsCount;
int _minimumActiveSessionsCount;
BOOL _pageRecreationEnabled;
BOOL _pageRefreshOnBacktrackEnabled;
BOOL _terminating;
BOOL _dynamicLoadingEnabled;
BOOL _printsHTMLParserDiagnostics;
BOOL _refusingNewSessions;
BOOL _shouldDieWhenRefusing;
BOOL _refusingNewClients;
BOOL _refuseThisRequest;
BOOL _isMultiThreaded;
BOOL _isMTProtected;
BOOL _timedRunLoop;
BOOL _isTracingEnabled;
BOOL _isTracingAssignmentsEnabled;
BOOL _isTracingObjectiveCMessagesEnabled;
BOOL _isTracingScriptedMessagesEnabled;
BOOL _isTracingStatementsEnabled;
NSRunLoop* _currentRunLoop;
NSDate* _runLoopDate;
NSTimer* _initialTimer;
NSLock* _activeSessionsCountLock;
}
-(void)dealloc;
@ -117,8 +123,8 @@ extern BOOL WOStrictFlag;
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
-(void)registerRequestHandlers;
-(void)_initAdaptorsWithUserDefaults:(NSUserDefaults*)_userDefault;
-(NSDictionary*)_argsDictionaryWithUserDefaults:(NSUserDefaults*)_userDefault;
-(void)_initAdaptorsWithUserDefaults:(NSUserDefaults*)userDefault;
-(NSDictionary*)_argsDictionaryWithUserDefaults:(NSUserDefaults*)userDefault;
-(void)unlock;
-(void)lock;
-(void)unlockRequestHandling;
@ -149,22 +155,22 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication (GSWApplicationD)
-(GSWComponentDefinition*)componentDefinitionWithName:(NSString*)_name
languages:(NSArray*)_languages;
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)_name
languages:(NSArray*)_languages;
-(GSWComponentDefinition*)lockedLoadComponentDefinitionWithName:(NSString*)_name
language:(NSString*)_language;
-(GSWComponentDefinition*)componentDefinitionWithName:(NSString*)aName
languages:(NSArray*)languages;
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)aName
languages:(NSArray*)languages;
-(GSWComponentDefinition*)lockedLoadComponentDefinitionWithName:(NSString*)aName
language:(NSString*)language;
-(NSArray*)lockedComponentBearingFrameworks;
-(NSArray*)lockedInitComponentBearingFrameworksFromBundleArray:(NSArray*)_bundles;
-(NSArray*)lockedInitComponentBearingFrameworksFromBundleArray:(NSArray*)bundles;
@end
//====================================================================
@interface GSWApplication (GSWApplicationE)
-(void)_discountTerminatedSession;
-(void)_finishInitializingSession:(GSWSession*)_session;
-(GSWSession*)_initializeSessionInContext:(GSWContext*)context_;
-(void)_finishInitializingSession:(GSWSession*)aSession;
-(GSWSession*)_initializeSessionInContext:(GSWContext*)aContext;
-(int)lockedDecrementActiveSessionCount;
-(int)lockedIncrementActiveSessionCount;
-(int)_activeSessionsCount;
@ -173,7 +179,7 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication (GSWApplicationF)
-(void)_setContext:(GSWContext*)context_;
-(void)_setContext:(GSWContext*)aContext;
// Internal Use only
-(GSWContext*)_context;
@end
@ -198,11 +204,11 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication (GSWApplicationJ)
-(id)_newLocationForRequest:(GSWRequest*)_request;
-(void)_connectionDidDie:(id)_unknown;
-(id)_newLocationForRequest:(GSWRequest*)aRequest;
-(void)_connectionDidDie:(id)unknown;
-(BOOL)_shouldKill;
-(void)_setShouldKill:(BOOL)_flag;
-(void)_synchronizeInstanceSettingsWithMonitor:(id)_monitor;
-(void)_setShouldKill:(BOOL)flag;
-(void)_synchronizeInstanceSettingsWithMonitor:(id)aMonitor;
-(BOOL)_setupForMonitoring;
-(id)_remoteMonitor;
-(NSString*)_monitorHost;
@ -219,7 +225,7 @@ extern BOOL WOStrictFlag;
@interface GSWApplication (GSWAdaptorManagement)
-(NSArray*)adaptors;
-(GSWAdaptor*)adaptorWithName:(NSString*)name_
-(GSWAdaptor*)adaptorWithName:(NSString*)aName
arguments:(NSDictionary*)someArguments;
@end
@ -228,55 +234,55 @@ extern BOOL WOStrictFlag;
@interface GSWApplication (GSWCacheManagement)
-(BOOL)isCachingEnabled;
-(void)setCachingEnabled:(BOOL)flag_;
-(void)setCachingEnabled:(BOOL)flag;
@end
//====================================================================
@interface GSWApplication (GSWSessionManagement)
-(GSWSessionStore*)sessionStore;
-(void)setSessionStore:(GSWSessionStore*)sessionStore_;
-(void)setSessionStore:(GSWSessionStore*)sessionStore;
-(GSWSession*)createSessionForRequest:(GSWRequest*)_request;
-(GSWSession*)_createSessionForRequest:(GSWRequest*)_request;
-(GSWSession*)createSessionForRequest:(GSWRequest*)aRequest;
-(GSWSession*)_createSessionForRequest:(GSWRequest*)aRequest;
-(Class)_sessionClass;
-(GSWSession*)restoreSessionWithID:(NSString*)_sessionID
inContext:(GSWContext*)context_;
-(GSWSession*)_restoreSessionWithID:(NSString*)_sessionID
inContext:(GSWContext*)context_;
-(void)saveSessionForContext:(GSWContext*)context_;
-(void)_saveSessionForContext:(GSWContext*)context_;
-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID
inContext:(GSWContext*)aContext;
-(GSWSession*)_restoreSessionWithID:(NSString*)aSessionID
inContext:(GSWContext*)aContext;
-(void)saveSessionForContext:(GSWContext*)aContext;
-(void)_saveSessionForContext:(GSWContext*)aContext;
@end
//====================================================================
@interface GSWApplication (GSWPageManagement)
-(unsigned int)pageCacheSize;
-(void)setPageCacheSize:(unsigned int)size_;
-(void)setPageCacheSize:(unsigned int)aSize;
-(unsigned)permanentPageCacheSize;
-(void)setPermanentPageCacheSize:(unsigned)size_;
-(void)setPermanentPageCacheSize:(unsigned)aSize;
-(BOOL)isPageRefreshOnBacktrackEnabled;
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)_flag;
-(GSWComponent*)pageWithName:(NSString*)name_
forRequest:(GSWRequest*)request_;
-(GSWComponent*)pageWithName:(NSString*)name_
inContext:(GSWContext*)context_;
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
-(GSWComponent*)pageWithName:(NSString*)aName
forRequest:(GSWRequest*)aRequest;
-(GSWComponent*)pageWithName:(NSString*)aName
inContext:(GSWContext*)aContext;
-(NSString*)defaultPageName;//NDFN
-(GSWComponent*)_pageWithName:(NSString*)name_
inContext:(GSWContext*)context_;
-(GSWComponent*)_pageWithName:(NSString*)aName
inContext:(GSWContext*)aContext;
@end
//====================================================================
@interface GSWApplication (GSWElementCreation)
-(GSWElement*)dynamicElementWithName:(NSString *)name_
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_
languages:(NSArray*)languages_;
-(GSWElement*)lockedDynamicElementWithName:(NSString *)name_
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_
languages:(NSArray*)languages_;
-(GSWElement*)dynamicElementWithName:(NSString *)aName
associations:(NSDictionary*)someAssociations
template:(GSWElement*)templateElement
languages:(NSArray*)languages;
-(GSWElement*)lockedDynamicElementWithName:(NSString*)aName
associations:(NSDictionary*)someAssociations
template:(GSWElement*)templateElement
languages:(NSArray*)languages;
@end
//====================================================================
@ -285,13 +291,13 @@ extern BOOL WOStrictFlag;
-(void)threadWillExit;//NDFN
-(void)run;
-(BOOL)runOnce;
-(void)setTimeOut:(NSTimeInterval)timeInterval_;
-(void)setTimeOut:(NSTimeInterval)aTimeInterval;
-(NSTimeInterval)timeOut;
-(void)terminate;
-(BOOL)isTerminating;
-(void)_scheduleApplicationTimerForTimeInterval:(NSTimeInterval)timeInterval_;
-(void)addTimer:(NSTimer*)timer_;//NDFN
-(void)_scheduleApplicationTimerForTimeInterval:(NSTimeInterval)aTimeInterval;
-(void)addTimer:(NSTimer*)aTimer;//NDFN
-(void)cancelInitialTimer;
-(void)handleInitialTimer;
-(void)_setNextCollectionCount:(int)_count;
@ -302,111 +308,111 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication (GSWRequestHandling)
-(GSWResponse*)dispatchRequest:(GSWRequest*)request_;
-(GSWResponse*)dispatchRequest:(GSWRequest*)aRequest;
-(void)awake;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(void)takeValuesFromRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
-(void)appendToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(void)sleep;
@end
//====================================================================
@interface GSWApplication (GSWErrorHandling)
-(GSWResponse*)handleException:(NSException*)exception_
inContext:(GSWContext*)context_;
-(GSWResponse*)_handleException:(NSException*)exception_
inContext:(GSWContext*)context_;
-(GSWResponse*)handlePageRestorationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)_handlePageRestorationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)handleSessionCreationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)_handleSessionCreationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)handleSessionRestorationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)_handleSessionRestorationErrorInContext:(GSWContext*)context_;
-(GSWResponse*)handleException:(NSException*)exception
inContext:(GSWContext*)aContext;
-(GSWResponse*)_handleException:(NSException*)exception
inContext:(GSWContext*)aContext;
-(GSWResponse*)handlePageRestorationErrorInContext:(GSWContext*)aContext;
-(GSWResponse*)_handlePageRestorationErrorInContext:(GSWContext*)aContext;
-(GSWResponse*)handleSessionCreationErrorInContext:(GSWContext*)aContext;
-(GSWResponse*)_handleSessionCreationErrorInContext:(GSWContext*)aContext;
-(GSWResponse*)handleSessionRestorationErrorInContext:(GSWContext*)aContext;
-(GSWResponse*)_handleSessionRestorationErrorInContext:(GSWContext*)aContext;
@end
//====================================================================
@interface GSWApplication (GSWConveniences)
+(void)_setApplication:(GSWApplication*)_application;
+(void)_setApplication:(GSWApplication*)application;
+(GSWApplication*)application;
@end
//====================================================================
@interface GSWApplication (GSWHTMLTemplateParsingDebugging)
-(BOOL)printsHTMLParserDiagnostics;
-(void)setPrintsHTMLParserDiagnostics:(BOOL)flag_;
-(void)setPrintsHTMLParserDiagnostics:(BOOL)flag;
@end
//====================================================================
@interface GSWApplication (GSWScriptedObjectSupport)
-(Class)scriptedClassWithPath:(NSString*)path_;
-(Class)scriptedClassWithPath:(NSString*)path_
encoding:(NSStringEncoding)encoding_;
-(Class)_classWithScriptedClassName:(NSString*)_name
languages:(NSArray*)_languages;
-(void)_setClassFromNameResolutionEnabled:(BOOL)_flag;
-(Class)scriptedClassWithPath:(NSString*)path;
-(Class)scriptedClassWithPath:(NSString*)path
encoding:(NSStringEncoding)encoding;
-(Class)_classWithScriptedClassName:(NSString*)aName
languages:(NSArray*)languages;
-(void)_setClassFromNameResolutionEnabled:(BOOL)flag;
@end
//====================================================================
@interface GSWApplication (GSWLibrarySupport)
-(Class)libraryClassWithPath:(NSString*)path_;//NDFN
-(Class)libraryClassWithPath:(NSString*)path;//NDFN
@end
//====================================================================
@interface GSWApplication (GSWDebugging)
-(void)debugWithString:(NSString*)_string;
-(void)debugWithFormat:(NSString*)_format
-(void)debugWithString:(NSString*)string;
-(void)debugWithFormat:(NSString*)format
arguments:(va_list)someArgumentsu;
-(void)debugWithFormat:(NSString*)formatString_,...;
+(void)debugWithFormat:(NSString*)formatString_,...;
-(void)logWithFormat:(NSString*)format_,...;
+(void)logWithFormat:(NSString*)format_,...;
-(void)debugWithFormat:(NSString*)formatString,...;
+(void)debugWithFormat:(NSString*)formatString,...;
-(void)logWithFormat:(NSString*)aFormat,...;
+(void)logWithFormat:(NSString*)aFormat,...;
-(void)logWithFormat:(NSString*)formatString_
arguments:(va_list)arguments_;
-(void)logErrorWithFormat:(NSString*)format_,...;
+(void)logErrorWithFormat:(NSString*)format_,...;
-(void)logErrorWithFormat:(NSString*)formatString_
arguments:(va_list)arguments_;
-(void)trace:(BOOL)flag_;
-(void)traceAssignments:(BOOL)flag_;
-(void)traceObjectiveCMessages:(BOOL)flag_;
-(void)traceScriptedMessages:(BOOL)flag_;
-(void)traceStatements:(BOOL)flag_;
+(void)logTakeValueForDeclarationNamed:(NSString*)declarationName_
type:(NSString*)declarationType_
bindingNamed:(NSString*)bindingName_
associationDescription:(NSString*)associationDescription_
value:(id)value_;
+(void)logSetValueForDeclarationNamed:(NSString*)declarationName_
type:(NSString*)declarationType_
bindingNamed:(NSString*)bindingName_
associationDescription:(NSString*)associationDescription_
value:(id)value_;
arguments:(va_list)arguments;
-(void)logErrorWithFormat:(NSString*)aFormat,...;
+(void)logErrorWithFormat:(NSString*)aFormat,...;
-(void)logErrorWithFormat:(NSString*)formatString
arguments:(va_list)arguments;
-(void)trace:(BOOL)flag;
-(void)traceAssignments:(BOOL)flag;
-(void)traceObjectiveCMessages:(BOOL)flag;
-(void)traceScriptedMessages:(BOOL)flag;
-(void)traceStatements:(BOOL)flag;
+(void)logTakeValueForDeclarationNamed:(NSString*)aDeclarationName
type:(NSString*)aDeclarationType
bindingNamed:(NSString*)aBindingName
associationDescription:(NSString*)anAssociationDescription
value:(id)aValue;
+(void)logSetValueForDeclarationNamed:(NSString*)aDeclarationName
type:(NSString*)aDeclarationType
bindingNamed:(NSString*)aBindingName
associationDescription:(NSString*)anAssociationDescription
value:(id)aValue;
-(void)logTakeValueForDeclarationNamed:(NSString*)declarationName_
type:(NSString*)declarationType_
bindingNamed:(NSString*)bindingName_
associationDescription:(NSString*)associationDescription_
value:(id)value_;
-(void)logTakeValueForDeclarationNamed:(NSString*)aDeclarationName
type:(NSString*)aDeclarationType
bindingNamed:(NSString*)aBindingName
associationDescription:(NSString*)anAssociationDescription
value:(id)aValue;
-(void)logSetValueForDeclarationNamed:(NSString*)declarationName_
type:(NSString*)declarationType_
bindingNamed:(NSString*)bindingName_
associationDescription:(NSString*)associationDescription_
value:(id)value_;
-(void)logSetValueForDeclarationNamed:(NSString*)aDeclarationName
type:(NSString*)aDeclarationType
bindingNamed:(NSString*)aBindingName
associationDescription:(NSString*)anAssociationDescription
value:(id)aValue;
+(void)logSynchronizeComponentToParentForValue:(id)value_
association:(GSWAssociation*)association_
inComponent:(NSObject*)component_;
+(void)logSynchronizeParentToComponentForValue:(id)value_
association:(GSWAssociation*)association_
inComponent:(NSObject*)component_;
association:(GSWAssociation*)anAssociation
inComponent:(NSObject*)aComponent;
+(void)logSynchronizeParentToComponentForValue:(id)aValue
association:(GSWAssociation*)anAssociation
inComponent:(NSObject*)aComponent;
-(void)_setTracingAspect:(id)_unknwon
enabled:(BOOL)_enabled;
-(void)_setTracingAspect:(id)unknwon
enabled:(BOOL)enabled;
@end
//====================================================================
@ -414,24 +420,24 @@ extern BOOL WOStrictFlag;
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
@interface GSWApplication (GSWDebuggingStatus)
-(void)statusDebugWithString:(NSString*)string_;
-(void)statusDebugWithFormat:(NSString*)format_
arguments:(va_list)arguments_;
-(void)statusDebugWithFormat:(NSString*)format_,...;
+(void)statusDebugWithFormat:(NSString*)format_,...;
-(void)statusLogWithFormat:(NSString*)format_,...;
+(void)statusLogWithFormat:(NSString*)format_,...;
-(void)statusLogWithFormat:(NSString*)format_
arguments:(va_list)arguments_;
-(void)statusLogErrorWithFormat:(NSString*)format_,...;
+(void)statusLogErrorWithFormat:(NSString*)format_,...;
-(void)statusLogErrorWithFormat:(NSString*)format_
arguments:(va_list)arguments_;
-(void)statusDebugWithString:(NSString*)aString;
-(void)statusDebugWithFormat:(NSString*)aFormat
arguments:(va_list)arguments;
-(void)statusDebugWithFormat:(NSString*)aFormat,...;
+(void)statusDebugWithFormat:(NSString*)aFormat,...;
-(void)statusLogWithFormat:(NSString*)aFormat,...;
+(void)statusLogWithFormat:(NSString*)aFormat,...;
-(void)statusLogWithFormat:(NSString*)aFormat
arguments:(va_list)arguments;
-(void)statusLogErrorWithFormat:(NSString*)aFormat,...;
+(void)statusLogErrorWithFormat:(NSString*)aFormat,...;
-(void)statusLogErrorWithFormat:(NSString*)aFormat
arguments:(va_list)arguments;
@end
//====================================================================
@interface GSWApplication (GSWStatisticsSupport)
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore_;
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore;
-(NSDictionary*)statistics;//bycopy
-(GSWStatisticsStore*)statisticsStore;
@end
@ -441,16 +447,16 @@ extern BOOL WOStrictFlag;
-(BOOL)monitoringEnabled;
-(int)activeSessionsCount;
-(int)minimumActiveSessionsCount;
-(void)setMinimumActiveSessionsCount:(int)count_;
-(void)setMinimumActiveSessionsCount:(int)aCount;
-(BOOL)isRefusingNewSessions;
-(void)refuseNewSessions:(BOOL)flag;
-(void)logToMonitorWithFormat:(NSString*)format_;
-(void)terminateAfterTimeInterval:(NSTimeInterval)timeInterval_;
-(void)logToMonitorWithFormat:(NSString*)aFormat;
-(void)terminateAfterTimeInterval:(NSTimeInterval)aTimeInterval;
@end
//====================================================================
@interface GSWApplication (GSWResourceManagerSupport)
-(void)setResourceManager:(GSWResourceManager*)resourceManager_;
-(void)setResourceManager:(GSWResourceManager*)resourceManager;
-(GSWResourceManager*)resourceManager;
@end
@ -458,76 +464,76 @@ extern BOOL WOStrictFlag;
@interface GSWApplication (RequestDispatching)
-(GSWRequestHandler*)defaultRequestHandler;
-(void)setDefaultRequestHandler:(GSWRequestHandler*)handler_;
-(void)setDefaultRequestHandler:(GSWRequestHandler*)handler;
-(void)registerRequestHandler:(GSWRequestHandler*)handler_
forKey:(NSString*)key_;
-(void)registerRequestHandler:(GSWRequestHandler*)handler
forKey:(NSString*)aKey;
-(void)removeRequestHandlerForKey:(NSString*)requestHandlerKey_;
-(void)removeRequestHandlerForKey:(NSString*)requestHandlerKey;
-(NSArray*)registeredRequestHandlerKeys;
-(GSWRequestHandler*)requestHandlerForKey:(NSString*)key_;
-(GSWRequestHandler*)requestHandlerForKey:(NSString*)aKey;
-(GSWRequestHandler*)handlerForRequest:(GSWRequest*)request_;
-(GSWRequestHandler*)handlerForRequest:(GSWRequest*)aRequest;
@end
//====================================================================
@interface GSWApplication (UserDefaults)
+(NSArray*)loadFrameworks;
+(void)setLoadFrameworks:(NSArray*)frameworks_;
+(void)setLoadFrameworks:(NSArray*)frameworks;
+(BOOL)isDebuggingEnabled;
+(void)setDebuggingEnabled:(BOOL)flag_;
+(void)setDebuggingEnabled:(BOOL)flag;
+(BOOL)isStatusDebuggingEnabled;//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag_;//NDFN
+(void)setStatusDebuggingEnabled:(BOOL)flag;//NDFN
+(BOOL)autoOpenInBrowser;
+(void)setAutoOpenInBrowser:(BOOL)flag_;
+(void)setAutoOpenInBrowser:(BOOL)flag;
+(BOOL)isDirectConnectEnabled;
+(void)setDirectConnectEnabled:(BOOL)flag_;
+(void)setDirectConnectEnabled:(BOOL)flag;
+(NSString*)cgiAdaptorURL;
+(void)setCGIAdaptorURL:(NSString*)url_;
+(void)setCGIAdaptorURL:(NSString*)url;
+(BOOL)isCachingEnabled;
+(void)setCachingEnabled:(BOOL)flag_;
+(void)setCachingEnabled:(BOOL)flag;
+(NSString*)applicationBaseURL;
+(void)setApplicationBaseURL:(NSString*)baseURL_;
+(void)setApplicationBaseURL:(NSString*)baseURL;
+(NSString*)frameworksBaseURL;
+(void)setFrameworksBaseURL:(NSString*)baseURL_;
+(void)setFrameworksBaseURL:(NSString*)baseURL;
+(NSString*)recordingPath;
+(void)setRecordingPath:(NSString*)path_;
+(void)setRecordingPath:(NSString*)path;
+(NSArray*)projectSearchPath;
+(void)setProjectSearchPath:(NSArray*)pathArray_;
+(void)setProjectSearchPath:(NSArray*)pathArray;
+(BOOL)isMonitorEnabled;
+(void)setMonitorEnabled:(BOOL)flag_;
+(void)setMonitorEnabled:(BOOL)flag;
+(NSString*)monitorHost;
+(void)setMonitorHost:(NSString*)hostName_;
+(void)setMonitorHost:(NSString*)hostName;
+(NSString*)SMTPHost;
+(void)setSMTPHost:(NSString*)hostName_;
+(void)setSMTPHost:(NSString*)hostName;
+(NSString*)adaptor;
+(void)setAdaptor:(NSString*)adaptorName_;
+(void)setAdaptor:(NSString*)adaptorName;
+(id)port;
+(void)setPort:(id)port_;
+(void)setPort:(id)port;
+(id)host;
+(void)setHost:(id)host_;
+(void)setHost:(id)host;
+(id)listenQueueSize;
+(void)setListenQueueSize:(id)listenQueueSize_;
+(void)setListenQueueSize:(id)aSize;
+(id)workerThreadCount;
+(void)setWorkerThreadCount:(id)workerThreadCount_;
+(void)setWorkerThreadCount:(id)workerThreadCount;
+(NSArray*)additionalAdaptors;
+(void)setAdditionalAdaptors:(NSArray*)adaptorList;
+(BOOL)includeCommentsInResponses;
+(void)setIncludeCommentsInResponses:(BOOL)flag_;
+(void)setIncludeCommentsInResponses:(BOOL)flag;
+(NSString*)componentRequestHandlerKey;
+(void)setComponentRequestHandlerKey:(NSString*)key_;
+(void)setComponentRequestHandlerKey:(NSString*)aKey;
+(NSString*)directActionRequestHandlerKey;
+(void)setDirectActionRequestHandlerKey:(NSString*)key_;
+(void)setDirectActionRequestHandlerKey:(NSString*)aKey;
+(NSString*)resourceRequestHandlerKey;
+(void)setResourceRequestHandlerKey:(NSString*)key_;
+(void)setSessionTimeOut:(NSNumber*)timeOut_;
+(void)setResourceRequestHandlerKey:(NSString*)aKey;
+(void)setSessionTimeOut:(NSNumber*)aTimeOut;
+(NSNumber*)sessionTimeOut;
+(void)setSessionTimeOutValue:(NSTimeInterval)timeOutValue_;
+(void)setSessionTimeOutValue:(NSTimeInterval)aTimeOutValue;
+(NSTimeInterval)sessionTimeOutValue;
+(NSString*)debugSetConfigFilePath;//NDFN
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath_;//NDFN
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath;//NDFN
+(NSString*)saveResponsesPath;//NDFN
+(void)setSaveResponsesPath:(NSString*)saveResponsesPath;//NDFN
@end
@ -560,9 +566,9 @@ extern BOOL WOStrictFlag;
@interface GSWApplication (GSWApplicationClassD)
+(int)_garbageCollectionRepeatCount;
+(BOOL)_lockDefaultEditingContext;
+(void)_setLockDefaultEditingContext:(BOOL)_flag;
+(void)_setLockDefaultEditingContext:(BOOL)flag;
+(id)_allowsConcurrentRequestHandling;
+(void)_setAllowsConcurrentRequestHandling:(id)_unknown;
+(void)_setAllowsConcurrentRequestHandling:(id)unknown;
@end
@ -578,50 +584,50 @@ extern BOOL WOStrictFlag;
//====================================================================
@interface GSWApplication (NDFN)
//NDFN
-(id)propListWithResourceNamed:(NSString*)name_
ofType:(NSString*)type_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
+(BOOL)createUnknownComponentClasses:(NSArray*)classes_
superClassName:(NSString*)superClassName_;
+(void)addDynCreateClassName:(NSString*)className_
superClassName:(NSString*)superClassName_;
-(id)propListWithResourceNamed:(NSString*)aName
ofType:(NSString*)aType
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
+(BOOL)createUnknownComponentClasses:(NSArray*)classes
superClassName:(NSString*)aSuperClassName;
+(void)addDynCreateClassName:(NSString*)aClassName
superClassName:(NSString*)aSuperClassName;
//NDFN
-(NSString*)pathForResourceNamed:(NSString*)name_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
-(NSString*)pathForResourceNamed:(NSString*)aName
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
//NDFN
-(NSString*)pathForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
-(NSString*)pathForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
//NDFN
-(NSString*)urlForResourceNamed:(NSString*)name_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_
request:(GSWRequest*)request_;
-(NSString*)urlForResourceNamed:(NSString*)aName
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages
request:(GSWRequest*)aRequest;
//NDFN
-(NSString*)stringForKey:(NSString*)key_
inTableNamed:(NSString*)tableName_
withDefaultValue:(NSString*)defaultValue_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
inTableNamed:(NSString*)aTableName
withDefaultValue:(NSString*)defaultValue
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
//NDFN
-(NSDictionary*)stringsTableNamed:(NSString*)tableName_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
-(NSDictionary*)stringsTableNamed:(NSString*)aTableName
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
//NDFN
-(NSArray*)stringsTableArrayNamed:(NSString*)tableName_
inFramework:(NSString*)frameworkName_
languages:(NSArray*)languages_;
-(NSArray*)stringsTableArrayNamed:(NSString*)aTableName
inFramework:(NSString*)aFrameworkName
languages:(NSArray*)languages;
//NDFN
-(NSArray*)filterLanguages:(NSArray*)languages;
@end
//====================================================================
/*
@interface GSWApplication (GSWDeprecatedAPI)
-(GSWComponent*)pageWithName:(NSString*)name_; //OldFN
-(GSWComponent*)pageWithName:(NSString*)aName; //OldFN
-(void)savePage:(GSWComponent*)page_;
-(GSWSession*)session;
-(GSWContext*)context;
@ -635,15 +641,15 @@ extern BOOL WOStrictFlag;
-(GSWResponse*)handleException:(NSException*)exception_;
-(GSWComponent*)restorePageForContextID:(NSString*)contextID_;
-(NSString*)pathForResourceNamed:(NSString*)name_
ofType:(NSString*)type_;
-(NSString*)urlForResourceNamed:(NSString*)name_
ofType:(NSString*)type_;
-(NSString*)pathForResourceNamed:(NSString*)aName
ofType:(NSString*)aType;
-(NSString*)urlForResourceNamed:(NSString*)aName
ofType:(NSString*)aType;
-(NSString*)stringForKey:(NSString*)key_
inTableNamed:(NSString*)table_
withDefaultValue:(NSString*)defaultValue_;
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
-(GSWDynamicElement*)dynamicElementWithName:(NSString*)name_
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
-(GSWDynamicElement*)dynamicElementWithName:(NSString*)aName
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_; //OldFN
@end

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,16 @@
/* GSWBindingNameAssociation.h - GSWeb: Class GSWBindingNameAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWBindingNameAssociation.h - <title>GSWeb: Class GSWBindingNameAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Apr 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,23 +35,23 @@
//====================================================================
@interface GSWBindingNameAssociation : GSWAssociation
{
NSString* parentBindingName;
NSString* keyPath;
NSString* _parentBindingName;
NSString* _keyPath;
//GSWeb Additions {
BOOL isNonMandatory;
BOOL _isNonMandatory;
// }
};
-(id)initWithKeyPath:(NSString*)keyPath_;
-(id)initWithKeyPath:(NSString*)keyPath;
-(void)dealloc;
-(id)copyWithZone:(NSZone*)zone;
-(NSString*)description;
-(BOOL)isImplementedForComponent:(NSObject*)object_;
-(BOOL)isImplementedForComponent:(NSObject*)object;
-(BOOL)isValueConstant;
-(BOOL)isValueSettable;
-(id)valueInObject:(id)object_;
-(void)setValue:(id)value_
inObject:(id)object_;
-(id)valueInObject:(id)object;
-(void)setValue:(id)value
inObject:(id)object;
@end
#endif //_GSWBindingNameAssociation_h__

View file

@ -1,11 +1,16 @@
/* GSWBindingNameAssociation.m - GSWeb: Class GSWBindingNameAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWBindingNameAssociation.m - <title>GSWeb: Class GSWBindingNameAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Apr 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,33 +35,33 @@ static char rcsId[] = "$Id$";
@implementation GSWBindingNameAssociation
//--------------------------------------------------------------------
-(id)initWithKeyPath:(NSString*)keyPath_
-(id)initWithKeyPath:(NSString*)aKeyPath
{
//OK
LOGObjectFnStart();
if ((self=[super init]))
{
NSArray* keys=nil;
NSDebugMLLog(@"associations",@"keyPath_=%@",keyPath_);
keys=[keyPath_ componentsSeparatedByString:@"."];
NSDebugMLLog(@"associations",@"aKeyPath=%@",aKeyPath);
keys=[aKeyPath componentsSeparatedByString:@"."];
if ([keys count]>0)
{
if (!WOStrictFlag && [keyPath_ hasPrefix:@"^"])
if (!WOStrictFlag && [aKeyPath hasPrefix:@"^"])
{
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
}
else if (!WOStrictFlag && [keyPath_ hasPrefix:@"~"])
else if (!WOStrictFlag && [aKeyPath hasPrefix:@"~"])
{
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
isNonMandatory=YES;
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
_isNonMandatory=YES;
};
if ([keys count]>1)
{
ASSIGN(keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
ASSIGN(_keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
};
};
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
};
LOGObjectFnStop();
return self;
@ -64,8 +70,8 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)dealloc
{
DESTROY(parentBindingName);
DESTROY(keyPath);
DESTROY(_parentBindingName);
DESTROY(_keyPath);
[super dealloc];
};
@ -73,8 +79,9 @@ static char rcsId[] = "$Id$";
-(id)copyWithZone:(NSZone*)zone;
{
GSWBindingNameAssociation* clone = [super copyWithZone:zone];
ASSIGN(clone->parentBindingName,parentBindingName);
ASSIGN(clone->keyPath,keyPath);
ASSIGN(clone->_parentBindingName,_parentBindingName);
ASSIGN(clone->_keyPath,_keyPath);
_isNonMandatory=_isNonMandatory;
return clone;
};
@ -84,29 +91,29 @@ static char rcsId[] = "$Id$";
return [NSString stringWithFormat:@"<%s %p - parentBindingName=%@ keyPath=%@>",
object_get_class_name(self),
(void*)self,
parentBindingName,
keyPath];
_parentBindingName,
_keyPath];
};
//--------------------------------------------------------------------
-(BOOL)isImplementedForComponent:(NSObject*)object_
-(BOOL)isImplementedForComponent:(NSObject*)object
{
BOOL _isImplemented=NO;
BOOL isImplemented=NO;
LOGObjectFnStart();
_isImplemented=[object_ hasBinding:parentBindingName];
isImplemented=(BOOL)[object hasBinding:_parentBindingName];
LOGObjectFnStop();
return _isImplemented;
return isImplemented;
};
//--------------------------------------------------------------------
-(id)valueInObject:(id)object_
-(id)valueInObject:(id)object
{
id _value=nil;
id value=nil;
LOGObjectFnStart();
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
NSDebugMLLog(@"associations",@"object_=%@",object_);
if (object_)
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
NSDebugMLLog(@"associations",@"object=%@",object);
if (object)
{
/*
#if !GSWEB_STRICT
@ -121,31 +128,31 @@ static char rcsId[] = "$Id$";
};
};
*/
_value=[object_ valueForBinding:parentBindingName];
NSDebugMLLog(@"associations",@"_value=%@",_value);
if (_value && keyPath)
value=[object valueForBinding:_parentBindingName];
NSDebugMLLog(@"associations",@"value=%@",value);
if (value && _keyPath)
{
_value=[GSWAssociation valueInObject:_value
forKeyPath:keyPath];
NSDebugMLLog(@"associations",@"_value=%@",_value);
value=[GSWAssociation valueInObject:value
forKeyPath:_keyPath];
NSDebugMLLog(@"associations",@"value=%@",value);
};
};
NSDebugMLLog(@"associations",@"_value=%@",_value);
[self logTakeValue:_value];
NSDebugMLLog(@"associations",@"value=%@",value);
[self logTakeValue:value];
LOGObjectFnStop();
return _value;
return value;
};
//--------------------------------------------------------------------
-(void)setValue:(id)value_
inObject:(id)object_
-(void)setValue:(id)value
inObject:(id)object
{
LOGObjectFnStart();
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
if (object_)
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
if (object)
{
[object_ validateValue:&value_
[object validateValue:&value
forKey:self];
/*
#if !GSWEB_STRICT
@ -160,18 +167,18 @@ static char rcsId[] = "$Id$";
};
};
*/
if (keyPath)
if (_keyPath)
{
id tmpValue=[object_ valueForBinding:parentBindingName];
[GSWAssociation setValue:value_
id tmpValue=[object valueForBinding:_parentBindingName];
[GSWAssociation setValue:value
inObject:tmpValue
forKeyPath:keyPath];
forKeyPath:_keyPath];
}
else
[object_ setValue:value_
forBinding:parentBindingName];
[object setValue:value
forBinding:_parentBindingName];
};
[self logSetValue:value_];
[self logSetValue:value];
LOGObjectFnStop();
};

View file

@ -1,11 +1,16 @@
/* GSWBundle.h - GSWeb: Class GSWBundle
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWBundle.h - <title>GSWeb: Class GSWBundle</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,21 +36,21 @@
//====================================================================
@interface GSWBundle : NSObject <NSLocking>
{
NSString* path;
NSString* baseURL;
NSString* frameworkName;
NSMutableDictionary* archiveCache;
NSMutableDictionary* apiCache;//NDFN
NSMutableDictionary* encodingCache;
NSMutableDictionary* pathCache;
NSMutableDictionary* urlCache;
NSMutableDictionary* stringsTableCache;
NSMutableDictionary* stringsTableArrayCache; //NDFN
NSMutableDictionary* templateCache;
NSMutableDictionary* classCache;
NSRecursiveLock* selfLock;
NSString* _path;
NSString* _baseURL;
NSString* _frameworkName;
NSMutableDictionary* _archiveCache;
NSMutableDictionary* _apiCache;//NDFN
NSMutableDictionary* _encodingCache;
NSMutableDictionary* _pathCache;
NSMutableDictionary* _urlCache;
NSMutableDictionary* _stringsTableCache;
NSMutableDictionary* _stringsTableArrayCache; //NDFN
NSMutableDictionary* _templateCache;
NSMutableDictionary* _classCache;
NSRecursiveLock* _selfLock;
#ifndef NDEBUG
int selfLockn;
int _selfLockn;
#endif
};
@ -53,11 +59,11 @@
-(NSString*)frameworkName;
-(NSString*)description;
-(void)dealloc;
-(id)initWithPath:(NSString*)path_
baseURL:(NSString*)baseURL_
inFrameworkNamed:(NSString*)frameworkName_;
-(id)initWithPath:(NSString*)path_
baseURL:(NSString*)baseURL_;
-(id)initWithPath:(NSString*)aPath
baseURL:(NSString*)aBaseURL
inFrameworkNamed:(NSString*)aFrameworkName;
-(id)initWithPath:(NSString*)aPath
baseURL:(NSString*)aBaseURL;
-(void)unlock;
-(void)lock;
@ -69,75 +75,75 @@
@end
@interface GSWBundle (GSWBundleA)
-(id)lockedResourceNamed:(NSString*)name_
ofType:(NSString*)type_
withLanguages:(NSArray*)languages_
usingCache:(NSMutableDictionary*)cache_
relativePath:(NSString**)relativePath_
absolutePath:(NSString**)absolutePath_;
-(id)lockedResourceNamed:(NSString*)aName
ofType:(NSString*)aType
withLanguages:(NSArray*)languages
usingCache:(NSMutableDictionary*)cache
relativePath:(NSString**)relativePath
absolutePath:(NSString**)absolutePath;
@end
@interface GSWBundle (GSWResourceManagement)
-(void)initializeObject:(id)object_
fromArchiveNamed:(NSString*)name_;
-(void)initializeObject:(id)anObject
fromArchiveNamed:(NSString*)aName;
-(void)initializeObject:(id)object_
-(void)initializeObject:(id)anObject
fromArchive:(NSDictionary*)archive;
-(Class)scriptedClassWithName:(NSString*)name_
superclassName:(NSString*)superclassName_;
-(Class)scriptedClassWithName:(NSString*)aName
superclassName:(NSString*)superclassName;
-(Class)lockedScriptedClassWithName:(NSString*)name_
pathName:(NSString*)pathName_
superclassName:(NSString*)superclassName_;
-(Class)lockedScriptedClassWithName:(NSString*)aName
pathName:(NSString*)pathName
superclassName:(NSString*)superclassName;
-(NSString*)lockedScriptedClassPathWithName:(NSString*)name_;
-(NSString*)lockedScriptedClassPathWithName:(NSString*)aName;
-(Class)compiledClassWithName:(NSString*)name_
superclassName:(NSString*)superclassName_;
-(Class)compiledClassWithName:(NSString*)aName
superclassName:(NSString*)superclassName;
-(GSWElement*)templateNamed:(NSString*)name_
languages:(NSArray*)languages_;
-(GSWElement*)templateNamed:(NSString*)aName
languages:(NSArray*)languages;
-(GSWElement*)lockedTemplateNamed:(NSString*)name_
languages:(NSArray*)languages_;
-(GSWElement*)lockedTemplateNamed:(NSString*)aName
languages:(NSArray*)languages;
-(NSString*)stringForKey:(NSString*)key_
inTableNamed:(NSString*)name_
withDefaultValue:(NSString*)defaultValue_
languages:(NSArray*)languages_;
inTableNamed:(NSString*)aName
withDefaultValue:(NSString*)defaultValue
languages:(NSArray*)languages;
//NDFN
-(NSDictionary*)stringsTableNamed:(NSString*)name_
withLanguages:(NSArray*)languages_;
-(NSDictionary*)stringsTableNamed:(NSString*)aName
withLanguages:(NSArray*)languages;
//NDFN
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
withLanguages:(NSArray*)languages_;
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
withLanguages:(NSArray*)languages;
-(NSString*)urlForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_
request:(GSWRequest*)request_;
-(NSString*)urlForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
languages:(NSArray*)languages
request:(GSWRequest*)aRequest;
-(NSString*)pathForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_;
-(NSString*)pathForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
languages:(NSArray*)languages;
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)name_;
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)aName;
-(NSDictionary*)archiveNamed:(NSString*)name_;
-(NSDictionary*)apiNamed:(NSString*)name_;//NDFN
-(NSDictionary*)archiveNamed:(NSString*)aName;
-(NSDictionary*)apiNamed:(NSString*)aName;//NDFN
-(NSDictionary*)lockedArchiveNamed:(NSString*)name_;
-(NSDictionary*)lockedApiNamed:(NSString*)name_;//NDFN
-(NSDictionary*)lockedArchiveNamed:(NSString*)aName;
-(NSDictionary*)lockedApiNamed:(NSString*)aName;//NDFN
@end
@interface GSWBundle (GSWBundleC)
-(id)scriptedClassNameFromClassName:(NSString*)name_;
-(id)scriptPathNameFromScriptedClassName:(NSString*)name_;
-(id)scriptedClassNameFromClassName:(NSString*)aName;
-(id)scriptPathNameFromScriptedClassName:(NSString*)aName;
@end
#endif //_GSWBundle_h__

File diff suppressed because it is too large Load diff

View file

@ -311,7 +311,8 @@ static char rcsId[] = "$Id$";
inComponent:component];
prefixValue=[_prefix valueInComponent:component];
suffixValue=[_suffix valueInComponent:component];
disableValue=[_itemDisabled valueInComponent:component];
disableValue=[self evaluateCondition:_itemDisabled
inContext:context];
[_index setValue:[NSNumber numberWithShort:i]
inComponent:component];
displayStringValue=[_displayString valueInComponent:component];

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$

View file

@ -199,6 +199,7 @@ static char rcsId[] = "$Id$";
GSWComponentDefinition* aComponentDefinition=nil;
LOGObjectFnStart();
aComponentDefinition=[self _componentDefinition];
NSAssert(aComponentDefinition,@"No componentDefinition");
aFrameworkName=[aComponentDefinition frameworkName];
NSDebugMLLog(@"GSWComponent",@"aFrameworkName=%@",aFrameworkName);
LOGObjectFnStop();
@ -458,7 +459,9 @@ associationsKeys:(NSArray*)associationsKeys
LOGObjectFnStart();
if (!template)
{
NSDebugMLLog(@"GSWComponent",@"templateName=%@",[self _templateName]);
template=[self templateWithName:[self _templateName]];
NSDebugMLLog(@"GSWComponent",@"template=%p",template);
if ([self isCachingEnabled])
{
ASSIGN(_template,template);
@ -474,13 +477,17 @@ associationsKeys:(NSArray*)associationsKeys
//OK
GSWComponentDefinition* aComponentDefinition=nil;
LOGObjectFnStart();
NSDebugMLLog(@"GSWComponent",@"_componentDefinition=%@",_componentDefinition);
if (_componentDefinition)
aComponentDefinition=_componentDefinition;
else
{
NSArray* languages=[self languages];
NSDebugMLLog(@"GSWComponent",@"languages=%@",languages);
NSDebugMLLog(@"GSWComponent",@"_name=%@",_name);
aComponentDefinition=[GSWApp componentDefinitionWithName:_name
languages:languages];
NSDebugMLLog(@"GSWComponent",@"aComponentDefinition=%@",aComponentDefinition);
if ([self isCachingEnabled])
{
ASSIGN(_componentDefinition,aComponentDefinition);
@ -543,9 +550,10 @@ associationsKeys:(NSArray*)associationsKeys
LOGObjectFnStart();
languages=[self languages];
aComponentDefinition=[self _componentDefinition];
NSAssert(aComponentDefinition,@"No componentDefinition");
template=[aComponentDefinition templateWithName:aName
languages:languages];
NSDebugMLLog(@"GSWComponent",@"template=%@",template);
NSDebugMLLog(@"GSWComponent",@"aName=%@ template=%@",aName,template);
LOGObjectFnStop();
return template;
};
@ -988,17 +996,20 @@ associationsKeys:(NSArray*)associationsKeys
GSWElementIDString* debugElementID=[aContext elementID];
#endif
LOGObjectFnStart();
NSAssert(aContext,@"No Context");
NSAssert(aResponse,@"No Response");
GSWStartElement(aContext);
GSWSaveAppendToResponseElementID(aContext);
template=[self _template];
NSAssert(template,@"No template");
#ifndef NDEBUG
if(GSDebugSet(@"gswcomponents") == YES)
if(GSDebugSet(@"gswcomponents"))
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
#endif
request=[aContext request];
NSAssert(request,@"No request");
isFromClientComponent=[request isFromClientComponent];
component=[aContext component];
[aContext appendZeroElementIDComponent];

View file

@ -1,11 +1,16 @@
/* GSWComponentDefinition.h - GSWeb: Class GSWComponentDefinition
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWComponentDefinition.h - <title>GSWeb: Class GSWComponentDefinition</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,36 +24,36 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
#ifndef _GSWComponentDefinition_h__
#define _GSWComponentDefinition_h__
//====================================================================
@interface GSWComponentDefinition : NSObject <NSCoding,NSCopying>
{
NSString* name;
GSWBundle* bundle;
NSMutableArray* observers;
NSString* frameworkName;
NSString* templateName;
Class componentClass;
BOOL isScriptedClass;
BOOL isCachingEnabled;
BOOL isAwake;
NSString* _name;
GSWBundle* _bundle;
NSMutableArray* _observers;
NSString* _frameworkName;
NSString* _templateName;
Class _componentClass;
BOOL _isScriptedClass;
BOOL _isCachingEnabled;
BOOL _isAwake;
};
-(id)initWithName:(NSString*)name_
path:(NSString*)_path
baseURL:(NSString*)_baseURL
frameworkName:(NSString*)_frameworkName;
-(id)initWithName:(NSString*)aName
path:(NSString*)aPath
baseURL:(NSString*)baseURL
frameworkName:(NSString*)aFrameworkName;
-(void)dealloc;
-(id)initWithCoder:(NSCoder*)coder_;
-(void)encodeWithCoder:(NSCoder*)coder_;
-(id)copyWithZone:(NSZone*)zone_;
-(id)initWithCoder:(NSCoder*)coder;
-(void)encodeWithCoder:(NSCoder*)coder;
-(id)copyWithZone:(NSZone*)zone;
-(NSString*)frameworkName;
-(NSString*)baseURL;
@ -62,7 +67,7 @@
//====================================================================
@interface GSWComponentDefinition (GSWCacheManagement)
-(BOOL)isCachingEnabled;
-(void)setCachingEnabled:(BOOL)flag_;
-(void)setCachingEnabled:(BOOL)flag;
@end
//====================================================================
@ -72,55 +77,55 @@
//====================================================================
@interface GSWComponentDefinition (GSWComponentDefinitionB)
-(GSWElement*)templateWithName:(NSString*)name_
languages:(NSArray*)languages_;
-(GSWElement*)templateWithName:(NSString*)aName
languages:(NSArray*)languages;
/*
-(NSString*)stringForKey:(NSString*)key_
inTableNamed:(NSString*)name_
inTableNamed:(NSString*)aName
withDefaultValue:(NSString*)defaultValue_
languages:(NSArray*)languages_;
languages:(NSArray*)languages;
//NDFN
-(NSDictionary*)stringsTableNamed:(NSString*)name_
withLanguages:(NSArray*)languages_;
-(NSDictionary*)stringsTableNamed:(NSString*)aName
withLanguages:(NSArray*)languages;
//NDFN
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
withLanguages:(NSArray*)languages_;
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
withLanguages:(NSArray*)languages;
-(NSString*)urlForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_
request:(GSWRequest*)request_;
-(NSString*)urlForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
languages:(NSArray*)languages
request:(GSWRequest*)aRequest;
*/
-(NSString*)pathForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_;
-(NSString*)pathForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
languages:(NSArray*)languages;
@end
//====================================================================
@interface GSWComponentDefinition (GSWComponentDefinitionC)
-(GSWComponent*)componentInstanceInContext:(GSWContext*)context_;
-(GSWComponent*)componentInstanceInContext:(GSWContext*)aContext;
-(Class)componentClass;
-(Class)_componentClass;
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations_
template:(GSWElement*)_template;
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations
template:(GSWElement*)template;
-(NSDictionary*)componentAPI;//NDFN
@end
//====================================================================
@interface GSWComponentDefinition (GSWComponentDefinitionD)
-(void)_finishInitializingComponent:(GSWComponent*)_component;
-(void)_finishInitializingComponent:(GSWComponent*)aComponent;
@end
//====================================================================
@interface GSWComponentDefinition (GSWComponentDefinitionE)
-(void)_notifyObserversForDyingComponent:(GSWComponent*)_component;
-(void)_awakeObserversForComponent:(GSWComponent*)_component;
-(void)_deallocForComponent:(GSWComponent*)_component;
-(void)_awakeForComponent:(GSWComponent*)_component;
-(void)_registerObserver:(id)_observer;
+(void)_registerObserver:(id)_observer;
-(void)_notifyObserversForDyingComponent:(GSWComponent*)aComponent;
-(void)_awakeObserversForComponent:(GSWComponent*)aComponent;
-(void)_deallocForComponent:(GSWComponent*)aComponent;
-(void)_awakeForComponent:(GSWComponent*)aComponent;
-(void)_registerObserver:(id)observer;
+(void)_registerObserver:(id)observer;
@end

View file

@ -1,11 +1,16 @@
/* GSWComponentDefinition.m - GSWeb: Class GSWComponentDefinition
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWComponentDefinition.m - <title>GSWeb: Class GSWComponentDefinition</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,28 +35,28 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentDefinition
//--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_
path:(NSString*)path_
baseURL:(NSString*)baseURL_
frameworkName:(NSString*)frameworkName_
-(id)initWithName:(NSString*)aName
path:(NSString*)aPath
baseURL:(NSString*)baseURL
frameworkName:(NSString*)aFrameworkName
{
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;
NSDebugMLLog(@"gswcomponents",@"aName=%@ aFrameworkName=%@",aName,aFrameworkName);
ASSIGN(_name,aName);
_bundle=[[GSWBundle alloc] initWithPath:aPath
baseURL:baseURL
inFrameworkNamed:aFrameworkName];
_observers=nil;
ASSIGN(_frameworkName,aFrameworkName);
NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",_frameworkName);
ASSIGN(_templateName,aName);//TODOV
NSDebugMLLog(@"gswcomponents",@"templateName=%@",_templateName);
_componentClass=Nil;
_isScriptedClass=NO;
_isCachingEnabled=NO;
_isAwake=NO;
[self setCachingEnabled:[GSWApplication isCachingEnabled]];
};
LOGObjectFnStop();
@ -62,82 +68,82 @@ static char rcsId[] = "$Id$";
{
GSWLogC("Dealloc GSWComponentDefinition");
GSWLogC("Dealloc GSWComponentDefinition: name");
DESTROY(name);
DESTROY(_name);
GSWLogC("Dealloc GSWComponentDefinition: bundle");
DESTROY(bundle);
DESTROY(_bundle);
GSWLogC("Dealloc GSWComponentDefinition: observers");
DESTROY(observers);
DESTROY(_observers);
GSWLogC("Dealloc GSWComponentDefinition: frameworkName");
DESTROY(frameworkName);
DESTROY(_frameworkName);
GSWLogC("Dealloc GSWComponentDefinition: templateName");
DESTROY(templateName);
DESTROY(_templateName);
GSWLogC("Dealloc GSWComponentDefinition: componentClass");
DESTROY(componentClass);
DESTROY(_componentClass);
GSWLogC("Dealloc GSWComponentDefinition Super");
[super dealloc];
GSWLogC("End Dealloc GSWComponentDefinition");
};
//--------------------------------------------------------------------
-(id)initWithCoder:(NSCoder*)coder_
-(id)initWithCoder:(NSCoder*)coder
{
if ((self = [super init]))
{
[coder_ decodeValueOfObjCType:@encode(id)
at:&name];
[coder_ decodeValueOfObjCType:@encode(id)
at:&bundle];
[coder_ decodeValueOfObjCType:@encode(id)
at:&observers]; //TODOV
[coder_ decodeValueOfObjCType:@encode(id)
at:&frameworkName];
[coder_ decodeValueOfObjCType:@encode(id)
at:&templateName];
[coder_ decodeValueOfObjCType:@encode(Class)
at:&componentClass];
[coder_ decodeValueOfObjCType:@encode(BOOL)
at:&isScriptedClass];
[coder_ decodeValueOfObjCType:@encode(BOOL)
at:&isCachingEnabled];
[coder_ decodeValueOfObjCType:@encode(BOOL)
at:&isAwake];
[coder decodeValueOfObjCType:@encode(id)
at:&_name];
[coder decodeValueOfObjCType:@encode(id)
at:&_bundle];
[coder decodeValueOfObjCType:@encode(id)
at:&_observers]; //TODOV
[coder decodeValueOfObjCType:@encode(id)
at:&_frameworkName];
[coder decodeValueOfObjCType:@encode(id)
at:&_templateName];
[coder decodeValueOfObjCType:@encode(Class)
at:&_componentClass];
[coder decodeValueOfObjCType:@encode(BOOL)
at:&_isScriptedClass];
[coder decodeValueOfObjCType:@encode(BOOL)
at:&_isCachingEnabled];
[coder decodeValueOfObjCType:@encode(BOOL)
at:&_isAwake];
};
return self;
};
//--------------------------------------------------------------------
-(void)encodeWithCoder:(NSCoder*)coder_
-(void)encodeWithCoder:(NSCoder*)coder
{
[coder_ encodeObject:name];
[coder_ encodeObject:bundle];
[coder_ encodeObject:observers]; //TODOV
[coder_ encodeObject:frameworkName];
[coder_ encodeObject:templateName];
[coder_ encodeValueOfObjCType:@encode(Class)
at:&componentClass];
[coder_ encodeValueOfObjCType:@encode(BOOL)
at:&isScriptedClass];
[coder_ encodeValueOfObjCType:@encode(BOOL)
at:&isCachingEnabled];
[coder_ encodeValueOfObjCType:@encode(BOOL)
at:&isAwake];
[coder encodeObject:_name];
[coder encodeObject:_bundle];
[coder encodeObject:_observers]; //TODOV
[coder encodeObject:_frameworkName];
[coder encodeObject:_templateName];
[coder encodeValueOfObjCType:@encode(Class)
at:&_componentClass];
[coder encodeValueOfObjCType:@encode(BOOL)
at:&_isScriptedClass];
[coder encodeValueOfObjCType:@encode(BOOL)
at:&_isCachingEnabled];
[coder encodeValueOfObjCType:@encode(BOOL)
at:&_isAwake];
};
//--------------------------------------------------------------------
-(id)copyWithZone:(NSZone*)zone_
-(id)copyWithZone:(NSZone*)zone
{
GSWComponentDefinition* clone = [[isa allocWithZone:zone_] init];
GSWComponentDefinition* clone = [[isa allocWithZone:zone] init];
if (clone)
{
ASSIGNCOPY(clone->name,name);
ASSIGNCOPY(clone->bundle,bundle);
ASSIGNCOPY(clone->observers,observers);
ASSIGNCOPY(clone->frameworkName,frameworkName);
ASSIGNCOPY(clone->templateName,templateName);
clone->componentClass=componentClass;
clone->isScriptedClass=isScriptedClass;
clone->isCachingEnabled=isCachingEnabled;
clone->isAwake=isAwake;
ASSIGNCOPY(clone->_name,_name);
ASSIGNCOPY(clone->_bundle,_bundle);
ASSIGNCOPY(clone->_observers,_observers);
ASSIGNCOPY(clone->_frameworkName,_frameworkName);
ASSIGNCOPY(clone->_templateName,_templateName);
clone->_componentClass=_componentClass;
clone->_isScriptedClass=_isScriptedClass;
clone->_isCachingEnabled=_isCachingEnabled;
clone->_isAwake=_isAwake;
};
return clone;
};
@ -145,25 +151,25 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(NSString*)frameworkName
{
return frameworkName;
return _frameworkName;
};
//--------------------------------------------------------------------
-(NSString*)baseURL
{
return [bundle baseURL];
return [_bundle baseURL];
};
//--------------------------------------------------------------------
-(NSString*)path
{
return [bundle path];
return [_bundle path];
};
//--------------------------------------------------------------------
-(NSString*)name
{
return name;
return _name;
};
//--------------------------------------------------------------------
@ -173,15 +179,15 @@ static char rcsId[] = "$Id$";
return [NSString stringWithFormat:@"<%s %p - name:[%@] bundle:[%@] observers=[%@] frameworkName=[%@] templateName=[%@] componentClass=[%@] isScriptedClass=[%s] isCachingEnabled=[%s] isAwake=[%s]>",
object_get_class_name(self),
(void*)self,
name,
bundle,
observers,
frameworkName,
templateName,
componentClass,
isScriptedClass ? "YES" : "NO",
isCachingEnabled ? "YES" : "NO",
isAwake ? "YES" : "NO"];
_name,
_bundle,
_observers,
_frameworkName,
_templateName,
_componentClass,
_isScriptedClass ? "YES" : "NO",
_isCachingEnabled ? "YES" : "NO",
_isAwake ? "YES" : "NO"];
};
//--------------------------------------------------------------------
@ -189,7 +195,7 @@ static char rcsId[] = "$Id$";
{
//OK
LOGObjectFnStart();
isAwake=NO;
_isAwake=NO;
LOGObjectFnStop();
};
@ -197,11 +203,11 @@ static char rcsId[] = "$Id$";
-(void)awake
{
//OK
BOOL _isCachingEnabled=NO;
BOOL isCachingEnabled=NO;
LOGObjectFnStart();
isAwake=YES;
_isCachingEnabled=[self isCachingEnabled];
if (!_isCachingEnabled) //??
_isAwake=YES;
isCachingEnabled=[self isCachingEnabled];
if (!isCachingEnabled) //??
[self _clearCache];
//call self componentClass
LOGObjectFnNotImplemented(); //TODOFN
@ -216,13 +222,13 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(BOOL)isCachingEnabled
{
return isCachingEnabled;
return _isCachingEnabled;
};
//--------------------------------------------------------------------
-(void)setCachingEnabled:(BOOL)flag_
-(void)setCachingEnabled:(BOOL)flag
{
isCachingEnabled=flag_;
_isCachingEnabled=flag;
};
@end
@ -235,7 +241,7 @@ static char rcsId[] = "$Id$";
{
//OK
LOGObjectFnStart();
[bundle clearCache];
[_bundle clearCache];
LOGObjectFnStop();
};
@ -245,88 +251,88 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentDefinition (GSWComponentDefinitionB)
//--------------------------------------------------------------------
-(GSWElement*)templateWithName:(NSString*)name_
languages:(NSArray*)languages_
-(GSWElement*)templateWithName:(NSString*)aName
languages:(NSArray*)languages
{
GSWElement* _element=nil;
GSWElement* element=nil;
LOGObjectFnStart();
_element=[bundle templateNamed:name_
languages:languages_];
NSDebugMLLog(@"gswcomponents",@"_element=%@",_element);
element=[_bundle templateNamed:aName
languages:languages];
NSDebugMLLog(@"gswcomponents",@"aName=%@ languages=%@ element=%@",aName,languages,element);
LOGObjectFnStop();
return _element;
return element;
};
/*
//--------------------------------------------------------------------
-(NSString*)stringForKey:(NSString*)key_
inTableNamed:(NSString*)name_
withDefaultValue:(NSString*)defaultValue_
languages:(NSArray*)languages_
-(NSString*)stringForKey:(NSString*)key
inTableNamed:(NSString*)aName
withDefaultValue:(NSString*)defaultValue
languages:(NSArray*)languages
{
NSString* _string=nil;
NSString* string=nil;
LOGObjectFnStart();
_string=[bundle stringForKey:key_
inTableNamed:name_
withDefaultValue:defaultValue_
languages:languages_];
string=[_bundle stringForKey:key
inTableNamed:aName
withDefaultValue:defaultValue
languages:languages];
LOGObjectFnStop();
return _string;
return string;
};
//--------------------------------------------------------------------
//NDFN
-(NSDictionary*)stringsTableNamed:(NSString*)name_
withLanguages:(NSArray*)languages_
-(NSDictionary*)stringsTableNamed:(NSString*)aName
withLanguages:(NSArray*)languages
{
NSDictionary* _stringsTable=nil;
NSDictionary* stringsTable=nil;
LOGObjectFnStart();
_stringsTable=[bundle stringsTableNamed:name_
withLanguages:languages_];
stringsTable=[bundle stringsTableNamed:aName
withLanguages:languages];
LOGObjectFnStop();
return _stringsTable;
return stringsTable;
};
//--------------------------------------------------------------------
//NDFN
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
withLanguages:(NSArray*)languages_
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
withLanguages:(NSArray*)languages
{
NSArray* _stringsTableArray=nil;
NSArray* stringsTableArray=nil;
LOGObjectFnStart();
_stringsTableArray=[bundle stringsTableArrayNamed:name_
withLanguages:languages_];
stringsTableArray=[bundle stringsTableArrayNamed:aName
withLanguages:languages];
LOGObjectFnStop();
return _stringsTableArray;
return stringsTableArray;
};
//--------------------------------------------------------------------
-(NSString*)urlForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_
request:(GSWRequest*)request_
-(NSString*)urlForResourceNamed:(NSString*)aName
ofType:(NSString*)type
languages:(NSArray*)languages
request:(GSWRequest*)request
{
NSString* _url=nil;
NSString* url=nil;
LOGObjectFnStart();
_url=[bundle urlForResourceNamed:name_
ofType:type_
languages:languages_
request:request_];
url=[bundle urlForResourceNamed:aName
ofType:type
languages:languages
request:request];
LOGObjectFnStop();
return _url;
return url;
};
*/
//--------------------------------------------------------------------
-(NSString*)pathForResourceNamed:(NSString*)name_
ofType:(NSString*)type_
languages:(NSArray*)languages_
-(NSString*)pathForResourceNamed:(NSString*)aName
ofType:(NSString*)aType
languages:(NSArray*)languages
{
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
_path=[bundle pathForResourceNamed:name_
ofType:type_
languages:languages_];
path=[_bundle pathForResourceNamed:aName
ofType:aType
languages:languages];
LOGObjectFnStop();
return _path;
return path;
};
@end
@ -335,35 +341,37 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentDefinition (GSWComponentDefinitionC)
//--------------------------------------------------------------------
-(GSWComponent*)componentInstanceInContext:(GSWContext*)_context
-(GSWComponent*)componentInstanceInContext:(GSWContext*)aContext
{
//OK
GSWComponent* _component=nil;
Class _componentClass=nil;
NSMutableDictionary* _threadDictionary=nil;
GSWComponent* component=nil;
Class componentClass=nil;
NSMutableDictionary* threadDictionary=nil;
LOGObjectFnStart();
NSAssert(_context,@"No Context");
NSDebugMLLog(@"gswcomponents",@"_context=%@",_context);
_componentClass=[self componentClass];
NSDebugMLLog(@"gswcomponents",@"_componentClass=%p",(void*)_componentClass);
_threadDictionary=GSCurrentThreadDictionary();
[_threadDictionary setObject:self
NSAssert(aContext,@"No Context");
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
componentClass=[self componentClass];
NSAssert(componentClass,@"No componentClass");
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
threadDictionary=GSCurrentThreadDictionary();
[threadDictionary setObject:self
forKey:GSWThreadKey_ComponentDefinition];
NS_DURING
{
_component=[[_componentClass new] autorelease];
component=[[componentClass new] autorelease];
}
NS_HANDLER
{
LOGException(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
[_threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
LOGException(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],__FILE__,__LINE__);
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
[localException raise];
};
NS_ENDHANDLER;
[_threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
// [_component context];//so what ?
LOGObjectFnStop();
return _component;
return component;
};
//--------------------------------------------------------------------
@ -377,71 +385,71 @@ static char rcsId[] = "$Id$";
-(Class)_componentClass
{
//OK To Verify
Class _componentClass=componentClass;
Class componentClass=_componentClass;
LOGObjectFnStart();
NSDebugMLLog(@"gswcomponents",@"_componentClass=%@",_componentClass);
NSDebugMLLog(@"gswcomponents",@"name=%@",name);
if (!_componentClass)
_componentClass=NSClassFromString(name);//???
NSDebugMLLog(@"gswcomponents",@"_componentClass=%@",_componentClass);
NSDebugMLLog(@"gswcomponents",@"_componentClass superclass=%@",[_componentClass superclass]);
if (!_componentClass)
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
NSDebugMLLog(@"gswcomponents",@"name=%@",_name);
if (!componentClass)
componentClass=NSClassFromString(_name);//???
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]);
if (!componentClass)
{
BOOL _createClassesOk=NO;
NSString* _superClassName=nil;
BOOL createClassesOk=NO;
NSString* superClassName=nil;
if (!WOStrictFlag)
{
NSDictionary* _archive=[bundle archiveNamed:name];
NSDebugMLLog(@"gswcomponents",@"_archive=%@",_archive);
_superClassName=[_archive objectForKey:@"superClassName"];
NSDebugMLLog(@"gswcomponents",@"_superClassName=%@",_superClassName);
if (_superClassName)
NSDictionary* archive=[_bundle archiveNamed:_name];
NSDebugMLLog(@"gswcomponents",@"archive=%@",archive);
superClassName=[archive objectForKey:@"superClassName"];
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
if (superClassName)
{
if (!NSClassFromString(_superClassName))
if (!NSClassFromString(superClassName))
{
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
_superClassName,
name);
superClassName,
_name);
};
};
};
if (!_superClassName)
_superClassName=@"GSWComponent";
NSDebugMLLog(@"gswcomponents",@"_superClassName=%@",_superClassName);
_createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:name]
superClassName:_superClassName];
_componentClass=NSClassFromString(name);
NSDebugMLLog(@"gswcomponents",@"_componentClass=%p",(void*)_componentClass);
if (!superClassName)
superClassName=@"GSWComponent";
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
superClassName:superClassName];
componentClass=NSClassFromString(_name);
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
};
//call GSWApp isCaching
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
LOGObjectFnStop();
return _componentClass;
return componentClass;
};
//--------------------------------------------------------------------
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)_associations
template:(GSWElement*)_template
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations
template:(GSWElement*)template
{
//OK
GSWComponentReference* _componentReference=nil;
GSWComponentReference* componentReference=nil;
LOGObjectFnStart();
_componentReference=[[[GSWComponentReference alloc]initWithName:name
associations:_associations
template:_template] autorelease];
componentReference=[[[GSWComponentReference alloc]initWithName:_name
associations:associations
template:template] autorelease];
LOGObjectFnStop();
return _componentReference;
return componentReference;
};
//--------------------------------------------------------------------
//NDFN
-(NSDictionary*)componentAPI
{
NSDictionary* _componentAPI=nil;
NSDictionary* componentAPI=nil;
LOGObjectFnStart();
_componentAPI=[bundle apiNamed:name];
componentAPI=[_bundle apiNamed:_name];
LOGObjectFnStop();
return _componentAPI;
return componentAPI;
};
@end
@ -450,14 +458,14 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentDefinition (GSWComponentDefinitionD)
//--------------------------------------------------------------------
-(void)_finishInitializingComponent:(GSWComponent*)_component
-(void)_finishInitializingComponent:(GSWComponent*)component
{
//OK
NSDictionary* _archive=nil;
NSDictionary* archive=nil;
LOGObjectFnStart();
_archive=[bundle archiveNamed:name];
[bundle initializeObject:_component
fromArchive:_archive];
archive=[_bundle archiveNamed:_name];
[_bundle initializeObject:component
fromArchive:archive];
LOGObjectFnStop();
};
@ -467,37 +475,37 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentDefinition (GSWComponentDefinitionE)
//--------------------------------------------------------------------
-(void)_notifyObserversForDyingComponent:(GSWComponent*)_component
-(void)_notifyObserversForDyingComponent:(GSWComponent*)aComponent
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(void)_awakeObserversForComponent:(GSWComponent*)_component
-(void)_awakeObserversForComponent:(GSWComponent*)aComponent
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(void)_deallocForComponent:(GSWComponent*)_component
-(void)_deallocForComponent:(GSWComponent*)aComponent
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(void)_awakeForComponent:(GSWComponent*)_component
-(void)_awakeForComponent:(GSWComponent*)aComponent
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(void)_registerObserver:(id)_observer
-(void)_registerObserver:(id)observer
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
+(void)_registerObserver:(id)_observer
+(void)_registerObserver:(id)observer
{
LOGClassFnNotImplemented(); //TODOFN
};

View file

@ -1,11 +1,16 @@
/* GSWComponentRequestHandler.h - GSWeb: Class GSWComponentRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWComponentRequestHandler.h - <title>GSWeb: Class GSWComponentRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -31,27 +37,27 @@
{
}
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)request_;
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)_application
inContext:(GSWContext*)context_
elements:(NSDictionary*)_elements;
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)_session
inContext:(GSWContext*)context_
elements:(NSDictionary*)_elements;
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest;
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)application
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements;
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)aSession
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements;
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)_component
inSession:(GSWSession*)_session
inContext:(GSWContext*)context_
elements:(NSDictionary*)_elements;
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)context_ID
inSession:(GSWSession*)_session;
inSession:(GSWSession*)aSession
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements;
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)aContextID
inSession:(GSWSession*)aSession;
@end
//====================================================================
@interface GSWComponentRequestHandler (GSWRequestHandlerClassA)
+(id)handler;
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)request_;
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)aRequest;
@end
#endif //_GSWComponentRequestHandler_h__

View file

@ -1,11 +1,16 @@
/* GSWComponentRequestHandler.m - GSWeb: Class GSWComponentRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWComponentRequestHandler.m - <title>GSWeb: Class GSWComponentRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,100 +35,104 @@ static char rcsId[] = "$Id$";
@implementation GSWComponentRequestHandler
//--------------------------------------------------------------------
-(GSWResponse*)handleRequest:(GSWRequest*)request_
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
{
//OK
GSWResponse* _response=nil;
GSWApplication* _application=[GSWApplication application];
GSWResponse* response=nil;
GSWApplication* application=[GSWApplication application];
LOGObjectFnStart();
[_application lockRequestHandling];
_response=[self lockedHandleRequest:request_];
if (!_response)
[application lockRequestHandling];
response=[self lockedHandleRequest:aRequest];
if (!response)
{
_response=[GSWResponse responseWithMessage:@"Component Handle request failed"
response=[GSWResponse responseWithMessage:@"Component Handle request failed"
inContext:nil
forRequest:request_];
[_response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
forRequest:aRequest];
[response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
};
[_application unlockRequestHandling];
NSDebugMLLog(@"requests",@"_response=%@",_response);
[application unlockRequestHandling];
NSDebugMLLog(@"requests",@"response=%@",response);
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)request_
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest
{
//OK
GSWStatisticsStore* _statisticsStore=nil;
GSWApplication* _application=[GSWApplication application];
GSWContext* _context=nil;
GSWResponse* _response=nil;
NSDictionary* _requestHandlerValues=nil;
NSString* _senderID=nil;
BOOL _exceptionRaised=NO;
GSWStatisticsStore* statisticsStore=nil;
GSWApplication* application=[GSWApplication application];
GSWContext* aContext=nil;
GSWResponse* response=nil;
NSDictionary* requestHandlerValues=nil;
NSString* senderID=nil;
BOOL exceptionRaised=NO;
LOGObjectFnStart();
NS_DURING
{
_requestHandlerValues=[GSWComponentRequestHandler _requestHandlerValuesForRequest:request_];
requestHandlerValues=[GSWComponentRequestHandler _requestHandlerValuesForRequest:aRequest];
}
NS_HANDLER
{
_exceptionRaised=YES;
exceptionRaised=YES;
LOGException(@"%@ (%@)",
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In -lockedHandleRequest:");
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In -lockedHandleRequest:");
LOGException(@"exception=%@",localException);
[_application awake];
_response=[_application handleException:localException
[application awake];
response=[application handleException:localException
inContext:nil];
[_application sleep];
[_response _finalizeInContext:_context];//DO Call _finalizeInContext: !
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
[application sleep];
[response _finalizeInContext:aContext];//DO Call _finalizeInContext: !
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
};
NS_ENDHANDLER;
if (!_exceptionRaised)
if (!exceptionRaised)
{
NSDebugMLLog(@"requests",@"_requestHandlerValues=%@",_requestHandlerValues);
_statisticsStore=[[GSWApplication application]statisticsStore];
NSDebugMLLog(@"requests",@"_statisticsStore=%@",_statisticsStore);
[_statisticsStore _applicationWillHandleComponentActionRequest];
_context=[GSWContext contextWithRequest:request_];
_senderID=[_requestHandlerValues objectForKey:GSWKey_ElementID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"AA _senderID=%@",_senderID);
[_context _setSenderID:_senderID];
[_application _setContext:_context];
NSDebugMLLog(@"requests",@"requestHandlerValues=%@",requestHandlerValues);
statisticsStore=[[GSWApplication application]statisticsStore];
NSDebugMLLog(@"requests",@"statisticsStore=%@",statisticsStore);
[statisticsStore _applicationWillHandleComponentActionRequest];
aContext=[GSWContext contextWithRequest:aRequest];
NSDebugMLLog(@"aContext",@"aContext=%@",aContext);
senderID=[requestHandlerValues objectForKey:GSWKey_ElementID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"AA senderID=%@",senderID);
[aContext _setSenderID:senderID];
[application _setContext:aContext];
//====>
NS_DURING
{
[_application awake];
_response=[self lockedDispatchWithPreparedApplication:_application
inContext:_context
elements:_requestHandlerValues];
[application awake];
response=[self lockedDispatchWithPreparedApplication:application
inContext:aContext
elements:requestHandlerValues];
}
NS_HANDLER
{
_exceptionRaised=YES;
exceptionRaised=YES;
LOGException(@"%@ (%@)",
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedDispatchWithPreparedApplication");
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In lockedDispatchWithPreparedApplication");
LOGException(@"exception=%@",localException);
_response=[_application handleException:localException
inContext:_context];
[_application sleep];
[_response _finalizeInContext:_context]; //DO Call _finalizeInContext: !
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
response=[application handleException:localException
inContext:aContext];
[application sleep];
[response _finalizeInContext:aContext]; //DO Call _finalizeInContext: !
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],
@"_finalizeInContext not called for GSWResponse");
};
NS_ENDHANDLER;
if (!_exceptionRaised)
if (!exceptionRaised)
{
NS_DURING
{
[_application sleep];
[_response _finalizeInContext:_context];//LAST //CLEAN
[application sleep];
[response _finalizeInContext:aContext];//LAST //CLEAN
}
NS_HANDLER
{
@ -130,271 +140,287 @@ static char rcsId[] = "$Id$";
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In [application sleep] or [_response _finalizeInContext:_context]");
@"In [application sleep] or [response _finalizeInContext:aContext]");
LOGException(@"exception=%@",localException);
_response=[_application handleException:localException
response=[application handleException:localException
inContext:nil];
[_response _finalizeInContext:_context]; //DO Call _finalizeInContext: !
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
[response _finalizeInContext:aContext]; //DO Call _finalizeInContext: !
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],
@"_finalizeInContext not called for GSWResponse");
};
NS_ENDHANDLER;
};
//<===========
};
[_application _setContext:nil];
_statisticsStore=[[GSWApplication application] statisticsStore];
[_statisticsStore _applicationDidHandleComponentActionRequest];
NSDebugMLLog(@"requests",@"_response=%@",_response);
[application _setContext:nil];
statisticsStore=[[GSWApplication application] statisticsStore];
[statisticsStore _applicationDidHandleComponentActionRequest];
NSDebugMLLog(@"requests",@"response=%@",response);
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)_application
inContext:(GSWContext*)_context
elements:(NSDictionary*)_elements
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)application
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements
{
//OK
GSWResponse* _response=nil;
GSWResponse* _errorResponse=nil;
GSWSession* _session=nil;
NSString* _sessionID=nil;
GSWResponse* response=nil;
GSWResponse* errorResponse=nil;
GSWSession* session=nil;
NSString* sessionID=nil;
LOGObjectFnStart();
NS_DURING
{
_sessionID=[_elements objectForKey:GSWKey_SessionID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"_sessionID=%@",_sessionID);
if (_sessionID)
sessionID=[elements objectForKey:GSWKey_SessionID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"sessionID=%@",sessionID);
if (sessionID)
{
_session=[_application restoreSessionWithID:_sessionID
inContext:_context];
if (!_session)
session=[application restoreSessionWithID:sessionID
inContext:aContext];
if (!session)
{
// check for refuseNewSessions
_errorResponse=[_application handleSessionRestorationErrorInContext:_context];
errorResponse=[application handleSessionRestorationErrorInContext:aContext];
};
}
else
{
// check for refuseNewSessions
_session=[_application _initializeSessionInContext:_context];
session=[application _initializeSessionInContext:aContext];
}
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore");
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"in session create/restore");
LOGException(@"exception=%@",localException);
_errorResponse=[_application handleException:localException
inContext:_context];
errorResponse=[application handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
if (!_response && !_errorResponse)
if (!response && !errorResponse)
{
if (_session)
if (session)
{
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"session=%@",session);
NS_DURING
{
_response=[self lockedDispatchWithPreparedSession:_session
inContext:_context
elements:_elements];
response=[self lockedDispatchWithPreparedSession:session
inContext:aContext
elements:elements];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in lockedDispatchWithPreparedSession");
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"in lockedDispatchWithPreparedSession");
LOGException(@"exception=%@",localException);
_errorResponse=[_application handleException:localException
inContext:_context];
errorResponse=[application handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
};
};
//======LAST //CLEAN
if (_response || _errorResponse)
if (response || errorResponse)
{
NSDebugMLLog(@"requests",@"_response=%@",_response);
NSDebugMLLog(@"requests",@"_errorResponse=%@",_errorResponse);
RETAIN(_response);
[_context _putAwakeComponentsToSleep];
[_application saveSessionForContext:_context];
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"_sessionCount=%u",[_session retainCount]);
NSDebugMLLog(@"requests",@"_response=%@",_response);
AUTORELEASE(_response);
NSDebugMLLog(@"requests",@"response=%@",response);
NSDebugMLLog(@"requests",@"errorResponse=%@",errorResponse);
RETAIN(response);
[aContext _putAwakeComponentsToSleep];
[application saveSessionForContext:aContext];
NSDebugMLLog(@"requests",@"session=%@",session);
NSDebugMLLog(@"requests",@"sessionCount=%u",[session retainCount]);
NSDebugMLLog(@"requests",@"response=%@",response);
AUTORELEASE(response);
};
LOGObjectFnStop();
return _response ? _response : _errorResponse;
return response ? response : errorResponse;
};
//--------------------------------------------------------------------
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)_session
inContext:(GSWContext*)_context
elements:(NSDictionary*)_elements
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)aSession
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements
{
//OK
GSWResponse* _errorResponse=nil;
GSWResponse* _response=nil;
GSWComponent* _page=nil;
BOOL _storesIDsInCookies=NO;
NSString* _contextID=nil;
GSWResponse* errorResponse=nil;
GSWResponse* response=nil;
GSWComponent* page=nil;
BOOL storesIDsInCookies=NO;
NSString* contextID=nil;
LOGObjectFnStart();
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"_context=%@",_context);
_storesIDsInCookies=[_session storesIDsInCookies]; //For What ?
NSDebugMLLog(@"requests",@"_storesIDsInCookies=%s",(_storesIDsInCookies ? "YES" : "NO"));
_contextID=[_elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
if (_contextID) // ??
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
NSDebugMLLog(@"requests",@"aContext=%@",aContext);
storesIDsInCookies=[aSession storesIDsInCookies]; //For What ?
NSDebugMLLog(@"requests",@"storesIDsInCookies=%s",(storesIDsInCookies ? "YES" : "NO"));
contextID=[elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
if (contextID) // ??
{
NSAssert([_contextID length]>0,@"contextID empty");
_page=[self lockedRestorePageForContextID:_contextID
inSession:_session];
NSAssert([contextID length]>0,@"contextID empty");
page=[self lockedRestorePageForContextID:contextID
inSession:aSession];
//??
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"_page=%@",_page);
if (!_page)
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
NSDebugMLLog(@"requests",@"page=%@",page);
if (!page)
{
GSWApplication* _application=[_session application];
_errorResponse=[_application handlePageRestorationErrorInContext:_context];
GSWApplication* application=[aSession application];
errorResponse=[application handlePageRestorationErrorInContext:aContext];
};
}
else
{
NSString* _pageName=[_elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
NSException* _exception=nil;
NSDebugMLLog(@"requests",@"_pageName=%@",_pageName);
NSString* pageName=[elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
NSException* exception=nil;
NSDebugMLLog(@"requests",@"pageName=%@",pageName);
NS_DURING
{
_page=[[GSWApplication application] pageWithName:_pageName
inContext:_context];
page=[[GSWApplication application] pageWithName:pageName
inContext:aContext];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In pageWithName");
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In pageWithName");
LOGException(@"exception=%@",localException);
ASSIGN(_exception,localException);
ASSIGN(exception,localException);
}
NS_ENDHANDLER;
if (!_page)
if (!page)
{
_errorResponse=[[GSWApplication application] handleException:_exception
inContext:_context];
errorResponse=[[GSWApplication application] handleException:exception
inContext:aContext];
};
DESTROY(_exception);
DESTROY(exception);
};
if (!_response && !_errorResponse && _page)
if (!response && !errorResponse && page)
{
[_context _setPageElement:_page];
_response=[self lockedDispatchWithPreparedPage:_page
inSession:_session
inContext:_context
elements:_elements];
[aContext _setPageElement:page];
response=[self lockedDispatchWithPreparedPage:page
inSession:aSession
inContext:aContext
elements:elements];
};
if (_response)
if (response)
{
BOOL _isPageRefreshOnBacktrackEnabled=[[GSWApplication application] isPageRefreshOnBacktrackEnabled];
BOOL isPageRefreshOnBacktrackEnabled=[[GSWApplication application] isPageRefreshOnBacktrackEnabled];
//TODO method adds a header to the HTTP response. This header sets the expiration date for an HTML page to the date and time of the creation of the page. Later, when the browser checks its cache for this page, it finds that the page is no longer valid and so refetches it by resubmitting the request URL to the WebObjects application.
[_session _saveCurrentPage];
[aSession _saveCurrentPage];
#if 0
if (!_contextID) // ??
if (!contextID) // ??
{
if (![_session storesIDsInCookies])//??
[_session clearCookieFromResponse:_response];
if (![aSession storesIDsInCookies])//??
[aSession clearCookieFromResponse:response];
};
#endif
};
NSDebugMLLog(@"requests",@"_response=%@",_response);
NSDebugMLLog(@"requests",@"response=%@",response);
LOGObjectFnStop();
return _response ? _response : _errorResponse;
return response ? response : errorResponse;
};
//--------------------------------------------------------------------
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)_component
inSession:(GSWSession*)_session
inContext:(GSWContext*)_context
elements:(NSDictionary*)_elements
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)aComponent
inSession:(GSWSession*)aSession
inContext:(GSWContext*)aContext
elements:(NSDictionary*)elements
{
//OK
GSWRequest* _request=nil;
GSWResponse* _response=nil;
GSWResponse* _errorResponse=nil;
NSString* _senderID=nil;
NSString* _contextID=nil;
NSString* _httpVersion=nil;
GSWElement* _page=nil;
GSWElement* _responsePage=nil;
BOOL _isFromClientComponent=NO;
BOOL _hasFormValues=NO;
GSWContext* _responseContext=nil;
GSWComponent* _responsePageElement=nil;
GSWRequest* _responseRequest=nil;
GSWRequest* request=nil;
GSWResponse* response=nil;
GSWResponse* errorResponse=nil;
NSString* senderID=nil;
NSString* contextID=nil;
NSString* httpVersion=nil;
GSWElement* page=nil;
GSWElement* responsePage=nil;
BOOL isFromClientComponent=NO;
BOOL hasFormValues=NO;
GSWContext* responseContext=nil;
GSWComponent* responsePageElement=nil;
GSWRequest* responseRequest=nil;
LOGObjectFnStart();
NSDebugMLLog(@"requests",@"_component=%@",_component);
_request=[_context request];
_contextID=[_elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
_response=[[GSWResponse new]autorelease];
NSDebugMLLog(@"requests",@"_response=%@",_response);
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"_context=%@",_context);
_senderID=[_context senderID];
NSDebugMLLog(@"requests",@"AA _senderID=%@",_senderID);
NSDebugMLLog(@"requests",@"aComponent=%@",aComponent);
request=[aContext request];
contextID=[elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
response=[[GSWResponse new]autorelease];
NSDebugMLLog(@"requests",@"response=%@",response);
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
NSDebugMLLog(@"requests",@"aContext=%@",aContext);
senderID=[aContext senderID];
NSDebugMLLog(@"requests",@"AA senderID=%@",senderID);
//TODO
{
GSWContext* _matchedContext=[_session _contextIDMatchingContextID:_contextID
requestSenderID:_senderID];
GSWContext* matchedContext=[aSession _contextIDMatchingContextID:contextID
requestSenderID:senderID];
}
_httpVersion=[_request httpVersion];
[_response setHTTPVersion:_httpVersion];
[_response setHeader:@"text/html"
httpVersion=[request httpVersion];
[response setHTTPVersion:httpVersion];
[response setHeader:@"text/html"
forKey:@"content-type"];
[_context _setResponse:_response];
_page=[_context page];
if (_contextID)//??
[aContext _setResponse:response];
page=[aContext page];
if (contextID)//??
{
_hasFormValues=[_request _hasFormValues];
hasFormValues=[request _hasFormValues];
}
else
{
[_context _setPageChanged:NO];
_isFromClientComponent=[_request isFromClientComponent];
[aContext _setPageChanged:NO];
isFromClientComponent=[request isFromClientComponent];
//??
[_context _setPageReplaced:NO];
_isFromClientComponent=[_request isFromClientComponent];
[aContext _setPageReplaced:NO];
isFromClientComponent=[request isFromClientComponent];
};
if (_hasFormValues)
if (hasFormValues)
{
NSDebugMLLog(@"requests",@"Before takeValues [_context elementID]=%@",[_context elementID]);
NSAssert([[_context elementID] length]==0,@"1 lockedDispatchWithPreparedPage elementID length>0");
[[GSWApplication application] takeValuesFromRequest:_request
inContext:_context];
NSDebugMLLog(@"requests",@"After takeValues[_context elementID]=%@",[_context elementID]);
if (![[_context elementID] length]==0)
NSDebugMLLog(@"requests",@"Before takeValues [aContext elementID]=%@",
[aContext elementID]);
NSAssert([[aContext elementID] length]==0,
@"1 lockedDispatchWithPreparedPage elementID length>0");
[[GSWApplication application] takeValuesFromRequest:request
inContext:aContext];
NSDebugMLLog(@"requests",@"After takeValues[aContext elementID]=%@",
[aContext elementID]);
if (![[aContext elementID] length]==0)
{
LOGSeriousError0(@"2 lockedDispatchWithPreparedPage elementID length>0");
[_context deleteAllElementIDComponents];//NDFN
[aContext deleteAllElementIDComponents];//NDFN
};
[_context _setPageChanged:NO];//???
_isFromClientComponent=[_request isFromClientComponent];
[_context _setPageReplaced:NO];
[aContext _setPageChanged:NO];//???
isFromClientComponent=[request isFromClientComponent];
[aContext _setPageReplaced:NO];
};
if (_senderID) //??
if (senderID) //??
{
BOOL _pageChanged=NO;
NSException* _exception=nil;
NSDebugMLLog(@"requests",@"Before invokeAction [_context elementID]=%@",[_context elementID]);
NSAssert([[_context elementID] length]==0,@"3 lockedDispatchWithPreparedPage elementID length>0");
BOOL pageChanged=NO;
NSException* exception=nil;
NSDebugMLLog(@"requests",@"Before invokeAction [aContext elementID]=%@",
[aContext elementID]);
NSAssert([[aContext elementID] length]==0,
@"3 lockedDispatchWithPreparedPage elementID length>0");
// Exception catching here ?
NS_DURING
{
_responsePage=[[GSWApplication application] invokeActionForRequest:_request
inContext:_context];
NSDebugMLLog(@"requests",@"After invokeAction [_context elementID]=%@",[_context elementID]);
NSAssert([[_context elementID] length]==0,@"4 lockedDispatchWithPreparedPage elementID length>0");
responsePage=[[GSWApplication application] invokeActionForRequest:request
inContext:aContext];
NSDebugMLLog(@"requests",@"After invokeAction [aContext elementID]=%@",[aContext elementID]);
NSAssert([[aContext elementID] length]==0,@"4 lockedDispatchWithPreparedPage elementID length>0");
}
NS_HANDLER
{
@ -402,92 +428,96 @@ static char rcsId[] = "$Id$";
LOGException(@"exception=%@",localException);
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"In invokeActionForRequest component=%@ of Class %@",
[_component name],
[_component class]);
[aComponent name],
[aComponent class]);
LOGException(@"exception=%@",localException);
ASSIGN(_exception,localException);
if (!_responsePage)
ASSIGN(exception,localException);
if (!responsePage)
{
_errorResponse=[[GSWApplication application] handleException:_exception
inContext:_context];
errorResponse=[[GSWApplication application] handleException:exception
inContext:aContext];
};
DESTROY(_exception);
DESTROY(exception);
}
NS_ENDHANDLER;
// [_context deleteAllElementIDComponents];//NDFN
NSDebugMLLog(@"requests",@"_responsePage=%@",_responsePage);
if (_errorResponse)
// [aContext deleteAllElementIDComponents];//NDFN
NSDebugMLLog(@"requests",@"responsePage=%@",responsePage);
if (errorResponse)
{
_response=_errorResponse;
_responseContext=_context;
response=errorResponse;
responseContext=aContext;
}
else
{
if (!_responsePage)
_responsePage=_page;
if (!responsePage)
responsePage=page;
_responseContext=[(GSWComponent*)_responsePage context];//So what ?
NSDebugMLLog(@"requests",@"_responseContext=%@",_responseContext);
[_responseContext _setPageReplaced:NO];
_responsePageElement=[_responseContext _pageElement];
NSDebugMLLog(@"requests",@"_responsePageElement=%@",_responsePageElement);
_pageChanged=(_responsePage!=_responsePageElement);
[_responseContext _setPageChanged:_pageChanged];//??
if (_pageChanged)
responseContext=[(GSWComponent*)responsePage context];//So what ?
NSDebugMLLog(@"requests",@"responseContext=%@",responseContext);
[responseContext _setPageReplaced:NO];
responsePageElement=[responseContext _pageElement];
NSDebugMLLog(@"requests",@"responsePageElement=%@",responsePageElement);
pageChanged=(responsePage!=responsePageElement);
[responseContext _setPageChanged:pageChanged];//??
if (pageChanged)
{
[_responseContext _setPageElement:_responsePage];
[responseContext _setPageElement:responsePage];
};
_responseRequest=[_responseContext request];//SoWhat ?
[_responseRequest isFromClientComponent];//SoWhat
responseRequest=[responseContext request];//SoWhat ?
[responseRequest isFromClientComponent];//SoWhat
};
}
else
{
_responseContext=_context;
_responsePageElement=_page;
_responsePage=_component;
_responseRequest=_request;
responseContext=aContext;
responsePageElement=page;
responsePage=aComponent;
responseRequest=request;
};
if (!_errorResponse)
if (!errorResponse)
{
NS_DURING
{
NSDebugMLLog(@"requests",@"_response before appendToResponse=%@",_response);
NSDebugMLLog(@"requests",@"_responseContext=%@",_responseContext);
NSAssert([[_context elementID] length]==0,@"5 lockedDispatchWithPreparedPage elementID length>0");
NSDebugMLLog(@"requests",@"Before appendToResponse [_context elementID]=%@",[_context elementID]);
[[GSWApplication application] appendToResponse:_response
inContext:_responseContext];
NSDebugMLLog(@"requests",@"After appendToResponse [_context elementID]=%@",[_context elementID]);
NSAssert([[_context elementID] length]==0,@"6 lockedDispatchWithPreparedPage elementID length>0");
_responseRequest=[_responseContext request];//SoWhat ?
[_responseRequest isFromClientComponent];//SoWhat
NSDebugMLLog(@"requests",@"response before appendToResponse=%@",response);
NSDebugMLLog(@"requests",@"responseContext=%@",responseContext);
NSAssert([[aContext elementID] length]==0,
@"5 lockedDispatchWithPreparedPage elementID length>0");
NSDebugMLLog(@"requests",@"Before appendToResponse [aContext elementID]=%@",
[aContext elementID]);
[[GSWApplication application] appendToResponse:response
inContext:responseContext];
NSDebugMLLog(@"requests",@"After appendToResponse [aContext elementID]=%@",
[aContext elementID]);
NSAssert([[aContext elementID] length]==0,
@"6 lockedDispatchWithPreparedPage elementID length>0");
responseRequest=[responseContext request];//SoWhat ?
[responseRequest isFromClientComponent];//SoWhat
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"In appendToResponse page=%@ of Class %@",
[_page name],
[_page class]);
[page name],
[page class]);
LOGException(@"exception=%@",localException);
NSDebugMLLog(@"requests",@"context=%@",_context);
_errorResponse=[[GSWApplication application] handleException:localException
inContext:_context];
NSDebugMLLog(@"requests",@"context=%@",aContext);
errorResponse=[[GSWApplication application] handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
};
NSDebugMLLog(@"requests",@"_response=%@",_response);
NSDebugMLLog(@"requests",@"response=%@",response);
LOGObjectFnStop();
return _errorResponse ? _errorResponse : _response;
return errorResponse ? errorResponse : response;
};
//--------------------------------------------------------------------
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)_contextID
inSession:(GSWSession*)_session
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)aContextID
inSession:(GSWSession*)aSession
{
//OK
GSWComponent* _page=[_session restorePageForContextID:_contextID];
return _page;
GSWComponent* page=[aSession restorePageForContextID:aContextID];
return page;
};
@end
@ -502,14 +532,14 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)request_
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)aRequest
{
//OK
NSDictionary* _values=nil;
NSDictionary* values=nil;
LOGClassFnStart();
NS_DURING
{
_values=[request_ uriOrFormOrCookiesElements];
values=[aRequest uriOrFormOrCookiesElements];
}
NS_HANDLER
{
@ -522,7 +552,7 @@ static char rcsId[] = "$Id$";
};
NS_ENDHANDLER;
LOGClassFnStop();
return _values;
return values;
};

View file

@ -1,11 +1,16 @@
/* GSWConstantValueAssociation.h - GSWeb: Class GSWConstantValueAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWConstantValueAssociation.h - <title>GSWeb: Class GSWConstantValueAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,18 +35,18 @@
//====================================================================
@interface GSWConstantValueAssociation:GSWAssociation
{
id value;
id _value;
};
-(id)initWithValue:(id)value_;
-(id)initWithValue:(id)aValue;
-(void)dealloc;
-(id)copyWithZone:(NSZone*)zone;
-(NSString*)debugDescription;
-(BOOL)isValueConstant;
-(BOOL)isValueSettable;
-(id)valueInObject:(id)object_;
-(void)setValue:(id)value_
inObject:(id)object_;
-(id)valueInObject:(id)object;
-(void)setValue:(id)aValue
inObject:(id)object;
-(NSString*)description;
@end

View file

@ -1,11 +1,16 @@
/* GSWConstantValueAssociation.m - GSWeb: Class GSWConstantValueAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWConstantValueAssociation.m - <title>GSWeb: Class GSWConstantValueAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,12 +35,12 @@ static char rcsId[] = "$Id$";
@implementation GSWConstantValueAssociation
//--------------------------------------------------------------------
-(id)initWithValue:(id)value_
-(id)initWithValue:(id)aValue
{
//OK
if ((self=[super init]))
{
ASSIGNCOPY(value,value_);
ASSIGNCOPY(_value,aValue);
};
return self;
};
@ -44,29 +50,29 @@ static char rcsId[] = "$Id$";
{
GSWLogMemC("GSWConstantValueAssociation start of dealloc");
GSWLogAssertGood(self);
DESTROY(value);
DESTROY(_value);
GSWLogMemC("value deallocated");
[super dealloc];
GSWLogMemC("GSWConstantValueAssociation end of dealloc");
};
//--------------------------------------------------------------------
-(id)copyWithZone:(NSZone*)zone;
-(id)copyWithZone:(NSZone*)zone
{
GSWConstantValueAssociation* clone = [super copyWithZone:zone];
ASSIGN(clone->value,value);
ASSIGN(clone->_value,_value);
return clone;
};
//--------------------------------------------------------------------
-(NSString*)debugDescription
{
NSString* _dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
NSString* dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
(void*)self,
value,
[value class]];
return _dscr;
_value,
[_value class]];
return dscr;
};
//--------------------------------------------------------------------
@ -82,34 +88,35 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(id)valueInObject:(id)object_
-(id)valueInObject:(id)object
{
[self logTakeValue:value];
return value;
[self logTakeValue:_value];
return _value;
};
//--------------------------------------------------------------------
-(void)setValue:(id)value_
inObject:(id)object_
-(void)setValue:(id)aValue
inObject:(id)object
{
ExceptionRaise0(@"GSWConstantValueAssociation",@"Can't set value for a constant value association");
ExceptionRaise0(@"GSWConstantValueAssociation",
@"Can't set value for a constant value association");
};
//--------------------------------------------------------------------
-(NSString*)description
{
NSString* _dscr=nil;
NSString* dscr=nil;
GSWLogAssertGood(self);
if (value)
if (_value)
{
GSWLogAssertGood(value);
GSWLogAssertGood(_value);
};
_dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
(void*)self,
value,
[value class]];
return _dscr;
_value,
[_value class]];
return dscr;
};
@end

View file

@ -1,11 +1,16 @@
/* debug.m - debug
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDebug.m - <title>GSWeb: Debug</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -80,23 +86,27 @@ NSString* objectDescription(id object)
if ([object respondsToSelector:@selector(description)])
{
NS_DURING
{
description=[object description];
}
NS_HANDLER
{
}
NS_ENDHANDLER;
};
return description;
};
//--------------------------------------------------------------------
NSString* IVarInString(const char* _type,void* _value)
NSString* IVarInString(const char* aType,void* aValue)
{
if (_type && _value)
if (aType && aValue)
{
switch (*_type)
switch (*aType)
{
case _C_ID:
{
id* pvalue=(id*)_value;
id* pvalue=(id*)aValue;
return [NSString stringWithFormat:@"object:%ld Class:%s Description:%@",
(long)(*pvalue),
[*pvalue class],
@ -105,98 +115,98 @@ NSString* IVarInString(const char* _type,void* _value)
break;
case _C_CLASS:
{
Class* pvalue=(Class*)_value;
Class* pvalue=(Class*)aValue;
return [NSString stringWithFormat:@"Class:%s",
class_get_class_name(*pvalue)];
};
break;
case _C_SEL:
{
SEL* pvalue=(SEL*)_value;
SEL* pvalue=(SEL*)aValue;
return [NSString stringWithFormat:@"SEL:%s",
sel_get_name(*pvalue)];
};
break;
case _C_CHR:
{
char* pvalue=(char*)_value;
char* pvalue=(char*)aValue;
return [NSString stringWithFormat:@"CHAR:%c",
*pvalue];
};
break;
case _C_UCHR:
{
unsigned char* pvalue=(unsigned char*)_value;
unsigned char* pvalue=(unsigned char*)aValue;
return [NSString stringWithFormat:@"UCHAR:%d",
(int)*pvalue];
};
break;
case _C_SHT:
{
short* pvalue=(short*)_value;
short* pvalue=(short*)aValue;
return [NSString stringWithFormat:@"SHORT:%d",
(int)*pvalue];
};
break;
case _C_USHT:
{
unsigned short* pvalue=(unsigned short*)_value;
unsigned short* pvalue=(unsigned short*)aValue;
return [NSString stringWithFormat:@"USHORT:%d",
(int)*pvalue];
};
break;
case _C_INT:
{
int* pvalue=(int*)_value;
int* pvalue=(int*)aValue;
return [NSString stringWithFormat:@"INT:%d",
*pvalue];
};
break;
case _C_UINT:
{
unsigned int* pvalue=(unsigned int*)_value;
unsigned int* pvalue=(unsigned int*)aValue;
return [NSString stringWithFormat:@"UINT:%u",
*pvalue];
};
break;
case _C_LNG:
{
long* pvalue=(long*)_value;
long* pvalue=(long*)aValue;
return [NSString stringWithFormat:@"LONG:%ld",
*pvalue];
};
break;
case _C_ULNG:
{
unsigned long* pvalue=(unsigned long*)_value;
unsigned long* pvalue=(unsigned long*)aValue;
return [NSString stringWithFormat:@"ULONG:%lu",
*pvalue];
};
break;
case _C_FLT:
{
float* pvalue=(float*)_value;
float* pvalue=(float*)aValue;
return [NSString stringWithFormat:@"FLOAT:%f",
(double)*pvalue];
};
break;
case _C_DBL:
{
double* pvalue=(double*)_value;
double* pvalue=(double*)aValue;
return [NSString stringWithFormat:@"DOUBLE:%f",
*pvalue];
};
break;
case _C_VOID:
{
void* pvalue=(void*)_value;
void* pvalue=(void*)aValue;
return [NSString stringWithFormat:@"VOID:*%lX",
(unsigned long)pvalue];
};
break;
case _C_CHARPTR:
{
char* pvalue=(void*)_value;
char* pvalue=(void*)aValue;
return [NSString stringWithFormat:@"CHAR*:%s",
pvalue];
};
@ -220,15 +230,15 @@ NSString* IVarInString(const char* _type,void* _value)
};
//--------------------------------------------------------------------
NSString* TypeToNSString(const char* _type)
NSString* TypeToNSString(const char* aType)
{
if (_type)
if (aType)
{
switch (*_type)
switch (*aType)
{
case _C_ID:
{ // '@'
const char *t = _type + 1;
const char *t = aType + 1;
if (*t == '"')
{
const char *start = t + 1;
@ -264,12 +274,12 @@ NSString* TypeToNSString(const char* _type)
case _C_CHARPTR: return @"char *";
case _C_PTR:
return [NSString stringWithFormat:@"%@ *",
TypeToNSString(_type + 1)];
TypeToNSString(aType + 1)];
break;
case _C_STRUCT_B:
{
NSString *structName = nil;
const char *t = _type + 1;
const char *t = aType + 1;
if (*t == '?')
structName = @"?";
@ -285,7 +295,7 @@ NSString* TypeToNSString(const char* _type)
};
default:
return [NSString stringWithFormat:@"%s", _type];
return [NSString stringWithFormat:@"%s", aType];
};
}
else

View file

@ -1,11 +1,18 @@
/* GSWDeployedBundle.h - GSWeb: Class GSWDeployedBundle
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDeployedBundle.h - <title>GSWeb: Class GSWDeployedBundle</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +26,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,50 +38,50 @@
//====================================================================
@interface GSWDeployedBundle : NSObject
{
NSString* bundlePath;
GSWMultiKeyDictionary* relativePathsCache;
NSRecursiveLock* selfLock;
NSString* _bundlePath;
GSWMultiKeyDictionary* _relativePathsCache;
NSRecursiveLock* _selfLock;
#ifndef NDEBUG
int selfLockn;
objc_thread_t selfLock_thread_id;
objc_thread_t creation_thread_id;
int _selfLockn;
objc_thread_t _selfLock_thread_id;
objc_thread_t _creation_thread_id;
#endif
};
-(void)dealloc;
-(NSString*)description;
-(id)initWithPath:(NSString*)path_;
-(id)initWithPath:(NSString*)aPath;
-(GSWProjectBundle*)projectBundle;
-(BOOL)isFramework;
-(NSString*)wrapperName;
-(NSString*)projectName;
-(NSString*)bundlePath;
-(NSArray*)pathsForResourcesOfType:(NSString*)type_;
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)type_;
-(NSString*)relativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_;
-(NSString*)relativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(NSString*)directory_
forLanguages:(NSArray*)languages_;
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(NSString*)directory_
forLanguage:(NSString*)language_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(NSString*)directory_
forLanguage:(NSString*)language_;
-(NSArray*)pathsForResourcesOfType:(NSString*)aType;
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)aType;
-(NSString*)relativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage;
-(NSString*)relativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(NSString*)aDirectory
forLanguages:(NSArray*)someLanguages;
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(NSString*)aDirectory
forLanguage:(NSString*)aLanguage;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(NSString*)aDirectory
forLanguage:(NSString*)aLanguage;
-(void)lock;
-(void)unlock;
@end
@interface GSWDeployedBundle (GSWDeployedBundleA)
+(GSWDeployedBundle*)bundleWithPath:(NSString*)path_;
+(GSWDeployedBundle*)bundleWithPath:(NSString*)aPath;
@end
#endif //_GSWDeployedBundle_h__

View file

@ -1,4 +1,5 @@
/** GSWDeployedBundle.m - <title>GSWeb: Class GSWDeployedBundle</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
@ -37,19 +38,19 @@ static char rcsId[] = "$Id$";
@implementation GSWDeployedBundle
//--------------------------------------------------------------------
-(id)initWithPath:(NSString*)path_
-(id)initWithPath:(NSString*)aPath
{
LOGObjectFnStart();
if ((self=[super init]))
{
NSDebugMLLog(@"bundles",@"path_=%@",path_);
ASSIGN(bundlePath,[path_ stringGoodPath]);
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
relativePathsCache=[GSWMultiKeyDictionary new];
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
ASSIGN(_bundlePath,[aPath stringGoodPath]);
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
_relativePathsCache=[GSWMultiKeyDictionary new];
#ifndef NDEBUG
creation_thread_id=objc_thread_id();
_creation_thread_id=objc_thread_id();
#endif
selfLock=[NSRecursiveLock new];
_selfLock=[NSRecursiveLock new];
/*
NSDebugMLog(@"selfLock->mutex=%p",(void*)selfLock->mutex);
NSDebugMLog(@"selfLock->mutex backend=%p",(void*)((pthread_mutex_t*)(selfLock->mutex->backend)));
@ -68,17 +69,17 @@ static char rcsId[] = "$Id$";
-(void)dealloc
{
NSDebugFLog(@"Dealloc GSWDeployedBundle %p",(void*)self);
DESTROY(bundlePath);
DESTROY(relativePathsCache);
DESTROY(_bundlePath);
DESTROY(_relativePathsCache);
GSWLogC("Dealloc GSWDeployedBundle: selfLock");
NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p creation_thread_id=%p",
(void*)selfLock,
selfLockn,
(void*)selfLock_thread_id,
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id(),
(void*)creation_thread_id);
(void*)_creation_thread_id);
fflush(stderr);
DESTROY(selfLock);
DESTROY(_selfLock);
GSWLogC("Dealloc GSWDeployedBundle Super");
[super dealloc];
NSDebugFLog(@"End Dealloc GSWDeployedBundle %p",(void*)self);
@ -94,10 +95,10 @@ static char rcsId[] = "$Id$";
(void*)self];
// GSWLogC("GSWDeployedBundle description B");
descr=[descr stringByAppendingFormat:@"bundlePath:%@ ",
bundlePath];
_bundlePath];
// GSWLogC("GSWDeployedBundle description C");
descr=[descr stringByAppendingFormat:@"relativePathsCache=%p>",
(void*)relativePathsCache];
(void*)_relativePathsCache];
// GSWLogC("GSWDeployedBundle description D");
return descr;
};
@ -106,41 +107,41 @@ static char rcsId[] = "$Id$";
-(GSWProjectBundle*)projectBundle
{
//OK
NSString* _projectName=nil;
BOOL _isFramework=NO;
GSWDeployedBundle* _projectBundle=nil;
NSString* projectName=nil;
BOOL isFramework=NO;
GSWDeployedBundle* projectBundle=nil;
LOGObjectFnStart();
_projectName=[self projectName];
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
_isFramework=[self isFramework];
NSDebugMLLog(@"bundles",@"_isFramework=%s",(_isFramework ? "YES" : "NO"));
_projectBundle=[GSWProjectBundle projectBundleForProjectNamed:_projectName
isFramework:_isFramework];
NSDebugMLLog(@"bundles",@"_projectBundle=%@",_projectBundle);
projectName=[self projectName];
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
isFramework=[self isFramework];
NSDebugMLLog(@"bundles",@"isFramework=%s",(isFramework ? "YES" : "NO"));
projectBundle=[GSWProjectBundle projectBundleForProjectNamed:projectName
isFramework:isFramework];
NSDebugMLLog(@"bundles",@"projectBundle=%@",projectBundle);
LOGObjectFnStop();
return (GSWProjectBundle*)_projectBundle;
return (GSWProjectBundle*)projectBundle;
};
//--------------------------------------------------------------------
-(BOOL)isFramework
{
//OK ??
return [bundlePath hasSuffix:GSFrameworkSuffix];
return [_bundlePath hasSuffix:GSFrameworkSuffix];
};
//--------------------------------------------------------------------
-(NSString*)wrapperName
{
//OK ?
NSString* _projectName=nil;
NSString* projectName=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
_projectName=[bundlePath lastPathComponent];
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
_projectName=[_projectName stringByDeletingPathExtension];
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
projectName=[_bundlePath lastPathComponent];
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
projectName=[projectName stringByDeletingPathExtension];
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
LOGObjectFnStop();
return _projectName;
return projectName;
};
//--------------------------------------------------------------------
@ -148,103 +149,106 @@ static char rcsId[] = "$Id$";
{
// H:\Wotests\ObjCTest3\ObjCTest3.gswa ==> ObjCTest3
//OK ?
NSString* _projectName=nil;
NSString* projectName=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"_gnustep_target_cpu=%@",[NSBundle _gnustep_target_cpu]);
NSDebugMLLog(@"bundles",@"_gnustep_target_dir=%@",[NSBundle _gnustep_target_dir]);
NSDebugMLLog(@"bundles",@"_gnustep_target_os=%@",[NSBundle _gnustep_target_os]);
NSDebugMLLog(@"bundles",@"_library_combo=%@",[NSBundle _library_combo]);
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
_projectName=[bundlePath lastPathComponent];
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
_projectName=[_projectName stringByDeletingPathExtension];
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
projectName=[_bundlePath lastPathComponent];
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
projectName=[projectName stringByDeletingPathExtension];
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
LOGObjectFnStop();
return _projectName;
return projectName;
};
//--------------------------------------------------------------------
-(NSString*)bundlePath
{
return bundlePath;
return _bundlePath;
};
//--------------------------------------------------------------------
-(NSArray*)pathsForResourcesOfType:(NSString*)type_
-(NSArray*)pathsForResourcesOfType:(NSString*)aType
{
//OK
NSArray* _paths=nil;
NSArray* paths=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"type_=%@ language_=%@",type_);
NSDebugMLLog(@"bundles",@"aType=%@",aType);
[self lock];
NS_DURING
{
_paths=[self lockedPathsForResourcesOfType:type_];
NSDebugMLLog(@"bundles",@"_paths=%@",_paths);
paths=[self lockedPathsForResourcesOfType:aType];
NSDebugMLLog(@"bundles",@"paths=%@",paths);
}
NS_HANDLER
{
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
localException,[localException reason]);
//TODO
[self unlock];
[localException raise];
};
NS_ENDHANDLER;
[self unlock];
return _paths;
return paths;
};
//--------------------------------------------------------------------
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)type_
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)aType
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(NSString*)relativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_
-(NSString*)relativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
[self lock];
NSDebugMLLog(@"bundles",@"name_=%@ language_=%@",name_,language_);
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
NS_DURING
{
_path=[self lockedRelativePathForResourceNamed:name_
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
path=[self lockedRelativePathForResourceNamed:aName
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
}
NS_HANDLER
{
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
localException,[localException reason]);
//TODO
[self unlock];
[localException raise];
};
NS_ENDHANDLER;
[self unlock];
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)relativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_
-(NSString*)relativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages
{
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ languages_=%@",name_,languages_);
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
[self lock];
NS_DURING
{
_path=[self lockedRelativePathForResourceNamed:name_
forLanguages:languages_];
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
path=[self lockedRelativePathForResourceNamed:aName
forLanguages:someLanguages];
//NSDebugMLLog(@"bundles",@"path=%@",path);
}
NS_HANDLER
{
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
localException,[localException reason]);
//TODO
[self unlock];
[localException raise];
@ -252,187 +256,188 @@ static char rcsId[] = "$Id$";
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ language_=%@",name_,language_);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources/WebServer"
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources"
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"."
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
};
};
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ languages_=%@",name_,languages_);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources/WebServer"
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
forLanguages:someLanguages];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources"
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
forLanguages:someLanguages];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"."
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
forLanguages:someLanguages];
NSDebugMLLog(@"bundles",@"path=%@",path);
};
};
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(id)directory_
forLanguages:(NSArray*)languages_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(id)aDirectory
forLanguages:(NSArray*)someLanguages
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ languages_=%@",name_,directory_,languages_);
if (languages_)
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ someLanguages=%@",aName,aDirectory,someLanguages);
if (someLanguages)
{
int i=0;
for(i=0;!_path && i<[languages_ count];i++)
for(i=0;!path && i<[someLanguages count];i++)
{
_path=[self lockedCachedRelativePathForResourceNamed:name_
inDirectory:directory_
forLanguage:[languages_ objectAtIndex:i]];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
path=[self lockedCachedRelativePathForResourceNamed:aName
inDirectory:aDirectory
forLanguage:[someLanguages objectAtIndex:i]];
NSDebugMLLog(@"bundles",@"path=%@",path);
};
};
if (!_path)
_path=[self lockedCachedRelativePathForResourceNamed:name_
inDirectory:directory_
if (!path)
path=[self lockedCachedRelativePathForResourceNamed:aName
inDirectory:aDirectory
forLanguage:nil];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
NSDebugMLLog(@"bundles",@"path=%@",path);
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(NSString*)directory_
forLanguage:(NSString*)language_
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(NSString*)aDirectory
forLanguage:(NSString*)aLanguage
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ language_=%@",name_,directory_,language_);
if (name_)
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
if (aName)
{
NSString* _emptyString=[NSString string];
NSString* _bundlePath=[self bundlePath];
NSArray* _keys;
if ([directory_ isEqualToString:@"."])
directory_=nil;
if (language_)
_keys=[NSArray arrayWithObjects:name_,
_bundlePath ? _bundlePath : _emptyString,
directory_ ? directory_ : _emptyString,
language_ ? language_ : _emptyString,
NSString* emptyString=[NSString string];
NSString* bundlePath=[self bundlePath];
NSArray* keys;
if ([aDirectory isEqualToString:@"."])
aDirectory=nil;
if (aLanguage)
keys=[NSArray arrayWithObjects:aName,
bundlePath ? bundlePath : emptyString,
aDirectory ? aDirectory : emptyString,
aLanguage ? aLanguage : emptyString,
nil];
else
_keys=[NSArray arrayWithObjects:name_,
_bundlePath ? _bundlePath : _emptyString,
directory_ ? directory_ : _emptyString,
keys=[NSArray arrayWithObjects:aName,
bundlePath ? bundlePath : emptyString,
aDirectory ? aDirectory : emptyString,
nil];
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
_path=[relativePathsCache objectForKeysArray:_keys];
path=[_relativePathsCache objectForKeysArray:keys];
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (_path==GSNotFoundMarker)
_path=nil;
if (!_path)
if (path==GSNotFoundMarker)
path=nil;
if (!path)
{
//call again _relativePathForResourceNamed:inDirectory:forLanguage:
NSString* _completePathTest=nil;
BOOL _exists=NO;
NSFileManager* _fileManager=nil;
NSString* _pathTest=[NSString string];
if (directory_)
_pathTest=[_pathTest stringByAppendingPathComponent:directory_];
NSString* completePathTest=nil;
BOOL exists=NO;
NSFileManager* fileManager=nil;
NSString* pathTest=[NSString string];
if (aDirectory)
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
if (language_)
_pathTest=[_pathTest stringByAppendingPathComponent:
[language_ stringByAppendingString:GSLanguagePSuffix]];
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
_pathTest=[_pathTest stringByAppendingPathComponent:name_];
NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
_completePathTest=[_bundlePath stringByAppendingPathComponent:_pathTest];
NSDebugMLLog(@"bundles",@"_completePathTest=%@",_completePathTest);
_fileManager=[NSFileManager defaultManager];
_exists=[_fileManager fileExistsAtPath:_completePathTest];
NSDebugMLLog(@"bundles",@"_exists=%s",(_exists ? "YES" : "NO"));
if (_exists)
if (aLanguage)
pathTest=[pathTest stringByAppendingPathComponent:
[aLanguage stringByAppendingString:GSLanguagePSuffix]];
//NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
pathTest=[pathTest stringByAppendingPathComponent:aName];
NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
completePathTest=[bundlePath stringByAppendingPathComponent:pathTest];
NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest);
fileManager=[NSFileManager defaultManager];
exists=[fileManager fileExistsAtPath:completePathTest];
NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO"));
if (exists)
{
_path=_pathTest;
[relativePathsCache setObject:_path
forKeysArray:_keys];
path=pathTest;
[_relativePathsCache setObject:path
forKeysArray:keys];
}
else
[relativePathsCache setObject:GSNotFoundMarker
forKeysArray:_keys];
[_relativePathsCache setObject:GSNotFoundMarker
forKeysArray:keys];
};
};
NSDebugMLLog(@"bundles",@"_path=%@",_path);
NSDebugMLLog(@"bundles",@"path=%@",path);
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
inDirectory:(NSString*)directory_
forLanguage:(NSString*)language_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
inDirectory:(NSString*)aDirectory
forLanguage:(NSString*)aLanguage
{
//OK
NSString* _path=nil;
NSString* path=nil;
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ language_=%@",name_,directory_,language_);
_path=[self lockedCachedRelativePathForResourceNamed:name_
inDirectory:directory_
forLanguage:language_];
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",
aName,aDirectory,aLanguage);
path=[self lockedCachedRelativePathForResourceNamed:aName
inDirectory:aDirectory
forLanguage:aLanguage];
LOGObjectFnStop();
return _path;
return path;
};
//--------------------------------------------------------------------
@ -441,26 +446,26 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
(void*)selfLock,
selfLockn,
(void*)selfLock_thread_id,
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
if (selfLockn>0)
if (_selfLockn>0)
{
if (selfLock_thread_id!=objc_thread_id())
if (_selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
#ifndef NDEBUG
selfLockn++;
selfLock_thread_id=objc_thread_id();
_selfLockn++;
_selfLock_thread_id=objc_thread_id();
#endif
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
selfLock,
selfLockn,
(void*)selfLock_thread_id,
_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
LOGObjectFnStop();
};
@ -471,27 +476,27 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
(void*)selfLock,
selfLockn,
(void*)selfLock_thread_id,
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
if (selfLockn>0)
if (_selfLockn>0)
{
if (selfLock_thread_id!=objc_thread_id())
if (_selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
TmpUnlock(selfLock);
TmpUnlock(_selfLock);
#ifndef NDEBUG
selfLockn--;
if (selfLockn==0)
selfLock_thread_id=NULL;
_selfLockn--;
if (_selfLockn==0)
_selfLock_thread_id=NULL;
#endif
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
(void*)selfLock,
selfLockn,
(void*)selfLock_thread_id,
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
LOGObjectFnStop();
};
@ -502,12 +507,12 @@ static char rcsId[] = "$Id$";
@implementation GSWDeployedBundle (GSWDeployedBundleA)
//--------------------------------------------------------------------
+(id)bundleWithPath:(NSString*)path_
+(id)bundleWithPath:(NSString*)aPath
{
id _bundle=nil;
NSDebugMLLog(@"bundles",@"path_=%@",path_);
_bundle=[[[GSWDeployedBundle alloc]initWithPath:path_]autorelease];
return _bundle;
id bundle=nil;
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
bundle=[[[GSWDeployedBundle alloc]initWithPath:aPath]autorelease];
return bundle;
};
@end

View file

@ -1,11 +1,16 @@
/* GSWDirectActionRequestHandler.h - GSWeb: Class GSWDirectActionRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDirectActionRequestHandler.h - <title>GSWeb: Class GSWDirectActionRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -31,10 +37,10 @@
{
};
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
-(GSWResponse*)_nilResponse;
-(void)_initializeRequestSessionIDInContext:(GSWContext*)context_;
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)_request;
-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext;
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)aRequest;
@end
//====================================================================

View file

@ -1,11 +1,16 @@
/* GSWDirectActionRequestHandler.m - GSWeb: Class GSWDirectActionRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDirectActionRequestHandler.m - <title>GSWeb: Class GSWDirectActionRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,96 +35,101 @@ static char rcsId[] = "$Id$";
@implementation GSWDirectActionRequestHandler
//--------------------------------------------------------------------
-(GSWResponse*)handleRequest:(GSWRequest*)request_
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
{
//OK
GSWResponse* _response=nil;
GSWStatisticsStore* _statisticsStore=nil;
GSWApplication* _application=nil;
GSWResponse* response=nil;
GSWStatisticsStore* statisticsStore=nil;
GSWApplication* application=nil;
LOGObjectFnStart();
_application=[GSWApplication application];
if (0/*[_application isRefusingNewSessions]*/)
application=[GSWApplication application];
if (0/*[application isRefusingNewSessions]*/)
{
//TODO
}
else
{
id _submitButtonsActionPathFromRequest=nil;
NSArray* _requestHandlerPathArray=nil;
NSString* _actionName=nil;
NSString* _className=nil;
GSWContext* _context=nil;
[_application lockRequestHandling];
id submitButtonsActionPathFromRequest=nil;
NSArray* requestHandlerPathArray=nil;
NSString* actionName=nil;
NSString* className=nil;
GSWContext* context=nil;
[application lockRequestHandling];
NS_DURING
{
NS_DURING
{
_statisticsStore=[[GSWApplication application]statisticsStore];
[_statisticsStore _applicationWillHandleDirectActionRequest];
_submitButtonsActionPathFromRequest=[self submitButtonsActionPathFromRequest:request_]; //So what ?
NSDebugMLLog(@"requests",@"_submitButtonsActionPathFromRequest=%@",_submitButtonsActionPathFromRequest);
_requestHandlerPathArray=[request_ requestHandlerPathArray];
NSDebugMLLog(@"requests",@"_requestHandlerPathArray=%@",_requestHandlerPathArray);
switch([_requestHandlerPathArray count])
statisticsStore=[[GSWApplication application]statisticsStore];
[statisticsStore _applicationWillHandleDirectActionRequest];
submitButtonsActionPathFromRequest=[self submitButtonsActionPathFromRequest:aRequest]; //So what ?
NSDebugMLLog(@"requests",@"submitButtonsActionPathFromRequest=%@",
submitButtonsActionPathFromRequest);
requestHandlerPathArray=[aRequest requestHandlerPathArray];
NSDebugMLLog(@"requests",@"requestHandlerPathArray=%@",
requestHandlerPathArray);
switch([requestHandlerPathArray count])
{
case 0:
_actionName=@"default";
_className=@"DirectAction";
actionName=@"default";
className=@"DirectAction";
break;
case 1:
{
NSString* _tmpActionName=[NSString stringWithFormat:@"%@Action",
[_requestHandlerPathArray objectAtIndex:0]];
SEL _tmpActionSel=NSSelectorFromString(_tmpActionName);
Class _class = NSClassFromString(@"DirectAction");
NSDebugMLLog(@"requests",@"_tmpActionName=%@",_tmpActionName);
if (_tmpActionSel && _class)
NSString* tmpActionName=[NSString stringWithFormat:@"%@Action",
[requestHandlerPathArray objectAtIndex:0]];
SEL tmpActionSel=NSSelectorFromString(tmpActionName);
Class aClass = NSClassFromString(@"DirectAction");
NSDebugMLLog(@"requests",@"tmpActionName=%@",
tmpActionName);
if (tmpActionSel && aClass)
{
if ([_class instancesRespondToSelector:_tmpActionSel])
if ([aClass instancesRespondToSelector:tmpActionSel])
{
_actionName=[_requestHandlerPathArray objectAtIndex:0];
_className=@"DirectAction";
actionName=[requestHandlerPathArray objectAtIndex:0];
className=@"DirectAction";
};
};
if (!_actionName)
if (!actionName)
{
_className=[_requestHandlerPathArray objectAtIndex:0];
_actionName=@"default";
className=[requestHandlerPathArray objectAtIndex:0];
actionName=@"default";
};
};
break;
case 2:
_className=[_requestHandlerPathArray objectAtIndex:0];
_actionName=[NSString stringWithFormat:@"%@",
[_requestHandlerPathArray objectAtIndex:1]];
className=[requestHandlerPathArray objectAtIndex:0];
actionName=[NSString stringWithFormat:@"%@",
[requestHandlerPathArray objectAtIndex:1]];
break;
default:
ExceptionRaise0(@"GSWDirectActionRequestHandler",@"bad parameters count");
break;
};
NSDebugMLLog(@"requests",@"_className=%@",_className);
NSDebugMLLog(@"requests",@"_actionName=%@",_actionName);
if ([_application isCachingEnabled])
NSDebugMLLog(@"requests",@"className=%@",className);
NSDebugMLLog(@"requests",@"actionName=%@",actionName);
if ([application isCachingEnabled])
{
//TODO
};
{
GSWResourceManager* _resourceManager=nil;
GSWDeployedBundle* _appBundle=nil;
GSWDirectAction* _directAction=nil;
id<GSWActionResults> _actionResult=nil;
Class _class=nil;
_resourceManager=[_application resourceManager];
_appBundle=[_resourceManager _appProjectBundle];
[_resourceManager _allFrameworkProjectBundles];//So what ?
[_application awake];
_class=NSClassFromString(_className);
NSAssert1(_class,@"No direct action class named %@",_className);
_directAction=[[_class alloc]initWithRequest:request_];
NSAssert1(_directAction,@"Direct action of class named %@ can't be created",_className);
_context=[_directAction _context];
_actionResult=[_directAction performActionNamed:_actionName];
_response=[_actionResult generateResponse];
GSWResourceManager* resourceManager=nil;
GSWDeployedBundle* appBundle=nil;
GSWDirectAction* directAction=nil;
id<GSWActionResults> actionResult=nil;
Class aClass=nil;
resourceManager=[application resourceManager];
appBundle=[resourceManager _appProjectBundle];
[resourceManager _allFrameworkProjectBundles];//So what ?
[application awake];
aClass=NSClassFromString(className);
NSAssert1(aClass,@"No direct action class named %@",
className);
directAction=[[aClass alloc]initWithRequest:aRequest];
NSAssert1(directAction,@"Direct action of class named %@ can't be created",
className);
context=[directAction _context];
actionResult=[directAction performActionNamed:actionName];
response=[actionResult generateResponse];
//Finir ?
};
@ -126,70 +137,70 @@ static char rcsId[] = "$Id$";
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
if (!_context)
_context=[GSWApp _context];
_response=[_application handleException:localException
inContext:_context];
if (!context)
context=[GSWApp _context];
response=[application handleException:localException
inContext:context];
//TODO
};
NS_ENDHANDLER;
NSDebugMLLog(@"requests",@"_response=%@",_response);
RETAIN(_response);
if (!_context)
_context=[GSWApp _context];
[_context _putAwakeComponentsToSleep];
[_application saveSessionForContext:_context];
NSDebugMLLog(@"requests",@"_response=%@",_response);
AUTORELEASE(_response);
NSDebugMLLog(@"requests",@"response=%@",response);
RETAIN(response);
if (!context)
context=[GSWApp _context];
[context _putAwakeComponentsToSleep];
[application saveSessionForContext:context];
NSDebugMLLog(@"requests",@"response=%@",response);
AUTORELEASE(response);
//Here ???
[_application sleep];
[application sleep];
//TODO do not fnalize if already done (in handleException for exemple)
[_response _finalizeInContext:_context];
[_application _setContext:nil];
_statisticsStore=[[GSWApplication application] statisticsStore];
[_statisticsStore _applicationDidHandleDirectActionRequestWithActionNamed:_actionName];
[response _finalizeInContext:context];
[application _setContext:nil];
statisticsStore=[[GSWApplication application] statisticsStore];
[statisticsStore _applicationDidHandleDirectActionRequestWithActionNamed:actionName];
}
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
[_application unlockRequestHandling];
[application unlockRequestHandling];
[localException raise];//TODO
};
NS_ENDHANDLER;
[_application unlockRequestHandling];
[application unlockRequestHandling];
};
LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(GSWResponse*)_nilResponse
{
//OK
GSWResponse* _response=nil;
GSWResponse* response=nil;
LOGObjectFnStart();
_response=[[GSWResponse new]autorelease];
[_response appendContentString:@"<HTML><HEAD><TITLE>DirectAction Error</TITLE></HEAD><BODY>The result of a direct action returned nothing.</BODY></HTML>"];
response=[[GSWResponse new]autorelease];
[response appendContentString:@"<HTML><HEAD><TITLE>DirectAction Error</TITLE></HEAD><BODY>The result of a direct action returned nothing.</BODY></HTML>"];
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(void)_initializeRequestSessionIDInContext:(GSWContext*)_context
-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)_request
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)aRequest
{
//OK
NSArray* _submitActions=nil;
NSArray* submitActions=nil;
LOGObjectFnStart();
_submitActions=[_request formValuesForKey:GSWKey_SubmitAction[GSWebNamingConv]];
if (_submitActions)
submitActions=[aRequest formValuesForKey:GSWKey_SubmitAction[GSWebNamingConv]];
if (submitActions)
{
//TODO
};

View file

@ -1,11 +1,16 @@
/* GSWDisplayGroup.h - GSWeb: Class GSWDisplayGroup
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDisplayGroup.h - <title>GSWeb: Class GSWDisplayGroup</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -27,7 +33,10 @@
#define _GSWDisplayGroup_h__
#if !GDL2
#ifndef TCSDB
#ifdef TCSDB
#import <TCSimpleDB/EODefines.h>
#import <TCSimpleDB/EODefines.h>
#else // TCSDB
#include <eoaccess/EOModel.h>
#include <eoaccess/EOEntity.h>
#include <eoaccess/EOAttribute.h>
@ -52,9 +61,6 @@
@class EOKeyValueUnarchiver;
#define EODataSource EODatabaseDataSource
#else // TCSDB
#import <TCSimpleDB/TCSimpleDB.h>
#import <TCSimpleDB/EODefines.h>
#endif
#else
#import <EOControl/EOQualifier.h>
@ -66,7 +72,7 @@
@interface GSWDisplayGroup : NSObject <NSCoding>
{
id delegate;
id _delegate;
/*
objects (array) supplied by the EODataSource
EOQualifier and EOSortOrderings to filter the objects for display
@ -149,17 +155,17 @@
- (unsigned)indexOfLastDisplayedObject;
- (id)init;
- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver*)unarchiver;
- (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver*)object_;
- (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver*)object;
- (NSMutableDictionary *)inputObjectForQualifier;
- (BOOL)inQueryMode;
- (void)editingContext:(id)editingContext_
- (void)editingContext:(id)editingContext
presentErrorMessage:(id)msg;
- (id)insert;
- (id)insertAfterLastObject;
- (NSDictionary *)insertedObjectDefaultValues;
- (void)insertObject:object_
- (void)insertObject:object
atIndex:(unsigned)index;
- (id)insertObjectAtIndex:(unsigned)index_;
- (id)insertObjectAtIndex:(unsigned)index;
- (EOQualifier *)lastQualifierFromInputValues;
- (NSArray *)localKeys;
- (id)masterObject;
@ -190,11 +196,11 @@
- (id)selectPrevious;
- (BOOL)selectsFirstObjectAfterFetch;
- (void)setBuildsQualifierFromInput:(BOOL)flag;
- (void)setCurrentBatchIndex:(unsigned)index_;
- (void)setDataSource:(EODataSource *)dataSource_;
- (void)setCurrentBatchIndex:(unsigned)index;
- (void)setDataSource:(EODataSource *)dataSource;
- (void)setDefaultStringMatchFormat:(NSString *)format;
- (void)setDefaultStringMatchOperator:(NSString *)operator;
- (void)setDelegate:(id)object_;
- (void)setDelegate:(id)object;
- (void)setDetailKey:(NSString *)detailKey;
- (void)setFetchesOnLoad:(BOOL)flag;
- (void)setInQueryMode:(BOOL)flag;
@ -204,7 +210,7 @@
- (void)setMasterObject:(id)masterObject;
- (void)setNumberOfObjectsPerBatch:(unsigned)count;
- (void)setObjectArray:(NSArray *)objects;
- (void)setQualifier:(EOQualifier *)qualifier_;
- (void)setQualifier:(EOQualifier *)qualifier;
- (BOOL)setSelectionIndexes:(NSArray *)selection;
- (void)setSelectsFirstObjectAfterFetch:(BOOL)flag;
- (void)setSortOrderings:(NSArray *)orderings;
@ -219,46 +225,46 @@
@interface NSObject (GSWDisplayGroupDelegation)
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
createObjectFailedForDataSource:(id)dataSource_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
createObjectFailedForDataSource:(id)dataSource;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didDeleteObject:(id)object_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
didDeleteObject:(id)object;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
didFetchObjects:(NSArray*)objects;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didInsertObject:object_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
didInsertObject:(id)object;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
didSetValue:(id)value
forObject:(id)object_
forObject:(id)object
key:(NSString*)key;
-(NSArray*)displayGroup:(GSWDisplayGroup*)displayGroup_
-(NSArray*)displayGroup:(GSWDisplayGroup*)displayGroup
displayArrayForObjects:(NSArray*)objects;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldChangeSelectionToIndexes:(NSArray*)newIndexes;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
shouldInsertObject:object_
atIndex:(unsigned)index_;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldInsertObject:object
atIndex:(unsigned)index;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldDeleteObject:object;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
shouldRedisplayForEditingContextChangeNotification:(NSNotification*)notification_;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldRedisplayForEditingContextChangeNotification:(NSNotification*)notification;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
shouldRefetchForInvalidatedAllObjectsNotification:(NSNotification*)notification_;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldRefetchForInvalidatedAllObjectsNotification:(NSNotification*)notification;
-(void)displayGroupDidChangeDataSource:(GSWDisplayGroup*)displayGroup_;
-(void)displayGroupDidChangeSelectedObjects:(GSWDisplayGroup*)displayGroup_;
-(void)displayGroupDidChangeSelection:(GSWDisplayGroup*)displayGroup_;
-(BOOL)displayGroupShouldFetch:(GSWDisplayGroup*)displayGroup_;
-(void)displayGroupDidChangeDataSource:(GSWDisplayGroup*)displayGroup;
-(void)displayGroupDidChangeSelectedObjects:(GSWDisplayGroup*)displayGroup;
-(void)displayGroupDidChangeSelection:(GSWDisplayGroup*)displayGroup;
-(BOOL)displayGroupShouldFetch:(GSWDisplayGroup*)displayGroup;
@end

View file

@ -1,12 +1,17 @@
/* GSWDisplayGroup.m - GSWeb: Class GSWDisplayGroup
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDisplayGroup.m - <title>GSWeb: Class GSWDisplayGroup</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Mirko Viviani <mirko.viviani@rccr.cremona.it>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +25,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -312,7 +318,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
return qualifier;
};
-(BOOL)_deleteObjectsAtIndexes:(id)indexes_
-(BOOL)_deleteObjectsAtIndexes:(id)indexes
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -321,7 +327,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
};
-(BOOL)_deleteObject:(id)object_
-(BOOL)_deleteObject:(id)object
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -338,7 +344,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
};
-(void)_lastObserverNotified:(id)object_
-(void)_lastObserverNotified:(id)object
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -346,7 +352,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
};
-(void)_beginObserverNotification:(id)object_
-(void)_beginObserverNotification:(id)object
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -362,7 +368,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
-(void)_notifyRowChanged:(int)row_
-(void)_notifyRowChanged:(int)row
{
LOGObjectFnStart();
//-1 ==> nil ?
@ -372,18 +378,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
-(id)_notify:(SEL)selector_
-(id)_notify:(SEL)selector
with:(id)object1
with:(id)object2
{
LOGObjectFnStart();
//TODOFN
if (selector_==@selector(displayGroup:didFetchObjects:)) //TODO ????
if (selector==@selector(displayGroup:didFetchObjects:)) //TODO ????
{
//Do it on object1
if(_delegateRespondsTo.didFetchObjects)
[delegate displayGroup:object1
[_delegate displayGroup:object1
didFetchObjects:object2];
}
else
@ -395,8 +401,8 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
};
-(id)_notify:(SEL)selector_
with:(id)object_
-(id)_notify:(SEL)selector
with:(id)object
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -422,7 +428,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
};
-(void)objectsChangedInEditingContext:(id)object_
-(void)objectsChangedInEditingContext:(id)object
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -436,7 +442,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart();
if(_delegateRespondsTo.shouldRedisplay == YES)
redisplay = [delegate displayGroup:self
redisplay = [_delegate displayGroup:self
shouldRedisplayForEditingContextChangeNotification:notification];
if(redisplay == YES)
@ -450,7 +456,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart();
if(_delegateRespondsTo.shouldRefetchObjects == YES)
refetch = [delegate displayGroup:self
refetch = [_delegate displayGroup:self
shouldRefetchForInvalidatedAllObjectsNotification:
notification];
@ -464,7 +470,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
delegate = nil;
_delegate = nil;
DESTROY(_dataSource);
@ -574,7 +580,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
//--------------------------------------------------------------------
// setDataSource:
- (void)setDataSource:(EODataSource *)dataSource_
- (void)setDataSource:(EODataSource *)dataSource
{
EOEditingContext *context=nil;
LOGObjectFnStart();
@ -587,7 +593,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[context setMessageHandler:nil];
}
ASSIGN(_dataSource, dataSource_);
ASSIGN(_dataSource,dataSource);
context = [_dataSource editingContext];
[context addEditor:self];
@ -597,7 +603,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[_displayedObjects removeAllObjects];
if(_delegateRespondsTo.didChangeDataSource == YES)
[delegate displayGroupDidChangeDataSource:self];
[_delegate displayGroupDidChangeDataSource:self];
LOGObjectFnStop();
}
@ -622,47 +628,47 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
- (id)delegate
{
return delegate;
return _delegate;
}
//--------------------------------------------------------------------
// setDelegate:
- (void)setDelegate:(id)delegate_
- (void)setDelegate:(id)delegate
{
LOGObjectFnStart();
delegate = delegate_;
_delegate = delegate;
_delegateRespondsTo.createObjectFailed =
[delegate respondsToSelector:@selector(displayGroup:createObjectFailedForDataSource:)];
[_delegate respondsToSelector:@selector(displayGroup:createObjectFailedForDataSource:)];
_delegateRespondsTo.didDeleteObject =
[delegate respondsToSelector:@selector(displayGroup:didDeleteObject:)];
[_delegate respondsToSelector:@selector(displayGroup:didDeleteObject:)];
_delegateRespondsTo.didFetchObjects =
[delegate respondsToSelector:@selector(displayGroup:didFetchObjects:)];
[_delegate respondsToSelector:@selector(displayGroup:didFetchObjects:)];
_delegateRespondsTo.didInsertObject =
[delegate respondsToSelector:@selector(displayGroup:didInsertObject:)];
[_delegate respondsToSelector:@selector(displayGroup:didInsertObject:)];
_delegateRespondsTo.didSetValueForObject =
[delegate respondsToSelector:@selector(displayGroup:didSetValue:forObject:key:)];
[_delegate respondsToSelector:@selector(displayGroup:didSetValue:forObject:key:)];
_delegateRespondsTo.displayArrayForObjects =
[delegate respondsToSelector:@selector(displayGroup:displayArrayForObjects:)];
[_delegate respondsToSelector:@selector(displayGroup:displayArrayForObjects:)];
_delegateRespondsTo.shouldChangeSelection =
[delegate respondsToSelector:@selector(displayGroup:shouldChangeSelectionToIndexes:)];
[_delegate respondsToSelector:@selector(displayGroup:shouldChangeSelectionToIndexes:)];
_delegateRespondsTo.shouldInsertObject =
[delegate respondsToSelector:@selector(displayGroup:shouldInsertObject:atIndex:)];
[_delegate respondsToSelector:@selector(displayGroup:shouldInsertObject:atIndex:)];
_delegateRespondsTo.shouldDeleteObject =
[delegate respondsToSelector:@selector(displayGroup:shouldDeleteObject:)];
[_delegate respondsToSelector:@selector(displayGroup:shouldDeleteObject:)];
_delegateRespondsTo.shouldRedisplay =
[delegate respondsToSelector:@selector(displayGroup:shouldRedisplayForEditingContextChangeNotification:)];
[_delegate respondsToSelector:@selector(displayGroup:shouldRedisplayForEditingContextChangeNotification:)];
_delegateRespondsTo.shouldRefetchObjects =
[delegate respondsToSelector:@selector(displayGroup:shouldRefetchForInvalidatedAllObjectsNotification:)];
[_delegate respondsToSelector:@selector(displayGroup:shouldRefetchForInvalidatedAllObjectsNotification:)];
_delegateRespondsTo.didChangeDataSource =
[delegate respondsToSelector:@selector(displayGroupDidChangeDataSource:)];
[_delegate respondsToSelector:@selector(displayGroupDidChangeDataSource:)];
_delegateRespondsTo.didChangeSelectedObjects =
[delegate respondsToSelector:@selector(displayGroupDidChangeSelectedObjects:)];
[_delegate respondsToSelector:@selector(displayGroupDidChangeSelectedObjects:)];
_delegateRespondsTo.didChangeSelection =
[delegate respondsToSelector:@selector(displayGroupDidChangeSelection:)];
[_delegate respondsToSelector:@selector(displayGroupDidChangeSelection:)];
_delegateRespondsTo.shouldFetchObjects =
[delegate respondsToSelector:@selector(displayGroupShouldFetch:)];
[_delegate respondsToSelector:@selector(displayGroupShouldFetch:)];
LOGObjectFnStop();
}
@ -689,7 +695,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
object = [_allObjects objectAtIndex:index];
if(_delegateRespondsTo.shouldDeleteObject == YES)
delete = [delegate displayGroup:self shouldDeleteObject:object];
delete = [_delegate displayGroup:self shouldDeleteObject:object];
if(delete)
{
@ -701,7 +707,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[_allObjects removeObjectIdenticalTo:object];
if(_delegateRespondsTo.didDeleteObject == YES)
[delegate displayGroup:self didDeleteObject:object];
[_delegate displayGroup:self didDeleteObject:object];
}
NS_HANDLER
{
@ -738,7 +744,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
while((object = [enumerator nextObject]))
{
if(_delegateRespondsTo.shouldDeleteObject == YES)
delete = [delegate displayGroup:self
delete = [_delegate displayGroup:self
shouldDeleteObject:object];
if(delete == NO)
@ -757,7 +763,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[_allObjects removeObjectIdenticalTo:object];
if(_delegateRespondsTo.didDeleteObject == YES)
[delegate displayGroup:self
[_delegate displayGroup:self
didDeleteObject:object];
}
}
@ -938,7 +944,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[_dataSource setQualifierBindings:_queryBindings];
if(_delegateRespondsTo.shouldFetchObjects == YES)
fetch = [delegate displayGroupShouldFetch:self];
fetch = [_delegate displayGroupShouldFetch:self];
if(fetch)
{
@ -1034,7 +1040,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
}
//--------------------------------------------------------------------
-(void)editingContext:(id)editingContext_
-(void)editingContext:(id)editingContext
presentErrorMessage:(id)msg
{
LOGObjectFnStart();
@ -1090,7 +1096,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
LOGObjectFnStart();
if(_delegateRespondsTo.shouldInsertObject == YES)
insert = [delegate displayGroup:self
insert = [_delegate displayGroup:self
shouldInsertObject:anObject
atIndex:index];
@ -1105,7 +1111,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
[self setCurrentBatchIndex:_batchIndex];
if(_delegateRespondsTo.didInsertObject == YES)
[delegate displayGroup:self
[_delegate displayGroup:self
didInsertObject:anObject];
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
@ -1127,7 +1133,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
if(object == nil)
{
if(_delegateRespondsTo.createObjectFailed == YES)
[delegate displayGroup:self
[_delegate displayGroup:self
createObjectFailedForDataSource:_dataSource];
}
else
@ -1660,20 +1666,20 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
//--------------------------------------------------------------------
// setCurrentBatchIndex:
- (void)setCurrentBatchIndex:(unsigned)index_
- (void)setCurrentBatchIndex:(unsigned)index
{
unsigned batchCount, num;
int i;
LOGObjectFnStart();
if(index_)
if(index)
{
[_displayedObjects removeAllObjects];
batchCount = [self batchCount];
NSLog(@"setCurrentBatchIndex : [self batchCount] = %d", [self batchCount]);
if(index_ > batchCount)
index_ = 1;
if(index > batchCount)
index = 1;
num = [_allObjects count];
NSLog(@"setCurrentBatchIndex : [_allObjects count] = %d", [_allObjects count]);
@ -1683,11 +1689,11 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
if(num)
{
NSLog(@"setCurrentBatchIndex : index_ = %d", index_);
NSLog(@"setCurrentBatchIndex : index = %d", index);
NSLog(@"setCurrentBatchIndex : num = %d", num);
for( i = (index_-1) * num;
((i < index_ * num) && (i < [_allObjects count]));
for( i = (index-1) * num;
((i < index * num) && (i < [_allObjects count]));
i++)
[_displayedObjects addObject:[_allObjects objectAtIndex:i]];
@ -1712,7 +1718,7 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
};
-(BOOL)_allowsNullForKey:(id)key_
-(BOOL)_allowsNullForKey:(id)key
{
LOGObjectFnStart();
LOGObjectFnNotImplemented(); //TODOFN
@ -1879,10 +1885,10 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
//--------------------------------------------------------------------
// setQualifier:
- (void)setQualifier:(EOQualifier *)qualifier_
- (void)setQualifier:(EOQualifier *)qualifier
{
LOGObjectFnStart();
ASSIGN(_qualifier, qualifier_);
ASSIGN(_qualifier, qualifier);
LOGObjectFnStop();
}
@ -1948,7 +1954,7 @@ STOP ?
LOGObjectFnStart();
//call selectedObjects //
if(_delegateRespondsTo.shouldChangeSelection == YES
&& [delegate displayGroup:self
&& [_delegate displayGroup:self
shouldChangeSelectionToIndexes:selection_] == NO)
retValue=NO;
else
@ -1983,10 +1989,10 @@ STOP ?
ASSIGN(_selection, selection_);
if(_delegateRespondsTo.didChangeSelection == YES)
[delegate displayGroupDidChangeSelection:self];
[_delegate displayGroupDidChangeSelection:self];
if(_delegateRespondsTo.didChangeSelectedObjects == YES)
[delegate displayGroupDidChangeSelectedObjects:self];
[_delegate displayGroupDidChangeSelectedObjects:self];
};
};
LOGObjectFnStop();
@ -2052,7 +2058,7 @@ STOP ?
if(_delegateRespondsTo.displayArrayForObjects == YES)
{
[_displayedObjects addObjectsFromArray:[delegate displayGroup:self
[_displayedObjects addObjectsFromArray:[_delegate displayGroup:self
displayArrayForObjects:_allObjects]];
}
else

View file

@ -1,11 +1,16 @@
/* GSWDynamicURLString.h - GSWeb: Class GSWDynamicURLString
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDynamicURLString.h - <title>GSWeb: Class GSWDynamicURLString</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,18 +36,18 @@
//====================================================================
@interface GSWDynamicURLString : NSObject <NSCoding,NSCopying/*,NSMutableString*/>
{
NSMutableString* url;
NSString* protocol;//NDFN
NSString* host;//NDFN
int port;//NDFN
NSString* prefix;
NSString* applicationName;
NSString* applicationNumberString;
NSString* requestHandlerKey;
NSString* queryString;
NSString* requestHandlerPath;
int applicationNumber;
BOOL composed;
NSMutableString* _url;
NSString* _protocol;//NDFN
NSString* _host;//NDFN
int _port;//NDFN
NSString* _prefix;
NSString* _applicationName;
NSString* _applicationNumberString;
NSString* _requestHandlerKey;
NSString* _queryString;
NSString* _requestHandlerPath;
int _applicationNumber;
BOOL _composed;
};
-(id)init;
@ -65,14 +71,14 @@
-(id)initWithContentsOfFile:(NSString*)path;
-(void)dealloc;
-(id)initWithCoder:(NSCoder*)coder_;
-(void)encodeWithCoder:(NSCoder*)coder_;
-(id)initWithCoder:(NSCoder*)coder;
-(void)encodeWithCoder:(NSCoder*)coder;
-(id)copyWithZone:(NSZone*)zone_;
-(id)copyWithZone:(NSZone*)zone;
-(NSString*)description;
-(void)forwardInvocation:(NSInvocation*)invocation_;
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector_;
-(void)forwardInvocation:(NSInvocation*)invocation;
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector;
@end
//====================================================================
@ -99,15 +105,15 @@
//====================================================================
@interface GSWDynamicURLString (GSWDynamicURLStringSet)
-(void)setURLRequestHandlerPath:(NSString*)string_;
-(void)setURLQueryString:(NSString*)string_;
-(void)setURLRequestHandlerKey:(NSString*)string_;
-(void)setURLApplicationNumber:(int)applicationNumber_;
-(void)setURLApplicationName:(NSString*)string_;
-(void)setURLPrefix:(NSString*)string_;
-(void)setURLProtocol:(NSString*)string_;//NDFN
-(void)setURLHost:(NSString*)string_;//NDFN
-(void)setURLPortString:(NSString*)string_;//NDFN
-(void)setURLRequestHandlerPath:(NSString*)aString;
-(void)setURLQueryString:(NSString*)aString;
-(void)setURLRequestHandlerKey:(NSString*)aString;
-(void)setURLApplicationNumber:(int)applicationNumber;
-(void)setURLApplicationName:(NSString*)aString;
-(void)setURLPrefix:(NSString*)aString;
-(void)setURLProtocol:(NSString*)aString;//NDFN
-(void)setURLHost:(NSString*)aString;//NDFN
-(void)setURLPortString:(NSString*)aString;//NDFN
-(void)setURLPort:(int)port_;//NDFN
@end

View file

@ -1,11 +1,16 @@
/* GSWDynamicURLString.m - GSWeb: Class GSWDynamicURLString
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWDynamicURLString.m - <title>GSWeb: Class GSWDynamicURLString</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -35,8 +41,8 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[NSMutableString new];
NSDebugMLLog(@"low",@"url class=%@",[url class]);
_url=[NSMutableString new];
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
};
LOGObjectFnStop();
return self;
@ -51,7 +57,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
_url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
length:length
freeWhenDone:flag];
if (chars)
@ -70,7 +76,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithCharacters:chars
_url=[[NSMutableString alloc]initWithCharacters:chars
length:length];
if (chars)
[self _parse];
@ -88,7 +94,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
_url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
length:length
freeWhenDone:flag];
if (byteString)
@ -106,14 +112,14 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithCString:byteString
_url=[[NSMutableString alloc]initWithCString:byteString
length:length];
NSDebugMLLog(@"low",@"url=%@",url);
NSDebugMLLog(@"low",@"url class=%@",[url class]);
NSDebugMLLog(@"low",@"url=%@",_url);
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
if (byteString)
[self _parse];
NSDebugMLLog(@"low",@"url=%@",url);
NSDebugMLLog(@"low",@"url class=%@",[url class]);
NSDebugMLLog(@"low",@"url=%@",_url);
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
};
LOGObjectFnStop();
return self;
@ -127,11 +133,11 @@ static char rcsId[] = "$Id$";
if ((self=[super init]))
{
NSDebugMLLog(@"low",@"byteString=%s",byteString);
url=[[NSMutableString alloc]initWithCString:byteString];
_url=[[NSMutableString alloc]initWithCString:byteString];
if (byteString)
[self _parse];
NSDebugMLLog(@"low",@"url=%@",url);
NSDebugMLLog(@"low",@"url class=%@",[url class]);
NSDebugMLLog(@"low",@"url=%@",_url);
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
};
LOGObjectFnStop();
return self;
@ -144,7 +150,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithString:string];
_url=[[NSMutableString alloc]initWithString:string];
if (string)
[self _parse];
};
@ -161,7 +167,7 @@ static char rcsId[] = "$Id$";
{
va_list ap;
va_start(ap,format);
url=[[NSMutableString alloc]initWithFormat:format
_url=[[NSMutableString alloc]initWithFormat:format
arguments:ap];
va_end(ap);
[self _parse];
@ -178,7 +184,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithFormat:format
_url=[[NSMutableString alloc]initWithFormat:format
arguments:argList];
[self _parse];
};
@ -194,7 +200,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithData:data
_url=[[NSMutableString alloc]initWithData:data
encoding:encoding];
if (data)
[self _parse];
@ -210,7 +216,7 @@ static char rcsId[] = "$Id$";
LOGObjectFnStart();
if ((self=[super init]))
{
url=[[NSMutableString alloc]initWithContentsOfFile:path];
_url=[[NSMutableString alloc]initWithContentsOfFile:path];
[self _parse];
};
LOGObjectFnStop();
@ -220,60 +226,60 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)dealloc
{
DESTROY(url);
DESTROY(prefix);
DESTROY(applicationName);
DESTROY(applicationNumberString);
DESTROY(requestHandlerKey);
DESTROY(queryString);
DESTROY(requestHandlerPath);
DESTROY(_url);
DESTROY(_prefix);
DESTROY(_applicationName);
DESTROY(_applicationNumberString);
DESTROY(_requestHandlerKey);
DESTROY(_queryString);
DESTROY(_requestHandlerPath);
[super dealloc];
};
//--------------------------------------------------------------------
-(id)initWithCoder:(NSCoder*)coder_
-(id)initWithCoder:(NSCoder*)coder
{
if ((self = [super initWithCoder:coder_]))
if ((self = [super initWithCoder:coder]))
{
[coder_ decodeValueOfObjCType:@encode(id)
at:&url];
composed=YES;
[coder decodeValueOfObjCType:@encode(id)
at:&_url];
_composed=YES;
[self _parse];
};
return self;
};
//--------------------------------------------------------------------
-(void)encodeWithCoder:(NSCoder*)coder_
-(void)encodeWithCoder:(NSCoder*)coder
{
[super encodeWithCoder: coder_];
[super encodeWithCoder:coder];
[self _compose];
[coder_ encodeObject:url];
[coder encodeObject:_url];
};
//--------------------------------------------------------------------
-(id)copyWithZone:(NSZone*)zone_
-(id)copyWithZone:(NSZone*)zone
{
GSWDynamicURLString* clone = nil;
LOGObjectFnStart();
NSDebugMLLog(@"low",@"url class=%@",[url class]);
clone=[[isa allocWithZone:zone_] init];
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
clone=[[isa allocWithZone:zone] init];
if (clone)
{
DESTROY(clone->url);
clone->url=[url mutableCopyWithZone:zone_];
NSDebugMLLog(@"low",@"clone->url class=%@",[clone->url class]);
ASSIGNCOPY(clone->protocol,protocol);
ASSIGNCOPY(clone->host,host);
clone->port=port;
ASSIGNCOPY(clone->prefix,prefix);
ASSIGNCOPY(clone->applicationName,applicationName);
ASSIGNCOPY(clone->applicationNumberString,applicationNumberString);
ASSIGNCOPY(clone->requestHandlerKey,requestHandlerKey);
ASSIGNCOPY(clone->queryString,queryString);
ASSIGNCOPY(clone->requestHandlerPath,requestHandlerPath);
clone->applicationNumber=applicationNumber;
clone->composed=composed;
DESTROY(clone->_url);
clone->_url=[_url mutableCopyWithZone:zone];
NSDebugMLLog(@"low",@"clone->_url class=%@",[clone->_url class]);
ASSIGNCOPY(clone->_protocol,_protocol);
ASSIGNCOPY(clone->_host,_host);
clone->_port=_port;
ASSIGNCOPY(clone->_prefix,_prefix);
ASSIGNCOPY(clone->_applicationName,_applicationName);
ASSIGNCOPY(clone->_applicationNumberString,_applicationNumberString);
ASSIGNCOPY(clone->_requestHandlerKey,_requestHandlerKey);
ASSIGNCOPY(clone->_queryString,_queryString);
ASSIGNCOPY(clone->_requestHandlerPath,_requestHandlerPath);
clone->_applicationNumber=_applicationNumber;
clone->_composed=_composed;
};
LOGObjectFnStop();
return clone;
@ -284,26 +290,26 @@ static char rcsId[] = "$Id$";
{
//OK
[self _compose];
return url;
return _url;
};
//--------------------------------------------------------------------
-(void)forwardInvocation:(NSInvocation*)invocation_
-(void)forwardInvocation:(NSInvocation*)invocation
{
NSString* _urlBackup=nil;
if (!composed)
NSString* urlBackup=nil;
if (!_composed)
[self _compose];
_urlBackup=[url copy];
[invocation_ invokeWithTarget:url];
if (![url isEqualToString:_urlBackup])
urlBackup=[_url copy];
[invocation invokeWithTarget:_url];
if (![_url isEqualToString:urlBackup])
[self _parse];
[_urlBackup release];
[urlBackup release];
};
//--------------------------------------------------------------------
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector_
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector
{
return [url methodSignatureForSelector:selector_];
return [_url methodSignatureForSelector:selector];
};
@end
@ -312,63 +318,65 @@ static char rcsId[] = "$Id$";
@implementation GSWDynamicURLString (GSWDynamicURLStringParsing)
-(void)_compose
{
if (!composed)
if (!_composed)
{
if (url)
if (_url)
{
int _length=[url length];
NSDebugMLLog(@"low",@"url %@ class=%@",url,[url class]);
if (_length>0)
[url deleteCharactersInRange:NSMakeRange(0,_length)];
int length=[_url length];
NSDebugMLLog(@"low",@"url %@ class=%@",_url,[_url class]);
if (length>0)
[_url deleteCharactersInRange:NSMakeRange(0,length)];
}
else
url=[NSMutableString new];
if (protocol)
_url=[NSMutableString new];
if (_protocol)
{
if (host)
[url appendFormat:@"%@://",protocol];
else if (port)
[url appendFormat:@"%@://localhost",protocol];
else if (prefix)
[url appendFormat:@"%@:/",protocol];
if (_host)
[_url appendFormat:@"%@://",_protocol];
else if (_port)
[_url appendFormat:@"%@://localhost",_protocol];
else if (_prefix)
[_url appendFormat:@"%@:/",_protocol];
else
[url appendFormat:@"%@://",protocol];
[_url appendFormat:@"%@://",_protocol];
};
if (host)
[url appendString:host];
if (port)
[url appendFormat:@":%d",port];
if (prefix)
[url appendFormat:@"%@/",prefix];
if (applicationName)
[url appendFormat:@"%@.%@/",applicationName,GSWApplicationSuffix[GSWebNamingConv]];
if (applicationNumber>=0)
[url appendFormat:@"%d/",applicationNumber];
if (requestHandlerKey)
[url appendFormat:@"%@/",requestHandlerKey];
if (requestHandlerPath)
[url appendFormat:@"%@",requestHandlerPath];
if (queryString)
[url appendFormat:@"?%@",queryString];
NSDebugMLLog(@"low",@"url %@ class=%@",url,[url class]);
if (_host)
[_url appendString:_host];
if (_port)
[_url appendFormat:@":%d",_port];
if (_prefix)
[_url appendFormat:@"%@/",_prefix];
if (_applicationName)
[_url appendFormat:@"%@.%@/",
_applicationName,
GSWApplicationSuffix[GSWebNamingConv]];
if (_applicationNumber>=0)
[_url appendFormat:@"%d/",_applicationNumber];
if (_requestHandlerKey)
[_url appendFormat:@"%@/",_requestHandlerKey];
if (_requestHandlerPath)
[_url appendFormat:@"%@",_requestHandlerPath];
if (_queryString)
[_url appendFormat:@"?%@",_queryString];
NSDebugMLLog(@"low",@"url %@ class=%@",_url,[_url class]);
};
};
//--------------------------------------------------------------------
-(void)_parse
{
DESTROY(prefix);
DESTROY(applicationName);
DESTROY(applicationNumberString);
DESTROY(requestHandlerKey);
DESTROY(queryString);
DESTROY(requestHandlerPath);
applicationNumber=-1;
composed=NO; //??
if (url)
DESTROY(_prefix);
DESTROY(_applicationName);
DESTROY(_applicationNumberString);
DESTROY(_requestHandlerKey);
DESTROY(_queryString);
DESTROY(_requestHandlerPath);
_applicationNumber=-1;
_composed=NO; //??
if (_url)
{
NSArray* _components=nil;
NSString* Left=url;
NSArray* components=nil;
NSString* Left=_url;
int index=0;
int tmpIndex=0;
NSRange protocolEndRange;
@ -377,19 +385,19 @@ static char rcsId[] = "$Id$";
{
if (queryStringStartRange.location+1<[Left length])
{
ASSIGN(queryString,[Left substringFromIndex:queryStringStartRange.location+queryStringStartRange.length]);
ASSIGN(_queryString,[Left substringFromIndex:queryStringStartRange.location+queryStringStartRange.length]);
};
Left=[Left substringToIndex:queryStringStartRange.location];
};
NSDebugMLLog(@"low",@"Left [%@]",Left);
NSDebugMLLog(@"low",@"queryString [%@]",queryString);
NSDebugMLLog(@"low",@"queryString [%@]",_queryString);
//Protocol
protocolEndRange=[Left rangeOfString:@"://"];
if (protocolEndRange.length>0)
{
ASSIGN(protocol,[Left substringToIndex:protocolEndRange.location]);
NSDebugMLLog(@"low",@"protocol [%@]",protocol);
ASSIGN(_protocol,[Left substringToIndex:protocolEndRange.location]);
NSDebugMLLog(@"low",@"protocol [%@]",_protocol);
if (protocolEndRange.location+protocolEndRange.length<[Left length])
Left=[Left substringFromIndex:protocolEndRange.location+protocolEndRange.length];
else
@ -401,8 +409,8 @@ static char rcsId[] = "$Id$";
NSRange hostEndRangePort=[Left rangeOfString:@":"];
if (hostEndRangePort.length>0)
{
ASSIGN(host,[Left substringToIndex:hostEndRangePort.location]);
NSDebugMLLog(@"low",@"host [%@]",host);
ASSIGN(_host,[Left substringToIndex:hostEndRangePort.location]);
NSDebugMLLog(@"low",@"host [%@]",_host);
if (hostEndRangePort.location+hostEndRangePort.length<[Left length])
Left=[Left substringFromIndex:hostEndRangePort.location+hostEndRangePort.length];
else
@ -415,8 +423,8 @@ static char rcsId[] = "$Id$";
{
NSString* portString=[Left substringToIndex:portEndRange.location];
NSDebugMLLog(@"low",@"portString [%@]",Left);
port=[portString intValue];
NSDebugMLLog(@"low",@"port [%d]",port);
_port=[portString intValue];
NSDebugMLLog(@"low",@"port [%d]",_port);
if (portEndRange.location+portEndRange.length<[Left length])
Left=[Left substringFromIndex:portEndRange.location+portEndRange.length-1]; //Keep the '/'
else
@ -425,8 +433,8 @@ static char rcsId[] = "$Id$";
}
else
{
port=[Left intValue];
NSDebugMLLog(@"low",@"port [%d]",port);
_port=[Left intValue];
NSDebugMLLog(@"low",@"port [%d]",_port);
Left=nil;
NSDebugMLLog(@"low",@"Left [%@]",Left);
};
@ -437,8 +445,8 @@ static char rcsId[] = "$Id$";
NSRange hostEndRangeSlash=[Left rangeOfString:@"/"];
if (hostEndRangeSlash.length>0)
{
ASSIGN(host,[Left substringToIndex:hostEndRangeSlash.location]);
NSDebugMLLog(@"low",@"host [%@]",host);
ASSIGN(_host,[Left substringToIndex:hostEndRangeSlash.location]);
NSDebugMLLog(@"low",@"host [%@]",_host);
if (hostEndRangeSlash.location+hostEndRangeSlash.length<[Left length])
Left=[Left substringFromIndex:hostEndRangeSlash.location+hostEndRangeSlash.length-1];//Keep the '/'
else
@ -447,8 +455,8 @@ static char rcsId[] = "$Id$";
}
else
{
ASSIGN(host,Left);
NSDebugMLLog(@"low",@"host [%@]",host);
ASSIGN(_host,Left);
NSDebugMLLog(@"low",@"host [%@]",_host);
Left=nil;
NSDebugMLLog(@"low",@"Left [%@]",Left);
};
@ -458,51 +466,41 @@ static char rcsId[] = "$Id$";
NSDebugMLLog(@"low",@"Left [%@]",Left);
//prefix
NSDebugMLLog(@"low",@"prefix: _components [%@]",_components);
_components=[Left componentsSeparatedByString:@"/"];
/*
for(tmpIndex=index;!prefix && tmpIndex<[_components count];tmpIndex++)
NSDebugMLLog(@"low",@"prefix: components [%@]",components);
components=[Left componentsSeparatedByString:@"/"];
for(tmpIndex=index;!_prefix && tmpIndex<[components count];tmpIndex++)
{
if ([[_components objectAtIndex:tmpIndex]hasPrefix:GSWURLPrefix])
{
ASSIGN(prefix,[[_components subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]componentsJoinedByString:@"/"]);
index=tmpIndex+1;
};
};
*/
for(tmpIndex=index;!prefix && tmpIndex<[_components count];tmpIndex++)
{
NSString* tmp=[_components objectAtIndex:tmpIndex];
NSString* tmp=[components objectAtIndex:tmpIndex];
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]]
|| [tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
{
if (tmpIndex-index>1)
{
ASSIGN(prefix,[[_components subarrayWithRange:NSMakeRange(index,tmpIndex-index)]componentsJoinedByString:@"/"]);
ASSIGN(_prefix,[[components subarrayWithRange:NSMakeRange(index,tmpIndex-index)]componentsJoinedByString:@"/"]);
index=tmpIndex;//Stay on ApplicationName !
};
};
};
if (!prefix)
if (!_prefix)
{
//TODO Erreur
NSDebugMLLog(@"low",@"No prefix in [%@]",url);
NSDebugMLLog(@"low",@"No prefix in [%@]",_url);
}
else
{
//applicationName
if (index>=[_components count])
if (index>=[components count])
{
//TODO Erreur
NSDebugMLLog(@"low",@"No applicationName in [%@]",url);
NSDebugMLLog(@"low",@"No applicationName in [%@]",_url);
}
else
{
NSDebugMLLog(@"low",@"applicationName: _components [%@]",
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
for(tmpIndex=index;!applicationName && tmpIndex<[_components count];tmpIndex++)
NSDebugMLLog(@"low",@"applicationName: components [%@]",
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
for(tmpIndex=index;!_applicationName && tmpIndex<[components count];tmpIndex++)
{
NSString* tmp=[_components objectAtIndex:tmpIndex];
NSString* tmp=[components objectAtIndex:tmpIndex];
NSString* appSuffix=nil;
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
appSuffix=GSWApplicationPSuffix[GSWNAMES_INDEX];
@ -510,46 +508,45 @@ static char rcsId[] = "$Id$";
appSuffix=GSWApplicationPSuffix[WONAMES_INDEX];
if (appSuffix)
{
ASSIGN(applicationName,[[[_components
subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]
ASSIGN(_applicationName,[[[components subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]
componentsJoinedByString:@"/"]
stringWithoutSuffix:appSuffix]);
index=tmpIndex+1;
};
};
if (!applicationName)
if (!_applicationName)
{
NSString* tmp=[[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]
NSString* tmp=[[components subarrayWithRange:NSMakeRange(index,[components count]-index)]
componentsJoinedByString:@"/"];
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]];
else if ([tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[WONAMES_INDEX]];
ASSIGN(applicationName,tmp);
index=[_components count];
ASSIGN(_applicationName,tmp);
index=[components count];
};
//Application Number
if (index<[_components count])
if (index<[components count])
{
NSDebugMLLog(@"low",@"applicationNumber: _components [%@]",
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
ASSIGN(applicationNumberString,[_components objectAtIndex:index]);
applicationNumber=[applicationNumberString intValue];
NSDebugMLLog(@"low",@"applicationNumber: components [%@]",
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
ASSIGN(_applicationNumberString,[components objectAtIndex:index]);
_applicationNumber=[_applicationNumberString intValue];
index++;
//requestHandlerKey
if (index<[_components count])
if (index<[components count])
{
NSDebugMLLog(@"low",@"requestHandlerKey: _components [%@]",
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
ASSIGN(requestHandlerKey,[_components objectAtIndex:index]);
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
ASSIGN(_requestHandlerKey,[components objectAtIndex:index]);
index++;
//requestHandlerPath
if (index<[_components count])
if (index<[components count])
{
NSDebugMLLog(@"low",@"requestHandlerPath: _components [%@]",
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
ASSIGN(requestHandlerPath,[[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]componentsJoinedByString:@"/"]);
NSDebugMLLog(@"low",@"requestHandlerPath: components [%@]",
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
ASSIGN(_requestHandlerPath,[[components subarrayWithRange:NSMakeRange(index,[components count]-index)]componentsJoinedByString:@"/"]);
index++;
};
};
@ -557,13 +554,13 @@ static char rcsId[] = "$Id$";
};
};
};
NSDebugMLLog(@"low",@"url=%@",url);
NSDebugMLLog(@"low",@"prefix=%@",prefix);
NSDebugMLLog(@"low",@"applicationName=%@",applicationName);
NSDebugMLLog(@"low",@"applicationNumberString=%@",applicationNumberString);
NSDebugMLLog(@"low",@"requestHandlerKey=%@",requestHandlerKey);
NSDebugMLLog(@"low",@"queryString=%@",queryString);
NSDebugMLLog(@"low",@"requestHandlerPath=%@",requestHandlerPath);
NSDebugMLLog(@"low",@"url=%@",_url);
NSDebugMLLog(@"low",@"prefix=%@",_prefix);
NSDebugMLLog(@"low",@"applicationName=%@",_applicationName);
NSDebugMLLog(@"low",@"applicationNumberString=%@",_applicationNumberString);
NSDebugMLLog(@"low",@"requestHandlerKey=%@",_requestHandlerKey);
NSDebugMLLog(@"low",@"queryString=%@",_queryString);
NSDebugMLLog(@"low",@"requestHandlerPath=%@",_requestHandlerPath);
};
@end
@ -581,37 +578,37 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(NSString*)urlRequestHandlerPath
{
return requestHandlerPath;
return _requestHandlerPath;
};
//--------------------------------------------------------------------
-(NSString*)urlQueryString
{
return queryString;
return _queryString;
};
//--------------------------------------------------------------------
-(NSString*)urlRequestHandlerKey
{
return requestHandlerKey;
return _requestHandlerKey;
};
//--------------------------------------------------------------------
-(int)urlApplicationNumber
{
return applicationNumber;
return _applicationNumber;
};
//--------------------------------------------------------------------
-(NSString*)urlApplicationName
{
return applicationName;
return _applicationName;
};
//--------------------------------------------------------------------
-(NSString*)urlPrefix
{
return prefix;
return _prefix;
};
//--------------------------------------------------------------------
@ -624,145 +621,145 @@ static char rcsId[] = "$Id$";
//NDFN
-(NSString*)urlProtocol
{
return protocol;
return _protocol;
};
//--------------------------------------------------------------------
//NDFN
-(NSString*)urlHost
{
return host;
return _host;
};
//--------------------------------------------------------------------
//NDFN
-(NSString*)urlPortString
{
return [NSString stringWithFormat:@"%d",port];
return [NSString stringWithFormat:@"%d",_port];
};
//--------------------------------------------------------------------
//NDFN
-(int)urlPort
{
return port;
return _port;
};
//--------------------------------------------------------------------
//NDFN
-(NSString*)urlProtocolHostPort
{
NSMutableString* _url=[NSMutableString string];
if (protocol)
NSMutableString* url=[NSMutableString string];
if (_protocol)
{
if (host)
[_url appendFormat:@"%@://",protocol];
else if (port)
[_url appendFormat:@"%@://localhost",protocol];
if (_host)
[url appendFormat:@"%@://",_protocol];
else if (_port)
[url appendFormat:@"%@://localhost",_protocol];
else
[_url appendFormat:@"%@://",protocol];
[url appendFormat:@"%@://",_protocol];
};
if (host)
[_url appendString:host];
if (port)
[_url appendFormat:@":%d",port];
return [NSString stringWithString:_url];
if (_host)
[url appendString:_host];
if (_port)
[url appendFormat:@":%d",_port];
return [NSString stringWithString:url];
};
@end
//====================================================================
@implementation GSWDynamicURLString (GSWDynamicURLStringSet)
-(void)setURLRequestHandlerPath:(NSString*)string_
-(void)setURLRequestHandlerPath:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(requestHandlerPath,string_);
composed=NO;
ASSIGN(_requestHandlerPath,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(void)setURLQueryString:(NSString*)string_
-(void)setURLQueryString:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(queryString,string_);
composed=NO;
ASSIGN(_queryString,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(void)setURLRequestHandlerKey:(NSString*)string_
-(void)setURLRequestHandlerKey:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(requestHandlerKey,string_);
composed=NO;
ASSIGN(_requestHandlerKey,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(void)setURLApplicationNumber:(int)applicationNumber_
-(void)setURLApplicationNumber:(int)applicationNumber
{
LOGObjectFnStart();
applicationNumber=applicationNumber_;
composed=NO;
_applicationNumber=applicationNumber;
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(void)setURLApplicationName:(NSString*)string_
-(void)setURLApplicationName:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(applicationName,string_);
composed=NO;
ASSIGN(_applicationName,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(void)setURLPrefix:(NSString*)string_
-(void)setURLPrefix:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(prefix,string_);
composed=NO;
ASSIGN(_prefix,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
//NDFN
-(void)setURLProtocol:(NSString*)string_
-(void)setURLProtocol:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(protocol,string_);
composed=NO;
ASSIGN(_protocol,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
//NDFN
-(void)setURLHost:(NSString*)string_
-(void)setURLHost:(NSString*)aString
{
LOGObjectFnStart();
ASSIGN(host,string_);
composed=NO;
ASSIGN(_host,aString);
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
//NDFN
-(void)setURLPortString:(NSString*)string_
-(void)setURLPortString:(NSString*)aString
{
LOGObjectFnStart();
port=[string_ intValue];
composed=NO;
_port=[aString intValue];
_composed=NO;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
//NDFN
-(void)setURLPort:(int)port_
-(void)setURLPort:(int)port
{
LOGObjectFnStart();
port=port_;
composed=NO;
_port=port;
_composed=NO;
LOGObjectFnStop();
};

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$

View file

@ -1,11 +1,16 @@
/* GSWEmbeddedObject.m - GSWeb: Class GSWEmbeddedObject
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWEmbeddedObject.m - <title>GSWeb: Class GSWEmbeddedObject</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -28,9 +34,9 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWEmbeddedObject
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
contentElements:(NSArray*)elements_
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
contentElements:(NSArray*)elements
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;

View file

@ -1,11 +1,16 @@
/* GSWGenericContainer.h - GSWeb: Class GSWGenericContainer
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWGenericContainer.h - <title>GSWeb: Class GSWGenericContainer</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,25 +36,25 @@
//====================================================================
@interface GSWGenericContainer: GSWDynamicElement
{
GSWAssociation* children;
NSDictionary *associations;
GSWElement* element;
GSWAssociation* _children;
NSDictionary* _associations;
GSWElement* _element;
};
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_;
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
template:(GSWElement*)templateElement;
-(void)dealloc;
-(NSString*)description;
-(void)appendToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
-(void)takeValuesFromRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
@end

View file

@ -1,11 +1,16 @@
/* GSWGenericContainer.m - GSWeb: Class GSWGenericContainer
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWGenericContainer.m - <title>GSWeb: Class GSWGenericContainer</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -28,21 +34,23 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWGenericContainer
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
template:(GSWElement*)templateElement
{
self = [super init];
associations=[associations_ retain];
element=[templateElement_ retain];
if ((self = [super init]))
{
ASSIGN(_associations,associations);
ASSIGN(_element,templateElement);
};
return self;
};
//--------------------------------------------------------------------
-(void)dealloc
{
[associations release];
[element release];
DESTROY(_associations);
DESTROY(_element);
[super dealloc];
};
@ -55,56 +63,55 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)appendToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
NSEnumerator *assocEnumer;
id currentAssocKey;
id component = [context_ component];
id theValue;
NSEnumerator *assocEnumer=nil;
id currentAssocKey=nil;
id component = [aContext component];
id theValue=nil;
id otherTag = nil;
id tag = [[associations objectForKey:@"elementName"] valueInComponent:component];
id tag = [[_associations objectForKey:@"elementName"] valueInComponent:component];
[response_ appendContentString:[NSString stringWithFormat:@"<%@",tag]];
[aResponse appendContentString:[NSString stringWithFormat:@"<%@",tag]];
if (otherTag = [[associations objectForKey:@"otherTagString"] valueInComponent:component]) {
[response_ appendContentString:[NSString stringWithFormat:@" %@",otherTag]];
if ((otherTag = [[_associations objectForKey:@"otherTagString"] valueInComponent:component]))
{
[aResponse appendContentString:[NSString stringWithFormat:@" %@",otherTag]];
}
assocEnumer = [associations keyEnumerator];
while (currentAssocKey = [assocEnumer nextObject]) {
theValue = [[associations objectForKey:currentAssocKey] valueInComponent:component];
if (([currentAssocKey isEqualToString:@"elementName"] == NO) && ([currentAssocKey isEqualToString:@"otherTagString"] == NO)) {
[response_ appendContentString:[NSString stringWithFormat:@" %@=\"%@\"",currentAssocKey,theValue]];
assocEnumer = [_associations keyEnumerator];
while ((currentAssocKey = [assocEnumer nextObject]))
{
theValue = [[_associations objectForKey:currentAssocKey] valueInComponent:component];
if (([currentAssocKey isEqualToString:@"elementName"] == NO)
&& ([currentAssocKey isEqualToString:@"otherTagString"] == NO))
{
[aResponse appendContentString:[NSString stringWithFormat:@" %@=\"%@\"",currentAssocKey,theValue]];
}
}
[response_ appendContentString:@">"];
[element appendToResponse:response_ inContext:context_];
[response_ appendContentString:[NSString stringWithFormat:@"</%@>",tag]];
[aResponse appendContentString:@">"];
[_element appendToResponse:aResponse inContext:aContext];
[aResponse appendContentString:[NSString stringWithFormat:@"</%@>",tag]];
};
//--------------------------------------------------------------------
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext
{
// LOGObjectFnNotImplemented(); //TODOFN
return [element invokeActionForRequest:request_ inContext:context_];
return [_element invokeActionForRequest:aRequest
inContext:aContext];
};
//--------------------------------------------------------------------
-(void)takeValuesFromRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext
{
// LOGObjectFnNotImplemented(); //TODOFN
return [element takeValuesFromRequest:request_ inContext:context_];
return [_element takeValuesFromRequest:aRequest
inContext:aContext];
};
//--------------------------------------------------------------------

View file

@ -1,12 +1,16 @@
/* GSWHTMLAttrParserExt.h - GSWeb: Class GSWPageElementParser: Categories
/** GSWHTMLAttrParserExt.h - <title>GSWeb: Class GSWHTMLAttrParserExt: Categories</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -32,9 +37,9 @@
-(NSString*)tagName;
-(NSDictionary*)attributes;
-(void)dealloc;
-(void)reportErrorWithException:(NSException*)_exception;
-(void)reportError:(NSString*)_text;
-(void)reportWarning:(NSString*)_text;
-(void)reportErrorWithException:(NSException*)exception;
-(void)reportError:(NSString*)text;
-(void)reportWarning:(NSString*)text;
-(BOOL)isError;
-(BOOL)isWarning;
-(NSArray*)errors;

View file

@ -1,12 +1,16 @@
/* GSWHTMLAttrParserExt.m - GSWeb: Class GSWHTMLAttrParser: Categories
/** GSWHTMLAttrParserExt.m - <title>GSWeb: Class GSWHTMLAttrParserExt: Categories</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -59,37 +64,37 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)reportErrorWithException:(NSException*)_exception
-(void)reportErrorWithException:(NSException*)exception
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[_exception description],
[_exception reason]];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[exception description],
[exception reason]];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportError:(NSString*)_text
-(void)reportError:(NSString*)text
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Error: %@",
_text];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Error: %@",
text];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportWarning:(NSString*)_text
-(void)reportWarning:(NSString*)text
{
NSString* _warning=nil;
NSString* warning=nil;
if (!warnings)
warnings=[NSMutableArray new];
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
_text];
[warnings addObject:_warning];
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
text];
[warnings addObject:warning];
};
//--------------------------------------------------------------------

View file

@ -1,12 +1,16 @@
/* GSWHTMLParserExt.h - GSWeb: Class GSWHTMLParser: Categories
/** GSWHTMLParserExt.h - <title>GSWeb: Class GSWHTMLParser: Categories</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,9 +35,9 @@
@interface GSWHTMLParser (GSWHTMLParserExt)
-(void)dealloc;
-(void)reportErrorWithException:(NSException*)_exception;
-(void)reportError:(NSString*)_text;
-(void)reportWarning:(NSString*)_text;
-(void)reportErrorWithException:(NSException*)exception;
-(void)reportError:(NSString*)text;
-(void)reportWarning:(NSString*)text;
-(BOOL)isError;
-(BOOL)isWarning;
-(NSArray*)errors;

View file

@ -1,12 +1,16 @@
/* GSWHTMLParserExt.m - GSWeb: Class GSWHTMLParser: Categories
/** GSWHTMLParserExt.m - <title>GSWeb: Class GSWHTMLParser: Categories</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -42,37 +47,37 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)reportErrorWithException:(NSException*)_exception
-(void)reportErrorWithException:(NSException*)exception
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[_exception description],
[_exception reason]];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[exception description],
[exception reason]];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportError:(NSString*)_text
-(void)reportError:(NSString*)text
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Error: %@",
_text];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Error: %@",
text];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportWarning:(NSString*)_text
-(void)reportWarning:(NSString*)text
{
NSString* _warning=nil;
NSString* warning=nil;
if (!warnings)
warnings=[NSMutableArray new];
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
_text];
[warnings addObject:_warning];
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
text];
[warnings addObject:warning];
};
//--------------------------------------------------------------------

View file

@ -1,11 +1,16 @@
/* GSWHTMLURLValuedElement.h - GSWeb: Class GSWHTMLURLValuedElement
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Apr 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,27 +35,27 @@
@interface GSWHTMLURLValuedElement: GSWHTMLDynamicElement
{
GSWAssociation* src;
GSWAssociation* value;
GSWAssociation* pageName;
GSWAssociation* _src;
GSWAssociation* _value;
GSWAssociation* _pageName;
//GSWeb Additions {
NSDictionary* pageSetVarAssociations;
GSWAssociation* pageSetVarAssociationsDynamic;
NSDictionary* _pageSetVarAssociations;
GSWAssociation* _pageSetVarAssociationsDynamic;
// }
GSWAssociation* filename;
GSWAssociation* framework;
GSWAssociation* data;
GSWAssociation* mimeType;
GSWAssociation* key;
GSWAssociation* actionClass;
GSWAssociation* directActionName;
GSWAssociation* queryDictionary;
NSDictionary* otherQueryAssociations;
GSWAssociation* _filename;
GSWAssociation* _framework;
GSWAssociation* _data;
GSWAssociation* _mimeType;
GSWAssociation* _key;
GSWAssociation* _actionClass;
GSWAssociation* _directActionName;
GSWAssociation* _queryDictionary;
NSDictionary* _otherQueryAssociations;
};
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
contentElements:(NSArray*)elements_;
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
contentElements:(NSArray*)elements;
-(void)dealloc;
-(NSString*)valueAttributeName;
@ -58,21 +64,21 @@
@end
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
@end
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementB)
//NDFN
-(void)appendURLToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)_appendCGIActionURLToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(id)computeActionStringInContext:(GSWContext*)context_;
-(id)computeQueryDictionaryInContext:(GSWContext*)context_;
-(NSString*)frameworkNameInContext:(GSWContext*)context_;
-(void)appendURLToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(void)_appendCGIActionURLToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(id)computeActionStringInContext:(GSWContext*)aContext;
-(id)computeQueryDictionaryInContext:(GSWContext*)aContext;
-(NSString*)frameworkNameInContext:(GSWContext*)aContext;
@end
#endif // _GSWHTMLURLValuedElement_h__

View file

@ -1,11 +1,16 @@
/* GSWHTMLURLValuedElement.m - GSWeb: Class GSWHTMLURLValuedElement
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Apr 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,91 +35,91 @@ static char rcsId[] = "$Id$";
@implementation GSWHTMLURLValuedElement
//--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
contentElements:(NSArray*)elements_
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)inAssociations
contentElements:(NSArray*)elements
{
NSString* _urlAttributeName=nil;
NSString* _valueAttributeName=nil;
NSMutableDictionary* _associations=nil;
NSString* urlAttributeName=nil;
NSString* valueAttributeName=nil;
NSMutableDictionary* associations=nil;
LOGObjectFnStartC("GSWHTMLURLValuedElement");
_urlAttributeName=[self urlAttributeName];//so what ?
_valueAttributeName=[self valueAttributeName];//so what ?
urlAttributeName=[self urlAttributeName];//so what ?
valueAttributeName=[self valueAttributeName];//so what ?
_associations=[NSMutableDictionary dictionaryWithDictionary:associations_];
associations=[NSMutableDictionary dictionaryWithDictionary:inAssociations];
src = [[associations_ objectForKey:src__Key
withDefaultObject:[src autorelease]] retain];
NSDebugMLLog(@"gswdync",@"src=%@",src);
_src = [[inAssociations objectForKey:src__Key
withDefaultObject:[_src autorelease]] retain];
NSDebugMLLog(@"gswdync",@"src=%@",_src);
value = [[associations_ objectForKey:value__Key
withDefaultObject:[value autorelease]] retain];
NSDebugMLLog(@"gswdync",@"value=%@",value);
_value = [[inAssociations objectForKey:value__Key
withDefaultObject:[_value autorelease]] retain];
NSDebugMLLog(@"gswdync",@"value=%@",_value);
pageName = [[associations_ objectForKey:pageName__Key
withDefaultObject:[pageName autorelease]] retain];
NSDebugMLLog(@"gswdync",@"pageName=%@",pageName);
_pageName = [[inAssociations objectForKey:pageName__Key
withDefaultObject:[_pageName autorelease]] retain];
NSDebugMLLog(@"gswdync",@"pageName=%@",_pageName);
filename = [[associations_ objectForKey:filename__Key
withDefaultObject:[filename autorelease]] retain];
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
_filename = [[inAssociations objectForKey:filename__Key
withDefaultObject:[_filename autorelease]] retain];
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
framework = [[associations_ objectForKey:framework__Key
withDefaultObject:[framework autorelease]] retain];
NSDebugMLLog(@"gswdync",@"framework=%@",framework);
_framework = [[inAssociations objectForKey:framework__Key
withDefaultObject:[_framework autorelease]] retain];
NSDebugMLLog(@"gswdync",@"framework=%@",_framework);
data = [[associations_ objectForKey:data__Key
withDefaultObject:[data autorelease]] retain];
NSDebugMLLog(@"gswdync",@"data=%@",data);
_data = [[inAssociations objectForKey:data__Key
withDefaultObject:[_data autorelease]] retain];
NSDebugMLLog(@"gswdync",@"data=%@",_data);
mimeType = [[associations_ objectForKey:mimeType__Key
withDefaultObject:[mimeType autorelease]] retain];
NSDebugMLLog(@"gswdync",@"mimeType=%@",mimeType);
_mimeType = [[inAssociations objectForKey:mimeType__Key
withDefaultObject:[_mimeType autorelease]] retain];
NSDebugMLLog(@"gswdync",@"mimeType=%@",_mimeType);
key = [[associations_ objectForKey:key__Key
withDefaultObject:[key autorelease]] retain];
NSDebugMLLog(@"gswdync",@"key=%@",key);
_key = [[inAssociations objectForKey:key__Key
withDefaultObject:[_key autorelease]] retain];
NSDebugMLLog(@"gswdync",@"key=%@",_key);
actionClass = [[associations_ objectForKey:actionClass__Key
withDefaultObject:[actionClass autorelease]] retain];
NSDebugMLLog(@"gswdync",@"actionClass=%@",actionClass);
_actionClass = [[inAssociations objectForKey:actionClass__Key
withDefaultObject:[_actionClass autorelease]] retain];
NSDebugMLLog(@"gswdync",@"actionClass=%@",_actionClass);
directActionName = [[associations_ objectForKey:directActionName__Key
withDefaultObject:[directActionName autorelease]] retain];
NSDebugMLLog(@"gswdync",@"directActionName=%@",directActionName);
_directActionName = [[inAssociations objectForKey:directActionName__Key
withDefaultObject:[_directActionName autorelease]] retain];
NSDebugMLLog(@"gswdync",@"directActionName=%@",_directActionName);
queryDictionary = [[associations_ objectForKey:queryDictionary__Key
withDefaultObject:[queryDictionary autorelease]] retain];
NSDebugMLLog(@"gswdync",@"queryDictionary=%@",queryDictionary);
_queryDictionary = [[inAssociations objectForKey:queryDictionary__Key
withDefaultObject:[_queryDictionary autorelease]] retain];
NSDebugMLLog(@"gswdync",@"queryDictionary=%@",_queryDictionary);
[_associations removeObjectForKey:src__Key];
[_associations removeObjectForKey:value__Key];
[_associations removeObjectForKey:pageName__Key];
[_associations removeObjectForKey:filename__Key];
[_associations removeObjectForKey:framework__Key];
[_associations removeObjectForKey:data__Key];
[_associations removeObjectForKey:mimeType__Key];
[_associations removeObjectForKey:key__Key];
[_associations removeObjectForKey:actionClass__Key];
[_associations removeObjectForKey:directActionName__Key];
[_associations removeObjectForKey:queryDictionary__Key];
[associations removeObjectForKey:src__Key];
[associations removeObjectForKey:value__Key];
[associations removeObjectForKey:pageName__Key];
[associations removeObjectForKey:filename__Key];
[associations removeObjectForKey:framework__Key];
[associations removeObjectForKey:data__Key];
[associations removeObjectForKey:mimeType__Key];
[associations removeObjectForKey:key__Key];
[associations removeObjectForKey:actionClass__Key];
[associations removeObjectForKey:directActionName__Key];
[associations removeObjectForKey:queryDictionary__Key];
if (!WOStrictFlag)
{
//pageSetVarAssociations//GNUstepWeb only
NSDictionary* _pageSetVarAssociations=[associations_ associationsWithoutPrefix:pageSetVar__Prefix__Key
removeFrom:_associations];
if ([_pageSetVarAssociations count]>0)
pageSetVarAssociations=[_pageSetVarAssociations retain];
pageSetVarAssociationsDynamic=[[associations_ objectForKey:pageSetVars__Key
withDefaultObject:[pageSetVarAssociationsDynamic autorelease]] retain];
NSDebugMLLog(@"gswdync",@"pageSetVarAssociationsDynamic=%@",pageSetVarAssociationsDynamic);
[_associations removeObjectForKey:pageSetVars__Key];
NSDictionary* pageSetVarAssociations=[inAssociations associationsWithoutPrefix:pageSetVar__Prefix__Key
removeFrom:associations];
if ([pageSetVarAssociations count]>0)
{
ASSIGN(_pageSetVarAssociations,pageSetVarAssociations);
};
_pageSetVarAssociationsDynamic=[[inAssociations objectForKey:pageSetVars__Key
withDefaultObject:[_pageSetVarAssociationsDynamic autorelease]] retain];
NSDebugMLLog(@"gswdync",@"_pageSetVarAssociationsDynamic=%@",_pageSetVarAssociationsDynamic);
[associations removeObjectForKey:pageSetVars__Key];
};
if ((self=[super initWithName:[self elementName]//NEW
attributeAssociations:_associations
contentElements:elements_]))
attributeAssociations:associations
contentElements:elements]))
{
};
LOGObjectFnStopC("GSWHTMLURLValuedElement");
@ -123,20 +129,20 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)dealloc
{
DESTROY(src);
DESTROY(value);
DESTROY(pageName);
DESTROY(pageSetVarAssociations);//GNUstepWeb only
DESTROY(pageSetVarAssociationsDynamic);//GSWeb only
DESTROY(filename);
DESTROY(framework);
DESTROY(data);
DESTROY(mimeType);
DESTROY(key);
DESTROY(actionClass);
DESTROY(directActionName);
DESTROY(queryDictionary);
DESTROY(otherQueryAssociations);
DESTROY(_src);
DESTROY(_value);
DESTROY(_pageName);
DESTROY(_pageSetVarAssociations);//GNUstepWeb only
DESTROY(_pageSetVarAssociationsDynamic);//GSWeb only
DESTROY(_filename);
DESTROY(_framework);
DESTROY(_data);
DESTROY(_mimeType);
DESTROY(_key);
DESTROY(_actionClass);
DESTROY(_directActionName);
DESTROY(_queryDictionary);
DESTROY(_otherQueryAssociations);
[super dealloc];
}
@ -168,76 +174,76 @@ static char rcsId[] = "$Id$";
@implementation GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
//--------------------------------------------------------------------
-(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;
LOGObjectFnStartC("GSWHTMLURLValuedElement");
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
_senderID=[context_ senderID];
_elementID=[context_ elementID];
NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID);
NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID);
NSDebugMLLog(@"gswdync",@"[_elementID isEqualToString:_senderID]=%d",(int)[_elementID isEqualToString:_senderID]);
if ([_elementID isEqualToString:_senderID])
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[aContext elementID]);
senderID=[aContext senderID];
elementID=[aContext elementID];
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
NSDebugMLLog(@"gswdync",@"[elementID isEqualToString:senderID]=%d",(int)[elementID isEqualToString:senderID]);
if ([elementID isEqualToString:senderID])
{
GSWComponent* _component=[context_ component];
if (value)
_element=[value valueInComponent:_component];
else if (pageName)
GSWComponent* component=[aContext component];
if (_value)
element=[_value valueInComponent:component];
else if (_pageName)
{
NSString* _pageNameValue=[pageName valueInComponent:_component];
_element=[GSWApp pageWithName:_pageNameValue
inContext:context_];
if (!WOStrictFlag && _element)//GNUstepWeb only
NSString* pageNameValue=[_pageName valueInComponent:component];
element=[GSWApp pageWithName:pageNameValue
inContext:aContext];
if (!WOStrictFlag && element)//GNUstepWeb only
{
if (pageSetVarAssociations)
if (_pageSetVarAssociations)
{
[pageSetVarAssociations associationsSetValuesFromObject:_component
inObject:(GSWComponent*)_element];
[_pageSetVarAssociations associationsSetValuesFromObject:component
inObject:(GSWComponent*)element];
};
if (pageSetVarAssociationsDynamic)
if (_pageSetVarAssociationsDynamic)
{
NSDictionary* _assocs=[pageSetVarAssociationsDynamic valueInComponent:_component];
if (_assocs)
NSDictionary* assocs=[_pageSetVarAssociationsDynamic valueInComponent:component];
if (assocs)
{
if (![_assocs isKindOfClass:[NSDictionary class]])
if (![assocs isKindOfClass:[NSDictionary class]])
{
ExceptionRaise(@"GSWHTMLURLValuedElement",@"%@ (%@) must return a Dictionary, not a %@ like %@",
pageSetVars__Key,
pageSetVarAssociationsDynamic,
[_assocs class],
_assocs);
_pageSetVarAssociationsDynamic,
[assocs class],
assocs);
}
else
{
[_assocs associationsSetValuesFromObject:_component
inObject:(GSWComponent*)_element];
[assocs associationsSetValuesFromObject:component
inObject:(GSWComponent*)element];
};
};
};
};
};
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke element=%@",element);
//the end ?
//TODOV
if (!_element)
_element=[context_ page];
if (!element)
element=[aContext page];
}
else
{
_element=[super invokeActionForRequest:request_
inContext:context_];
element=[super invokeActionForRequest:aRequest
inContext:aContext];
};
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke element=%@",element);
NSDebugMLLog(@"gswdync",@"senderID=%@",[aContext senderID]);
NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[aContext elementID]);
LOGObjectFnStopC("GSWHTMLURLValuedElement");
return _element;
return element;
};
@ -246,146 +252,146 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
//NDFN
-(void)appendURLToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)appendURLToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
//OK
NSString* _urlAttributeName=nil;
NSString* _url=nil;
GSWComponent* _component=nil;
NSString* _keyValue=nil;
id _data=nil;
id _mimeTypeValue=nil;
GSWURLValuedElementData* _dataValue=nil;
GSWResourceManager* _resourceManager=nil;
NSString* urlAttributeName=nil;
NSString* url=nil;
GSWComponent* component=nil;
NSString* keyValue=nil;
id data=nil;
id mimeTypeValue=nil;
GSWURLValuedElementData* dataValue=nil;
GSWResourceManager* resourceManager=nil;
LOGObjectFnStartC("GSWHTMLURLValuedElement");
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
_component=[context_ component];
NSDebugMLLog(@"gswdync",@"data=%@",data);
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
NSDebugMLLog(@"gswdync",@"pageName=%@",pageName);
_resourceManager=[[GSWApplication application]resourceManager];
if (src)
_url=[src valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
component=[aContext component];
NSDebugMLLog(@"gswdync",@"data=%@",_data);
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
NSDebugMLLog(@"gswdync",@"pageName=%@",_pageName);
resourceManager=[[GSWApplication application]resourceManager];
if (_src)
url=[_src valueInComponent:component];
else
{
if (key)
if (_key)
{
_keyValue=[key valueInComponent:_component];
_dataValue=[_resourceManager _cachedDataForKey:_keyValue];
keyValue=[_key valueInComponent:component];
dataValue=[resourceManager _cachedDataForKey:keyValue];
};
if (!_dataValue && data)
if (!dataValue && _data)
{
_data=[data valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"_data=%@",_data);
_mimeTypeValue=[mimeType valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"mimeType=%@",mimeType);
NSDebugMLLog(@"gswdync",@"_mimeTypeValue=%@",_mimeTypeValue);
_dataValue=[[[GSWURLValuedElementData alloc] initWithData:_data
mimeType:_mimeTypeValue
data=[_data valueInComponent:component];
NSDebugMLLog(@"gswdync",@"_data=%@",data);
mimeTypeValue=[_mimeType valueInComponent:component];
NSDebugMLLog(@"gswdync",@"mimeType=%@",_mimeType);
NSDebugMLLog(@"gswdync",@"mimeTypeValue=%@",mimeTypeValue);
dataValue=[[[GSWURLValuedElementData alloc] initWithData:data
mimeType:mimeTypeValue
key:nil] autorelease];
NSDebugMLLog(@"gswdync",@"_dataValue=%@",_dataValue);
[_resourceManager setURLValuedElementData:_dataValue];
NSDebugMLLog(@"gswdync",@"dataValue=%@",dataValue);
[resourceManager setURLValuedElementData:dataValue];
}
else if (filename)
else if (_filename)
{
//Exemple: Body with filename
id _filenameValue=nil;
id _frameworkValue=nil;
GSWRequest* _request=nil;
NSArray* _languages=nil;
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
_filenameValue=[filename valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"_filenameValue=%@",_filenameValue);
_frameworkValue=[self frameworkNameInContext:context_];
NSDebugMLLog(@"gswdync",@"_frameworkValue=%@",_frameworkValue);
_request=[context_ request];
_languages=[context_ languages];
_url=[_resourceManager urlForResourceNamed:_filenameValue
inFramework:_frameworkValue
languages:_languages
request:_request];
id filenameValue=nil;
id frameworkValue=nil;
GSWRequest* request=nil;
NSArray* languages=nil;
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
filenameValue=[_filename valueInComponent:component];
NSDebugMLLog(@"gswdync",@"filenameValue=%@",filenameValue);
frameworkValue=[self frameworkNameInContext:aContext];
NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue);
request=[aContext request];
languages=[aContext languages];
url=[resourceManager urlForResourceNamed:filenameValue
inFramework:frameworkValue
languages:languages
request:request];
};
};
[response_ appendContentCharacter:' '];
_urlAttributeName=[self urlAttributeName];
if (_urlAttributeName)
[aResponse appendContentCharacter:' '];
urlAttributeName=[self urlAttributeName];
if (urlAttributeName)
{
[response_ _appendContentAsciiString:_urlAttributeName];
[response_ _appendContentAsciiString:@"=\""];
[aResponse _appendContentAsciiString:urlAttributeName];
[aResponse _appendContentAsciiString:@"=\""];
};
if (src)
if (_src)
{
[response_ appendContentString:_url];
[aResponse appendContentString:url];
}
else
{
if (key || data)
if (_key || _data)
{
[_dataValue appendDataURLToResponse:response_
inContext:context_];
[dataValue appendDataURLToResponse:aResponse
inContext:aContext];
}
else if (filename)
else if (_filename)
{
NSDebugMLLog(@"gswdync",@"_url = %@",_url);
[response_ appendContentString:_url];
NSDebugMLLog(@"gswdync",@"url = %@",url);
[aResponse appendContentString:url];
}
else
{
GSWDynamicURLString* _componentActionURL=[context_ componentActionURL];
NSDebugMLLog(@"gswdync",@"_componentActionURL=%@",_componentActionURL);
[response_ appendContentString:(NSString*)_componentActionURL];
GSWDynamicURLString* componentActionURL=[aContext componentActionURL];
NSDebugMLLog(@"gswdync",@"componentActionURL=%@",componentActionURL);
[aResponse appendContentString:(NSString*)componentActionURL];
};
};
if (_urlAttributeName)
[response_ appendContentCharacter:'"'];
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
if (urlAttributeName)
[aResponse appendContentCharacter:'"'];
NSDebugMLLog(@"gswdync",@"_elementID=%@",[aContext elementID]);
LOGObjectFnStopC("GSWHTMLURLValuedElement");
};
//--------------------------------------------------------------------
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
//OK
LOGObjectFnStartC("GSWHTMLURLValuedElement");
[self appendURLToResponse:response_
inContext:context_];
[self appendURLToResponse:aResponse
inContext:aContext];
LOGObjectFnStopC("GSWHTMLURLValuedElement");
};
//--------------------------------------------------------------------
-(void)_appendCGIActionURLToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)_appendCGIActionURLToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(id)computeActionStringInContext:(GSWContext*)context_
-(id)computeActionStringInContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(id)computeQueryDictionaryInContext:(GSWContext*)context_
-(id)computeQueryDictionaryInContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(NSString*)frameworkNameInContext:(GSWContext*)context_
-(NSString*)frameworkNameInContext:(GSWContext*)aContext
{
//OK
NSString* _frameworkName=nil;
GSWComponent* _component=[context_ component];
NSDebugMLog(@"framework=%@",framework);
if (framework)
_frameworkName=[framework valueInComponent:_component];
NSString* frameworkName=nil;
GSWComponent* component=[aContext component];
NSDebugMLog(@"framework=%@",_framework);
if (_framework)
frameworkName=[_framework valueInComponent:component];
else
_frameworkName=[_component frameworkName];
return _frameworkName;
frameworkName=[component frameworkName];
return frameworkName;
};
@end

View file

@ -1,11 +1,16 @@
/* GSWKeyValueAssociation.h - GSWeb: Class GSWKeyValueAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWKeyValueAssociation.h - <title>GSWeb: Class GSWKeyValueAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,16 +35,16 @@
//====================================================================
@interface GSWKeyValueAssociation : GSWAssociation
{
NSString* keyPath;
NSString* _keyPath;
}
-(id)initWithKeyPath:(NSString*)keypath_;
-(id)initWithKeyPath:(NSString*)aKeyPath;
-(void)dealloc;
-(id)copyWithZone:(NSZone*)zone;
-(id)valueInObject:(id)object_;
-(void)setValue:(id)value_
inObject:(id)object_;
-(id)valueInObject:(id)object;
-(void)setValue:(id)aValue
inObject:(id)object;
-(BOOL)isValueConstant;
-(BOOL)isValueSettable;

View file

@ -1,11 +1,16 @@
/* GSWKeyValueAssociation.m - GSWeb: Class GSWKeyValueAssociation
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWKeyValueAssociation.m - <title>GSWeb: Class GSWKeyValueAssociation</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,12 +35,12 @@ static char rcsId[] = "$Id$";
@implementation GSWKeyValueAssociation
//--------------------------------------------------------------------
-(id)initWithKeyPath:(NSString*)keyPath_
-(id)initWithKeyPath:(NSString*)aKeyPath
{
//OK
if ((self=[super init]))
{
ASSIGNCOPY(keyPath,keyPath_);
ASSIGNCOPY(_keyPath,aKeyPath);
};
return self;
};
@ -44,30 +50,30 @@ static char rcsId[] = "$Id$";
{
GSWLogMemC("GSWKeyValueAssociation start of dealloc");
GSWLogAssertGood(self);
DESTROY(keyPath);
DESTROY(_keyPath);
GSWLogMemC("keyPath deallocated");
[super dealloc];
GSWLogMemC("GSWKeyValueAssociation end of dealloc");
};
//--------------------------------------------------------------------
-(id)copyWithZone:(NSZone*)zone;
-(id)copyWithZone:(NSZone*)zone
{
GSWKeyValueAssociation* clone = [super copyWithZone:zone];
ASSIGN(clone->keyPath,keyPath);
ASSIGN(clone->_keyPath,_keyPath);
return clone;
};
//--------------------------------------------------------------------
-(id)valueInObject:(id)object_
-(id)valueInObject:(id)object
{
id retValue=nil;
LOGObjectFnStart();
NSDebugMLLog(@"associations",@"self=%@ ",self);
NSDebugMLLog(@"associations",@"keyPath=%@ ",keyPath);
NSDebugMLLog(@"associations",@"object_=%@ ", object_);
retValue=[GSWAssociation valueInObject:object_
forKeyPath:keyPath];
NSDebugMLLog(@"associations",@"keyPath=%@ ",_keyPath);
NSDebugMLLog(@"associations",@"object=%@ ", object);
retValue=[GSWAssociation valueInObject:object
forKeyPath:_keyPath];
NSDebugMLLog(@"associations",@"self=%@ retValue=%@ (%p) (class=%@)",
self,
retValue,
@ -79,24 +85,25 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)setValue:(id)value_
inObject:(id)object_
-(void)setValue:(id)aValue
inObject:(id)object
{
LOGObjectFnStart();
NSDebugMLLog(@"associations",@"keyPath=%@ ",keyPath);
NSDebugMLLog(@"associations",@"GSWAssociation: setValue:%@ (self=%@)",value_,self);
if (value_) {
NSDebugMLLog(@"associations",@"value_ class:%@",NSStringFromClass([value_ class]));
NSDebugMLLog(@"associations",@"keyPath=%@ ",_keyPath);
NSDebugMLLog(@"associations",@"GSWAssociation: setValue:%@ (self=%@)",aValue,self);
if (aValue)
{
NSDebugMLLog(@"associations",@"value_ class:%@",NSStringFromClass([aValue class]));
}
/*Not Here because self is not a string key !
//TODO (return something!)
[object_ validateValue:&value_
[object validateValue:&aValue
forKey:self];
*/
[GSWAssociation setValue:value_
inObject:object_
forKeyPath:keyPath];
[self logSetValue:value_];
[GSWAssociation setValue:aValue
inObject:object
forKeyPath:_keyPath];
[self logSetValue:aValue];
LOGObjectFnStop();
};
@ -121,7 +128,7 @@ static char rcsId[] = "$Id$";
object_get_class_name(self),
(void*)self];
dscr=[dscr stringByAppendingFormat:@" keyPath=%@>",
keyPath];
_keyPath];
return dscr;
};
@ -133,7 +140,7 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(NSString*)keyPath
{
return keyPath;
return _keyPath;
};
//--------------------------------------------------------------------

View file

@ -1,11 +1,16 @@
/* GSWMultiKeyDictionary.h - GSWeb: Class GSWMultiKeyDictionary
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWMultiKeyDictionary.h - <title>GSWeb: Class GSWMultiKeyDictionary</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,35 +36,35 @@
//==============================================================================
@interface GSWMultiKeyDictionary : NSObject
{
NSMutableDictionary* dict;
NSMutableDictionary* _dict;
};
+(id)dictionary;
-(id)init;
-(id)initWithCapacity:(unsigned int)capacity_;
-(id)initWithCapacity:(unsigned int)capacity;
-(void)dealloc;
-(NSString*)description;
-(NSEnumerator*)objectEnumerator;
-(void)removeAllObjects;
-(void)setObject:(id)object_
forKeys:(id)keys_,...;
-(id)objectForKeys:(id)keys_,...;
-(void)setObject:(id)object
forKeys:(id)keys,...;
-(id)objectForKeys:(id)keys,...;
-(void)setObject:(id)object_
forKeysArray:(NSArray*)keys_;
-(id)objectForKeysArray:(NSArray*)keys_;
-(void)setObject:(id)object
forKeysArray:(NSArray*)keys;
-(id)objectForKeysArray:(NSArray*)keys;
-(NSArray*)allValues;
-(NSArray*)allKeys;
-(NSArray*)objectsForKeysArrays:(NSArray*)keys_
notFoundMarker:(id)notFoundMarker_;
-(void)makeObjectsPerformSelector:(SEL)selector_;
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object_;
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object1_
withObject:(id)object2_;
-(NSArray*)objectsForKeysArrays:(NSArray*)keys
notFoundMarker:(id)notFoundMarker;
-(void)makeObjectsPerformSelector:(SEL)selector;
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object;
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object1
withObject:(id)object2;
@end
#endif // _GSWMultiKeyDictionary_h__

View file

@ -1,11 +1,16 @@
/* GSWMultiKeyDictionary.m - GSWeb: Class GSWMultiKeyDictionary
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWMultiKeyDictionary.m - <title>GSWeb: Class GSWMultiKeyDictionary</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -46,12 +52,12 @@ static char rcsId[] = "$Id$";
};
//------------------------------------------------------------------------------
-(id)initWithCapacity:(unsigned int)capacity_
-(id)initWithCapacity:(unsigned int)capacity
{
LOGObjectFnStart();
if ((self=[super init]))
{
dict=[[NSMutableDictionary dictionaryWithCapacity:capacity_] retain];
_dict=[[NSMutableDictionary dictionaryWithCapacity:capacity] retain];
};
LOGObjectFnStop();
return self;
@ -60,7 +66,7 @@ static char rcsId[] = "$Id$";
//------------------------------------------------------------------------------
-(void)dealloc
{
DESTROY(dict);
DESTROY(_dict);
[super dealloc];
};
@ -74,7 +80,7 @@ static char rcsId[] = "$Id$";
(void*)self];
// GSWLogC("GSWMultiKeyDictionary description B");
descr=[descr stringByAppendingFormat:@"dict=%@>",
dict];
_dict];
// GSWLogC("GSWMultiKeyDictionary description C");
return descr;
};
@ -82,18 +88,18 @@ static char rcsId[] = "$Id$";
//------------------------------------------------------------------------------
-(NSEnumerator*)objectEnumerator
{
return [dict objectEnumerator];
return [_dict objectEnumerator];
};
//------------------------------------------------------------------------------
-(void)removeAllObjects
{
[dict removeAllObjects];
[_dict removeAllObjects];
};
//------------------------------------------------------------------------------
-(void)setObject:(id)object_
forKeys:(id)keys_,...
-(void)setObject:(id)object
forKeys:(id)keys,...
{
NSMutableArray* array=nil;
va_list ap;
@ -101,10 +107,11 @@ static char rcsId[] = "$Id$";
array = [NSMutableArray array];
va_start(ap, keys_);
va_start(ap, keys);
tmpId = keys_;
do {
tmpId = keys;
do
{
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
@ -112,22 +119,23 @@ static char rcsId[] = "$Id$";
va_end(ap);
[self setObject:object_
[self setObject:object
forKeysArray:array];
};
//------------------------------------------------------------------------------
-(id)objectForKeys:(id)keys_,...
-(id)objectForKeys:(id)keys,...
{
NSMutableArray* array=nil;
va_list ap;
id tmpId;
array = [NSMutableArray array];
va_start(ap, keys_);
va_start(ap, keys);
tmpId = keys_;
do {
tmpId = keys;
do
{
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
@ -139,61 +147,61 @@ static char rcsId[] = "$Id$";
};
//------------------------------------------------------------------------------
-(void)setObject:(id)object_
forKeysArray:(NSArray*)keys_
-(void)setObject:(id)object
forKeysArray:(NSArray*)keys
{
[dict setObject:object_
forKey:keys_];
[_dict setObject:object
forKey:keys];
};
//------------------------------------------------------------------------------
-(id)objectForKeysArray:(NSArray*)keys_
-(id)objectForKeysArray:(NSArray*)keys
{
return [dict objectForKey:keys_];
return [_dict objectForKey:keys];
};
//------------------------------------------------------------------------------
-(NSArray*)objectsForKeysArrays:(NSArray*)keys_
notFoundMarker:(id)notFoundMarker_
-(NSArray*)objectsForKeysArrays:(NSArray*)keys
notFoundMarker:(id)notFoundMarker
{
return [dict objectsForKeys:keys_
notFoundMarker:notFoundMarker_];
return [_dict objectsForKeys:keys
notFoundMarker:notFoundMarker];
};
//------------------------------------------------------------------------------
-(NSArray*)allValues
{
return [dict allValues];
return [_dict allValues];
};
//------------------------------------------------------------------------------
-(NSArray*)allKeys
{
return [dict allKeys];
return [_dict allKeys];
};
//------------------------------------------------------------------------------
-(void)makeObjectsPerformSelector:(SEL)selector_
-(void)makeObjectsPerformSelector:(SEL)selector
{
[dict makeObjectsPerformSelector:selector_];
[_dict makeObjectsPerformSelector:selector];
};
//------------------------------------------------------------------------------
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object_
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object
{
[dict makeObjectsPerformSelector:selector_
withObject:object_];
[_dict makeObjectsPerformSelector:selector
withObject:object];
};
//------------------------------------------------------------------------------
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object1_
withObject:(id)object2_
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object1
withObject:(id)object2
{
[dict makeObjectsPerformSelector:selector_
withObject:object1_
withObject:object2_];
[_dict makeObjectsPerformSelector:selector
withObject:object1
withObject:object2];
};
@end

View file

@ -1,11 +1,16 @@
/* GSWPageDefElement.h - GSWeb: Class GSWPageDefElement
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWPageDefElement.h - <title>GSWeb: Class GSWPageDefElement</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,24 +35,24 @@
//====================================================================
@interface GSWPageDefElement: NSObject <NSCopying>
{
NSString* elementName;
NSString* className;
NSMutableDictionary* associations;
NSString* _elementName;
NSString* _className;
NSMutableDictionary* _associations;
};
-(NSString*)description;
-(id)init;
-(void)dealloc;
-(id)copyWithZone:(NSZone *)zone;
-(id)initWithCoder:(NSCoder*)code_;
-(void)encodeWithCoder:(NSCoder*)code_;
-(id)initWithCoder:(NSCoder*)code;
-(void)encodeWithCoder:(NSCoder*)code;
-(NSString*)elementName;
-(void)setElementName:(NSString*)_name;
-(void)setElementName:(NSString*)aNname;
-(NSString*)className;
-(void)setClassName:(NSString*)_name;
-(void)setClassName:(NSString*)aNname;
-(NSDictionary*)associations;
-(void)setAssociation:(GSWAssociation*)_association
forKey:(NSString*)_key;
-(void)setAssociation:(GSWAssociation*)association
forKey:(NSString*)key;
@end
#endif //_GSWPageDefElement_h__

View file

@ -1,11 +1,16 @@
/* GSWPageDefElement.m - GSWeb: Class GSWPageDefElement
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWPageDefElement.m - <title>GSWeb: Class GSWPageDefElement</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -45,11 +51,11 @@ static char rcsId[] = "$Id$";
{
// NSDebugFLLog(@"low",@"Dealloc GSWPageDefElement=%p",(void*)self);
// GSWLogC("Dealloc GSWPageDefElement: elementName");
DESTROY(elementName);
DESTROY(_elementName);
// GSWLogC("Dealloc GSWPageDefElement: className");
DESTROY(className);
DESTROY(_className);
// GSWLogC("Dealloc GSWPageDefElement: associations");
DESTROY(associations);
DESTROY(_associations);
[super dealloc];
// GSWLogC("End Dealloc GSWPageDefElement");
}
@ -58,74 +64,74 @@ static char rcsId[] = "$Id$";
-(id)copyWithZone:(NSZone*)zone
{
GSWPageDefElement* clone = [[isa allocWithZone:zone] init];
ASSIGNCOPY(clone->elementName,elementName);
ASSIGNCOPY(clone->className,className);
ASSIGNCOPY(clone->associations,associations);
ASSIGNCOPY(clone->_elementName,_elementName);
ASSIGNCOPY(clone->_className,_className);
ASSIGNCOPY(clone->_associations,_associations);
return clone;
};
//--------------------------------------------------------------------
-(id)initWithCoder:(NSCoder*)coder_
-(id)initWithCoder:(NSCoder*)coder
{
if ((self = [super init]))
{
[coder_ decodeValueOfObjCType:@encode(id)
at:&elementName];
[coder_ decodeValueOfObjCType:@encode(id)
at:&className];
[coder_ decodeValueOfObjCType:@encode(id)
at:&associations];
[coder decodeValueOfObjCType:@encode(id)
at:&_elementName];
[coder decodeValueOfObjCType:@encode(id)
at:&_className];
[coder decodeValueOfObjCType:@encode(id)
at:&_associations];
};
return self;
};
//--------------------------------------------------------------------
-(void)encodeWithCoder:(NSCoder*)coder_
-(void)encodeWithCoder:(NSCoder*)coder
{
[coder_ encodeObject:elementName];
[coder_ encodeObject:className];
[coder_ encodeObject:associations];
[coder encodeObject:_elementName];
[coder encodeObject:_className];
[coder encodeObject:_associations];
};
//--------------------------------------------------------------------
-(NSString*)elementName
{
return elementName;
return _elementName;
};
//--------------------------------------------------------------------
-(void)setElementName:(NSString*)_name
-(void)setElementName:(NSString*)aName
{
ASSIGNCOPY(elementName,_name);
ASSIGNCOPY(_elementName,aName);
};
//--------------------------------------------------------------------
-(NSString*)className
{
return className;
return _className;
};
//--------------------------------------------------------------------
-(void)setClassName:(NSString*)_name
-(void)setClassName:(NSString*)aName
{
ASSIGNCOPY(className,_name);
ASSIGNCOPY(_className,aName);
};
//--------------------------------------------------------------------
-(NSDictionary*)associations
{
return associations;
return _associations;
};
//--------------------------------------------------------------------
-(void)setAssociation:(GSWAssociation*)_association
forKey:(NSString*)_key
-(void)setAssociation:(GSWAssociation*)association
forKey:(NSString*)key
{
if (!associations)
associations=[NSMutableDictionary new];
[associations setObject:_association
forKey:_key];
if (!_associations)
_associations=[NSMutableDictionary new];
[_associations setObject:association
forKey:key];
};
//--------------------------------------------------------------------
@ -134,8 +140,8 @@ static char rcsId[] = "$Id$";
return [NSString stringWithFormat:@"<%@ %p elementName:[%@] className:[%@] associations:\n%@",
[self class],
(void*)self,
elementName,
className,
associations];
_elementName,
_className,
_associations];
};
@end

View file

@ -1,12 +1,16 @@
/* GSWPageDefParserExt.h - GSWeb: Class GSWPageElementParser: Categories
/** GSWPageDefParserExt.h - <title>GSWeb: Class GSWPageDefParserExt</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -32,14 +37,14 @@
-(NSDictionary*)elements;
-(NSArray*)includes;
-(void)dealloc;
-(void)reportErrorWithException:(NSException*)_exception;
-(void)reportError:(NSString*)_text;
-(void)reportWarning:(NSString*)_text;
-(void)reportErrorWithException:(NSException*)exception;
-(void)reportError:(NSString*)text;
-(void)reportWarning:(NSString*)text;
-(BOOL)isError;
-(BOOL)isWarning;
-(NSArray*)errors;
-(NSArray*)warnings;
-(NSString*)unescapedString:(NSString*)string_;
-(NSString*)unescapedString:(NSString*)string;
@end
#endif //_GSWPageDefParserExt_h__

View file

@ -1,12 +1,16 @@
/* GSWPageDefParserExt.m - GSWeb: Class GSWPageDefParser: Categories
/** GSWPageDefParserExt.m - <title>GSWeb: Class GSWPageDefParserExt</title>
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -20,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -57,37 +62,37 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)reportErrorWithException:(NSException*)_exception
-(void)reportErrorWithException:(NSException*)exception
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[_exception description],
[_exception reason]];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
[exception description],
[exception reason]];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportError:(NSString*)_text
-(void)reportError:(NSString*)text
{
NSString* _error=nil;
NSString* error=nil;
if (!errors)
errors=[NSMutableArray new];
_error=[NSString stringWithFormat:@"Parsing Error: %@",
_text];
[errors addObject:_error];
error=[NSString stringWithFormat:@"Parsing Error: %@",
text];
[errors addObject:error];
};
//--------------------------------------------------------------------
-(void)reportWarning:(NSString*)_text
-(void)reportWarning:(NSString*)text
{
NSString* _warning=nil;
NSString* warning=nil;
if (!warnings)
warnings=[NSMutableArray new];
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
_text];
[warnings addObject:_warning];
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
text];
[warnings addObject:warning];
};
//--------------------------------------------------------------------
@ -115,24 +120,24 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(NSString*)unescapedString:(NSString*)string_
-(NSString*)unescapedString:(NSString*)aString
{
//TODO
string_=[string_ stringByReplacingString:@"\\n"
aString=[aString stringByReplacingString:@"\\n"
withString:@"\n"];
string_=[string_ stringByReplacingString:@"\\r"
aString=[aString stringByReplacingString:@"\\r"
withString:@"\r"];
string_=[string_ stringByReplacingString:@"\\t"
aString=[aString stringByReplacingString:@"\\t"
withString:@"\t"];
string_=[string_ stringByReplacingString:@"\\b"
aString=[aString stringByReplacingString:@"\\b"
withString:@"\b"];
string_=[string_ stringByReplacingString:@"\\f"
aString=[aString stringByReplacingString:@"\\f"
withString:@"\f"];
string_=[string_ stringByReplacingString:@"\\\""
aString=[aString stringByReplacingString:@"\\\""
withString:@"\""];
string_=[string_ stringByReplacingString:@"\\\'"
aString=[aString stringByReplacingString:@"\\\'"
withString:@"\'"];
return string_;
return aString;
};
@end

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$

View file

@ -1,11 +1,16 @@
/* GSWParam.m - GSWeb: Class GSWParam
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWParam.m - <title>GSWeb: Class GSWParam</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -28,12 +34,12 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWParam
-(id) initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
contentElements:(NSArray*)elements_
target:(id)target_
key:(NSString*)key_
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull_
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
contentElements:(NSArray*)elements
target:(id)target
key:(NSString*)key
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
@ -41,9 +47,9 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
contentElements:(NSArray*)elements_
-(id)initWithName:(NSString*)aName
associations:(NSDictionary*)associations
contentElements:(NSArray*)elements
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
@ -75,8 +81,8 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWParam (GSWParamA)
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
@ -87,15 +93,15 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWParam (GSWParamB)
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(id)valueInComponent:(id)component_
-(id)valueInComponent:(id)component
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;

View file

@ -1,11 +1,16 @@
/* GSWProjectBundle.h - GSWeb: Class GSWProjectBundle
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWProjectBundle - <title>GSWeb: Class GSWProjectBundle</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,20 +36,20 @@
//====================================================================
@interface GSWProjectBundle : GSWDeployedBundle
{
NSString* projectName;
NSDictionary* subprojects;
NSDictionary* pbProjectDictionary;
NSString* _projectName;
NSDictionary* _subprojects;
NSDictionary* _pbProjectDictionary;
};
-(id)initWithPath:(NSString*)path_;
-(id)initWithPath:(NSString*)aPath;
-(void)dealloc;
-(NSString*)description;
-(NSArray*)lockedPathsForResourcesOfType:(id)type_;
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)type_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_;
-(NSArray*)lockedPathsForResourcesOfType:(id)aType;
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)aType;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage;
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages;
-(NSDictionary*)subprojects;
-(BOOL)isFramework;
-(GSWDeployedBundle*)projectBundle;
@ -54,8 +60,8 @@
@interface GSWProjectBundle (GSWProjectBundle)
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)name_
isFramework:(BOOL)isFramework_;
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)aName
isFramework:(BOOL)isFramework;
@end

View file

@ -1,4 +1,5 @@
/** GSWProjectBundle.m - <title>GSWeb: Class GSWProjectBundle</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
@ -33,16 +34,14 @@ static char rcsId[] = "$Id$";
#include <GSWeb/GSWeb.h>
#include <Foundation/NSFileManager.h>
//====================================================================
@implementation GSWProjectBundle
-(id)initWithPath:(NSString*)path_
-(id)initWithPath:(NSString*)aPath
{
LOGObjectFnStart();
NSDebugMLLog(@"bundles",@"path_=%@",path_);
if ((self=[super initWithPath:path_]))
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
if ((self=[super initWithPath:aPath]))
{
//TODO
};
@ -53,9 +52,9 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(void)dealloc
{
DESTROY(projectName);
DESTROY(subprojects);
DESTROY(pbProjectDictionary);
DESTROY(_projectName);
DESTROY(_subprojects);
DESTROY(_pbProjectDictionary);
[super dealloc];
};
@ -65,49 +64,49 @@ static char rcsId[] = "$Id$";
return [NSString stringWithFormat:@"<%s %p - bundlePath:[%@] relativePaths:[%@] projectName:[%@] subprojects:[%@] pbProjectDictionary:[%@]>",
object_get_class_name(self),
(void*)self,
bundlePath,
relativePathsCache,
projectName,
subprojects,
pbProjectDictionary];
_bundlePath,
_relativePathsCache,
_projectName,
_subprojects,
_pbProjectDictionary];
};
//--------------------------------------------------------------------
-(NSArray*)lockedPathsForResourcesOfType:(id)type_
-(NSArray*)lockedPathsForResourcesOfType:(id)aType
{
LOGObjectFnNotImplemented(); //TODOFN
return [super lockedPathsForResourcesOfType:type_];
return [super lockedPathsForResourcesOfType:aType];
};
//--------------------------------------------------------------------
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)type_
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)aType
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguage:(NSString*)language_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguage:(NSString*)aLanguage
{
LOGObjectFnNotImplemented(); //TODOFN
return [super lockedRelativePathForResourceNamed:name_
forLanguage:language_];
return [super lockedRelativePathForResourceNamed:aName
forLanguage:aLanguage];
};
//--------------------------------------------------------------------
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
forLanguages:(NSArray*)languages_
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
forLanguages:(NSArray*)someLanguages
{
LOGObjectFnNotImplemented(); //TODOFN
return [super lockedRelativePathForResourceNamed:name_
forLanguages:languages_];
return [super lockedRelativePathForResourceNamed:aName
forLanguages:someLanguages];
};
//--------------------------------------------------------------------
-(NSDictionary*)subprojects
{
return subprojects;
return _subprojects;
};
//--------------------------------------------------------------------
@ -134,98 +133,99 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(NSString*)projectName
{
return projectName;
return _projectName;
};
//--------------------------------------------------------------------
-(NSDictionary*)_pbProjectDictionary
{
return pbProjectDictionary;
return _pbProjectDictionary;
};
@end
//====================================================================
@implementation GSWProjectBundle (GSWProjectBundle)
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)name_
isFramework:(BOOL)isFramework_
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)aName
isFramework:(BOOL)isFramework
{
//OK
//name:ObjCTest3
GSWDeployedBundle* _projectBundle=nil;
GSWDeployedBundle* _aBundle=nil;
NSArray* _projectSearchPath=nil;
NSMutableArray* _projectsBundles=nil;
NSEnumerator* _projectEnum = nil;
NSEnumerator* _projectSearchPathEnum=nil;
NSString* _path=nil;
GSWDeployedBundle* projectBundle=nil;
GSWDeployedBundle* aBundle=nil;
NSArray* projectSearchPath=nil;
NSMutableArray* projectsBundles=nil;
NSEnumerator* projectEnum = nil;
NSEnumerator* projectSearchPathEnum=nil;
NSString* path=nil;
LOGClassFnStart();
NSDebugMLLog(@"bundles",@"name_:%@",name_);
NSDebugMLLog(@"bundles",@"isFramework_=%s",(isFramework_ ? "YES" : "NO"));
NSDebugMLLog(@"bundles",@"aName:%@",aName);
NSDebugMLLog(@"bundles",@"isFramework=%s",(isFramework ? "YES" : "NO"));
_projectSearchPath=[GSWApplication projectSearchPath]; // ("H:\\Wotests")
NSDebugMLLog(@"bundles",@"_projectSearchPath:%@",_projectSearchPath);
_projectsBundles=[NSMutableArray array];
projectSearchPath=[GSWApplication projectSearchPath]; // ("H:\\Wotests")
NSDebugMLLog(@"bundles",@"projectSearchPath:%@",projectSearchPath);
projectsBundles=[NSMutableArray array];
_projectSearchPathEnum = [_projectSearchPath objectEnumerator];
while ((_path = [_projectSearchPathEnum nextObject]))
projectSearchPathEnum = [projectSearchPath objectEnumerator];
while ((path = [projectSearchPathEnum nextObject]))
{
NSDirectoryEnumerator* dirEnum=nil;
NSString* filePath=nil;
NSFileManager* fileManager=[NSFileManager defaultManager];
dirEnum = [fileManager enumeratorAtPath:_path];
dirEnum = [fileManager enumeratorAtPath:path];
while ((filePath = [dirEnum nextObject]))
{
NSDictionary* attributes = [dirEnum fileAttributes];
NSString* fileType = [attributes objectForKey:NSFileType];
filePath=[_path stringByAppendingFormat:@"/%@",filePath];
filePath=[path stringByAppendingFormat:@"/%@",filePath];
NSDebugMLLog(@"bundles",@"filePath:%@",filePath);
// NSDebugMLLog(@"bundles",@"attributes:%@",attributes);
// NSDebugMLLog(@"bundles",@"fileType:%@",fileType);
if ([fileType isEqual:NSFileTypeDirectory])
{
BOOL _tmpBundleIsFramework=NO;
NSString* _tmpBundleProjectName=nil;
GSWDeployedBundle* _tmpBundle=[GSWProjectBundle bundleWithPath:filePath];
NSDebugMLLog(@"bundles",@"_tmpBundle:%@",_tmpBundle);
_tmpBundleProjectName=[_tmpBundle projectName];
NSDebugMLLog(@"bundles",@"_tmpBundleProjectName:%@",_tmpBundleProjectName);
_tmpBundleIsFramework=[_tmpBundle isFramework];
NSDebugMLLog(@"bundles",@"_tmpBundleIsFramework=%s",(_tmpBundleIsFramework ? "YES" : "NO"));
BOOL tmpBundleIsFramework=NO;
NSString* tmpBundleProjectName=nil;
GSWDeployedBundle* tmpBundle=(GSWDeployedBundle*)[GSWProjectBundle bundleWithPath:filePath];
NSDebugMLLog(@"bundles",@"tmpBundle:%@",tmpBundle);
tmpBundleProjectName=[tmpBundle projectName];
NSDebugMLLog(@"bundles",@"tmpBundleProjectName:%@",tmpBundleProjectName);
tmpBundleIsFramework=[tmpBundle isFramework];
NSDebugMLLog(@"bundles",@"tmpBundleIsFramework=%s",
(tmpBundleIsFramework ? "YES" : "NO"));
//Why projectName...
if ((isFramework_ && _tmpBundleIsFramework)
||(!isFramework_ && !_tmpBundleIsFramework))
if ((isFramework && tmpBundleIsFramework)
||(!isFramework && !tmpBundleIsFramework))
{
NSDebugMLLog(@"bundles",@"adding _tmpBundle:%@",_tmpBundleProjectName);
[_projectsBundles addObject:_tmpBundle];
NSDebugMLLog(@"bundles",@"adding tmpBundle:%@",tmpBundleProjectName);
[projectsBundles addObject:tmpBundle];
};
};
};
};
_projectEnum =[_projectsBundles objectEnumerator];
while(!_projectBundle && (_aBundle = [_projectEnum nextObject]))
projectEnum =[projectsBundles objectEnumerator];
while(!projectBundle && (aBundle = [projectEnum nextObject]))
{
NSString* suffix1=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
NSString* suffix2=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
NSString* suffix1=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
NSString* suffix2=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
NSDebugMLLog(@"bundles",@"suffix1:%@ suffix2",suffix1,suffix2);
NSDebugMLLog(@"bundles",@"_aBundle:%@",_aBundle);
NSDebugMLLog(@"bundles",@"aBundle:%@",aBundle);
if ([[_aBundle bundlePath]hasSuffix:suffix1]
|| [[_aBundle bundlePath]hasSuffix:suffix2]
|| [[_aBundle bundlePath]hasSuffix:@".debug"])
if ([[aBundle bundlePath]hasSuffix:suffix1]
|| [[aBundle bundlePath]hasSuffix:suffix2]
|| [[aBundle bundlePath]hasSuffix:@".debug"])
{
NSString* _tmpName=[_aBundle projectName];
NSDebugMLLog(@"bundles",@"_tmpName:%@",_tmpName);
if ([_tmpName isEqual:name_])
NSString* tmpName=[aBundle projectName];
NSDebugMLLog(@"bundles",@"tmpName:%@",tmpName);
if ([tmpName isEqual:aName])
{
_projectBundle=_aBundle;
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
projectBundle=aBundle;
NSDebugMLLog(@"bundles",@"projectBundle:%@",projectBundle);
};
};
};
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
NSDebugMLLog(@"bundles",@"projectBundle:%@",projectBundle);
LOGClassFnStop();
return _projectBundle;
return projectBundle;
};
@end

View file

@ -1,11 +1,18 @@
/* GSWQuickTime.h - GSWeb: Class GSWQuickTime
Copyright (C) 2000 Free Software Foundation, Inc.
/** GSWQuickTime.h - <title>GSWeb: Class GSWQuickTime</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 2000
Copyright (C) 2000-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 200
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +26,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -30,57 +38,57 @@
//====================================================================
@interface GSWNestedList: GSWDynamicElement
{
NSMutableDictionary* associations;
GSWAssociation* src;
GSWAssociation* filename;
GSWAssociation* hotspotList;
GSWAssociation* framework;
GSWAssociation* width;
GSWAssociation* height;
GSWAssociation* action;
GSWAssociation* selection;
GSWAssociation* loop;
GSWAssociation* volume;
GSWAssociation* scale;
GSWAssociation* pluginsPage;
GSWAssociation* pluginsPageName;
GSWAssociation* href;
GSWAssociation* pageName;
GSWAssociation* bgcolor;
GSWAssociation* target;
GSWAssociation* pan;
GSWAssociation* tilt;
GSWAssociation* fov;
GSWAssociation* node;
GSWAssociation* correction;
GSWAssociation* cache;
GSWAssociation* autoplay;
GSWAssociation* autostart;
GSWAssociation* hidden;
GSWAssociation* playEveryFrame;
GSWAssociation* controller;
GSWAssociation* prefixHost;
NSMutableDictionary* _associations;
GSWAssociation* _src;
GSWAssociation* _filename;
GSWAssociation* _hotspotList;
GSWAssociation* _framework;
GSWAssociation* _width;
GSWAssociation* _height;
GSWAssociation* _action;
GSWAssociation* _selection;
GSWAssociation* _loop;
GSWAssociation* _volume;
GSWAssociation* _scale;
GSWAssociation* _pluginsPage;
GSWAssociation* _pluginsPageName;
GSWAssociation* _href;
GSWAssociation* _pageName;
GSWAssociation* _bgcolor;
GSWAssociation* _target;
GSWAssociation* _pan;
GSWAssociation* _tilt;
GSWAssociation* _fov;
GSWAssociation* _node;
GSWAssociation* _correction;
GSWAssociation* _cache;
GSWAssociation* _autoplay;
GSWAssociation* _autostart;
GSWAssociation* _hidden;
GSWAssociation* _playEveryFrame;
GSWAssociation* _controller;
GSWAssociation* _prefixHost;
};
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
inContext:(GSWContext*)context_;
-(void)appendToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)addHRefToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
inContext:(GSWContext*)aContext;
-(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(void)addHRefToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(id)_generateURL:(id)u;
-(id)_prefixedURL:(id)u
inContext:(GSWContext*)context_;
-(void)addToResponse:(GSWResponse*)response_
tag:(id)tag_
value:(id)value_;
inContext:(GSWContext*)aContext;
-(void)addToResponse:(GSWResponse*)aResponse
tag:(id)tag
value:(id)value;
-(void)dealloc;
-(id)init;
-(id)initWithName:(NSString*)name_
associations:(NSDictionary*)associations_
template:(GSWElement*)templateElement_;
-(BOOL)booleanValueOfBinding:(id)binding_
inComponent:(id)component_;
-(id)initWithName:(NSString*)name
associations:(NSDictionary*)associations
template:(GSWElement*)templateElement;
-(BOOL)booleanValueOfBinding:(id)binding
inComponent:(id)component;
@end
#endif //_GSWQuickTime_h__

View file

@ -1,11 +1,16 @@
/* GSWRequestHandler.h - GSWeb: Class GSWRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWRequestHandler.h - <title>GSWeb: Class GSWRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -29,13 +35,13 @@
//====================================================================
@interface GSWRequestHandler : NSObject <NSLocking>
{
NSRecursiveLock* selfLock;
NSRecursiveLock* _selfLock;
#ifndef NDEBUG
int selfLockn;
int _selfLockn;
#endif
};
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
-(void)lock;
-(void)unlock;

View file

@ -1,11 +1,16 @@
/* GSWRequestHandler.m - GSWeb: Class GSWRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWRequestHandler.m - <title>GSWeb: Class GSWRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,7 +35,7 @@ static char rcsId[] = "$Id$";
@implementation GSWRequestHandler
//--------------------------------------------------------------------
-(GSWResponse*)handleRequest:(GSWRequest*)request_
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;

View file

@ -1,11 +1,16 @@
/* GSWResourceRequestHandler.h - GSWeb: Class GSWResourceRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWResourceRequestHandler.h - <title>GSWeb: Class GSWResourceRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -31,12 +37,12 @@
{
};
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)_path;
-(GSWResponse*)_responseForDataAtPath:(NSString*)_path;
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)_key;
-(GSWResponse*)_generateResponseForData:(NSData*)_data
mimeType:(NSString*)_mimeType;
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)aPath;
-(GSWResponse*)_responseForDataAtPath:(NSString*)aPath;
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)aKey;
-(GSWResponse*)_generateResponseForData:(NSData*)aData
mimeType:(NSString*)mimeType;
@end

View file

@ -1,11 +1,16 @@
/* GSWResourceRequestHandler.m - GSWeb: Class GSWResourceRequestHandler
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWResourceRequestHandler.m - <title>GSWeb: Class GSWResourceRequestHandler</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Feb 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,74 +35,74 @@ static char rcsId[] = "$Id$";
@implementation GSWResourceRequestHandler
//--------------------------------------------------------------------
-(GSWResponse*)handleRequest:(GSWRequest*)request_
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
{
//OK
// /cgi/GSWeb.exe/ObjCTest3.gswa/wr?gswdata=0
GSWResponse* _response=nil;
NSString* _gswdata=nil;
NSDictionary* _elements=nil;
// /GSWeb/ObjCTest3.gswa/wr?gswdata=0
GSWResponse* response=nil;
NSString* gswdata=nil;
NSDictionary* elements=nil;
LOGObjectFnStart();
_elements=[request_ uriOrFormOrCookiesElements];
NSDebugMLog(@"_elements=%@",_elements);
_gswdata=[_elements objectForKey:GSWKey_Data[GSWebNamingConv]];
NSDebugMLog(@"_gswdata=%@",_gswdata);
if (_gswdata)
_response=[self _responseForDataCachedWithKey:_gswdata];
elements=[aRequest uriOrFormOrCookiesElements];
NSDebugMLog(@"elements=%@",elements);
gswdata=[elements objectForKey:GSWKey_Data[GSWebNamingConv]];
NSDebugMLog(@"gswdata=%@",gswdata);
if (gswdata)
response=[self _responseForDataCachedWithKey:gswdata];
else
{
ExceptionRaise0(@"GSWResourceRequestHandler",@"No data key in request");
LOGError0(@"");//TODO
};
NSDebugMLog(@"_response=%@",_response);
[_response _finalizeInContext:nil];
NSDebugMLog(@"response=%@",response);
[response _finalizeInContext:nil];
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)_path
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)aPath
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(GSWResponse*)_responseForDataAtPath:(NSString*)_path
-(GSWResponse*)_responseForDataAtPath:(NSString*)aPath
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
//--------------------------------------------------------------------
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)_key
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)aKey
{
//OK
GSWResponse* _response=nil;
GSWResourceManager* _resourceManager=nil;
GSWURLValuedElementData* _data=nil;
GSWResponse* response=nil;
GSWResourceManager* resourceManager=nil;
GSWURLValuedElementData* data=nil;
LOGObjectFnStart();
NSDebugMLog(@"_key=%@",_key);
_response=[[GSWResponse new]autorelease];
_resourceManager=[[GSWApplication application] resourceManager];
_data=[_resourceManager _cachedDataForKey:_key];
NSDebugMLog(@"_data=%@",_data);
if (_data)
[_data appendToResponse:_response
NSDebugMLog(@"aKey=%@",aKey);
response=[[GSWResponse new]autorelease];
resourceManager=[[GSWApplication application] resourceManager];
data=[resourceManager _cachedDataForKey:aKey];
NSDebugMLog(@"data=%@",data);
if (data)
[data appendToResponse:response
inContext:nil];
else
{
LOGSeriousError(@"No data for _key %@",
_key);
key);
//TODO
};
LOGObjectFnStop();
return _response;
return response;
};
//--------------------------------------------------------------------
-(GSWResponse*)_generateResponseForData:(NSData*)_data
mimeType:(NSString*)_mimeType
-(GSWResponse*)_generateResponseForData:(NSData*)aData
mimeType:(NSString*)mimeType
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$

View file

@ -1,11 +1,16 @@
/* GSWStatisticsStore.h - GSWeb: Class GSWStatisticsStore
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWStatisticsStore.h - <title>GSWeb: Class GSWStatisticsStore</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,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$
</license>
**/
#ifndef _GSWStatisticsStore_h__
#define _GSWStatisticsStore_h__
@ -29,46 +33,46 @@
@interface GSWStatisticsStore : NSObject <NSLocking>
{
NSRecursiveLock* selfLock;
NSRecursiveLock* _selfLock;
#ifndef NDEBUG
int selfLockn;
int _selfLockn;
#endif
int transactionMovingAverageSampleCount;
int sessionMovingAverageSampleCount;
int transactionsCount;
int lastStatsTransactionsCount;
int directActionTransactionsCount;
int componentActionTransactionsCount;
int sessionsCount;
int lastStatsSessionsCount;
int maxActiveSessionsCount;
NSDate* maxActiveSessionsDate;
float averageRequestsPerSession;
double averageSessionLife;
NSArray* lastSessionStatistics;
double movingAverageSessionLife;
float movingAverageRequestsPerSession;
int movingAverageSessionsCount;
NSDate* startDate;
NSDate* lastStatsDate;
double lastWillHandleRequestTimeInterval;
double lastDidHandleRequestTimeInterval;
double totalIdleTimeInterval;
double totalTransactionTimeInterval;
double totalDATransactionTimeInterval;
double totalCATransactionTimeInterval;
double movingIdleTimeInterval;
double movingTransactionTimeInterval;
int movingAverageTransactionsCount;
NSDictionary* initializationMemory;
NSMutableDictionary* pagesStatistics;
NSString* currentPage;
NSMutableDictionary* pathsStatistics;
NSString* logPath;
double logRotation;
NSDate* logCreationDate;
NSString* password;
NSMutableDictionary* directActionStatistics;
int _transactionMovingAverageSampleCount;
int _sessionMovingAverageSampleCount;
int _transactionsCount;
int _lastStatsTransactionsCount;
int _directActionTransactionsCount;
int _componentActionTransactionsCount;
int _sessionsCount;
int _lastStatsSessionsCount;
int _maxActiveSessionsCount;
NSDate* _maxActiveSessionsDate;
float _averageRequestsPerSession;
double _averageSessionLife;
NSArray* _lastSessionStatistics;
double _movingAverageSessionLife;
float _movingAverageRequestsPerSession;
int _movingAverageSessionsCount;
NSDate* _startDate;
NSDate* _lastStatsDate;
double _lastWillHandleRequestTimeInterval;
double _lastDidHandleRequestTimeInterval;
double _totalIdleTimeInterval;
double _totalTransactionTimeInterval;
double _totalDATransactionTimeInterval;
double _totalCATransactionTimeInterval;
double _movingIdleTimeInterval;
double _movingTransactionTimeInterval;
int _movingAverageTransactionsCount;
NSDictionary* _initializationMemory;
NSMutableDictionary* _pagesStatistics;
NSString* _currentPage;
NSMutableDictionary* _pathsStatistics;
NSString* _logPath;
double _logRotation;
NSDate* _logCreationDate;
NSString* _password;
NSMutableDictionary* _directActionStatistics;
};
-(id)init;
@ -78,22 +82,22 @@
-(void)lock;
-(id)statistics;
-(int)sessionMovingAverageSampleSize;
-(void)setSessionMovingAverageSampleSize:(int)size_;
-(void)setSessionMovingAverageSampleSize:(int)aSize;
-(int)transactionMovingAverageSampleSize;
-(void)setTransactionMovingAverageSampleSize:(int)size_;
-(void)setTransactionMovingAverageSampleSize:(int)aSize;
@end
@interface GSWStatisticsStore (GSWStatisticsStoreA)
-(void)_purgePathsStatistics;
-(void)_updatePathsStatisticsWithPaths:(id)paths_;
-(void)_updatePagesStatisticsForPage:(id)page_
timeInterval:(NSTimeInterval)timeInterval_;
-(void)_updateDAStatisticsForActionNamed:(id)name_
timeInterval:(NSTimeInterval)timeInterval_;
-(void)_sessionTerminating:(id)session_;
-(void)_applicationCreatedSession:(GSWSession*)session_;
-(void)_updatePathsStatisticsWithPaths:(id)paths;
-(void)_updatePagesStatisticsForPage:(id)page
timeInterval:(NSTimeInterval)timeInterval;
-(void)_updateDAStatisticsForActionNamed:(id)name
timeInterval:(NSTimeInterval)timeInterval;
-(void)_sessionTerminating:(id)session;
-(void)_applicationCreatedSession:(GSWSession*)session;
-(void)_applicationDidHandleComponentActionRequest;
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name_;
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name;
-(double)_applicationDidHandleRequest;
-(void)_applicationWillHandleDirectActionRequest;
-(void)_applicationWillHandleComponentActionRequest;
@ -101,22 +105,22 @@
@end
@interface GSWStatisticsStore (GSWStatisticsStoreB)
-(NSString*)descriptionForResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(void)recordStatisticsForResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
-(void)recordStatisticsForResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
@end
@interface GSWStatisticsStore (GSWStatisticsStoreC)
-(void)logString:(id)string_;
-(void)logString:(id)string;
-(double)logFileRotationFrequencyInDays;
-(NSString*)logFile;
-(void) setLogFile:(NSString*)logFile_
-(void) setLogFile:(NSString*)logFile
rotationFrequencyInDays:(double)rotationFrequency;
-(id)formatDescription:(id)description_
forResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_;
-(id)formatDescription:(id)description
forResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext;
@end
@interface GSWStatisticsStore (GSWStatisticsStoreD)
@ -146,14 +150,14 @@
@end
@interface GSWStatisticsStore (GSWStatisticsStoreE)
-(BOOL)validateLogin:(id)login_
forSession:(id)session_;
-(void)setPassword:(NSString*)password_;
-(BOOL)validateLogin:(id)login
forSession:(id)session;
-(void)setPassword:(NSString*)password;
@end
@interface GSWStatisticsStore (GSWStatisticsStoreF)
-(BOOL)validateLogin:(id)login_;
-(BOOL)validateLogin:(id)login;
@end
@interface GSWStatisticsStore (GSWStatisticsStoreG)
@ -162,6 +166,6 @@
@end
@interface GSWStatisticsStore (GSWStatisticsStoreH)
+(id)timeIntervalDescription:(double)timeInterval_;
+(id)timeIntervalDescription:(double)timeInterval;
@end
#endif //_GSWStatisticsStore_h__

View file

@ -1,11 +1,16 @@
/* GSWStatisticsStore.m - GSWeb: Class GSWStatisticsStore
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWStatisticsStore.m - <title>GSWeb: Class GSWStatisticsStore</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -36,11 +42,11 @@ static char rcsId[] = "$Id$";
//OK
if ((self=[super init]))
{
transactionMovingAverageSampleCount = 100;
sessionMovingAverageSampleCount = 10;
ASSIGN(startDate, [NSDate date]);
ASSIGN(initializationMemory, [self _memoryUsage]);
selfLock = [NSRecursiveLock new];
_transactionMovingAverageSampleCount = 100;
_sessionMovingAverageSampleCount = 10;
ASSIGN(_startDate, [NSDate date]);
ASSIGN(_initializationMemory, [self _memoryUsage]);
_selfLock = [NSRecursiveLock new];
};
return self;
};
@ -50,20 +56,20 @@ static char rcsId[] = "$Id$";
{
GSWLogC("Dealloc GSWStatisticsStore");
GSWLogC("Dealloc GSWStatisticsStore: selfLock");
DESTROY(selfLock);
DESTROY(_selfLock);
GSWLogC("Dealloc GSWStatisticsStore: maxActiveSessionsDate");
DESTROY(maxActiveSessionsDate);
DESTROY(lastSessionStatistics);
DESTROY(startDate);
DESTROY(lastStatsDate);
DESTROY(initializationMemory);
DESTROY(pagesStatistics);
DESTROY(currentPage);
DESTROY(pathsStatistics);
DESTROY(logPath);
DESTROY(logCreationDate);
DESTROY(password);
DESTROY(directActionStatistics);
DESTROY(_maxActiveSessionsDate);
DESTROY(_lastSessionStatistics);
DESTROY(_startDate);
DESTROY(_lastStatsDate);
DESTROY(_initializationMemory);
DESTROY(_pagesStatistics);
DESTROY(_currentPage);
DESTROY(_pathsStatistics);
DESTROY(_logPath);
DESTROY(_logCreationDate);
DESTROY(_password);
DESTROY(_directActionStatistics);
GSWLogC("Dealloc GSWStatisticsStore Super");
[super dealloc];
GSWLogC("End Dealloc GSWStatisticsStore");
@ -73,12 +79,12 @@ static char rcsId[] = "$Id$";
-(void)unlock
{
LOGObjectFnStart();
NSDebugMLog(@"selfLockn=%d",selfLockn);
TmpUnlock(selfLock);
NSDebugMLog(@"selfLockn=%d",_selfLockn);
TmpUnlock(_selfLock);
#ifndef NDEBUG
selfLockn--;
_selfLockn--;
#endif
NSDebugMLog(@"selfLockn=%d",selfLockn);
NSDebugMLog(@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
@ -86,12 +92,12 @@ static char rcsId[] = "$Id$";
-(void)lock
{
LOGObjectFnStart();
NSDebugMLog(@"selfLockn=%d",selfLockn);
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
NSDebugMLog(@"selfLockn=%d",_selfLockn);
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
#ifndef NDEBUG
selfLockn++;
_selfLockn++;
#endif
NSDebugMLog(@"selfLockn=%d",selfLockn);
NSDebugMLog(@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
@ -107,14 +113,14 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return sessionMovingAverageSampleCount;
return _sessionMovingAverageSampleCount;
};
//--------------------------------------------------------------------
-(void)setSessionMovingAverageSampleSize:(int)size_
-(void)setSessionMovingAverageSampleSize:(int)aSize
{
LOGObjectFnStart();
sessionMovingAverageSampleCount=size_;
_sessionMovingAverageSampleCount=aSize;
LOGObjectFnStop();
};
@ -123,14 +129,14 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return transactionMovingAverageSampleCount;
return _transactionMovingAverageSampleCount;
};
//--------------------------------------------------------------------
-(void)setTransactionMovingAverageSampleSize:(int)size_
-(void)setTransactionMovingAverageSampleSize:(int)aSize
{
LOGObjectFnStart();
transactionMovingAverageSampleCount=size_;
_transactionMovingAverageSampleCount=aSize;
LOGObjectFnStop();
};
@ -162,7 +168,7 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)_updatePathsStatisticsWithPaths:(id)paths_
-(void)_updatePathsStatisticsWithPaths:(id)paths
{
//OK
LOGObjectFnStart();
@ -185,91 +191,93 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)_updatePagesStatisticsForPage:(id)page_
timeInterval:(NSTimeInterval)timeInterval_
-(void)_updatePagesStatisticsForPage:(id)aPage
timeInterval:(NSTimeInterval)aTimeInterval
{
//OK
NSMutableDictionary* _pageStats=nil;
NSNumber* _AvgRespTime=nil;
NSNumber* _MinRespTime=nil;
NSNumber* _MaxRespTime=nil;
NSNumber* _Served=nil;
double _AvgRespTimeValue=0;
double _MinRespTimeValue=0;
double _MaxRespTimeValue=0;
int _ServedValue=0;
NSMutableDictionary* pageStats=nil;
NSNumber* AvgRespTime=nil;
NSNumber* MinRespTime=nil;
NSNumber* MaxRespTime=nil;
NSNumber* Served=nil;
double AvgRespTimeValue=0;
double MinRespTimeValue=0;
double MaxRespTimeValue=0;
int ServedValue=0;
LOGObjectFnStart();
[self lock];
NS_DURING
{
NSDebugMLog(@"page_=%@",page_);
if (!pagesStatistics)
pagesStatistics=[NSMutableDictionary new];
NSDebugMLog(@"aPage=%@",aPage);
if (!_pagesStatistics)
_pagesStatistics=[NSMutableDictionary new];
else
_pageStats=[pagesStatistics objectForKey:page_];
NSDebugMLog(@"pagesStatistics=%@",pagesStatistics);
NSDebugMLog(@"_pageStats=%@",_pageStats);
if (_pageStats)
pageStats=[_pagesStatistics objectForKey:aPage];
NSDebugMLog(@"pagesStatistics=%@",_pagesStatistics);
NSDebugMLog(@"pageStats=%@",pageStats);
if (pageStats)
{
_AvgRespTime=[_pageStats objectForKey:@"Avg Resp. Time"];
_MinRespTime=[_pageStats objectForKey:@"Min Resp. Time"];
_MaxRespTime=[_pageStats objectForKey:@"Max Resp. Time"];
_Served=[_pageStats objectForKey:@"Served"];
AvgRespTime=[pageStats objectForKey:@"Avg Resp. Time"];
MinRespTime=[pageStats objectForKey:@"Min Resp. Time"];
MaxRespTime=[pageStats objectForKey:@"Max Resp. Time"];
Served=[pageStats objectForKey:@"Served"];
_ServedValue=[_Served intValue];
if (_MinRespTime)
ServedValue=[Served intValue];
if (MinRespTime)
{
_MinRespTimeValue=[_MinRespTime doubleValue];
_MinRespTimeValue=min(_MinRespTimeValue,timeInterval_);
MinRespTimeValue=[MinRespTime doubleValue];
MinRespTimeValue=min(MinRespTimeValue,aTimeInterval);
}
else
_MinRespTimeValue=timeInterval_;
if (_MaxRespTime)
MinRespTimeValue=aTimeInterval;
if (MaxRespTime)
{
_MaxRespTimeValue=[_MaxRespTime doubleValue];
_MaxRespTimeValue=max(_MaxRespTimeValue,timeInterval_);
MaxRespTimeValue=[MaxRespTime doubleValue];
MaxRespTimeValue=max(MaxRespTimeValue,aTimeInterval);
}
else
_MaxRespTimeValue=timeInterval_;
if (_AvgRespTime)
MaxRespTimeValue=aTimeInterval;
if (AvgRespTime)
{
_AvgRespTimeValue=[_AvgRespTime doubleValue];
_AvgRespTimeValue=((_AvgRespTimeValue*_ServedValue)+timeInterval_)/(_ServedValue+1);
AvgRespTimeValue=[AvgRespTime doubleValue];
AvgRespTimeValue=((AvgRespTimeValue*ServedValue)+aTimeInterval)/(ServedValue+1);
}
else
_AvgRespTimeValue=timeInterval_;
_Served++;
AvgRespTimeValue=aTimeInterval;
Served++;
}
else
{
_pageStats=[NSMutableDictionary dictionary];
[pagesStatistics setObject:_pageStats
forKey:page_];
_AvgRespTimeValue=timeInterval_;
_MinRespTimeValue=timeInterval_;
_MaxRespTimeValue=timeInterval_;
_ServedValue=1;
pageStats=[NSMutableDictionary dictionary];
[_pagesStatistics setObject:pageStats
forKey:aPage];
AvgRespTimeValue=aTimeInterval;
MinRespTimeValue=aTimeInterval;
MaxRespTimeValue=aTimeInterval;
ServedValue=1;
};
_AvgRespTime=[NSNumber numberWithDouble:_AvgRespTimeValue];
_MinRespTime=[NSNumber numberWithDouble:_MinRespTimeValue];
_MaxRespTime=[NSNumber numberWithDouble:_MaxRespTimeValue];
_Served=[NSNumber numberWithInt:_ServedValue];
NSDebugMLog(@"_AvgRespTime=%@",_AvgRespTime);
NSDebugMLog(@"_MinRespTime=%@",_MinRespTime);
NSDebugMLog(@"_MaxRespTime=%@",_MaxRespTime);
NSDebugMLog(@"_Served=%@",_Served);
[_pageStats setObject:_AvgRespTime
AvgRespTime=[NSNumber numberWithDouble:AvgRespTimeValue];
MinRespTime=[NSNumber numberWithDouble:MinRespTimeValue];
MaxRespTime=[NSNumber numberWithDouble:MaxRespTimeValue];
Served=[NSNumber numberWithInt:ServedValue];
NSDebugMLog(@"AvgRespTime=%@",AvgRespTime);
NSDebugMLog(@"MinRespTime=%@",MinRespTime);
NSDebugMLog(@"MaxRespTime=%@",MaxRespTime);
NSDebugMLog(@"Served=%@",Served);
[pageStats setObject:AvgRespTime
forKey:@"Avg Resp. Time"];
[_pageStats setObject:_MinRespTime
[pageStats setObject:MinRespTime
forKey:@"Min Resp. Time"];
[_pageStats setObject:_MaxRespTime
[pageStats setObject:MaxRespTime
forKey:@"Max Resp. Time"];
[_pageStats setObject:_Served
[pageStats setObject:Served
forKey:@"Served"];
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -280,34 +288,36 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)_updateDAStatisticsForActionNamed:(id)name_
timeInterval:(NSTimeInterval)timeInterval_
-(void)_updateDAStatisticsForActionNamed:(id)aName
timeInterval:(NSTimeInterval)aTimeInterval
{
LOGObjectFnNotImplemented(); //TODOFN
};
//--------------------------------------------------------------------
-(void)_sessionTerminating:(id)session_
-(void)_sessionTerminating:(id)aSession
{
//OK
LOGObjectFnStart();
[self lock];
NS_DURING
{
int _activeSessionsCount=[GSWApp _activeSessionsCount];
NSArray* _statistics=[session_ statistics];
NSDate* _sessionBirthDate=nil;
NSTimeInterval _sessionTimeOut=0;
int _sessionRequestCounter=0;
[self _updatePathsStatisticsWithPaths:_statistics];
_sessionBirthDate=[session_ _birthDate];
_sessionTimeOut=[session_ timeOut];
_sessionRequestCounter=[session_ _requestCounter];
int activeSessionsCount=[GSWApp _activeSessionsCount];
NSArray* statistics=[aSession statistics];
NSDate* sessionBirthDate=nil;
NSTimeInterval sessionTimeOut=0;
int sessionRequestCounter=0;
[self _updatePathsStatisticsWithPaths:statistics];
sessionBirthDate=[aSession _birthDate];
sessionTimeOut=[aSession timeOut];
sessionRequestCounter=[aSession _requestCounter];
//TODOFN
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -318,22 +328,24 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)_applicationCreatedSession:(GSWSession*)session_
-(void)_applicationCreatedSession:(GSWSession*)aSession
{
//OK
int _activeSessionsCount=0;
int activeSessionsCount=0;
LOGObjectFnStart();
[self lock];
NS_DURING
{
_activeSessionsCount=[[GSWApplication application] _activeSessionsCount];
ASSIGN(maxActiveSessionsDate,[NSDate date]);
maxActiveSessionsCount=max(_activeSessionsCount,maxActiveSessionsCount);
sessionsCount++; //ou _activeSessionsCount
activeSessionsCount=[[GSWApplication application] _activeSessionsCount];
ASSIGN(_maxActiveSessionsDate,[NSDate date]);
_maxActiveSessionsCount=max(activeSessionsCount,_maxActiveSessionsCount);
_sessionsCount++; //ou activeSessionsCount
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -347,20 +359,22 @@ static char rcsId[] = "$Id$";
-(void)_applicationDidHandleComponentActionRequest
{
//OK
double _timeInterval=0;
double timeInterval=0;
LOGObjectFnStart();
[self lock];
NS_DURING
{
_timeInterval=[self _applicationDidHandleRequest];
NSDebugMLog(@"currentPage=%@",currentPage);
if (currentPage)//TODO no current page if no session (error page,...)
[self _updatePagesStatisticsForPage:currentPage
timeInterval:_timeInterval];
timeInterval=[self _applicationDidHandleRequest];
NSDebugMLog(@"currentPage=%@",_currentPage);
if (_currentPage)//TODO no current page if no session (error page,...)
[self _updatePagesStatisticsForPage:_currentPage
timeInterval:timeInterval];
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -371,7 +385,7 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name_
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)aName
{
LOGObjectFnNotImplemented(); //TODOFN
};
@ -381,11 +395,11 @@ static char rcsId[] = "$Id$";
{
//OK
LOGObjectFnNotImplemented(); //TODOFN
//lastDidHandleRequestTimeInterval=115.005370 (ancien=53.516954)
//totalTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
//movingTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
//_lastDidHandleRequestTimeInterval=115.005370 (ancien=53.516954)
//_totalTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
//_movingTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
return movingTransactionTimeInterval; //??? 61.488416: ou _totalTransactionTimeInterval - precedent
return _movingTransactionTimeInterval; //??? 61.488416: ou _totalTransactionTimeInterval - precedent
};
//--------------------------------------------------------------------
@ -396,12 +410,14 @@ static char rcsId[] = "$Id$";
[self lock];
NS_DURING
{
directActionTransactionsCount++;
_directActionTransactionsCount++;
[self _applicationWillHandleRequest];
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -419,12 +435,14 @@ static char rcsId[] = "$Id$";
[self lock];
NS_DURING
{
componentActionTransactionsCount++;
_componentActionTransactionsCount++;
[self _applicationWillHandleRequest];
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -439,13 +457,13 @@ static char rcsId[] = "$Id$";
{
//OK
LOGObjectFnNotImplemented(); //TODOFN
transactionsCount++;
_transactionsCount++;
/*
lastWillHandleRequestTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
totalIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
movingIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
*/
movingAverageTransactionsCount++;
_movingAverageTransactionsCount++;
};
@end
@ -454,23 +472,25 @@ static char rcsId[] = "$Id$";
@implementation GSWStatisticsStore (GSWStatisticsStoreB)
//--------------------------------------------------------------------
-(NSString*)descriptionForResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
//OK
GSWComponent* _page=nil;
NSString* _description=nil;
GSWComponent* page=nil;
NSString* description=nil;
LOGObjectFnStart();
[self lock];
NS_DURING
{
_page=[context_ page];
_description=[_page descriptionForResponse:response_
inContext:context_];
page=[aContext page];
description=[page descriptionForResponse:aResponse
inContext:aContext];
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -478,31 +498,33 @@ static char rcsId[] = "$Id$";
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return _description;
return description;
};
//--------------------------------------------------------------------
-(void)recordStatisticsForResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)recordStatisticsForResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
//OK
GSWComponent* _page=nil;
NSString* _pageName=nil;
GSWComponent* page=nil;
NSString* pageName=nil;
LOGObjectFnStart();
[self lock];
NS_DURING
{
_page=[context_ page];
NSDebugMLog(@"_page=%@",_page);
_pageName=[_page name];
NSDebugMLog(@"_pageName=%@",_pageName);
ASSIGN(currentPage,_pageName);
NSDebugMLog(@"currentPage=%@",currentPage);
page=[aContext page];
NSDebugMLog(@"page=%@",page);
pageName=[page name];
NSDebugMLog(@"pageName=%@",pageName);
ASSIGN(_currentPage,pageName);
NSDebugMLog(@"_currentPage=%@",_currentPage);
[self _memoryUsage];//TODO Delete because it's Just for Test !
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -518,7 +540,7 @@ static char rcsId[] = "$Id$";
@implementation GSWStatisticsStore (GSWStatisticsStoreC)
//--------------------------------------------------------------------
-(void)logString:(id)string_
-(void)logString:(id)aString
{
LOGObjectFnNotImplemented(); //TODOFN
};
@ -528,23 +550,25 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return logRotation;
return _logRotation;
};
//--------------------------------------------------------------------
-(NSString*)logFile
{
//OK
NSString* _logFile=nil;
NSString* logFile=nil;
LOGObjectFnStart();
[self lock];
NS_DURING
{
_logFile=logPath;
logFile=_logPath;
}
NS_HANDLER
{
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
localException,[localException reason],
__FILE__,__LINE__);
//TODO
[self unlock];
[localException raise];
@ -552,23 +576,23 @@ static char rcsId[] = "$Id$";
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return _logFile;
return logFile;
};
//--------------------------------------------------------------------
-(void) setLogFile:(id)logFile_
-(void) setLogFile:(id)logFile
rotationFrequencyInDays:(double)rotationFrequency
{
LOGObjectFnStart();
ASSIGN(logPath,logFile_);
logRotation=rotationFrequency;
ASSIGN(_logPath,logFile);
_logRotation=rotationFrequency;
LOGObjectFnStop();
};
//--------------------------------------------------------------------
-(id)formatDescription:(id)description_
forResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(id)formatDescription:(id)description
forResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
@ -584,7 +608,7 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return password;
return _password;
};
//--------------------------------------------------------------------
@ -592,7 +616,7 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return pathsStatistics;
return _pathsStatistics;
};
//--------------------------------------------------------------------
@ -600,7 +624,7 @@ static char rcsId[] = "$Id$";
{
LOGObjectFnStart();
LOGObjectFnStop();
return pagesStatistics;
return _pagesStatistics;
};
//--------------------------------------------------------------------
@ -613,39 +637,39 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(NSDictionary*)_memoryUsage
{
struct rusage _rusage;
struct rusage rusageStruct;
int i=0;
LOGObjectFnStart();
//Use NSRealMemoryAvailable ??
for(i=0;i<2;i++)
{
memset(&_rusage,0,sizeof(_rusage));
if (getrusage(i>0 ? RUSAGE_CHILDREN : RUSAGE_SELF,&_rusage)!=0)
memset(&rusageStruct,0,sizeof(rusageStruct));
if (getrusage(i>0 ? RUSAGE_CHILDREN : RUSAGE_SELF,&rusageStruct)!=0)
{
LOGError(@"getrusage faled %d",errno);
}
else
{
NSTimeInterval _userTime=NSTimeIntervalFromTimeVal(&_rusage.ru_utime);
NSTimeInterval _systemTime=NSTimeIntervalFromTimeVal(&_rusage.ru_stime);
NSDebugMLog(@"_userTime=%ld",(long)_userTime);
NSDebugMLog(@"_systemTime=%ld",(long)_systemTime);
NSDebugMLog(@"ru_maxrss=%ld",_rusage.ru_maxrss); /* maximum resident set size */
NSDebugMLog(@"ru_ixrss=%ld",_rusage.ru_ixrss); /* integral shared memory size */
NSDebugMLog(@"ru_idrss=%ld",_rusage.ru_idrss); /* integral unshared data size */
NSDebugMLog(@"ru_isrss=%ld",_rusage.ru_isrss); /* integral unshared stack size */
NSDebugMLog(@"ru_minflt=%ld",_rusage.ru_minflt); /* page reclaims */
NSDebugMLog(@"ru_minflt bytes=%ld",_rusage.ru_minflt*getpagesize()); /* page reclaims */
NSDebugMLog(@"ru_majflt=%ld",_rusage.ru_majflt); /* page faults */
NSDebugMLog(@"ru_majflt bytes=%ld",_rusage.ru_majflt*getpagesize()); /* page faults */
NSDebugMLog(@"ru_nswap=%ld",_rusage.ru_nswap); /* swaps */
NSDebugMLog(@"ru_inblock=%ld",_rusage.ru_inblock); /* block input operations */
NSDebugMLog(@"ru_oublock=%ld",_rusage.ru_oublock); /* block output operations */
NSDebugMLog(@"ru_msgsnd=%ld",_rusage.ru_msgsnd); /* messages sent */
NSDebugMLog(@"ru_msgrcv=%ld",_rusage.ru_msgrcv); /* messages received */
NSDebugMLog(@"ru_nsignals=%ld",_rusage.ru_nsignals); /* signals received */
NSDebugMLog(@"ru_nvcsw=%ld",_rusage.ru_nvcsw); /* voluntary context switches */
NSDebugMLog(@"ru_nivcsw=%ld",_rusage.ru_nivcsw); /* involuntary context switches */
NSTimeInterval userTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_utime);
NSTimeInterval systemTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_stime);
NSDebugMLog(@"userTime=%ld",(long)userTime);
NSDebugMLog(@"systemTime=%ld",(long)systemTime);
NSDebugMLog(@"ru_maxrss=%ld",rusageStruct.ru_maxrss); /* maximum resident set size */
NSDebugMLog(@"ru_ixrss=%ld",rusageStruct.ru_ixrss); /* integral shared memory size */
NSDebugMLog(@"ru_idrss=%ld",rusageStruct.ru_idrss); /* integral unshared data size */
NSDebugMLog(@"ru_isrss=%ld",rusageStruct.ru_isrss); /* integral unshared stack size */
NSDebugMLog(@"ru_minflt=%ld",rusageStruct.ru_minflt); /* page reclaims */
NSDebugMLog(@"ru_minflt bytes=%ld",rusageStruct.ru_minflt*getpagesize()); /* page reclaims */
NSDebugMLog(@"ru_majflt=%ld",rusageStruct.ru_majflt); /* page faults */
NSDebugMLog(@"ru_majflt bytes=%ld",rusageStruct.ru_majflt*getpagesize()); /* page faults */
NSDebugMLog(@"ru_nswap=%ld",rusageStruct.ru_nswap); /* swaps */
NSDebugMLog(@"ru_inblock=%ld",rusageStruct.ru_inblock); /* block input operations */
NSDebugMLog(@"ru_oublock=%ld",rusageStruct.ru_oublock); /* block output operations */
NSDebugMLog(@"ru_msgsnd=%ld",rusageStruct.ru_msgsnd); /* messages sent */
NSDebugMLog(@"ru_msgrcv=%ld",rusageStruct.ru_msgrcv); /* messages received */
NSDebugMLog(@"ru_nsignals=%ld",rusageStruct.ru_nsignals); /* signals received */
NSDebugMLog(@"ru_nvcsw=%ld",rusageStruct.ru_nvcsw); /* voluntary context switches */
NSDebugMLog(@"ru_nivcsw=%ld",rusageStruct.ru_nivcsw); /* involuntary context switches */
};
};
{
@ -699,7 +723,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return movingAverageSessionLife;
return _movingAverageSessionLife;
};
//--------------------------------------------------------------------
@ -707,7 +731,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return averageSessionLife;
return _averageSessionLife;
};
//--------------------------------------------------------------------
@ -715,7 +739,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return movingAverageRequestsPerSession;
return _movingAverageRequestsPerSession;
};
//--------------------------------------------------------------------
@ -723,7 +747,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return averageRequestsPerSession;
return _averageRequestsPerSession;
};
//--------------------------------------------------------------------
@ -731,7 +755,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return maxActiveSessionsDate;
return _maxActiveSessionsDate;
};
//--------------------------------------------------------------------
@ -739,7 +763,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return maxActiveSessionsCount;
return _maxActiveSessionsCount;
};
//--------------------------------------------------------------------
@ -747,61 +771,61 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return sessionsCount;
return _sessionsCount;
};
//--------------------------------------------------------------------
-(double)_movingAverageTransactionTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return movingTransactionTimeInterval/movingAverageTransactionsCount; //?
return _movingTransactionTimeInterval/_movingAverageTransactionsCount; //?
};
//--------------------------------------------------------------------
-(double)_movingAverageIdleTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return movingIdleTimeInterval/movingAverageTransactionsCount;//??
return _movingIdleTimeInterval/_movingAverageTransactionsCount;//??
};
//--------------------------------------------------------------------
-(double)_averageCATransactionTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return totalCATransactionTimeInterval/movingAverageTransactionsCount; //??
return _totalCATransactionTimeInterval/_movingAverageTransactionsCount; //??
};
//--------------------------------------------------------------------
-(double)_averageDATransactionTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return totalDATransactionTimeInterval/movingAverageTransactionsCount; //??
return _totalDATransactionTimeInterval/_movingAverageTransactionsCount; //??
};
//--------------------------------------------------------------------
-(double)_averageTransactionTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return totalTransactionTimeInterval/movingAverageTransactionsCount; //?
return _totalTransactionTimeInterval/_movingAverageTransactionsCount; //?
};
//--------------------------------------------------------------------
-(double)_averageIdleTime
{
LOGObjectFnStart();
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
LOGObjectFnStop();
return totalIdleTimeInterval/movingAverageTransactionsCount;//??
return _totalIdleTimeInterval/_movingAverageTransactionsCount;//??
};
//--------------------------------------------------------------------
@ -809,7 +833,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return directActionTransactionsCount;
return _directActionTransactionsCount;
};
//--------------------------------------------------------------------
@ -817,7 +841,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return componentActionTransactionsCount;
return _componentActionTransactionsCount;
};
//--------------------------------------------------------------------
@ -825,7 +849,7 @@ s
{
LOGObjectFnStart();
LOGObjectFnStop();
return transactionsCount;
return _transactionsCount;
};
@end
@ -834,18 +858,18 @@ s
@implementation GSWStatisticsStore (GSWStatisticsStoreE)
//--------------------------------------------------------------------
-(BOOL)validateLogin:(id)login_
forSession:(id)session_
-(BOOL)validateLogin:(id)aLogin
forSession:(id)aSession
{
LOGObjectFnNotImplemented(); //TODOFN
return NO;
};
//--------------------------------------------------------------------
-(void)setPassword:(NSString*)password_
-(void)setPassword:(NSString*)aPassword
{
LOGObjectFnStart();
ASSIGN(password,password_);
ASSIGN(_password,aPassword);
LOGObjectFnStop();
};
@ -854,7 +878,7 @@ s
//====================================================================
@implementation GSWStatisticsStore (GSWStatisticsStoreF)
//--------------------------------------------------------------------
-(BOOL)validateLogin:(id)login_
-(BOOL)validateLogin:(id)aLogin
{
LOGObjectFnNotImplemented(); //TODOFN
return NO;
@ -876,7 +900,7 @@ s
@implementation GSWStatisticsStore (GSWStatisticsStoreH)
//--------------------------------------------------------------------
+(id)timeIntervalDescription:(double)timeInterval_
+(id)timeIntervalDescription:(double)aTimeInterval
{
LOGClassFnNotImplemented(); //TODOFN
return nil;

View file

@ -1,11 +1,16 @@
/* GSWStats.h - GSWeb: Class GSWStats
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWStats.h - <title>GSWeb: Class GSWStats</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$

View file

@ -1,11 +1,16 @@
/* GSWStats.m - GSWeb: Class GSWStats
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWStats.m - <title>GSWeb: Class GSWStats</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -29,8 +35,8 @@ static char rcsId[] = "$Id$";
@implementation GSWStats
-(id)defaultAction
{
GSWComponent* _component=[self pageWithName:@"GSWStatsPage"];
return _component;
GSWComponent* component=[self pageWithName:@"GSWStatsPage"];
return component;
};
@end

View file

@ -1,11 +1,16 @@
/* GSWTemplateParser.h - GSWeb: Class GSWTemplateParser
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWTemplateParser - <title>GSWeb: Class GSWTemplateParser</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -43,53 +49,53 @@
int tagN;
}
+(GSWElement*)templateNamed:(NSString*)name_
inFrameworkNamed:(NSString*)frameworkName_
+(GSWElement*)templateNamed:(NSString*)aName
inFrameworkNamed:(NSString*)aFrameworkName
withParserClassName:(NSString*)parserClassName
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding
fromPath:(NSString*)HTMLPath
definitionsString:(NSString*)pageDefString
languages:(NSArray*)languages_
definitionPath:(NSString*)definitionPath_;
+(GSWElement*)templateNamed:(NSString*)name_
inFrameworkNamed:(NSString*)frameworkName_
languages:(NSArray*)someLanguages
definitionPath:(NSString*)aDefinitionPath;
+(GSWElement*)templateNamed:(NSString*)aName
inFrameworkNamed:(NSString*)aFrameworkName
withParserClass:(Class)parserClass
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding
fromPath:(NSString*)HTMLPath
definitionsString:(NSString*)pageDefString
languages:(NSArray*)languages_
definitionPath:(NSString*)definitionPath_;
languages:(NSArray*)someLanguages
definitionPath:(NSString*)aDefinitionPath;
+(void)setDefaultParserClassName:(NSString*)parserClassName;
+(NSString*)defaultParserClassName;
+(Class)defaultParserClass;
-(id)initWithTemplateName:(NSString*)name_
inFrameworkName:(NSString*)frameworkName_
-(id)initWithTemplateName:(NSString*)aName
inFrameworkName:(NSString*)aFrameworkName
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding_
encoding:(NSStringEncoding)anEncoding
fromPath:(NSString*)HTMLPath
withDefinitionsString:(NSString*)pageDefString
fromPath:(NSString*)definitionPath_
forLanguages:(NSArray*)languages_;
fromPath:(NSString*)aDefinitionPath
forLanguages:(NSArray*)someLanguages;
-(void)dealloc;
-(NSString*)logPrefix;
-(GSWElement*)template;
-(NSArray*)templateElements;
-(NSDictionary*)definitions;
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring_
named:(NSString*)localDefinitionName_
inFrameworkNamed:(NSString*)localFrameworkName_
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring
named:(NSString*)localDefinitionName
inFrameworkNamed:(NSString*)localFrameworkName
processedFiles:(NSMutableSet*)processedFiles;
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName_
fromFrameworkNamed:(NSString*)fromFrameworkName_
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName
fromFrameworkNamed:(NSString*)fromFrameworkName
processedFiles:(NSMutableSet*)processedFiles;
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes_
named:(NSString*)localDefinitionsName_
inFrameworkNamed:(NSString*)localFrameworkName_
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes
named:(NSString*)localDefinitionsName
inFrameworkNamed:(NSString*)localFrameworkName
processedFiles:(NSMutableSet*)processedFiles;
@end

View file

@ -2,7 +2,7 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
@ -72,67 +72,67 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
};
//--------------------------------------------------------------------
+(GSWElement*)templateNamed:(NSString*)name_
inFrameworkNamed:(NSString*)frameworkName_
+(GSWElement*)templateNamed:(NSString*)aName
inFrameworkNamed:(NSString*)aFrameworkName
withParserClassName:(NSString*)parserClassName
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding_
encoding:(NSStringEncoding)anEncoding
fromPath:(NSString*)HTMLPath
definitionsString:(NSString*)pageDefString
languages:(NSArray*)languages_
definitionPath:(NSString*)definitionPath_
languages:(NSArray*)someLanguages
definitionPath:(NSString*)aDefinitionPath
{
GSWElement* resultTemplate=nil;
Class parserClass=Nil;
LOGClassFnStart();
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
NSDebugMLLog(@"GSWTemplateParser",@"aDefinitionPath=%@",aDefinitionPath);
if (parserClassName)
{
parserClass=NSClassFromString(parserClassName);
NSAssert1(parserClass,@"No Parser class named %@",parserClassName);
};
resultTemplate=[self templateNamed:name_
inFrameworkNamed:frameworkName_
resultTemplate=[self templateNamed:aName
inFrameworkNamed:aFrameworkName
withParserClass:parserClass
withString:HTMLString
encoding:encoding_
encoding:anEncoding
fromPath:HTMLPath
definitionsString:pageDefString
languages:languages_
definitionPath:definitionPath_];
languages:someLanguages
definitionPath:aDefinitionPath];
LOGClassFnStop();
return resultTemplate;
};
//--------------------------------------------------------------------
+(GSWElement*)templateNamed:(NSString*)name_
inFrameworkNamed:(NSString*)frameworkName_
+(GSWElement*)templateNamed:(NSString*)aName
inFrameworkNamed:(NSString*)aFrameworkName
withParserClass:(Class)parserClass
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding_
encoding:(NSStringEncoding)anEncoding
fromPath:(NSString*)HTMLPath
definitionsString:(NSString*)pageDefString
languages:(NSArray*)languages_
definitionPath:(NSString*)definitionPath_
languages:(NSArray*)someLanguages
definitionPath:(NSString*)aDefinitionPath
{
GSWElement* resultTemplate=nil;
GSWTemplateParser* templateParser=nil;
LOGClassFnStart();
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ frameworkName:%@ pageDefString=%@",name_,frameworkName_,pageDefString);
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ frameworkName:%@ pageDefString=%@",aName,aFrameworkName,pageDefString);
NSDebugMLLog(@"GSWTemplateParser",@"aDefinitionPath=%@",aDefinitionPath);
if (!parserClass)
{
parserClass=[self defaultParserClass];
NSAssert(parserClass,@"No defaultParser Class");
};
templateParser=[[[parserClass alloc] initWithTemplateName:name_
inFrameworkName:frameworkName_
templateParser=[[[parserClass alloc] initWithTemplateName:aName
inFrameworkName:aFrameworkName
withString:HTMLString
encoding:encoding_
encoding:anEncoding
fromPath:HTMLPath
withDefinitionsString:pageDefString
fromPath:definitionPath_
forLanguages:languages_] autorelease];
fromPath:aDefinitionPath
forLanguages:someLanguages] autorelease];
if (templateParser)
resultTemplate=[templateParser template];
LOGClassFnStop();
@ -140,25 +140,25 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
};
//--------------------------------------------------------------------
-(id)initWithTemplateName:(NSString*)name_
inFrameworkName:(NSString*)frameworkName_
-(id)initWithTemplateName:(NSString*)aName
inFrameworkName:(NSString*)aFrameworkName
withString:(NSString*)HTMLString
encoding:(NSStringEncoding)encoding_
encoding:(NSStringEncoding)anEncoding
fromPath:(NSString*)HTMLPath
withDefinitionsString:(NSString*)pageDefString
fromPath:(NSString*)definitionPath_
forLanguages:(NSArray*)languages_
fromPath:(NSString*)aDefinitionPath
forLanguages:(NSArray*)someLanguages
{
if ((self=[self init]))
{
ASSIGN(_templateName,name_);
ASSIGN(_frameworkName,frameworkName_);
ASSIGN(_templateName,aName);
ASSIGN(_frameworkName,aFrameworkName);
ASSIGN(_string,HTMLString);
_stringEncoding=encoding_;
_stringEncoding=anEncoding;
ASSIGN(_stringPath,HTMLPath);
ASSIGN(_definitionsString,pageDefString);
ASSIGN(_languages,languages_);
ASSIGN(_definitionFilePath,definitionPath_);
ASSIGN(_languages,someLanguages);
ASSIGN(_definitionFilePath,aDefinitionPath);
};
return self;
};
@ -210,7 +210,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
NSEnumerator* _enum = [definitionsElements objectEnumerator];
id _obj=nil;
NSString* _className=nil;
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ definitionsElements=%@",name_,definitionsElements);
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ definitionsElements=%@",aName,definitionsElements);
while ((_obj = [_enum nextObject]))
{
_className=[_obj className];
@ -300,9 +300,9 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
};
//--------------------------------------------------------------------
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring_
named:(NSString*)localDefinitionName_
inFrameworkNamed:(NSString*)localFrameworkName_
-(NSDictionary*)parseDefinitionsString:(NSString*)aLocalDefinitionString
named:(NSString*)aLocalDefinitionName
inFrameworkNamed:(NSString*)aLocalFrameworkName
processedFiles:(NSMutableSet*)processedFiles
{
NSDictionary* returnedLocalDefinitions=nil;
@ -316,7 +316,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
GSWPageDefParser* definitionsParser=nil;
LOGObjectFnStart();
arpParse=[NSAutoreleasePool new];
definitionsStream=[[ANTLRTextInputStreamString newWithString:localDefinitionstring_]
definitionsStream=[[ANTLRTextInputStreamString newWithString:aLocalDefinitionString]
autorelease];
definitionsLexer=[[[GSWPageDefLexer alloc]initWithTextStream:definitionsStream]
autorelease];
@ -325,8 +325,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
autorelease];
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles=%@",processedFiles);
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ definitionsString=%@",
localDefinitionName_,
localDefinitionstring_);
aLocalDefinitionName,
aLocalDefinitionString);
NS_DURING
{
NSDebugMLLog0(@"low",@"Call definitionsParser");
@ -339,9 +339,9 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
ExceptionRaise(@"GSWTemplateParser",
@"%@ Errors in Definitions parsing template named %@: %@\nString:\n%@",
[self logPrefix],
localDefinitionName_,
aLocalDefinitionName,
[definitionsParser errors],
localDefinitionstring_);
aLocalDefinitionString);
};
NSDebugMLLog0(@"low",@"Call [definitionsParser elements]");
tmpDefinitions=[[[definitionsParser elements] mutableCopy] autorelease];
@ -354,7 +354,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
{
LOGError(@"%@ name:%@ Definitions Parse failed!",
[self logPrefix],
localDefinitionName_);
aLocalDefinitionName);
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"%@ In [definitionsParser document]...",
[self logPrefix]);
@ -378,12 +378,12 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
if (localDefinitions)
{
NSDebugMLLog(@"GSWTemplateParser",@"definitionsIncludes:%@\n",definitionsIncludes);
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitionName_:%@\n",localDefinitionName_);
NSDebugMLLog(@"GSWTemplateParser",@"localFrameworkName_:%@\n",localFrameworkName_);
NSDebugMLLog(@"GSWTemplateParser",@"aLocalDefinitionName:%@\n",aLocalDefinitionName);
NSDebugMLLog(@"GSWTemplateParser",@"aLocalFrameworkName:%@\n",aLocalFrameworkName);
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles:%@\n",processedFiles);
tmpDefinitions=[self processIncludes:definitionsIncludes
named:localDefinitionName_
inFrameworkNamed:localFrameworkName_
named:aLocalDefinitionName
inFrameworkNamed:aLocalFrameworkName
processedFiles:processedFiles];
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
if (tmpDefinitions)
@ -393,7 +393,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
localDefinitions=nil;
LOGError(@"%@ Template name:%@ componentDefinition parse failed for definitionsIncludes:%@",
[self logPrefix],
localDefinitionName_,
aLocalDefinitionName,
definitionsIncludes);
};
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
@ -406,8 +406,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
};
//--------------------------------------------------------------------
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName_
fromFrameworkNamed:(NSString*)fromFrameworkName_
-(NSDictionary*)parseDefinitionInclude:(NSString*)anIncludeName
fromFrameworkNamed:(NSString*)fromFrameworkName
processedFiles:(NSMutableSet*)processedFiles
{
NSDictionary* returnedLocalDefinitions=nil;
@ -415,99 +415,99 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
NSDictionary* tmpDefinitions=nil;
NSString* localFrameworkName=nil;
NSString* localDefinitionName=nil;
NSString* _language=nil;
NSString* _resourceName=nil;
NSString* language=nil;
NSString* resourceName=nil;
NSString* localDefinitionResourceName=nil;
GSWResourceManager* _resourceManager=nil;
NSString* _path=nil;
GSWResourceManager* resourceManager=nil;
NSString* path=nil;
int iLanguage=0;
int iName=0;
LOGObjectFnStart();
NSDebugMLLog(@"gswcomponents",@"includeName_=%@",includeName_);
_resourceManager=[GSWApp resourceManager];
localDefinitionName=[includeName_ lastPathComponent];
localFrameworkName=[includeName_ stringByDeletingLastPathComponent];
NSDebugMLLog(@"gswcomponents",@"anIncludeName=%@",anIncludeName);
resourceManager=[GSWApp resourceManager];
localDefinitionName=[anIncludeName lastPathComponent];
localFrameworkName=[anIncludeName stringByDeletingLastPathComponent];
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
NSDebugMLLog(@"gswcomponents",@"fromFrameworkName_=%@",fromFrameworkName_);
NSDebugMLLog(@"gswcomponents",@"fromFrameworkName=%@",fromFrameworkName);
if ([localFrameworkName length]==0)
localFrameworkName=fromFrameworkName_;
localFrameworkName=fromFrameworkName;
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
for(iLanguage=0;iLanguage<=[_languages count] && !_path;iLanguage++)
for(iLanguage=0;iLanguage<=[_languages count] && !path;iLanguage++)
{
if (iLanguage<[_languages count])
_language=[_languages objectAtIndex:iLanguage];
language=[_languages objectAtIndex:iLanguage];
else
_language=nil;
for(iName=0;!_path && iName<2;iName++)
language=nil;
for(iName=0;!path && iName<2;iName++)
{
_resourceName=[localDefinitionName stringByAppendingString:GSWPagePSuffix[GSWebNamingConvForRound(iName)]];
resourceName=[localDefinitionName stringByAppendingString:GSWPagePSuffix[GSWebNamingConvForRound(iName)]];
localDefinitionResourceName=[localDefinitionName stringByAppendingString:GSWComponentDefinitionPSuffix[GSWebNamingConvForRound(iName)]];
NSDebugMLLog(@"gswcomponents",@"_resourceName=%@ localDefinitionResourceName=%@ localDefinitionName=%@",
_resourceName,
NSDebugMLLog(@"gswcomponents",@"resourceName=%@ localDefinitionResourceName=%@ localDefinitionName=%@",
resourceName,
localDefinitionResourceName,
localDefinitionName);
NSDebugMLLog(@"gswcomponents",@"Search %@ Language=%@",_resourceName,_language);
_path=[_resourceManager pathForResourceNamed:_resourceName
NSDebugMLLog(@"gswcomponents",@"Search %@ Language=%@",resourceName,language);
path=[resourceManager pathForResourceNamed:resourceName
inFramework:localFrameworkName
language:_language];
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: _language=%@ _path=%@ processedFiles=%@",
_language,
_path,
language:language];
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: language=%@ path=%@ processedFiles=%@",
language,
path,
processedFiles);
if (_path)
if (path)
{
_path=[_path stringByAppendingPathComponent:localDefinitionResourceName];
NSDebugMLLog(@"gswcomponents",@"Found %@ Language=%@ : %@",_resourceName,_language,_path);
if ([processedFiles containsObject:_path])
path=[path stringByAppendingPathComponent:localDefinitionResourceName];
NSDebugMLLog(@"gswcomponents",@"Found %@ Language=%@ : %@",resourceName,language,path);
if ([processedFiles containsObject:path])
{
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",_path);
_path=nil;
if (_language)
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",path);
path=nil;
if (language)
iLanguage=[_languages count]-1;//For directly go to no language search so we don't include (for exemple) an English file for a french file
};
};
if (!_path)
if (!path)
{
NSDebugMLLog(@"gswcomponents",@"Direct Search %@ Language=%@",localDefinitionResourceName,_language);
_path=[_resourceManager pathForResourceNamed:localDefinitionResourceName
NSDebugMLLog(@"gswcomponents",@"Direct Search %@ Language=%@",localDefinitionResourceName,language);
path=[resourceManager pathForResourceNamed:localDefinitionResourceName
inFramework:localFrameworkName
language:_language];
if (_path)
language:language];
if (path)
{
NSDebugMLLog(@"gswcomponents",@"Direct Found %@ Language=%@ : %@",localDefinitionResourceName,_language,_path);
if ([processedFiles containsObject:_path])
NSDebugMLLog(@"gswcomponents",@"Direct Found %@ Language=%@ : %@",localDefinitionResourceName,language,path);
if ([processedFiles containsObject:path])
{
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",_path);
_path=nil;
if (_language)
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",path);
path=nil;
if (language)
iLanguage=[_languages count]-1;//For directly go to no language search so we don't include (for exemple) an English file for a french file
};
};
NSDebugMLLog(@"gswcomponents",@"Direct Search in Component Definition _language=%@ _path=%@ (processedFiles=%@)",
_language,
_path,
NSDebugMLLog(@"gswcomponents",@"Direct Search in Component Definition language=%@ path=%@ (processedFiles=%@)",
language,
path,
processedFiles);
};
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: _language=%@ _path=%@ processedFiles=%@",
_language,
_path,
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: language=%@ path=%@ processedFiles=%@",
language,
path,
processedFiles);
};
};
if (_path)
if (path)
{
NSString* _pageDefString=nil;
NSDebugMLLog(@"GSWTemplateParser",@"_path=%@",_path);
[processedFiles addObject:_path];
NSString* pageDefString=nil;
NSDebugMLLog(@"GSWTemplateParser",@"path=%@",path);
[processedFiles addObject:path];
//NSString* pageDefPath=[path stringByAppendingString:_definitionPath];
//TODO use encoding !
_pageDefString=[NSString stringWithContentsOfFile:_path];
NSDebugMLLog(@"GSWTemplateParser",@"path=%@: _pageDefString:%@\n",_path,_pageDefString);
if (_pageDefString)
pageDefString=[NSString stringWithContentsOfFile:path];
NSDebugMLLog(@"GSWTemplateParser",@"path=%@: pageDefString:%@\n",path,pageDefString);
if (pageDefString)
{
tmpDefinitions=[self parseDefinitionsString:_pageDefString
named:includeName_
tmpDefinitions=[self parseDefinitionsString:pageDefString
named:anIncludeName
inFrameworkNamed:localFrameworkName
processedFiles:processedFiles];
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
@ -517,7 +517,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
{
LOGError(@"%@ Template componentDefinition parse failed for included file:%@ in framework:%@ (processedFiles=%@)",
[self logPrefix],
includeName_,
anIncludeName,
localFrameworkName,
processedFiles);
};
@ -528,7 +528,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
ExceptionRaise(@"GSWTemplateParser",
@"%@ Can't load included component definition named:%@ in framework:%@ (processedFiles=%@)",
[self logPrefix],
includeName_,
anIncludeName,
localFrameworkName,
processedFiles);
};
@ -538,7 +538,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
ExceptionRaise(@"GSWTemplateParser",
@"%@ Can't find included component definition named:%@ in framework:%@ (processedFiles=%@)",
[self logPrefix],
includeName_,
anIncludeName,
localFrameworkName,
processedFiles);
};
@ -550,45 +550,45 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
};
//--------------------------------------------------------------------
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes_
named:(NSString*)localDefinitionsName_
inFrameworkNamed:(NSString*)localFrameworkName_
-(NSDictionary*)processIncludes:(NSArray*)someDefinitionsIncludes
named:(NSString*)aLocalDefinitionsName
inFrameworkNamed:(NSString*)aLocalFrameworkName
processedFiles:(NSMutableSet*)processedFiles
{
int _count=0;
int count=0;
NSDictionary* returnedLocalDefinitions=nil;
NSMutableDictionary* localDefinitions=nil;
LOGObjectFnStart();
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ frameworkName_=%@ definitionsIncludes_=%@",
localDefinitionsName_,
localFrameworkName_,
definitionsIncludes_);
localDefinitions=[NSMutableDictionary dictionary];
_count=[definitionsIncludes_ count];
if (_count>0)
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ aFrameworkName=%@ someDefinitionsIncludes=%@",
aLocalDefinitionsName,
aLocalFrameworkName,
someDefinitionsIncludes);
localDefinitions=(NSMutableDictionary*)[NSMutableDictionary dictionary];
count=[someDefinitionsIncludes count];
if (count>0)
{
NSDictionary* tmpDefinitions=nil;
int i=0;
NSString* _includeName=nil;
for(i=_count-1;localDefinitions && i>=0;i--)
NSString* includeName=nil;
for(i=count-1;localDefinitions && i>=0;i--)
{
_includeName=[definitionsIncludes_ objectAtIndex:i];
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@",
_includeName);
tmpDefinitions=[self parseDefinitionInclude:_includeName
fromFrameworkNamed:localFrameworkName_
includeName=[someDefinitionsIncludes objectAtIndex:i];
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition includeName:%@",
includeName);
tmpDefinitions=[self parseDefinitionInclude:includeName
fromFrameworkNamed:aLocalFrameworkName
processedFiles:processedFiles];
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@ tmpDefinitions=%@",
_includeName,
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition includeName:%@ tmpDefinitions=%@",
includeName,
tmpDefinitions);
if (tmpDefinitions)
[localDefinitions addDefaultEntriesFromDictionary:tmpDefinitions];
else
{
localDefinitions=nil;
LOGError(@"%@ Template componentDefinition parse failed for _includeName:%@",
LOGError(@"%@ Template componentDefinition parse failed for includeName:%@",
[self logPrefix],
_includeName);
includeName);
};
};
};

View file

@ -1,11 +1,16 @@
/* GSWTemplateParserANTLR.h - GSWeb: Class GSWTemplateParserANTLR
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -46,12 +52,12 @@
};
-(void)dealloc;
-(NSArray*)templateElements;
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)_AST
stopOnTagNamed:(NSString*)_stopTagName;
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)AST
stopOnTagNamed:(NSString*)stopTagName;
-(BOOL)parseTag:(ANTLRDefAST)_AST;
-(NSString*)getTagNameFor:(ANTLRDefAST)_AST;
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)_AST;
-(BOOL)parseTag:(ANTLRDefAST)AST;
-(NSString*)getTagNameFor:(ANTLRDefAST)AST;
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)AST;
@end
#endif //_GSWTemplateParserANTLR_h__

View file

@ -1,11 +1,16 @@
/* GSWTemplateParserANTLR.m - GSWeb: Class GSWTemplateParserANTLR
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -152,18 +158,18 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(BOOL)parseTag:(ANTLRDefAST)_AST
-(BOOL)parseTag:(ANTLRDefAST)anAST
{
BOOL htmlAttrParseOK=YES;
NSString* tagName=[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
NSString* tagName=[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
LOGClassFnStart();
if (!tagName
&& ([_AST tokenType]==GSWHTMLTokenType_OPENTAG
|| [_AST tokenType]==GSWHTMLTokenType_CLOSETAG))
&& ([anAST tokenType]==GSWHTMLTokenType_OPENTAG
|| [anAST tokenType]==GSWHTMLTokenType_CLOSETAG))
{
NSAutoreleasePool* arpParse=nil;
ANTLRTextInputStreamString* _tagStream=[[[ANTLRTextInputStreamString alloc]
initWithString:[_AST text]]
initWithString:[anAST text]]
autorelease];
GSWHTMLAttrLexer* htmlAttrLexer=[[[GSWHTMLAttrLexer alloc]
initWithTextStream:_tagStream]
@ -173,7 +179,7 @@ static char rcsId[] = "$Id$";
autorelease];
NSString* tagName=nil;
NSDictionary* tagAttrs=nil;
NSDebugMLLog(@"low",@"PARSE:[%@]",[_AST text]);
NSDebugMLLog(@"low",@"PARSE:[%@]",[anAST text]);
NSDebugMLLog(@"low",@"stream:[%@]",_tagStream);
htmlAttrParseOK=NO;
arpParse=[NSAutoreleasePool new];
@ -197,7 +203,7 @@ static char rcsId[] = "$Id$";
NS_HANDLER
{
htmlAttrParseOK=NO;
LOGError(@"PARSE PB:[%@]",[_AST text]);//TODO
LOGError(@"PARSE PB:[%@]",[anAST text]);//TODO
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In [_tagParser tag]...");
[localException raise];
@ -217,7 +223,7 @@ static char rcsId[] = "$Id$";
DESTROY(arpParse);
NSDebugMLLog0(@"low",@"DESTROYED(arpParse)\n");
NSDebugMLLog(@"low",@"END PARSE:[%@]",[_AST text]);
NSDebugMLLog(@"low",@"END PARSE:[%@]",[anAST text]);
if (htmlAttrParseOK && tagName)
{
@ -227,17 +233,17 @@ static char rcsId[] = "$Id$";
NSDebugMLLog(@"low",@"Add tagName:[%@]",
tagName);
[_tagsNames setObject:tagName
forKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
forKey:[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
NSDebugMLLog(@"low",@"Verify tagName=%@",
[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]); //TODO bad hack
[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]); //TODO bad hack
NSDebugMLLog(@"low",@"Add tagsAttrs:[%@]",
tagAttrs);
if (tagAttrs)
{
[_tagsAttrs setObject:tagAttrs
forKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
forKey:[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
NSDebugMLLog(@"low",@"Verify tagAttrs=%@",
[_tagsAttrs objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]); //TODO bad hack
[_tagsAttrs objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]); //TODO bad hack
};
};
};
@ -246,16 +252,18 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(NSString*)getTagNameFor:(ANTLRDefAST)_AST
-(NSString*)getTagNameFor:(ANTLRDefAST)anAST
{
NSString* tagName=[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
NSString* tagName=[_tagsNames objectForKey:
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
LOGClassFnStart();
NSDebugMLLog(@"low",@"[%@]",[_AST text]);
NSDebugMLLog(@"low",@"[%@]",[anAST text]);
if (!tagName)
{
BOOL htmlAttrParseOK=[self parseTag:_AST];
BOOL htmlAttrParseOK=[self parseTag:anAST];
if (htmlAttrParseOK)
tagName=[_tagsNames objectForKey:[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
tagName=[_tagsNames objectForKey:
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
};
NSDebugMLLog(@"low",@"tagName:[%@]",tagName);
LOGClassFnStop();
@ -263,18 +271,18 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)_AST
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)anAST
{
NSDictionary* tagAttrs=[_tagsAttrs objectForKey:
[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
LOGClassFnStart();
NSDebugMLLog(@"low",@"[%@]",[_AST text]);
NSDebugMLLog(@"low",@"[%@]",[anAST text]);
if (!tagAttrs)
{
BOOL htmlAttrParseOK=[self parseTag:_AST];
BOOL htmlAttrParseOK=[self parseTag:anAST];
if (htmlAttrParseOK)
tagAttrs=[_tagsAttrs objectForKey:
[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
};
NSDebugMLLog(@"low",@"tagAttrs:[%@]",tagAttrs);
LOGClassFnStop();
@ -282,34 +290,34 @@ static char rcsId[] = "$Id$";
};
//--------------------------------------------------------------------
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)_AST
stopOnTagNamed:(NSString*)_stopTagName
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)anAST
stopOnTagNamed:(NSString*)stopTagName
{
NSMutableArray* _elements=[NSMutableArray array];
ANTLRDefAST _currentAST=*_AST;
NSMutableArray* elements=[NSMutableArray array];
ANTLRDefAST currentAST=*anAST;
BOOL end=NO;
BOOL inHTMLBareString=NO;
NSMutableString* htmlBareString=nil;
LOGClassFnStart();
NSDebugMLLog(@"low",@"_stopTagName:[%@]",_stopTagName);
while(_currentAST && !end)
NSDebugMLLog(@"low",@"stopTagName:[%@]",stopTagName);
while(currentAST && !end)
{
GSWElement* element=nil;
NSString* tagName=nil;
NSDictionary* tagAttrs=nil;
BOOL stopBareString=NO;
NSDebugMLLog(@"low",@"[_currentAST: text=[%@] Type=%d",
[_currentAST text],
[_currentAST tokenType]);
NSDebugMLLog(@"low",@"[currentAST: text=[%@] Type=%d",
[currentAST text],
[currentAST tokenType]);
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
end ? "YES" : "NO",
inHTMLBareString ? "YES" : "NO",
stopBareString ? "YES" : "NO");
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG
|| [_currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG
|| [currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
{
tagName=[self getTagNameFor:_currentAST];
tagName=[self getTagNameFor:currentAST];
NSDebugMLLog(@"low",@"Result tagName:[%@]",tagName);
if (!tagName)
{
@ -317,11 +325,11 @@ static char rcsId[] = "$Id$";
}
else
{
NSDebugMLLog(@"low",@"[_currentAST tokenType]=%d",(int)[_currentAST tokenType]);
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
NSDebugMLLog(@"low",@"[currentAST tokenType]=%d",(int)[currentAST tokenType]);
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
{
NSDebugMLLog0(@"low",@"Found Open Tag");
tagAttrs=[self getTagAttrsFor:_currentAST];
tagAttrs=[self getTagAttrsFor:currentAST];
NSDebugMLLog(@"low",@"tagAttrs=%@",tagAttrs);
if ([tagName caseInsensitiveCompare:GSWTag_Name[GSWNAMES_INDEX]]==NSOrderedSame
|| [tagName caseInsensitiveCompare:GSWTag_Name[WONAMES_INDEX]]==NSOrderedSame)
@ -336,7 +344,7 @@ static char rcsId[] = "$Id$";
}
else
{
ANTLRDefAST nextAST=[_currentAST nextSibling];
ANTLRDefAST nextAST=[currentAST nextSibling];
NSString* name=[tagAttrs objectForKey:@"name"];
NSDebugMLLog0(@"low",@"Process GSWeb Tag");
NSDebugMLLog(@"low",@"GSWeb Tag: name:[%@]",
@ -344,7 +352,7 @@ static char rcsId[] = "$Id$";
if (!name)
{
LOGError(@"No name for Element:%@",
[_currentAST text]);//TODO
[currentAST text]);//TODO
ExceptionRaise(@"GSWTemplateParser",
@"GSWTemlateParser: no name for GNUstepWeb tag in template named %@",
_templateName);
@ -425,28 +433,28 @@ static char rcsId[] = "$Id$";
_templateName);
};
};
_currentAST=nextAST;
currentAST=nextAST;
};
};
}
else
{
if (_stopTagName
&& [tagName caseInsensitiveCompare:_stopTagName]==NSOrderedSame)
if (stopTagName
&& [tagName caseInsensitiveCompare:stopTagName]==NSOrderedSame)
{
NSDebugMLLog(@"low",@"_stopTagName found: %@",_stopTagName);
NSDebugMLLog(@"low",@"stopTagName found: %@",stopTagName);
end=YES;
stopBareString=YES;
_currentAST=[_currentAST nextSibling];
currentAST=[currentAST nextSibling];
};
};
};
}
else if ([_currentAST tokenType]==GSWHTMLTokenType_COMMENT)
else if ([currentAST tokenType]==GSWHTMLTokenType_COMMENT)
{
stopBareString=YES;
element=[GSWHTMLComment elementWithString:[_currentAST text]];
_currentAST=[_currentAST nextSibling];
element=[GSWHTMLComment elementWithString:[currentAST text]];
currentAST=[currentAST nextSibling];
}
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
end ? "YES" : "NO",
@ -461,17 +469,17 @@ static char rcsId[] = "$Id$";
inHTMLBareString=YES;
htmlBareString=[[NSMutableString new] autorelease];
};
NSDebugMLLog(@"low",@"inHTMLBareString: adding [%@]",[_currentAST text]);
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
[htmlBareString appendFormat:@"<%@>",[_currentAST text]];
else if ([_currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
[htmlBareString appendFormat:@"</%@>",[_currentAST text]];
NSDebugMLLog(@"low",@"inHTMLBareString: adding [%@]",[currentAST text]);
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
[htmlBareString appendFormat:@"<%@>",[currentAST text]];
else if ([currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
[htmlBareString appendFormat:@"</%@>",[currentAST text]];
else
[htmlBareString appendString:[_currentAST text]];
[htmlBareString appendString:[currentAST text]];
NSDebugMLLog(@"low",@"htmlBareString: ==> [%@]",htmlBareString);
_currentAST=[_currentAST nextSibling];
currentAST=[currentAST nextSibling];
};
if (inHTMLBareString && (stopBareString || !_currentAST))
if (inHTMLBareString && (stopBareString || !currentAST))
{
NSDebugMLLog0(@"low",@"inHTMLBareString && stopBareString");
NSDebugMLLog(@"low",@"CREATE GSWHTMLBareString:\n%@",htmlBareString);
@ -483,17 +491,17 @@ static char rcsId[] = "$Id$";
if (element)
{
NSDebugMLLog(@"low",@"element to add: element=[%@]",element);
[_elements addObject:element];
[elements addObject:element];
element=nil;
};
NSDebugMLLog(@"low",@"element:%@",element);
NSDebugMLLog(@"low",@"inHTMLBareString:%d",(int)inHTMLBareString);
NSDebugMLLog(@"low",@"htmlBareString:%@",htmlBareString);
};
*_AST=_currentAST;
NSDebugMLLog(@"low",@"_elements]:%@",_elements);
*anAST=currentAST;
NSDebugMLLog(@"low",@"elements]:%@",elements);
LOGClassFnStop();
return _elements;
return elements;
};
@end

View file

@ -1,11 +1,16 @@
/* GSWTemplateParserXML.h - GSWeb: Class GSWTemplateParserXML
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWTemplateParserXML.h - <title>GSWeb: Class GSWTemplateParserXML</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -47,7 +53,7 @@
+(void)setCachedDTDContent:(NSString*)externalContent
forKey:(NSString*)url;
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser;
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser_;
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser;
-(id)init;
-(xmlParserInputPtr)resolveEntity:(NSString*)publicIdEntity
systemID:(NSString*)systemIdEntity;

View file

@ -1,4 +1,5 @@
/** GSWTemplateParserXML.m - <title>GSWeb: Class GSWTemplateParserXML</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
@ -121,9 +122,9 @@ static NSMutableDictionary* DTDCache=nil;
};
//--------------------------------------------------------------------
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser_
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser
{
return AUTORELEASE([[self alloc] initWithTemplateParser:templateParser_]);
return AUTORELEASE([[self alloc] initWithTemplateParser:templateParser]);
};
extern void externalSubset (void *ctx,
@ -132,11 +133,11 @@ extern void externalSubset (void *ctx,
const xmlChar *SystemID);
//--------------------------------------------------------------------
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser_
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser
{
if ((self=[self init]))
{
_templateParser=templateParser_;
_templateParser=templateParser;
//NSLog(@"my sax lib=%p",lib);
if (lib)
{

View file

@ -1,11 +1,16 @@
/* utils.h - utils
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWUtils.m - <title>GSWeb: Utilities</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,10 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
#ifndef _GSWebUtils_h__
#define _GSWebUtils_h__
@ -95,7 +103,7 @@ void ValidationExceptionRaiseFn0(const char *func,
{ ValidationExceptionRaiseFn0(__PRETTY_FUNCTION__, __FILE__, __LINE__,name_,message_,format_); }
extern BOOL boolValueFor(id id_);
extern BOOL boolValueWithDefaultFor(id id_,BOOL default_);
extern BOOL boolValueWithDefaultFor(id id_,BOOL defaultValue);
//extern BOOLNB boolNbFor(BOOL value_);
extern BOOL isHeaderKeysEqual(NSString* headerKey,NSString* testKey);
extern BOOL SBIsEqual(id id1,id id2);
@ -198,22 +206,22 @@ extern NSData* HexStringToData(NSString* _string);
//====================================================================
@interface NSException (NSExceptionUserInfoAdd)
-(NSException*)exceptionByAddingUserInfo:(NSDictionary*)userInfo_;
-(NSException*)exceptionByAddingUserInfoKey:(id)key_
format:(NSString*)format_,...;
-(NSException*)exceptionByAddingToUserInfoKey:(id)key_
format:(NSString*)format_,...;
-(NSException*)exceptionByAddingUserInfoFrameInfo:(NSString*)frameInfo_;
-(NSException*)exceptionByAddingUserInfoFrameInfoFormat:(NSString*)format_,...;
-(NSException*)exceptionByAddingUserInfoFrameInfoObject:(id)obj_
sel:(SEL)sel_
file:(const char*)file_
line:(int)line_
format:(NSString*)format_,...;
-(NSException*)exceptionByAddingUserInfoFrameInfoFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_
format:(NSString*)format_,...;
-(NSException*)exceptionByAddingUserInfo:(NSDictionary*)userInfo;
-(NSException*)exceptionByAddingUserInfoKey:(id)key
format:(NSString*)format,...;
-(NSException*)exceptionByAddingToUserInfoKey:(id)key
format:(NSString*)format,...;
-(NSException*)exceptionByAddingUserInfoFrameInfo:(NSString*)frameInfo;
-(NSException*)exceptionByAddingUserInfoFrameInfoFormat:(NSString*)format,...;
-(NSException*)exceptionByAddingUserInfoFrameInfoObject:(id)obj
sel:(SEL)sel
file:(const char*)file
line:(int)line
format:(NSString*)format,...;
-(NSException*)exceptionByAddingUserInfoFrameInfoFunction:(const char*)fn
file:(const char*)file
line:(int)line
format:(NSString*)format,...;
-(BOOL)isValidationException;
@end
@ -224,41 +232,41 @@ extern NSData* HexStringToData(NSString* _string);
//====================================================================
@interface NSDictionary (SBDictionary)
-(id) objectForKey:(id)_key
withDefaultObject:(id)_default;
+(id) dictionaryWithDictionary:(NSDictionary*)dictionary_
andDefaultEntriesFromDictionary:(NSDictionary*)dictionaryDefaults_;
-(id)dictionaryBySettingObject:(id)object_
forKey:(id)key_;
-(id)dictionaryByAddingEntriesFromDictionary:(NSDictionary*)dictionary_;
-(id) objectForKey:(id)key
withDefaultObject:(id)defaultObject;
+(id) dictionaryWithDictionary:(NSDictionary*)dictionary
andDefaultEntriesFromDictionary:(NSDictionary*)dictionaryDefaults;
-(id)dictionaryBySettingObject:(id)object
forKey:(id)key;
-(id)dictionaryByAddingEntriesFromDictionary:(NSDictionary*)dictionary;
@end
//====================================================================
@interface NSMutableDictionary (SBMutableDictionary)
-(void)setDefaultObject:(id)object_
forKey:(id)key_;
-(void)addDefaultEntriesFromDictionary:(NSDictionary*)dictionary_;
-(void)setDefaultObject:(id)object
forKey:(id)key;
-(void)addDefaultEntriesFromDictionary:(NSDictionary*)dictionary;
@end
//====================================================================
@interface NSMutableOrderedArray: NSMutableArray
{
NSMutableArray *array;
SEL compareSelector;
NSMutableArray* _array;
SEL _compareSelector;
};
-(id)initWithCompareSelector:(SEL)compareSelector;
-(void)addObject:(id)object_;
-(void)addObjectsFromArray:(NSArray*)array_;
-(void)insertObject:(id)object_
atIndex:(unsigned int)index_;
-(void)replaceObjectAtIndex:(unsigned int)index_
withObject:(id)object_;
-(void)replaceObjectsInRange:(NSRange)range_
withObjectsFromArray:(NSArray*)array_;
-(void)replaceObjectsInRange:(NSRange)range_
withObjectsFromArray:(NSArray*)array_
range:(NSRange)arrayRange_;
-(void)setArray:(NSArray*)array_;
-(void)addObject:(id)object;
-(void)addObjectsFromArray:(NSArray*)array;
-(void)insertObject:(id)object
atIndex:(unsigned int)index;
-(void)replaceObjectAtIndex:(unsigned int)index
withObject:(id)object;
-(void)replaceObjectsInRange:(NSRange)range
withObjectsFromArray:(NSArray*)array;
-(void)replaceObjectsInRange:(NSRange)range
withObjectsFromArray:(NSArray*)array
range:(NSRange)arrayRange;
-(void)setArray:(NSArray*)array;
@end
//====================================================================
@ -295,61 +303,68 @@ extern NSData* HexStringToData(NSString* _string);
@interface NSLock (NSLockBD)
-(BOOL)isLocked;
-(BOOL)tmplock;
-(BOOL)tmplockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(BOOL)tmplockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmptryLock;
-(BOOL)tmptryLockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(BOOL)tmptryLockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
fromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
fromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
-(BOOL)tmplockBeforeDate:(NSDate*)limit
fromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
fromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(void)tmpunlock;
-(void)tmpunlockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(void)tmpunlockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
@end
//====================================================================
@interface NSRecursiveLock (NSLockBD)
-(BOOL)isLocked;
-(BOOL)tmplock;
-(BOOL)tmplockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(BOOL)tmplockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmptryLock;
-(BOOL)tmptryLockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(BOOL)tmptryLockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
fromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
fromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
-(BOOL)tmplockBeforeDate:(NSDate*)limit
fromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
fromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
-(void)tmpunlock;
-(void)tmpunlockFromFunction:(const char*)fn_
file:(const char*)file_
line:(int)line_;
-(void)tmpunlockFromFunction:(const char*)fn
file:(const char*)file
line:(int)line;
@end
//====================================================================
@interface NSArray (NSPerformSelectorWith2Objects)
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object1_
withObject:(id)object2_;
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object1
withObject:(id)object2;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
@ -364,12 +379,12 @@ extern NSData* HexStringToData(NSString* _string);
//====================================================================
@interface NSDictionary (NSPerformSelector)
-(void)makeObjectsPerformSelector:(SEL)selector_;
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object_;
-(void)makeObjectsPerformSelector:(SEL)selector_
withObject:(id)object1_
withObject:(id)object2_;
-(void)makeObjectsPerformSelector:(SEL)selector;
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object;
-(void)makeObjectsPerformSelector:(SEL)selector
withObject:(id)object_
withObject:(id)object2;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
@ -383,19 +398,19 @@ extern NSData* HexStringToData(NSString* _string);
//====================================================================
@interface NSDictionary (FromNSArray)
+(id)dictionaryWithArray:(NSArray*)array_
onSelector:(SEL)sel_;
+(id)dictionaryWithArray:(NSArray*)array_
onSelector:(SEL)sel_
+(id)dictionaryWithArray:(NSArray*)array
onSelector:(SEL)sel;
+(id)dictionaryWithArray:(NSArray*)array
onSelector:(SEL)sel
withObject:(id)object;
@end
//====================================================================
@interface NSNumber (SBNumber)
+(NSNumber*)maxValueOf:(NSNumber*)_val0
and:(NSNumber*)_val1;
+(NSNumber*)minValueOf:(NSNumber*)_val0
and:(NSNumber*)_val1;
+(NSNumber*)maxValueOf:(NSNumber*)val0
and:(NSNumber*)val1;
+(NSNumber*)minValueOf:(NSNumber*)val0
and:(NSNumber*)val1;
@end
//====================================================================
@ -406,15 +421,15 @@ extern NSData* HexStringToData(NSString* _string);
-(NSRange)rangeOfData:(NSData *)aData
options:(unsigned)mask
range:(NSRange)aRange;
-(NSArray*)componentsSeparatedByData:(NSData*)separator_;
-(NSData*)dataByDeletingFirstBytesCount:(unsigned int)bytesCount_;
-(NSData*)dataByDeletingLastBytesCount:(unsigned int)bytesCount_;
-(NSArray*)componentsSeparatedByData:(NSData*)separator;
-(NSData*)dataByDeletingFirstBytesCount:(unsigned int)bytesCount;
-(NSData*)dataByDeletingLastBytesCount:(unsigned int)bytesCount;
@end
//====================================================================
@interface NSMutableData (SBNSData)
-(void)deleteFirstBytesCount:(unsigned int)bytesCount_;
-(void)deleteLastBytesCount:(unsigned int)bytesCount_;
-(void)deleteFirstBytesCount:(unsigned int)bytesCount;
-(void)deleteLastBytesCount:(unsigned int)bytesCount;
@end
//====================================================================
@ -427,10 +442,10 @@ typedef enum _NSNumFmtType
@interface NSFooNumberFormatter : NSFormatter <NSCoding, NSCopying>
{
NSNumFmtType type;
NSNumFmtType _type;
};
-(id)initType:(NSNumFmtType)type_;
-(id)initType:(NSNumFmtType)type;
-(NSString*)stringForObjectValue:(id)anObject;
-(BOOL)getObjectValue:(id*)anObject
forString:(NSString*)string

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,16 @@
/* GSWWOCompatibility.h - GSWeb: GSWWOCompatibility
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWWOCompatibility.h - <title>GSWeb: GSWWOCompatibility</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 2000-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Dec 2000
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$

View file

@ -1,11 +1,16 @@
/* GSWWOCompatibility.m - GSWeb: GSWWOCompatibility
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWWOCompatibility.m - <title>GSWeb: GSWWOCompatibility</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 2000-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Dec 2000
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
#include <GSWeb/GSWeb.h>

View file

@ -1,11 +1,18 @@
/* GSWeb.h - GSWeb
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWeb.h - <title>GSWeb</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +26,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$

View file

@ -1,11 +1,18 @@
/* GSWeb.m - GSWeb
Copyright (C) 1999 Free Software Foundation, Inc.
/** GSWeb.m - <title>GSWeb</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
<abstract></abstract>
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +26,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";

View file

@ -1,11 +1,16 @@
/* NSNonBlockingFileHandle.h - NSNonBlockingFileHandle
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSNonBlockingFileHandle.h - <title>GSWeb: NSNonBlockingFileHandle</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$

View file

@ -1,11 +1,16 @@
/* NSNonBlockingFileHandle.m - NSNonBlockingFileHandle
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSNonBlockingFileHandle.m - <title>GSWeb: NSNonBlockingFileHandle</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
#include <time.h>
#include <sys/time.h>
@ -53,11 +59,11 @@
// Does not block if there is no data; returns nil instead.
-(NSData*)availableDataNonBlocking
{
NSData* _data=nil;
NSData* data=nil;
LOGObjectFnStart();
_data=[self readDataOfLengthNonBlocking: UINT_MAX];
data=[self readDataOfLengthNonBlocking: UINT_MAX];
LOGObjectFnStop();
return _data;
return data;
};
// Returns an NSData object containing all of the currently available data.
@ -65,16 +71,16 @@
// Cover for #{-availableDataNonBlocking}.
-(NSData*)readDataToEndOfFileNonBlocking
{
NSData* _data=nil;
NSData* data=nil;
LOGObjectFnStart();
_data=[self readDataOfLengthNonBlocking: UINT_MAX];
data=[self readDataOfLengthNonBlocking: UINT_MAX];
LOGObjectFnStop();
return _data;
return data;
};
-(unsigned int)_availableByteCountNonBlocking
{
int numBytes;
int numBytes=0;
int fd = 0;
LOGObjectFnStart();
fd=[self fileDescriptor];
@ -94,7 +100,7 @@
-(NSData*)readDataOfLengthNonBlocking:(unsigned int)length
{
NSData* data=nil;
unsigned int readLength;
unsigned int readLength=0;
LOGObjectFnStart();
readLength = [self _availableByteCountNonBlocking];

View file

@ -1,11 +1,16 @@
/* NSString+HTML.h
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSString+HTML.h - <title>GSWeb: NSString / HTML</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -31,13 +37,13 @@
-(NSString*)htmlPlus2Space;
-(NSString*)decodeURL;
-(NSString*)encodeURL;
-(NSString*)encodeURLWithValid:(NSString*)_valid;
-(NSString*)encodeURLWithValid:(NSString*)valid;
-(NSDictionary*)dictionaryQueryString;
-(NSDictionary*)dictionaryWithSep1:(NSString*)p_pstrSep1
withSep2:(NSString*)p_pstrSep2
withOptionUnescape:(BOOL)_unescape;
-(BOOL)ismapCoordx:(int*)x_
y:(int*)y_;
-(NSDictionary*)dictionaryWithSep1:(NSString*)sep1
withSep2:(NSString*)sep2
withOptionUnescape:(BOOL)unescape;
-(BOOL)ismapCoordx:(int*)x
y:(int*)y;
-(NSString*)stringByEscapingHTMLString;
-(NSString*)stringByEscapingHTMLAttributeValue;
-(NSString*)stringByConvertingToHTMLEntities;

View file

@ -1,11 +1,16 @@
/* NSString+HTML.m
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSString+HTML.m - <title>GSWeb: NSString / HTML</title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -211,18 +217,18 @@ void initHtmlChars()
-(NSString*)decodeURL
{
//TODO speed
unichar* _unichars=NULL;
unichar _uniChar=0;
NSString* _void=nil;
unichar* unichars=NULL;
unichar uniChar=0;
NSString* voidString=nil;
NSString* temp=nil;
const char* p=NULL;
int uniCharsIndex=0;
NSDebugMLLog(@"low",@"self=%@",self);
_void=[self htmlPlus2Space];
NSDebugMLLog(@"low",@"_void=%@",_void);
_unichars=_fastMallocBuffer(sizeof(unichar)*([_void length]+1));
NSDebugMLLog(@"low",@"[_void cString]=%s",[_void cString]);
for (p=[_void cString];p && *p;p++)
voidString=[self htmlPlus2Space];
NSDebugMLLog(@"low",@"voidString=%@",voidString);
unichars=_fastMallocBuffer(sizeof(unichar)*([voidString length]+1));
NSDebugMLLog(@"low",@"[voidString cString]=%s",[voidString cString]);
for (p=[voidString cString];p && *p;p++)
{
if (*p == '%')
{
@ -230,26 +236,26 @@ void initHtmlChars()
// 2 hex digits follow...
//
int i=0;
_uniChar=0;
uniChar=0;
for (i=0;p[1] && i<2;i++)
{
p++;
NSDebugMLLog(@"low",@"*p=%c %u",(char)*p,(unsigned int)*p);
_uniChar <<= 4;
NSDebugMLLog(@"low",@"_uniChar=%x",(unsigned int)_uniChar);
uniChar <<= 4;
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
if (isdigit(*p))
_uniChar+=*p-'0';
uniChar+=*p-'0';
else
_uniChar+=toupper(*p)-'A'+10;
NSDebugMLLog(@"low",@"_uniChar=%x",(unsigned int)_uniChar);
uniChar+=toupper(*p)-'A'+10;
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
};
}
else
_uniChar=(unsigned char)*p;
_unichars[uniCharsIndex]=_uniChar;
uniChar=(unsigned char)*p;
unichars[uniCharsIndex]=uniChar;
uniCharsIndex++;
};
temp=[NSString stringWithCharacters:_unichars
temp=[NSString stringWithCharacters:unichars
length:uniCharsIndex];
NSDebugMLLog(@"low",@"temp=%@",temp);
NSDebugMLLog(@"low",@"temp data=%@",[temp dataUsingEncoding:NSISOLatin1StringEncoding]);
@ -270,11 +276,11 @@ void initHtmlChars()
};
//--------------------------------------------------------------------
-(NSString*)encodeURLWithValid:(NSString*)_valid
-(NSString*)encodeURLWithValid:(NSString*)validString
{
NSMutableString* temp=[NSMutableString stringWithCapacity:[self length]];
const char* p=NULL;
const char* valid=[_valid cString];
const char* valid=[validString cString];
static char *digits = "0123456789ABCDEF";
for (p =[self cString]; p && *p; p++)
{
@ -295,34 +301,34 @@ void initHtmlChars()
};
//--------------------------------------------------------------------
-(NSDictionary*)dictionaryWithSep1:(NSString*)p_pstrSep1
withSep2:(NSString*)p_pstrSep2
withOptionUnescape:(BOOL)_unescape
-(NSDictionary*)dictionaryWithSep1:(NSString*)sep1
withSep2:(NSString*)sep2
withOptionUnescape:(BOOL)unescape
{
NSMutableDictionary* pDico=nil;
if ([self length]>0)
{
NSArray* listItems = [self componentsSeparatedByString:p_pstrSep1];
NSArray* listItems = [self componentsSeparatedByString:sep1];
int iCount=0;
pDico=[NSMutableDictionary dictionary];
pDico=(NSMutableDictionary*)[NSMutableDictionary dictionary];
for(iCount=0;iCount<[listItems count];iCount++)
{
if ([[listItems objectAtIndex:iCount] length]>0)
{
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:p_pstrSep2];
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:sep2];
id key=nil;
id value=nil;
if ([listParam count]==1)
{
key=[listParam objectAtIndex:0];
if (_unescape)
if (unescape)
key=[key decodeURL];
}
else if ([listParam count]==2)
{
key=[listParam objectAtIndex:0];
value=[listParam objectAtIndex:1];
if (_unescape)
if (unescape)
{
key=[key decodeURL];
value=[value decodeURL];
@ -349,41 +355,42 @@ void initHtmlChars()
};
//--------------------------------------------------------------------
-(BOOL)ismapCoordx:(int*)x_
y:(int*)y_
-(BOOL)ismapCoordx:(int*)x
y:(int*)y
{
BOOL _ok=NO;
NSScanner* _scanner=[NSScanner scannerWithString:self];
if ([_scanner scanInt:x_])
BOOL ok=NO;
NSScanner* scanner=[NSScanner scannerWithString:self];
if ([scanner scanInt:x])
{
if (x_)
if (x)
{
NSDebugMLLog(@"low",@"x=%d",*x_);
NSDebugMLLog(@"low",@"x=%d",*x);
};
if ([_scanner scanString:@"," intoString:NULL])
if ([scanner scanString:@","
intoString:NULL])
{
if ([_scanner scanInt:y_])
if ([scanner scanInt:y])
{
if (y_)
if (y)
{
NSDebugMLLog(@"low",@"y=%d",*y_);
NSDebugMLLog(@"low",@"y=%d",*y);
};
NSDebugMLLog(@"low",@"[_scanner isAtEnd]=%d",(int)[_scanner isAtEnd]);
if ([_scanner isAtEnd])
NSDebugMLLog(@"low",@"[scanner isAtEnd]=%d",(int)[scanner isAtEnd]);
if ([scanner isAtEnd])
{
_ok=YES;
ok=YES;
};
};
};
};
if (!_ok)
if (!ok)
{
if (x_)
*x_=INT_MAX;
if (y_)
*y_=INT_MAX;
if (x)
*x=INT_MAX;
if (y)
*y=INT_MAX;
};
return _ok;
return ok;
};
//--------------------------------------------------------------------

View file

@ -1,11 +1,16 @@
/* NSString+Trimming.h
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSString+Trimming.h - <title>GSWeb: Class NSString with Trimming </title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
// $Id$
@ -32,17 +38,17 @@
-(BOOL)isAFloatNumber;
-(BOOL)isAnIntegerNumber;
#ifdef LONG_LONG_MAX
-(BOOL)isAnIntegerNumberWithMin:(long long)min_
max:(long long)max_;
-(BOOL)isAnIntegerNumberWithMin:(long long)min
max:(long long)max;
#else
-(BOOL)isAnIntegerNumberWithMin:(long)min_
max:(long)max_;
-(BOOL)isAnIntegerNumberWithMin:(long)min
max:(long)max;
#endif
-(BOOL)isAnUnsignedIntegerNumber;
#ifdef LONG_LONG_MAX
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max_;
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max;
#else
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max_;
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max;
#endif
-(BOOL)isStartingWithNumber;
-(long)longValue;
@ -53,37 +59,37 @@
//====================================================================
@interface NSString (UniqueIdString)
+(NSString*)stringUniqueIdWithLength:(int)_lentgh;
+(NSString*)stringUniqueIdWithLength:(int)length;
@end
//====================================================================
@interface NSString (stringWithObject)
+(NSString*)stringWithObject:(id)object_;
+(NSString*)stringWithObject:(id)object;
@end
//====================================================================
@interface NSString (uniqueFileName)
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory_
withPrefix:(NSString*)prefix_
withSuffix:(NSString*)suffix_;
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory
withPrefix:(NSString*)prefix
withSuffix:(NSString*)suffix;
@end
//====================================================================
@interface NSString (Qutotes)
-(BOOL)hasPrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_;
-(NSString*)stringWithoutPrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_;
-(BOOL)isQuotedWith:(NSString*)quote_;
-(NSString*)stringWithoutQuote:(NSString*)quote_;
-(BOOL)hasPrefix:(NSString*)prefix
andSuffix:(NSString*)suffix;
-(NSString*)stringWithoutPrefix:(NSString*)prefix
andSuffix:(NSString*)suffix;
-(BOOL)isQuotedWith:(NSString*)quote;
-(NSString*)stringWithoutQuote:(NSString*)quote;
@end
//====================================================================
@interface NSMutableString (Qutotes)
-(void)removePrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_;
-(void)removeQuote:(NSString*)quote_;
-(void)removePrefix:(NSString*)prefix
andSuffix:(NSString*)suffix;
-(void)removeQuote:(NSString*)quote;
@end
#endif //_NSString_Trimming_h__

View file

@ -1,11 +1,16 @@
/* NSString+Trimming.m
Copyright (C) 1999 Free Software Foundation, Inc.
/** NSString+Trimming.m - <title>GSWeb: Class NSString with Trimming </title>
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
This file is part of the GNUstep Web Library.
<license>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
@ -19,7 +24,8 @@
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
</license>
**/
static char rcsId[] = "$Id$";
@ -62,18 +68,18 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
#ifdef LONG_LONG_MAX
-(BOOL)isAnIntegerNumberWithMin:(long long)min_
max:(long long)max_
-(BOOL)isAnIntegerNumberWithMin:(long long)min
max:(long long)max
#else
-(BOOL)isAnIntegerNumberWithMin:(long)min_
max:(long)max_
-(BOOL)isAnIntegerNumberWithMin:(long)min
max:(long)max
#endif
{
if ([self isAnIntegerNumber])
{
//TODO
long _v=[self longValue];
if (_v>=min_ && _v<=max_)
long v=[self longValue];
if (v>=min && v<=max)
return YES;
else
return NO;
@ -97,16 +103,16 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
#ifdef LONG_LONG_MAX
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max_
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max
#else
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max_
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max
#endif
{
if ([self isAnUnsignedIntegerNumber])
{
//TODO
unsigned long _v=[self ulongValue];
if (_v<=max_)
unsigned long v=[self ulongValue];
if (v<=max)
return YES;
else
return NO;
@ -142,10 +148,10 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(long long)longLongValue
{
long long _v=0;
NSScanner* _scanner = [NSScanner scannerWithString:self];
[_scanner scanLongLong:&_v];
return _v;
long long v=0;
NSScanner* scanner = [NSScanner scannerWithString:self];
[scanner scanLongLong:&v];
return v;
}
@end
@ -153,7 +159,7 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation NSString (UniqueIdString)
//--------------------------------------------------------------------
+(NSString*)stringUniqueIdWithLength:(int)_lentgh
+(NSString*)stringUniqueIdWithLength:(int)length
{
int i=0;
NSTimeInterval ti=[[NSDate date]timeIntervalSinceReferenceDate];
@ -161,7 +167,7 @@ static char rcsId[] = "$Id$";
NSMutableData* data=nil;
void* pData=NULL;
NSString* dataHex=nil;
int intLength=(_lentgh/sizeof(int))-sizeof(ti);
int intLength=(length/sizeof(int))-sizeof(ti);
if (intLength<0)
intLength=0;
size=sizeof(ti)+intLength*sizeof(int);
@ -183,28 +189,28 @@ static char rcsId[] = "$Id$";
@implementation NSString (stringWithObject)
//--------------------------------------------------------------------
+(NSString*)stringWithObject:(id)object_
+(NSString*)stringWithObject:(id)object
{
NSString* _string=nil;
if (object_)
NSString* string=nil;
if (object)
{
if ([object_ isKindOfClass:[NSString class]])
_string=[[object_ copy] autorelease];
if ([object isKindOfClass:[NSString class]])
string=[[object copy] autorelease];
#ifdef GDL2
else if ([object_ isKindOfClass:[EONull class]])
_string=@"";
else if ([object isKindOfClass:[EONull class]])
string=@"";
#else
else if ([object_ isKindOfClass:[NSNull class]])
_string=@"";
else if ([object isKindOfClass:[NSNull class]])
string=@"";
#endif
else if ([object_ respondsToSelector:@selector(stringValue)])
_string=[object_ stringValue];
else if ([object_ respondsToSelector:@selector(description)])
_string=[object_ description];
else if ([object respondsToSelector:@selector(stringValue)])
string=[object stringValue];
else if ([object respondsToSelector:@selector(description)])
string=[object description];
else
_string=object_;
string=object;
};
return _string;
return string;
};
@end
@ -212,35 +218,35 @@ static char rcsId[] = "$Id$";
@implementation NSString (uniqueFileName)
//--------------------------------------------------------------------
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory_
withPrefix:(NSString*)prefix_
withSuffix:(NSString*)suffix_
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory
withPrefix:(NSString*)prefix
withSuffix:(NSString*)suffix
{
NSString* _filename=nil;
NSFileManager* _fileManager=nil;
NSArray* _directoryContents=nil;
NSString* filename=nil;
NSFileManager* fileManager=nil;
NSArray* directoryContents=nil;
LOGObjectFnStart();
_fileManager=[NSFileManager defaultManager];
_directoryContents=[_fileManager directoryContentsAtPath:directory_];
if (!_directoryContents)
fileManager=[NSFileManager defaultManager];
directoryContents=[fileManager directoryContentsAtPath:directory];
if (!directoryContents)
{
//ERROR
}
else
{
int _attempts=16;
while(_attempts-->0 && !_filename)
int attempts=16;
while(attempts-->0 && !filename)
{
NSString* _unique=[NSString stringUniqueIdWithLength:16];
_filename=[NSString stringWithFormat:@"%@_%@_%@",prefix_,_unique,suffix_];
if ([_directoryContents containsObject:_filename])
_filename=nil;
NSString* unique=[NSString stringUniqueIdWithLength:16];
filename=[NSString stringWithFormat:@"%@_%@_%@",prefix,unique,suffix];
if ([directoryContents containsObject:filename])
filename=nil;
};
};
if (_filename)
_filename=[directory_ stringByAppendingPathComponent:_filename];
if (filename)
filename=[directory stringByAppendingPathComponent:filename];
LOGObjectFnStop();
return _filename;
return filename;
};
@end
@ -248,30 +254,30 @@ static char rcsId[] = "$Id$";
@implementation NSString (Qutotes)
//--------------------------------------------------------------------
-(BOOL)hasPrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_
-(BOOL)hasPrefix:(NSString*)prefix
andSuffix:(NSString*)suffix
{
return [self hasPrefix:prefix_] && [self hasSuffix:suffix_];
return [self hasPrefix:prefix] && [self hasSuffix:suffix];
};
//--------------------------------------------------------------------
-(NSString*)stringWithoutPrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_
-(NSString*)stringWithoutPrefix:(NSString*)prefix
andSuffix:(NSString*)suffix
{
return [[self stringWithoutPrefix:prefix_]stringWithoutSuffix:suffix_];
return [[self stringWithoutPrefix:prefix]stringWithoutSuffix:suffix];
};
//--------------------------------------------------------------------
-(BOOL)isQuotedWith:(NSString*)quote_
-(BOOL)isQuotedWith:(NSString*)quote
{
return [self hasPrefix:quote_
andSuffix:quote_];
return [self hasPrefix:quote
andSuffix:quote];
};
//--------------------------------------------------------------------
-(NSString*)stringWithoutQuote:(NSString*)quote_
-(NSString*)stringWithoutQuote:(NSString*)quote
{
return [self stringWithoutPrefix:quote_
andSuffix:quote_];
return [self stringWithoutPrefix:quote
andSuffix:quote];
};
@end
@ -279,18 +285,18 @@ static char rcsId[] = "$Id$";
@implementation NSMutableString (Qutotes)
//--------------------------------------------------------------------
-(void)removePrefix:(NSString*)prefix_
andSuffix:(NSString*)suffix_
-(void)removePrefix:(NSString*)prefix
andSuffix:(NSString*)suffix
{
[self removePrefix:prefix_];
[self removeSuffix:suffix_];
[self removePrefix:prefix];
[self removeSuffix:suffix];
};
//--------------------------------------------------------------------
-(void)removeQuote:(NSString*)quote_
-(void)removeQuote:(NSString*)quote
{
[self removePrefix:quote_
andSuffix:quote_];
[self removePrefix:quote
andSuffix:quote];
};
@end