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:
mguesdon 2002-08-04 18:00:11 +00:00
parent f87b59dfca
commit 1e53c66863
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWApplication.h - <title>GSWeb: Class GSWApplication</title>
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,20 +24,21 @@
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[]);
extern int GSWApplicationMain(NSString* applicationClassName,
int argc,
const char *argv[]);
int argc,
const char *argv[]);
extern NSString* globalApplicationClassName;
extern int GSWebNamingConv;//GSWNAMES_INDEX or WONAMES_INDEX
#define GSWebNamingConvInversed (GSWebNamingConv==GSWNAMES_INDEX ? WONAMES_INDEX : GSWNAMES_INDEX)
@ -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,8 +225,8 @@ extern BOOL WOStrictFlag;
@interface GSWApplication (GSWAdaptorManagement)
-(NSArray*)adaptors;
-(GSWAdaptor*)adaptorWithName:(NSString*)name_
arguments:(NSDictionary*)someArguments;
-(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
arguments:(va_list)someArgumentsu;
-(void)debugWithFormat:(NSString*)formatString_,...;
+(void)debugWithFormat:(NSString*)formatString_,...;
-(void)logWithFormat:(NSString*)format_,...;
+(void)logWithFormat:(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*)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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Apr 1999
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Apr 1999
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,34 +35,34 @@ 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:@"."];
if ([keys count]>0)
{
if (!WOStrictFlag && [keyPath_ hasPrefix:@"^"])
{
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
}
else if (!WOStrictFlag && [keyPath_ hasPrefix:@"~"])
{
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
isNonMandatory=YES;
};
if ([keys count]>1)
{
ASSIGN(keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
};
};
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
};
{
NSArray* keys=nil;
NSDebugMLLog(@"associations",@"aKeyPath=%@",aKeyPath);
keys=[aKeyPath componentsSeparatedByString:@"."];
if ([keys count]>0)
{
if (!WOStrictFlag && [aKeyPath hasPrefix:@"^"])
{
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
}
else if (!WOStrictFlag && [aKeyPath hasPrefix:@"~"])
{
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
_isNonMandatory=YES;
};
if ([keys count]>1)
{
ASSIGN(_keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
};
};
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;
};
@ -82,96 +89,96 @@ static char rcsId[] = "$Id$";
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - parentBindingName=%@ keyPath=%@>",
object_get_class_name(self),
(void*)self,
parentBindingName,
keyPath];
object_get_class_name(self),
(void*)self,
_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_)
{
/*
#if !GSWEB_STRICT
if (!isNonMandatory)
#endif
{
if (![self isImplementedForComponent:object_])
{
ExceptionRaise(NSGenericException,@"%@ is not implemented for object of class %@",
self,
[object_ class]);
};
};
*/
_value=[object_ valueForBinding:parentBindingName];
NSDebugMLLog(@"associations",@"_value=%@",_value);
if (_value && keyPath)
{
_value=[GSWAssociation valueInObject:_value
forKeyPath:keyPath];
NSDebugMLLog(@"associations",@"_value=%@",_value);
};
};
NSDebugMLLog(@"associations",@"_value=%@",_value);
[self logTakeValue:_value];
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
NSDebugMLLog(@"associations",@"object=%@",object);
if (object)
{
/*
#if !GSWEB_STRICT
if (!isNonMandatory)
#endif
{
if (![self isImplementedForComponent:object_])
{
ExceptionRaise(NSGenericException,@"%@ is not implemented for object of class %@",
self,
[object_ class]);
};
};
*/
value=[object valueForBinding:_parentBindingName];
NSDebugMLLog(@"associations",@"value=%@",value);
if (value && _keyPath)
{
value=[GSWAssociation valueInObject:value
forKeyPath:_keyPath];
NSDebugMLLog(@"associations",@"value=%@",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_)
{
[object_ validateValue:&value_
forKey:self];
/*
#if !GSWEB_STRICT
if (!isNonMandatory)
#endif
{
if (![self isImplementedForComponent:object_])
{
ExceptionRaise(NSGenericException,@"%@ is not implemented for object of class %@",
self,
[object_ class]);
};
};
*/
if (keyPath)
{
id tmpValue=[object_ valueForBinding:parentBindingName];
[GSWAssociation setValue:value_
inObject:tmpValue
forKeyPath:keyPath];
}
else
[object_ setValue:value_
forBinding:parentBindingName];
};
[self logSetValue:value_];
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
if (object)
{
[object validateValue:&value
forKey:self];
/*
#if !GSWEB_STRICT
if (!isNonMandatory)
#endif
{
if (![self isImplementedForComponent:object_])
{
ExceptionRaise(NSGenericException,@"%@ is not implemented for object of class %@",
self,
[object_ class]);
};
};
*/
if (_keyPath)
{
id tmpValue=[object valueForBinding:_parentBindingName];
[GSWAssociation setValue:value
inObject:tmpValue
forKeyPath:_keyPath];
}
else
[object setValue:value
forBinding:_parentBindingName];
};
[self logSetValue:value];
LOGObjectFnStop();
};

View file

@ -1,11 +1,16 @@
/* GSWBundle.h - GSWeb: Class GSWBundle
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWBundle.h - <title>GSWeb: Class GSWBundle</title>
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_
fromArchive:(NSDictionary*)archive;
-(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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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_
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;
@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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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,108 +68,108 @@ 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;
};
//--------------------------------------------------------------------
-(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,12 +203,12 @@ static char rcsId[] = "$Id$";
-(void)awake
{
//OK
BOOL _isCachingEnabled=NO;
BOOL isCachingEnabled=NO;
LOGObjectFnStart();
isAwake=YES;
_isCachingEnabled=[self isCachingEnabled];
if (!_isCachingEnabled) //??
[self _clearCache];
_isAwake=YES;
isCachingEnabled=[self isCachingEnabled];
if (!isCachingEnabled) //??
[self _clearCache];
//call self componentClass
LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
@ -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
forKey:GSWThreadKey_ComponentDefinition];
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];
[localException raise];
};
{
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)
{
BOOL _createClassesOk=NO;
NSString* _superClassName=nil;
if (!WOStrictFlag)
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;
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))
{
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
_superClassName,
name);
};
};
if (!NSClassFromString(superClassName))
{
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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,465 +35,489 @@ 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"
inContext:nil
forRequest:request_];
[_response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
response=[GSWResponse responseWithMessage:@"Component Handle request failed"
inContext:nil
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
inContext:nil];
[_application sleep];
[_response _finalizeInContext:_context];//DO Call _finalizeInContext: !
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
[application awake];
response=[application handleException:localException
inContext:nil];
[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];
//====>
NS_DURING
{
[_application awake];
_response=[self lockedDispatchWithPreparedApplication:_application
inContext:_context
elements:_requestHandlerValues];
}
NS_HANDLER
{
_exceptionRaised=YES;
LOGException(@"%@ (%@)",
localException,
[localException reason]);
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");
};
NS_ENDHANDLER;
if (!_exceptionRaised)
{
NS_DURING
{
[_application sleep];
[_response _finalizeInContext:_context];//LAST //CLEAN
}
NS_HANDLER
{
LOGException(@"%@ (%@)",
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In [application sleep] or [_response _finalizeInContext:_context]");
LOGException(@"exception=%@",localException);
_response=[_application handleException:localException
inContext:nil];
[_response _finalizeInContext:_context]; //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);
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:aContext
elements:requestHandlerValues];
}
NS_HANDLER
{
exceptionRaised=YES;
LOGException(@"%@ (%@)",
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In lockedDispatchWithPreparedApplication");
LOGException(@"exception=%@",localException);
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)
{
NS_DURING
{
[application sleep];
[response _finalizeInContext:aContext];//LAST //CLEAN
}
NS_HANDLER
{
LOGException(@"%@ (%@)",
localException,
[localException reason]);
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In [application sleep] or [response _finalizeInContext:aContext]");
LOGException(@"exception=%@",localException);
response=[application handleException:localException
inContext:nil];
[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);
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)
{
_session=[_application restoreSessionWithID:_sessionID
inContext:_context];
if (!_session)
{
// check for refuseNewSessions
_errorResponse=[_application handleSessionRestorationErrorInContext:_context];
};
}
else
{
// check for refuseNewSessions
_session=[_application _initializeSessionInContext:_context];
}
}
{
sessionID=[elements objectForKey:GSWKey_SessionID[GSWebNamingConv]];
NSDebugMLLog(@"requests",@"sessionID=%@",sessionID);
if (sessionID)
{
session=[application restoreSessionWithID:sessionID
inContext:aContext];
if (!session)
{
// check for refuseNewSessions
errorResponse=[application handleSessionRestorationErrorInContext:aContext];
};
}
else
{
// check for refuseNewSessions
session=[application _initializeSessionInContext:aContext];
}
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore");
LOGException(@"exception=%@",localException);
_errorResponse=[_application handleException:localException
inContext:_context];
}
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"in session create/restore");
LOGException(@"exception=%@",localException);
errorResponse=[application handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
if (!_response && !_errorResponse)
{
if (_session)
{
NSDebugMLLog(@"requests",@"_session=%@",_session);
NS_DURING
{
_response=[self lockedDispatchWithPreparedSession:_session
inContext:_context
elements:_elements];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in lockedDispatchWithPreparedSession");
LOGException(@"exception=%@",localException);
_errorResponse=[_application handleException:localException
inContext:_context];
}
NS_ENDHANDLER;
};
};
//======LAST //CLEAN
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);
};
if (!response && !errorResponse)
{
if (session)
{
NSDebugMLLog(@"requests",@"session=%@",session);
NS_DURING
{
response=[self lockedDispatchWithPreparedSession:session
inContext:aContext
elements:elements];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"in lockedDispatchWithPreparedSession");
LOGException(@"exception=%@",localException);
errorResponse=[application handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
};
};
//======LAST //CLEAN
if (response || errorResponse)
{
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) // ??
{
NSAssert([_contextID length]>0,@"contextID empty");
_page=[self lockedRestorePageForContextID:_contextID
inSession:_session];
//??
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
NSDebugMLLog(@"requests",@"_session=%@",_session);
NSDebugMLLog(@"requests",@"_page=%@",_page);
if (!_page)
{
GSWApplication* _application=[_session application];
_errorResponse=[_application handlePageRestorationErrorInContext:_context];
};
}
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:aSession];
//??
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
NSDebugMLLog(@"requests",@"page=%@",page);
if (!page)
{
GSWApplication* application=[aSession application];
errorResponse=[application handlePageRestorationErrorInContext:aContext];
};
}
else
{
NSString* _pageName=[_elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
NSException* _exception=nil;
NSDebugMLLog(@"requests",@"_pageName=%@",_pageName);
NS_DURING
{
_page=[[GSWApplication application] pageWithName:_pageName
inContext:_context];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In pageWithName");
LOGException(@"exception=%@",localException);
ASSIGN(_exception,localException);
}
NS_ENDHANDLER;
if (!_page)
{
_errorResponse=[[GSWApplication application] handleException:_exception
inContext:_context];
};
DESTROY(_exception);
};
if (!_response && !_errorResponse && _page)
{
[_context _setPageElement:_page];
_response=[self lockedDispatchWithPreparedPage:_page
inSession:_session
inContext:_context
elements:_elements];
};
if (_response)
{
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.
{
NSString* pageName=[elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
NSException* exception=nil;
NSDebugMLLog(@"requests",@"pageName=%@",pageName);
NS_DURING
{
page=[[GSWApplication application] pageWithName:pageName
inContext:aContext];
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In pageWithName");
LOGException(@"exception=%@",localException);
ASSIGN(exception,localException);
}
NS_ENDHANDLER;
if (!page)
{
errorResponse=[[GSWApplication application] handleException:exception
inContext:aContext];
};
DESTROY(exception);
};
if (!response && !errorResponse && page)
{
[aContext _setPageElement:page];
response=[self lockedDispatchWithPreparedPage:page
inSession:aSession
inContext:aContext
elements:elements];
};
if (response)
{
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 (![_session storesIDsInCookies])//??
[_session clearCookieFromResponse:_response];
};
if (!contextID) // ??
{
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"
forKey:@"content-type"];
[_context _setResponse:_response];
_page=[_context page];
if (_contextID)//??
{
_hasFormValues=[_request _hasFormValues];
}
httpVersion=[request httpVersion];
[response setHTTPVersion:httpVersion];
[response setHeader:@"text/html"
forKey:@"content-type"];
[aContext _setResponse:response];
page=[aContext page];
if (contextID)//??
{
hasFormValues=[request _hasFormValues];
}
else
{
[_context _setPageChanged:NO];
_isFromClientComponent=[_request isFromClientComponent];
//??
[_context _setPageReplaced:NO];
_isFromClientComponent=[_request isFromClientComponent];
};
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)
{
LOGSeriousError0(@"2 lockedDispatchWithPreparedPage elementID length>0");
[_context deleteAllElementIDComponents];//NDFN
};
[_context _setPageChanged:NO];//???
_isFromClientComponent=[_request isFromClientComponent];
[_context _setPageReplaced:NO];
};
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");
// 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");
}
NS_HANDLER
{
LOGException0(@"exception in invokeActionForRequest");
LOGException(@"exception=%@",localException);
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"In invokeActionForRequest component=%@ of Class %@",
[_component name],
[_component class]);
LOGException(@"exception=%@",localException);
ASSIGN(_exception,localException);
if (!_responsePage)
{
_errorResponse=[[GSWApplication application] handleException:_exception
inContext:_context];
};
DESTROY(_exception);
}
NS_ENDHANDLER;
// [_context deleteAllElementIDComponents];//NDFN
NSDebugMLLog(@"requests",@"_responsePage=%@",_responsePage);
if (_errorResponse)
{
_response=_errorResponse;
_responseContext=_context;
}
else
{
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 _setPageElement:_responsePage];
};
_responseRequest=[_responseContext request];//SoWhat ?
[_responseRequest isFromClientComponent];//SoWhat
};
}
{
[aContext _setPageChanged:NO];
isFromClientComponent=[request isFromClientComponent];
//??
[aContext _setPageReplaced:NO];
isFromClientComponent=[request isFromClientComponent];
};
if (hasFormValues)
{
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");
[aContext deleteAllElementIDComponents];//NDFN
};
[aContext _setPageChanged:NO];//???
isFromClientComponent=[request isFromClientComponent];
[aContext _setPageReplaced:NO];
};
if (senderID) //??
{
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:aContext];
NSDebugMLLog(@"requests",@"After invokeAction [aContext elementID]=%@",[aContext elementID]);
NSAssert([[aContext elementID] length]==0,@"4 lockedDispatchWithPreparedPage elementID length>0");
}
NS_HANDLER
{
LOGException0(@"exception in invokeActionForRequest");
LOGException(@"exception=%@",localException);
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"In invokeActionForRequest component=%@ of Class %@",
[aComponent name],
[aComponent class]);
LOGException(@"exception=%@",localException);
ASSIGN(exception,localException);
if (!responsePage)
{
errorResponse=[[GSWApplication application] handleException:exception
inContext:aContext];
};
DESTROY(exception);
}
NS_ENDHANDLER;
// [aContext deleteAllElementIDComponents];//NDFN
NSDebugMLLog(@"requests",@"responsePage=%@",responsePage);
if (errorResponse)
{
response=errorResponse;
responseContext=aContext;
}
else
{
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 _setPageElement:responsePage];
};
responseRequest=[responseContext request];//SoWhat ?
[responseRequest isFromClientComponent];//SoWhat
};
}
else
{
_responseContext=_context;
_responsePageElement=_page;
_responsePage=_component;
_responseRequest=_request;
};
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
}
NS_HANDLER
{
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
@"In appendToResponse page=%@ of Class %@",
[_page name],
[_page class]);
LOGException(@"exception=%@",localException);
NSDebugMLLog(@"requests",@"context=%@",_context);
_errorResponse=[[GSWApplication application] handleException:localException
inContext:_context];
}
NS_ENDHANDLER;
};
NSDebugMLLog(@"requests",@"_response=%@",_response);
{
responseContext=aContext;
responsePageElement=page;
responsePage=aComponent;
responseRequest=request;
};
if (!errorResponse)
{
NS_DURING
{
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]);
LOGException(@"exception=%@",localException);
NSDebugMLLog(@"requests",@"context=%@",aContext);
errorResponse=[[GSWApplication application] handleException:localException
inContext:aContext];
}
NS_ENDHANDLER;
};
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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;
-(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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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,13 +35,13 @@ 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: %@)>",
object_get_class_name(self),
(void*)self,
value,
[value class]];
return _dscr;
NSString* dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
(void*)self,
_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)
{
GSWLogAssertGood(value);
};
_dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
(void*)self,
value,
[value class]];
return _dscr;
if (_value)
{
GSWLogAssertGood(_value);
};
dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
object_get_class_name(self),
(void*)self,
_value,
[_value class]];
return dscr;
};
@end

View file

@ -1,11 +1,16 @@
/* debug.m - debug
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
/** GSWDebug.m - <title>GSWeb: Debug</title>
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$";
@ -78,237 +84,241 @@ NSString* objectDescription(id object)
{
NSString* description=nil;
if ([object respondsToSelector:@selector(description)])
{
NS_DURING
description=[object description];
NS_HANDLER
NS_ENDHANDLER;
};
{
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)
{
switch (*_type)
{
case _C_ID:
{
id* pvalue=(id*)_value;
return [NSString stringWithFormat:@"object:%ld Class:%s Description:%@",
(long)(*pvalue),
[*pvalue class],
objectDescription(*pvalue)];
};
break;
case _C_CLASS:
{
Class* pvalue=(Class*)_value;
return [NSString stringWithFormat:@"Class:%s",
class_get_class_name(*pvalue)];
};
break;
case _C_SEL:
{
SEL* pvalue=(SEL*)_value;
return [NSString stringWithFormat:@"SEL:%s",
sel_get_name(*pvalue)];
};
break;
case _C_CHR:
{
char* pvalue=(char*)_value;
return [NSString stringWithFormat:@"CHAR:%c",
*pvalue];
};
break;
case _C_UCHR:
{
unsigned char* pvalue=(unsigned char*)_value;
return [NSString stringWithFormat:@"UCHAR:%d",
(int)*pvalue];
};
break;
case _C_SHT:
{
short* pvalue=(short*)_value;
return [NSString stringWithFormat:@"SHORT:%d",
(int)*pvalue];
};
break;
case _C_USHT:
{
unsigned short* pvalue=(unsigned short*)_value;
return [NSString stringWithFormat:@"USHORT:%d",
(int)*pvalue];
};
break;
case _C_INT:
{
int* pvalue=(int*)_value;
return [NSString stringWithFormat:@"INT:%d",
*pvalue];
};
break;
case _C_UINT:
{
unsigned int* pvalue=(unsigned int*)_value;
return [NSString stringWithFormat:@"UINT:%u",
*pvalue];
};
break;
case _C_LNG:
{
long* pvalue=(long*)_value;
return [NSString stringWithFormat:@"LONG:%ld",
*pvalue];
};
break;
case _C_ULNG:
{
unsigned long* pvalue=(unsigned long*)_value;
return [NSString stringWithFormat:@"ULONG:%lu",
*pvalue];
};
break;
case _C_FLT:
{
float* pvalue=(float*)_value;
return [NSString stringWithFormat:@"FLOAT:%f",
(double)*pvalue];
};
break;
case _C_DBL:
{
double* pvalue=(double*)_value;
return [NSString stringWithFormat:@"DOUBLE:%f",
*pvalue];
};
break;
case _C_VOID:
{
void* pvalue=(void*)_value;
return [NSString stringWithFormat:@"VOID:*%lX",
(unsigned long)pvalue];
};
break;
case _C_CHARPTR:
{
char* pvalue=(void*)_value;
return [NSString stringWithFormat:@"CHAR*:%s",
pvalue];
};
break;
case _C_PTR:
{
return [NSString stringWithFormat:@"PTR"];
};
break;
case _C_STRUCT_B:
{
return [NSString stringWithFormat:@"STRUCT"];
};
break;
default:
return [NSString stringWithFormat:@"Unknown"];
};
}
if (aType && aValue)
{
switch (*aType)
{
case _C_ID:
{
id* pvalue=(id*)aValue;
return [NSString stringWithFormat:@"object:%ld Class:%s Description:%@",
(long)(*pvalue),
[*pvalue class],
objectDescription(*pvalue)];
};
break;
case _C_CLASS:
{
Class* pvalue=(Class*)aValue;
return [NSString stringWithFormat:@"Class:%s",
class_get_class_name(*pvalue)];
};
break;
case _C_SEL:
{
SEL* pvalue=(SEL*)aValue;
return [NSString stringWithFormat:@"SEL:%s",
sel_get_name(*pvalue)];
};
break;
case _C_CHR:
{
char* pvalue=(char*)aValue;
return [NSString stringWithFormat:@"CHAR:%c",
*pvalue];
};
break;
case _C_UCHR:
{
unsigned char* pvalue=(unsigned char*)aValue;
return [NSString stringWithFormat:@"UCHAR:%d",
(int)*pvalue];
};
break;
case _C_SHT:
{
short* pvalue=(short*)aValue;
return [NSString stringWithFormat:@"SHORT:%d",
(int)*pvalue];
};
break;
case _C_USHT:
{
unsigned short* pvalue=(unsigned short*)aValue;
return [NSString stringWithFormat:@"USHORT:%d",
(int)*pvalue];
};
break;
case _C_INT:
{
int* pvalue=(int*)aValue;
return [NSString stringWithFormat:@"INT:%d",
*pvalue];
};
break;
case _C_UINT:
{
unsigned int* pvalue=(unsigned int*)aValue;
return [NSString stringWithFormat:@"UINT:%u",
*pvalue];
};
break;
case _C_LNG:
{
long* pvalue=(long*)aValue;
return [NSString stringWithFormat:@"LONG:%ld",
*pvalue];
};
break;
case _C_ULNG:
{
unsigned long* pvalue=(unsigned long*)aValue;
return [NSString stringWithFormat:@"ULONG:%lu",
*pvalue];
};
break;
case _C_FLT:
{
float* pvalue=(float*)aValue;
return [NSString stringWithFormat:@"FLOAT:%f",
(double)*pvalue];
};
break;
case _C_DBL:
{
double* pvalue=(double*)aValue;
return [NSString stringWithFormat:@"DOUBLE:%f",
*pvalue];
};
break;
case _C_VOID:
{
void* pvalue=(void*)aValue;
return [NSString stringWithFormat:@"VOID:*%lX",
(unsigned long)pvalue];
};
break;
case _C_CHARPTR:
{
char* pvalue=(void*)aValue;
return [NSString stringWithFormat:@"CHAR*:%s",
pvalue];
};
break;
case _C_PTR:
{
return [NSString stringWithFormat:@"PTR"];
};
break;
case _C_STRUCT_B:
{
return [NSString stringWithFormat:@"STRUCT"];
};
break;
default:
return [NSString stringWithFormat:@"Unknown"];
};
}
else
return [NSString stringWithString:@"NULL type or NULL pValue"];
return [NSString stringWithString:@"NULL type or NULL pValue"];
};
//--------------------------------------------------------------------
NSString* TypeToNSString(const char* _type)
NSString* TypeToNSString(const char* aType)
{
if (_type)
{
switch (*_type)
{
case _C_ID:
{ // '@'
const char *t = _type + 1;
if (*t == '"')
{
const char *start = t + 1;
do
{
t++;
}
while ((*t != '"') && (*t != '\0'));
if (aType)
{
switch (*aType)
{
case _C_ID:
{ // '@'
const char *t = aType + 1;
if (*t == '"')
{
const char *start = t + 1;
do
{
t++;
}
while ((*t != '"') && (*t != '\0'));
return [[NSString stringWithCString:start
length:(t - start)]
stringByAppendingString:@" *"];
}
else
return @"id";
};
break;
case _C_CLASS: return @"Class";
case _C_SEL: return @"SEL";
case _C_CHR: return @"char";
case _C_UCHR: return @"unsigned char";
case _C_SHT: return @"short";
case _C_USHT: return @"unsigned short";
case _C_INT: return @"int";
case _C_UINT: return @"unsigned int";
case _C_LNG: return @"long";
case _C_ULNG: return @"unsigned long";
// case _C_LNG_LNG: return @"long long";
// case _C_ULNG_LNG: return @"unsigned long long";
case _C_FLT: return @"float";
case _C_DBL: return @"double";
case _C_VOID: return @"void";
case _C_CHARPTR: return @"char *";
case _C_PTR:
return [NSString stringWithFormat:@"%@ *",
TypeToNSString(_type + 1)];
break;
case _C_STRUCT_B:
{
NSString *structName = nil;
const char *t = _type + 1;
return [[NSString stringWithCString:start
length:(t - start)]
stringByAppendingString:@" *"];
}
else
return @"id";
};
break;
case _C_CLASS: return @"Class";
case _C_SEL: return @"SEL";
case _C_CHR: return @"char";
case _C_UCHR: return @"unsigned char";
case _C_SHT: return @"short";
case _C_USHT: return @"unsigned short";
case _C_INT: return @"int";
case _C_UINT: return @"unsigned int";
case _C_LNG: return @"long";
case _C_ULNG: return @"unsigned long";
// case _C_LNG_LNG: return @"long long";
// case _C_ULNG_LNG: return @"unsigned long long";
case _C_FLT: return @"float";
case _C_DBL: return @"double";
case _C_VOID: return @"void";
case _C_CHARPTR: return @"char *";
case _C_PTR:
return [NSString stringWithFormat:@"%@ *",
TypeToNSString(aType + 1)];
break;
case _C_STRUCT_B:
{
NSString *structName = nil;
const char *t = aType + 1;
if (*t == '?')
structName = @"?";
else
{
const char *beg = t;
while ((*t != '=') && (*t != '\0') && (*t != _C_STRUCT_E))
t++;
structName = [NSString stringWithCString:beg length:(t - beg)];
};
if (*t == '?')
structName = @"?";
else
{
const char *beg = t;
while ((*t != '=') && (*t != '\0') && (*t != _C_STRUCT_E))
t++;
structName = [NSString stringWithCString:beg length:(t - beg)];
};
return [NSString stringWithFormat:@"struct %@ {...}", structName];
};
return [NSString stringWithFormat:@"struct %@ {...}", structName];
};
default:
return [NSString stringWithFormat:@"%s", _type];
};
}
default:
return [NSString stringWithFormat:@"%s", aType];
};
}
else
return [NSString stringWithString:@"NULL type"];
return [NSString stringWithString:@"NULL type"];
};
//--------------------------------------------------------------------
void DumpIVar(id object,struct objc_ivar* ivar,int deep)
{
if (ivar && object && deep>=0)
{
void* pValue=((void*)object) + ivar->ivar_offset;
NSString* pType=TypeToNSString(ivar->ivar_type);
NSString* pIVar=IVarInString(ivar->ivar_type,pValue);
NSDebugFLog(@"IVar %s type:%@ value:%@\n",
ivar->ivar_name,
pType,
pIVar);
if (deep>0 && ivar->ivar_type && *ivar->ivar_type==_C_ID && pValue)
{
GSWLogDumpObjectFn(NULL,0,*((id*)pValue),deep);
};
};
{
void* pValue=((void*)object) + ivar->ivar_offset;
NSString* pType=TypeToNSString(ivar->ivar_type);
NSString* pIVar=IVarInString(ivar->ivar_type,pValue);
NSDebugFLog(@"IVar %s type:%@ value:%@\n",
ivar->ivar_name,
pType,
pIVar);
if (deep>0 && ivar->ivar_type && *ivar->ivar_type==_C_ID && pValue)
{
GSWLogDumpObjectFn(NULL,0,*((id*)pValue),deep);
};
};
};
//--------------------------------------------------------------------
@ -316,59 +326,59 @@ void DumpIVar(id object,struct objc_ivar* ivar,int deep)
void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep)
{
USTART
if (object && deep>0)
{
struct objc_ivar_list *ivars=NULL;
Class class = [object class];
if (class)
{
NSDebugFLog(@"--%s %d [%d] Dumping object %p of Class %s Description:%@\n",
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
line,
deep,
(void*)object,
class->name,
objectDescription(object));
while (class)
{
ivars = class->ivars;
class = class->super_class;
if (ivars)
{
int i;
for (i = 0; i < ivars->ivar_count; i++)
{
DumpIVar(object,&ivars->ivar_list[i],deep-1);
};
}
};
};
};
if (object && deep>0)
{
struct objc_ivar_list *ivars=NULL;
Class class = [object class];
if (class)
{
NSDebugFLog(@"--%s %d [%d] Dumping object %p of Class %s Description:%@\n",
(file && isalpha(*file) && line>=0 && line<=20000) ? file :"",
line,
deep,
(void*)object,
class->name,
objectDescription(object));
while (class)
{
ivars = class->ivars;
class = class->super_class;
if (ivars)
{
int i;
for (i = 0; i < ivars->ivar_count; i++)
{
DumpIVar(object,&ivars->ivar_list[i],deep-1);
};
}
};
};
};
USTOP
};
};
//--------------------------------------------------------------------
void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object)
{
if (object)
{
if ([object isa]==((Class)0xdeadface))
{
[GSWApp statusDebugWithFormat:@"DEAD FACE: object %p isa=%p in %s at %d\n",
(void*)object,
(void*)[object isa],
file,
line];
NSCParameterAssert([object isa]==(Class)0xdeadface);
};
}
{
if ([object isa]==((Class)0xdeadface))
{
[GSWApp statusDebugWithFormat:@"DEAD FACE: object %p isa=%p in %s at %d\n",
(void*)object,
(void*)[object isa],
file,
line];
NSCParameterAssert([object isa]==(Class)0xdeadface);
};
}
else
{
[GSWApp statusDebugWithFormat:@"NULL: object %p in %s at %d\n",
(void*)object,
file,
line];
NSCParameterAssert(object);
};
{
[GSWApp statusDebugWithFormat:@"NULL: object %p in %s at %d\n",
(void*)object,
file,
line];
NSCParameterAssert(object);
};
};
#endif

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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
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,29 +38,29 @@ 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)));
NSDebugMLog(@"selfLock->mutex backend m_owner=%p",
(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_owner));
NSDebugMLog(@"selfLock->mutex backend m_count=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_count));
NSDebugMLog(@"selfLock->mutex backend m_kind=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_kind));
NSDebugMLog(@"selfLock->mutex backend m_spinlock=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_spinlock));
NSDebugMLog(@"selfLock->mutex=%p",(void*)selfLock->mutex);
NSDebugMLog(@"selfLock->mutex backend=%p",(void*)((pthread_mutex_t*)(selfLock->mutex->backend)));
NSDebugMLog(@"selfLock->mutex backend m_owner=%p",
(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_owner));
NSDebugMLog(@"selfLock->mutex backend m_count=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_count));
NSDebugMLog(@"selfLock->mutex backend m_kind=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_kind));
NSDebugMLog(@"selfLock->mutex backend m_spinlock=%p",(void*)(((pthread_mutex_t*)(selfLock->mutex->backend))->m_spinlock));
*/
};
};
LOGObjectFnStop();
return self;
};
@ -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*)objc_thread_id(),
(void*)creation_thread_id);
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_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);
@ -90,14 +91,14 @@ static char rcsId[] = "$Id$";
NSString* descr=nil;
// GSWLogC("GSWDeployedBundle description A");
descr=[NSString stringWithFormat:@"<%s %p - ",
object_get_class_name(self),
(void*)self];
object_get_class_name(self),
(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,291 +149,295 @@ 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]);
//TODO
[self unlock];
[localException raise];
};
{
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]);
//TODO
[self unlock];
[localException raise];
};
{
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]);
//TODO
[self unlock];
[localException raise];
};
{
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
localException,[localException reason]);
//TODO
[self unlock];
[localException raise];
};
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_
inDirectory:@"Resources/WebServer"
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
inDirectory:@"Resources"
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
inDirectory:@"."
forLanguage:language_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
};
};
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources/WebServer"
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources"
forLanguage:aLanguage];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"."
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_
inDirectory:@"Resources/WebServer"
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
inDirectory:@"Resources"
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
if (!_path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
_path=[self lockedRelativePathForResourceNamed:name_
inDirectory:@"."
forLanguages:languages_];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
};
};
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources/WebServer"
forLanguages:someLanguages];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"Resources"
forLanguages:someLanguages];
NSDebugMLLog(@"bundles",@"path=%@",path);
if (!path)
{
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
path=[self lockedRelativePathForResourceNamed:aName
inDirectory:@"."
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_)
{
int i=0;
for(i=0;!_path && i<[languages_ count];i++)
{
_path=[self lockedCachedRelativePathForResourceNamed:name_
inDirectory:directory_
forLanguage:[languages_ objectAtIndex:i]];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
};
};
if (!_path)
_path=[self lockedCachedRelativePathForResourceNamed:name_
inDirectory:directory_
forLanguage:nil];
NSDebugMLLog(@"bundles",@"_path=%@",_path);
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ someLanguages=%@",aName,aDirectory,someLanguages);
if (someLanguages)
{
int i=0;
for(i=0;!path && i<[someLanguages count];i++)
{
path=[self lockedCachedRelativePathForResourceNamed:aName
inDirectory:aDirectory
forLanguage:[someLanguages objectAtIndex:i]];
NSDebugMLLog(@"bundles",@"path=%@",path);
};
};
if (!path)
path=[self lockedCachedRelativePathForResourceNamed:aName
inDirectory:aDirectory
forLanguage:nil];
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_)
{
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,
nil];
else
_keys=[NSArray arrayWithObjects:name_,
_bundlePath ? _bundlePath : _emptyString,
directory_ ? directory_ : _emptyString,
nil];
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
_path=[relativePathsCache objectForKeysArray:_keys];
//NSDebugMLLog(@"bundles",@"_path=%@",_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_];
//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)
{
_path=_pathTest;
[relativePathsCache setObject:_path
forKeysArray:_keys];
}
else
[relativePathsCache setObject:GSNotFoundMarker
forKeysArray:_keys];
};
};
NSDebugMLLog(@"bundles",@"_path=%@",_path);
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
if (aName)
{
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:aName,
bundlePath ? bundlePath : emptyString,
aDirectory ? aDirectory : emptyString,
nil];
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
path=[_relativePathsCache objectForKeysArray:keys];
//NSDebugMLLog(@"bundles",@"_path=%@",_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 (aDirectory)
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
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];
}
else
[_relativePathsCache setObject:GSNotFoundMarker
forKeysArray:keys];
};
};
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,27 +446,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 (selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
if (_selfLockn>0)
{
if (_selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
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,
(void*)objc_thread_id());
_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
LOGObjectFnStop();
};
@ -471,28 +476,28 @@ 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*)objc_thread_id());
if (selfLockn>0)
{
if (selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
TmpUnlock(selfLock);
(void*)_selfLock,
_selfLockn,
(void*)_selfLock_thread_id,
(void*)objc_thread_id());
if (_selfLockn>0)
{
if (_selfLock_thread_id!=objc_thread_id())
{
NSDebugMLog0(@"PROBLEM: owner!=thread id");
};
};
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*)objc_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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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,171 +35,176 @@ 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]*/)
{
//TODO
}
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];
NS_DURING
{
id submitButtonsActionPathFromRequest=nil;
NSArray* requestHandlerPathArray=nil;
NSString* actionName=nil;
NSString* className=nil;
GSWContext* context=nil;
[application lockRequestHandling];
NS_DURING
{
NS_DURING
{
NS_DURING
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])
{
_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])
{
case 0:
_actionName=@"default";
_className=@"DirectAction";
break;
case 1:
case 0:
actionName=@"default";
className=@"DirectAction";
break;
case 1:
{
NSString* tmpActionName=[NSString stringWithFormat:@"%@Action",
[requestHandlerPathArray objectAtIndex:0]];
SEL tmpActionSel=NSSelectorFromString(tmpActionName);
Class aClass = NSClassFromString(@"DirectAction");
NSDebugMLLog(@"requests",@"tmpActionName=%@",
tmpActionName);
if (tmpActionSel && aClass)
{
NSString* _tmpActionName=[NSString stringWithFormat:@"%@Action",
[_requestHandlerPathArray objectAtIndex:0]];
SEL _tmpActionSel=NSSelectorFromString(_tmpActionName);
Class _class = NSClassFromString(@"DirectAction");
NSDebugMLLog(@"requests",@"_tmpActionName=%@",_tmpActionName);
if (_tmpActionSel && _class)
if ([aClass instancesRespondToSelector:tmpActionSel])
{
if ([_class instancesRespondToSelector:_tmpActionSel])
{
_actionName=[_requestHandlerPathArray objectAtIndex:0];
_className=@"DirectAction";
};
};
if (!_actionName)
{
_className=[_requestHandlerPathArray objectAtIndex:0];
_actionName=@"default";
actionName=[requestHandlerPathArray objectAtIndex:0];
className=@"DirectAction";
};
};
break;
case 2:
_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])
{
//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];
//Finir ?
};
}
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
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);
//Here ???
[_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];
if (!actionName)
{
className=[requestHandlerPathArray objectAtIndex:0];
actionName=@"default";
};
};
break;
case 2:
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])
{
//TODO
};
{
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 ?
};
}
NS_HANDLER
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
[_application unlockRequestHandling];
[localException raise];//TODO
if (!context)
context=[GSWApp _context];
response=[application handleException:localException
inContext:context];
//TODO
};
NS_ENDHANDLER;
[_application unlockRequestHandling];
};
NS_ENDHANDLER;
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];
//TODO do not fnalize if already done (in handleException for exemple)
[response _finalizeInContext:context];
[application _setContext:nil];
statisticsStore=[[GSWApplication application] statisticsStore];
[statisticsStore _applicationDidHandleDirectActionRequestWithActionNamed:actionName];
}
NS_HANDLER
{
LOGException(@"%@ (%@)",localException,[localException reason]);
[application unlockRequestHandling];
[localException raise];//TODO
};
NS_ENDHANDLER;
[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)
{
//TODO
};
submitActions=[aRequest formValuesForKey:GSWKey_SubmitAction[GSWebNamingConv]];
if (submitActions)
{
//TODO
};
LOGObjectFnNotImplemented(); //TODOFN
LOGObjectFnStop();
return nil;

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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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,46 +33,46 @@
#define _GSWDisplayGroup_h__
#if !GDL2
#ifndef TCSDB
#include <eoaccess/EOModel.h>
#include <eoaccess/EOEntity.h>
#include <eoaccess/EOAttribute.h>
#include <eoaccess/EOAttributeOrdering.h>
#include <eoaccess/EORelationship.h>
#include <eoaccess/EOQualifier.h>
#ifdef TCSDB
#import <TCSimpleDB/EODefines.h>
#import <TCSimpleDB/EODefines.h>
#else // TCSDB
#include <eoaccess/EOModel.h>
#include <eoaccess/EOEntity.h>
#include <eoaccess/EOAttribute.h>
#include <eoaccess/EOAttributeOrdering.h>
#include <eoaccess/EORelationship.h>
#include <eoaccess/EOQualifier.h>
#include <eoaccess/EOAdaptor.h>
#include <eoaccess/EOAdaptorContext.h>
#include <eoaccess/EOAdaptorChannel.h>
#include <eoaccess/EOAdaptor.h>
#include <eoaccess/EOAdaptorContext.h>
#include <eoaccess/EOAdaptorChannel.h>
#include <eoaccess/EODatabase.h>
#include <eoaccess/EODatabaseContext.h>
#include <eoaccess/EODatabaseChannel.h>
#include <eoaccess/EODataSources.h>
#include <eoaccess/EODatabaseDataSource.h>
#include <eoaccess/EODatabase.h>
#include <eoaccess/EODatabaseContext.h>
#include <eoaccess/EODatabaseChannel.h>
#include <eoaccess/EODataSources.h>
#include <eoaccess/EODatabaseDataSource.h>
#include <eoaccess/EOGenericRecord.h>
#include <eoaccess/EONull.h>
#include <eoaccess/EOSQLExpression.h>
#include <eoaccess/EOGenericRecord.h>
#include <eoaccess/EONull.h>
#include <eoaccess/EOSQLExpression.h>
@class EOKeyValueUnarchiver;
@class EOKeyValueUnarchiver;
#define EODataSource EODatabaseDataSource
#else // TCSDB
#import <TCSimpleDB/TCSimpleDB.h>
#import <TCSimpleDB/EODefines.h>
#endif
#define EODataSource EODatabaseDataSource
#endif
#else
#import <EOControl/EOQualifier.h>
#import <EOControl/EODataSource.h>
#import <EOControl/EODetailDataSource.h>
#import <EOControl/EOKeyValueArchiver.h>
#import <EOAccess/EODatabaseDataSource.h>
#import <EOControl/EOQualifier.h>
#import <EOControl/EODataSource.h>
#import <EOControl/EODetailDataSource.h>
#import <EOControl/EOKeyValueArchiver.h>
#import <EOAccess/EODatabaseDataSource.h>
#endif
@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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Mirko Viviani <mirko.viviani@rccr.cremona.it>
Date: Jan 1999
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$";
@ -53,7 +59,7 @@ static char rcsId[] = "$Id$";
_queryBindings = [[NSMutableDictionary alloc] initWithCapacity:8];
// _selection = 1; //????
_batchIndex = 1;
_batchIndex = 1;
[[NSNotificationCenter defaultCenter]
addObserver:self
@ -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,19 +378,19 @@ 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
didFetchObjects:object2];
[_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,8 +2058,8 @@ STOP ?
if(_delegateRespondsTo.displayArrayForObjects == YES)
{
[_displayedObjects addObjectsFromArray:[delegate displayGroup:self
displayArrayForObjects:_allObjects]];
[_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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
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,49 +36,49 @@
//====================================================================
@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;
-(id)initWithCharactersNoCopy:(unichar*)chars
length:(unsigned int)length
freeWhenDone:(BOOL)flag;
length:(unsigned int)length
freeWhenDone:(BOOL)flag;
-(id)initWithCharacters:(const unichar*)chars
length:(unsigned int)length;
length:(unsigned int)length;
-(id)initWithCStringNoCopy:(char*)byteString
length:(unsigned int)length
freeWhenDone:(BOOL)flag;
length:(unsigned int)length
freeWhenDone:(BOOL)flag;
-(id)initWithCString:(const char*)byteString
length:(unsigned int)length;
length:(unsigned int)length;
-(id)initWithCString:(const char*)byteString;
-(id)initWithString:(NSString*)string;
-(id)initWithFormat:(NSString*)format,...;
-(id)initWithFormat:(NSString*)format
arguments:(va_list)argList;
arguments:(va_list)argList;
-(id)initWithData:(NSData*)data
encoding:(NSStringEncoding)encoding;
encoding:(NSStringEncoding)encoding;
-(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

File diff suppressed because it is too large Load diff

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

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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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>
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$
$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>
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$
$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,83 +34,84 @@ 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];
return self;
if ((self = [super init]))
{
ASSIGN(_associations,associations);
ASSIGN(_element,templateElement);
};
return self;
};
//--------------------------------------------------------------------
-(void)dealloc
{
[associations release];
[element release];
[super dealloc];
DESTROY(_associations);
DESTROY(_element);
[super dealloc];
};
//--------------------------------------------------------------------
-(NSString*)description
{
//TODOFN
//TODOFN
return [super description];
};
//--------------------------------------------------------------------
-(void)appendToResponse:(GSWResponse*)response_
inContext:(GSWContext*)context_
-(void)appendToResponse:(GSWResponse*)aResponse
inContext:(GSWContext*)aContext
{
NSEnumerator *assocEnumer;
id currentAssocKey;
id component = [context_ component];
id theValue;
id otherTag = nil;
id tag = [[associations objectForKey:@"elementName"] valueInComponent:component];
NSEnumerator *assocEnumer=nil;
id currentAssocKey=nil;
id component = [aContext component];
id theValue=nil;
id otherTag = nil;
id tag = [[_associations objectForKey:@"elementName"] valueInComponent:component];
[aResponse appendContentString:[NSString stringWithFormat:@"<%@",tag]];
[response_ 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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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];
errors=[NSMutableArray new];
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];
errors=[NSMutableArray new];
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];
warnings=[NSMutableArray new];
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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];
errors=[NSMutableArray new];
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];
errors=[NSMutableArray new];
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];
warnings=[NSMutableArray new];
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Apr 1999
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
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,93 +35,93 @@ 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];
//pageSetVarAssociations//GNUstepWeb only
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");
return self;
};
@ -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];
}
@ -158,8 +164,8 @@ static char rcsId[] = "$Id$";
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p>",
object_get_class_name(self),
(void*)self];
object_get_class_name(self),
(void*)self];
};
@end
@ -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])
{
GSWComponent* _component=[context_ 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
{
if (pageSetVarAssociations)
{
[pageSetVarAssociations associationsSetValuesFromObject:_component
inObject:(GSWComponent*)_element];
};
if (pageSetVarAssociationsDynamic)
{
NSDictionary* _assocs=[pageSetVarAssociationsDynamic valueInComponent:_component];
if (_assocs)
{
if (![_assocs isKindOfClass:[NSDictionary class]])
{
ExceptionRaise(@"GSWHTMLURLValuedElement",@"%@ (%@) must return a Dictionary, not a %@ like %@",
pageSetVars__Key,
pageSetVarAssociationsDynamic,
[_assocs class],
_assocs);
}
else
{
[_assocs associationsSetValuesFromObject:_component
inObject:(GSWComponent*)_element];
};
};
};
};
};
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
//the end ?
//TODOV
if (!_element)
_element=[context_ page];
}
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=[aContext component];
if (_value)
element=[_value valueInComponent:component];
else if (_pageName)
{
NSString* pageNameValue=[_pageName valueInComponent:component];
element=[GSWApp pageWithName:pageNameValue
inContext:aContext];
if (!WOStrictFlag && element)//GNUstepWeb only
{
if (_pageSetVarAssociations)
{
[_pageSetVarAssociations associationsSetValuesFromObject:component
inObject:(GSWComponent*)element];
};
if (_pageSetVarAssociationsDynamic)
{
NSDictionary* assocs=[_pageSetVarAssociationsDynamic valueInComponent:component];
if (assocs)
{
if (![assocs isKindOfClass:[NSDictionary class]])
{
ExceptionRaise(@"GSWHTMLURLValuedElement",@"%@ (%@) must return a Dictionary, not a %@ like %@",
pageSetVars__Key,
_pageSetVarAssociationsDynamic,
[assocs class],
assocs);
}
else
{
[assocs associationsSetValuesFromObject:component
inObject:(GSWComponent*)element];
};
};
};
};
};
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke element=%@",element);
//the end ?
//TODOV
if (!element)
element=[aContext page];
}
else
{
_element=[super invokeActionForRequest:request_
inContext:context_];
};
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]);
{
element=[super invokeActionForRequest:aRequest
inContext:aContext];
};
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)
{
_keyValue=[key valueInComponent:_component];
_dataValue=[_resourceManager _cachedDataForKey:_keyValue];
};
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
key:nil] autorelease];
NSDebugMLLog(@"gswdync",@"_dataValue=%@",_dataValue);
[_resourceManager setURLValuedElementData:_dataValue];
}
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];
};
};
[response_ appendContentCharacter:' '];
_urlAttributeName=[self urlAttributeName];
if (_urlAttributeName)
{
[response_ _appendContentAsciiString:_urlAttributeName];
[response_ _appendContentAsciiString:@"=\""];
};
if (src)
{
[response_ appendContentString:_url];
}
{
if (_key)
{
keyValue=[_key valueInComponent:component];
dataValue=[resourceManager _cachedDataForKey:keyValue];
};
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
key:nil] autorelease];
NSDebugMLLog(@"gswdync",@"dataValue=%@",dataValue);
[resourceManager setURLValuedElementData:dataValue];
}
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:aContext];
NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue);
request=[aContext request];
languages=[aContext languages];
url=[resourceManager urlForResourceNamed:filenameValue
inFramework:frameworkValue
languages:languages
request:request];
};
};
[aResponse appendContentCharacter:' '];
urlAttributeName=[self urlAttributeName];
if (urlAttributeName)
{
[aResponse _appendContentAsciiString:urlAttributeName];
[aResponse _appendContentAsciiString:@"=\""];
};
if (_src)
{
[aResponse appendContentString:url];
}
else
{
if (key || data)
{
[_dataValue appendDataURLToResponse:response_
inContext:context_];
}
else if (filename)
{
NSDebugMLLog(@"gswdync",@"_url = %@",_url);
[response_ appendContentString:_url];
}
else
{
GSWDynamicURLString* _componentActionURL=[context_ componentActionURL];
NSDebugMLLog(@"gswdync",@"_componentActionURL=%@",_componentActionURL);
[response_ appendContentString:(NSString*)_componentActionURL];
};
};
if (_urlAttributeName)
[response_ appendContentCharacter:'"'];
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
{
if (_key || _data)
{
[dataValue appendDataURLToResponse:aResponse
inContext:aContext];
}
else if (_filename)
{
NSDebugMLLog(@"gswdync",@"url = %@",url);
[aResponse appendContentString:url];
}
else
{
GSWDynamicURLString* componentActionURL=[aContext componentActionURL];
NSDebugMLLog(@"gswdync",@"componentActionURL=%@",componentActionURL);
[aResponse appendContentString:(NSString*)componentActionURL];
};
};
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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,13 +35,13 @@ 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_
forKey:self];
[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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWMultiKeyDictionary.h - <title>GSWeb: Class GSWMultiKeyDictionary</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWMultiKeyDictionary.m - <title>GSWeb: Class GSWMultiKeyDictionary</title>
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,13 +52,13 @@ 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,37 +107,39 @@ static char rcsId[] = "$Id$";
array = [NSMutableArray array];
va_start(ap, keys_);
va_start(ap, keys);
tmpId = keys_;
do {
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
while ( tmpId );
tmpId = keys;
do
{
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
while(tmpId);
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 {
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
while ( tmpId );
tmpId = keys;
do
{
[array addObject:tmpId];
tmpId = va_arg(ap,id);
}
while(tmpId);
va_end(ap);
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWPageDefElement.h - <title>GSWeb: Class GSWPageDefElement</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
/** GSWPageDefElement.m - <title>GSWeb: Class GSWPageDefElement</title>
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$";
-(id)init
{
if ((self=[super init]))
{
};
{
};
return self;
};
@ -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,84 +64,84 @@ 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];
};
//--------------------------------------------------------------------
-(NSString*)description
{
return [NSString stringWithFormat:@"<%@ %p elementName:[%@] className:[%@] associations:\n%@",
[self class],
(void*)self,
elementName,
className,
associations];
[self class],
(void*)self,
_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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 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
@ -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];
errors=[NSMutableArray new];
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];
errors=[NSMutableArray new];
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];
warnings=[NSMutableArray new];
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWParam.m - <title>GSWeb: Class GSWParam</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWProjectBundle - <title>GSWeb: Class GSWProjectBundle</title>
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];
};
@ -63,51 +62,51 @@ static char rcsId[] = "$Id$";
-(NSString*)description
{
return [NSString stringWithFormat:@"<%s %p - bundlePath:[%@] relativePaths:[%@] projectName:[%@] subprojects:[%@] pbProjectDictionary:[%@]>",
object_get_class_name(self),
(void*)self,
bundlePath,
relativePathsCache,
projectName,
subprojects,
pbProjectDictionary];
object_get_class_name(self),
(void*)self,
_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]))
{
NSDirectoryEnumerator* dirEnum=nil;
NSString* filePath=nil;
NSFileManager* fileManager=[NSFileManager defaultManager];
dirEnum = [fileManager enumeratorAtPath:_path];
while ((filePath = [dirEnum nextObject]))
{
NSDictionary* attributes = [dirEnum fileAttributes];
NSString* fileType = [attributes objectForKey:NSFileType];
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"));
projectSearchPathEnum = [projectSearchPath objectEnumerator];
while ((path = [projectSearchPathEnum nextObject]))
{
NSDirectoryEnumerator* dirEnum=nil;
NSString* filePath=nil;
NSFileManager* fileManager=[NSFileManager defaultManager];
dirEnum = [fileManager enumeratorAtPath:path];
while ((filePath = [dirEnum nextObject]))
{
NSDictionary* attributes = [dirEnum fileAttributes];
NSString* fileType = [attributes objectForKey:NSFileType];
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=(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))
{
NSDebugMLLog(@"bundles",@"adding _tmpBundle:%@",_tmpBundleProjectName);
[_projectsBundles addObject:_tmpBundle];
};
};
};
};
_projectEnum =[_projectsBundles objectEnumerator];
while(!_projectBundle && (_aBundle = [_projectEnum nextObject]))
{
NSString* suffix1=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
NSString* suffix2=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
NSDebugMLLog(@"bundles",@"suffix1:%@ suffix2",suffix1,suffix2);
NSDebugMLLog(@"bundles",@"_aBundle:%@",_aBundle);
if ((isFramework && tmpBundleIsFramework)
||(!isFramework && !tmpBundleIsFramework))
{
NSDebugMLLog(@"bundles",@"adding tmpBundle:%@",tmpBundleProjectName);
[projectsBundles addObject:tmpBundle];
};
};
};
};
projectEnum =[projectsBundles objectEnumerator];
while(!projectBundle && (aBundle = [projectEnum nextObject]))
{
NSString* suffix1=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
NSString* suffix2=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
NSDebugMLLog(@"bundles",@"suffix1:%@ suffix2",suffix1,suffix2);
NSDebugMLLog(@"bundles",@"aBundle:%@",aBundle);
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_])
{
_projectBundle=_aBundle;
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
};
};
};
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
if ([[aBundle bundlePath]hasSuffix:suffix1]
|| [[aBundle bundlePath]hasSuffix:suffix2]
|| [[aBundle bundlePath]hasSuffix:@".debug"])
{
NSString* tmpName=[aBundle projectName];
NSDebugMLLog(@"bundles",@"tmpName:%@",tmpName);
if ([tmpName isEqual:aName])
{
projectBundle=aBundle;
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>
Copyright (C) 2000-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 2000
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
/** GSWRequestHandler.h - <title>GSWeb: Class GSWRequestHandler</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
/** GSWRequestHandler.m - <title>GSWeb: Class GSWRequestHandler</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
/** GSWResourceRequestHandler.h - <title>GSWeb: Class GSWResourceRequestHandler</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Feb 1999
/** GSWResourceRequestHandler.m - <title>GSWeb: Class GSWResourceRequestHandler</title>
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];
{
ExceptionRaise0(@"GSWResourceRequestHandler",@"No data key in request");
LOGError0(@"");//TODO
};
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
inContext:nil];
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);
//TODO
};
{
LOGSeriousError(@"No data for _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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWStatisticsStore.h - <title>GSWeb: Class GSWStatisticsStore</title>
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__

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,16 @@
/* GSWStats.h - GSWeb: Class GSWStats
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWStats.h - <title>GSWeb: Class GSWStats</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWStats.m - <title>GSWeb: Class GSWStats</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWTemplateParser - <title>GSWeb: Class GSWTemplateParser</title>
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,8 +2,8 @@
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
$Revision$
$Date$
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Mar 1999
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** GSWTemplateParserXML.h - <title>GSWeb: Class GSWTemplateParserXML</title>
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,8 +1,9 @@
/** GSWTemplateParserXML.m - <title>GSWeb: Class GSWTemplateParserXML</title>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Mar 1999
Date: Mar 1999
$Revision$
$Date$
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
/** GSWUtils.m - <title>GSWeb: Utilities</title>
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);
@ -179,7 +187,7 @@ extern NSData* HexStringToData(NSString* _string);
//====================================================================
@interface NSException (NSBuild)
+(NSException*)exceptionWithName:(NSString *)name
format:(NSString *)format,...;
format:(NSString *)format,...;
@end
@ -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
//====================================================================
@ -274,10 +282,10 @@ extern NSData* HexStringToData(NSString* _string);
+(NSString*)className;
-(id)performSelectorIfPossible:(SEL)aSelector;
-(id)performSelectorIfPossible:(SEL)aSelector
withObject:(id)anObject;
withObject:(id)anObject;
-(id)performSelectorIfPossible:(SEL)aSelector
withObject:(id)object1
withObject:(id)object2;
withObject:(id)object1
withObject:(id)object2;
@end
//====================================================================
@ -286,155 +294,162 @@ extern NSData* HexStringToData(NSString* _string);
@end
//====================================================================
#define TmpLock(_lock_) [(_lock_) tmplockFromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpTryLockBeforeDate(_lock_,_limit_) [(_lock_) tmptryLockBeforeDate:(_limit_) fromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpLockBeforeDate(_lock_,_limit_) [(_lock_) tmplockBeforeDate:(_limit_) fromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpUnlock(_lock_) [(_lock_) tmpunlockFromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpLock(_lock_) [(_lock_) tmplockFromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpTryLockBeforeDate(_lock_,_limit_) [(_lock_) tmptryLockBeforeDate:(_limit_) fromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpLockBeforeDate(_lock_,_limit_) [(_lock_) tmplockBeforeDate:(_limit_) fromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
#define TmpUnlock(_lock_) [(_lock_) tmpunlockFromFunction:__PRETTY_FUNCTION__ file:__FILE__ line:__LINE__]
//====================================================================
@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
withObject:(id)argument;
withObject:(id)argument;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
withObject:(id)argument1
withObject:(id)argument2;
withObject:(id)argument1
withObject:(id)argument2;
-(void)makeObjectsPerformIfPossible:(SEL)aSelector
withObject:(id)argument;
withObject:(id)argument;
@end
//====================================================================
@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
withObject:(id)argument;
withObject:(id)argument;
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
withObject:(id)argument1
withObject:(id)argument2;
withObject:(id)argument1
withObject:(id)argument2;
-(void)makeObjectsPerformIfPossible:(SEL)aSelector
withObject:(id)argument;
withObject:(id)argument;
@end
//====================================================================
@interface NSDictionary (FromNSArray)
+(id)dictionaryWithArray:(NSArray*)array_
onSelector:(SEL)sel_;
+(id)dictionaryWithArray:(NSArray*)array_
onSelector:(SEL)sel_
withObject:(id)object;
+(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
//====================================================================
@interface NSData (SBNSData)
-(NSRange)rangeOfData:(NSData*)data;
-(NSRange)rangeOfData:(NSData*)data
options:(unsigned)mask;
options:(unsigned)mask;
-(NSRange)rangeOfData:(NSData *)aData
options:(unsigned)mask
range:(NSRange)aRange;
-(NSArray*)componentsSeparatedByData:(NSData*)separator_;
-(NSData*)dataByDeletingFirstBytesCount:(unsigned int)bytesCount_;
-(NSData*)dataByDeletingLastBytesCount:(unsigned int)bytesCount_;
options:(unsigned)mask
range:(NSRange)aRange;
-(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
//====================================================================
typedef enum _NSNumFmtType
{
NSNumFmtType__Unknown = 0,
NSNumFmtType__Int = 1,
NSNumFmtType__Int = 1,
NSNumFmtType__Float = 2,
} 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
errorDescription:(NSString**)error;
forString:(NSString*)string
errorDescription:(NSString**)error;
@end
#endif // _GSWebUtils_h__

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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Dec 2000
/** GSWWOCompatibility.h - <title>GSWeb: GSWWOCompatibility</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Dec 2000
/** GSWWOCompatibility.m - <title>GSWeb: GSWWOCompatibility</title>
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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>
Copyright (C) 1999-2002 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
Date: Jan 1999
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSNonBlockingFileHandle.h - <title>GSWeb: NSNonBlockingFileHandle</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSNonBlockingFileHandle.m - <title>GSWeb: NSNonBlockingFileHandle</title>
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,26 +71,26 @@
// 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];
if(ioctl(fd, FIONREAD, (char *) &numBytes) == -1)
{
LOGException0(@"NSFileHandleOperationException ioctl() Err");
[NSException raise: NSFileHandleOperationException
format: @"ioctl() Err # %d", (int)errno];
};
if (ioctl(fd, FIONREAD, (char *) &numBytes) == -1)
{
LOGException0(@"NSFileHandleOperationException ioctl() Err");
[NSException raise: NSFileHandleOperationException
format: @"ioctl() Err # %d", (int)errno];
};
LOGObjectFnStop();
return numBytes;
};
@ -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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSString+HTML.h - <title>GSWeb: NSString / HTML</title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSString+HTML.m - <title>GSWeb: NSString / HTML</title>
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$";
@ -136,59 +142,59 @@ static NSArray* htmlChars=nil;
void initHtmlChars()
{
if (!normalChars)
{
normalChars=[[NSArray arrayWithObjects:
@"&",
@">",
@"<",
@"\"",
@"£",
@"|",
@"°",
@"é",
@"ç",
@"à",
@"â",
@"ã",
@"è",
@"ê",
@"ì",
@"î",
@"ñ",
@"ô",
@"õ",
@"ù",
@"û",
nil
] retain];
};
{
normalChars=[[NSArray arrayWithObjects:
@"&",
@">",
@"<",
@"\"",
@"£",
@"|",
@"°",
@"é",
@"ç",
@"à",
@"â",
@"ã",
@"è",
@"ê",
@"ì",
@"î",
@"ñ",
@"ô",
@"õ",
@"ù",
@"û",
nil
] retain];
};
if (!htmlChars)
{
htmlChars=[[NSArray arrayWithObjects:
@"&amp;",
@"&gt;",
@"&lt;",
@"&quot;",
@"&pound;",
@"&brvbar;",
@"&deg;",
@"&eacute;",
@"&ccedil;",
@"&agrave;",
@"&acirc;",
@"&atilde;",
@"&egrave;",
@"&ecirc;",
@"&igrave;",
@"&icirc;",
@"&ntilde;",
@"&ocirc;",
@"&otilde;",
@"&ugrave;",
@"&ucirc;",
nil
] retain];
};
{
htmlChars=[[NSArray arrayWithObjects:
@"&amp;",
@"&gt;",
@"&lt;",
@"&quot;",
@"&pound;",
@"&brvbar;",
@"&deg;",
@"&eacute;",
@"&ccedil;",
@"&agrave;",
@"&acirc;",
@"&atilde;",
@"&egrave;",
@"&ecirc;",
@"&igrave;",
@"&icirc;",
@"&ntilde;",
@"&ocirc;",
@"&otilde;",
@"&ugrave;",
@"&ucirc;",
nil
] retain];
};
};
//====================================================================
@ -198,7 +204,7 @@ void initHtmlChars()
-(NSString*)htmlPlus2Space
{
return [self stringByReplacingString:@"+"
withString:@" "];
withString:@" "];
};
//--------------------------------------------------------------------
@ -211,46 +217,46 @@ 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 == '%')
if (*p == '%')
{
//
// 2 hex digits follow...
//
int i=0;
_uniChar=0;
for (i=0;p[1] && i<2;i++)
//
// 2 hex digits follow...
//
int i=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);
if (isdigit(*p))
_uniChar+=*p-'0';
else
_uniChar+=toupper(*p)-'A'+10;
NSDebugMLLog(@"low",@"_uniChar=%x",(unsigned int)_uniChar);
p++;
NSDebugMLLog(@"low",@"*p=%c %u",(char)*p,(unsigned int)*p);
uniChar <<= 4;
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
if (isdigit(*p))
uniChar+=*p-'0';
else
uniChar+=toupper(*p)-'A'+10;
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
};
}
else
_uniChar=(unsigned char)*p;
_unichars[uniCharsIndex]=_uniChar;
uniCharsIndex++;
else
uniChar=(unsigned char)*p;
unichars[uniCharsIndex]=uniChar;
uniCharsIndex++;
};
temp=[NSString stringWithCharacters:_unichars
length:uniCharsIndex];
temp=[NSString stringWithCharacters:unichars
length:uniCharsIndex];
NSDebugMLLog(@"low",@"temp=%@",temp);
NSDebugMLLog(@"low",@"temp data=%@",[temp dataUsingEncoding:NSISOLatin1StringEncoding]);
return temp;
@ -270,120 +276,121 @@ 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++)
{
if (isdigit(*p) || isalpha(*p) || (valid && strchr(valid, *p)))
[temp appendFormat:@"%c",*p];
else
[temp appendFormat:@"%%%c%c",digits[(*p >> 4) & 0x0f],digits[*p & 0x0f]];
if (isdigit(*p) || isalpha(*p) || (valid && strchr(valid, *p)))
[temp appendFormat:@"%c",*p];
else
[temp appendFormat:@"%%%c%c",digits[(*p >> 4) & 0x0f],digits[*p & 0x0f]];
};
return [NSString stringWithString:temp];
return [NSString stringWithString:temp];
}
//--------------------------------------------------------------------
-(NSDictionary*)dictionaryQueryString
{
return [self dictionaryWithSep1:@"&"
withSep2:@"="
withOptionUnescape:YES];
withSep2:@"="
withOptionUnescape:YES];
};
//--------------------------------------------------------------------
-(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];
int iCount=0;
pDico=[NSMutableDictionary dictionary];
for(iCount=0;iCount<[listItems count];iCount++)
{
if ([[listItems objectAtIndex:iCount] length]>0)
{
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:p_pstrSep2];
id key=nil;
id value=nil;
if ([listParam count]==1)
{
key=[listParam objectAtIndex:0];
if (_unescape)
key=[key decodeURL];
}
else if ([listParam count]==2)
{
key=[listParam objectAtIndex:0];
value=[listParam objectAtIndex:1];
if (_unescape)
{
key=[key decodeURL];
value=[value decodeURL];
};
};
if (key)
{
id newValue=nil;
id prevValue=[pDico objectForKey:key];
if (!value)
value=[NSString string];
if (prevValue)
newValue=[prevValue arrayByAddingObject:value];
else
newValue=[NSArray arrayWithObject:value];
[pDico setObject:newValue
forKey: key];
};
};
};
pDico=[NSDictionary dictionaryWithDictionary:pDico];
};
return pDico;
NSMutableDictionary* pDico=nil;
if ([self length]>0)
{
NSArray* listItems = [self componentsSeparatedByString:sep1];
int iCount=0;
pDico=(NSMutableDictionary*)[NSMutableDictionary dictionary];
for(iCount=0;iCount<[listItems count];iCount++)
{
if ([[listItems objectAtIndex:iCount] length]>0)
{
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:sep2];
id key=nil;
id value=nil;
if ([listParam count]==1)
{
key=[listParam objectAtIndex:0];
if (unescape)
key=[key decodeURL];
}
else if ([listParam count]==2)
{
key=[listParam objectAtIndex:0];
value=[listParam objectAtIndex:1];
if (unescape)
{
key=[key decodeURL];
value=[value decodeURL];
};
};
if (key)
{
id newValue=nil;
id prevValue=[pDico objectForKey:key];
if (!value)
value=[NSString string];
if (prevValue)
newValue=[prevValue arrayByAddingObject:value];
else
newValue=[NSArray arrayWithObject:value];
[pDico setObject:newValue
forKey: key];
};
};
};
pDico=[NSDictionary dictionaryWithDictionary:pDico];
};
return pDico;
};
//--------------------------------------------------------------------
-(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_])
{
if (x_)
{
NSDebugMLLog(@"low",@"x=%d",*x_);
};
if ([_scanner scanString:@"," intoString:NULL])
{
if ([_scanner scanInt:y_])
{
if (y_)
{
NSDebugMLLog(@"low",@"y=%d",*y_);
};
NSDebugMLLog(@"low",@"[_scanner isAtEnd]=%d",(int)[_scanner isAtEnd]);
if ([_scanner isAtEnd])
{
_ok=YES;
};
};
};
};
if (!_ok)
{
if (x_)
*x_=INT_MAX;
if (y_)
*y_=INT_MAX;
};
return _ok;
BOOL ok=NO;
NSScanner* scanner=[NSScanner scannerWithString:self];
if ([scanner scanInt:x])
{
if (x)
{
NSDebugMLLog(@"low",@"x=%d",*x);
};
if ([scanner scanString:@","
intoString:NULL])
{
if ([scanner scanInt:y])
{
if (y)
{
NSDebugMLLog(@"low",@"y=%d",*y);
};
NSDebugMLLog(@"low",@"[scanner isAtEnd]=%d",(int)[scanner isAtEnd]);
if ([scanner isAtEnd])
{
ok=YES;
};
};
};
};
if (!ok)
{
if (x)
*x=INT_MAX;
if (y)
*y=INT_MAX;
};
return ok;
};
//--------------------------------------------------------------------
@ -392,15 +399,15 @@ void initHtmlChars()
//TODO speed
NSString* str=nil;
if ([self length]>0)
{
NSMutableString* tmp=[self mutableCopy];
[tmp replaceString:@"&" withString:@"&amp;"];
[tmp replaceString:@"\"" withString:@"&quot;"];
[tmp replaceString:@"<" withString:@"&lt;"];
[tmp replaceString:@">" withString:@"&gt;"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
NSMutableString* tmp=[self mutableCopy];
[tmp replaceString:@"&" withString:@"&amp;"];
[tmp replaceString:@"\"" withString:@"&quot;"];
[tmp replaceString:@"<" withString:@"&lt;"];
[tmp replaceString:@">" withString:@"&gt;"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};
@ -410,18 +417,18 @@ void initHtmlChars()
//TODO speed
NSString* str=nil;
if ([self length]>0)
{
NSMutableString* tmp=[self mutableCopy];
[tmp replaceString:@"&" withString:@"&amp;"];
[tmp replaceString:@"\"" withString:@"&quot;"];
[tmp replaceString:@"<" withString:@"&lt;"];
[tmp replaceString:@">" withString:@"&gt;"];
[tmp replaceString:@"\t" withString:@"&#9;"];
[tmp replaceString:@"\n" withString:@"&#10;"];
[tmp replaceString:@"\r" withString:@"&#13;"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
NSMutableString* tmp=[self mutableCopy];
[tmp replaceString:@"&" withString:@"&amp;"];
[tmp replaceString:@"\"" withString:@"&quot;"];
[tmp replaceString:@"<" withString:@"&lt;"];
[tmp replaceString:@">" withString:@"&gt;"];
[tmp replaceString:@"\t" withString:@"&#9;"];
[tmp replaceString:@"\n" withString:@"&#10;"];
[tmp replaceString:@"\r" withString:@"&#13;"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};
@ -431,19 +438,19 @@ void initHtmlChars()
//TODO speed
NSString* str=nil;
if ([self length]>0)
{
int i=0;
NSMutableString* tmp=[self mutableCopy];
if (!normalChars)
initHtmlChars();
for(i=0;i<[normalChars count];i++)
{
[tmp replaceString:[normalChars objectAtIndex:i]
withString:[htmlChars objectAtIndex:i]];
};
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
int i=0;
NSMutableString* tmp=[self mutableCopy];
if (!normalChars)
initHtmlChars();
for(i=0;i<[normalChars count];i++)
{
[tmp replaceString:[normalChars objectAtIndex:i]
withString:[htmlChars objectAtIndex:i]];
};
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};
@ -452,19 +459,19 @@ void initHtmlChars()
{
NSString* str=nil;
if ([self length]>0)
{
int i=0;
NSMutableString* tmp=[self mutableCopy];
if (!normalChars)
initHtmlChars();
for(i=0;i<[normalChars count];i++)
{
[tmp replaceString:[htmlChars objectAtIndex:i]
withString:[normalChars objectAtIndex:i]];
};
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
int i=0;
NSMutableString* tmp=[self mutableCopy];
if (!normalChars)
initHtmlChars();
for(i=0;i<[normalChars count];i++)
{
[tmp replaceString:[htmlChars objectAtIndex:i]
withString:[normalChars objectAtIndex:i]];
};
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};
@ -473,15 +480,15 @@ void initHtmlChars()
{
NSString* str=nil;
if ([self length]>0)
{
//TODO speed
NSMutableString* tmp=[[self stringByConvertingToHTMLEntities] mutableCopy];
[tmp replaceString:@"\r\n" withString:@"<BR>"];
[tmp replaceString:@"\r" withString:@"<BR>"];
[tmp replaceString:@"\n" withString:@"<BR>"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
//TODO speed
NSMutableString* tmp=[[self stringByConvertingToHTMLEntities] mutableCopy];
[tmp replaceString:@"\r\n" withString:@"<BR>"];
[tmp replaceString:@"\r" withString:@"<BR>"];
[tmp replaceString:@"\n" withString:@"<BR>"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};
@ -490,13 +497,13 @@ void initHtmlChars()
{
NSString* str=nil;
if ([self length]>0)
{
//TODO speed
NSMutableString* tmp=[[self stringByConvertingFromHTMLEntities] mutableCopy];
[tmp replaceString:@"<BR>" withString:@"\n"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
{
//TODO speed
NSMutableString* tmp=[[self stringByConvertingFromHTMLEntities] mutableCopy];
[tmp replaceString:@"<BR>" withString:@"\n"];
str = AUTORELEASE([tmp copy]);
RELEASE(tmp);
};
return str;
};

View file

@ -1,11 +1,16 @@
/* NSString+Trimming.h
Copyright (C) 1999 Free Software Foundation, Inc.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSString+Trimming.h - <title>GSWeb: Class NSString with Trimming </title>
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.
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
/** NSString+Trimming.m - <title>GSWeb: Class NSString with Trimming </title>
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$";
@ -40,7 +46,7 @@ static char rcsId[] = "$Id$";
//TODOV
NSRange nonNumberRange;
NSMutableCharacterSet* nonNumberCS=[[NSCharacterSet decimalDigitCharacterSet]
mutableCopy];
mutableCopy];
[nonNumberCS addCharactersInString:@".Ee-+"];
[nonNumberCS invert];
nonNumberRange = [self rangeOfCharacterFromSet:nonNumberCS];
@ -53,7 +59,7 @@ static char rcsId[] = "$Id$";
//TODOV
NSRange nonNumberRange;
NSMutableCharacterSet* nonNumberCS=[[NSCharacterSet decimalDigitCharacterSet]
mutableCopy];
mutableCopy];
[nonNumberCS addCharactersInString:@".-+"];
[nonNumberCS invert];
nonNumberRange = [self rangeOfCharacterFromSet:nonNumberCS];
@ -62,24 +68,24 @@ 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_)
return YES;
else
return NO;
}
{
//TODO
long v=[self longValue];
if (v>=min && v<=max)
return YES;
else
return NO;
}
else
return NO;
return NO;
};
//--------------------------------------------------------------------
@ -88,7 +94,7 @@ static char rcsId[] = "$Id$";
//TODOV
NSRange nonNumberRange;
NSMutableCharacterSet* nonNumberCS=[[NSCharacterSet decimalDigitCharacterSet]
mutableCopy];
mutableCopy];
[nonNumberCS addCharactersInString:@".+"];
[nonNumberCS invert];
nonNumberRange = [self rangeOfCharacterFromSet:nonNumberCS];
@ -97,22 +103,22 @@ 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_)
return YES;
else
return NO;
}
{
//TODO
unsigned long v=[self ulongValue];
if (v<=max)
return YES;
else
return NO;
}
else
return NO;
return NO;
};
//--------------------------------------------------------------------
@ -121,7 +127,7 @@ static char rcsId[] = "$Id$";
//TODOV
NSRange numberRange;
NSMutableCharacterSet* numberCS=[[NSCharacterSet decimalDigitCharacterSet]
mutableCopy];
mutableCopy];
[numberCS addCharactersInString:@".-+"];
numberRange = [self rangeOfCharacterFromSet:numberCS];
return (numberRange.location==0 && numberRange.length>0);
@ -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,9 +167,9 @@ 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;
intLength=0;
size=sizeof(ti)+intLength*sizeof(int);
data=[NSMutableData dataWithLength:size];
pData=[data mutableBytes];
@ -171,10 +177,10 @@ static char rcsId[] = "$Id$";
*((NSTimeInterval*)pData)=ti;//TODO: NSSwapHostLongToBig(ti);
pData+=sizeof(ti);
for(i=0;i<intLength;i++)
{
*((int*)pData)=rand(); //TODO: NSSwapHostIntToBig(rand());
pData+=sizeof(int);
};
{
*((int*)pData)=rand(); //TODO: NSSwapHostIntToBig(rand());
pData+=sizeof(int);
};
dataHex=DataToHexString(data);
return dataHex;
};
@ -183,28 +189,28 @@ static char rcsId[] = "$Id$";
@implementation NSString (stringWithObject)
//--------------------------------------------------------------------
+(NSString*)stringWithObject:(id)object_
+(NSString*)stringWithObject:(id)object
{
NSString* _string=nil;
if (object_)
{
if ([object_ isKindOfClass:[NSString class]])
_string=[[object_ copy] autorelease];
NSString* string=nil;
if (object)
{
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
_string=object_;
};
return _string;
else if ([object respondsToSelector:@selector(stringValue)])
string=[object stringValue];
else if ([object respondsToSelector:@selector(description)])
string=[object description];
else
string=object;
};
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)
{
//ERROR
}
fileManager=[NSFileManager defaultManager];
directoryContents=[fileManager directoryContentsAtPath:directory];
if (!directoryContents)
{
//ERROR
}
else
{
int _attempts=16;
while(_attempts-->0 && !_filename)
{
NSString* _unique=[NSString stringUniqueIdWithLength:16];
_filename=[NSString stringWithFormat:@"%@_%@_%@",prefix_,_unique,suffix_];
if ([_directoryContents containsObject:_filename])
_filename=nil;
};
};
if (_filename)
_filename=[directory_ stringByAppendingPathComponent:_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;
};
};
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