mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-06-02 18:11:10 +00:00
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:
parent
d421bf9a4a
commit
2f71fe907d
77 changed files with 9292 additions and 8659 deletions
73
ChangeLog
73
ChangeLog
|
@ -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>
|
2002-07-28 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
* GSWeb.framework/WebObjects:
|
* GSWeb.framework/WebObjects:
|
||||||
o added WebObjects headers (suggested by David Wetzel <dave@turbocat.de>)
|
o added WebObjects headers (suggested by David Wetzel <dave@turbocat.de>)
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWApplication.h - GSWeb: Class GSWApplication
|
/** GSWApplication.h - <title>GSWeb: Class GSWApplication</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
|
@ -19,14 +24,15 @@
|
||||||
You should have received a copy of the GNU Library General Public
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef _GSWApplication_h__
|
#ifndef _GSWApplication_h__
|
||||||
#define _GSWApplication_h__
|
#define _GSWApplication_h__
|
||||||
|
|
||||||
extern void GSWApplicationSetDebugSetOption(NSString* opt_);
|
extern void GSWApplicationSetDebugSetOption(NSString* opt);
|
||||||
extern int WOApplicationMain(NSString* applicationClassName,
|
extern int WOApplicationMain(NSString* applicationClassName,
|
||||||
int argc,
|
int argc,
|
||||||
const char *argv[]);
|
const char *argv[]);
|
||||||
|
@ -42,56 +48,56 @@ extern BOOL WOStrictFlag;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication : NSObject <NSLocking>
|
@interface GSWApplication : NSObject <NSLocking>
|
||||||
{
|
{
|
||||||
NSArray* adaptors;
|
NSArray* _adaptors;
|
||||||
GSWSessionStore* sessionStore;
|
GSWSessionStore* _sessionStore;
|
||||||
GSWMultiKeyDictionary* componentDefinitionCache;
|
GSWMultiKeyDictionary* _componentDefinitionCache;
|
||||||
NSTimeInterval timeOut;
|
NSTimeInterval _timeOut;
|
||||||
NSTimer* timer;
|
NSTimer* _timer;
|
||||||
// GSWContext* context; // being deprecated
|
// GSWContext* context; // being deprecated
|
||||||
GSWStatisticsStore* statisticsStore;
|
GSWStatisticsStore* _statisticsStore;
|
||||||
GSWResourceManager* resourceManager;
|
GSWResourceManager* _resourceManager;
|
||||||
NSDistantObject* remoteMonitor;
|
NSDistantObject* _remoteMonitor;
|
||||||
NSConnection* remoteMonitorConnection;
|
NSConnection* _remoteMonitorConnection;
|
||||||
NSString* instanceNumber;
|
NSString* _instanceNumber;
|
||||||
NSMutableDictionary* requestHandlers;
|
NSMutableDictionary* _requestHandlers;
|
||||||
GSWRequestHandler* defaultRequestHandler;
|
GSWRequestHandler* _defaultRequestHandler;
|
||||||
@public //TODO-NOW REMOVE
|
@public //TODO-NOW REMOVE
|
||||||
NSRecursiveLock* selfLock;
|
NSRecursiveLock* _selfLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int selfLockn;
|
int _selfLockn;
|
||||||
objc_thread_t selfLock_thread_id;
|
objc_thread_t _selfLock_thread_id;
|
||||||
#endif
|
#endif
|
||||||
NSLock* globalLock;
|
NSLock* _globalLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int globalLockn;
|
int _globalLockn;
|
||||||
objc_thread_t globalLock_thread_id;
|
objc_thread_t _globalLock_thread_id;
|
||||||
#endif
|
#endif
|
||||||
NSAutoreleasePool* globalAutoreleasePool;
|
NSAutoreleasePool* _globalAutoreleasePool;
|
||||||
unsigned pageCacheSize;
|
unsigned _pageCacheSize;
|
||||||
unsigned permanentPageCacheSize;
|
unsigned _permanentPageCacheSize;
|
||||||
int activeSessionsCount;
|
int _activeSessionsCount;
|
||||||
int minimumActiveSessionsCount;
|
int _minimumActiveSessionsCount;
|
||||||
BOOL pageRecreationEnabled;
|
BOOL _pageRecreationEnabled;
|
||||||
BOOL pageRefreshOnBacktrackEnabled;
|
BOOL _pageRefreshOnBacktrackEnabled;
|
||||||
BOOL terminating;
|
BOOL _terminating;
|
||||||
BOOL dynamicLoadingEnabled;
|
BOOL _dynamicLoadingEnabled;
|
||||||
BOOL printsHTMLParserDiagnostics;
|
BOOL _printsHTMLParserDiagnostics;
|
||||||
BOOL refusingNewSessions;
|
BOOL _refusingNewSessions;
|
||||||
BOOL shouldDieWhenRefusing;
|
BOOL _shouldDieWhenRefusing;
|
||||||
BOOL refusingNewClients;
|
BOOL _refusingNewClients;
|
||||||
BOOL refuseThisRequest;
|
BOOL _refuseThisRequest;
|
||||||
BOOL isMultiThreaded;
|
BOOL _isMultiThreaded;
|
||||||
BOOL isMTProtected;
|
BOOL _isMTProtected;
|
||||||
BOOL timedRunLoop;
|
BOOL _timedRunLoop;
|
||||||
BOOL isTracingEnabled;
|
BOOL _isTracingEnabled;
|
||||||
BOOL isTracingAssignmentsEnabled;
|
BOOL _isTracingAssignmentsEnabled;
|
||||||
BOOL isTracingObjectiveCMessagesEnabled;
|
BOOL _isTracingObjectiveCMessagesEnabled;
|
||||||
BOOL isTracingScriptedMessagesEnabled;
|
BOOL _isTracingScriptedMessagesEnabled;
|
||||||
BOOL isTracingStatementsEnabled;
|
BOOL _isTracingStatementsEnabled;
|
||||||
NSRunLoop* currentRunLoop;
|
NSRunLoop* _currentRunLoop;
|
||||||
NSDate* runLoopDate;
|
NSDate* _runLoopDate;
|
||||||
NSTimer* initialTimer;
|
NSTimer* _initialTimer;
|
||||||
NSLock* activeSessionsCountLock;
|
NSLock* _activeSessionsCountLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
|
@ -117,8 +123,8 @@ extern BOOL WOStrictFlag;
|
||||||
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
|
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
|
||||||
|
|
||||||
-(void)registerRequestHandlers;
|
-(void)registerRequestHandlers;
|
||||||
-(void)_initAdaptorsWithUserDefaults:(NSUserDefaults*)_userDefault;
|
-(void)_initAdaptorsWithUserDefaults:(NSUserDefaults*)userDefault;
|
||||||
-(NSDictionary*)_argsDictionaryWithUserDefaults:(NSUserDefaults*)_userDefault;
|
-(NSDictionary*)_argsDictionaryWithUserDefaults:(NSUserDefaults*)userDefault;
|
||||||
-(void)unlock;
|
-(void)unlock;
|
||||||
-(void)lock;
|
-(void)lock;
|
||||||
-(void)unlockRequestHandling;
|
-(void)unlockRequestHandling;
|
||||||
|
@ -149,22 +155,22 @@ extern BOOL WOStrictFlag;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWApplicationD)
|
@interface GSWApplication (GSWApplicationD)
|
||||||
|
|
||||||
-(GSWComponentDefinition*)componentDefinitionWithName:(NSString*)_name
|
-(GSWComponentDefinition*)componentDefinitionWithName:(NSString*)aName
|
||||||
languages:(NSArray*)_languages;
|
languages:(NSArray*)languages;
|
||||||
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)_name
|
-(GSWComponentDefinition*)lockedComponentDefinitionWithName:(NSString*)aName
|
||||||
languages:(NSArray*)_languages;
|
languages:(NSArray*)languages;
|
||||||
-(GSWComponentDefinition*)lockedLoadComponentDefinitionWithName:(NSString*)_name
|
-(GSWComponentDefinition*)lockedLoadComponentDefinitionWithName:(NSString*)aName
|
||||||
language:(NSString*)_language;
|
language:(NSString*)language;
|
||||||
-(NSArray*)lockedComponentBearingFrameworks;
|
-(NSArray*)lockedComponentBearingFrameworks;
|
||||||
-(NSArray*)lockedInitComponentBearingFrameworksFromBundleArray:(NSArray*)_bundles;
|
-(NSArray*)lockedInitComponentBearingFrameworksFromBundleArray:(NSArray*)bundles;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWApplicationE)
|
@interface GSWApplication (GSWApplicationE)
|
||||||
-(void)_discountTerminatedSession;
|
-(void)_discountTerminatedSession;
|
||||||
-(void)_finishInitializingSession:(GSWSession*)_session;
|
-(void)_finishInitializingSession:(GSWSession*)aSession;
|
||||||
-(GSWSession*)_initializeSessionInContext:(GSWContext*)context_;
|
-(GSWSession*)_initializeSessionInContext:(GSWContext*)aContext;
|
||||||
-(int)lockedDecrementActiveSessionCount;
|
-(int)lockedDecrementActiveSessionCount;
|
||||||
-(int)lockedIncrementActiveSessionCount;
|
-(int)lockedIncrementActiveSessionCount;
|
||||||
-(int)_activeSessionsCount;
|
-(int)_activeSessionsCount;
|
||||||
|
@ -173,7 +179,7 @@ extern BOOL WOStrictFlag;
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWApplicationF)
|
@interface GSWApplication (GSWApplicationF)
|
||||||
-(void)_setContext:(GSWContext*)context_;
|
-(void)_setContext:(GSWContext*)aContext;
|
||||||
// Internal Use only
|
// Internal Use only
|
||||||
-(GSWContext*)_context;
|
-(GSWContext*)_context;
|
||||||
@end
|
@end
|
||||||
|
@ -198,11 +204,11 @@ extern BOOL WOStrictFlag;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWApplicationJ)
|
@interface GSWApplication (GSWApplicationJ)
|
||||||
|
|
||||||
-(id)_newLocationForRequest:(GSWRequest*)_request;
|
-(id)_newLocationForRequest:(GSWRequest*)aRequest;
|
||||||
-(void)_connectionDidDie:(id)_unknown;
|
-(void)_connectionDidDie:(id)unknown;
|
||||||
-(BOOL)_shouldKill;
|
-(BOOL)_shouldKill;
|
||||||
-(void)_setShouldKill:(BOOL)_flag;
|
-(void)_setShouldKill:(BOOL)flag;
|
||||||
-(void)_synchronizeInstanceSettingsWithMonitor:(id)_monitor;
|
-(void)_synchronizeInstanceSettingsWithMonitor:(id)aMonitor;
|
||||||
-(BOOL)_setupForMonitoring;
|
-(BOOL)_setupForMonitoring;
|
||||||
-(id)_remoteMonitor;
|
-(id)_remoteMonitor;
|
||||||
-(NSString*)_monitorHost;
|
-(NSString*)_monitorHost;
|
||||||
|
@ -219,7 +225,7 @@ extern BOOL WOStrictFlag;
|
||||||
@interface GSWApplication (GSWAdaptorManagement)
|
@interface GSWApplication (GSWAdaptorManagement)
|
||||||
|
|
||||||
-(NSArray*)adaptors;
|
-(NSArray*)adaptors;
|
||||||
-(GSWAdaptor*)adaptorWithName:(NSString*)name_
|
-(GSWAdaptor*)adaptorWithName:(NSString*)aName
|
||||||
arguments:(NSDictionary*)someArguments;
|
arguments:(NSDictionary*)someArguments;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -228,55 +234,55 @@ extern BOOL WOStrictFlag;
|
||||||
@interface GSWApplication (GSWCacheManagement)
|
@interface GSWApplication (GSWCacheManagement)
|
||||||
|
|
||||||
-(BOOL)isCachingEnabled;
|
-(BOOL)isCachingEnabled;
|
||||||
-(void)setCachingEnabled:(BOOL)flag_;
|
-(void)setCachingEnabled:(BOOL)flag;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWSessionManagement)
|
@interface GSWApplication (GSWSessionManagement)
|
||||||
|
|
||||||
-(GSWSessionStore*)sessionStore;
|
-(GSWSessionStore*)sessionStore;
|
||||||
-(void)setSessionStore:(GSWSessionStore*)sessionStore_;
|
-(void)setSessionStore:(GSWSessionStore*)sessionStore;
|
||||||
|
|
||||||
-(GSWSession*)createSessionForRequest:(GSWRequest*)_request;
|
-(GSWSession*)createSessionForRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWSession*)_createSessionForRequest:(GSWRequest*)_request;
|
-(GSWSession*)_createSessionForRequest:(GSWRequest*)aRequest;
|
||||||
-(Class)_sessionClass;
|
-(Class)_sessionClass;
|
||||||
-(GSWSession*)restoreSessionWithID:(NSString*)_sessionID
|
-(GSWSession*)restoreSessionWithID:(NSString*)aSessionID
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(GSWSession*)_restoreSessionWithID:(NSString*)_sessionID
|
-(GSWSession*)_restoreSessionWithID:(NSString*)aSessionID
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)saveSessionForContext:(GSWContext*)context_;
|
-(void)saveSessionForContext:(GSWContext*)aContext;
|
||||||
-(void)_saveSessionForContext:(GSWContext*)context_;
|
-(void)_saveSessionForContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWPageManagement)
|
@interface GSWApplication (GSWPageManagement)
|
||||||
|
|
||||||
-(unsigned int)pageCacheSize;
|
-(unsigned int)pageCacheSize;
|
||||||
-(void)setPageCacheSize:(unsigned int)size_;
|
-(void)setPageCacheSize:(unsigned int)aSize;
|
||||||
-(unsigned)permanentPageCacheSize;
|
-(unsigned)permanentPageCacheSize;
|
||||||
-(void)setPermanentPageCacheSize:(unsigned)size_;
|
-(void)setPermanentPageCacheSize:(unsigned)aSize;
|
||||||
-(BOOL)isPageRefreshOnBacktrackEnabled;
|
-(BOOL)isPageRefreshOnBacktrackEnabled;
|
||||||
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)_flag;
|
-(void)setPageRefreshOnBacktrackEnabled:(BOOL)flag;
|
||||||
-(GSWComponent*)pageWithName:(NSString*)name_
|
-(GSWComponent*)pageWithName:(NSString*)aName
|
||||||
forRequest:(GSWRequest*)request_;
|
forRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWComponent*)pageWithName:(NSString*)name_
|
-(GSWComponent*)pageWithName:(NSString*)aName
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(NSString*)defaultPageName;//NDFN
|
-(NSString*)defaultPageName;//NDFN
|
||||||
-(GSWComponent*)_pageWithName:(NSString*)name_
|
-(GSWComponent*)_pageWithName:(NSString*)aName
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWElementCreation)
|
@interface GSWApplication (GSWElementCreation)
|
||||||
|
|
||||||
-(GSWElement*)dynamicElementWithName:(NSString *)name_
|
-(GSWElement*)dynamicElementWithName:(NSString *)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)someAssociations
|
||||||
template:(GSWElement*)templateElement_
|
template:(GSWElement*)templateElement
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
-(GSWElement*)lockedDynamicElementWithName:(NSString *)name_
|
-(GSWElement*)lockedDynamicElementWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)someAssociations
|
||||||
template:(GSWElement*)templateElement_
|
template:(GSWElement*)templateElement
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -285,13 +291,13 @@ extern BOOL WOStrictFlag;
|
||||||
-(void)threadWillExit;//NDFN
|
-(void)threadWillExit;//NDFN
|
||||||
-(void)run;
|
-(void)run;
|
||||||
-(BOOL)runOnce;
|
-(BOOL)runOnce;
|
||||||
-(void)setTimeOut:(NSTimeInterval)timeInterval_;
|
-(void)setTimeOut:(NSTimeInterval)aTimeInterval;
|
||||||
-(NSTimeInterval)timeOut;
|
-(NSTimeInterval)timeOut;
|
||||||
-(void)terminate;
|
-(void)terminate;
|
||||||
-(BOOL)isTerminating;
|
-(BOOL)isTerminating;
|
||||||
|
|
||||||
-(void)_scheduleApplicationTimerForTimeInterval:(NSTimeInterval)timeInterval_;
|
-(void)_scheduleApplicationTimerForTimeInterval:(NSTimeInterval)aTimeInterval;
|
||||||
-(void)addTimer:(NSTimer*)timer_;//NDFN
|
-(void)addTimer:(NSTimer*)aTimer;//NDFN
|
||||||
-(void)cancelInitialTimer;
|
-(void)cancelInitialTimer;
|
||||||
-(void)handleInitialTimer;
|
-(void)handleInitialTimer;
|
||||||
-(void)_setNextCollectionCount:(int)_count;
|
-(void)_setNextCollectionCount:(int)_count;
|
||||||
|
@ -302,111 +308,111 @@ extern BOOL WOStrictFlag;
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWRequestHandling)
|
@interface GSWApplication (GSWRequestHandling)
|
||||||
-(GSWResponse*)dispatchRequest:(GSWRequest*)request_;
|
-(GSWResponse*)dispatchRequest:(GSWRequest*)aRequest;
|
||||||
-(void)awake;
|
-(void)awake;
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
-(void)appendToResponse:(GSWResponse*)response_
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)sleep;
|
-(void)sleep;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWErrorHandling)
|
@interface GSWApplication (GSWErrorHandling)
|
||||||
-(GSWResponse*)handleException:(NSException*)exception_
|
-(GSWResponse*)handleException:(NSException*)exception
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)_handleException:(NSException*)exception_
|
-(GSWResponse*)_handleException:(NSException*)exception
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)handlePageRestorationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)handlePageRestorationErrorInContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)_handlePageRestorationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)_handlePageRestorationErrorInContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)handleSessionCreationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)handleSessionCreationErrorInContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)_handleSessionCreationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)_handleSessionCreationErrorInContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)handleSessionRestorationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)handleSessionRestorationErrorInContext:(GSWContext*)aContext;
|
||||||
-(GSWResponse*)_handleSessionRestorationErrorInContext:(GSWContext*)context_;
|
-(GSWResponse*)_handleSessionRestorationErrorInContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWConveniences)
|
@interface GSWApplication (GSWConveniences)
|
||||||
+(void)_setApplication:(GSWApplication*)_application;
|
+(void)_setApplication:(GSWApplication*)application;
|
||||||
+(GSWApplication*)application;
|
+(GSWApplication*)application;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWHTMLTemplateParsingDebugging)
|
@interface GSWApplication (GSWHTMLTemplateParsingDebugging)
|
||||||
-(BOOL)printsHTMLParserDiagnostics;
|
-(BOOL)printsHTMLParserDiagnostics;
|
||||||
-(void)setPrintsHTMLParserDiagnostics:(BOOL)flag_;
|
-(void)setPrintsHTMLParserDiagnostics:(BOOL)flag;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWScriptedObjectSupport)
|
@interface GSWApplication (GSWScriptedObjectSupport)
|
||||||
-(Class)scriptedClassWithPath:(NSString*)path_;
|
-(Class)scriptedClassWithPath:(NSString*)path;
|
||||||
-(Class)scriptedClassWithPath:(NSString*)path_
|
-(Class)scriptedClassWithPath:(NSString*)path
|
||||||
encoding:(NSStringEncoding)encoding_;
|
encoding:(NSStringEncoding)encoding;
|
||||||
-(Class)_classWithScriptedClassName:(NSString*)_name
|
-(Class)_classWithScriptedClassName:(NSString*)aName
|
||||||
languages:(NSArray*)_languages;
|
languages:(NSArray*)languages;
|
||||||
-(void)_setClassFromNameResolutionEnabled:(BOOL)_flag;
|
-(void)_setClassFromNameResolutionEnabled:(BOOL)flag;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWLibrarySupport)
|
@interface GSWApplication (GSWLibrarySupport)
|
||||||
-(Class)libraryClassWithPath:(NSString*)path_;//NDFN
|
-(Class)libraryClassWithPath:(NSString*)path;//NDFN
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWDebugging)
|
@interface GSWApplication (GSWDebugging)
|
||||||
-(void)debugWithString:(NSString*)_string;
|
-(void)debugWithString:(NSString*)string;
|
||||||
-(void)debugWithFormat:(NSString*)_format
|
-(void)debugWithFormat:(NSString*)format
|
||||||
arguments:(va_list)someArgumentsu;
|
arguments:(va_list)someArgumentsu;
|
||||||
-(void)debugWithFormat:(NSString*)formatString_,...;
|
-(void)debugWithFormat:(NSString*)formatString,...;
|
||||||
+(void)debugWithFormat:(NSString*)formatString_,...;
|
+(void)debugWithFormat:(NSString*)formatString,...;
|
||||||
-(void)logWithFormat:(NSString*)format_,...;
|
-(void)logWithFormat:(NSString*)aFormat,...;
|
||||||
+(void)logWithFormat:(NSString*)format_,...;
|
+(void)logWithFormat:(NSString*)aFormat,...;
|
||||||
-(void)logWithFormat:(NSString*)formatString_
|
-(void)logWithFormat:(NSString*)formatString_
|
||||||
arguments:(va_list)arguments_;
|
arguments:(va_list)arguments;
|
||||||
-(void)logErrorWithFormat:(NSString*)format_,...;
|
-(void)logErrorWithFormat:(NSString*)aFormat,...;
|
||||||
+(void)logErrorWithFormat:(NSString*)format_,...;
|
+(void)logErrorWithFormat:(NSString*)aFormat,...;
|
||||||
-(void)logErrorWithFormat:(NSString*)formatString_
|
-(void)logErrorWithFormat:(NSString*)formatString
|
||||||
arguments:(va_list)arguments_;
|
arguments:(va_list)arguments;
|
||||||
-(void)trace:(BOOL)flag_;
|
-(void)trace:(BOOL)flag;
|
||||||
-(void)traceAssignments:(BOOL)flag_;
|
-(void)traceAssignments:(BOOL)flag;
|
||||||
-(void)traceObjectiveCMessages:(BOOL)flag_;
|
-(void)traceObjectiveCMessages:(BOOL)flag;
|
||||||
-(void)traceScriptedMessages:(BOOL)flag_;
|
-(void)traceScriptedMessages:(BOOL)flag;
|
||||||
-(void)traceStatements:(BOOL)flag_;
|
-(void)traceStatements:(BOOL)flag;
|
||||||
+(void)logTakeValueForDeclarationNamed:(NSString*)declarationName_
|
+(void)logTakeValueForDeclarationNamed:(NSString*)aDeclarationName
|
||||||
type:(NSString*)declarationType_
|
type:(NSString*)aDeclarationType
|
||||||
bindingNamed:(NSString*)bindingName_
|
bindingNamed:(NSString*)aBindingName
|
||||||
associationDescription:(NSString*)associationDescription_
|
associationDescription:(NSString*)anAssociationDescription
|
||||||
value:(id)value_;
|
value:(id)aValue;
|
||||||
+(void)logSetValueForDeclarationNamed:(NSString*)declarationName_
|
+(void)logSetValueForDeclarationNamed:(NSString*)aDeclarationName
|
||||||
type:(NSString*)declarationType_
|
type:(NSString*)aDeclarationType
|
||||||
bindingNamed:(NSString*)bindingName_
|
bindingNamed:(NSString*)aBindingName
|
||||||
associationDescription:(NSString*)associationDescription_
|
associationDescription:(NSString*)anAssociationDescription
|
||||||
value:(id)value_;
|
value:(id)aValue;
|
||||||
|
|
||||||
-(void)logTakeValueForDeclarationNamed:(NSString*)declarationName_
|
-(void)logTakeValueForDeclarationNamed:(NSString*)aDeclarationName
|
||||||
type:(NSString*)declarationType_
|
type:(NSString*)aDeclarationType
|
||||||
bindingNamed:(NSString*)bindingName_
|
bindingNamed:(NSString*)aBindingName
|
||||||
associationDescription:(NSString*)associationDescription_
|
associationDescription:(NSString*)anAssociationDescription
|
||||||
value:(id)value_;
|
value:(id)aValue;
|
||||||
|
|
||||||
-(void)logSetValueForDeclarationNamed:(NSString*)declarationName_
|
-(void)logSetValueForDeclarationNamed:(NSString*)aDeclarationName
|
||||||
type:(NSString*)declarationType_
|
type:(NSString*)aDeclarationType
|
||||||
bindingNamed:(NSString*)bindingName_
|
bindingNamed:(NSString*)aBindingName
|
||||||
associationDescription:(NSString*)associationDescription_
|
associationDescription:(NSString*)anAssociationDescription
|
||||||
value:(id)value_;
|
value:(id)aValue;
|
||||||
+(void)logSynchronizeComponentToParentForValue:(id)value_
|
+(void)logSynchronizeComponentToParentForValue:(id)value_
|
||||||
association:(GSWAssociation*)association_
|
association:(GSWAssociation*)anAssociation
|
||||||
inComponent:(NSObject*)component_;
|
inComponent:(NSObject*)aComponent;
|
||||||
+(void)logSynchronizeParentToComponentForValue:(id)value_
|
+(void)logSynchronizeParentToComponentForValue:(id)aValue
|
||||||
association:(GSWAssociation*)association_
|
association:(GSWAssociation*)anAssociation
|
||||||
inComponent:(NSObject*)component_;
|
inComponent:(NSObject*)aComponent;
|
||||||
|
|
||||||
-(void)_setTracingAspect:(id)_unknwon
|
-(void)_setTracingAspect:(id)unknwon
|
||||||
enabled:(BOOL)_enabled;
|
enabled:(BOOL)enabled;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -414,24 +420,24 @@ extern BOOL WOStrictFlag;
|
||||||
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
|
//Same as GSWDebugging but it print messages on stdout AND call GSWDebugging methods
|
||||||
@interface GSWApplication (GSWDebuggingStatus)
|
@interface GSWApplication (GSWDebuggingStatus)
|
||||||
|
|
||||||
-(void)statusDebugWithString:(NSString*)string_;
|
-(void)statusDebugWithString:(NSString*)aString;
|
||||||
-(void)statusDebugWithFormat:(NSString*)format_
|
-(void)statusDebugWithFormat:(NSString*)aFormat
|
||||||
arguments:(va_list)arguments_;
|
arguments:(va_list)arguments;
|
||||||
-(void)statusDebugWithFormat:(NSString*)format_,...;
|
-(void)statusDebugWithFormat:(NSString*)aFormat,...;
|
||||||
+(void)statusDebugWithFormat:(NSString*)format_,...;
|
+(void)statusDebugWithFormat:(NSString*)aFormat,...;
|
||||||
-(void)statusLogWithFormat:(NSString*)format_,...;
|
-(void)statusLogWithFormat:(NSString*)aFormat,...;
|
||||||
+(void)statusLogWithFormat:(NSString*)format_,...;
|
+(void)statusLogWithFormat:(NSString*)aFormat,...;
|
||||||
-(void)statusLogWithFormat:(NSString*)format_
|
-(void)statusLogWithFormat:(NSString*)aFormat
|
||||||
arguments:(va_list)arguments_;
|
arguments:(va_list)arguments;
|
||||||
-(void)statusLogErrorWithFormat:(NSString*)format_,...;
|
-(void)statusLogErrorWithFormat:(NSString*)aFormat,...;
|
||||||
+(void)statusLogErrorWithFormat:(NSString*)format_,...;
|
+(void)statusLogErrorWithFormat:(NSString*)aFormat,...;
|
||||||
-(void)statusLogErrorWithFormat:(NSString*)format_
|
-(void)statusLogErrorWithFormat:(NSString*)aFormat
|
||||||
arguments:(va_list)arguments_;
|
arguments:(va_list)arguments;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWStatisticsSupport)
|
@interface GSWApplication (GSWStatisticsSupport)
|
||||||
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore_;
|
-(void)setStatisticsStore:(GSWStatisticsStore*)statisticsStore;
|
||||||
-(NSDictionary*)statistics;//bycopy
|
-(NSDictionary*)statistics;//bycopy
|
||||||
-(GSWStatisticsStore*)statisticsStore;
|
-(GSWStatisticsStore*)statisticsStore;
|
||||||
@end
|
@end
|
||||||
|
@ -441,16 +447,16 @@ extern BOOL WOStrictFlag;
|
||||||
-(BOOL)monitoringEnabled;
|
-(BOOL)monitoringEnabled;
|
||||||
-(int)activeSessionsCount;
|
-(int)activeSessionsCount;
|
||||||
-(int)minimumActiveSessionsCount;
|
-(int)minimumActiveSessionsCount;
|
||||||
-(void)setMinimumActiveSessionsCount:(int)count_;
|
-(void)setMinimumActiveSessionsCount:(int)aCount;
|
||||||
-(BOOL)isRefusingNewSessions;
|
-(BOOL)isRefusingNewSessions;
|
||||||
-(void)refuseNewSessions:(BOOL)flag;
|
-(void)refuseNewSessions:(BOOL)flag;
|
||||||
-(void)logToMonitorWithFormat:(NSString*)format_;
|
-(void)logToMonitorWithFormat:(NSString*)aFormat;
|
||||||
-(void)terminateAfterTimeInterval:(NSTimeInterval)timeInterval_;
|
-(void)terminateAfterTimeInterval:(NSTimeInterval)aTimeInterval;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (GSWResourceManagerSupport)
|
@interface GSWApplication (GSWResourceManagerSupport)
|
||||||
-(void)setResourceManager:(GSWResourceManager*)resourceManager_;
|
-(void)setResourceManager:(GSWResourceManager*)resourceManager;
|
||||||
-(GSWResourceManager*)resourceManager;
|
-(GSWResourceManager*)resourceManager;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -458,76 +464,76 @@ extern BOOL WOStrictFlag;
|
||||||
@interface GSWApplication (RequestDispatching)
|
@interface GSWApplication (RequestDispatching)
|
||||||
-(GSWRequestHandler*)defaultRequestHandler;
|
-(GSWRequestHandler*)defaultRequestHandler;
|
||||||
|
|
||||||
-(void)setDefaultRequestHandler:(GSWRequestHandler*)handler_;
|
-(void)setDefaultRequestHandler:(GSWRequestHandler*)handler;
|
||||||
|
|
||||||
-(void)registerRequestHandler:(GSWRequestHandler*)handler_
|
-(void)registerRequestHandler:(GSWRequestHandler*)handler
|
||||||
forKey:(NSString*)key_;
|
forKey:(NSString*)aKey;
|
||||||
|
|
||||||
-(void)removeRequestHandlerForKey:(NSString*)requestHandlerKey_;
|
-(void)removeRequestHandlerForKey:(NSString*)requestHandlerKey;
|
||||||
|
|
||||||
-(NSArray*)registeredRequestHandlerKeys;
|
-(NSArray*)registeredRequestHandlerKeys;
|
||||||
|
|
||||||
-(GSWRequestHandler*)requestHandlerForKey:(NSString*)key_;
|
-(GSWRequestHandler*)requestHandlerForKey:(NSString*)aKey;
|
||||||
|
|
||||||
-(GSWRequestHandler*)handlerForRequest:(GSWRequest*)request_;
|
-(GSWRequestHandler*)handlerForRequest:(GSWRequest*)aRequest;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (UserDefaults)
|
@interface GSWApplication (UserDefaults)
|
||||||
+(NSArray*)loadFrameworks;
|
+(NSArray*)loadFrameworks;
|
||||||
+(void)setLoadFrameworks:(NSArray*)frameworks_;
|
+(void)setLoadFrameworks:(NSArray*)frameworks;
|
||||||
+(BOOL)isDebuggingEnabled;
|
+(BOOL)isDebuggingEnabled;
|
||||||
+(void)setDebuggingEnabled:(BOOL)flag_;
|
+(void)setDebuggingEnabled:(BOOL)flag;
|
||||||
+(BOOL)isStatusDebuggingEnabled;//NDFN
|
+(BOOL)isStatusDebuggingEnabled;//NDFN
|
||||||
+(void)setStatusDebuggingEnabled:(BOOL)flag_;//NDFN
|
+(void)setStatusDebuggingEnabled:(BOOL)flag;//NDFN
|
||||||
+(BOOL)autoOpenInBrowser;
|
+(BOOL)autoOpenInBrowser;
|
||||||
+(void)setAutoOpenInBrowser:(BOOL)flag_;
|
+(void)setAutoOpenInBrowser:(BOOL)flag;
|
||||||
+(BOOL)isDirectConnectEnabled;
|
+(BOOL)isDirectConnectEnabled;
|
||||||
+(void)setDirectConnectEnabled:(BOOL)flag_;
|
+(void)setDirectConnectEnabled:(BOOL)flag;
|
||||||
+(NSString*)cgiAdaptorURL;
|
+(NSString*)cgiAdaptorURL;
|
||||||
+(void)setCGIAdaptorURL:(NSString*)url_;
|
+(void)setCGIAdaptorURL:(NSString*)url;
|
||||||
+(BOOL)isCachingEnabled;
|
+(BOOL)isCachingEnabled;
|
||||||
+(void)setCachingEnabled:(BOOL)flag_;
|
+(void)setCachingEnabled:(BOOL)flag;
|
||||||
+(NSString*)applicationBaseURL;
|
+(NSString*)applicationBaseURL;
|
||||||
+(void)setApplicationBaseURL:(NSString*)baseURL_;
|
+(void)setApplicationBaseURL:(NSString*)baseURL;
|
||||||
+(NSString*)frameworksBaseURL;
|
+(NSString*)frameworksBaseURL;
|
||||||
+(void)setFrameworksBaseURL:(NSString*)baseURL_;
|
+(void)setFrameworksBaseURL:(NSString*)baseURL;
|
||||||
+(NSString*)recordingPath;
|
+(NSString*)recordingPath;
|
||||||
+(void)setRecordingPath:(NSString*)path_;
|
+(void)setRecordingPath:(NSString*)path;
|
||||||
+(NSArray*)projectSearchPath;
|
+(NSArray*)projectSearchPath;
|
||||||
+(void)setProjectSearchPath:(NSArray*)pathArray_;
|
+(void)setProjectSearchPath:(NSArray*)pathArray;
|
||||||
+(BOOL)isMonitorEnabled;
|
+(BOOL)isMonitorEnabled;
|
||||||
+(void)setMonitorEnabled:(BOOL)flag_;
|
+(void)setMonitorEnabled:(BOOL)flag;
|
||||||
+(NSString*)monitorHost;
|
+(NSString*)monitorHost;
|
||||||
+(void)setMonitorHost:(NSString*)hostName_;
|
+(void)setMonitorHost:(NSString*)hostName;
|
||||||
+(NSString*)SMTPHost;
|
+(NSString*)SMTPHost;
|
||||||
+(void)setSMTPHost:(NSString*)hostName_;
|
+(void)setSMTPHost:(NSString*)hostName;
|
||||||
+(NSString*)adaptor;
|
+(NSString*)adaptor;
|
||||||
+(void)setAdaptor:(NSString*)adaptorName_;
|
+(void)setAdaptor:(NSString*)adaptorName;
|
||||||
+(id)port;
|
+(id)port;
|
||||||
+(void)setPort:(id)port_;
|
+(void)setPort:(id)port;
|
||||||
+(id)host;
|
+(id)host;
|
||||||
+(void)setHost:(id)host_;
|
+(void)setHost:(id)host;
|
||||||
+(id)listenQueueSize;
|
+(id)listenQueueSize;
|
||||||
+(void)setListenQueueSize:(id)listenQueueSize_;
|
+(void)setListenQueueSize:(id)aSize;
|
||||||
+(id)workerThreadCount;
|
+(id)workerThreadCount;
|
||||||
+(void)setWorkerThreadCount:(id)workerThreadCount_;
|
+(void)setWorkerThreadCount:(id)workerThreadCount;
|
||||||
+(NSArray*)additionalAdaptors;
|
+(NSArray*)additionalAdaptors;
|
||||||
+(void)setAdditionalAdaptors:(NSArray*)adaptorList;
|
+(void)setAdditionalAdaptors:(NSArray*)adaptorList;
|
||||||
+(BOOL)includeCommentsInResponses;
|
+(BOOL)includeCommentsInResponses;
|
||||||
+(void)setIncludeCommentsInResponses:(BOOL)flag_;
|
+(void)setIncludeCommentsInResponses:(BOOL)flag;
|
||||||
+(NSString*)componentRequestHandlerKey;
|
+(NSString*)componentRequestHandlerKey;
|
||||||
+(void)setComponentRequestHandlerKey:(NSString*)key_;
|
+(void)setComponentRequestHandlerKey:(NSString*)aKey;
|
||||||
+(NSString*)directActionRequestHandlerKey;
|
+(NSString*)directActionRequestHandlerKey;
|
||||||
+(void)setDirectActionRequestHandlerKey:(NSString*)key_;
|
+(void)setDirectActionRequestHandlerKey:(NSString*)aKey;
|
||||||
+(NSString*)resourceRequestHandlerKey;
|
+(NSString*)resourceRequestHandlerKey;
|
||||||
+(void)setResourceRequestHandlerKey:(NSString*)key_;
|
+(void)setResourceRequestHandlerKey:(NSString*)aKey;
|
||||||
+(void)setSessionTimeOut:(NSNumber*)timeOut_;
|
+(void)setSessionTimeOut:(NSNumber*)aTimeOut;
|
||||||
+(NSNumber*)sessionTimeOut;
|
+(NSNumber*)sessionTimeOut;
|
||||||
+(void)setSessionTimeOutValue:(NSTimeInterval)timeOutValue_;
|
+(void)setSessionTimeOutValue:(NSTimeInterval)aTimeOutValue;
|
||||||
+(NSTimeInterval)sessionTimeOutValue;
|
+(NSTimeInterval)sessionTimeOutValue;
|
||||||
+(NSString*)debugSetConfigFilePath;//NDFN
|
+(NSString*)debugSetConfigFilePath;//NDFN
|
||||||
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath_;//NDFN
|
+(void)setDebugSetConfigFilePath:(NSString*)debugSetConfigFilePath;//NDFN
|
||||||
+(NSString*)saveResponsesPath;//NDFN
|
+(NSString*)saveResponsesPath;//NDFN
|
||||||
+(void)setSaveResponsesPath:(NSString*)saveResponsesPath;//NDFN
|
+(void)setSaveResponsesPath:(NSString*)saveResponsesPath;//NDFN
|
||||||
@end
|
@end
|
||||||
|
@ -560,9 +566,9 @@ extern BOOL WOStrictFlag;
|
||||||
@interface GSWApplication (GSWApplicationClassD)
|
@interface GSWApplication (GSWApplicationClassD)
|
||||||
+(int)_garbageCollectionRepeatCount;
|
+(int)_garbageCollectionRepeatCount;
|
||||||
+(BOOL)_lockDefaultEditingContext;
|
+(BOOL)_lockDefaultEditingContext;
|
||||||
+(void)_setLockDefaultEditingContext:(BOOL)_flag;
|
+(void)_setLockDefaultEditingContext:(BOOL)flag;
|
||||||
+(id)_allowsConcurrentRequestHandling;
|
+(id)_allowsConcurrentRequestHandling;
|
||||||
+(void)_setAllowsConcurrentRequestHandling:(id)_unknown;
|
+(void)_setAllowsConcurrentRequestHandling:(id)unknown;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -578,50 +584,50 @@ extern BOOL WOStrictFlag;
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWApplication (NDFN)
|
@interface GSWApplication (NDFN)
|
||||||
//NDFN
|
//NDFN
|
||||||
-(id)propListWithResourceNamed:(NSString*)name_
|
-(id)propListWithResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
+(BOOL)createUnknownComponentClasses:(NSArray*)classes_
|
+(BOOL)createUnknownComponentClasses:(NSArray*)classes
|
||||||
superClassName:(NSString*)superClassName_;
|
superClassName:(NSString*)aSuperClassName;
|
||||||
+(void)addDynCreateClassName:(NSString*)className_
|
+(void)addDynCreateClassName:(NSString*)aClassName
|
||||||
superClassName:(NSString*)superClassName_;
|
superClassName:(NSString*)aSuperClassName;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)urlForResourceNamed:(NSString*)name_
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
request:(GSWRequest*)request_;
|
request:(GSWRequest*)aRequest;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)stringForKey:(NSString*)key_
|
-(NSString*)stringForKey:(NSString*)key_
|
||||||
inTableNamed:(NSString*)tableName_
|
inTableNamed:(NSString*)aTableName
|
||||||
withDefaultValue:(NSString*)defaultValue_
|
withDefaultValue:(NSString*)defaultValue
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSDictionary*)stringsTableNamed:(NSString*)tableName_
|
-(NSDictionary*)stringsTableNamed:(NSString*)aTableName
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSArray*)stringsTableArrayNamed:(NSString*)tableName_
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aTableName
|
||||||
inFramework:(NSString*)frameworkName_
|
inFramework:(NSString*)aFrameworkName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSArray*)filterLanguages:(NSArray*)languages;
|
-(NSArray*)filterLanguages:(NSArray*)languages;
|
||||||
@end
|
@end
|
||||||
//====================================================================
|
//====================================================================
|
||||||
/*
|
/*
|
||||||
@interface GSWApplication (GSWDeprecatedAPI)
|
@interface GSWApplication (GSWDeprecatedAPI)
|
||||||
-(GSWComponent*)pageWithName:(NSString*)name_; //OldFN
|
-(GSWComponent*)pageWithName:(NSString*)aName; //OldFN
|
||||||
-(void)savePage:(GSWComponent*)page_;
|
-(void)savePage:(GSWComponent*)page_;
|
||||||
-(GSWSession*)session;
|
-(GSWSession*)session;
|
||||||
-(GSWContext*)context;
|
-(GSWContext*)context;
|
||||||
|
@ -635,15 +641,15 @@ extern BOOL WOStrictFlag;
|
||||||
-(GSWResponse*)handleException:(NSException*)exception_;
|
-(GSWResponse*)handleException:(NSException*)exception_;
|
||||||
|
|
||||||
-(GSWComponent*)restorePageForContextID:(NSString*)contextID_;
|
-(GSWComponent*)restorePageForContextID:(NSString*)contextID_;
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_;
|
ofType:(NSString*)aType;
|
||||||
-(NSString*)urlForResourceNamed:(NSString*)name_
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_;
|
ofType:(NSString*)aType;
|
||||||
-(NSString*)stringForKey:(NSString*)key_
|
-(NSString*)stringForKey:(NSString*)key_
|
||||||
inTableNamed:(NSString*)table_
|
inTableNamed:(NSString*)table_
|
||||||
withDefaultValue:(NSString*)defaultValue_;
|
withDefaultValue:(NSString*)defaultValue_;
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWDynamicElement*)dynamicElementWithName:(NSString*)name_
|
-(GSWDynamicElement*)dynamicElementWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations_
|
||||||
template:(GSWElement*)templateElement_; //OldFN
|
template:(GSWElement*)templateElement_; //OldFN
|
||||||
@end
|
@end
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,16 @@
|
||||||
/* GSWBindingNameAssociation.h - GSWeb: Class GSWBindingNameAssociation
|
/** GSWBindingNameAssociation.h - <title>GSWeb: Class GSWBindingNameAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Apr 1999
|
Date: Apr 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,23 +35,23 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWBindingNameAssociation : GSWAssociation
|
@interface GSWBindingNameAssociation : GSWAssociation
|
||||||
{
|
{
|
||||||
NSString* parentBindingName;
|
NSString* _parentBindingName;
|
||||||
NSString* keyPath;
|
NSString* _keyPath;
|
||||||
//GSWeb Additions {
|
//GSWeb Additions {
|
||||||
BOOL isNonMandatory;
|
BOOL _isNonMandatory;
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithKeyPath:(NSString*)keyPath_;
|
-(id)initWithKeyPath:(NSString*)keyPath;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)copyWithZone:(NSZone*)zone;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(BOOL)isImplementedForComponent:(NSObject*)object_;
|
-(BOOL)isImplementedForComponent:(NSObject*)object;
|
||||||
-(BOOL)isValueConstant;
|
-(BOOL)isValueConstant;
|
||||||
-(BOOL)isValueSettable;
|
-(BOOL)isValueSettable;
|
||||||
-(id)valueInObject:(id)object_;
|
-(id)valueInObject:(id)object;
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)value
|
||||||
inObject:(id)object_;
|
inObject:(id)object;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWBindingNameAssociation_h__
|
#endif //_GSWBindingNameAssociation_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWBindingNameAssociation.m - GSWeb: Class GSWBindingNameAssociation
|
/** GSWBindingNameAssociation.m - <title>GSWeb: Class GSWBindingNameAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Apr 1999
|
Date: Apr 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,33 +35,33 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWBindingNameAssociation
|
@implementation GSWBindingNameAssociation
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithKeyPath:(NSString*)keyPath_
|
-(id)initWithKeyPath:(NSString*)aKeyPath
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSArray* keys=nil;
|
NSArray* keys=nil;
|
||||||
NSDebugMLLog(@"associations",@"keyPath_=%@",keyPath_);
|
NSDebugMLLog(@"associations",@"aKeyPath=%@",aKeyPath);
|
||||||
keys=[keyPath_ componentsSeparatedByString:@"."];
|
keys=[aKeyPath componentsSeparatedByString:@"."];
|
||||||
if ([keys count]>0)
|
if ([keys count]>0)
|
||||||
{
|
{
|
||||||
if (!WOStrictFlag && [keyPath_ hasPrefix:@"^"])
|
if (!WOStrictFlag && [aKeyPath hasPrefix:@"^"])
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
|
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"^"]);
|
||||||
}
|
}
|
||||||
else if (!WOStrictFlag && [keyPath_ hasPrefix:@"~"])
|
else if (!WOStrictFlag && [aKeyPath hasPrefix:@"~"])
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
|
ASSIGNCOPY(_parentBindingName,[[keys objectAtIndex:0] stringWithoutPrefix:@"~"]);
|
||||||
isNonMandatory=YES;
|
_isNonMandatory=YES;
|
||||||
};
|
};
|
||||||
if ([keys count]>1)
|
if ([keys count]>1)
|
||||||
{
|
{
|
||||||
ASSIGN(keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
|
ASSIGN(_keyPath,[[keys subarrayWithRange:NSMakeRange(1,[keys count]-1)]componentsJoinedByString:@"."]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
|
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
|
||||||
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
|
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -64,8 +70,8 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
DESTROY(parentBindingName);
|
DESTROY(_parentBindingName);
|
||||||
DESTROY(keyPath);
|
DESTROY(_keyPath);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,8 +79,9 @@ static char rcsId[] = "$Id$";
|
||||||
-(id)copyWithZone:(NSZone*)zone;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
{
|
{
|
||||||
GSWBindingNameAssociation* clone = [super copyWithZone:zone];
|
GSWBindingNameAssociation* clone = [super copyWithZone:zone];
|
||||||
ASSIGN(clone->parentBindingName,parentBindingName);
|
ASSIGN(clone->_parentBindingName,_parentBindingName);
|
||||||
ASSIGN(clone->keyPath,keyPath);
|
ASSIGN(clone->_keyPath,_keyPath);
|
||||||
|
_isNonMandatory=_isNonMandatory;
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -84,34 +91,34 @@ static char rcsId[] = "$Id$";
|
||||||
return [NSString stringWithFormat:@"<%s %p - parentBindingName=%@ keyPath=%@>",
|
return [NSString stringWithFormat:@"<%s %p - parentBindingName=%@ keyPath=%@>",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
parentBindingName,
|
_parentBindingName,
|
||||||
keyPath];
|
_keyPath];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)isImplementedForComponent:(NSObject*)object_
|
-(BOOL)isImplementedForComponent:(NSObject*)object
|
||||||
{
|
{
|
||||||
BOOL _isImplemented=NO;
|
BOOL isImplemented=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_isImplemented=[object_ hasBinding:parentBindingName];
|
isImplemented=(BOOL)[object hasBinding:_parentBindingName];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _isImplemented;
|
return isImplemented;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)valueInObject:(id)object_
|
-(id)valueInObject:(id)object
|
||||||
{
|
{
|
||||||
id _value=nil;
|
id value=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
|
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
|
||||||
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
|
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
|
||||||
NSDebugMLLog(@"associations",@"object_=%@",object_);
|
NSDebugMLLog(@"associations",@"object=%@",object);
|
||||||
if (object_)
|
if (object)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
#if !GSWEB_STRICT
|
#if !GSWEB_STRICT
|
||||||
if (!isNonMandatory)
|
if (!isNonMandatory)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (![self isImplementedForComponent:object_])
|
if (![self isImplementedForComponent:object_])
|
||||||
{
|
{
|
||||||
|
@ -120,37 +127,37 @@ static char rcsId[] = "$Id$";
|
||||||
[object_ class]);
|
[object_ class]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
_value=[object_ valueForBinding:parentBindingName];
|
value=[object valueForBinding:_parentBindingName];
|
||||||
NSDebugMLLog(@"associations",@"_value=%@",_value);
|
NSDebugMLLog(@"associations",@"value=%@",value);
|
||||||
if (_value && keyPath)
|
if (value && _keyPath)
|
||||||
{
|
{
|
||||||
_value=[GSWAssociation valueInObject:_value
|
value=[GSWAssociation valueInObject:value
|
||||||
forKeyPath:keyPath];
|
forKeyPath:_keyPath];
|
||||||
NSDebugMLLog(@"associations",@"_value=%@",_value);
|
NSDebugMLLog(@"associations",@"value=%@",value);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"associations",@"_value=%@",_value);
|
NSDebugMLLog(@"associations",@"value=%@",value);
|
||||||
[self logTakeValue:_value];
|
[self logTakeValue:value];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)value
|
||||||
inObject:(id)object_
|
inObject:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"associations",@"parentBindingName=%@",parentBindingName);
|
NSDebugMLLog(@"associations",@"parentBindingName=%@",_parentBindingName);
|
||||||
NSDebugMLLog(@"associations",@"keyPath=%@",keyPath);
|
NSDebugMLLog(@"associations",@"keyPath=%@",_keyPath);
|
||||||
if (object_)
|
if (object)
|
||||||
{
|
{
|
||||||
[object_ validateValue:&value_
|
[object validateValue:&value
|
||||||
forKey:self];
|
forKey:self];
|
||||||
/*
|
/*
|
||||||
#if !GSWEB_STRICT
|
#if !GSWEB_STRICT
|
||||||
if (!isNonMandatory)
|
if (!isNonMandatory)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (![self isImplementedForComponent:object_])
|
if (![self isImplementedForComponent:object_])
|
||||||
{
|
{
|
||||||
|
@ -159,19 +166,19 @@ static char rcsId[] = "$Id$";
|
||||||
[object_ class]);
|
[object_ class]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
if (keyPath)
|
if (_keyPath)
|
||||||
{
|
{
|
||||||
id tmpValue=[object_ valueForBinding:parentBindingName];
|
id tmpValue=[object valueForBinding:_parentBindingName];
|
||||||
[GSWAssociation setValue:value_
|
[GSWAssociation setValue:value
|
||||||
inObject:tmpValue
|
inObject:tmpValue
|
||||||
forKeyPath:keyPath];
|
forKeyPath:_keyPath];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[object_ setValue:value_
|
[object setValue:value
|
||||||
forBinding:parentBindingName];
|
forBinding:_parentBindingName];
|
||||||
};
|
};
|
||||||
[self logSetValue:value_];
|
[self logSetValue:value];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWBundle.h - GSWeb: Class GSWBundle
|
/** GSWBundle.h - <title>GSWeb: Class GSWBundle</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,21 +36,21 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWBundle : NSObject <NSLocking>
|
@interface GSWBundle : NSObject <NSLocking>
|
||||||
{
|
{
|
||||||
NSString* path;
|
NSString* _path;
|
||||||
NSString* baseURL;
|
NSString* _baseURL;
|
||||||
NSString* frameworkName;
|
NSString* _frameworkName;
|
||||||
NSMutableDictionary* archiveCache;
|
NSMutableDictionary* _archiveCache;
|
||||||
NSMutableDictionary* apiCache;//NDFN
|
NSMutableDictionary* _apiCache;//NDFN
|
||||||
NSMutableDictionary* encodingCache;
|
NSMutableDictionary* _encodingCache;
|
||||||
NSMutableDictionary* pathCache;
|
NSMutableDictionary* _pathCache;
|
||||||
NSMutableDictionary* urlCache;
|
NSMutableDictionary* _urlCache;
|
||||||
NSMutableDictionary* stringsTableCache;
|
NSMutableDictionary* _stringsTableCache;
|
||||||
NSMutableDictionary* stringsTableArrayCache; //NDFN
|
NSMutableDictionary* _stringsTableArrayCache; //NDFN
|
||||||
NSMutableDictionary* templateCache;
|
NSMutableDictionary* _templateCache;
|
||||||
NSMutableDictionary* classCache;
|
NSMutableDictionary* _classCache;
|
||||||
NSRecursiveLock* selfLock;
|
NSRecursiveLock* _selfLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int selfLockn;
|
int _selfLockn;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,11 +59,11 @@
|
||||||
-(NSString*)frameworkName;
|
-(NSString*)frameworkName;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)initWithPath:(NSString*)path_
|
-(id)initWithPath:(NSString*)aPath
|
||||||
baseURL:(NSString*)baseURL_
|
baseURL:(NSString*)aBaseURL
|
||||||
inFrameworkNamed:(NSString*)frameworkName_;
|
inFrameworkNamed:(NSString*)aFrameworkName;
|
||||||
-(id)initWithPath:(NSString*)path_
|
-(id)initWithPath:(NSString*)aPath
|
||||||
baseURL:(NSString*)baseURL_;
|
baseURL:(NSString*)aBaseURL;
|
||||||
-(void)unlock;
|
-(void)unlock;
|
||||||
-(void)lock;
|
-(void)lock;
|
||||||
|
|
||||||
|
@ -69,75 +75,75 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWBundle (GSWBundleA)
|
@interface GSWBundle (GSWBundleA)
|
||||||
-(id)lockedResourceNamed:(NSString*)name_
|
-(id)lockedResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
withLanguages:(NSArray*)languages_
|
withLanguages:(NSArray*)languages
|
||||||
usingCache:(NSMutableDictionary*)cache_
|
usingCache:(NSMutableDictionary*)cache
|
||||||
relativePath:(NSString**)relativePath_
|
relativePath:(NSString**)relativePath
|
||||||
absolutePath:(NSString**)absolutePath_;
|
absolutePath:(NSString**)absolutePath;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@interface GSWBundle (GSWResourceManagement)
|
@interface GSWBundle (GSWResourceManagement)
|
||||||
-(void)initializeObject:(id)object_
|
-(void)initializeObject:(id)anObject
|
||||||
fromArchiveNamed:(NSString*)name_;
|
fromArchiveNamed:(NSString*)aName;
|
||||||
|
|
||||||
-(void)initializeObject:(id)object_
|
-(void)initializeObject:(id)anObject
|
||||||
fromArchive:(NSDictionary*)archive;
|
fromArchive:(NSDictionary*)archive;
|
||||||
|
|
||||||
-(Class)scriptedClassWithName:(NSString*)name_
|
-(Class)scriptedClassWithName:(NSString*)aName
|
||||||
superclassName:(NSString*)superclassName_;
|
superclassName:(NSString*)superclassName;
|
||||||
|
|
||||||
-(Class)lockedScriptedClassWithName:(NSString*)name_
|
-(Class)lockedScriptedClassWithName:(NSString*)aName
|
||||||
pathName:(NSString*)pathName_
|
pathName:(NSString*)pathName
|
||||||
superclassName:(NSString*)superclassName_;
|
superclassName:(NSString*)superclassName;
|
||||||
|
|
||||||
-(NSString*)lockedScriptedClassPathWithName:(NSString*)name_;
|
-(NSString*)lockedScriptedClassPathWithName:(NSString*)aName;
|
||||||
|
|
||||||
-(Class)compiledClassWithName:(NSString*)name_
|
-(Class)compiledClassWithName:(NSString*)aName
|
||||||
superclassName:(NSString*)superclassName_;
|
superclassName:(NSString*)superclassName;
|
||||||
|
|
||||||
-(GSWElement*)templateNamed:(NSString*)name_
|
-(GSWElement*)templateNamed:(NSString*)aName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
|
|
||||||
-(GSWElement*)lockedTemplateNamed:(NSString*)name_
|
-(GSWElement*)lockedTemplateNamed:(NSString*)aName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
|
|
||||||
-(NSString*)stringForKey:(NSString*)key_
|
-(NSString*)stringForKey:(NSString*)key_
|
||||||
inTableNamed:(NSString*)name_
|
inTableNamed:(NSString*)aName
|
||||||
withDefaultValue:(NSString*)defaultValue_
|
withDefaultValue:(NSString*)defaultValue
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSDictionary*)stringsTableNamed:(NSString*)name_
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_;
|
withLanguages:(NSArray*)languages;
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_;
|
withLanguages:(NSArray*)languages;
|
||||||
|
|
||||||
-(NSString*)urlForResourceNamed:(NSString*)name_
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
request:(GSWRequest*)request_;
|
request:(GSWRequest*)aRequest;
|
||||||
|
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
|
|
||||||
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)name_;
|
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)aName;
|
||||||
|
|
||||||
-(NSDictionary*)archiveNamed:(NSString*)name_;
|
-(NSDictionary*)archiveNamed:(NSString*)aName;
|
||||||
-(NSDictionary*)apiNamed:(NSString*)name_;//NDFN
|
-(NSDictionary*)apiNamed:(NSString*)aName;//NDFN
|
||||||
|
|
||||||
-(NSDictionary*)lockedArchiveNamed:(NSString*)name_;
|
-(NSDictionary*)lockedArchiveNamed:(NSString*)aName;
|
||||||
-(NSDictionary*)lockedApiNamed:(NSString*)name_;//NDFN
|
-(NSDictionary*)lockedApiNamed:(NSString*)aName;//NDFN
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWBundle (GSWBundleC)
|
@interface GSWBundle (GSWBundleC)
|
||||||
-(id)scriptedClassNameFromClassName:(NSString*)name_;
|
-(id)scriptedClassNameFromClassName:(NSString*)aName;
|
||||||
-(id)scriptPathNameFromScriptedClassName:(NSString*)name_;
|
-(id)scriptPathNameFromScriptedClassName:(NSString*)aName;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWBundle_h__
|
#endif //_GSWBundle_h__
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -311,7 +311,8 @@ static char rcsId[] = "$Id$";
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
prefixValue=[_prefix valueInComponent:component];
|
prefixValue=[_prefix valueInComponent:component];
|
||||||
suffixValue=[_suffix valueInComponent:component];
|
suffixValue=[_suffix valueInComponent:component];
|
||||||
disableValue=[_itemDisabled valueInComponent:component];
|
disableValue=[self evaluateCondition:_itemDisabled
|
||||||
|
inContext:context];
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
displayStringValue=[_displayString valueInComponent:component];
|
displayStringValue=[_displayString valueInComponent:component];
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -199,6 +199,7 @@ static char rcsId[] = "$Id$";
|
||||||
GSWComponentDefinition* aComponentDefinition=nil;
|
GSWComponentDefinition* aComponentDefinition=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
aComponentDefinition=[self _componentDefinition];
|
aComponentDefinition=[self _componentDefinition];
|
||||||
|
NSAssert(aComponentDefinition,@"No componentDefinition");
|
||||||
aFrameworkName=[aComponentDefinition frameworkName];
|
aFrameworkName=[aComponentDefinition frameworkName];
|
||||||
NSDebugMLLog(@"GSWComponent",@"aFrameworkName=%@",aFrameworkName);
|
NSDebugMLLog(@"GSWComponent",@"aFrameworkName=%@",aFrameworkName);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -458,7 +459,9 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (!template)
|
if (!template)
|
||||||
{
|
{
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"templateName=%@",[self _templateName]);
|
||||||
template=[self templateWithName:[self _templateName]];
|
template=[self templateWithName:[self _templateName]];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"template=%p",template);
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
ASSIGN(_template,template);
|
ASSIGN(_template,template);
|
||||||
|
@ -474,13 +477,17 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
//OK
|
//OK
|
||||||
GSWComponentDefinition* aComponentDefinition=nil;
|
GSWComponentDefinition* aComponentDefinition=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"_componentDefinition=%@",_componentDefinition);
|
||||||
if (_componentDefinition)
|
if (_componentDefinition)
|
||||||
aComponentDefinition=_componentDefinition;
|
aComponentDefinition=_componentDefinition;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSArray* languages=[self languages];
|
NSArray* languages=[self languages];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"languages=%@",languages);
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"_name=%@",_name);
|
||||||
aComponentDefinition=[GSWApp componentDefinitionWithName:_name
|
aComponentDefinition=[GSWApp componentDefinitionWithName:_name
|
||||||
languages:languages];
|
languages:languages];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"aComponentDefinition=%@",aComponentDefinition);
|
||||||
if ([self isCachingEnabled])
|
if ([self isCachingEnabled])
|
||||||
{
|
{
|
||||||
ASSIGN(_componentDefinition,aComponentDefinition);
|
ASSIGN(_componentDefinition,aComponentDefinition);
|
||||||
|
@ -543,9 +550,10 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
languages=[self languages];
|
languages=[self languages];
|
||||||
aComponentDefinition=[self _componentDefinition];
|
aComponentDefinition=[self _componentDefinition];
|
||||||
|
NSAssert(aComponentDefinition,@"No componentDefinition");
|
||||||
template=[aComponentDefinition templateWithName:aName
|
template=[aComponentDefinition templateWithName:aName
|
||||||
languages:languages];
|
languages:languages];
|
||||||
NSDebugMLLog(@"GSWComponent",@"template=%@",template);
|
NSDebugMLLog(@"GSWComponent",@"aName=%@ template=%@",aName,template);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return template;
|
return template;
|
||||||
};
|
};
|
||||||
|
@ -988,17 +996,20 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
GSWElementIDString* debugElementID=[aContext elementID];
|
GSWElementIDString* debugElementID=[aContext elementID];
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
NSAssert(aContext,@"No Context");
|
||||||
|
NSAssert(aResponse,@"No Response");
|
||||||
GSWStartElement(aContext);
|
GSWStartElement(aContext);
|
||||||
GSWSaveAppendToResponseElementID(aContext);
|
GSWSaveAppendToResponseElementID(aContext);
|
||||||
|
|
||||||
template=[self _template];
|
template=[self _template];
|
||||||
|
NSAssert(template,@"No template");
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
if(GSDebugSet(@"gswcomponents") == YES)
|
if(GSDebugSet(@"gswcomponents"))
|
||||||
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
|
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
request=[aContext request];
|
request=[aContext request];
|
||||||
|
NSAssert(request,@"No request");
|
||||||
isFromClientComponent=[request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
component=[aContext component];
|
component=[aContext component];
|
||||||
[aContext appendZeroElementIDComponent];
|
[aContext appendZeroElementIDComponent];
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWComponentDefinition.h - GSWeb: Class GSWComponentDefinition
|
/** GSWComponentDefinition.h - <title>GSWeb: Class GSWComponentDefinition</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#ifndef _GSWComponentDefinition_h__
|
#ifndef _GSWComponentDefinition_h__
|
||||||
#define _GSWComponentDefinition_h__
|
#define _GSWComponentDefinition_h__
|
||||||
|
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition : NSObject <NSCoding,NSCopying>
|
@interface GSWComponentDefinition : NSObject <NSCoding,NSCopying>
|
||||||
{
|
{
|
||||||
NSString* name;
|
NSString* _name;
|
||||||
GSWBundle* bundle;
|
GSWBundle* _bundle;
|
||||||
NSMutableArray* observers;
|
NSMutableArray* _observers;
|
||||||
NSString* frameworkName;
|
NSString* _frameworkName;
|
||||||
NSString* templateName;
|
NSString* _templateName;
|
||||||
Class componentClass;
|
Class _componentClass;
|
||||||
BOOL isScriptedClass;
|
BOOL _isScriptedClass;
|
||||||
BOOL isCachingEnabled;
|
BOOL _isCachingEnabled;
|
||||||
BOOL isAwake;
|
BOOL _isAwake;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
path:(NSString*)_path
|
path:(NSString*)aPath
|
||||||
baseURL:(NSString*)_baseURL
|
baseURL:(NSString*)baseURL
|
||||||
frameworkName:(NSString*)_frameworkName;
|
frameworkName:(NSString*)aFrameworkName;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)initWithCoder:(NSCoder*)coder_;
|
-(id)initWithCoder:(NSCoder*)coder;
|
||||||
-(void)encodeWithCoder:(NSCoder*)coder_;
|
-(void)encodeWithCoder:(NSCoder*)coder;
|
||||||
-(id)copyWithZone:(NSZone*)zone_;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
|
|
||||||
-(NSString*)frameworkName;
|
-(NSString*)frameworkName;
|
||||||
-(NSString*)baseURL;
|
-(NSString*)baseURL;
|
||||||
|
@ -62,7 +67,7 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition (GSWCacheManagement)
|
@interface GSWComponentDefinition (GSWCacheManagement)
|
||||||
-(BOOL)isCachingEnabled;
|
-(BOOL)isCachingEnabled;
|
||||||
-(void)setCachingEnabled:(BOOL)flag_;
|
-(void)setCachingEnabled:(BOOL)flag;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -72,55 +77,55 @@
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition (GSWComponentDefinitionB)
|
@interface GSWComponentDefinition (GSWComponentDefinitionB)
|
||||||
-(GSWElement*)templateWithName:(NSString*)name_
|
-(GSWElement*)templateWithName:(NSString*)aName
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
/*
|
/*
|
||||||
-(NSString*)stringForKey:(NSString*)key_
|
-(NSString*)stringForKey:(NSString*)key_
|
||||||
inTableNamed:(NSString*)name_
|
inTableNamed:(NSString*)aName
|
||||||
withDefaultValue:(NSString*)defaultValue_
|
withDefaultValue:(NSString*)defaultValue_
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSDictionary*)stringsTableNamed:(NSString*)name_
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_;
|
withLanguages:(NSArray*)languages;
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_;
|
withLanguages:(NSArray*)languages;
|
||||||
|
|
||||||
-(NSString*)urlForResourceNamed:(NSString*)name_
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
request:(GSWRequest*)request_;
|
request:(GSWRequest*)aRequest;
|
||||||
*/
|
*/
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
languages:(NSArray*)languages_;
|
languages:(NSArray*)languages;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition (GSWComponentDefinitionC)
|
@interface GSWComponentDefinition (GSWComponentDefinitionC)
|
||||||
-(GSWComponent*)componentInstanceInContext:(GSWContext*)context_;
|
-(GSWComponent*)componentInstanceInContext:(GSWContext*)aContext;
|
||||||
-(Class)componentClass;
|
-(Class)componentClass;
|
||||||
-(Class)_componentClass;
|
-(Class)_componentClass;
|
||||||
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations_
|
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations
|
||||||
template:(GSWElement*)_template;
|
template:(GSWElement*)template;
|
||||||
|
|
||||||
-(NSDictionary*)componentAPI;//NDFN
|
-(NSDictionary*)componentAPI;//NDFN
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition (GSWComponentDefinitionD)
|
@interface GSWComponentDefinition (GSWComponentDefinitionD)
|
||||||
-(void)_finishInitializingComponent:(GSWComponent*)_component;
|
-(void)_finishInitializingComponent:(GSWComponent*)aComponent;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentDefinition (GSWComponentDefinitionE)
|
@interface GSWComponentDefinition (GSWComponentDefinitionE)
|
||||||
-(void)_notifyObserversForDyingComponent:(GSWComponent*)_component;
|
-(void)_notifyObserversForDyingComponent:(GSWComponent*)aComponent;
|
||||||
-(void)_awakeObserversForComponent:(GSWComponent*)_component;
|
-(void)_awakeObserversForComponent:(GSWComponent*)aComponent;
|
||||||
-(void)_deallocForComponent:(GSWComponent*)_component;
|
-(void)_deallocForComponent:(GSWComponent*)aComponent;
|
||||||
-(void)_awakeForComponent:(GSWComponent*)_component;
|
-(void)_awakeForComponent:(GSWComponent*)aComponent;
|
||||||
-(void)_registerObserver:(id)_observer;
|
-(void)_registerObserver:(id)observer;
|
||||||
+(void)_registerObserver:(id)_observer;
|
+(void)_registerObserver:(id)observer;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWComponentDefinition.m - GSWeb: Class GSWComponentDefinition
|
/** GSWComponentDefinition.m - <title>GSWeb: Class GSWComponentDefinition</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,28 +35,28 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentDefinition
|
@implementation GSWComponentDefinition
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
path:(NSString*)path_
|
path:(NSString*)aPath
|
||||||
baseURL:(NSString*)baseURL_
|
baseURL:(NSString*)baseURL
|
||||||
frameworkName:(NSString*)frameworkName_
|
frameworkName:(NSString*)aFrameworkName
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswcomponents",@"name_=%@ frameworkName_=%@",name_,frameworkName_);
|
NSDebugMLLog(@"gswcomponents",@"aName=%@ aFrameworkName=%@",aName,aFrameworkName);
|
||||||
ASSIGN(name,name_);
|
ASSIGN(_name,aName);
|
||||||
bundle=[[GSWBundle alloc] initWithPath:path_
|
_bundle=[[GSWBundle alloc] initWithPath:aPath
|
||||||
baseURL:baseURL_
|
baseURL:baseURL
|
||||||
inFrameworkNamed:frameworkName_];
|
inFrameworkNamed:aFrameworkName];
|
||||||
observers=nil;
|
_observers=nil;
|
||||||
ASSIGN(frameworkName,frameworkName_);
|
ASSIGN(_frameworkName,aFrameworkName);
|
||||||
NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",frameworkName);
|
NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",_frameworkName);
|
||||||
ASSIGN(templateName,name_);//TODOV
|
ASSIGN(_templateName,aName);//TODOV
|
||||||
NSDebugMLLog(@"gswcomponents",@"templateName=%@",templateName);
|
NSDebugMLLog(@"gswcomponents",@"templateName=%@",_templateName);
|
||||||
componentClass=Nil;
|
_componentClass=Nil;
|
||||||
isScriptedClass=NO;
|
_isScriptedClass=NO;
|
||||||
isCachingEnabled=NO;
|
_isCachingEnabled=NO;
|
||||||
isAwake=NO;
|
_isAwake=NO;
|
||||||
[self setCachingEnabled:[GSWApplication isCachingEnabled]];
|
[self setCachingEnabled:[GSWApplication isCachingEnabled]];
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -62,82 +68,82 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
GSWLogC("Dealloc GSWComponentDefinition");
|
GSWLogC("Dealloc GSWComponentDefinition");
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: name");
|
GSWLogC("Dealloc GSWComponentDefinition: name");
|
||||||
DESTROY(name);
|
DESTROY(_name);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: bundle");
|
GSWLogC("Dealloc GSWComponentDefinition: bundle");
|
||||||
DESTROY(bundle);
|
DESTROY(_bundle);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: observers");
|
GSWLogC("Dealloc GSWComponentDefinition: observers");
|
||||||
DESTROY(observers);
|
DESTROY(_observers);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: frameworkName");
|
GSWLogC("Dealloc GSWComponentDefinition: frameworkName");
|
||||||
DESTROY(frameworkName);
|
DESTROY(_frameworkName);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: templateName");
|
GSWLogC("Dealloc GSWComponentDefinition: templateName");
|
||||||
DESTROY(templateName);
|
DESTROY(_templateName);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition: componentClass");
|
GSWLogC("Dealloc GSWComponentDefinition: componentClass");
|
||||||
DESTROY(componentClass);
|
DESTROY(_componentClass);
|
||||||
GSWLogC("Dealloc GSWComponentDefinition Super");
|
GSWLogC("Dealloc GSWComponentDefinition Super");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
GSWLogC("End Dealloc GSWComponentDefinition");
|
GSWLogC("End Dealloc GSWComponentDefinition");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithCoder:(NSCoder*)coder_
|
-(id)initWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&name];
|
at:&_name];
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&bundle];
|
at:&_bundle];
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&observers]; //TODOV
|
at:&_observers]; //TODOV
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&frameworkName];
|
at:&_frameworkName];
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&templateName];
|
at:&_templateName];
|
||||||
[coder_ decodeValueOfObjCType:@encode(Class)
|
[coder decodeValueOfObjCType:@encode(Class)
|
||||||
at:&componentClass];
|
at:&_componentClass];
|
||||||
[coder_ decodeValueOfObjCType:@encode(BOOL)
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isScriptedClass];
|
at:&_isScriptedClass];
|
||||||
[coder_ decodeValueOfObjCType:@encode(BOOL)
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isCachingEnabled];
|
at:&_isCachingEnabled];
|
||||||
[coder_ decodeValueOfObjCType:@encode(BOOL)
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isAwake];
|
at:&_isAwake];
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)encodeWithCoder:(NSCoder*)coder_
|
-(void)encodeWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
[coder_ encodeObject:name];
|
[coder encodeObject:_name];
|
||||||
[coder_ encodeObject:bundle];
|
[coder encodeObject:_bundle];
|
||||||
[coder_ encodeObject:observers]; //TODOV
|
[coder encodeObject:_observers]; //TODOV
|
||||||
[coder_ encodeObject:frameworkName];
|
[coder encodeObject:_frameworkName];
|
||||||
[coder_ encodeObject:templateName];
|
[coder encodeObject:_templateName];
|
||||||
[coder_ encodeValueOfObjCType:@encode(Class)
|
[coder encodeValueOfObjCType:@encode(Class)
|
||||||
at:&componentClass];
|
at:&_componentClass];
|
||||||
[coder_ encodeValueOfObjCType:@encode(BOOL)
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isScriptedClass];
|
at:&_isScriptedClass];
|
||||||
[coder_ encodeValueOfObjCType:@encode(BOOL)
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isCachingEnabled];
|
at:&_isCachingEnabled];
|
||||||
[coder_ encodeValueOfObjCType:@encode(BOOL)
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&isAwake];
|
at:&_isAwake];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone_
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
GSWComponentDefinition* clone = [[isa allocWithZone:zone_] init];
|
GSWComponentDefinition* clone = [[isa allocWithZone:zone] init];
|
||||||
if (clone)
|
if (clone)
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(clone->name,name);
|
ASSIGNCOPY(clone->_name,_name);
|
||||||
ASSIGNCOPY(clone->bundle,bundle);
|
ASSIGNCOPY(clone->_bundle,_bundle);
|
||||||
ASSIGNCOPY(clone->observers,observers);
|
ASSIGNCOPY(clone->_observers,_observers);
|
||||||
ASSIGNCOPY(clone->frameworkName,frameworkName);
|
ASSIGNCOPY(clone->_frameworkName,_frameworkName);
|
||||||
ASSIGNCOPY(clone->templateName,templateName);
|
ASSIGNCOPY(clone->_templateName,_templateName);
|
||||||
clone->componentClass=componentClass;
|
clone->_componentClass=_componentClass;
|
||||||
clone->isScriptedClass=isScriptedClass;
|
clone->_isScriptedClass=_isScriptedClass;
|
||||||
clone->isCachingEnabled=isCachingEnabled;
|
clone->_isCachingEnabled=_isCachingEnabled;
|
||||||
clone->isAwake=isAwake;
|
clone->_isAwake=_isAwake;
|
||||||
};
|
};
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
@ -145,25 +151,25 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)frameworkName
|
-(NSString*)frameworkName
|
||||||
{
|
{
|
||||||
return frameworkName;
|
return _frameworkName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)baseURL
|
-(NSString*)baseURL
|
||||||
{
|
{
|
||||||
return [bundle baseURL];
|
return [_bundle baseURL];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)path
|
-(NSString*)path
|
||||||
{
|
{
|
||||||
return [bundle path];
|
return [_bundle path];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)name
|
-(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]>",
|
return [NSString stringWithFormat:@"<%s %p - name:[%@] bundle:[%@] observers=[%@] frameworkName=[%@] templateName=[%@] componentClass=[%@] isScriptedClass=[%s] isCachingEnabled=[%s] isAwake=[%s]>",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
name,
|
_name,
|
||||||
bundle,
|
_bundle,
|
||||||
observers,
|
_observers,
|
||||||
frameworkName,
|
_frameworkName,
|
||||||
templateName,
|
_templateName,
|
||||||
componentClass,
|
_componentClass,
|
||||||
isScriptedClass ? "YES" : "NO",
|
_isScriptedClass ? "YES" : "NO",
|
||||||
isCachingEnabled ? "YES" : "NO",
|
_isCachingEnabled ? "YES" : "NO",
|
||||||
isAwake ? "YES" : "NO"];
|
_isAwake ? "YES" : "NO"];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -189,7 +195,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
isAwake=NO;
|
_isAwake=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -197,11 +203,11 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)awake
|
-(void)awake
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
BOOL _isCachingEnabled=NO;
|
BOOL isCachingEnabled=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
isAwake=YES;
|
_isAwake=YES;
|
||||||
_isCachingEnabled=[self isCachingEnabled];
|
isCachingEnabled=[self isCachingEnabled];
|
||||||
if (!_isCachingEnabled) //??
|
if (!isCachingEnabled) //??
|
||||||
[self _clearCache];
|
[self _clearCache];
|
||||||
//call self componentClass
|
//call self componentClass
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -216,13 +222,13 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)isCachingEnabled
|
-(BOOL)isCachingEnabled
|
||||||
{
|
{
|
||||||
return isCachingEnabled;
|
return _isCachingEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setCachingEnabled:(BOOL)flag_
|
-(void)setCachingEnabled:(BOOL)flag
|
||||||
{
|
{
|
||||||
isCachingEnabled=flag_;
|
_isCachingEnabled=flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -235,7 +241,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[bundle clearCache];
|
[_bundle clearCache];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -245,88 +251,88 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentDefinition (GSWComponentDefinitionB)
|
@implementation GSWComponentDefinition (GSWComponentDefinitionB)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)templateWithName:(NSString*)name_
|
-(GSWElement*)templateWithName:(NSString*)aName
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
{
|
{
|
||||||
GSWElement* _element=nil;
|
GSWElement* element=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_element=[bundle templateNamed:name_
|
element=[_bundle templateNamed:aName
|
||||||
languages:languages_];
|
languages:languages];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_element=%@",_element);
|
NSDebugMLLog(@"gswcomponents",@"aName=%@ languages=%@ element=%@",aName,languages,element);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _element;
|
return element;
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)stringForKey:(NSString*)key_
|
-(NSString*)stringForKey:(NSString*)key
|
||||||
inTableNamed:(NSString*)name_
|
inTableNamed:(NSString*)aName
|
||||||
withDefaultValue:(NSString*)defaultValue_
|
withDefaultValue:(NSString*)defaultValue
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
{
|
{
|
||||||
NSString* _string=nil;
|
NSString* string=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_string=[bundle stringForKey:key_
|
string=[_bundle stringForKey:key
|
||||||
inTableNamed:name_
|
inTableNamed:aName
|
||||||
withDefaultValue:defaultValue_
|
withDefaultValue:defaultValue
|
||||||
languages:languages_];
|
languages:languages];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _string;
|
return string;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSDictionary*)stringsTableNamed:(NSString*)name_
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_
|
withLanguages:(NSArray*)languages
|
||||||
{
|
{
|
||||||
NSDictionary* _stringsTable=nil;
|
NSDictionary* stringsTable=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_stringsTable=[bundle stringsTableNamed:name_
|
stringsTable=[bundle stringsTableNamed:aName
|
||||||
withLanguages:languages_];
|
withLanguages:languages];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _stringsTable;
|
return stringsTable;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSArray*)stringsTableArrayNamed:(NSString*)name_
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
||||||
withLanguages:(NSArray*)languages_
|
withLanguages:(NSArray*)languages
|
||||||
{
|
{
|
||||||
NSArray* _stringsTableArray=nil;
|
NSArray* stringsTableArray=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_stringsTableArray=[bundle stringsTableArrayNamed:name_
|
stringsTableArray=[bundle stringsTableArrayNamed:aName
|
||||||
withLanguages:languages_];
|
withLanguages:languages];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _stringsTableArray;
|
return stringsTableArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlForResourceNamed:(NSString*)name_
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)type
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
request:(GSWRequest*)request_
|
request:(GSWRequest*)request
|
||||||
{
|
{
|
||||||
NSString* _url=nil;
|
NSString* url=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_url=[bundle urlForResourceNamed:name_
|
url=[bundle urlForResourceNamed:aName
|
||||||
ofType:type_
|
ofType:type
|
||||||
languages:languages_
|
languages:languages
|
||||||
request:request_];
|
request:request];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _url;
|
return url;
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)pathForResourceNamed:(NSString*)name_
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
||||||
ofType:(NSString*)type_
|
ofType:(NSString*)aType
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)languages
|
||||||
{
|
{
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_path=[bundle pathForResourceNamed:name_
|
path=[_bundle pathForResourceNamed:aName
|
||||||
ofType:type_
|
ofType:aType
|
||||||
languages:languages_];
|
languages:languages];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -335,35 +341,37 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentDefinition (GSWComponentDefinitionC)
|
@implementation GSWComponentDefinition (GSWComponentDefinitionC)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWComponent*)componentInstanceInContext:(GSWContext*)_context
|
-(GSWComponent*)componentInstanceInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponent* _component=nil;
|
GSWComponent* component=nil;
|
||||||
Class _componentClass=nil;
|
Class componentClass=nil;
|
||||||
NSMutableDictionary* _threadDictionary=nil;
|
NSMutableDictionary* threadDictionary=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(_context,@"No Context");
|
NSAssert(aContext,@"No Context");
|
||||||
NSDebugMLLog(@"gswcomponents",@"_context=%@",_context);
|
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
|
||||||
_componentClass=[self componentClass];
|
componentClass=[self componentClass];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_componentClass=%p",(void*)_componentClass);
|
NSAssert(componentClass,@"No componentClass");
|
||||||
_threadDictionary=GSCurrentThreadDictionary();
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
||||||
[_threadDictionary setObject:self
|
threadDictionary=GSCurrentThreadDictionary();
|
||||||
|
[threadDictionary setObject:self
|
||||||
forKey:GSWThreadKey_ComponentDefinition];
|
forKey:GSWThreadKey_ComponentDefinition];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_component=[[_componentClass new] autorelease];
|
component=[[componentClass new] autorelease];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
LOGException(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
[_threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
localException,[localException reason],__FILE__,__LINE__);
|
||||||
|
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[_threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
||||||
// [_component context];//so what ?
|
// [_component context];//so what ?
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _component;
|
return component;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -377,71 +385,71 @@ static char rcsId[] = "$Id$";
|
||||||
-(Class)_componentClass
|
-(Class)_componentClass
|
||||||
{
|
{
|
||||||
//OK To Verify
|
//OK To Verify
|
||||||
Class _componentClass=componentClass;
|
Class componentClass=_componentClass;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"_componentClass=%@",_componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
||||||
NSDebugMLLog(@"gswcomponents",@"name=%@",name);
|
NSDebugMLLog(@"gswcomponents",@"name=%@",_name);
|
||||||
if (!_componentClass)
|
if (!componentClass)
|
||||||
_componentClass=NSClassFromString(name);//???
|
componentClass=NSClassFromString(_name);//???
|
||||||
NSDebugMLLog(@"gswcomponents",@"_componentClass=%@",_componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
||||||
NSDebugMLLog(@"gswcomponents",@"_componentClass superclass=%@",[_componentClass superclass]);
|
NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]);
|
||||||
if (!_componentClass)
|
if (!componentClass)
|
||||||
{
|
{
|
||||||
BOOL _createClassesOk=NO;
|
BOOL createClassesOk=NO;
|
||||||
NSString* _superClassName=nil;
|
NSString* superClassName=nil;
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
{
|
{
|
||||||
NSDictionary* _archive=[bundle archiveNamed:name];
|
NSDictionary* archive=[_bundle archiveNamed:_name];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_archive=%@",_archive);
|
NSDebugMLLog(@"gswcomponents",@"archive=%@",archive);
|
||||||
_superClassName=[_archive objectForKey:@"superClassName"];
|
superClassName=[archive objectForKey:@"superClassName"];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_superClassName=%@",_superClassName);
|
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
||||||
if (_superClassName)
|
if (superClassName)
|
||||||
{
|
{
|
||||||
if (!NSClassFromString(_superClassName))
|
if (!NSClassFromString(superClassName))
|
||||||
{
|
{
|
||||||
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
|
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
|
||||||
_superClassName,
|
superClassName,
|
||||||
name);
|
_name);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_superClassName)
|
if (!superClassName)
|
||||||
_superClassName=@"GSWComponent";
|
superClassName=@"GSWComponent";
|
||||||
NSDebugMLLog(@"gswcomponents",@"_superClassName=%@",_superClassName);
|
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
||||||
_createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:name]
|
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
|
||||||
superClassName:_superClassName];
|
superClassName:superClassName];
|
||||||
_componentClass=NSClassFromString(name);
|
componentClass=NSClassFromString(_name);
|
||||||
NSDebugMLLog(@"gswcomponents",@"_componentClass=%p",(void*)_componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
||||||
};
|
};
|
||||||
//call GSWApp isCaching
|
//call GSWApp isCaching
|
||||||
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _componentClass;
|
return componentClass;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)_associations
|
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations
|
||||||
template:(GSWElement*)_template
|
template:(GSWElement*)template
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponentReference* _componentReference=nil;
|
GSWComponentReference* componentReference=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_componentReference=[[[GSWComponentReference alloc]initWithName:name
|
componentReference=[[[GSWComponentReference alloc]initWithName:_name
|
||||||
associations:_associations
|
associations:associations
|
||||||
template:_template] autorelease];
|
template:template] autorelease];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _componentReference;
|
return componentReference;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSDictionary*)componentAPI
|
-(NSDictionary*)componentAPI
|
||||||
{
|
{
|
||||||
NSDictionary* _componentAPI=nil;
|
NSDictionary* componentAPI=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_componentAPI=[bundle apiNamed:name];
|
componentAPI=[_bundle apiNamed:_name];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _componentAPI;
|
return componentAPI;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -450,14 +458,14 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentDefinition (GSWComponentDefinitionD)
|
@implementation GSWComponentDefinition (GSWComponentDefinitionD)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_finishInitializingComponent:(GSWComponent*)_component
|
-(void)_finishInitializingComponent:(GSWComponent*)component
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSDictionary* _archive=nil;
|
NSDictionary* archive=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_archive=[bundle archiveNamed:name];
|
archive=[_bundle archiveNamed:_name];
|
||||||
[bundle initializeObject:_component
|
[_bundle initializeObject:component
|
||||||
fromArchive:_archive];
|
fromArchive:archive];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -467,37 +475,37 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentDefinition (GSWComponentDefinitionE)
|
@implementation GSWComponentDefinition (GSWComponentDefinitionE)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_notifyObserversForDyingComponent:(GSWComponent*)_component
|
-(void)_notifyObserversForDyingComponent:(GSWComponent*)aComponent
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_awakeObserversForComponent:(GSWComponent*)_component
|
-(void)_awakeObserversForComponent:(GSWComponent*)aComponent
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_deallocForComponent:(GSWComponent*)_component
|
-(void)_deallocForComponent:(GSWComponent*)aComponent
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_awakeForComponent:(GSWComponent*)_component
|
-(void)_awakeForComponent:(GSWComponent*)aComponent
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_registerObserver:(id)_observer
|
-(void)_registerObserver:(id)observer
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(void)_registerObserver:(id)_observer
|
+(void)_registerObserver:(id)observer
|
||||||
{
|
{
|
||||||
LOGClassFnNotImplemented(); //TODOFN
|
LOGClassFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWComponentRequestHandler.h - GSWeb: Class GSWComponentRequestHandler
|
/** GSWComponentRequestHandler.h - <title>GSWeb: Class GSWComponentRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -31,27 +37,27 @@
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)_application
|
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)application
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements;
|
elements:(NSDictionary*)elements;
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)_session
|
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)aSession
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements;
|
elements:(NSDictionary*)elements;
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)_component
|
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)_component
|
||||||
inSession:(GSWSession*)_session
|
inSession:(GSWSession*)aSession
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements;
|
elements:(NSDictionary*)elements;
|
||||||
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)context_ID
|
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)aContextID
|
||||||
inSession:(GSWSession*)_session;
|
inSession:(GSWSession*)aSession;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWComponentRequestHandler (GSWRequestHandlerClassA)
|
@interface GSWComponentRequestHandler (GSWRequestHandlerClassA)
|
||||||
+(id)handler;
|
+(id)handler;
|
||||||
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)request_;
|
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)aRequest;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWComponentRequestHandler_h__
|
#endif //_GSWComponentRequestHandler_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWComponentRequestHandler.m - GSWeb: Class GSWComponentRequestHandler
|
/** GSWComponentRequestHandler.m - <title>GSWeb: Class GSWComponentRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,100 +35,104 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentRequestHandler
|
@implementation GSWComponentRequestHandler
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWApplication* _application=[GSWApplication application];
|
GSWApplication* application=[GSWApplication application];
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[_application lockRequestHandling];
|
[application lockRequestHandling];
|
||||||
_response=[self lockedHandleRequest:request_];
|
response=[self lockedHandleRequest:aRequest];
|
||||||
if (!_response)
|
if (!response)
|
||||||
{
|
{
|
||||||
_response=[GSWResponse responseWithMessage:@"Component Handle request failed"
|
response=[GSWResponse responseWithMessage:@"Component Handle request failed"
|
||||||
inContext:nil
|
inContext:nil
|
||||||
forRequest:request_];
|
forRequest:aRequest];
|
||||||
[_response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
|
[response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
|
||||||
};
|
};
|
||||||
[_application unlockRequestHandling];
|
[application unlockRequestHandling];
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)request_
|
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWStatisticsStore* _statisticsStore=nil;
|
GSWStatisticsStore* statisticsStore=nil;
|
||||||
GSWApplication* _application=[GSWApplication application];
|
GSWApplication* application=[GSWApplication application];
|
||||||
GSWContext* _context=nil;
|
GSWContext* aContext=nil;
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
NSDictionary* _requestHandlerValues=nil;
|
NSDictionary* requestHandlerValues=nil;
|
||||||
NSString* _senderID=nil;
|
NSString* senderID=nil;
|
||||||
BOOL _exceptionRaised=NO;
|
BOOL exceptionRaised=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_requestHandlerValues=[GSWComponentRequestHandler _requestHandlerValuesForRequest:request_];
|
requestHandlerValues=[GSWComponentRequestHandler _requestHandlerValuesForRequest:aRequest];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
_exceptionRaised=YES;
|
exceptionRaised=YES;
|
||||||
LOGException(@"%@ (%@)",
|
LOGException(@"%@ (%@)",
|
||||||
localException,
|
localException,
|
||||||
[localException reason]);
|
[localException reason]);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In -lockedHandleRequest:");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
|
@"In -lockedHandleRequest:");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
[_application awake];
|
[application awake];
|
||||||
_response=[_application handleException:localException
|
response=[application handleException:localException
|
||||||
inContext:nil];
|
inContext:nil];
|
||||||
[_application sleep];
|
[application sleep];
|
||||||
[_response _finalizeInContext:_context];//DO Call _finalizeInContext: !
|
[response _finalizeInContext:aContext];//DO Call _finalizeInContext: !
|
||||||
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
|
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
if (!_exceptionRaised)
|
if (!exceptionRaised)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"requests",@"_requestHandlerValues=%@",_requestHandlerValues);
|
NSDebugMLLog(@"requests",@"requestHandlerValues=%@",requestHandlerValues);
|
||||||
_statisticsStore=[[GSWApplication application]statisticsStore];
|
statisticsStore=[[GSWApplication application]statisticsStore];
|
||||||
NSDebugMLLog(@"requests",@"_statisticsStore=%@",_statisticsStore);
|
NSDebugMLLog(@"requests",@"statisticsStore=%@",statisticsStore);
|
||||||
[_statisticsStore _applicationWillHandleComponentActionRequest];
|
[statisticsStore _applicationWillHandleComponentActionRequest];
|
||||||
_context=[GSWContext contextWithRequest:request_];
|
aContext=[GSWContext contextWithRequest:aRequest];
|
||||||
_senderID=[_requestHandlerValues objectForKey:GSWKey_ElementID[GSWebNamingConv]];
|
NSDebugMLLog(@"aContext",@"aContext=%@",aContext);
|
||||||
NSDebugMLLog(@"requests",@"AA _senderID=%@",_senderID);
|
senderID=[requestHandlerValues objectForKey:GSWKey_ElementID[GSWebNamingConv]];
|
||||||
[_context _setSenderID:_senderID];
|
NSDebugMLLog(@"requests",@"AA senderID=%@",senderID);
|
||||||
[_application _setContext:_context];
|
[aContext _setSenderID:senderID];
|
||||||
//====>
|
[application _setContext:aContext];
|
||||||
|
//====>
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_application awake];
|
[application awake];
|
||||||
_response=[self lockedDispatchWithPreparedApplication:_application
|
response=[self lockedDispatchWithPreparedApplication:application
|
||||||
inContext:_context
|
inContext:aContext
|
||||||
elements:_requestHandlerValues];
|
elements:requestHandlerValues];
|
||||||
|
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
_exceptionRaised=YES;
|
exceptionRaised=YES;
|
||||||
LOGException(@"%@ (%@)",
|
LOGException(@"%@ (%@)",
|
||||||
localException,
|
localException,
|
||||||
[localException reason]);
|
[localException reason]);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In lockedDispatchWithPreparedApplication");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
|
@"In lockedDispatchWithPreparedApplication");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
_response=[_application handleException:localException
|
response=[application handleException:localException
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
[_application sleep];
|
[application sleep];
|
||||||
[_response _finalizeInContext:_context]; //DO Call _finalizeInContext: !
|
[response _finalizeInContext:aContext]; //DO Call _finalizeInContext: !
|
||||||
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
|
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],
|
||||||
|
@"_finalizeInContext not called for GSWResponse");
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
if (!_exceptionRaised)
|
if (!exceptionRaised)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_application sleep];
|
[application sleep];
|
||||||
[_response _finalizeInContext:_context];//LAST //CLEAN
|
[response _finalizeInContext:aContext];//LAST //CLEAN
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -130,271 +140,287 @@ static char rcsId[] = "$Id$";
|
||||||
localException,
|
localException,
|
||||||
[localException reason]);
|
[localException reason]);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
@"In [application sleep] or [_response _finalizeInContext:_context]");
|
@"In [application sleep] or [response _finalizeInContext:aContext]");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
_response=[_application handleException:localException
|
response=[application handleException:localException
|
||||||
inContext:nil];
|
inContext:nil];
|
||||||
[_response _finalizeInContext:_context]; //DO Call _finalizeInContext: !
|
[response _finalizeInContext:aContext]; //DO Call _finalizeInContext: !
|
||||||
NSAssert(!_response || [_response isFinalizeInContextHasBeenCalled],@"_finalizeInContext not called for GSWResponse");
|
NSAssert(!response || [response isFinalizeInContextHasBeenCalled],
|
||||||
|
@"_finalizeInContext not called for GSWResponse");
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
//<===========
|
//<===========
|
||||||
};
|
};
|
||||||
|
|
||||||
[_application _setContext:nil];
|
[application _setContext:nil];
|
||||||
_statisticsStore=[[GSWApplication application] statisticsStore];
|
statisticsStore=[[GSWApplication application] statisticsStore];
|
||||||
[_statisticsStore _applicationDidHandleComponentActionRequest];
|
[statisticsStore _applicationDidHandleComponentActionRequest];
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)_application
|
-(GSWResponse*)lockedDispatchWithPreparedApplication:(GSWApplication*)application
|
||||||
inContext:(GSWContext*)_context
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements
|
elements:(NSDictionary*)elements
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWResponse* _errorResponse=nil;
|
GSWResponse* errorResponse=nil;
|
||||||
GSWSession* _session=nil;
|
GSWSession* session=nil;
|
||||||
NSString* _sessionID=nil;
|
NSString* sessionID=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_sessionID=[_elements objectForKey:GSWKey_SessionID[GSWebNamingConv]];
|
sessionID=[elements objectForKey:GSWKey_SessionID[GSWebNamingConv]];
|
||||||
NSDebugMLLog(@"requests",@"_sessionID=%@",_sessionID);
|
NSDebugMLLog(@"requests",@"sessionID=%@",sessionID);
|
||||||
if (_sessionID)
|
if (sessionID)
|
||||||
{
|
{
|
||||||
_session=[_application restoreSessionWithID:_sessionID
|
session=[application restoreSessionWithID:sessionID
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
if (!_session)
|
if (!session)
|
||||||
{
|
{
|
||||||
// check for refuseNewSessions
|
// check for refuseNewSessions
|
||||||
_errorResponse=[_application handleSessionRestorationErrorInContext:_context];
|
errorResponse=[application handleSessionRestorationErrorInContext:aContext];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// check for refuseNewSessions
|
// check for refuseNewSessions
|
||||||
_session=[_application _initializeSessionInContext:_context];
|
session=[application _initializeSessionInContext:aContext];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in session create/restore");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
|
@"in session create/restore");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
_errorResponse=[_application handleException:localException
|
errorResponse=[application handleException:localException
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
if (!_response && !_errorResponse)
|
if (!response && !errorResponse)
|
||||||
{
|
{
|
||||||
if (_session)
|
if (session)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"requests",@"_session=%@",_session);
|
NSDebugMLLog(@"requests",@"session=%@",session);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_response=[self lockedDispatchWithPreparedSession:_session
|
response=[self lockedDispatchWithPreparedSession:session
|
||||||
inContext:_context
|
inContext:aContext
|
||||||
elements:_elements];
|
elements:elements];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"in lockedDispatchWithPreparedSession");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
|
@"in lockedDispatchWithPreparedSession");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
_errorResponse=[_application handleException:localException
|
errorResponse=[application handleException:localException
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//======LAST //CLEAN
|
//======LAST //CLEAN
|
||||||
if (_response || _errorResponse)
|
if (response || errorResponse)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
NSDebugMLLog(@"requests",@"_errorResponse=%@",_errorResponse);
|
NSDebugMLLog(@"requests",@"errorResponse=%@",errorResponse);
|
||||||
RETAIN(_response);
|
RETAIN(response);
|
||||||
[_context _putAwakeComponentsToSleep];
|
[aContext _putAwakeComponentsToSleep];
|
||||||
[_application saveSessionForContext:_context];
|
[application saveSessionForContext:aContext];
|
||||||
NSDebugMLLog(@"requests",@"_session=%@",_session);
|
NSDebugMLLog(@"requests",@"session=%@",session);
|
||||||
NSDebugMLLog(@"requests",@"_sessionCount=%u",[_session retainCount]);
|
NSDebugMLLog(@"requests",@"sessionCount=%u",[session retainCount]);
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
AUTORELEASE(_response);
|
AUTORELEASE(response);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response ? _response : _errorResponse;
|
return response ? response : errorResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)_session
|
-(GSWResponse*)lockedDispatchWithPreparedSession:(GSWSession*)aSession
|
||||||
inContext:(GSWContext*)_context
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements
|
elements:(NSDictionary*)elements
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _errorResponse=nil;
|
GSWResponse* errorResponse=nil;
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWComponent* _page=nil;
|
GSWComponent* page=nil;
|
||||||
BOOL _storesIDsInCookies=NO;
|
BOOL storesIDsInCookies=NO;
|
||||||
NSString* _contextID=nil;
|
NSString* contextID=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"requests",@"_session=%@",_session);
|
|
||||||
NSDebugMLLog(@"requests",@"_context=%@",_context);
|
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
|
||||||
_storesIDsInCookies=[_session storesIDsInCookies]; //For What ?
|
NSDebugMLLog(@"requests",@"aContext=%@",aContext);
|
||||||
NSDebugMLLog(@"requests",@"_storesIDsInCookies=%s",(_storesIDsInCookies ? "YES" : "NO"));
|
|
||||||
_contextID=[_elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
|
storesIDsInCookies=[aSession storesIDsInCookies]; //For What ?
|
||||||
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
|
NSDebugMLLog(@"requests",@"storesIDsInCookies=%s",(storesIDsInCookies ? "YES" : "NO"));
|
||||||
if (_contextID) // ??
|
|
||||||
|
contextID=[elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
|
||||||
|
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
|
||||||
|
|
||||||
|
if (contextID) // ??
|
||||||
{
|
{
|
||||||
NSAssert([_contextID length]>0,@"contextID empty");
|
NSAssert([contextID length]>0,@"contextID empty");
|
||||||
_page=[self lockedRestorePageForContextID:_contextID
|
page=[self lockedRestorePageForContextID:contextID
|
||||||
inSession:_session];
|
inSession:aSession];
|
||||||
//??
|
//??
|
||||||
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
|
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
|
||||||
NSDebugMLLog(@"requests",@"_session=%@",_session);
|
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
|
||||||
NSDebugMLLog(@"requests",@"_page=%@",_page);
|
NSDebugMLLog(@"requests",@"page=%@",page);
|
||||||
if (!_page)
|
if (!page)
|
||||||
{
|
{
|
||||||
GSWApplication* _application=[_session application];
|
GSWApplication* application=[aSession application];
|
||||||
_errorResponse=[_application handlePageRestorationErrorInContext:_context];
|
errorResponse=[application handlePageRestorationErrorInContext:aContext];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSString* _pageName=[_elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
|
NSString* pageName=[elements objectForKey:GSWKey_PageName[GSWebNamingConv]];
|
||||||
NSException* _exception=nil;
|
NSException* exception=nil;
|
||||||
NSDebugMLLog(@"requests",@"_pageName=%@",_pageName);
|
NSDebugMLLog(@"requests",@"pageName=%@",pageName);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_page=[[GSWApplication application] pageWithName:_pageName
|
page=[[GSWApplication application] pageWithName:pageName
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In pageWithName");
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
|
@"In pageWithName");
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
ASSIGN(_exception,localException);
|
ASSIGN(exception,localException);
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
if (!_page)
|
if (!page)
|
||||||
{
|
{
|
||||||
_errorResponse=[[GSWApplication application] handleException:_exception
|
errorResponse=[[GSWApplication application] handleException:exception
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
};
|
};
|
||||||
DESTROY(_exception);
|
DESTROY(exception);
|
||||||
};
|
};
|
||||||
if (!_response && !_errorResponse && _page)
|
if (!response && !errorResponse && page)
|
||||||
{
|
{
|
||||||
[_context _setPageElement:_page];
|
[aContext _setPageElement:page];
|
||||||
_response=[self lockedDispatchWithPreparedPage:_page
|
response=[self lockedDispatchWithPreparedPage:page
|
||||||
inSession:_session
|
inSession:aSession
|
||||||
inContext:_context
|
inContext:aContext
|
||||||
elements:_elements];
|
elements:elements];
|
||||||
};
|
};
|
||||||
if (_response)
|
if (response)
|
||||||
{
|
{
|
||||||
BOOL _isPageRefreshOnBacktrackEnabled=[[GSWApplication application] isPageRefreshOnBacktrackEnabled];
|
BOOL isPageRefreshOnBacktrackEnabled=[[GSWApplication application] isPageRefreshOnBacktrackEnabled];
|
||||||
//TODO method adds a header to the HTTP response. This header sets the expiration date for an HTML page to the date and time of the creation of the page. Later, when the browser checks its cache for this page, it finds that the page is no longer valid and so refetches it by resubmitting the request URL to the WebObjects application.
|
//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 0
|
||||||
if (!_contextID) // ??
|
if (!contextID) // ??
|
||||||
{
|
{
|
||||||
if (![_session storesIDsInCookies])//??
|
if (![aSession storesIDsInCookies])//??
|
||||||
[_session clearCookieFromResponse:_response];
|
[aSession clearCookieFromResponse:response];
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response ? _response : _errorResponse;
|
return response ? response : errorResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)_component
|
-(GSWResponse*)lockedDispatchWithPreparedPage:(GSWComponent*)aComponent
|
||||||
inSession:(GSWSession*)_session
|
inSession:(GSWSession*)aSession
|
||||||
inContext:(GSWContext*)_context
|
inContext:(GSWContext*)aContext
|
||||||
elements:(NSDictionary*)_elements
|
elements:(NSDictionary*)elements
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWRequest* _request=nil;
|
GSWRequest* request=nil;
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWResponse* _errorResponse=nil;
|
GSWResponse* errorResponse=nil;
|
||||||
NSString* _senderID=nil;
|
NSString* senderID=nil;
|
||||||
NSString* _contextID=nil;
|
NSString* contextID=nil;
|
||||||
NSString* _httpVersion=nil;
|
NSString* httpVersion=nil;
|
||||||
GSWElement* _page=nil;
|
GSWElement* page=nil;
|
||||||
GSWElement* _responsePage=nil;
|
GSWElement* responsePage=nil;
|
||||||
BOOL _isFromClientComponent=NO;
|
BOOL isFromClientComponent=NO;
|
||||||
BOOL _hasFormValues=NO;
|
BOOL hasFormValues=NO;
|
||||||
GSWContext* _responseContext=nil;
|
GSWContext* responseContext=nil;
|
||||||
GSWComponent* _responsePageElement=nil;
|
GSWComponent* responsePageElement=nil;
|
||||||
GSWRequest* _responseRequest=nil;
|
GSWRequest* responseRequest=nil;
|
||||||
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"requests",@"_component=%@",_component);
|
NSDebugMLLog(@"requests",@"aComponent=%@",aComponent);
|
||||||
_request=[_context request];
|
|
||||||
_contextID=[_elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
|
request=[aContext request];
|
||||||
NSDebugMLLog(@"requests",@"_contextID=%@",_contextID);
|
contextID=[elements objectForKey:GSWKey_ContextID[GSWebNamingConv]];
|
||||||
_response=[[GSWResponse new]autorelease];
|
NSDebugMLLog(@"requests",@"contextID=%@",contextID);
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
|
||||||
NSDebugMLLog(@"requests",@"_session=%@",_session);
|
response=[[GSWResponse new]autorelease];
|
||||||
NSDebugMLLog(@"requests",@"_context=%@",_context);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
_senderID=[_context senderID];
|
NSDebugMLLog(@"requests",@"aSession=%@",aSession);
|
||||||
NSDebugMLLog(@"requests",@"AA _senderID=%@",_senderID);
|
NSDebugMLLog(@"requests",@"aContext=%@",aContext);
|
||||||
|
|
||||||
|
senderID=[aContext senderID];
|
||||||
|
NSDebugMLLog(@"requests",@"AA senderID=%@",senderID);
|
||||||
//TODO
|
//TODO
|
||||||
{
|
{
|
||||||
GSWContext* _matchedContext=[_session _contextIDMatchingContextID:_contextID
|
GSWContext* matchedContext=[aSession _contextIDMatchingContextID:contextID
|
||||||
requestSenderID:_senderID];
|
requestSenderID:senderID];
|
||||||
}
|
}
|
||||||
_httpVersion=[_request httpVersion];
|
httpVersion=[request httpVersion];
|
||||||
[_response setHTTPVersion:_httpVersion];
|
[response setHTTPVersion:httpVersion];
|
||||||
[_response setHeader:@"text/html"
|
[response setHeader:@"text/html"
|
||||||
forKey:@"content-type"];
|
forKey:@"content-type"];
|
||||||
[_context _setResponse:_response];
|
[aContext _setResponse:response];
|
||||||
_page=[_context page];
|
page=[aContext page];
|
||||||
if (_contextID)//??
|
if (contextID)//??
|
||||||
{
|
{
|
||||||
_hasFormValues=[_request _hasFormValues];
|
hasFormValues=[request _hasFormValues];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[_context _setPageChanged:NO];
|
[aContext _setPageChanged:NO];
|
||||||
_isFromClientComponent=[_request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
//??
|
//??
|
||||||
[_context _setPageReplaced:NO];
|
[aContext _setPageReplaced:NO];
|
||||||
_isFromClientComponent=[_request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
};
|
};
|
||||||
if (_hasFormValues)
|
if (hasFormValues)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"requests",@"Before takeValues [_context elementID]=%@",[_context elementID]);
|
NSDebugMLLog(@"requests",@"Before takeValues [aContext elementID]=%@",
|
||||||
NSAssert([[_context elementID] length]==0,@"1 lockedDispatchWithPreparedPage elementID length>0");
|
[aContext elementID]);
|
||||||
[[GSWApplication application] takeValuesFromRequest:_request
|
NSAssert([[aContext elementID] length]==0,
|
||||||
inContext:_context];
|
@"1 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
NSDebugMLLog(@"requests",@"After takeValues[_context elementID]=%@",[_context elementID]);
|
[[GSWApplication application] takeValuesFromRequest:request
|
||||||
if (![[_context elementID] length]==0)
|
inContext:aContext];
|
||||||
|
NSDebugMLLog(@"requests",@"After takeValues[aContext elementID]=%@",
|
||||||
|
[aContext elementID]);
|
||||||
|
if (![[aContext elementID] length]==0)
|
||||||
{
|
{
|
||||||
LOGSeriousError0(@"2 lockedDispatchWithPreparedPage elementID length>0");
|
LOGSeriousError0(@"2 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
[_context deleteAllElementIDComponents];//NDFN
|
[aContext deleteAllElementIDComponents];//NDFN
|
||||||
};
|
};
|
||||||
[_context _setPageChanged:NO];//???
|
[aContext _setPageChanged:NO];//???
|
||||||
_isFromClientComponent=[_request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
[_context _setPageReplaced:NO];
|
[aContext _setPageReplaced:NO];
|
||||||
};
|
};
|
||||||
if (_senderID) //??
|
if (senderID) //??
|
||||||
{
|
{
|
||||||
BOOL _pageChanged=NO;
|
BOOL pageChanged=NO;
|
||||||
NSException* _exception=nil;
|
NSException* exception=nil;
|
||||||
NSDebugMLLog(@"requests",@"Before invokeAction [_context elementID]=%@",[_context elementID]);
|
NSDebugMLLog(@"requests",@"Before invokeAction [aContext elementID]=%@",
|
||||||
NSAssert([[_context elementID] length]==0,@"3 lockedDispatchWithPreparedPage elementID length>0");
|
[aContext elementID]);
|
||||||
|
NSAssert([[aContext elementID] length]==0,
|
||||||
|
@"3 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
// Exception catching here ?
|
// Exception catching here ?
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_responsePage=[[GSWApplication application] invokeActionForRequest:_request
|
responsePage=[[GSWApplication application] invokeActionForRequest:request
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
NSDebugMLLog(@"requests",@"After invokeAction [_context elementID]=%@",[_context elementID]);
|
NSDebugMLLog(@"requests",@"After invokeAction [aContext elementID]=%@",[aContext elementID]);
|
||||||
NSAssert([[_context elementID] length]==0,@"4 lockedDispatchWithPreparedPage elementID length>0");
|
NSAssert([[aContext elementID] length]==0,@"4 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -402,92 +428,96 @@ static char rcsId[] = "$Id$";
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
||||||
@"In invokeActionForRequest component=%@ of Class %@",
|
@"In invokeActionForRequest component=%@ of Class %@",
|
||||||
[_component name],
|
[aComponent name],
|
||||||
[_component class]);
|
[aComponent class]);
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
ASSIGN(_exception,localException);
|
ASSIGN(exception,localException);
|
||||||
if (!_responsePage)
|
if (!responsePage)
|
||||||
{
|
{
|
||||||
_errorResponse=[[GSWApplication application] handleException:_exception
|
errorResponse=[[GSWApplication application] handleException:exception
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
};
|
};
|
||||||
DESTROY(_exception);
|
DESTROY(exception);
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
// [_context deleteAllElementIDComponents];//NDFN
|
// [aContext deleteAllElementIDComponents];//NDFN
|
||||||
NSDebugMLLog(@"requests",@"_responsePage=%@",_responsePage);
|
NSDebugMLLog(@"requests",@"responsePage=%@",responsePage);
|
||||||
if (_errorResponse)
|
if (errorResponse)
|
||||||
{
|
{
|
||||||
_response=_errorResponse;
|
response=errorResponse;
|
||||||
_responseContext=_context;
|
responseContext=aContext;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!_responsePage)
|
if (!responsePage)
|
||||||
_responsePage=_page;
|
responsePage=page;
|
||||||
|
|
||||||
_responseContext=[(GSWComponent*)_responsePage context];//So what ?
|
responseContext=[(GSWComponent*)responsePage context];//So what ?
|
||||||
NSDebugMLLog(@"requests",@"_responseContext=%@",_responseContext);
|
NSDebugMLLog(@"requests",@"responseContext=%@",responseContext);
|
||||||
[_responseContext _setPageReplaced:NO];
|
[responseContext _setPageReplaced:NO];
|
||||||
_responsePageElement=[_responseContext _pageElement];
|
responsePageElement=[responseContext _pageElement];
|
||||||
NSDebugMLLog(@"requests",@"_responsePageElement=%@",_responsePageElement);
|
NSDebugMLLog(@"requests",@"responsePageElement=%@",responsePageElement);
|
||||||
_pageChanged=(_responsePage!=_responsePageElement);
|
pageChanged=(responsePage!=responsePageElement);
|
||||||
[_responseContext _setPageChanged:_pageChanged];//??
|
[responseContext _setPageChanged:pageChanged];//??
|
||||||
if (_pageChanged)
|
if (pageChanged)
|
||||||
{
|
{
|
||||||
[_responseContext _setPageElement:_responsePage];
|
[responseContext _setPageElement:responsePage];
|
||||||
};
|
};
|
||||||
_responseRequest=[_responseContext request];//SoWhat ?
|
responseRequest=[responseContext request];//SoWhat ?
|
||||||
[_responseRequest isFromClientComponent];//SoWhat
|
[responseRequest isFromClientComponent];//SoWhat
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_responseContext=_context;
|
responseContext=aContext;
|
||||||
_responsePageElement=_page;
|
responsePageElement=page;
|
||||||
_responsePage=_component;
|
responsePage=aComponent;
|
||||||
_responseRequest=_request;
|
responseRequest=request;
|
||||||
};
|
};
|
||||||
if (!_errorResponse)
|
if (!errorResponse)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"requests",@"_response before appendToResponse=%@",_response);
|
NSDebugMLLog(@"requests",@"response before appendToResponse=%@",response);
|
||||||
NSDebugMLLog(@"requests",@"_responseContext=%@",_responseContext);
|
NSDebugMLLog(@"requests",@"responseContext=%@",responseContext);
|
||||||
NSAssert([[_context elementID] length]==0,@"5 lockedDispatchWithPreparedPage elementID length>0");
|
NSAssert([[aContext elementID] length]==0,
|
||||||
NSDebugMLLog(@"requests",@"Before appendToResponse [_context elementID]=%@",[_context elementID]);
|
@"5 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
[[GSWApplication application] appendToResponse:_response
|
NSDebugMLLog(@"requests",@"Before appendToResponse [aContext elementID]=%@",
|
||||||
inContext:_responseContext];
|
[aContext elementID]);
|
||||||
NSDebugMLLog(@"requests",@"After appendToResponse [_context elementID]=%@",[_context elementID]);
|
[[GSWApplication application] appendToResponse:response
|
||||||
NSAssert([[_context elementID] length]==0,@"6 lockedDispatchWithPreparedPage elementID length>0");
|
inContext:responseContext];
|
||||||
_responseRequest=[_responseContext request];//SoWhat ?
|
NSDebugMLLog(@"requests",@"After appendToResponse [aContext elementID]=%@",
|
||||||
[_responseRequest isFromClientComponent];//SoWhat
|
[aContext elementID]);
|
||||||
|
NSAssert([[aContext elementID] length]==0,
|
||||||
|
@"6 lockedDispatchWithPreparedPage elementID length>0");
|
||||||
|
responseRequest=[responseContext request];//SoWhat ?
|
||||||
|
[responseRequest isFromClientComponent];//SoWhat
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
||||||
@"In appendToResponse page=%@ of Class %@",
|
@"In appendToResponse page=%@ of Class %@",
|
||||||
[_page name],
|
[page name],
|
||||||
[_page class]);
|
[page class]);
|
||||||
LOGException(@"exception=%@",localException);
|
LOGException(@"exception=%@",localException);
|
||||||
NSDebugMLLog(@"requests",@"context=%@",_context);
|
NSDebugMLLog(@"requests",@"context=%@",aContext);
|
||||||
_errorResponse=[[GSWApplication application] handleException:localException
|
errorResponse=[[GSWApplication application] handleException:localException
|
||||||
inContext:_context];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _errorResponse ? _errorResponse : _response;
|
return errorResponse ? errorResponse : response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)_contextID
|
-(GSWComponent*)lockedRestorePageForContextID:(NSString*)aContextID
|
||||||
inSession:(GSWSession*)_session
|
inSession:(GSWSession*)aSession
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponent* _page=[_session restorePageForContextID:_contextID];
|
GSWComponent* page=[aSession restorePageForContextID:aContextID];
|
||||||
return _page;
|
return page;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -502,14 +532,14 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)request_
|
+(NSDictionary*)_requestHandlerValuesForRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSDictionary* _values=nil;
|
NSDictionary* values=nil;
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_values=[request_ uriOrFormOrCookiesElements];
|
values=[aRequest uriOrFormOrCookiesElements];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -522,7 +552,7 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
return _values;
|
return values;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWConstantValueAssociation.h - GSWeb: Class GSWConstantValueAssociation
|
/** GSWConstantValueAssociation.h - <title>GSWeb: Class GSWConstantValueAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,18 +35,18 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWConstantValueAssociation:GSWAssociation
|
@interface GSWConstantValueAssociation:GSWAssociation
|
||||||
{
|
{
|
||||||
id value;
|
id _value;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithValue:(id)value_;
|
-(id)initWithValue:(id)aValue;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)copyWithZone:(NSZone *)zone;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
-(NSString*)debugDescription;
|
-(NSString*)debugDescription;
|
||||||
-(BOOL)isValueConstant;
|
-(BOOL)isValueConstant;
|
||||||
-(BOOL)isValueSettable;
|
-(BOOL)isValueSettable;
|
||||||
-(id)valueInObject:(id)object_;
|
-(id)valueInObject:(id)object;
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)aValue
|
||||||
inObject:(id)object_;
|
inObject:(id)object;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWConstantValueAssociation.m - GSWeb: Class GSWConstantValueAssociation
|
/** GSWConstantValueAssociation.m - <title>GSWeb: Class GSWConstantValueAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,12 +35,12 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWConstantValueAssociation
|
@implementation GSWConstantValueAssociation
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithValue:(id)value_
|
-(id)initWithValue:(id)aValue
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(value,value_);
|
ASSIGNCOPY(_value,aValue);
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
@ -44,29 +50,29 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
GSWLogMemC("GSWConstantValueAssociation start of dealloc");
|
GSWLogMemC("GSWConstantValueAssociation start of dealloc");
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
DESTROY(value);
|
DESTROY(_value);
|
||||||
GSWLogMemC("value deallocated");
|
GSWLogMemC("value deallocated");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
GSWLogMemC("GSWConstantValueAssociation end of dealloc");
|
GSWLogMemC("GSWConstantValueAssociation end of dealloc");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone;
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
GSWConstantValueAssociation* clone = [super copyWithZone:zone];
|
GSWConstantValueAssociation* clone = [super copyWithZone:zone];
|
||||||
ASSIGN(clone->value,value);
|
ASSIGN(clone->_value,_value);
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)debugDescription
|
-(NSString*)debugDescription
|
||||||
{
|
{
|
||||||
NSString* _dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
|
NSString* dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
value,
|
_value,
|
||||||
[value class]];
|
[_value class]];
|
||||||
return _dscr;
|
return dscr;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -82,34 +88,35 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)valueInObject:(id)object_
|
-(id)valueInObject:(id)object
|
||||||
{
|
{
|
||||||
[self logTakeValue:value];
|
[self logTakeValue:_value];
|
||||||
return value;
|
return _value;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)aValue
|
||||||
inObject:(id)object_
|
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*)description
|
||||||
{
|
{
|
||||||
NSString* _dscr=nil;
|
NSString* dscr=nil;
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
if (value)
|
if (_value)
|
||||||
{
|
{
|
||||||
GSWLogAssertGood(value);
|
GSWLogAssertGood(_value);
|
||||||
};
|
};
|
||||||
_dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
|
dscr=[NSString stringWithFormat:@"<%s %p - value=%@ (class: %@)>",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
value,
|
_value,
|
||||||
[value class]];
|
[_value class]];
|
||||||
return _dscr;
|
return dscr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* debug.m - debug
|
/** GSWDebug.m - <title>GSWeb: Debug</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -80,23 +86,27 @@ NSString* objectDescription(id object)
|
||||||
if ([object respondsToSelector:@selector(description)])
|
if ([object respondsToSelector:@selector(description)])
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
|
{
|
||||||
description=[object description];
|
description=[object description];
|
||||||
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
}
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
return description;
|
return description;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
NSString* IVarInString(const char* _type,void* _value)
|
NSString* IVarInString(const char* aType,void* aValue)
|
||||||
{
|
{
|
||||||
if (_type && _value)
|
if (aType && aValue)
|
||||||
{
|
{
|
||||||
switch (*_type)
|
switch (*aType)
|
||||||
{
|
{
|
||||||
case _C_ID:
|
case _C_ID:
|
||||||
{
|
{
|
||||||
id* pvalue=(id*)_value;
|
id* pvalue=(id*)aValue;
|
||||||
return [NSString stringWithFormat:@"object:%ld Class:%s Description:%@",
|
return [NSString stringWithFormat:@"object:%ld Class:%s Description:%@",
|
||||||
(long)(*pvalue),
|
(long)(*pvalue),
|
||||||
[*pvalue class],
|
[*pvalue class],
|
||||||
|
@ -105,98 +115,98 @@ NSString* IVarInString(const char* _type,void* _value)
|
||||||
break;
|
break;
|
||||||
case _C_CLASS:
|
case _C_CLASS:
|
||||||
{
|
{
|
||||||
Class* pvalue=(Class*)_value;
|
Class* pvalue=(Class*)aValue;
|
||||||
return [NSString stringWithFormat:@"Class:%s",
|
return [NSString stringWithFormat:@"Class:%s",
|
||||||
class_get_class_name(*pvalue)];
|
class_get_class_name(*pvalue)];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_SEL:
|
case _C_SEL:
|
||||||
{
|
{
|
||||||
SEL* pvalue=(SEL*)_value;
|
SEL* pvalue=(SEL*)aValue;
|
||||||
return [NSString stringWithFormat:@"SEL:%s",
|
return [NSString stringWithFormat:@"SEL:%s",
|
||||||
sel_get_name(*pvalue)];
|
sel_get_name(*pvalue)];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_CHR:
|
case _C_CHR:
|
||||||
{
|
{
|
||||||
char* pvalue=(char*)_value;
|
char* pvalue=(char*)aValue;
|
||||||
return [NSString stringWithFormat:@"CHAR:%c",
|
return [NSString stringWithFormat:@"CHAR:%c",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_UCHR:
|
case _C_UCHR:
|
||||||
{
|
{
|
||||||
unsigned char* pvalue=(unsigned char*)_value;
|
unsigned char* pvalue=(unsigned char*)aValue;
|
||||||
return [NSString stringWithFormat:@"UCHAR:%d",
|
return [NSString stringWithFormat:@"UCHAR:%d",
|
||||||
(int)*pvalue];
|
(int)*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_SHT:
|
case _C_SHT:
|
||||||
{
|
{
|
||||||
short* pvalue=(short*)_value;
|
short* pvalue=(short*)aValue;
|
||||||
return [NSString stringWithFormat:@"SHORT:%d",
|
return [NSString stringWithFormat:@"SHORT:%d",
|
||||||
(int)*pvalue];
|
(int)*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_USHT:
|
case _C_USHT:
|
||||||
{
|
{
|
||||||
unsigned short* pvalue=(unsigned short*)_value;
|
unsigned short* pvalue=(unsigned short*)aValue;
|
||||||
return [NSString stringWithFormat:@"USHORT:%d",
|
return [NSString stringWithFormat:@"USHORT:%d",
|
||||||
(int)*pvalue];
|
(int)*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_INT:
|
case _C_INT:
|
||||||
{
|
{
|
||||||
int* pvalue=(int*)_value;
|
int* pvalue=(int*)aValue;
|
||||||
return [NSString stringWithFormat:@"INT:%d",
|
return [NSString stringWithFormat:@"INT:%d",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_UINT:
|
case _C_UINT:
|
||||||
{
|
{
|
||||||
unsigned int* pvalue=(unsigned int*)_value;
|
unsigned int* pvalue=(unsigned int*)aValue;
|
||||||
return [NSString stringWithFormat:@"UINT:%u",
|
return [NSString stringWithFormat:@"UINT:%u",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_LNG:
|
case _C_LNG:
|
||||||
{
|
{
|
||||||
long* pvalue=(long*)_value;
|
long* pvalue=(long*)aValue;
|
||||||
return [NSString stringWithFormat:@"LONG:%ld",
|
return [NSString stringWithFormat:@"LONG:%ld",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_ULNG:
|
case _C_ULNG:
|
||||||
{
|
{
|
||||||
unsigned long* pvalue=(unsigned long*)_value;
|
unsigned long* pvalue=(unsigned long*)aValue;
|
||||||
return [NSString stringWithFormat:@"ULONG:%lu",
|
return [NSString stringWithFormat:@"ULONG:%lu",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_FLT:
|
case _C_FLT:
|
||||||
{
|
{
|
||||||
float* pvalue=(float*)_value;
|
float* pvalue=(float*)aValue;
|
||||||
return [NSString stringWithFormat:@"FLOAT:%f",
|
return [NSString stringWithFormat:@"FLOAT:%f",
|
||||||
(double)*pvalue];
|
(double)*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_DBL:
|
case _C_DBL:
|
||||||
{
|
{
|
||||||
double* pvalue=(double*)_value;
|
double* pvalue=(double*)aValue;
|
||||||
return [NSString stringWithFormat:@"DOUBLE:%f",
|
return [NSString stringWithFormat:@"DOUBLE:%f",
|
||||||
*pvalue];
|
*pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_VOID:
|
case _C_VOID:
|
||||||
{
|
{
|
||||||
void* pvalue=(void*)_value;
|
void* pvalue=(void*)aValue;
|
||||||
return [NSString stringWithFormat:@"VOID:*%lX",
|
return [NSString stringWithFormat:@"VOID:*%lX",
|
||||||
(unsigned long)pvalue];
|
(unsigned long)pvalue];
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case _C_CHARPTR:
|
case _C_CHARPTR:
|
||||||
{
|
{
|
||||||
char* pvalue=(void*)_value;
|
char* pvalue=(void*)aValue;
|
||||||
return [NSString stringWithFormat:@"CHAR*:%s",
|
return [NSString stringWithFormat:@"CHAR*:%s",
|
||||||
pvalue];
|
pvalue];
|
||||||
};
|
};
|
||||||
|
@ -220,15 +230,15 @@ NSString* IVarInString(const char* _type,void* _value)
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
NSString* TypeToNSString(const char* _type)
|
NSString* TypeToNSString(const char* aType)
|
||||||
{
|
{
|
||||||
if (_type)
|
if (aType)
|
||||||
{
|
{
|
||||||
switch (*_type)
|
switch (*aType)
|
||||||
{
|
{
|
||||||
case _C_ID:
|
case _C_ID:
|
||||||
{ // '@'
|
{ // '@'
|
||||||
const char *t = _type + 1;
|
const char *t = aType + 1;
|
||||||
if (*t == '"')
|
if (*t == '"')
|
||||||
{
|
{
|
||||||
const char *start = t + 1;
|
const char *start = t + 1;
|
||||||
|
@ -256,20 +266,20 @@ NSString* TypeToNSString(const char* _type)
|
||||||
case _C_UINT: return @"unsigned int";
|
case _C_UINT: return @"unsigned int";
|
||||||
case _C_LNG: return @"long";
|
case _C_LNG: return @"long";
|
||||||
case _C_ULNG: return @"unsigned long";
|
case _C_ULNG: return @"unsigned long";
|
||||||
// case _C_LNG_LNG: return @"long long";
|
// case _C_LNG_LNG: return @"long long";
|
||||||
// case _C_ULNG_LNG: return @"unsigned long long";
|
// case _C_ULNG_LNG: return @"unsigned long long";
|
||||||
case _C_FLT: return @"float";
|
case _C_FLT: return @"float";
|
||||||
case _C_DBL: return @"double";
|
case _C_DBL: return @"double";
|
||||||
case _C_VOID: return @"void";
|
case _C_VOID: return @"void";
|
||||||
case _C_CHARPTR: return @"char *";
|
case _C_CHARPTR: return @"char *";
|
||||||
case _C_PTR:
|
case _C_PTR:
|
||||||
return [NSString stringWithFormat:@"%@ *",
|
return [NSString stringWithFormat:@"%@ *",
|
||||||
TypeToNSString(_type + 1)];
|
TypeToNSString(aType + 1)];
|
||||||
break;
|
break;
|
||||||
case _C_STRUCT_B:
|
case _C_STRUCT_B:
|
||||||
{
|
{
|
||||||
NSString *structName = nil;
|
NSString *structName = nil;
|
||||||
const char *t = _type + 1;
|
const char *t = aType + 1;
|
||||||
|
|
||||||
if (*t == '?')
|
if (*t == '?')
|
||||||
structName = @"?";
|
structName = @"?";
|
||||||
|
@ -285,7 +295,7 @@ NSString* TypeToNSString(const char* _type)
|
||||||
};
|
};
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return [NSString stringWithFormat:@"%s", _type];
|
return [NSString stringWithFormat:@"%s", aType];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -345,7 +355,7 @@ void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
USTOP
|
USTOP
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object)
|
void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object)
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
/* GSWDeployedBundle.h - GSWeb: Class GSWDeployedBundle
|
/** GSWDeployedBundle.h - <title>GSWeb: Class GSWDeployedBundle</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
<abstract></abstract>
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,50 +38,50 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWDeployedBundle : NSObject
|
@interface GSWDeployedBundle : NSObject
|
||||||
{
|
{
|
||||||
NSString* bundlePath;
|
NSString* _bundlePath;
|
||||||
GSWMultiKeyDictionary* relativePathsCache;
|
GSWMultiKeyDictionary* _relativePathsCache;
|
||||||
NSRecursiveLock* selfLock;
|
NSRecursiveLock* _selfLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int selfLockn;
|
int _selfLockn;
|
||||||
objc_thread_t selfLock_thread_id;
|
objc_thread_t _selfLock_thread_id;
|
||||||
objc_thread_t creation_thread_id;
|
objc_thread_t _creation_thread_id;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(id)initWithPath:(NSString*)path_;
|
-(id)initWithPath:(NSString*)aPath;
|
||||||
-(GSWProjectBundle*)projectBundle;
|
-(GSWProjectBundle*)projectBundle;
|
||||||
-(BOOL)isFramework;
|
-(BOOL)isFramework;
|
||||||
-(NSString*)wrapperName;
|
-(NSString*)wrapperName;
|
||||||
-(NSString*)projectName;
|
-(NSString*)projectName;
|
||||||
-(NSString*)bundlePath;
|
-(NSString*)bundlePath;
|
||||||
-(NSArray*)pathsForResourcesOfType:(NSString*)type_;
|
-(NSArray*)pathsForResourcesOfType:(NSString*)aType;
|
||||||
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)type_;
|
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)aType;
|
||||||
-(NSString*)relativePathForResourceNamed:(NSString*)name_
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_;
|
forLanguage:(NSString*)aLanguage;
|
||||||
-(NSString*)relativePathForResourceNamed:(NSString*)name_
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_;
|
forLanguage:(NSString*)aLanguage;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(NSString*)directory_
|
inDirectory:(NSString*)aDirectory
|
||||||
forLanguages:(NSArray*)languages_;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(NSString*)directory_
|
inDirectory:(NSString*)aDirectory
|
||||||
forLanguage:(NSString*)language_;
|
forLanguage:(NSString*)aLanguage;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(NSString*)directory_
|
inDirectory:(NSString*)aDirectory
|
||||||
forLanguage:(NSString*)language_;
|
forLanguage:(NSString*)aLanguage;
|
||||||
-(void)lock;
|
-(void)lock;
|
||||||
-(void)unlock;
|
-(void)unlock;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWDeployedBundle (GSWDeployedBundleA)
|
@interface GSWDeployedBundle (GSWDeployedBundleA)
|
||||||
+(GSWDeployedBundle*)bundleWithPath:(NSString*)path_;
|
+(GSWDeployedBundle*)bundleWithPath:(NSString*)aPath;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWDeployedBundle_h__
|
#endif //_GSWDeployedBundle_h__
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** GSWDeployedBundle.m - <title>GSWeb: Class GSWDeployedBundle</title>
|
/** GSWDeployedBundle.m - <title>GSWeb: Class GSWDeployedBundle</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
@ -37,19 +38,19 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWDeployedBundle
|
@implementation GSWDeployedBundle
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithPath:(NSString*)path_
|
-(id)initWithPath:(NSString*)aPath
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"path_=%@",path_);
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
||||||
ASSIGN(bundlePath,[path_ stringGoodPath]);
|
ASSIGN(_bundlePath,[aPath stringGoodPath]);
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
|
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
|
||||||
relativePathsCache=[GSWMultiKeyDictionary new];
|
_relativePathsCache=[GSWMultiKeyDictionary new];
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
creation_thread_id=objc_thread_id();
|
_creation_thread_id=objc_thread_id();
|
||||||
#endif
|
#endif
|
||||||
selfLock=[NSRecursiveLock new];
|
_selfLock=[NSRecursiveLock new];
|
||||||
/*
|
/*
|
||||||
NSDebugMLog(@"selfLock->mutex=%p",(void*)selfLock->mutex);
|
NSDebugMLog(@"selfLock->mutex=%p",(void*)selfLock->mutex);
|
||||||
NSDebugMLog(@"selfLock->mutex backend=%p",(void*)((pthread_mutex_t*)(selfLock->mutex->backend)));
|
NSDebugMLog(@"selfLock->mutex backend=%p",(void*)((pthread_mutex_t*)(selfLock->mutex->backend)));
|
||||||
|
@ -68,17 +69,17 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
NSDebugFLog(@"Dealloc GSWDeployedBundle %p",(void*)self);
|
NSDebugFLog(@"Dealloc GSWDeployedBundle %p",(void*)self);
|
||||||
DESTROY(bundlePath);
|
DESTROY(_bundlePath);
|
||||||
DESTROY(relativePathsCache);
|
DESTROY(_relativePathsCache);
|
||||||
GSWLogC("Dealloc GSWDeployedBundle: selfLock");
|
GSWLogC("Dealloc GSWDeployedBundle: selfLock");
|
||||||
NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p creation_thread_id=%p",
|
NSDebugFLog(@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p creation_thread_id=%p",
|
||||||
(void*)selfLock,
|
(void*)_selfLock,
|
||||||
selfLockn,
|
_selfLockn,
|
||||||
(void*)selfLock_thread_id,
|
(void*)_selfLock_thread_id,
|
||||||
(void*)objc_thread_id(),
|
(void*)objc_thread_id(),
|
||||||
(void*)creation_thread_id);
|
(void*)_creation_thread_id);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
DESTROY(selfLock);
|
DESTROY(_selfLock);
|
||||||
GSWLogC("Dealloc GSWDeployedBundle Super");
|
GSWLogC("Dealloc GSWDeployedBundle Super");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
NSDebugFLog(@"End Dealloc GSWDeployedBundle %p",(void*)self);
|
NSDebugFLog(@"End Dealloc GSWDeployedBundle %p",(void*)self);
|
||||||
|
@ -94,10 +95,10 @@ static char rcsId[] = "$Id$";
|
||||||
(void*)self];
|
(void*)self];
|
||||||
// GSWLogC("GSWDeployedBundle description B");
|
// GSWLogC("GSWDeployedBundle description B");
|
||||||
descr=[descr stringByAppendingFormat:@"bundlePath:%@ ",
|
descr=[descr stringByAppendingFormat:@"bundlePath:%@ ",
|
||||||
bundlePath];
|
_bundlePath];
|
||||||
// GSWLogC("GSWDeployedBundle description C");
|
// GSWLogC("GSWDeployedBundle description C");
|
||||||
descr=[descr stringByAppendingFormat:@"relativePathsCache=%p>",
|
descr=[descr stringByAppendingFormat:@"relativePathsCache=%p>",
|
||||||
(void*)relativePathsCache];
|
(void*)_relativePathsCache];
|
||||||
// GSWLogC("GSWDeployedBundle description D");
|
// GSWLogC("GSWDeployedBundle description D");
|
||||||
return descr;
|
return descr;
|
||||||
};
|
};
|
||||||
|
@ -106,41 +107,41 @@ static char rcsId[] = "$Id$";
|
||||||
-(GSWProjectBundle*)projectBundle
|
-(GSWProjectBundle*)projectBundle
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _projectName=nil;
|
NSString* projectName=nil;
|
||||||
BOOL _isFramework=NO;
|
BOOL isFramework=NO;
|
||||||
GSWDeployedBundle* _projectBundle=nil;
|
GSWDeployedBundle* projectBundle=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_projectName=[self projectName];
|
projectName=[self projectName];
|
||||||
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
||||||
_isFramework=[self isFramework];
|
isFramework=[self isFramework];
|
||||||
NSDebugMLLog(@"bundles",@"_isFramework=%s",(_isFramework ? "YES" : "NO"));
|
NSDebugMLLog(@"bundles",@"isFramework=%s",(isFramework ? "YES" : "NO"));
|
||||||
_projectBundle=[GSWProjectBundle projectBundleForProjectNamed:_projectName
|
projectBundle=[GSWProjectBundle projectBundleForProjectNamed:projectName
|
||||||
isFramework:_isFramework];
|
isFramework:isFramework];
|
||||||
NSDebugMLLog(@"bundles",@"_projectBundle=%@",_projectBundle);
|
NSDebugMLLog(@"bundles",@"projectBundle=%@",projectBundle);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return (GSWProjectBundle*)_projectBundle;
|
return (GSWProjectBundle*)projectBundle;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)isFramework
|
-(BOOL)isFramework
|
||||||
{
|
{
|
||||||
//OK ??
|
//OK ??
|
||||||
return [bundlePath hasSuffix:GSFrameworkSuffix];
|
return [_bundlePath hasSuffix:GSFrameworkSuffix];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)wrapperName
|
-(NSString*)wrapperName
|
||||||
{
|
{
|
||||||
//OK ?
|
//OK ?
|
||||||
NSString* _projectName=nil;
|
NSString* projectName=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
|
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
|
||||||
_projectName=[bundlePath lastPathComponent];
|
projectName=[_bundlePath lastPathComponent];
|
||||||
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
||||||
_projectName=[_projectName stringByDeletingPathExtension];
|
projectName=[projectName stringByDeletingPathExtension];
|
||||||
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _projectName;
|
return projectName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -148,103 +149,106 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
// H:\Wotests\ObjCTest3\ObjCTest3.gswa ==> ObjCTest3
|
// H:\Wotests\ObjCTest3\ObjCTest3.gswa ==> ObjCTest3
|
||||||
//OK ?
|
//OK ?
|
||||||
NSString* _projectName=nil;
|
NSString* projectName=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"_gnustep_target_cpu=%@",[NSBundle _gnustep_target_cpu]);
|
NSDebugMLLog(@"bundles",@"_gnustep_target_cpu=%@",[NSBundle _gnustep_target_cpu]);
|
||||||
NSDebugMLLog(@"bundles",@"_gnustep_target_dir=%@",[NSBundle _gnustep_target_dir]);
|
NSDebugMLLog(@"bundles",@"_gnustep_target_dir=%@",[NSBundle _gnustep_target_dir]);
|
||||||
NSDebugMLLog(@"bundles",@"_gnustep_target_os=%@",[NSBundle _gnustep_target_os]);
|
NSDebugMLLog(@"bundles",@"_gnustep_target_os=%@",[NSBundle _gnustep_target_os]);
|
||||||
NSDebugMLLog(@"bundles",@"_library_combo=%@",[NSBundle _library_combo]);
|
NSDebugMLLog(@"bundles",@"_library_combo=%@",[NSBundle _library_combo]);
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@",bundlePath);
|
NSDebugMLLog(@"bundles",@"_bundlePath=%@",_bundlePath);
|
||||||
_projectName=[bundlePath lastPathComponent];
|
projectName=[_bundlePath lastPathComponent];
|
||||||
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
||||||
_projectName=[_projectName stringByDeletingPathExtension];
|
projectName=[projectName stringByDeletingPathExtension];
|
||||||
NSDebugMLLog(@"bundles",@"_projectName=%@",_projectName);
|
NSDebugMLLog(@"bundles",@"projectName=%@",projectName);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _projectName;
|
return projectName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)bundlePath
|
-(NSString*)bundlePath
|
||||||
{
|
{
|
||||||
return bundlePath;
|
return _bundlePath;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSArray*)pathsForResourcesOfType:(NSString*)type_
|
-(NSArray*)pathsForResourcesOfType:(NSString*)aType
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSArray* _paths=nil;
|
NSArray* paths=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"type_=%@ language_=%@",type_);
|
NSDebugMLLog(@"bundles",@"aType=%@",aType);
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_paths=[self lockedPathsForResourcesOfType:type_];
|
paths=[self lockedPathsForResourcesOfType:aType];
|
||||||
NSDebugMLLog(@"bundles",@"_paths=%@",_paths);
|
NSDebugMLLog(@"bundles",@"paths=%@",paths);
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
||||||
|
localException,[localException reason]);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
return _paths;
|
return paths;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)type_
|
-(NSArray*)lockedPathsForResourcesOfType:(NSString*)aType
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)relativePathForResourceNamed:(NSString*)name_
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_
|
forLanguage:(NSString*)aLanguage
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ language_=%@",name_,language_);
|
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
forLanguage:language_];
|
forLanguage:aLanguage];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
||||||
|
localException,[localException reason]);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)relativePathForResourceNamed:(NSString*)name_
|
-(NSString*)relativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_
|
forLanguages:(NSArray*)someLanguages
|
||||||
{
|
{
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ languages_=%@",name_,languages_);
|
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
forLanguages:languages_];
|
forLanguages:someLanguages];
|
||||||
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
//NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",localException,[localException reason]);
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@)",
|
||||||
|
localException,[localException reason]);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -252,187 +256,188 @@ static char rcsId[] = "$Id$";
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_
|
forLanguage:(NSString*)aLanguage
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ language_=%@",name_,language_);
|
NSDebugMLLog(@"bundles",@"aName=%@ aLanguage=%@",aName,aLanguage);
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"Resources/WebServer"
|
inDirectory:@"Resources/WebServer"
|
||||||
forLanguage:language_];
|
forLanguage:aLanguage];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
if (!_path)
|
if (!path)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"Resources"
|
inDirectory:@"Resources"
|
||||||
forLanguage:language_];
|
forLanguage:aLanguage];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
if (!_path)
|
if (!path)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"."
|
inDirectory:@"."
|
||||||
forLanguage:language_];
|
forLanguage:aLanguage];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_
|
forLanguages:(NSArray*)someLanguages
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ languages_=%@",name_,languages_);
|
NSDebugMLLog(@"bundles",@"aName=%@ someLanguages=%@",aName,someLanguages);
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources/WebServer",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"Resources/WebServer"
|
inDirectory:@"Resources/WebServer"
|
||||||
forLanguages:languages_];
|
forLanguages:someLanguages];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
if (!_path)
|
if (!path)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying Resources",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"Resources"
|
inDirectory:@"Resources"
|
||||||
forLanguages:languages_];
|
forLanguages:someLanguages];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
if (!_path)
|
if (!path)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",bundlePath);
|
NSDebugMLLog(@"bundles",@"bundlePath=%@ Trying .",_bundlePath);
|
||||||
_path=[self lockedRelativePathForResourceNamed:name_
|
path=[self lockedRelativePathForResourceNamed:aName
|
||||||
inDirectory:@"."
|
inDirectory:@"."
|
||||||
forLanguages:languages_];
|
forLanguages:someLanguages];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(id)directory_
|
inDirectory:(id)aDirectory
|
||||||
forLanguages:(NSArray*)languages_
|
forLanguages:(NSArray*)someLanguages
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ languages_=%@",name_,directory_,languages_);
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ someLanguages=%@",aName,aDirectory,someLanguages);
|
||||||
if (languages_)
|
if (someLanguages)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
for(i=0;!_path && i<[languages_ count];i++)
|
for(i=0;!path && i<[someLanguages count];i++)
|
||||||
{
|
{
|
||||||
_path=[self lockedCachedRelativePathForResourceNamed:name_
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
||||||
inDirectory:directory_
|
inDirectory:aDirectory
|
||||||
forLanguage:[languages_ objectAtIndex:i]];
|
forLanguage:[someLanguages objectAtIndex:i]];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_path)
|
if (!path)
|
||||||
_path=[self lockedCachedRelativePathForResourceNamed:name_
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
||||||
inDirectory:directory_
|
inDirectory:aDirectory
|
||||||
forLanguage:nil];
|
forLanguage:nil];
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedCachedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(NSString*)directory_
|
inDirectory:(NSString*)aDirectory
|
||||||
forLanguage:(NSString*)language_
|
forLanguage:(NSString*)aLanguage
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ language_=%@",name_,directory_,language_);
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
|
||||||
if (name_)
|
if (aName)
|
||||||
{
|
{
|
||||||
NSString* _emptyString=[NSString string];
|
NSString* emptyString=[NSString string];
|
||||||
NSString* _bundlePath=[self bundlePath];
|
NSString* bundlePath=[self bundlePath];
|
||||||
NSArray* _keys;
|
NSArray* keys;
|
||||||
if ([directory_ isEqualToString:@"."])
|
if ([aDirectory isEqualToString:@"."])
|
||||||
directory_=nil;
|
aDirectory=nil;
|
||||||
if (language_)
|
if (aLanguage)
|
||||||
_keys=[NSArray arrayWithObjects:name_,
|
keys=[NSArray arrayWithObjects:aName,
|
||||||
_bundlePath ? _bundlePath : _emptyString,
|
bundlePath ? bundlePath : emptyString,
|
||||||
directory_ ? directory_ : _emptyString,
|
aDirectory ? aDirectory : emptyString,
|
||||||
language_ ? language_ : _emptyString,
|
aLanguage ? aLanguage : emptyString,
|
||||||
nil];
|
nil];
|
||||||
else
|
else
|
||||||
_keys=[NSArray arrayWithObjects:name_,
|
keys=[NSArray arrayWithObjects:aName,
|
||||||
_bundlePath ? _bundlePath : _emptyString,
|
bundlePath ? bundlePath : emptyString,
|
||||||
directory_ ? directory_ : _emptyString,
|
aDirectory ? aDirectory : emptyString,
|
||||||
nil];
|
nil];
|
||||||
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
|
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
|
||||||
_path=[relativePathsCache objectForKeysArray:_keys];
|
path=[_relativePathsCache objectForKeysArray:keys];
|
||||||
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
||||||
if (_path==GSNotFoundMarker)
|
if (path==GSNotFoundMarker)
|
||||||
_path=nil;
|
path=nil;
|
||||||
if (!_path)
|
if (!path)
|
||||||
{
|
{
|
||||||
//call again _relativePathForResourceNamed:inDirectory:forLanguage:
|
//call again _relativePathForResourceNamed:inDirectory:forLanguage:
|
||||||
NSString* _completePathTest=nil;
|
NSString* completePathTest=nil;
|
||||||
BOOL _exists=NO;
|
BOOL exists=NO;
|
||||||
NSFileManager* _fileManager=nil;
|
NSFileManager* fileManager=nil;
|
||||||
NSString* _pathTest=[NSString string];
|
NSString* pathTest=[NSString string];
|
||||||
if (directory_)
|
if (aDirectory)
|
||||||
_pathTest=[_pathTest stringByAppendingPathComponent:directory_];
|
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
|
||||||
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
||||||
if (language_)
|
if (aLanguage)
|
||||||
_pathTest=[_pathTest stringByAppendingPathComponent:
|
pathTest=[pathTest stringByAppendingPathComponent:
|
||||||
[language_ stringByAppendingString:GSLanguagePSuffix]];
|
[aLanguage stringByAppendingString:GSLanguagePSuffix]];
|
||||||
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
//NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||||
_pathTest=[_pathTest stringByAppendingPathComponent:name_];
|
pathTest=[pathTest stringByAppendingPathComponent:aName];
|
||||||
NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||||
_completePathTest=[_bundlePath stringByAppendingPathComponent:_pathTest];
|
completePathTest=[bundlePath stringByAppendingPathComponent:pathTest];
|
||||||
NSDebugMLLog(@"bundles",@"_completePathTest=%@",_completePathTest);
|
NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest);
|
||||||
_fileManager=[NSFileManager defaultManager];
|
fileManager=[NSFileManager defaultManager];
|
||||||
_exists=[_fileManager fileExistsAtPath:_completePathTest];
|
exists=[fileManager fileExistsAtPath:completePathTest];
|
||||||
NSDebugMLLog(@"bundles",@"_exists=%s",(_exists ? "YES" : "NO"));
|
NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO"));
|
||||||
if (_exists)
|
if (exists)
|
||||||
{
|
{
|
||||||
_path=_pathTest;
|
path=pathTest;
|
||||||
[relativePathsCache setObject:_path
|
[_relativePathsCache setObject:path
|
||||||
forKeysArray:_keys];
|
forKeysArray:keys];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
[relativePathsCache setObject:GSNotFoundMarker
|
[_relativePathsCache setObject:GSNotFoundMarker
|
||||||
forKeysArray:_keys];
|
forKeysArray:keys];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
inDirectory:(NSString*)directory_
|
inDirectory:(NSString*)aDirectory
|
||||||
forLanguage:(NSString*)language_
|
forLanguage:(NSString*)aLanguage
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_=%@ directory_=%@ language_=%@",name_,directory_,language_);
|
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",
|
||||||
_path=[self lockedCachedRelativePathForResourceNamed:name_
|
aName,aDirectory,aLanguage);
|
||||||
inDirectory:directory_
|
path=[self lockedCachedRelativePathForResourceNamed:aName
|
||||||
forLanguage:language_];
|
inDirectory:aDirectory
|
||||||
|
forLanguage:aLanguage];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -441,26 +446,26 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
||||||
(void*)selfLock,
|
(void*)_selfLock,
|
||||||
selfLockn,
|
_selfLockn,
|
||||||
(void*)selfLock_thread_id,
|
(void*)_selfLock_thread_id,
|
||||||
(void*)objc_thread_id());
|
(void*)objc_thread_id());
|
||||||
if (selfLockn>0)
|
if (_selfLockn>0)
|
||||||
{
|
{
|
||||||
if (selfLock_thread_id!=objc_thread_id())
|
if (_selfLock_thread_id!=objc_thread_id())
|
||||||
{
|
{
|
||||||
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
selfLockn++;
|
_selfLockn++;
|
||||||
selfLock_thread_id=objc_thread_id();
|
_selfLock_thread_id=objc_thread_id();
|
||||||
#endif
|
#endif
|
||||||
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
||||||
selfLock,
|
_selfLock,
|
||||||
selfLockn,
|
_selfLockn,
|
||||||
(void*)selfLock_thread_id,
|
(void*)_selfLock_thread_id,
|
||||||
(void*)objc_thread_id());
|
(void*)objc_thread_id());
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
@ -471,27 +476,27 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
||||||
(void*)selfLock,
|
(void*)_selfLock,
|
||||||
selfLockn,
|
_selfLockn,
|
||||||
(void*)selfLock_thread_id,
|
(void*)_selfLock_thread_id,
|
||||||
(void*)objc_thread_id());
|
(void*)objc_thread_id());
|
||||||
if (selfLockn>0)
|
if (_selfLockn>0)
|
||||||
{
|
{
|
||||||
if (selfLock_thread_id!=objc_thread_id())
|
if (_selfLock_thread_id!=objc_thread_id())
|
||||||
{
|
{
|
||||||
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
NSDebugMLog0(@"PROBLEM: owner!=thread id");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
TmpUnlock(selfLock);
|
TmpUnlock(_selfLock);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
selfLockn--;
|
_selfLockn--;
|
||||||
if (selfLockn==0)
|
if (_selfLockn==0)
|
||||||
selfLock_thread_id=NULL;
|
_selfLock_thread_id=NULL;
|
||||||
#endif
|
#endif
|
||||||
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
NSDebugMLLog(@"bundles",@"selfLock=%p selfLockn=%d selfLock_thread_id=%p objc_thread_id()=%p",
|
||||||
(void*)selfLock,
|
(void*)_selfLock,
|
||||||
selfLockn,
|
_selfLockn,
|
||||||
(void*)selfLock_thread_id,
|
(void*)_selfLock_thread_id,
|
||||||
(void*)objc_thread_id());
|
(void*)objc_thread_id());
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
@ -502,12 +507,12 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWDeployedBundle (GSWDeployedBundleA)
|
@implementation GSWDeployedBundle (GSWDeployedBundleA)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(id)bundleWithPath:(NSString*)path_
|
+(id)bundleWithPath:(NSString*)aPath
|
||||||
{
|
{
|
||||||
id _bundle=nil;
|
id bundle=nil;
|
||||||
NSDebugMLLog(@"bundles",@"path_=%@",path_);
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
||||||
_bundle=[[[GSWDeployedBundle alloc]initWithPath:path_]autorelease];
|
bundle=[[[GSWDeployedBundle alloc]initWithPath:aPath]autorelease];
|
||||||
return _bundle;
|
return bundle;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWDirectActionRequestHandler.h - GSWeb: Class GSWDirectActionRequestHandler
|
/** GSWDirectActionRequestHandler.h - <title>GSWeb: Class GSWDirectActionRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -31,10 +37,10 @@
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWResponse*)_nilResponse;
|
-(GSWResponse*)_nilResponse;
|
||||||
-(void)_initializeRequestSessionIDInContext:(GSWContext*)context_;
|
-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext;
|
||||||
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)_request;
|
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)aRequest;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWDirectActionRequestHandler.m - GSWeb: Class GSWDirectActionRequestHandler
|
/** GSWDirectActionRequestHandler.m - <title>GSWeb: Class GSWDirectActionRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,96 +35,101 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWDirectActionRequestHandler
|
@implementation GSWDirectActionRequestHandler
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWStatisticsStore* _statisticsStore=nil;
|
GSWStatisticsStore* statisticsStore=nil;
|
||||||
GSWApplication* _application=nil;
|
GSWApplication* application=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_application=[GSWApplication application];
|
application=[GSWApplication application];
|
||||||
if (0/*[_application isRefusingNewSessions]*/)
|
if (0/*[application isRefusingNewSessions]*/)
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
id _submitButtonsActionPathFromRequest=nil;
|
id submitButtonsActionPathFromRequest=nil;
|
||||||
NSArray* _requestHandlerPathArray=nil;
|
NSArray* requestHandlerPathArray=nil;
|
||||||
NSString* _actionName=nil;
|
NSString* actionName=nil;
|
||||||
NSString* _className=nil;
|
NSString* className=nil;
|
||||||
GSWContext* _context=nil;
|
GSWContext* context=nil;
|
||||||
[_application lockRequestHandling];
|
[application lockRequestHandling];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_statisticsStore=[[GSWApplication application]statisticsStore];
|
statisticsStore=[[GSWApplication application]statisticsStore];
|
||||||
[_statisticsStore _applicationWillHandleDirectActionRequest];
|
[statisticsStore _applicationWillHandleDirectActionRequest];
|
||||||
_submitButtonsActionPathFromRequest=[self submitButtonsActionPathFromRequest:request_]; //So what ?
|
submitButtonsActionPathFromRequest=[self submitButtonsActionPathFromRequest:aRequest]; //So what ?
|
||||||
NSDebugMLLog(@"requests",@"_submitButtonsActionPathFromRequest=%@",_submitButtonsActionPathFromRequest);
|
NSDebugMLLog(@"requests",@"submitButtonsActionPathFromRequest=%@",
|
||||||
_requestHandlerPathArray=[request_ requestHandlerPathArray];
|
submitButtonsActionPathFromRequest);
|
||||||
NSDebugMLLog(@"requests",@"_requestHandlerPathArray=%@",_requestHandlerPathArray);
|
requestHandlerPathArray=[aRequest requestHandlerPathArray];
|
||||||
switch([_requestHandlerPathArray count])
|
NSDebugMLLog(@"requests",@"requestHandlerPathArray=%@",
|
||||||
|
requestHandlerPathArray);
|
||||||
|
switch([requestHandlerPathArray count])
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
_actionName=@"default";
|
actionName=@"default";
|
||||||
_className=@"DirectAction";
|
className=@"DirectAction";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
NSString* _tmpActionName=[NSString stringWithFormat:@"%@Action",
|
NSString* tmpActionName=[NSString stringWithFormat:@"%@Action",
|
||||||
[_requestHandlerPathArray objectAtIndex:0]];
|
[requestHandlerPathArray objectAtIndex:0]];
|
||||||
SEL _tmpActionSel=NSSelectorFromString(_tmpActionName);
|
SEL tmpActionSel=NSSelectorFromString(tmpActionName);
|
||||||
Class _class = NSClassFromString(@"DirectAction");
|
Class aClass = NSClassFromString(@"DirectAction");
|
||||||
NSDebugMLLog(@"requests",@"_tmpActionName=%@",_tmpActionName);
|
NSDebugMLLog(@"requests",@"tmpActionName=%@",
|
||||||
if (_tmpActionSel && _class)
|
tmpActionName);
|
||||||
|
if (tmpActionSel && aClass)
|
||||||
{
|
{
|
||||||
if ([_class instancesRespondToSelector:_tmpActionSel])
|
if ([aClass instancesRespondToSelector:tmpActionSel])
|
||||||
{
|
{
|
||||||
_actionName=[_requestHandlerPathArray objectAtIndex:0];
|
actionName=[requestHandlerPathArray objectAtIndex:0];
|
||||||
_className=@"DirectAction";
|
className=@"DirectAction";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_actionName)
|
if (!actionName)
|
||||||
{
|
{
|
||||||
_className=[_requestHandlerPathArray objectAtIndex:0];
|
className=[requestHandlerPathArray objectAtIndex:0];
|
||||||
_actionName=@"default";
|
actionName=@"default";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
_className=[_requestHandlerPathArray objectAtIndex:0];
|
className=[requestHandlerPathArray objectAtIndex:0];
|
||||||
_actionName=[NSString stringWithFormat:@"%@",
|
actionName=[NSString stringWithFormat:@"%@",
|
||||||
[_requestHandlerPathArray objectAtIndex:1]];
|
[requestHandlerPathArray objectAtIndex:1]];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ExceptionRaise0(@"GSWDirectActionRequestHandler",@"bad parameters count");
|
ExceptionRaise0(@"GSWDirectActionRequestHandler",@"bad parameters count");
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"requests",@"_className=%@",_className);
|
NSDebugMLLog(@"requests",@"className=%@",className);
|
||||||
NSDebugMLLog(@"requests",@"_actionName=%@",_actionName);
|
NSDebugMLLog(@"requests",@"actionName=%@",actionName);
|
||||||
if ([_application isCachingEnabled])
|
if ([application isCachingEnabled])
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
GSWResourceManager* _resourceManager=nil;
|
GSWResourceManager* resourceManager=nil;
|
||||||
GSWDeployedBundle* _appBundle=nil;
|
GSWDeployedBundle* appBundle=nil;
|
||||||
GSWDirectAction* _directAction=nil;
|
GSWDirectAction* directAction=nil;
|
||||||
id<GSWActionResults> _actionResult=nil;
|
id<GSWActionResults> actionResult=nil;
|
||||||
Class _class=nil;
|
Class aClass=nil;
|
||||||
_resourceManager=[_application resourceManager];
|
resourceManager=[application resourceManager];
|
||||||
_appBundle=[_resourceManager _appProjectBundle];
|
appBundle=[resourceManager _appProjectBundle];
|
||||||
[_resourceManager _allFrameworkProjectBundles];//So what ?
|
[resourceManager _allFrameworkProjectBundles];//So what ?
|
||||||
[_application awake];
|
[application awake];
|
||||||
_class=NSClassFromString(_className);
|
aClass=NSClassFromString(className);
|
||||||
NSAssert1(_class,@"No direct action class named %@",_className);
|
NSAssert1(aClass,@"No direct action class named %@",
|
||||||
_directAction=[[_class alloc]initWithRequest:request_];
|
className);
|
||||||
NSAssert1(_directAction,@"Direct action of class named %@ can't be created",_className);
|
directAction=[[aClass alloc]initWithRequest:aRequest];
|
||||||
_context=[_directAction _context];
|
NSAssert1(directAction,@"Direct action of class named %@ can't be created",
|
||||||
_actionResult=[_directAction performActionNamed:_actionName];
|
className);
|
||||||
_response=[_actionResult generateResponse];
|
context=[directAction _context];
|
||||||
|
actionResult=[directAction performActionNamed:actionName];
|
||||||
|
response=[actionResult generateResponse];
|
||||||
|
|
||||||
//Finir ?
|
//Finir ?
|
||||||
};
|
};
|
||||||
|
@ -126,70 +137,70 @@ static char rcsId[] = "$Id$";
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||||
if (!_context)
|
if (!context)
|
||||||
_context=[GSWApp _context];
|
context=[GSWApp _context];
|
||||||
_response=[_application handleException:localException
|
response=[application handleException:localException
|
||||||
inContext:_context];
|
inContext:context];
|
||||||
//TODO
|
//TODO
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
RETAIN(_response);
|
RETAIN(response);
|
||||||
if (!_context)
|
if (!context)
|
||||||
_context=[GSWApp _context];
|
context=[GSWApp _context];
|
||||||
[_context _putAwakeComponentsToSleep];
|
[context _putAwakeComponentsToSleep];
|
||||||
[_application saveSessionForContext:_context];
|
[application saveSessionForContext:context];
|
||||||
NSDebugMLLog(@"requests",@"_response=%@",_response);
|
NSDebugMLLog(@"requests",@"response=%@",response);
|
||||||
AUTORELEASE(_response);
|
AUTORELEASE(response);
|
||||||
|
|
||||||
//Here ???
|
//Here ???
|
||||||
[_application sleep];
|
[application sleep];
|
||||||
//TODO do not fnalize if already done (in handleException for exemple)
|
//TODO do not fnalize if already done (in handleException for exemple)
|
||||||
[_response _finalizeInContext:_context];
|
[response _finalizeInContext:context];
|
||||||
[_application _setContext:nil];
|
[application _setContext:nil];
|
||||||
_statisticsStore=[[GSWApplication application] statisticsStore];
|
statisticsStore=[[GSWApplication application] statisticsStore];
|
||||||
[_statisticsStore _applicationDidHandleDirectActionRequestWithActionNamed:_actionName];
|
[statisticsStore _applicationDidHandleDirectActionRequestWithActionNamed:actionName];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||||
[_application unlockRequestHandling];
|
[application unlockRequestHandling];
|
||||||
[localException raise];//TODO
|
[localException raise];//TODO
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[_application unlockRequestHandling];
|
[application unlockRequestHandling];
|
||||||
};
|
};
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)_nilResponse
|
-(GSWResponse*)_nilResponse
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_response=[[GSWResponse new]autorelease];
|
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 appendContentString:@"<HTML><HEAD><TITLE>DirectAction Error</TITLE></HEAD><BODY>The result of a direct action returned nothing.</BODY></HTML>"];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_initializeRequestSessionIDInContext:(GSWContext*)_context
|
-(void)_initializeRequestSessionIDInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)_request
|
-(id)submitButtonsActionPathFromRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSArray* _submitActions=nil;
|
NSArray* submitActions=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_submitActions=[_request formValuesForKey:GSWKey_SubmitAction[GSWebNamingConv]];
|
submitActions=[aRequest formValuesForKey:GSWKey_SubmitAction[GSWebNamingConv]];
|
||||||
if (_submitActions)
|
if (submitActions)
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWDisplayGroup.h - GSWeb: Class GSWDisplayGroup
|
/** GSWDisplayGroup.h - <title>GSWeb: Class GSWDisplayGroup</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -27,46 +33,46 @@
|
||||||
#define _GSWDisplayGroup_h__
|
#define _GSWDisplayGroup_h__
|
||||||
|
|
||||||
#if !GDL2
|
#if !GDL2
|
||||||
#ifndef TCSDB
|
#ifdef TCSDB
|
||||||
#include <eoaccess/EOModel.h>
|
#import <TCSimpleDB/EODefines.h>
|
||||||
#include <eoaccess/EOEntity.h>
|
#import <TCSimpleDB/EODefines.h>
|
||||||
#include <eoaccess/EOAttribute.h>
|
#else // TCSDB
|
||||||
#include <eoaccess/EOAttributeOrdering.h>
|
#include <eoaccess/EOModel.h>
|
||||||
#include <eoaccess/EORelationship.h>
|
#include <eoaccess/EOEntity.h>
|
||||||
#include <eoaccess/EOQualifier.h>
|
#include <eoaccess/EOAttribute.h>
|
||||||
|
#include <eoaccess/EOAttributeOrdering.h>
|
||||||
|
#include <eoaccess/EORelationship.h>
|
||||||
|
#include <eoaccess/EOQualifier.h>
|
||||||
|
|
||||||
#include <eoaccess/EOAdaptor.h>
|
#include <eoaccess/EOAdaptor.h>
|
||||||
#include <eoaccess/EOAdaptorContext.h>
|
#include <eoaccess/EOAdaptorContext.h>
|
||||||
#include <eoaccess/EOAdaptorChannel.h>
|
#include <eoaccess/EOAdaptorChannel.h>
|
||||||
|
|
||||||
#include <eoaccess/EODatabase.h>
|
#include <eoaccess/EODatabase.h>
|
||||||
#include <eoaccess/EODatabaseContext.h>
|
#include <eoaccess/EODatabaseContext.h>
|
||||||
#include <eoaccess/EODatabaseChannel.h>
|
#include <eoaccess/EODatabaseChannel.h>
|
||||||
#include <eoaccess/EODataSources.h>
|
#include <eoaccess/EODataSources.h>
|
||||||
#include <eoaccess/EODatabaseDataSource.h>
|
#include <eoaccess/EODatabaseDataSource.h>
|
||||||
|
|
||||||
#include <eoaccess/EOGenericRecord.h>
|
#include <eoaccess/EOGenericRecord.h>
|
||||||
#include <eoaccess/EONull.h>
|
#include <eoaccess/EONull.h>
|
||||||
#include <eoaccess/EOSQLExpression.h>
|
#include <eoaccess/EOSQLExpression.h>
|
||||||
|
|
||||||
@class EOKeyValueUnarchiver;
|
@class EOKeyValueUnarchiver;
|
||||||
|
|
||||||
#define EODataSource EODatabaseDataSource
|
#define EODataSource EODatabaseDataSource
|
||||||
#else // TCSDB
|
#endif
|
||||||
#import <TCSimpleDB/TCSimpleDB.h>
|
|
||||||
#import <TCSimpleDB/EODefines.h>
|
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#import <EOControl/EOQualifier.h>
|
#import <EOControl/EOQualifier.h>
|
||||||
#import <EOControl/EODataSource.h>
|
#import <EOControl/EODataSource.h>
|
||||||
#import <EOControl/EODetailDataSource.h>
|
#import <EOControl/EODetailDataSource.h>
|
||||||
#import <EOControl/EOKeyValueArchiver.h>
|
#import <EOControl/EOKeyValueArchiver.h>
|
||||||
#import <EOAccess/EODatabaseDataSource.h>
|
#import <EOAccess/EODatabaseDataSource.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@interface GSWDisplayGroup : NSObject <NSCoding>
|
@interface GSWDisplayGroup : NSObject <NSCoding>
|
||||||
{
|
{
|
||||||
id delegate;
|
id _delegate;
|
||||||
/*
|
/*
|
||||||
objects (array) supplied by the EODataSource
|
objects (array) supplied by the EODataSource
|
||||||
EOQualifier and EOSortOrderings to filter the objects for display
|
EOQualifier and EOSortOrderings to filter the objects for display
|
||||||
|
@ -149,17 +155,17 @@
|
||||||
- (unsigned)indexOfLastDisplayedObject;
|
- (unsigned)indexOfLastDisplayedObject;
|
||||||
- (id)init;
|
- (id)init;
|
||||||
- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver*)unarchiver;
|
- (id)initWithKeyValueUnarchiver:(EOKeyValueUnarchiver*)unarchiver;
|
||||||
- (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver*)object_;
|
- (void)awakeFromKeyValueUnarchiver:(EOKeyValueUnarchiver*)object;
|
||||||
- (NSMutableDictionary *)inputObjectForQualifier;
|
- (NSMutableDictionary *)inputObjectForQualifier;
|
||||||
- (BOOL)inQueryMode;
|
- (BOOL)inQueryMode;
|
||||||
- (void)editingContext:(id)editingContext_
|
- (void)editingContext:(id)editingContext
|
||||||
presentErrorMessage:(id)msg;
|
presentErrorMessage:(id)msg;
|
||||||
- (id)insert;
|
- (id)insert;
|
||||||
- (id)insertAfterLastObject;
|
- (id)insertAfterLastObject;
|
||||||
- (NSDictionary *)insertedObjectDefaultValues;
|
- (NSDictionary *)insertedObjectDefaultValues;
|
||||||
- (void)insertObject:object_
|
- (void)insertObject:object
|
||||||
atIndex:(unsigned)index;
|
atIndex:(unsigned)index;
|
||||||
- (id)insertObjectAtIndex:(unsigned)index_;
|
- (id)insertObjectAtIndex:(unsigned)index;
|
||||||
- (EOQualifier *)lastQualifierFromInputValues;
|
- (EOQualifier *)lastQualifierFromInputValues;
|
||||||
- (NSArray *)localKeys;
|
- (NSArray *)localKeys;
|
||||||
- (id)masterObject;
|
- (id)masterObject;
|
||||||
|
@ -190,11 +196,11 @@
|
||||||
- (id)selectPrevious;
|
- (id)selectPrevious;
|
||||||
- (BOOL)selectsFirstObjectAfterFetch;
|
- (BOOL)selectsFirstObjectAfterFetch;
|
||||||
- (void)setBuildsQualifierFromInput:(BOOL)flag;
|
- (void)setBuildsQualifierFromInput:(BOOL)flag;
|
||||||
- (void)setCurrentBatchIndex:(unsigned)index_;
|
- (void)setCurrentBatchIndex:(unsigned)index;
|
||||||
- (void)setDataSource:(EODataSource *)dataSource_;
|
- (void)setDataSource:(EODataSource *)dataSource;
|
||||||
- (void)setDefaultStringMatchFormat:(NSString *)format;
|
- (void)setDefaultStringMatchFormat:(NSString *)format;
|
||||||
- (void)setDefaultStringMatchOperator:(NSString *)operator;
|
- (void)setDefaultStringMatchOperator:(NSString *)operator;
|
||||||
- (void)setDelegate:(id)object_;
|
- (void)setDelegate:(id)object;
|
||||||
- (void)setDetailKey:(NSString *)detailKey;
|
- (void)setDetailKey:(NSString *)detailKey;
|
||||||
- (void)setFetchesOnLoad:(BOOL)flag;
|
- (void)setFetchesOnLoad:(BOOL)flag;
|
||||||
- (void)setInQueryMode:(BOOL)flag;
|
- (void)setInQueryMode:(BOOL)flag;
|
||||||
|
@ -204,7 +210,7 @@
|
||||||
- (void)setMasterObject:(id)masterObject;
|
- (void)setMasterObject:(id)masterObject;
|
||||||
- (void)setNumberOfObjectsPerBatch:(unsigned)count;
|
- (void)setNumberOfObjectsPerBatch:(unsigned)count;
|
||||||
- (void)setObjectArray:(NSArray *)objects;
|
- (void)setObjectArray:(NSArray *)objects;
|
||||||
- (void)setQualifier:(EOQualifier *)qualifier_;
|
- (void)setQualifier:(EOQualifier *)qualifier;
|
||||||
- (BOOL)setSelectionIndexes:(NSArray *)selection;
|
- (BOOL)setSelectionIndexes:(NSArray *)selection;
|
||||||
- (void)setSelectsFirstObjectAfterFetch:(BOOL)flag;
|
- (void)setSelectsFirstObjectAfterFetch:(BOOL)flag;
|
||||||
- (void)setSortOrderings:(NSArray *)orderings;
|
- (void)setSortOrderings:(NSArray *)orderings;
|
||||||
|
@ -219,46 +225,46 @@
|
||||||
|
|
||||||
@interface NSObject (GSWDisplayGroupDelegation)
|
@interface NSObject (GSWDisplayGroupDelegation)
|
||||||
|
|
||||||
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
createObjectFailedForDataSource:(id)dataSource_;
|
createObjectFailedForDataSource:(id)dataSource;
|
||||||
|
|
||||||
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
didDeleteObject:(id)object_;
|
didDeleteObject:(id)object;
|
||||||
|
|
||||||
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
didFetchObjects:(NSArray*)objects;
|
didFetchObjects:(NSArray*)objects;
|
||||||
|
|
||||||
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
didInsertObject:object_;
|
didInsertObject:(id)object;
|
||||||
|
|
||||||
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(void)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
didSetValue:(id)value
|
didSetValue:(id)value
|
||||||
forObject:(id)object_
|
forObject:(id)object
|
||||||
key:(NSString*)key;
|
key:(NSString*)key;
|
||||||
|
|
||||||
-(NSArray*)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(NSArray*)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
displayArrayForObjects:(NSArray*)objects;
|
displayArrayForObjects:(NSArray*)objects;
|
||||||
|
|
||||||
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
shouldChangeSelectionToIndexes:(NSArray*)newIndexes;
|
shouldChangeSelectionToIndexes:(NSArray*)newIndexes;
|
||||||
|
|
||||||
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
shouldInsertObject:object_
|
shouldInsertObject:object
|
||||||
atIndex:(unsigned)index_;
|
atIndex:(unsigned)index;
|
||||||
|
|
||||||
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
shouldDeleteObject:object;
|
shouldDeleteObject:object;
|
||||||
|
|
||||||
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
shouldRedisplayForEditingContextChangeNotification:(NSNotification*)notification_;
|
shouldRedisplayForEditingContextChangeNotification:(NSNotification*)notification;
|
||||||
|
|
||||||
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
|
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
|
||||||
shouldRefetchForInvalidatedAllObjectsNotification:(NSNotification*)notification_;
|
shouldRefetchForInvalidatedAllObjectsNotification:(NSNotification*)notification;
|
||||||
|
|
||||||
-(void)displayGroupDidChangeDataSource:(GSWDisplayGroup*)displayGroup_;
|
-(void)displayGroupDidChangeDataSource:(GSWDisplayGroup*)displayGroup;
|
||||||
-(void)displayGroupDidChangeSelectedObjects:(GSWDisplayGroup*)displayGroup_;
|
-(void)displayGroupDidChangeSelectedObjects:(GSWDisplayGroup*)displayGroup;
|
||||||
-(void)displayGroupDidChangeSelection:(GSWDisplayGroup*)displayGroup_;
|
-(void)displayGroupDidChangeSelection:(GSWDisplayGroup*)displayGroup;
|
||||||
-(BOOL)displayGroupShouldFetch:(GSWDisplayGroup*)displayGroup_;
|
-(BOOL)displayGroupShouldFetch:(GSWDisplayGroup*)displayGroup;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
/* GSWDisplayGroup.m - GSWeb: Class GSWDisplayGroup
|
/** GSWDisplayGroup.m - <title>GSWeb: Class GSWDisplayGroup</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -312,7 +318,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
return qualifier;
|
return qualifier;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(BOOL)_deleteObjectsAtIndexes:(id)indexes_
|
-(BOOL)_deleteObjectsAtIndexes:(id)indexes
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -321,7 +327,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(BOOL)_deleteObject:(id)object_
|
-(BOOL)_deleteObject:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -338,7 +344,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(void)_lastObserverNotified:(id)object_
|
-(void)_lastObserverNotified:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -346,7 +352,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(void)_beginObserverNotification:(id)object_
|
-(void)_beginObserverNotification:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -362,7 +368,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-(void)_notifyRowChanged:(int)row_
|
-(void)_notifyRowChanged:(int)row
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
//-1 ==> nil ?
|
//-1 ==> nil ?
|
||||||
|
@ -372,18 +378,18 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-(id)_notify:(SEL)selector_
|
-(id)_notify:(SEL)selector
|
||||||
with:(id)object1
|
with:(id)object1
|
||||||
with:(id)object2
|
with:(id)object2
|
||||||
|
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
//TODOFN
|
//TODOFN
|
||||||
if (selector_==@selector(displayGroup:didFetchObjects:)) //TODO ????
|
if (selector==@selector(displayGroup:didFetchObjects:)) //TODO ????
|
||||||
{
|
{
|
||||||
//Do it on object1
|
//Do it on object1
|
||||||
if(_delegateRespondsTo.didFetchObjects)
|
if(_delegateRespondsTo.didFetchObjects)
|
||||||
[delegate displayGroup:object1
|
[_delegate displayGroup:object1
|
||||||
didFetchObjects:object2];
|
didFetchObjects:object2];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -395,8 +401,8 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(id)_notify:(SEL)selector_
|
-(id)_notify:(SEL)selector
|
||||||
with:(id)object_
|
with:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -422,7 +428,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
-(void)objectsChangedInEditingContext:(id)object_
|
-(void)objectsChangedInEditingContext:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -436,7 +442,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
if(_delegateRespondsTo.shouldRedisplay == YES)
|
if(_delegateRespondsTo.shouldRedisplay == YES)
|
||||||
redisplay = [delegate displayGroup:self
|
redisplay = [_delegate displayGroup:self
|
||||||
shouldRedisplayForEditingContextChangeNotification:notification];
|
shouldRedisplayForEditingContextChangeNotification:notification];
|
||||||
|
|
||||||
if(redisplay == YES)
|
if(redisplay == YES)
|
||||||
|
@ -450,7 +456,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
if(_delegateRespondsTo.shouldRefetchObjects == YES)
|
if(_delegateRespondsTo.shouldRefetchObjects == YES)
|
||||||
refetch = [delegate displayGroup:self
|
refetch = [_delegate displayGroup:self
|
||||||
shouldRefetchForInvalidatedAllObjectsNotification:
|
shouldRefetchForInvalidatedAllObjectsNotification:
|
||||||
notification];
|
notification];
|
||||||
|
|
||||||
|
@ -464,7 +470,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
{
|
{
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
|
||||||
delegate = nil;
|
_delegate = nil;
|
||||||
|
|
||||||
DESTROY(_dataSource);
|
DESTROY(_dataSource);
|
||||||
|
|
||||||
|
@ -574,7 +580,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setDataSource:
|
// setDataSource:
|
||||||
|
|
||||||
- (void)setDataSource:(EODataSource *)dataSource_
|
- (void)setDataSource:(EODataSource *)dataSource
|
||||||
{
|
{
|
||||||
EOEditingContext *context=nil;
|
EOEditingContext *context=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
@ -587,7 +593,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[context setMessageHandler:nil];
|
[context setMessageHandler:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSIGN(_dataSource, dataSource_);
|
ASSIGN(_dataSource,dataSource);
|
||||||
|
|
||||||
context = [_dataSource editingContext];
|
context = [_dataSource editingContext];
|
||||||
[context addEditor:self];
|
[context addEditor:self];
|
||||||
|
@ -597,7 +603,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[_displayedObjects removeAllObjects];
|
[_displayedObjects removeAllObjects];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didChangeDataSource == YES)
|
if(_delegateRespondsTo.didChangeDataSource == YES)
|
||||||
[delegate displayGroupDidChangeDataSource:self];
|
[_delegate displayGroupDidChangeDataSource:self];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,47 +628,47 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
- (id)delegate
|
- (id)delegate
|
||||||
{
|
{
|
||||||
return delegate;
|
return _delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setDelegate:
|
// setDelegate:
|
||||||
|
|
||||||
- (void)setDelegate:(id)delegate_
|
- (void)setDelegate:(id)delegate
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
delegate = delegate_;
|
_delegate = delegate;
|
||||||
|
|
||||||
_delegateRespondsTo.createObjectFailed =
|
_delegateRespondsTo.createObjectFailed =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:createObjectFailedForDataSource:)];
|
[_delegate respondsToSelector:@selector(displayGroup:createObjectFailedForDataSource:)];
|
||||||
_delegateRespondsTo.didDeleteObject =
|
_delegateRespondsTo.didDeleteObject =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:didDeleteObject:)];
|
[_delegate respondsToSelector:@selector(displayGroup:didDeleteObject:)];
|
||||||
_delegateRespondsTo.didFetchObjects =
|
_delegateRespondsTo.didFetchObjects =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:didFetchObjects:)];
|
[_delegate respondsToSelector:@selector(displayGroup:didFetchObjects:)];
|
||||||
_delegateRespondsTo.didInsertObject =
|
_delegateRespondsTo.didInsertObject =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:didInsertObject:)];
|
[_delegate respondsToSelector:@selector(displayGroup:didInsertObject:)];
|
||||||
_delegateRespondsTo.didSetValueForObject =
|
_delegateRespondsTo.didSetValueForObject =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:didSetValue:forObject:key:)];
|
[_delegate respondsToSelector:@selector(displayGroup:didSetValue:forObject:key:)];
|
||||||
_delegateRespondsTo.displayArrayForObjects =
|
_delegateRespondsTo.displayArrayForObjects =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:displayArrayForObjects:)];
|
[_delegate respondsToSelector:@selector(displayGroup:displayArrayForObjects:)];
|
||||||
_delegateRespondsTo.shouldChangeSelection =
|
_delegateRespondsTo.shouldChangeSelection =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:shouldChangeSelectionToIndexes:)];
|
[_delegate respondsToSelector:@selector(displayGroup:shouldChangeSelectionToIndexes:)];
|
||||||
_delegateRespondsTo.shouldInsertObject =
|
_delegateRespondsTo.shouldInsertObject =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:shouldInsertObject:atIndex:)];
|
[_delegate respondsToSelector:@selector(displayGroup:shouldInsertObject:atIndex:)];
|
||||||
_delegateRespondsTo.shouldDeleteObject =
|
_delegateRespondsTo.shouldDeleteObject =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:shouldDeleteObject:)];
|
[_delegate respondsToSelector:@selector(displayGroup:shouldDeleteObject:)];
|
||||||
_delegateRespondsTo.shouldRedisplay =
|
_delegateRespondsTo.shouldRedisplay =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:shouldRedisplayForEditingContextChangeNotification:)];
|
[_delegate respondsToSelector:@selector(displayGroup:shouldRedisplayForEditingContextChangeNotification:)];
|
||||||
_delegateRespondsTo.shouldRefetchObjects =
|
_delegateRespondsTo.shouldRefetchObjects =
|
||||||
[delegate respondsToSelector:@selector(displayGroup:shouldRefetchForInvalidatedAllObjectsNotification:)];
|
[_delegate respondsToSelector:@selector(displayGroup:shouldRefetchForInvalidatedAllObjectsNotification:)];
|
||||||
_delegateRespondsTo.didChangeDataSource =
|
_delegateRespondsTo.didChangeDataSource =
|
||||||
[delegate respondsToSelector:@selector(displayGroupDidChangeDataSource:)];
|
[_delegate respondsToSelector:@selector(displayGroupDidChangeDataSource:)];
|
||||||
_delegateRespondsTo.didChangeSelectedObjects =
|
_delegateRespondsTo.didChangeSelectedObjects =
|
||||||
[delegate respondsToSelector:@selector(displayGroupDidChangeSelectedObjects:)];
|
[_delegate respondsToSelector:@selector(displayGroupDidChangeSelectedObjects:)];
|
||||||
_delegateRespondsTo.didChangeSelection =
|
_delegateRespondsTo.didChangeSelection =
|
||||||
[delegate respondsToSelector:@selector(displayGroupDidChangeSelection:)];
|
[_delegate respondsToSelector:@selector(displayGroupDidChangeSelection:)];
|
||||||
_delegateRespondsTo.shouldFetchObjects =
|
_delegateRespondsTo.shouldFetchObjects =
|
||||||
[delegate respondsToSelector:@selector(displayGroupShouldFetch:)];
|
[_delegate respondsToSelector:@selector(displayGroupShouldFetch:)];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -689,7 +695,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
object = [_allObjects objectAtIndex:index];
|
object = [_allObjects objectAtIndex:index];
|
||||||
|
|
||||||
if(_delegateRespondsTo.shouldDeleteObject == YES)
|
if(_delegateRespondsTo.shouldDeleteObject == YES)
|
||||||
delete = [delegate displayGroup:self shouldDeleteObject:object];
|
delete = [_delegate displayGroup:self shouldDeleteObject:object];
|
||||||
|
|
||||||
if(delete)
|
if(delete)
|
||||||
{
|
{
|
||||||
|
@ -701,7 +707,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[_allObjects removeObjectIdenticalTo:object];
|
[_allObjects removeObjectIdenticalTo:object];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didDeleteObject == YES)
|
if(_delegateRespondsTo.didDeleteObject == YES)
|
||||||
[delegate displayGroup:self didDeleteObject:object];
|
[_delegate displayGroup:self didDeleteObject:object];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -738,7 +744,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
while((object = [enumerator nextObject]))
|
while((object = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
if(_delegateRespondsTo.shouldDeleteObject == YES)
|
if(_delegateRespondsTo.shouldDeleteObject == YES)
|
||||||
delete = [delegate displayGroup:self
|
delete = [_delegate displayGroup:self
|
||||||
shouldDeleteObject:object];
|
shouldDeleteObject:object];
|
||||||
|
|
||||||
if(delete == NO)
|
if(delete == NO)
|
||||||
|
@ -757,7 +763,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[_allObjects removeObjectIdenticalTo:object];
|
[_allObjects removeObjectIdenticalTo:object];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didDeleteObject == YES)
|
if(_delegateRespondsTo.didDeleteObject == YES)
|
||||||
[delegate displayGroup:self
|
[_delegate displayGroup:self
|
||||||
didDeleteObject:object];
|
didDeleteObject:object];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -938,7 +944,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[_dataSource setQualifierBindings:_queryBindings];
|
[_dataSource setQualifierBindings:_queryBindings];
|
||||||
|
|
||||||
if(_delegateRespondsTo.shouldFetchObjects == YES)
|
if(_delegateRespondsTo.shouldFetchObjects == YES)
|
||||||
fetch = [delegate displayGroupShouldFetch:self];
|
fetch = [_delegate displayGroupShouldFetch:self];
|
||||||
|
|
||||||
if(fetch)
|
if(fetch)
|
||||||
{
|
{
|
||||||
|
@ -1034,7 +1040,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)editingContext:(id)editingContext_
|
-(void)editingContext:(id)editingContext
|
||||||
presentErrorMessage:(id)msg
|
presentErrorMessage:(id)msg
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
@ -1090,7 +1096,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if(_delegateRespondsTo.shouldInsertObject == YES)
|
if(_delegateRespondsTo.shouldInsertObject == YES)
|
||||||
insert = [delegate displayGroup:self
|
insert = [_delegate displayGroup:self
|
||||||
shouldInsertObject:anObject
|
shouldInsertObject:anObject
|
||||||
atIndex:index];
|
atIndex:index];
|
||||||
|
|
||||||
|
@ -1105,7 +1111,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
[self setCurrentBatchIndex:_batchIndex];
|
[self setCurrentBatchIndex:_batchIndex];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didInsertObject == YES)
|
if(_delegateRespondsTo.didInsertObject == YES)
|
||||||
[delegate displayGroup:self
|
[_delegate displayGroup:self
|
||||||
didInsertObject:anObject];
|
didInsertObject:anObject];
|
||||||
|
|
||||||
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
|
[self setSelectionIndexes:[NSArray arrayWithObject:[NSNumber numberWithUnsignedInt:index]]];
|
||||||
|
@ -1127,7 +1133,7 @@ Description: <EOKeyValueUnarchiver: 0x1a84d20>
|
||||||
if(object == nil)
|
if(object == nil)
|
||||||
{
|
{
|
||||||
if(_delegateRespondsTo.createObjectFailed == YES)
|
if(_delegateRespondsTo.createObjectFailed == YES)
|
||||||
[delegate displayGroup:self
|
[_delegate displayGroup:self
|
||||||
createObjectFailedForDataSource:_dataSource];
|
createObjectFailedForDataSource:_dataSource];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1660,20 +1666,20 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setCurrentBatchIndex:
|
// setCurrentBatchIndex:
|
||||||
|
|
||||||
- (void)setCurrentBatchIndex:(unsigned)index_
|
- (void)setCurrentBatchIndex:(unsigned)index
|
||||||
{
|
{
|
||||||
unsigned batchCount, num;
|
unsigned batchCount, num;
|
||||||
int i;
|
int i;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
if(index_)
|
if(index)
|
||||||
{
|
{
|
||||||
[_displayedObjects removeAllObjects];
|
[_displayedObjects removeAllObjects];
|
||||||
|
|
||||||
batchCount = [self batchCount];
|
batchCount = [self batchCount];
|
||||||
NSLog(@"setCurrentBatchIndex : [self batchCount] = %d", [self batchCount]);
|
NSLog(@"setCurrentBatchIndex : [self batchCount] = %d", [self batchCount]);
|
||||||
if(index_ > batchCount)
|
if(index > batchCount)
|
||||||
index_ = 1;
|
index = 1;
|
||||||
|
|
||||||
num = [_allObjects count];
|
num = [_allObjects count];
|
||||||
NSLog(@"setCurrentBatchIndex : [_allObjects count] = %d", [_allObjects count]);
|
NSLog(@"setCurrentBatchIndex : [_allObjects count] = %d", [_allObjects count]);
|
||||||
|
@ -1683,11 +1689,11 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
|
||||||
|
|
||||||
if(num)
|
if(num)
|
||||||
{
|
{
|
||||||
NSLog(@"setCurrentBatchIndex : index_ = %d", index_);
|
NSLog(@"setCurrentBatchIndex : index = %d", index);
|
||||||
NSLog(@"setCurrentBatchIndex : num = %d", num);
|
NSLog(@"setCurrentBatchIndex : num = %d", num);
|
||||||
|
|
||||||
for( i = (index_-1) * num;
|
for( i = (index-1) * num;
|
||||||
((i < index_ * num) && (i < [_allObjects count]));
|
((i < index * num) && (i < [_allObjects count]));
|
||||||
i++)
|
i++)
|
||||||
[_displayedObjects addObject:[_allObjects objectAtIndex: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();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
|
@ -1879,10 +1885,10 @@ self setSelectionIndexes:indexes of objects in objects? //ret 1
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// setQualifier:
|
// setQualifier:
|
||||||
|
|
||||||
- (void)setQualifier:(EOQualifier *)qualifier_
|
- (void)setQualifier:(EOQualifier *)qualifier
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(_qualifier, qualifier_);
|
ASSIGN(_qualifier, qualifier);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1948,7 +1954,7 @@ STOP ?
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
//call selectedObjects //
|
//call selectedObjects //
|
||||||
if(_delegateRespondsTo.shouldChangeSelection == YES
|
if(_delegateRespondsTo.shouldChangeSelection == YES
|
||||||
&& [delegate displayGroup:self
|
&& [_delegate displayGroup:self
|
||||||
shouldChangeSelectionToIndexes:selection_] == NO)
|
shouldChangeSelectionToIndexes:selection_] == NO)
|
||||||
retValue=NO;
|
retValue=NO;
|
||||||
else
|
else
|
||||||
|
@ -1983,10 +1989,10 @@ STOP ?
|
||||||
ASSIGN(_selection, selection_);
|
ASSIGN(_selection, selection_);
|
||||||
|
|
||||||
if(_delegateRespondsTo.didChangeSelection == YES)
|
if(_delegateRespondsTo.didChangeSelection == YES)
|
||||||
[delegate displayGroupDidChangeSelection:self];
|
[_delegate displayGroupDidChangeSelection:self];
|
||||||
|
|
||||||
if(_delegateRespondsTo.didChangeSelectedObjects == YES)
|
if(_delegateRespondsTo.didChangeSelectedObjects == YES)
|
||||||
[delegate displayGroupDidChangeSelectedObjects:self];
|
[_delegate displayGroupDidChangeSelectedObjects:self];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -2052,7 +2058,7 @@ STOP ?
|
||||||
|
|
||||||
if(_delegateRespondsTo.displayArrayForObjects == YES)
|
if(_delegateRespondsTo.displayArrayForObjects == YES)
|
||||||
{
|
{
|
||||||
[_displayedObjects addObjectsFromArray:[delegate displayGroup:self
|
[_displayedObjects addObjectsFromArray:[_delegate displayGroup:self
|
||||||
displayArrayForObjects:_allObjects]];
|
displayArrayForObjects:_allObjects]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWDynamicURLString.h - GSWeb: Class GSWDynamicURLString
|
/** GSWDynamicURLString.h - <title>GSWeb: Class GSWDynamicURLString</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,18 +36,18 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWDynamicURLString : NSObject <NSCoding,NSCopying/*,NSMutableString*/>
|
@interface GSWDynamicURLString : NSObject <NSCoding,NSCopying/*,NSMutableString*/>
|
||||||
{
|
{
|
||||||
NSMutableString* url;
|
NSMutableString* _url;
|
||||||
NSString* protocol;//NDFN
|
NSString* _protocol;//NDFN
|
||||||
NSString* host;//NDFN
|
NSString* _host;//NDFN
|
||||||
int port;//NDFN
|
int _port;//NDFN
|
||||||
NSString* prefix;
|
NSString* _prefix;
|
||||||
NSString* applicationName;
|
NSString* _applicationName;
|
||||||
NSString* applicationNumberString;
|
NSString* _applicationNumberString;
|
||||||
NSString* requestHandlerKey;
|
NSString* _requestHandlerKey;
|
||||||
NSString* queryString;
|
NSString* _queryString;
|
||||||
NSString* requestHandlerPath;
|
NSString* _requestHandlerPath;
|
||||||
int applicationNumber;
|
int _applicationNumber;
|
||||||
BOOL composed;
|
BOOL _composed;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)init;
|
-(id)init;
|
||||||
|
@ -65,14 +71,14 @@
|
||||||
-(id)initWithContentsOfFile:(NSString*)path;
|
-(id)initWithContentsOfFile:(NSString*)path;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
|
|
||||||
-(id)initWithCoder:(NSCoder*)coder_;
|
-(id)initWithCoder:(NSCoder*)coder;
|
||||||
-(void)encodeWithCoder:(NSCoder*)coder_;
|
-(void)encodeWithCoder:(NSCoder*)coder;
|
||||||
|
|
||||||
-(id)copyWithZone:(NSZone*)zone_;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
|
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(void)forwardInvocation:(NSInvocation*)invocation_;
|
-(void)forwardInvocation:(NSInvocation*)invocation;
|
||||||
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector_;
|
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -99,15 +105,15 @@
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWDynamicURLString (GSWDynamicURLStringSet)
|
@interface GSWDynamicURLString (GSWDynamicURLStringSet)
|
||||||
-(void)setURLRequestHandlerPath:(NSString*)string_;
|
-(void)setURLRequestHandlerPath:(NSString*)aString;
|
||||||
-(void)setURLQueryString:(NSString*)string_;
|
-(void)setURLQueryString:(NSString*)aString;
|
||||||
-(void)setURLRequestHandlerKey:(NSString*)string_;
|
-(void)setURLRequestHandlerKey:(NSString*)aString;
|
||||||
-(void)setURLApplicationNumber:(int)applicationNumber_;
|
-(void)setURLApplicationNumber:(int)applicationNumber;
|
||||||
-(void)setURLApplicationName:(NSString*)string_;
|
-(void)setURLApplicationName:(NSString*)aString;
|
||||||
-(void)setURLPrefix:(NSString*)string_;
|
-(void)setURLPrefix:(NSString*)aString;
|
||||||
-(void)setURLProtocol:(NSString*)string_;//NDFN
|
-(void)setURLProtocol:(NSString*)aString;//NDFN
|
||||||
-(void)setURLHost:(NSString*)string_;//NDFN
|
-(void)setURLHost:(NSString*)aString;//NDFN
|
||||||
-(void)setURLPortString:(NSString*)string_;//NDFN
|
-(void)setURLPortString:(NSString*)aString;//NDFN
|
||||||
-(void)setURLPort:(int)port_;//NDFN
|
-(void)setURLPort:(int)port_;//NDFN
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWDynamicURLString.m - GSWeb: Class GSWDynamicURLString
|
/** GSWDynamicURLString.m - <title>GSWeb: Class GSWDynamicURLString</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -35,8 +41,8 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[NSMutableString new];
|
_url=[NSMutableString new];
|
||||||
NSDebugMLLog(@"low",@"url class=%@",[url class]);
|
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -51,7 +57,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
|
_url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
|
||||||
length:length
|
length:length
|
||||||
freeWhenDone:flag];
|
freeWhenDone:flag];
|
||||||
if (chars)
|
if (chars)
|
||||||
|
@ -70,7 +76,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithCharacters:chars
|
_url=[[NSMutableString alloc]initWithCharacters:chars
|
||||||
length:length];
|
length:length];
|
||||||
if (chars)
|
if (chars)
|
||||||
[self _parse];
|
[self _parse];
|
||||||
|
@ -88,7 +94,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
|
_url=[[NSMutableString alloc]initWithCStringNoCopy:byteString
|
||||||
length:length
|
length:length
|
||||||
freeWhenDone:flag];
|
freeWhenDone:flag];
|
||||||
if (byteString)
|
if (byteString)
|
||||||
|
@ -106,14 +112,14 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithCString:byteString
|
_url=[[NSMutableString alloc]initWithCString:byteString
|
||||||
length:length];
|
length:length];
|
||||||
NSDebugMLLog(@"low",@"url=%@",url);
|
NSDebugMLLog(@"low",@"url=%@",_url);
|
||||||
NSDebugMLLog(@"low",@"url class=%@",[url class]);
|
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
|
||||||
if (byteString)
|
if (byteString)
|
||||||
[self _parse];
|
[self _parse];
|
||||||
NSDebugMLLog(@"low",@"url=%@",url);
|
NSDebugMLLog(@"low",@"url=%@",_url);
|
||||||
NSDebugMLLog(@"low",@"url class=%@",[url class]);
|
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -127,11 +133,11 @@ static char rcsId[] = "$Id$";
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"byteString=%s",byteString);
|
NSDebugMLLog(@"low",@"byteString=%s",byteString);
|
||||||
url=[[NSMutableString alloc]initWithCString:byteString];
|
_url=[[NSMutableString alloc]initWithCString:byteString];
|
||||||
if (byteString)
|
if (byteString)
|
||||||
[self _parse];
|
[self _parse];
|
||||||
NSDebugMLLog(@"low",@"url=%@",url);
|
NSDebugMLLog(@"low",@"url=%@",_url);
|
||||||
NSDebugMLLog(@"low",@"url class=%@",[url class]);
|
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -144,7 +150,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithString:string];
|
_url=[[NSMutableString alloc]initWithString:string];
|
||||||
if (string)
|
if (string)
|
||||||
[self _parse];
|
[self _parse];
|
||||||
};
|
};
|
||||||
|
@ -161,7 +167,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap,format);
|
va_start(ap,format);
|
||||||
url=[[NSMutableString alloc]initWithFormat:format
|
_url=[[NSMutableString alloc]initWithFormat:format
|
||||||
arguments:ap];
|
arguments:ap];
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
[self _parse];
|
[self _parse];
|
||||||
|
@ -178,7 +184,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithFormat:format
|
_url=[[NSMutableString alloc]initWithFormat:format
|
||||||
arguments:argList];
|
arguments:argList];
|
||||||
[self _parse];
|
[self _parse];
|
||||||
};
|
};
|
||||||
|
@ -194,7 +200,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithData:data
|
_url=[[NSMutableString alloc]initWithData:data
|
||||||
encoding:encoding];
|
encoding:encoding];
|
||||||
if (data)
|
if (data)
|
||||||
[self _parse];
|
[self _parse];
|
||||||
|
@ -210,7 +216,7 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
url=[[NSMutableString alloc]initWithContentsOfFile:path];
|
_url=[[NSMutableString alloc]initWithContentsOfFile:path];
|
||||||
[self _parse];
|
[self _parse];
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -220,60 +226,60 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
DESTROY(url);
|
DESTROY(_url);
|
||||||
DESTROY(prefix);
|
DESTROY(_prefix);
|
||||||
DESTROY(applicationName);
|
DESTROY(_applicationName);
|
||||||
DESTROY(applicationNumberString);
|
DESTROY(_applicationNumberString);
|
||||||
DESTROY(requestHandlerKey);
|
DESTROY(_requestHandlerKey);
|
||||||
DESTROY(queryString);
|
DESTROY(_queryString);
|
||||||
DESTROY(requestHandlerPath);
|
DESTROY(_requestHandlerPath);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithCoder:(NSCoder*)coder_
|
-(id)initWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
if ((self = [super initWithCoder:coder_]))
|
if ((self = [super initWithCoder:coder]))
|
||||||
{
|
{
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&url];
|
at:&_url];
|
||||||
composed=YES;
|
_composed=YES;
|
||||||
[self _parse];
|
[self _parse];
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)encodeWithCoder:(NSCoder*)coder_
|
-(void)encodeWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: coder_];
|
[super encodeWithCoder:coder];
|
||||||
[self _compose];
|
[self _compose];
|
||||||
[coder_ encodeObject:url];
|
[coder encodeObject:_url];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone_
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
GSWDynamicURLString* clone = nil;
|
GSWDynamicURLString* clone = nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"low",@"url class=%@",[url class]);
|
NSDebugMLLog(@"low",@"url class=%@",[_url class]);
|
||||||
clone=[[isa allocWithZone:zone_] init];
|
clone=[[isa allocWithZone:zone] init];
|
||||||
if (clone)
|
if (clone)
|
||||||
{
|
{
|
||||||
DESTROY(clone->url);
|
DESTROY(clone->_url);
|
||||||
clone->url=[url mutableCopyWithZone:zone_];
|
clone->_url=[_url mutableCopyWithZone:zone];
|
||||||
NSDebugMLLog(@"low",@"clone->url class=%@",[clone->url class]);
|
NSDebugMLLog(@"low",@"clone->_url class=%@",[clone->_url class]);
|
||||||
ASSIGNCOPY(clone->protocol,protocol);
|
ASSIGNCOPY(clone->_protocol,_protocol);
|
||||||
ASSIGNCOPY(clone->host,host);
|
ASSIGNCOPY(clone->_host,_host);
|
||||||
clone->port=port;
|
clone->_port=_port;
|
||||||
ASSIGNCOPY(clone->prefix,prefix);
|
ASSIGNCOPY(clone->_prefix,_prefix);
|
||||||
ASSIGNCOPY(clone->applicationName,applicationName);
|
ASSIGNCOPY(clone->_applicationName,_applicationName);
|
||||||
ASSIGNCOPY(clone->applicationNumberString,applicationNumberString);
|
ASSIGNCOPY(clone->_applicationNumberString,_applicationNumberString);
|
||||||
ASSIGNCOPY(clone->requestHandlerKey,requestHandlerKey);
|
ASSIGNCOPY(clone->_requestHandlerKey,_requestHandlerKey);
|
||||||
ASSIGNCOPY(clone->queryString,queryString);
|
ASSIGNCOPY(clone->_queryString,_queryString);
|
||||||
ASSIGNCOPY(clone->requestHandlerPath,requestHandlerPath);
|
ASSIGNCOPY(clone->_requestHandlerPath,_requestHandlerPath);
|
||||||
clone->applicationNumber=applicationNumber;
|
clone->_applicationNumber=_applicationNumber;
|
||||||
clone->composed=composed;
|
clone->_composed=_composed;
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return clone;
|
return clone;
|
||||||
|
@ -284,26 +290,26 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
[self _compose];
|
[self _compose];
|
||||||
return url;
|
return _url;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)forwardInvocation:(NSInvocation*)invocation_
|
-(void)forwardInvocation:(NSInvocation*)invocation
|
||||||
{
|
{
|
||||||
NSString* _urlBackup=nil;
|
NSString* urlBackup=nil;
|
||||||
if (!composed)
|
if (!_composed)
|
||||||
[self _compose];
|
[self _compose];
|
||||||
_urlBackup=[url copy];
|
urlBackup=[_url copy];
|
||||||
[invocation_ invokeWithTarget:url];
|
[invocation invokeWithTarget:_url];
|
||||||
if (![url isEqualToString:_urlBackup])
|
if (![_url isEqualToString:urlBackup])
|
||||||
[self _parse];
|
[self _parse];
|
||||||
[_urlBackup release];
|
[urlBackup release];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector_
|
-(NSMethodSignature*)methodSignatureForSelector:(SEL)selector
|
||||||
{
|
{
|
||||||
return [url methodSignatureForSelector:selector_];
|
return [_url methodSignatureForSelector:selector];
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -312,63 +318,65 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWDynamicURLString (GSWDynamicURLStringParsing)
|
@implementation GSWDynamicURLString (GSWDynamicURLStringParsing)
|
||||||
-(void)_compose
|
-(void)_compose
|
||||||
{
|
{
|
||||||
if (!composed)
|
if (!_composed)
|
||||||
{
|
{
|
||||||
if (url)
|
if (_url)
|
||||||
{
|
{
|
||||||
int _length=[url length];
|
int length=[_url length];
|
||||||
NSDebugMLLog(@"low",@"url %@ class=%@",url,[url class]);
|
NSDebugMLLog(@"low",@"url %@ class=%@",_url,[_url class]);
|
||||||
if (_length>0)
|
if (length>0)
|
||||||
[url deleteCharactersInRange:NSMakeRange(0,_length)];
|
[_url deleteCharactersInRange:NSMakeRange(0,length)];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
url=[NSMutableString new];
|
_url=[NSMutableString new];
|
||||||
if (protocol)
|
if (_protocol)
|
||||||
{
|
{
|
||||||
if (host)
|
if (_host)
|
||||||
[url appendFormat:@"%@://",protocol];
|
[_url appendFormat:@"%@://",_protocol];
|
||||||
else if (port)
|
else if (_port)
|
||||||
[url appendFormat:@"%@://localhost",protocol];
|
[_url appendFormat:@"%@://localhost",_protocol];
|
||||||
else if (prefix)
|
else if (_prefix)
|
||||||
[url appendFormat:@"%@:/",protocol];
|
[_url appendFormat:@"%@:/",_protocol];
|
||||||
else
|
else
|
||||||
[url appendFormat:@"%@://",protocol];
|
[_url appendFormat:@"%@://",_protocol];
|
||||||
};
|
};
|
||||||
if (host)
|
if (_host)
|
||||||
[url appendString:host];
|
[_url appendString:_host];
|
||||||
if (port)
|
if (_port)
|
||||||
[url appendFormat:@":%d",port];
|
[_url appendFormat:@":%d",_port];
|
||||||
if (prefix)
|
if (_prefix)
|
||||||
[url appendFormat:@"%@/",prefix];
|
[_url appendFormat:@"%@/",_prefix];
|
||||||
if (applicationName)
|
if (_applicationName)
|
||||||
[url appendFormat:@"%@.%@/",applicationName,GSWApplicationSuffix[GSWebNamingConv]];
|
[_url appendFormat:@"%@.%@/",
|
||||||
if (applicationNumber>=0)
|
_applicationName,
|
||||||
[url appendFormat:@"%d/",applicationNumber];
|
GSWApplicationSuffix[GSWebNamingConv]];
|
||||||
if (requestHandlerKey)
|
if (_applicationNumber>=0)
|
||||||
[url appendFormat:@"%@/",requestHandlerKey];
|
[_url appendFormat:@"%d/",_applicationNumber];
|
||||||
if (requestHandlerPath)
|
if (_requestHandlerKey)
|
||||||
[url appendFormat:@"%@",requestHandlerPath];
|
[_url appendFormat:@"%@/",_requestHandlerKey];
|
||||||
if (queryString)
|
if (_requestHandlerPath)
|
||||||
[url appendFormat:@"?%@",queryString];
|
[_url appendFormat:@"%@",_requestHandlerPath];
|
||||||
NSDebugMLLog(@"low",@"url %@ class=%@",url,[url class]);
|
if (_queryString)
|
||||||
|
[_url appendFormat:@"?%@",_queryString];
|
||||||
|
NSDebugMLLog(@"low",@"url %@ class=%@",_url,[_url class]);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_parse
|
-(void)_parse
|
||||||
{
|
{
|
||||||
DESTROY(prefix);
|
DESTROY(_prefix);
|
||||||
DESTROY(applicationName);
|
DESTROY(_applicationName);
|
||||||
DESTROY(applicationNumberString);
|
DESTROY(_applicationNumberString);
|
||||||
DESTROY(requestHandlerKey);
|
DESTROY(_requestHandlerKey);
|
||||||
DESTROY(queryString);
|
DESTROY(_queryString);
|
||||||
DESTROY(requestHandlerPath);
|
DESTROY(_requestHandlerPath);
|
||||||
applicationNumber=-1;
|
_applicationNumber=-1;
|
||||||
composed=NO; //??
|
_composed=NO; //??
|
||||||
if (url)
|
if (_url)
|
||||||
{
|
{
|
||||||
NSArray* _components=nil;
|
NSArray* components=nil;
|
||||||
NSString* Left=url;
|
NSString* Left=_url;
|
||||||
int index=0;
|
int index=0;
|
||||||
int tmpIndex=0;
|
int tmpIndex=0;
|
||||||
NSRange protocolEndRange;
|
NSRange protocolEndRange;
|
||||||
|
@ -377,19 +385,19 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
if (queryStringStartRange.location+1<[Left length])
|
if (queryStringStartRange.location+1<[Left length])
|
||||||
{
|
{
|
||||||
ASSIGN(queryString,[Left substringFromIndex:queryStringStartRange.location+queryStringStartRange.length]);
|
ASSIGN(_queryString,[Left substringFromIndex:queryStringStartRange.location+queryStringStartRange.length]);
|
||||||
};
|
};
|
||||||
Left=[Left substringToIndex:queryStringStartRange.location];
|
Left=[Left substringToIndex:queryStringStartRange.location];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
||||||
NSDebugMLLog(@"low",@"queryString [%@]",queryString);
|
NSDebugMLLog(@"low",@"queryString [%@]",_queryString);
|
||||||
|
|
||||||
//Protocol
|
//Protocol
|
||||||
protocolEndRange=[Left rangeOfString:@"://"];
|
protocolEndRange=[Left rangeOfString:@"://"];
|
||||||
if (protocolEndRange.length>0)
|
if (protocolEndRange.length>0)
|
||||||
{
|
{
|
||||||
ASSIGN(protocol,[Left substringToIndex:protocolEndRange.location]);
|
ASSIGN(_protocol,[Left substringToIndex:protocolEndRange.location]);
|
||||||
NSDebugMLLog(@"low",@"protocol [%@]",protocol);
|
NSDebugMLLog(@"low",@"protocol [%@]",_protocol);
|
||||||
if (protocolEndRange.location+protocolEndRange.length<[Left length])
|
if (protocolEndRange.location+protocolEndRange.length<[Left length])
|
||||||
Left=[Left substringFromIndex:protocolEndRange.location+protocolEndRange.length];
|
Left=[Left substringFromIndex:protocolEndRange.location+protocolEndRange.length];
|
||||||
else
|
else
|
||||||
|
@ -401,8 +409,8 @@ static char rcsId[] = "$Id$";
|
||||||
NSRange hostEndRangePort=[Left rangeOfString:@":"];
|
NSRange hostEndRangePort=[Left rangeOfString:@":"];
|
||||||
if (hostEndRangePort.length>0)
|
if (hostEndRangePort.length>0)
|
||||||
{
|
{
|
||||||
ASSIGN(host,[Left substringToIndex:hostEndRangePort.location]);
|
ASSIGN(_host,[Left substringToIndex:hostEndRangePort.location]);
|
||||||
NSDebugMLLog(@"low",@"host [%@]",host);
|
NSDebugMLLog(@"low",@"host [%@]",_host);
|
||||||
if (hostEndRangePort.location+hostEndRangePort.length<[Left length])
|
if (hostEndRangePort.location+hostEndRangePort.length<[Left length])
|
||||||
Left=[Left substringFromIndex:hostEndRangePort.location+hostEndRangePort.length];
|
Left=[Left substringFromIndex:hostEndRangePort.location+hostEndRangePort.length];
|
||||||
else
|
else
|
||||||
|
@ -415,8 +423,8 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
NSString* portString=[Left substringToIndex:portEndRange.location];
|
NSString* portString=[Left substringToIndex:portEndRange.location];
|
||||||
NSDebugMLLog(@"low",@"portString [%@]",Left);
|
NSDebugMLLog(@"low",@"portString [%@]",Left);
|
||||||
port=[portString intValue];
|
_port=[portString intValue];
|
||||||
NSDebugMLLog(@"low",@"port [%d]",port);
|
NSDebugMLLog(@"low",@"port [%d]",_port);
|
||||||
if (portEndRange.location+portEndRange.length<[Left length])
|
if (portEndRange.location+portEndRange.length<[Left length])
|
||||||
Left=[Left substringFromIndex:portEndRange.location+portEndRange.length-1]; //Keep the '/'
|
Left=[Left substringFromIndex:portEndRange.location+portEndRange.length-1]; //Keep the '/'
|
||||||
else
|
else
|
||||||
|
@ -425,8 +433,8 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
port=[Left intValue];
|
_port=[Left intValue];
|
||||||
NSDebugMLLog(@"low",@"port [%d]",port);
|
NSDebugMLLog(@"low",@"port [%d]",_port);
|
||||||
Left=nil;
|
Left=nil;
|
||||||
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
||||||
};
|
};
|
||||||
|
@ -437,8 +445,8 @@ static char rcsId[] = "$Id$";
|
||||||
NSRange hostEndRangeSlash=[Left rangeOfString:@"/"];
|
NSRange hostEndRangeSlash=[Left rangeOfString:@"/"];
|
||||||
if (hostEndRangeSlash.length>0)
|
if (hostEndRangeSlash.length>0)
|
||||||
{
|
{
|
||||||
ASSIGN(host,[Left substringToIndex:hostEndRangeSlash.location]);
|
ASSIGN(_host,[Left substringToIndex:hostEndRangeSlash.location]);
|
||||||
NSDebugMLLog(@"low",@"host [%@]",host);
|
NSDebugMLLog(@"low",@"host [%@]",_host);
|
||||||
if (hostEndRangeSlash.location+hostEndRangeSlash.length<[Left length])
|
if (hostEndRangeSlash.location+hostEndRangeSlash.length<[Left length])
|
||||||
Left=[Left substringFromIndex:hostEndRangeSlash.location+hostEndRangeSlash.length-1];//Keep the '/'
|
Left=[Left substringFromIndex:hostEndRangeSlash.location+hostEndRangeSlash.length-1];//Keep the '/'
|
||||||
else
|
else
|
||||||
|
@ -447,8 +455,8 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ASSIGN(host,Left);
|
ASSIGN(_host,Left);
|
||||||
NSDebugMLLog(@"low",@"host [%@]",host);
|
NSDebugMLLog(@"low",@"host [%@]",_host);
|
||||||
Left=nil;
|
Left=nil;
|
||||||
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
||||||
};
|
};
|
||||||
|
@ -458,51 +466,41 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
NSDebugMLLog(@"low",@"Left [%@]",Left);
|
||||||
//prefix
|
//prefix
|
||||||
NSDebugMLLog(@"low",@"prefix: _components [%@]",_components);
|
NSDebugMLLog(@"low",@"prefix: components [%@]",components);
|
||||||
_components=[Left componentsSeparatedByString:@"/"];
|
components=[Left componentsSeparatedByString:@"/"];
|
||||||
/*
|
for(tmpIndex=index;!_prefix && tmpIndex<[components count];tmpIndex++)
|
||||||
for(tmpIndex=index;!prefix && tmpIndex<[_components count];tmpIndex++)
|
|
||||||
{
|
{
|
||||||
if ([[_components objectAtIndex:tmpIndex]hasPrefix:GSWURLPrefix])
|
NSString* tmp=[components objectAtIndex:tmpIndex];
|
||||||
{
|
|
||||||
ASSIGN(prefix,[[_components subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]componentsJoinedByString:@"/"]);
|
|
||||||
index=tmpIndex+1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
for(tmpIndex=index;!prefix && tmpIndex<[_components count];tmpIndex++)
|
|
||||||
{
|
|
||||||
NSString* tmp=[_components objectAtIndex:tmpIndex];
|
|
||||||
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]]
|
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]]
|
||||||
|| [tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
|
|| [tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
|
||||||
{
|
{
|
||||||
if (tmpIndex-index>1)
|
if (tmpIndex-index>1)
|
||||||
{
|
{
|
||||||
ASSIGN(prefix,[[_components subarrayWithRange:NSMakeRange(index,tmpIndex-index)]componentsJoinedByString:@"/"]);
|
ASSIGN(_prefix,[[components subarrayWithRange:NSMakeRange(index,tmpIndex-index)]componentsJoinedByString:@"/"]);
|
||||||
index=tmpIndex;//Stay on ApplicationName !
|
index=tmpIndex;//Stay on ApplicationName !
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!prefix)
|
if (!_prefix)
|
||||||
{
|
{
|
||||||
//TODO Erreur
|
//TODO Erreur
|
||||||
NSDebugMLLog(@"low",@"No prefix in [%@]",url);
|
NSDebugMLLog(@"low",@"No prefix in [%@]",_url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//applicationName
|
//applicationName
|
||||||
if (index>=[_components count])
|
if (index>=[components count])
|
||||||
{
|
{
|
||||||
//TODO Erreur
|
//TODO Erreur
|
||||||
NSDebugMLLog(@"low",@"No applicationName in [%@]",url);
|
NSDebugMLLog(@"low",@"No applicationName in [%@]",_url);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"applicationName: _components [%@]",
|
NSDebugMLLog(@"low",@"applicationName: components [%@]",
|
||||||
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
|
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
|
||||||
for(tmpIndex=index;!applicationName && tmpIndex<[_components count];tmpIndex++)
|
for(tmpIndex=index;!_applicationName && tmpIndex<[components count];tmpIndex++)
|
||||||
{
|
{
|
||||||
NSString* tmp=[_components objectAtIndex:tmpIndex];
|
NSString* tmp=[components objectAtIndex:tmpIndex];
|
||||||
NSString* appSuffix=nil;
|
NSString* appSuffix=nil;
|
||||||
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
|
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
|
||||||
appSuffix=GSWApplicationPSuffix[GSWNAMES_INDEX];
|
appSuffix=GSWApplicationPSuffix[GSWNAMES_INDEX];
|
||||||
|
@ -510,46 +508,45 @@ static char rcsId[] = "$Id$";
|
||||||
appSuffix=GSWApplicationPSuffix[WONAMES_INDEX];
|
appSuffix=GSWApplicationPSuffix[WONAMES_INDEX];
|
||||||
if (appSuffix)
|
if (appSuffix)
|
||||||
{
|
{
|
||||||
ASSIGN(applicationName,[[[_components
|
ASSIGN(_applicationName,[[[components subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]
|
||||||
subarrayWithRange:NSMakeRange(index,tmpIndex-index+1)]
|
|
||||||
componentsJoinedByString:@"/"]
|
componentsJoinedByString:@"/"]
|
||||||
stringWithoutSuffix:appSuffix]);
|
stringWithoutSuffix:appSuffix]);
|
||||||
index=tmpIndex+1;
|
index=tmpIndex+1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!applicationName)
|
if (!_applicationName)
|
||||||
{
|
{
|
||||||
NSString* tmp=[[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]
|
NSString* tmp=[[components subarrayWithRange:NSMakeRange(index,[components count]-index)]
|
||||||
componentsJoinedByString:@"/"];
|
componentsJoinedByString:@"/"];
|
||||||
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
|
if ([tmp hasSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]])
|
||||||
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]];
|
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[GSWNAMES_INDEX]];
|
||||||
else if ([tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
|
else if ([tmp hasSuffix:GSWApplicationPSuffix[WONAMES_INDEX]])
|
||||||
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[WONAMES_INDEX]];
|
tmp=[tmp stringWithoutSuffix:GSWApplicationPSuffix[WONAMES_INDEX]];
|
||||||
ASSIGN(applicationName,tmp);
|
ASSIGN(_applicationName,tmp);
|
||||||
index=[_components count];
|
index=[components count];
|
||||||
};
|
};
|
||||||
|
|
||||||
//Application Number
|
//Application Number
|
||||||
if (index<[_components count])
|
if (index<[components count])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"applicationNumber: _components [%@]",
|
NSDebugMLLog(@"low",@"applicationNumber: components [%@]",
|
||||||
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
|
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
|
||||||
ASSIGN(applicationNumberString,[_components objectAtIndex:index]);
|
ASSIGN(_applicationNumberString,[components objectAtIndex:index]);
|
||||||
applicationNumber=[applicationNumberString intValue];
|
_applicationNumber=[_applicationNumberString intValue];
|
||||||
index++;
|
index++;
|
||||||
//requestHandlerKey
|
//requestHandlerKey
|
||||||
if (index<[_components count])
|
if (index<[components count])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"requestHandlerKey: _components [%@]",
|
NSDebugMLLog(@"low",@"requestHandlerKey: _components [%@]",
|
||||||
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
|
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
|
||||||
ASSIGN(requestHandlerKey,[_components objectAtIndex:index]);
|
ASSIGN(_requestHandlerKey,[components objectAtIndex:index]);
|
||||||
index++;
|
index++;
|
||||||
//requestHandlerPath
|
//requestHandlerPath
|
||||||
if (index<[_components count])
|
if (index<[components count])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"requestHandlerPath: _components [%@]",
|
NSDebugMLLog(@"low",@"requestHandlerPath: components [%@]",
|
||||||
[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]);
|
[components subarrayWithRange:NSMakeRange(index,[components count]-index)]);
|
||||||
ASSIGN(requestHandlerPath,[[_components subarrayWithRange:NSMakeRange(index,[_components count]-index)]componentsJoinedByString:@"/"]);
|
ASSIGN(_requestHandlerPath,[[components subarrayWithRange:NSMakeRange(index,[components count]-index)]componentsJoinedByString:@"/"]);
|
||||||
index++;
|
index++;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -557,13 +554,13 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"url=%@",url);
|
NSDebugMLLog(@"low",@"url=%@",_url);
|
||||||
NSDebugMLLog(@"low",@"prefix=%@",prefix);
|
NSDebugMLLog(@"low",@"prefix=%@",_prefix);
|
||||||
NSDebugMLLog(@"low",@"applicationName=%@",applicationName);
|
NSDebugMLLog(@"low",@"applicationName=%@",_applicationName);
|
||||||
NSDebugMLLog(@"low",@"applicationNumberString=%@",applicationNumberString);
|
NSDebugMLLog(@"low",@"applicationNumberString=%@",_applicationNumberString);
|
||||||
NSDebugMLLog(@"low",@"requestHandlerKey=%@",requestHandlerKey);
|
NSDebugMLLog(@"low",@"requestHandlerKey=%@",_requestHandlerKey);
|
||||||
NSDebugMLLog(@"low",@"queryString=%@",queryString);
|
NSDebugMLLog(@"low",@"queryString=%@",_queryString);
|
||||||
NSDebugMLLog(@"low",@"requestHandlerPath=%@",requestHandlerPath);
|
NSDebugMLLog(@"low",@"requestHandlerPath=%@",_requestHandlerPath);
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -581,37 +578,37 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlRequestHandlerPath
|
-(NSString*)urlRequestHandlerPath
|
||||||
{
|
{
|
||||||
return requestHandlerPath;
|
return _requestHandlerPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlQueryString
|
-(NSString*)urlQueryString
|
||||||
{
|
{
|
||||||
return queryString;
|
return _queryString;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlRequestHandlerKey
|
-(NSString*)urlRequestHandlerKey
|
||||||
{
|
{
|
||||||
return requestHandlerKey;
|
return _requestHandlerKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(int)urlApplicationNumber
|
-(int)urlApplicationNumber
|
||||||
{
|
{
|
||||||
return applicationNumber;
|
return _applicationNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlApplicationName
|
-(NSString*)urlApplicationName
|
||||||
{
|
{
|
||||||
return applicationName;
|
return _applicationName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)urlPrefix
|
-(NSString*)urlPrefix
|
||||||
{
|
{
|
||||||
return prefix;
|
return _prefix;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -624,145 +621,145 @@ static char rcsId[] = "$Id$";
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)urlProtocol
|
-(NSString*)urlProtocol
|
||||||
{
|
{
|
||||||
return protocol;
|
return _protocol;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)urlHost
|
-(NSString*)urlHost
|
||||||
{
|
{
|
||||||
return host;
|
return _host;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)urlPortString
|
-(NSString*)urlPortString
|
||||||
{
|
{
|
||||||
return [NSString stringWithFormat:@"%d",port];
|
return [NSString stringWithFormat:@"%d",_port];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(int)urlPort
|
-(int)urlPort
|
||||||
{
|
{
|
||||||
return port;
|
return _port;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)urlProtocolHostPort
|
-(NSString*)urlProtocolHostPort
|
||||||
{
|
{
|
||||||
NSMutableString* _url=[NSMutableString string];
|
NSMutableString* url=[NSMutableString string];
|
||||||
if (protocol)
|
if (_protocol)
|
||||||
{
|
{
|
||||||
if (host)
|
if (_host)
|
||||||
[_url appendFormat:@"%@://",protocol];
|
[url appendFormat:@"%@://",_protocol];
|
||||||
else if (port)
|
else if (_port)
|
||||||
[_url appendFormat:@"%@://localhost",protocol];
|
[url appendFormat:@"%@://localhost",_protocol];
|
||||||
else
|
else
|
||||||
[_url appendFormat:@"%@://",protocol];
|
[url appendFormat:@"%@://",_protocol];
|
||||||
};
|
};
|
||||||
if (host)
|
if (_host)
|
||||||
[_url appendString:host];
|
[url appendString:_host];
|
||||||
if (port)
|
if (_port)
|
||||||
[_url appendFormat:@":%d",port];
|
[url appendFormat:@":%d",_port];
|
||||||
return [NSString stringWithString:_url];
|
return [NSString stringWithString:url];
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWDynamicURLString (GSWDynamicURLStringSet)
|
@implementation GSWDynamicURLString (GSWDynamicURLStringSet)
|
||||||
-(void)setURLRequestHandlerPath:(NSString*)string_
|
-(void)setURLRequestHandlerPath:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(requestHandlerPath,string_);
|
ASSIGN(_requestHandlerPath,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setURLQueryString:(NSString*)string_
|
-(void)setURLQueryString:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(queryString,string_);
|
ASSIGN(_queryString,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setURLRequestHandlerKey:(NSString*)string_
|
-(void)setURLRequestHandlerKey:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(requestHandlerKey,string_);
|
ASSIGN(_requestHandlerKey,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setURLApplicationNumber:(int)applicationNumber_
|
-(void)setURLApplicationNumber:(int)applicationNumber
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
applicationNumber=applicationNumber_;
|
_applicationNumber=applicationNumber;
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setURLApplicationName:(NSString*)string_
|
-(void)setURLApplicationName:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(applicationName,string_);
|
ASSIGN(_applicationName,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setURLPrefix:(NSString*)string_
|
-(void)setURLPrefix:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(prefix,string_);
|
ASSIGN(_prefix,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)setURLProtocol:(NSString*)string_
|
-(void)setURLProtocol:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(protocol,string_);
|
ASSIGN(_protocol,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)setURLHost:(NSString*)string_
|
-(void)setURLHost:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(host,string_);
|
ASSIGN(_host,aString);
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)setURLPortString:(NSString*)string_
|
-(void)setURLPortString:(NSString*)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
port=[string_ intValue];
|
_port=[aString intValue];
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)setURLPort:(int)port_
|
-(void)setURLPort:(int)port
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
port=port_;
|
_port=port;
|
||||||
composed=NO;
|
_composed=NO;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWEmbeddedObject.m - GSWeb: Class GSWEmbeddedObject
|
/** GSWEmbeddedObject.m - <title>GSWeb: Class GSWEmbeddedObject</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -28,9 +34,9 @@ static char rcsId[] = "$Id$";
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWEmbeddedObject
|
@implementation GSWEmbeddedObject
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
contentElements:(NSArray*)elements_
|
contentElements:(NSArray*)elements
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWGenericContainer.h - GSWeb: Class GSWGenericContainer
|
/** GSWGenericContainer.h - <title>GSWeb: Class GSWGenericContainer</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,25 +36,25 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWGenericContainer: GSWDynamicElement
|
@interface GSWGenericContainer: GSWDynamicElement
|
||||||
{
|
{
|
||||||
GSWAssociation* children;
|
GSWAssociation* _children;
|
||||||
NSDictionary *associations;
|
NSDictionary* _associations;
|
||||||
GSWElement* element;
|
GSWElement* _element;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
template:(GSWElement*)templateElement_;
|
template:(GSWElement*)templateElement;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
|
|
||||||
-(void)appendToResponse:(GSWResponse*)response_
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWGenericContainer.m - GSWeb: Class GSWGenericContainer
|
/** GSWGenericContainer.m - <title>GSWeb: Class GSWGenericContainer</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -28,83 +34,84 @@ static char rcsId[] = "$Id$";
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWGenericContainer
|
@implementation GSWGenericContainer
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
template:(GSWElement*)templateElement_
|
template:(GSWElement*)templateElement
|
||||||
{
|
{
|
||||||
self = [super init];
|
if ((self = [super init]))
|
||||||
associations=[associations_ retain];
|
{
|
||||||
element=[templateElement_ retain];
|
ASSIGN(_associations,associations);
|
||||||
|
ASSIGN(_element,templateElement);
|
||||||
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
[associations release];
|
DESTROY(_associations);
|
||||||
[element release];
|
DESTROY(_element);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)description
|
-(NSString*)description
|
||||||
{
|
{
|
||||||
//TODOFN
|
//TODOFN
|
||||||
return [super description];
|
return [super description];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(void)appendToResponse:(GSWResponse*)response_
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
NSEnumerator *assocEnumer;
|
NSEnumerator *assocEnumer=nil;
|
||||||
id currentAssocKey;
|
id currentAssocKey=nil;
|
||||||
id component = [context_ component];
|
id component = [aContext component];
|
||||||
id theValue;
|
id theValue=nil;
|
||||||
id otherTag = nil;
|
id otherTag = nil;
|
||||||
id tag = [[associations objectForKey:@"elementName"] valueInComponent:component];
|
id tag = [[_associations objectForKey:@"elementName"] valueInComponent:component];
|
||||||
|
|
||||||
[response_ appendContentString:[NSString stringWithFormat:@"<%@",tag]];
|
[aResponse appendContentString:[NSString stringWithFormat:@"<%@",tag]];
|
||||||
|
|
||||||
if (otherTag = [[associations objectForKey:@"otherTagString"] valueInComponent:component]) {
|
if ((otherTag = [[_associations objectForKey:@"otherTagString"] valueInComponent:component]))
|
||||||
[response_ appendContentString:[NSString stringWithFormat:@" %@",otherTag]];
|
{
|
||||||
|
[aResponse appendContentString:[NSString stringWithFormat:@" %@",otherTag]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assocEnumer = [_associations keyEnumerator];
|
||||||
assocEnumer = [associations keyEnumerator];
|
while ((currentAssocKey = [assocEnumer nextObject]))
|
||||||
while (currentAssocKey = [assocEnumer nextObject]) {
|
{
|
||||||
theValue = [[associations objectForKey:currentAssocKey] valueInComponent:component];
|
theValue = [[_associations objectForKey:currentAssocKey] valueInComponent:component];
|
||||||
if (([currentAssocKey isEqualToString:@"elementName"] == NO) && ([currentAssocKey isEqualToString:@"otherTagString"] == NO)) {
|
if (([currentAssocKey isEqualToString:@"elementName"] == NO)
|
||||||
[response_ appendContentString:[NSString stringWithFormat:@" %@=\"%@\"",currentAssocKey,theValue]];
|
&& ([currentAssocKey isEqualToString:@"otherTagString"] == NO))
|
||||||
|
{
|
||||||
|
[aResponse appendContentString:[NSString stringWithFormat:@" %@=\"%@\"",currentAssocKey,theValue]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[response_ appendContentString:@">"];
|
[aResponse appendContentString:@">"];
|
||||||
[element appendToResponse:response_ inContext:context_];
|
[_element appendToResponse:aResponse inContext:aContext];
|
||||||
[response_ appendContentString:[NSString stringWithFormat:@"</%@>",tag]];
|
[aResponse appendContentString:[NSString stringWithFormat:@"</%@>",tag]];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
// LOGObjectFnNotImplemented(); //TODOFN
|
return [_element invokeActionForRequest:aRequest
|
||||||
|
inContext:aContext];
|
||||||
return [element invokeActionForRequest:request_ inContext:context_];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(void)takeValuesFromRequest:(GSWRequest*)request_
|
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
// LOGObjectFnNotImplemented(); //TODOFN
|
return [_element takeValuesFromRequest:aRequest
|
||||||
|
inContext:aContext];
|
||||||
return [element takeValuesFromRequest:request_ inContext:context_];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWHTMLAttrParserExt.h - GSWeb: Class GSWPageElementParser: Categories
|
/** GSWHTMLAttrParserExt.h - <title>GSWeb: Class GSWHTMLAttrParserExt: Categories</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -32,9 +37,9 @@
|
||||||
-(NSString*)tagName;
|
-(NSString*)tagName;
|
||||||
-(NSDictionary*)attributes;
|
-(NSDictionary*)attributes;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(void)reportErrorWithException:(NSException*)_exception;
|
-(void)reportErrorWithException:(NSException*)exception;
|
||||||
-(void)reportError:(NSString*)_text;
|
-(void)reportError:(NSString*)text;
|
||||||
-(void)reportWarning:(NSString*)_text;
|
-(void)reportWarning:(NSString*)text;
|
||||||
-(BOOL)isError;
|
-(BOOL)isError;
|
||||||
-(BOOL)isWarning;
|
-(BOOL)isWarning;
|
||||||
-(NSArray*)errors;
|
-(NSArray*)errors;
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWHTMLAttrParserExt.m - GSWeb: Class GSWHTMLAttrParser: Categories
|
/** GSWHTMLAttrParserExt.m - <title>GSWeb: Class GSWHTMLAttrParserExt: Categories</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
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)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
||||||
[_exception description],
|
[exception description],
|
||||||
[_exception reason]];
|
[exception reason]];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportError:(NSString*)_text
|
-(void)reportError:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _error=nil;
|
NSString* error=nil;
|
||||||
if (!errors)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Error: %@",
|
error=[NSString stringWithFormat:@"Parsing Error: %@",
|
||||||
_text];
|
text];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportWarning:(NSString*)_text
|
-(void)reportWarning:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _warning=nil;
|
NSString* warning=nil;
|
||||||
if (!warnings)
|
if (!warnings)
|
||||||
warnings=[NSMutableArray new];
|
warnings=[NSMutableArray new];
|
||||||
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
||||||
_text];
|
text];
|
||||||
[warnings addObject:_warning];
|
[warnings addObject:warning];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWHTMLParserExt.h - GSWeb: Class GSWHTMLParser: Categories
|
/** GSWHTMLParserExt.h - <title>GSWeb: Class GSWHTMLParser: Categories</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,9 +35,9 @@
|
||||||
|
|
||||||
@interface GSWHTMLParser (GSWHTMLParserExt)
|
@interface GSWHTMLParser (GSWHTMLParserExt)
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(void)reportErrorWithException:(NSException*)_exception;
|
-(void)reportErrorWithException:(NSException*)exception;
|
||||||
-(void)reportError:(NSString*)_text;
|
-(void)reportError:(NSString*)text;
|
||||||
-(void)reportWarning:(NSString*)_text;
|
-(void)reportWarning:(NSString*)text;
|
||||||
-(BOOL)isError;
|
-(BOOL)isError;
|
||||||
-(BOOL)isWarning;
|
-(BOOL)isWarning;
|
||||||
-(NSArray*)errors;
|
-(NSArray*)errors;
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWHTMLParserExt.m - GSWeb: Class GSWHTMLParser: Categories
|
/** GSWHTMLParserExt.m - <title>GSWeb: Class GSWHTMLParser: Categories</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
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)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
||||||
[_exception description],
|
[exception description],
|
||||||
[_exception reason]];
|
[exception reason]];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportError:(NSString*)_text
|
-(void)reportError:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _error=nil;
|
NSString* error=nil;
|
||||||
if (!errors)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Error: %@",
|
error=[NSString stringWithFormat:@"Parsing Error: %@",
|
||||||
_text];
|
text];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportWarning:(NSString*)_text
|
-(void)reportWarning:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _warning=nil;
|
NSString* warning=nil;
|
||||||
if (!warnings)
|
if (!warnings)
|
||||||
warnings=[NSMutableArray new];
|
warnings=[NSMutableArray new];
|
||||||
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
||||||
_text];
|
text];
|
||||||
[warnings addObject:_warning];
|
[warnings addObject:warning];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWHTMLURLValuedElement.h - GSWeb: Class GSWHTMLURLValuedElement
|
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Apr 1999
|
Date: Apr 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,27 +35,27 @@
|
||||||
|
|
||||||
@interface GSWHTMLURLValuedElement: GSWHTMLDynamicElement
|
@interface GSWHTMLURLValuedElement: GSWHTMLDynamicElement
|
||||||
{
|
{
|
||||||
GSWAssociation* src;
|
GSWAssociation* _src;
|
||||||
GSWAssociation* value;
|
GSWAssociation* _value;
|
||||||
GSWAssociation* pageName;
|
GSWAssociation* _pageName;
|
||||||
//GSWeb Additions {
|
//GSWeb Additions {
|
||||||
NSDictionary* pageSetVarAssociations;
|
NSDictionary* _pageSetVarAssociations;
|
||||||
GSWAssociation* pageSetVarAssociationsDynamic;
|
GSWAssociation* _pageSetVarAssociationsDynamic;
|
||||||
// }
|
// }
|
||||||
GSWAssociation* filename;
|
GSWAssociation* _filename;
|
||||||
GSWAssociation* framework;
|
GSWAssociation* _framework;
|
||||||
GSWAssociation* data;
|
GSWAssociation* _data;
|
||||||
GSWAssociation* mimeType;
|
GSWAssociation* _mimeType;
|
||||||
GSWAssociation* key;
|
GSWAssociation* _key;
|
||||||
GSWAssociation* actionClass;
|
GSWAssociation* _actionClass;
|
||||||
GSWAssociation* directActionName;
|
GSWAssociation* _directActionName;
|
||||||
GSWAssociation* queryDictionary;
|
GSWAssociation* _queryDictionary;
|
||||||
NSDictionary* otherQueryAssociations;
|
NSDictionary* _otherQueryAssociations;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
contentElements:(NSArray*)elements_;
|
contentElements:(NSArray*)elements;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
|
|
||||||
-(NSString*)valueAttributeName;
|
-(NSString*)valueAttributeName;
|
||||||
|
@ -58,21 +64,21 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
|
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementB)
|
@interface GSWHTMLURLValuedElement (GSWHTMLURLValuedElementB)
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)appendURLToResponse:(GSWResponse*)response_
|
-(void)appendURLToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)_appendCGIActionURLToResponse:(GSWResponse*)response_
|
-(void)_appendCGIActionURLToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(id)computeActionStringInContext:(GSWContext*)context_;
|
-(id)computeActionStringInContext:(GSWContext*)aContext;
|
||||||
-(id)computeQueryDictionaryInContext:(GSWContext*)context_;
|
-(id)computeQueryDictionaryInContext:(GSWContext*)aContext;
|
||||||
-(NSString*)frameworkNameInContext:(GSWContext*)context_;
|
-(NSString*)frameworkNameInContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif // _GSWHTMLURLValuedElement_h__
|
#endif // _GSWHTMLURLValuedElement_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWHTMLURLValuedElement.m - GSWeb: Class GSWHTMLURLValuedElement
|
/** GSWHTMLURLValuedElement.m - <title>GSWeb: Class GSWHTMLURLValuedElement</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
Date: Jan 1999
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Apr 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,91 +35,91 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWHTMLURLValuedElement
|
@implementation GSWHTMLURLValuedElement
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)inAssociations
|
||||||
contentElements:(NSArray*)elements_
|
contentElements:(NSArray*)elements
|
||||||
{
|
{
|
||||||
NSString* _urlAttributeName=nil;
|
NSString* urlAttributeName=nil;
|
||||||
NSString* _valueAttributeName=nil;
|
NSString* valueAttributeName=nil;
|
||||||
NSMutableDictionary* _associations=nil;
|
NSMutableDictionary* associations=nil;
|
||||||
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
||||||
_urlAttributeName=[self urlAttributeName];//so what ?
|
urlAttributeName=[self urlAttributeName];//so what ?
|
||||||
_valueAttributeName=[self valueAttributeName];//so what ?
|
valueAttributeName=[self valueAttributeName];//so what ?
|
||||||
|
|
||||||
_associations=[NSMutableDictionary dictionaryWithDictionary:associations_];
|
associations=[NSMutableDictionary dictionaryWithDictionary:inAssociations];
|
||||||
|
|
||||||
src = [[associations_ objectForKey:src__Key
|
_src = [[inAssociations objectForKey:src__Key
|
||||||
withDefaultObject:[src autorelease]] retain];
|
withDefaultObject:[_src autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"src=%@",src);
|
NSDebugMLLog(@"gswdync",@"src=%@",_src);
|
||||||
|
|
||||||
value = [[associations_ objectForKey:value__Key
|
_value = [[inAssociations objectForKey:value__Key
|
||||||
withDefaultObject:[value autorelease]] retain];
|
withDefaultObject:[_value autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",value);
|
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
||||||
|
|
||||||
pageName = [[associations_ objectForKey:pageName__Key
|
_pageName = [[inAssociations objectForKey:pageName__Key
|
||||||
withDefaultObject:[pageName autorelease]] retain];
|
withDefaultObject:[_pageName autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"pageName=%@",pageName);
|
NSDebugMLLog(@"gswdync",@"pageName=%@",_pageName);
|
||||||
|
|
||||||
filename = [[associations_ objectForKey:filename__Key
|
_filename = [[inAssociations objectForKey:filename__Key
|
||||||
withDefaultObject:[filename autorelease]] retain];
|
withDefaultObject:[_filename autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
|
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
|
||||||
|
|
||||||
framework = [[associations_ objectForKey:framework__Key
|
_framework = [[inAssociations objectForKey:framework__Key
|
||||||
withDefaultObject:[framework autorelease]] retain];
|
withDefaultObject:[_framework autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"framework=%@",framework);
|
NSDebugMLLog(@"gswdync",@"framework=%@",_framework);
|
||||||
|
|
||||||
data = [[associations_ objectForKey:data__Key
|
_data = [[inAssociations objectForKey:data__Key
|
||||||
withDefaultObject:[data autorelease]] retain];
|
withDefaultObject:[_data autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"data=%@",data);
|
NSDebugMLLog(@"gswdync",@"data=%@",_data);
|
||||||
|
|
||||||
mimeType = [[associations_ objectForKey:mimeType__Key
|
_mimeType = [[inAssociations objectForKey:mimeType__Key
|
||||||
withDefaultObject:[mimeType autorelease]] retain];
|
withDefaultObject:[_mimeType autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"mimeType=%@",mimeType);
|
NSDebugMLLog(@"gswdync",@"mimeType=%@",_mimeType);
|
||||||
|
|
||||||
key = [[associations_ objectForKey:key__Key
|
_key = [[inAssociations objectForKey:key__Key
|
||||||
withDefaultObject:[key autorelease]] retain];
|
withDefaultObject:[_key autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"key=%@",key);
|
NSDebugMLLog(@"gswdync",@"key=%@",_key);
|
||||||
|
|
||||||
actionClass = [[associations_ objectForKey:actionClass__Key
|
_actionClass = [[inAssociations objectForKey:actionClass__Key
|
||||||
withDefaultObject:[actionClass autorelease]] retain];
|
withDefaultObject:[_actionClass autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"actionClass=%@",actionClass);
|
NSDebugMLLog(@"gswdync",@"actionClass=%@",_actionClass);
|
||||||
|
|
||||||
directActionName = [[associations_ objectForKey:directActionName__Key
|
_directActionName = [[inAssociations objectForKey:directActionName__Key
|
||||||
withDefaultObject:[directActionName autorelease]] retain];
|
withDefaultObject:[_directActionName autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"directActionName=%@",directActionName);
|
NSDebugMLLog(@"gswdync",@"directActionName=%@",_directActionName);
|
||||||
|
|
||||||
queryDictionary = [[associations_ objectForKey:queryDictionary__Key
|
_queryDictionary = [[inAssociations objectForKey:queryDictionary__Key
|
||||||
withDefaultObject:[queryDictionary autorelease]] retain];
|
withDefaultObject:[_queryDictionary autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"queryDictionary=%@",queryDictionary);
|
NSDebugMLLog(@"gswdync",@"queryDictionary=%@",_queryDictionary);
|
||||||
|
|
||||||
[_associations removeObjectForKey:src__Key];
|
[associations removeObjectForKey:src__Key];
|
||||||
[_associations removeObjectForKey:value__Key];
|
[associations removeObjectForKey:value__Key];
|
||||||
[_associations removeObjectForKey:pageName__Key];
|
[associations removeObjectForKey:pageName__Key];
|
||||||
[_associations removeObjectForKey:filename__Key];
|
[associations removeObjectForKey:filename__Key];
|
||||||
[_associations removeObjectForKey:framework__Key];
|
[associations removeObjectForKey:framework__Key];
|
||||||
[_associations removeObjectForKey:data__Key];
|
[associations removeObjectForKey:data__Key];
|
||||||
[_associations removeObjectForKey:mimeType__Key];
|
[associations removeObjectForKey:mimeType__Key];
|
||||||
[_associations removeObjectForKey:key__Key];
|
[associations removeObjectForKey:key__Key];
|
||||||
[_associations removeObjectForKey:actionClass__Key];
|
[associations removeObjectForKey:actionClass__Key];
|
||||||
[_associations removeObjectForKey:directActionName__Key];
|
[associations removeObjectForKey:directActionName__Key];
|
||||||
[_associations removeObjectForKey:queryDictionary__Key];
|
[associations removeObjectForKey:queryDictionary__Key];
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
{
|
{
|
||||||
//pageSetVarAssociations//GNUstepWeb only
|
//pageSetVarAssociations//GNUstepWeb only
|
||||||
|
NSDictionary* pageSetVarAssociations=[inAssociations associationsWithoutPrefix:pageSetVar__Prefix__Key
|
||||||
NSDictionary* _pageSetVarAssociations=[associations_ associationsWithoutPrefix:pageSetVar__Prefix__Key
|
removeFrom:associations];
|
||||||
removeFrom:_associations];
|
if ([pageSetVarAssociations count]>0)
|
||||||
if ([_pageSetVarAssociations count]>0)
|
{
|
||||||
pageSetVarAssociations=[_pageSetVarAssociations retain];
|
ASSIGN(_pageSetVarAssociations,pageSetVarAssociations);
|
||||||
|
};
|
||||||
pageSetVarAssociationsDynamic=[[associations_ objectForKey:pageSetVars__Key
|
_pageSetVarAssociationsDynamic=[[inAssociations objectForKey:pageSetVars__Key
|
||||||
withDefaultObject:[pageSetVarAssociationsDynamic autorelease]] retain];
|
withDefaultObject:[_pageSetVarAssociationsDynamic autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"pageSetVarAssociationsDynamic=%@",pageSetVarAssociationsDynamic);
|
NSDebugMLLog(@"gswdync",@"_pageSetVarAssociationsDynamic=%@",_pageSetVarAssociationsDynamic);
|
||||||
[_associations removeObjectForKey:pageSetVars__Key];
|
[associations removeObjectForKey:pageSetVars__Key];
|
||||||
};
|
};
|
||||||
if ((self=[super initWithName:[self elementName]//NEW
|
if ((self=[super initWithName:[self elementName]//NEW
|
||||||
attributeAssociations:_associations
|
attributeAssociations:associations
|
||||||
contentElements:elements_]))
|
contentElements:elements]))
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
||||||
|
@ -123,20 +129,20 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
DESTROY(src);
|
DESTROY(_src);
|
||||||
DESTROY(value);
|
DESTROY(_value);
|
||||||
DESTROY(pageName);
|
DESTROY(_pageName);
|
||||||
DESTROY(pageSetVarAssociations);//GNUstepWeb only
|
DESTROY(_pageSetVarAssociations);//GNUstepWeb only
|
||||||
DESTROY(pageSetVarAssociationsDynamic);//GSWeb only
|
DESTROY(_pageSetVarAssociationsDynamic);//GSWeb only
|
||||||
DESTROY(filename);
|
DESTROY(_filename);
|
||||||
DESTROY(framework);
|
DESTROY(_framework);
|
||||||
DESTROY(data);
|
DESTROY(_data);
|
||||||
DESTROY(mimeType);
|
DESTROY(_mimeType);
|
||||||
DESTROY(key);
|
DESTROY(_key);
|
||||||
DESTROY(actionClass);
|
DESTROY(_actionClass);
|
||||||
DESTROY(directActionName);
|
DESTROY(_directActionName);
|
||||||
DESTROY(queryDictionary);
|
DESTROY(_queryDictionary);
|
||||||
DESTROY(otherQueryAssociations);
|
DESTROY(_otherQueryAssociations);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,76 +174,76 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
|
@implementation GSWHTMLURLValuedElement (GSWHTMLURLValuedElementA)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWElement* _element=nil;
|
GSWElement* element=nil;
|
||||||
NSString* _senderID=nil;
|
NSString* senderID=nil;
|
||||||
NSString* _elementID=nil;
|
NSString* elementID=nil;
|
||||||
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
||||||
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"ET=%@ id=%@",[self class],[aContext elementID]);
|
||||||
_senderID=[context_ senderID];
|
senderID=[aContext senderID];
|
||||||
_elementID=[context_ elementID];
|
elementID=[aContext elementID];
|
||||||
NSDebugMLLog(@"gswdync",@"_senderID=%@",_senderID);
|
NSDebugMLLog(@"gswdync",@"senderID=%@",senderID);
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",_elementID);
|
NSDebugMLLog(@"gswdync",@"elementID=%@",elementID);
|
||||||
NSDebugMLLog(@"gswdync",@"[_elementID isEqualToString:_senderID]=%d",(int)[_elementID isEqualToString:_senderID]);
|
NSDebugMLLog(@"gswdync",@"[elementID isEqualToString:senderID]=%d",(int)[elementID isEqualToString:senderID]);
|
||||||
if ([_elementID isEqualToString:_senderID])
|
if ([elementID isEqualToString:senderID])
|
||||||
{
|
{
|
||||||
GSWComponent* _component=[context_ component];
|
GSWComponent* component=[aContext component];
|
||||||
if (value)
|
if (_value)
|
||||||
_element=[value valueInComponent:_component];
|
element=[_value valueInComponent:component];
|
||||||
else if (pageName)
|
else if (_pageName)
|
||||||
{
|
{
|
||||||
NSString* _pageNameValue=[pageName valueInComponent:_component];
|
NSString* pageNameValue=[_pageName valueInComponent:component];
|
||||||
_element=[GSWApp pageWithName:_pageNameValue
|
element=[GSWApp pageWithName:pageNameValue
|
||||||
inContext:context_];
|
inContext:aContext];
|
||||||
if (!WOStrictFlag && _element)//GNUstepWeb only
|
if (!WOStrictFlag && element)//GNUstepWeb only
|
||||||
{
|
{
|
||||||
if (pageSetVarAssociations)
|
if (_pageSetVarAssociations)
|
||||||
{
|
{
|
||||||
[pageSetVarAssociations associationsSetValuesFromObject:_component
|
[_pageSetVarAssociations associationsSetValuesFromObject:component
|
||||||
inObject:(GSWComponent*)_element];
|
inObject:(GSWComponent*)element];
|
||||||
};
|
};
|
||||||
if (pageSetVarAssociationsDynamic)
|
if (_pageSetVarAssociationsDynamic)
|
||||||
{
|
{
|
||||||
NSDictionary* _assocs=[pageSetVarAssociationsDynamic valueInComponent:_component];
|
NSDictionary* assocs=[_pageSetVarAssociationsDynamic valueInComponent:component];
|
||||||
if (_assocs)
|
if (assocs)
|
||||||
{
|
{
|
||||||
if (![_assocs isKindOfClass:[NSDictionary class]])
|
if (![assocs isKindOfClass:[NSDictionary class]])
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWHTMLURLValuedElement",@"%@ (%@) must return a Dictionary, not a %@ like %@",
|
ExceptionRaise(@"GSWHTMLURLValuedElement",@"%@ (%@) must return a Dictionary, not a %@ like %@",
|
||||||
pageSetVars__Key,
|
pageSetVars__Key,
|
||||||
pageSetVarAssociationsDynamic,
|
_pageSetVarAssociationsDynamic,
|
||||||
[_assocs class],
|
[assocs class],
|
||||||
_assocs);
|
assocs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[_assocs associationsSetValuesFromObject:_component
|
[assocs associationsSetValuesFromObject:component
|
||||||
inObject:(GSWComponent*)_element];
|
inObject:(GSWComponent*)element];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
|
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke element=%@",element);
|
||||||
//the end ?
|
//the end ?
|
||||||
//TODOV
|
//TODOV
|
||||||
if (!_element)
|
if (!element)
|
||||||
_element=[context_ page];
|
element=[aContext page];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_element=[super invokeActionForRequest:request_
|
element=[super invokeActionForRequest:aRequest
|
||||||
inContext:context_];
|
inContext:aContext];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke _element=%@",_element);
|
NSDebugMLLog(@"gswdync",@"GSWHTMLURLValuedElement invoke element=%@",element);
|
||||||
NSDebugMLLog(@"gswdync",@"_senderID=%@",[context_ senderID]);
|
NSDebugMLLog(@"gswdync",@"senderID=%@",[aContext senderID]);
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
|
||||||
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"END ET=%@ id=%@",[self class],[aContext elementID]);
|
||||||
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
||||||
return _element;
|
return element;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,146 +252,146 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
//NDFN
|
//NDFN
|
||||||
-(void)appendURLToResponse:(GSWResponse*)response_
|
-(void)appendURLToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _urlAttributeName=nil;
|
NSString* urlAttributeName=nil;
|
||||||
NSString* _url=nil;
|
NSString* url=nil;
|
||||||
GSWComponent* _component=nil;
|
GSWComponent* component=nil;
|
||||||
NSString* _keyValue=nil;
|
NSString* keyValue=nil;
|
||||||
id _data=nil;
|
id data=nil;
|
||||||
id _mimeTypeValue=nil;
|
id mimeTypeValue=nil;
|
||||||
GSWURLValuedElementData* _dataValue=nil;
|
GSWURLValuedElementData* dataValue=nil;
|
||||||
GSWResourceManager* _resourceManager=nil;
|
GSWResourceManager* resourceManager=nil;
|
||||||
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"elementID=%@",[aContext elementID]);
|
||||||
_component=[context_ component];
|
component=[aContext component];
|
||||||
NSDebugMLLog(@"gswdync",@"data=%@",data);
|
NSDebugMLLog(@"gswdync",@"data=%@",_data);
|
||||||
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
|
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
|
||||||
NSDebugMLLog(@"gswdync",@"pageName=%@",pageName);
|
NSDebugMLLog(@"gswdync",@"pageName=%@",_pageName);
|
||||||
_resourceManager=[[GSWApplication application]resourceManager];
|
resourceManager=[[GSWApplication application]resourceManager];
|
||||||
if (src)
|
if (_src)
|
||||||
_url=[src valueInComponent:_component];
|
url=[_src valueInComponent:component];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (key)
|
if (_key)
|
||||||
{
|
{
|
||||||
_keyValue=[key valueInComponent:_component];
|
keyValue=[_key valueInComponent:component];
|
||||||
_dataValue=[_resourceManager _cachedDataForKey:_keyValue];
|
dataValue=[resourceManager _cachedDataForKey:keyValue];
|
||||||
};
|
};
|
||||||
if (!_dataValue && data)
|
if (!dataValue && _data)
|
||||||
{
|
{
|
||||||
_data=[data valueInComponent:_component];
|
data=[_data valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"_data=%@",_data);
|
NSDebugMLLog(@"gswdync",@"_data=%@",data);
|
||||||
_mimeTypeValue=[mimeType valueInComponent:_component];
|
mimeTypeValue=[_mimeType valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"mimeType=%@",mimeType);
|
NSDebugMLLog(@"gswdync",@"mimeType=%@",_mimeType);
|
||||||
NSDebugMLLog(@"gswdync",@"_mimeTypeValue=%@",_mimeTypeValue);
|
NSDebugMLLog(@"gswdync",@"mimeTypeValue=%@",mimeTypeValue);
|
||||||
_dataValue=[[[GSWURLValuedElementData alloc] initWithData:_data
|
dataValue=[[[GSWURLValuedElementData alloc] initWithData:data
|
||||||
mimeType:_mimeTypeValue
|
mimeType:mimeTypeValue
|
||||||
key:nil] autorelease];
|
key:nil] autorelease];
|
||||||
NSDebugMLLog(@"gswdync",@"_dataValue=%@",_dataValue);
|
NSDebugMLLog(@"gswdync",@"dataValue=%@",dataValue);
|
||||||
[_resourceManager setURLValuedElementData:_dataValue];
|
[resourceManager setURLValuedElementData:dataValue];
|
||||||
}
|
}
|
||||||
else if (filename)
|
else if (_filename)
|
||||||
{
|
{
|
||||||
//Exemple: Body with filename
|
//Exemple: Body with filename
|
||||||
id _filenameValue=nil;
|
id filenameValue=nil;
|
||||||
id _frameworkValue=nil;
|
id frameworkValue=nil;
|
||||||
GSWRequest* _request=nil;
|
GSWRequest* request=nil;
|
||||||
NSArray* _languages=nil;
|
NSArray* languages=nil;
|
||||||
NSDebugMLLog(@"gswdync",@"filename=%@",filename);
|
NSDebugMLLog(@"gswdync",@"filename=%@",_filename);
|
||||||
_filenameValue=[filename valueInComponent:_component];
|
filenameValue=[_filename valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"_filenameValue=%@",_filenameValue);
|
NSDebugMLLog(@"gswdync",@"filenameValue=%@",filenameValue);
|
||||||
_frameworkValue=[self frameworkNameInContext:context_];
|
frameworkValue=[self frameworkNameInContext:aContext];
|
||||||
NSDebugMLLog(@"gswdync",@"_frameworkValue=%@",_frameworkValue);
|
NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue);
|
||||||
_request=[context_ request];
|
request=[aContext request];
|
||||||
_languages=[context_ languages];
|
languages=[aContext languages];
|
||||||
_url=[_resourceManager urlForResourceNamed:_filenameValue
|
url=[resourceManager urlForResourceNamed:filenameValue
|
||||||
inFramework:_frameworkValue
|
inFramework:frameworkValue
|
||||||
languages:_languages
|
languages:languages
|
||||||
request:_request];
|
request:request];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
[response_ appendContentCharacter:' '];
|
[aResponse appendContentCharacter:' '];
|
||||||
_urlAttributeName=[self urlAttributeName];
|
urlAttributeName=[self urlAttributeName];
|
||||||
if (_urlAttributeName)
|
if (urlAttributeName)
|
||||||
{
|
{
|
||||||
[response_ _appendContentAsciiString:_urlAttributeName];
|
[aResponse _appendContentAsciiString:urlAttributeName];
|
||||||
[response_ _appendContentAsciiString:@"=\""];
|
[aResponse _appendContentAsciiString:@"=\""];
|
||||||
};
|
};
|
||||||
if (src)
|
if (_src)
|
||||||
{
|
{
|
||||||
[response_ appendContentString:_url];
|
[aResponse appendContentString:url];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (key || data)
|
if (_key || _data)
|
||||||
{
|
{
|
||||||
[_dataValue appendDataURLToResponse:response_
|
[dataValue appendDataURLToResponse:aResponse
|
||||||
inContext:context_];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
else if (filename)
|
else if (_filename)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"_url = %@",_url);
|
NSDebugMLLog(@"gswdync",@"url = %@",url);
|
||||||
[response_ appendContentString:_url];
|
[aResponse appendContentString:url];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSWDynamicURLString* _componentActionURL=[context_ componentActionURL];
|
GSWDynamicURLString* componentActionURL=[aContext componentActionURL];
|
||||||
NSDebugMLLog(@"gswdync",@"_componentActionURL=%@",_componentActionURL);
|
NSDebugMLLog(@"gswdync",@"componentActionURL=%@",componentActionURL);
|
||||||
[response_ appendContentString:(NSString*)_componentActionURL];
|
[aResponse appendContentString:(NSString*)componentActionURL];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (_urlAttributeName)
|
if (urlAttributeName)
|
||||||
[response_ appendContentCharacter:'"'];
|
[aResponse appendContentCharacter:'"'];
|
||||||
NSDebugMLLog(@"gswdync",@"_elementID=%@",[context_ elementID]);
|
NSDebugMLLog(@"gswdync",@"_elementID=%@",[aContext elementID]);
|
||||||
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
LOGObjectFnStartC("GSWHTMLURLValuedElement");
|
||||||
[self appendURLToResponse:response_
|
[self appendURLToResponse:aResponse
|
||||||
inContext:context_];
|
inContext:aContext];
|
||||||
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
LOGObjectFnStopC("GSWHTMLURLValuedElement");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_appendCGIActionURLToResponse:(GSWResponse*)response_
|
-(void)_appendCGIActionURLToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)computeActionStringInContext:(GSWContext*)context_
|
-(id)computeActionStringInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)computeQueryDictionaryInContext:(GSWContext*)context_
|
-(id)computeQueryDictionaryInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)frameworkNameInContext:(GSWContext*)context_
|
-(NSString*)frameworkNameInContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _frameworkName=nil;
|
NSString* frameworkName=nil;
|
||||||
GSWComponent* _component=[context_ component];
|
GSWComponent* component=[aContext component];
|
||||||
NSDebugMLog(@"framework=%@",framework);
|
NSDebugMLog(@"framework=%@",_framework);
|
||||||
if (framework)
|
if (_framework)
|
||||||
_frameworkName=[framework valueInComponent:_component];
|
frameworkName=[_framework valueInComponent:component];
|
||||||
else
|
else
|
||||||
_frameworkName=[_component frameworkName];
|
frameworkName=[component frameworkName];
|
||||||
return _frameworkName;
|
return frameworkName;
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWKeyValueAssociation.h - GSWeb: Class GSWKeyValueAssociation
|
/** GSWKeyValueAssociation.h - <title>GSWeb: Class GSWKeyValueAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,16 +35,16 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWKeyValueAssociation : GSWAssociation
|
@interface GSWKeyValueAssociation : GSWAssociation
|
||||||
{
|
{
|
||||||
NSString* keyPath;
|
NSString* _keyPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
-(id)initWithKeyPath:(NSString*)keypath_;
|
-(id)initWithKeyPath:(NSString*)aKeyPath;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)copyWithZone:(NSZone*)zone;
|
-(id)copyWithZone:(NSZone*)zone;
|
||||||
|
|
||||||
-(id)valueInObject:(id)object_;
|
-(id)valueInObject:(id)object;
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)aValue
|
||||||
inObject:(id)object_;
|
inObject:(id)object;
|
||||||
-(BOOL)isValueConstant;
|
-(BOOL)isValueConstant;
|
||||||
-(BOOL)isValueSettable;
|
-(BOOL)isValueSettable;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWKeyValueAssociation.m - GSWeb: Class GSWKeyValueAssociation
|
/** GSWKeyValueAssociation.m - <title>GSWeb: Class GSWKeyValueAssociation</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,12 +35,12 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWKeyValueAssociation
|
@implementation GSWKeyValueAssociation
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithKeyPath:(NSString*)keyPath_
|
-(id)initWithKeyPath:(NSString*)aKeyPath
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(keyPath,keyPath_);
|
ASSIGNCOPY(_keyPath,aKeyPath);
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
@ -44,30 +50,30 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
GSWLogMemC("GSWKeyValueAssociation start of dealloc");
|
GSWLogMemC("GSWKeyValueAssociation start of dealloc");
|
||||||
GSWLogAssertGood(self);
|
GSWLogAssertGood(self);
|
||||||
DESTROY(keyPath);
|
DESTROY(_keyPath);
|
||||||
GSWLogMemC("keyPath deallocated");
|
GSWLogMemC("keyPath deallocated");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
GSWLogMemC("GSWKeyValueAssociation end of dealloc");
|
GSWLogMemC("GSWKeyValueAssociation end of dealloc");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)copyWithZone:(NSZone*)zone;
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
GSWKeyValueAssociation* clone = [super copyWithZone:zone];
|
GSWKeyValueAssociation* clone = [super copyWithZone:zone];
|
||||||
ASSIGN(clone->keyPath,keyPath);
|
ASSIGN(clone->_keyPath,_keyPath);
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)valueInObject:(id)object_
|
-(id)valueInObject:(id)object
|
||||||
{
|
{
|
||||||
id retValue=nil;
|
id retValue=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"associations",@"self=%@ ",self);
|
NSDebugMLLog(@"associations",@"self=%@ ",self);
|
||||||
NSDebugMLLog(@"associations",@"keyPath=%@ ",keyPath);
|
NSDebugMLLog(@"associations",@"keyPath=%@ ",_keyPath);
|
||||||
NSDebugMLLog(@"associations",@"object_=%@ ", object_);
|
NSDebugMLLog(@"associations",@"object=%@ ", object);
|
||||||
retValue=[GSWAssociation valueInObject:object_
|
retValue=[GSWAssociation valueInObject:object
|
||||||
forKeyPath:keyPath];
|
forKeyPath:_keyPath];
|
||||||
NSDebugMLLog(@"associations",@"self=%@ retValue=%@ (%p) (class=%@)",
|
NSDebugMLLog(@"associations",@"self=%@ retValue=%@ (%p) (class=%@)",
|
||||||
self,
|
self,
|
||||||
retValue,
|
retValue,
|
||||||
|
@ -79,24 +85,25 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setValue:(id)value_
|
-(void)setValue:(id)aValue
|
||||||
inObject:(id)object_
|
inObject:(id)object
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"associations",@"keyPath=%@ ",keyPath);
|
NSDebugMLLog(@"associations",@"keyPath=%@ ",_keyPath);
|
||||||
NSDebugMLLog(@"associations",@"GSWAssociation: setValue:%@ (self=%@)",value_,self);
|
NSDebugMLLog(@"associations",@"GSWAssociation: setValue:%@ (self=%@)",aValue,self);
|
||||||
if (value_) {
|
if (aValue)
|
||||||
NSDebugMLLog(@"associations",@"value_ class:%@",NSStringFromClass([value_ class]));
|
{
|
||||||
|
NSDebugMLLog(@"associations",@"value_ class:%@",NSStringFromClass([aValue class]));
|
||||||
}
|
}
|
||||||
/*Not Here because self is not a string key !
|
/*Not Here because self is not a string key !
|
||||||
//TODO (return something!)
|
//TODO (return something!)
|
||||||
[object_ validateValue:&value_
|
[object validateValue:&aValue
|
||||||
forKey:self];
|
forKey:self];
|
||||||
*/
|
*/
|
||||||
[GSWAssociation setValue:value_
|
[GSWAssociation setValue:aValue
|
||||||
inObject:object_
|
inObject:object
|
||||||
forKeyPath:keyPath];
|
forKeyPath:_keyPath];
|
||||||
[self logSetValue:value_];
|
[self logSetValue:aValue];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,7 +128,7 @@ static char rcsId[] = "$Id$";
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self];
|
(void*)self];
|
||||||
dscr=[dscr stringByAppendingFormat:@" keyPath=%@>",
|
dscr=[dscr stringByAppendingFormat:@" keyPath=%@>",
|
||||||
keyPath];
|
_keyPath];
|
||||||
return dscr;
|
return dscr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -133,7 +140,7 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)keyPath
|
-(NSString*)keyPath
|
||||||
{
|
{
|
||||||
return keyPath;
|
return _keyPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWMultiKeyDictionary.h - GSWeb: Class GSWMultiKeyDictionary
|
/** GSWMultiKeyDictionary.h - <title>GSWeb: Class GSWMultiKeyDictionary</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,35 +36,35 @@
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@interface GSWMultiKeyDictionary : NSObject
|
@interface GSWMultiKeyDictionary : NSObject
|
||||||
{
|
{
|
||||||
NSMutableDictionary* dict;
|
NSMutableDictionary* _dict;
|
||||||
};
|
};
|
||||||
|
|
||||||
+(id)dictionary;
|
+(id)dictionary;
|
||||||
-(id)init;
|
-(id)init;
|
||||||
-(id)initWithCapacity:(unsigned int)capacity_;
|
-(id)initWithCapacity:(unsigned int)capacity;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
|
|
||||||
|
|
||||||
-(NSEnumerator*)objectEnumerator;
|
-(NSEnumerator*)objectEnumerator;
|
||||||
-(void)removeAllObjects;
|
-(void)removeAllObjects;
|
||||||
-(void)setObject:(id)object_
|
-(void)setObject:(id)object
|
||||||
forKeys:(id)keys_,...;
|
forKeys:(id)keys,...;
|
||||||
-(id)objectForKeys:(id)keys_,...;
|
-(id)objectForKeys:(id)keys,...;
|
||||||
|
|
||||||
-(void)setObject:(id)object_
|
-(void)setObject:(id)object
|
||||||
forKeysArray:(NSArray*)keys_;
|
forKeysArray:(NSArray*)keys;
|
||||||
-(id)objectForKeysArray:(NSArray*)keys_;
|
-(id)objectForKeysArray:(NSArray*)keys;
|
||||||
-(NSArray*)allValues;
|
-(NSArray*)allValues;
|
||||||
-(NSArray*)allKeys;
|
-(NSArray*)allKeys;
|
||||||
-(NSArray*)objectsForKeysArrays:(NSArray*)keys_
|
-(NSArray*)objectsForKeysArrays:(NSArray*)keys
|
||||||
notFoundMarker:(id)notFoundMarker_;
|
notFoundMarker:(id)notFoundMarker;
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_;
|
-(void)makeObjectsPerformSelector:(SEL)selector;
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object_;
|
withObject:(id)object;
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object1_
|
withObject:(id)object1
|
||||||
withObject:(id)object2_;
|
withObject:(id)object2;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif // _GSWMultiKeyDictionary_h__
|
#endif // _GSWMultiKeyDictionary_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWMultiKeyDictionary.m - GSWeb: Class GSWMultiKeyDictionary
|
/** GSWMultiKeyDictionary.m - <title>GSWeb: Class GSWMultiKeyDictionary</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -46,12 +52,12 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(id)initWithCapacity:(unsigned int)capacity_
|
-(id)initWithCapacity:(unsigned int)capacity
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
dict=[[NSMutableDictionary dictionaryWithCapacity:capacity_] retain];
|
_dict=[[NSMutableDictionary dictionaryWithCapacity:capacity] retain];
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -60,7 +66,7 @@ static char rcsId[] = "$Id$";
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
DESTROY(dict);
|
DESTROY(_dict);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,7 +80,7 @@ static char rcsId[] = "$Id$";
|
||||||
(void*)self];
|
(void*)self];
|
||||||
// GSWLogC("GSWMultiKeyDictionary description B");
|
// GSWLogC("GSWMultiKeyDictionary description B");
|
||||||
descr=[descr stringByAppendingFormat:@"dict=%@>",
|
descr=[descr stringByAppendingFormat:@"dict=%@>",
|
||||||
dict];
|
_dict];
|
||||||
// GSWLogC("GSWMultiKeyDictionary description C");
|
// GSWLogC("GSWMultiKeyDictionary description C");
|
||||||
return descr;
|
return descr;
|
||||||
};
|
};
|
||||||
|
@ -82,18 +88,18 @@ static char rcsId[] = "$Id$";
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(NSEnumerator*)objectEnumerator
|
-(NSEnumerator*)objectEnumerator
|
||||||
{
|
{
|
||||||
return [dict objectEnumerator];
|
return [_dict objectEnumerator];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(void)removeAllObjects
|
-(void)removeAllObjects
|
||||||
{
|
{
|
||||||
[dict removeAllObjects];
|
[_dict removeAllObjects];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(void)setObject:(id)object_
|
-(void)setObject:(id)object
|
||||||
forKeys:(id)keys_,...
|
forKeys:(id)keys,...
|
||||||
{
|
{
|
||||||
NSMutableArray* array=nil;
|
NSMutableArray* array=nil;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -101,37 +107,39 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
array = [NSMutableArray array];
|
array = [NSMutableArray array];
|
||||||
|
|
||||||
va_start(ap, keys_);
|
va_start(ap, keys);
|
||||||
|
|
||||||
tmpId = keys_;
|
tmpId = keys;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
[array addObject:tmpId];
|
[array addObject:tmpId];
|
||||||
tmpId = va_arg(ap,id);
|
tmpId = va_arg(ap,id);
|
||||||
}
|
}
|
||||||
while ( tmpId );
|
while(tmpId);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
[self setObject:object_
|
[self setObject:object
|
||||||
forKeysArray:array];
|
forKeysArray:array];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(id)objectForKeys:(id)keys_,...
|
-(id)objectForKeys:(id)keys,...
|
||||||
{
|
{
|
||||||
NSMutableArray* array=nil;
|
NSMutableArray* array=nil;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
id tmpId;
|
id tmpId;
|
||||||
|
|
||||||
array = [NSMutableArray array];
|
array = [NSMutableArray array];
|
||||||
va_start(ap, keys_);
|
va_start(ap, keys);
|
||||||
|
|
||||||
tmpId = keys_;
|
tmpId = keys;
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
[array addObject:tmpId];
|
[array addObject:tmpId];
|
||||||
tmpId = va_arg(ap,id);
|
tmpId = va_arg(ap,id);
|
||||||
}
|
}
|
||||||
while ( tmpId );
|
while(tmpId);
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
|
@ -139,61 +147,61 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(void)setObject:(id)object_
|
-(void)setObject:(id)object
|
||||||
forKeysArray:(NSArray*)keys_
|
forKeysArray:(NSArray*)keys
|
||||||
{
|
{
|
||||||
[dict setObject:object_
|
[_dict setObject:object
|
||||||
forKey:keys_];
|
forKey:keys];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(id)objectForKeysArray:(NSArray*)keys_
|
-(id)objectForKeysArray:(NSArray*)keys
|
||||||
{
|
{
|
||||||
return [dict objectForKey:keys_];
|
return [_dict objectForKey:keys];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(NSArray*)objectsForKeysArrays:(NSArray*)keys_
|
-(NSArray*)objectsForKeysArrays:(NSArray*)keys
|
||||||
notFoundMarker:(id)notFoundMarker_
|
notFoundMarker:(id)notFoundMarker
|
||||||
{
|
{
|
||||||
return [dict objectsForKeys:keys_
|
return [_dict objectsForKeys:keys
|
||||||
notFoundMarker:notFoundMarker_];
|
notFoundMarker:notFoundMarker];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(NSArray*)allValues
|
-(NSArray*)allValues
|
||||||
{
|
{
|
||||||
return [dict allValues];
|
return [_dict allValues];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(NSArray*)allKeys
|
-(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_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object_
|
withObject:(id)object
|
||||||
{
|
{
|
||||||
[dict makeObjectsPerformSelector:selector_
|
[_dict makeObjectsPerformSelector:selector
|
||||||
withObject:object_];
|
withObject:object];
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object1_
|
withObject:(id)object1
|
||||||
withObject:(id)object2_
|
withObject:(id)object2
|
||||||
{
|
{
|
||||||
[dict makeObjectsPerformSelector:selector_
|
[_dict makeObjectsPerformSelector:selector
|
||||||
withObject:object1_
|
withObject:object1
|
||||||
withObject:object2_];
|
withObject:object2];
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWPageDefElement.h - GSWeb: Class GSWPageDefElement
|
/** GSWPageDefElement.h - <title>GSWeb: Class GSWPageDefElement</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,24 +35,24 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWPageDefElement: NSObject <NSCopying>
|
@interface GSWPageDefElement: NSObject <NSCopying>
|
||||||
{
|
{
|
||||||
NSString* elementName;
|
NSString* _elementName;
|
||||||
NSString* className;
|
NSString* _className;
|
||||||
NSMutableDictionary* associations;
|
NSMutableDictionary* _associations;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(id)init;
|
-(id)init;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)copyWithZone:(NSZone *)zone;
|
-(id)copyWithZone:(NSZone *)zone;
|
||||||
-(id)initWithCoder:(NSCoder*)code_;
|
-(id)initWithCoder:(NSCoder*)code;
|
||||||
-(void)encodeWithCoder:(NSCoder*)code_;
|
-(void)encodeWithCoder:(NSCoder*)code;
|
||||||
-(NSString*)elementName;
|
-(NSString*)elementName;
|
||||||
-(void)setElementName:(NSString*)_name;
|
-(void)setElementName:(NSString*)aNname;
|
||||||
-(NSString*)className;
|
-(NSString*)className;
|
||||||
-(void)setClassName:(NSString*)_name;
|
-(void)setClassName:(NSString*)aNname;
|
||||||
-(NSDictionary*)associations;
|
-(NSDictionary*)associations;
|
||||||
-(void)setAssociation:(GSWAssociation*)_association
|
-(void)setAssociation:(GSWAssociation*)association
|
||||||
forKey:(NSString*)_key;
|
forKey:(NSString*)key;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWPageDefElement_h__
|
#endif //_GSWPageDefElement_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWPageDefElement.m - GSWeb: Class GSWPageDefElement
|
/** GSWPageDefElement.m - <title>GSWeb: Class GSWPageDefElement</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
Date: Jan 1999
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -45,11 +51,11 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
// NSDebugFLLog(@"low",@"Dealloc GSWPageDefElement=%p",(void*)self);
|
// NSDebugFLLog(@"low",@"Dealloc GSWPageDefElement=%p",(void*)self);
|
||||||
// GSWLogC("Dealloc GSWPageDefElement: elementName");
|
// GSWLogC("Dealloc GSWPageDefElement: elementName");
|
||||||
DESTROY(elementName);
|
DESTROY(_elementName);
|
||||||
// GSWLogC("Dealloc GSWPageDefElement: className");
|
// GSWLogC("Dealloc GSWPageDefElement: className");
|
||||||
DESTROY(className);
|
DESTROY(_className);
|
||||||
// GSWLogC("Dealloc GSWPageDefElement: associations");
|
// GSWLogC("Dealloc GSWPageDefElement: associations");
|
||||||
DESTROY(associations);
|
DESTROY(_associations);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
// GSWLogC("End Dealloc GSWPageDefElement");
|
// GSWLogC("End Dealloc GSWPageDefElement");
|
||||||
}
|
}
|
||||||
|
@ -58,74 +64,74 @@ static char rcsId[] = "$Id$";
|
||||||
-(id)copyWithZone:(NSZone*)zone
|
-(id)copyWithZone:(NSZone*)zone
|
||||||
{
|
{
|
||||||
GSWPageDefElement* clone = [[isa allocWithZone:zone] init];
|
GSWPageDefElement* clone = [[isa allocWithZone:zone] init];
|
||||||
ASSIGNCOPY(clone->elementName,elementName);
|
ASSIGNCOPY(clone->_elementName,_elementName);
|
||||||
ASSIGNCOPY(clone->className,className);
|
ASSIGNCOPY(clone->_className,_className);
|
||||||
ASSIGNCOPY(clone->associations,associations);
|
ASSIGNCOPY(clone->_associations,_associations);
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithCoder:(NSCoder*)coder_
|
-(id)initWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&elementName];
|
at:&_elementName];
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&className];
|
at:&_className];
|
||||||
[coder_ decodeValueOfObjCType:@encode(id)
|
[coder decodeValueOfObjCType:@encode(id)
|
||||||
at:&associations];
|
at:&_associations];
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)encodeWithCoder:(NSCoder*)coder_
|
-(void)encodeWithCoder:(NSCoder*)coder
|
||||||
{
|
{
|
||||||
[coder_ encodeObject:elementName];
|
[coder encodeObject:_elementName];
|
||||||
[coder_ encodeObject:className];
|
[coder encodeObject:_className];
|
||||||
[coder_ encodeObject:associations];
|
[coder encodeObject:_associations];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)elementName
|
-(NSString*)elementName
|
||||||
{
|
{
|
||||||
return elementName;
|
return _elementName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setElementName:(NSString*)_name
|
-(void)setElementName:(NSString*)aName
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(elementName,_name);
|
ASSIGNCOPY(_elementName,aName);
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)className
|
-(NSString*)className
|
||||||
{
|
{
|
||||||
return className;
|
return _className;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setClassName:(NSString*)_name
|
-(void)setClassName:(NSString*)aName
|
||||||
{
|
{
|
||||||
ASSIGNCOPY(className,_name);
|
ASSIGNCOPY(_className,aName);
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)associations
|
-(NSDictionary*)associations
|
||||||
{
|
{
|
||||||
return associations;
|
return _associations;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setAssociation:(GSWAssociation*)_association
|
-(void)setAssociation:(GSWAssociation*)association
|
||||||
forKey:(NSString*)_key
|
forKey:(NSString*)key
|
||||||
{
|
{
|
||||||
if (!associations)
|
if (!_associations)
|
||||||
associations=[NSMutableDictionary new];
|
_associations=[NSMutableDictionary new];
|
||||||
[associations setObject:_association
|
[_associations setObject:association
|
||||||
forKey:_key];
|
forKey:key];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -134,8 +140,8 @@ static char rcsId[] = "$Id$";
|
||||||
return [NSString stringWithFormat:@"<%@ %p elementName:[%@] className:[%@] associations:\n%@",
|
return [NSString stringWithFormat:@"<%@ %p elementName:[%@] className:[%@] associations:\n%@",
|
||||||
[self class],
|
[self class],
|
||||||
(void*)self,
|
(void*)self,
|
||||||
elementName,
|
_elementName,
|
||||||
className,
|
_className,
|
||||||
associations];
|
_associations];
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWPageDefParserExt.h - GSWeb: Class GSWPageElementParser: Categories
|
/** GSWPageDefParserExt.h - <title>GSWeb: Class GSWPageDefParserExt</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -32,14 +37,14 @@
|
||||||
-(NSDictionary*)elements;
|
-(NSDictionary*)elements;
|
||||||
-(NSArray*)includes;
|
-(NSArray*)includes;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(void)reportErrorWithException:(NSException*)_exception;
|
-(void)reportErrorWithException:(NSException*)exception;
|
||||||
-(void)reportError:(NSString*)_text;
|
-(void)reportError:(NSString*)text;
|
||||||
-(void)reportWarning:(NSString*)_text;
|
-(void)reportWarning:(NSString*)text;
|
||||||
-(BOOL)isError;
|
-(BOOL)isError;
|
||||||
-(BOOL)isWarning;
|
-(BOOL)isWarning;
|
||||||
-(NSArray*)errors;
|
-(NSArray*)errors;
|
||||||
-(NSArray*)warnings;
|
-(NSArray*)warnings;
|
||||||
-(NSString*)unescapedString:(NSString*)string_;
|
-(NSString*)unescapedString:(NSString*)string;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWPageDefParserExt_h__
|
#endif //_GSWPageDefParserExt_h__
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/* GSWPageDefParserExt.m - GSWeb: Class GSWPageDefParser: Categories
|
/** GSWPageDefParserExt.m - <title>GSWeb: Class GSWPageDefParserExt</title>
|
||||||
|
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
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)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
error=[NSString stringWithFormat:@"Parsing Exception: %@ (Reason:%@)",
|
||||||
[_exception description],
|
[exception description],
|
||||||
[_exception reason]];
|
[exception reason]];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportError:(NSString*)_text
|
-(void)reportError:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _error=nil;
|
NSString* error=nil;
|
||||||
if (!errors)
|
if (!errors)
|
||||||
errors=[NSMutableArray new];
|
errors=[NSMutableArray new];
|
||||||
_error=[NSString stringWithFormat:@"Parsing Error: %@",
|
error=[NSString stringWithFormat:@"Parsing Error: %@",
|
||||||
_text];
|
text];
|
||||||
[errors addObject:_error];
|
[errors addObject:error];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)reportWarning:(NSString*)_text
|
-(void)reportWarning:(NSString*)text
|
||||||
{
|
{
|
||||||
NSString* _warning=nil;
|
NSString* warning=nil;
|
||||||
if (!warnings)
|
if (!warnings)
|
||||||
warnings=[NSMutableArray new];
|
warnings=[NSMutableArray new];
|
||||||
_warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
warning=[NSString stringWithFormat:@"Parsing Warning: %@",
|
||||||
_text];
|
text];
|
||||||
[warnings addObject:_warning];
|
[warnings addObject:warning];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -115,24 +120,24 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)unescapedString:(NSString*)string_
|
-(NSString*)unescapedString:(NSString*)aString
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
string_=[string_ stringByReplacingString:@"\\n"
|
aString=[aString stringByReplacingString:@"\\n"
|
||||||
withString:@"\n"];
|
withString:@"\n"];
|
||||||
string_=[string_ stringByReplacingString:@"\\r"
|
aString=[aString stringByReplacingString:@"\\r"
|
||||||
withString:@"\r"];
|
withString:@"\r"];
|
||||||
string_=[string_ stringByReplacingString:@"\\t"
|
aString=[aString stringByReplacingString:@"\\t"
|
||||||
withString:@"\t"];
|
withString:@"\t"];
|
||||||
string_=[string_ stringByReplacingString:@"\\b"
|
aString=[aString stringByReplacingString:@"\\b"
|
||||||
withString:@"\b"];
|
withString:@"\b"];
|
||||||
string_=[string_ stringByReplacingString:@"\\f"
|
aString=[aString stringByReplacingString:@"\\f"
|
||||||
withString:@"\f"];
|
withString:@"\f"];
|
||||||
string_=[string_ stringByReplacingString:@"\\\""
|
aString=[aString stringByReplacingString:@"\\\""
|
||||||
withString:@"\""];
|
withString:@"\""];
|
||||||
string_=[string_ stringByReplacingString:@"\\\'"
|
aString=[aString stringByReplacingString:@"\\\'"
|
||||||
withString:@"\'"];
|
withString:@"\'"];
|
||||||
return string_;
|
return aString;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWParam.m - GSWeb: Class GSWParam
|
/** GSWParam.m - <title>GSWeb: Class GSWParam</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -28,12 +34,12 @@ static char rcsId[] = "$Id$";
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWParam
|
@implementation GSWParam
|
||||||
|
|
||||||
-(id) initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
contentElements:(NSArray*)elements_
|
contentElements:(NSArray*)elements
|
||||||
target:(id)target_
|
target:(id)target
|
||||||
key:(NSString*)key_
|
key:(NSString*)key
|
||||||
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull_
|
treatNilValueAsGSWNull:(BOOL)treatNilValueAsGSWNull
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -41,9 +47,9 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
contentElements:(NSArray*)elements_
|
contentElements:(NSArray*)elements
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -75,8 +81,8 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWParam (GSWParamA)
|
@implementation GSWParam (GSWParamA)
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -87,15 +93,15 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWParam (GSWParamB)
|
@implementation GSWParam (GSWParamB)
|
||||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response_
|
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(id)valueInComponent:(id)component_
|
-(id)valueInComponent:(id)component
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWProjectBundle.h - GSWeb: Class GSWProjectBundle
|
/** GSWProjectBundle - <title>GSWeb: Class GSWProjectBundle</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,20 +36,20 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWProjectBundle : GSWDeployedBundle
|
@interface GSWProjectBundle : GSWDeployedBundle
|
||||||
{
|
{
|
||||||
NSString* projectName;
|
NSString* _projectName;
|
||||||
NSDictionary* subprojects;
|
NSDictionary* _subprojects;
|
||||||
NSDictionary* pbProjectDictionary;
|
NSDictionary* _pbProjectDictionary;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithPath:(NSString*)path_;
|
-(id)initWithPath:(NSString*)aPath;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)description;
|
-(NSString*)description;
|
||||||
-(NSArray*)lockedPathsForResourcesOfType:(id)type_;
|
-(NSArray*)lockedPathsForResourcesOfType:(id)aType;
|
||||||
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)type_;
|
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)aType;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_;
|
forLanguage:(NSString*)aLanguage;
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(NSDictionary*)subprojects;
|
-(NSDictionary*)subprojects;
|
||||||
-(BOOL)isFramework;
|
-(BOOL)isFramework;
|
||||||
-(GSWDeployedBundle*)projectBundle;
|
-(GSWDeployedBundle*)projectBundle;
|
||||||
|
@ -54,8 +60,8 @@
|
||||||
|
|
||||||
|
|
||||||
@interface GSWProjectBundle (GSWProjectBundle)
|
@interface GSWProjectBundle (GSWProjectBundle)
|
||||||
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)name_
|
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)aName
|
||||||
isFramework:(BOOL)isFramework_;
|
isFramework:(BOOL)isFramework;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** GSWProjectBundle.m - <title>GSWeb: Class GSWProjectBundle</title>
|
/** GSWProjectBundle.m - <title>GSWeb: Class GSWProjectBundle</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
@ -33,16 +34,14 @@ static char rcsId[] = "$Id$";
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
#include <Foundation/NSFileManager.h>
|
#include <Foundation/NSFileManager.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWProjectBundle
|
@implementation GSWProjectBundle
|
||||||
|
|
||||||
-(id)initWithPath:(NSString*)path_
|
-(id)initWithPath:(NSString*)aPath
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"path_=%@",path_);
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
||||||
if ((self=[super initWithPath:path_]))
|
if ((self=[super initWithPath:aPath]))
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
};
|
};
|
||||||
|
@ -53,9 +52,9 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)dealloc
|
-(void)dealloc
|
||||||
{
|
{
|
||||||
DESTROY(projectName);
|
DESTROY(_projectName);
|
||||||
DESTROY(subprojects);
|
DESTROY(_subprojects);
|
||||||
DESTROY(pbProjectDictionary);
|
DESTROY(_pbProjectDictionary);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,49 +64,49 @@ static char rcsId[] = "$Id$";
|
||||||
return [NSString stringWithFormat:@"<%s %p - bundlePath:[%@] relativePaths:[%@] projectName:[%@] subprojects:[%@] pbProjectDictionary:[%@]>",
|
return [NSString stringWithFormat:@"<%s %p - bundlePath:[%@] relativePaths:[%@] projectName:[%@] subprojects:[%@] pbProjectDictionary:[%@]>",
|
||||||
object_get_class_name(self),
|
object_get_class_name(self),
|
||||||
(void*)self,
|
(void*)self,
|
||||||
bundlePath,
|
_bundlePath,
|
||||||
relativePathsCache,
|
_relativePathsCache,
|
||||||
projectName,
|
_projectName,
|
||||||
subprojects,
|
_subprojects,
|
||||||
pbProjectDictionary];
|
_pbProjectDictionary];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSArray*)lockedPathsForResourcesOfType:(id)type_
|
-(NSArray*)lockedPathsForResourcesOfType:(id)aType
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return [super lockedPathsForResourcesOfType:type_];
|
return [super lockedPathsForResourcesOfType:aType];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)type_
|
-(NSArray*)lockedPathsForResourcesInSubprojectsOfType:(id)aType
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguage:(NSString*)language_
|
forLanguage:(NSString*)aLanguage
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return [super lockedRelativePathForResourceNamed:name_
|
return [super lockedRelativePathForResourceNamed:aName
|
||||||
forLanguage:language_];
|
forLanguage:aLanguage];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)name_
|
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||||
forLanguages:(NSArray*)languages_
|
forLanguages:(NSArray*)someLanguages
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return [super lockedRelativePathForResourceNamed:name_
|
return [super lockedRelativePathForResourceNamed:aName
|
||||||
forLanguages:languages_];
|
forLanguages:someLanguages];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)subprojects
|
-(NSDictionary*)subprojects
|
||||||
{
|
{
|
||||||
return subprojects;
|
return _subprojects;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -134,98 +133,99 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)projectName
|
-(NSString*)projectName
|
||||||
{
|
{
|
||||||
return projectName;
|
return _projectName;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)_pbProjectDictionary
|
-(NSDictionary*)_pbProjectDictionary
|
||||||
{
|
{
|
||||||
return pbProjectDictionary;
|
return _pbProjectDictionary;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWProjectBundle (GSWProjectBundle)
|
@implementation GSWProjectBundle (GSWProjectBundle)
|
||||||
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)name_
|
+(GSWDeployedBundle*)projectBundleForProjectNamed:(NSString*)aName
|
||||||
isFramework:(BOOL)isFramework_
|
isFramework:(BOOL)isFramework
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
//name:ObjCTest3
|
//name:ObjCTest3
|
||||||
GSWDeployedBundle* _projectBundle=nil;
|
GSWDeployedBundle* projectBundle=nil;
|
||||||
GSWDeployedBundle* _aBundle=nil;
|
GSWDeployedBundle* aBundle=nil;
|
||||||
NSArray* _projectSearchPath=nil;
|
NSArray* projectSearchPath=nil;
|
||||||
NSMutableArray* _projectsBundles=nil;
|
NSMutableArray* projectsBundles=nil;
|
||||||
NSEnumerator* _projectEnum = nil;
|
NSEnumerator* projectEnum = nil;
|
||||||
NSEnumerator* _projectSearchPathEnum=nil;
|
NSEnumerator* projectSearchPathEnum=nil;
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"bundles",@"name_:%@",name_);
|
NSDebugMLLog(@"bundles",@"aName:%@",aName);
|
||||||
NSDebugMLLog(@"bundles",@"isFramework_=%s",(isFramework_ ? "YES" : "NO"));
|
NSDebugMLLog(@"bundles",@"isFramework=%s",(isFramework ? "YES" : "NO"));
|
||||||
|
|
||||||
_projectSearchPath=[GSWApplication projectSearchPath]; // ("H:\\Wotests")
|
projectSearchPath=[GSWApplication projectSearchPath]; // ("H:\\Wotests")
|
||||||
NSDebugMLLog(@"bundles",@"_projectSearchPath:%@",_projectSearchPath);
|
NSDebugMLLog(@"bundles",@"projectSearchPath:%@",projectSearchPath);
|
||||||
_projectsBundles=[NSMutableArray array];
|
projectsBundles=[NSMutableArray array];
|
||||||
|
|
||||||
_projectSearchPathEnum = [_projectSearchPath objectEnumerator];
|
projectSearchPathEnum = [projectSearchPath objectEnumerator];
|
||||||
while ((_path = [_projectSearchPathEnum nextObject]))
|
while ((path = [projectSearchPathEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSDirectoryEnumerator* dirEnum=nil;
|
NSDirectoryEnumerator* dirEnum=nil;
|
||||||
NSString* filePath=nil;
|
NSString* filePath=nil;
|
||||||
NSFileManager* fileManager=[NSFileManager defaultManager];
|
NSFileManager* fileManager=[NSFileManager defaultManager];
|
||||||
dirEnum = [fileManager enumeratorAtPath:_path];
|
dirEnum = [fileManager enumeratorAtPath:path];
|
||||||
while ((filePath = [dirEnum nextObject]))
|
while ((filePath = [dirEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSDictionary* attributes = [dirEnum fileAttributes];
|
NSDictionary* attributes = [dirEnum fileAttributes];
|
||||||
NSString* fileType = [attributes objectForKey:NSFileType];
|
NSString* fileType = [attributes objectForKey:NSFileType];
|
||||||
filePath=[_path stringByAppendingFormat:@"/%@",filePath];
|
filePath=[path stringByAppendingFormat:@"/%@",filePath];
|
||||||
NSDebugMLLog(@"bundles",@"filePath:%@",filePath);
|
NSDebugMLLog(@"bundles",@"filePath:%@",filePath);
|
||||||
// NSDebugMLLog(@"bundles",@"attributes:%@",attributes);
|
// NSDebugMLLog(@"bundles",@"attributes:%@",attributes);
|
||||||
// NSDebugMLLog(@"bundles",@"fileType:%@",fileType);
|
// NSDebugMLLog(@"bundles",@"fileType:%@",fileType);
|
||||||
if ([fileType isEqual:NSFileTypeDirectory])
|
if ([fileType isEqual:NSFileTypeDirectory])
|
||||||
{
|
{
|
||||||
BOOL _tmpBundleIsFramework=NO;
|
BOOL tmpBundleIsFramework=NO;
|
||||||
NSString* _tmpBundleProjectName=nil;
|
NSString* tmpBundleProjectName=nil;
|
||||||
GSWDeployedBundle* _tmpBundle=[GSWProjectBundle bundleWithPath:filePath];
|
GSWDeployedBundle* tmpBundle=(GSWDeployedBundle*)[GSWProjectBundle bundleWithPath:filePath];
|
||||||
NSDebugMLLog(@"bundles",@"_tmpBundle:%@",_tmpBundle);
|
NSDebugMLLog(@"bundles",@"tmpBundle:%@",tmpBundle);
|
||||||
_tmpBundleProjectName=[_tmpBundle projectName];
|
tmpBundleProjectName=[tmpBundle projectName];
|
||||||
NSDebugMLLog(@"bundles",@"_tmpBundleProjectName:%@",_tmpBundleProjectName);
|
NSDebugMLLog(@"bundles",@"tmpBundleProjectName:%@",tmpBundleProjectName);
|
||||||
_tmpBundleIsFramework=[_tmpBundle isFramework];
|
tmpBundleIsFramework=[tmpBundle isFramework];
|
||||||
NSDebugMLLog(@"bundles",@"_tmpBundleIsFramework=%s",(_tmpBundleIsFramework ? "YES" : "NO"));
|
NSDebugMLLog(@"bundles",@"tmpBundleIsFramework=%s",
|
||||||
|
(tmpBundleIsFramework ? "YES" : "NO"));
|
||||||
//Why projectName...
|
//Why projectName...
|
||||||
if ((isFramework_ && _tmpBundleIsFramework)
|
if ((isFramework && tmpBundleIsFramework)
|
||||||
||(!isFramework_ && !_tmpBundleIsFramework))
|
||(!isFramework && !tmpBundleIsFramework))
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"bundles",@"adding _tmpBundle:%@",_tmpBundleProjectName);
|
NSDebugMLLog(@"bundles",@"adding tmpBundle:%@",tmpBundleProjectName);
|
||||||
[_projectsBundles addObject:_tmpBundle];
|
[projectsBundles addObject:tmpBundle];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_projectEnum =[_projectsBundles objectEnumerator];
|
projectEnum =[projectsBundles objectEnumerator];
|
||||||
while(!_projectBundle && (_aBundle = [_projectEnum nextObject]))
|
while(!projectBundle && (aBundle = [projectEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSString* suffix1=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
|
NSString* suffix1=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConv];
|
||||||
NSString* suffix2=isFramework_ ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
|
NSString* suffix2=isFramework ? GSFrameworkPSuffix : GSWApplicationPSuffix[GSWebNamingConvInversed];
|
||||||
NSDebugMLLog(@"bundles",@"suffix1:%@ suffix2",suffix1,suffix2);
|
NSDebugMLLog(@"bundles",@"suffix1:%@ suffix2",suffix1,suffix2);
|
||||||
NSDebugMLLog(@"bundles",@"_aBundle:%@",_aBundle);
|
NSDebugMLLog(@"bundles",@"aBundle:%@",aBundle);
|
||||||
|
|
||||||
if ([[_aBundle bundlePath]hasSuffix:suffix1]
|
if ([[aBundle bundlePath]hasSuffix:suffix1]
|
||||||
|| [[_aBundle bundlePath]hasSuffix:suffix2]
|
|| [[aBundle bundlePath]hasSuffix:suffix2]
|
||||||
|| [[_aBundle bundlePath]hasSuffix:@".debug"])
|
|| [[aBundle bundlePath]hasSuffix:@".debug"])
|
||||||
{
|
{
|
||||||
NSString* _tmpName=[_aBundle projectName];
|
NSString* tmpName=[aBundle projectName];
|
||||||
NSDebugMLLog(@"bundles",@"_tmpName:%@",_tmpName);
|
NSDebugMLLog(@"bundles",@"tmpName:%@",tmpName);
|
||||||
if ([_tmpName isEqual:name_])
|
if ([tmpName isEqual:aName])
|
||||||
{
|
{
|
||||||
_projectBundle=_aBundle;
|
projectBundle=aBundle;
|
||||||
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
|
NSDebugMLLog(@"bundles",@"projectBundle:%@",projectBundle);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"bundles",@"_projectBundle:%@",_projectBundle);
|
NSDebugMLLog(@"bundles",@"projectBundle:%@",projectBundle);
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
return _projectBundle;
|
return projectBundle;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
/* GSWQuickTime.h - GSWeb: Class GSWQuickTime
|
/** GSWQuickTime.h - <title>GSWeb: Class GSWQuickTime</title>
|
||||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||||
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.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -30,57 +38,57 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWNestedList: GSWDynamicElement
|
@interface GSWNestedList: GSWDynamicElement
|
||||||
{
|
{
|
||||||
NSMutableDictionary* associations;
|
NSMutableDictionary* _associations;
|
||||||
GSWAssociation* src;
|
GSWAssociation* _src;
|
||||||
GSWAssociation* filename;
|
GSWAssociation* _filename;
|
||||||
GSWAssociation* hotspotList;
|
GSWAssociation* _hotspotList;
|
||||||
GSWAssociation* framework;
|
GSWAssociation* _framework;
|
||||||
GSWAssociation* width;
|
GSWAssociation* _width;
|
||||||
GSWAssociation* height;
|
GSWAssociation* _height;
|
||||||
GSWAssociation* action;
|
GSWAssociation* _action;
|
||||||
GSWAssociation* selection;
|
GSWAssociation* _selection;
|
||||||
GSWAssociation* loop;
|
GSWAssociation* _loop;
|
||||||
GSWAssociation* volume;
|
GSWAssociation* _volume;
|
||||||
GSWAssociation* scale;
|
GSWAssociation* _scale;
|
||||||
GSWAssociation* pluginsPage;
|
GSWAssociation* _pluginsPage;
|
||||||
GSWAssociation* pluginsPageName;
|
GSWAssociation* _pluginsPageName;
|
||||||
GSWAssociation* href;
|
GSWAssociation* _href;
|
||||||
GSWAssociation* pageName;
|
GSWAssociation* _pageName;
|
||||||
GSWAssociation* bgcolor;
|
GSWAssociation* _bgcolor;
|
||||||
GSWAssociation* target;
|
GSWAssociation* _target;
|
||||||
GSWAssociation* pan;
|
GSWAssociation* _pan;
|
||||||
GSWAssociation* tilt;
|
GSWAssociation* _tilt;
|
||||||
GSWAssociation* fov;
|
GSWAssociation* _fov;
|
||||||
GSWAssociation* node;
|
GSWAssociation* _node;
|
||||||
GSWAssociation* correction;
|
GSWAssociation* _correction;
|
||||||
GSWAssociation* cache;
|
GSWAssociation* _cache;
|
||||||
GSWAssociation* autoplay;
|
GSWAssociation* _autoplay;
|
||||||
GSWAssociation* autostart;
|
GSWAssociation* _autostart;
|
||||||
GSWAssociation* hidden;
|
GSWAssociation* _hidden;
|
||||||
GSWAssociation* playEveryFrame;
|
GSWAssociation* _playEveryFrame;
|
||||||
GSWAssociation* controller;
|
GSWAssociation* _controller;
|
||||||
GSWAssociation* prefixHost;
|
GSWAssociation* _prefixHost;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(GSWElement*)invokeActionForRequest:(GSWRequest*)request_
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)appendToResponse:(GSWResponse*)response_
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)addHRefToResponse:(GSWResponse*)response_
|
-(void)addHRefToResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(id)_generateURL:(id)u;
|
-(id)_generateURL:(id)u;
|
||||||
-(id)_prefixedURL:(id)u
|
-(id)_prefixedURL:(id)u
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)addToResponse:(GSWResponse*)response_
|
-(void)addToResponse:(GSWResponse*)aResponse
|
||||||
tag:(id)tag_
|
tag:(id)tag
|
||||||
value:(id)value_;
|
value:(id)value;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(id)init;
|
-(id)init;
|
||||||
-(id)initWithName:(NSString*)name_
|
-(id)initWithName:(NSString*)name
|
||||||
associations:(NSDictionary*)associations_
|
associations:(NSDictionary*)associations
|
||||||
template:(GSWElement*)templateElement_;
|
template:(GSWElement*)templateElement;
|
||||||
-(BOOL)booleanValueOfBinding:(id)binding_
|
-(BOOL)booleanValueOfBinding:(id)binding
|
||||||
inComponent:(id)component_;
|
inComponent:(id)component;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWQuickTime_h__
|
#endif //_GSWQuickTime_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWRequestHandler.h - GSWeb: Class GSWRequestHandler
|
/** GSWRequestHandler.h - <title>GSWeb: Class GSWRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -29,13 +35,13 @@
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWRequestHandler : NSObject <NSLocking>
|
@interface GSWRequestHandler : NSObject <NSLocking>
|
||||||
{
|
{
|
||||||
NSRecursiveLock* selfLock;
|
NSRecursiveLock* _selfLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int selfLockn;
|
int _selfLockn;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
|
||||||
-(void)lock;
|
-(void)lock;
|
||||||
-(void)unlock;
|
-(void)unlock;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWRequestHandler.m - GSWeb: Class GSWRequestHandler
|
/** GSWRequestHandler.m - <title>GSWeb: Class GSWRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,7 +35,7 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWRequestHandler
|
@implementation GSWRequestHandler
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWResourceRequestHandler.h - GSWeb: Class GSWResourceRequestHandler
|
/** GSWResourceRequestHandler.h - <title>GSWeb: Class GSWResourceRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -31,12 +37,12 @@
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_;
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest;
|
||||||
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)_path;
|
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)aPath;
|
||||||
-(GSWResponse*)_responseForDataAtPath:(NSString*)_path;
|
-(GSWResponse*)_responseForDataAtPath:(NSString*)aPath;
|
||||||
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)_key;
|
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)aKey;
|
||||||
-(GSWResponse*)_generateResponseForData:(NSData*)_data
|
-(GSWResponse*)_generateResponseForData:(NSData*)aData
|
||||||
mimeType:(NSString*)_mimeType;
|
mimeType:(NSString*)mimeType;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWResourceRequestHandler.m - GSWeb: Class GSWResourceRequestHandler
|
/** GSWResourceRequestHandler.m - <title>GSWeb: Class GSWResourceRequestHandler</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Feb 1999
|
Date: Feb 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,74 +35,74 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWResourceRequestHandler
|
@implementation GSWResourceRequestHandler
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)request_
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
// /cgi/GSWeb.exe/ObjCTest3.gswa/wr?gswdata=0
|
// /GSWeb/ObjCTest3.gswa/wr?gswdata=0
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
NSString* _gswdata=nil;
|
NSString* gswdata=nil;
|
||||||
NSDictionary* _elements=nil;
|
NSDictionary* elements=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_elements=[request_ uriOrFormOrCookiesElements];
|
elements=[aRequest uriOrFormOrCookiesElements];
|
||||||
NSDebugMLog(@"_elements=%@",_elements);
|
NSDebugMLog(@"elements=%@",elements);
|
||||||
_gswdata=[_elements objectForKey:GSWKey_Data[GSWebNamingConv]];
|
gswdata=[elements objectForKey:GSWKey_Data[GSWebNamingConv]];
|
||||||
NSDebugMLog(@"_gswdata=%@",_gswdata);
|
NSDebugMLog(@"gswdata=%@",gswdata);
|
||||||
if (_gswdata)
|
if (gswdata)
|
||||||
_response=[self _responseForDataCachedWithKey:_gswdata];
|
response=[self _responseForDataCachedWithKey:gswdata];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWResourceRequestHandler",@"No data key in request");
|
ExceptionRaise0(@"GSWResourceRequestHandler",@"No data key in request");
|
||||||
LOGError0(@"");//TODO
|
LOGError0(@"");//TODO
|
||||||
};
|
};
|
||||||
NSDebugMLog(@"_response=%@",_response);
|
NSDebugMLog(@"response=%@",response);
|
||||||
[_response _finalizeInContext:nil];
|
[response _finalizeInContext:nil];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)_path
|
-(GSWResponse*)_responseForJavaClassAtPath:(NSString*)aPath
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)_responseForDataAtPath:(NSString*)_path
|
-(GSWResponse*)_responseForDataAtPath:(NSString*)aPath
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)_key
|
-(GSWResponse*)_responseForDataCachedWithKey:(NSString*)aKey
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWResponse* _response=nil;
|
GSWResponse* response=nil;
|
||||||
GSWResourceManager* _resourceManager=nil;
|
GSWResourceManager* resourceManager=nil;
|
||||||
GSWURLValuedElementData* _data=nil;
|
GSWURLValuedElementData* data=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLog(@"_key=%@",_key);
|
NSDebugMLog(@"aKey=%@",aKey);
|
||||||
_response=[[GSWResponse new]autorelease];
|
response=[[GSWResponse new]autorelease];
|
||||||
_resourceManager=[[GSWApplication application] resourceManager];
|
resourceManager=[[GSWApplication application] resourceManager];
|
||||||
_data=[_resourceManager _cachedDataForKey:_key];
|
data=[resourceManager _cachedDataForKey:aKey];
|
||||||
NSDebugMLog(@"_data=%@",_data);
|
NSDebugMLog(@"data=%@",data);
|
||||||
if (_data)
|
if (data)
|
||||||
[_data appendToResponse:_response
|
[data appendToResponse:response
|
||||||
inContext:nil];
|
inContext:nil];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LOGSeriousError(@"No data for _key %@",
|
LOGSeriousError(@"No data for _key %@",
|
||||||
_key);
|
key);
|
||||||
//TODO
|
//TODO
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _response;
|
return response;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWResponse*)_generateResponseForData:(NSData*)_data
|
-(GSWResponse*)_generateResponseForData:(NSData*)aData
|
||||||
mimeType:(NSString*)_mimeType
|
mimeType:(NSString*)mimeType
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWStatisticsStore.h - GSWeb: Class GSWStatisticsStore
|
/** GSWStatisticsStore.h - <title>GSWeb: Class GSWStatisticsStore</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
// $Id$
|
|
||||||
|
|
||||||
#ifndef _GSWStatisticsStore_h__
|
#ifndef _GSWStatisticsStore_h__
|
||||||
#define _GSWStatisticsStore_h__
|
#define _GSWStatisticsStore_h__
|
||||||
|
@ -29,46 +33,46 @@
|
||||||
|
|
||||||
@interface GSWStatisticsStore : NSObject <NSLocking>
|
@interface GSWStatisticsStore : NSObject <NSLocking>
|
||||||
{
|
{
|
||||||
NSRecursiveLock* selfLock;
|
NSRecursiveLock* _selfLock;
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
int selfLockn;
|
int _selfLockn;
|
||||||
#endif
|
#endif
|
||||||
int transactionMovingAverageSampleCount;
|
int _transactionMovingAverageSampleCount;
|
||||||
int sessionMovingAverageSampleCount;
|
int _sessionMovingAverageSampleCount;
|
||||||
int transactionsCount;
|
int _transactionsCount;
|
||||||
int lastStatsTransactionsCount;
|
int _lastStatsTransactionsCount;
|
||||||
int directActionTransactionsCount;
|
int _directActionTransactionsCount;
|
||||||
int componentActionTransactionsCount;
|
int _componentActionTransactionsCount;
|
||||||
int sessionsCount;
|
int _sessionsCount;
|
||||||
int lastStatsSessionsCount;
|
int _lastStatsSessionsCount;
|
||||||
int maxActiveSessionsCount;
|
int _maxActiveSessionsCount;
|
||||||
NSDate* maxActiveSessionsDate;
|
NSDate* _maxActiveSessionsDate;
|
||||||
float averageRequestsPerSession;
|
float _averageRequestsPerSession;
|
||||||
double averageSessionLife;
|
double _averageSessionLife;
|
||||||
NSArray* lastSessionStatistics;
|
NSArray* _lastSessionStatistics;
|
||||||
double movingAverageSessionLife;
|
double _movingAverageSessionLife;
|
||||||
float movingAverageRequestsPerSession;
|
float _movingAverageRequestsPerSession;
|
||||||
int movingAverageSessionsCount;
|
int _movingAverageSessionsCount;
|
||||||
NSDate* startDate;
|
NSDate* _startDate;
|
||||||
NSDate* lastStatsDate;
|
NSDate* _lastStatsDate;
|
||||||
double lastWillHandleRequestTimeInterval;
|
double _lastWillHandleRequestTimeInterval;
|
||||||
double lastDidHandleRequestTimeInterval;
|
double _lastDidHandleRequestTimeInterval;
|
||||||
double totalIdleTimeInterval;
|
double _totalIdleTimeInterval;
|
||||||
double totalTransactionTimeInterval;
|
double _totalTransactionTimeInterval;
|
||||||
double totalDATransactionTimeInterval;
|
double _totalDATransactionTimeInterval;
|
||||||
double totalCATransactionTimeInterval;
|
double _totalCATransactionTimeInterval;
|
||||||
double movingIdleTimeInterval;
|
double _movingIdleTimeInterval;
|
||||||
double movingTransactionTimeInterval;
|
double _movingTransactionTimeInterval;
|
||||||
int movingAverageTransactionsCount;
|
int _movingAverageTransactionsCount;
|
||||||
NSDictionary* initializationMemory;
|
NSDictionary* _initializationMemory;
|
||||||
NSMutableDictionary* pagesStatistics;
|
NSMutableDictionary* _pagesStatistics;
|
||||||
NSString* currentPage;
|
NSString* _currentPage;
|
||||||
NSMutableDictionary* pathsStatistics;
|
NSMutableDictionary* _pathsStatistics;
|
||||||
NSString* logPath;
|
NSString* _logPath;
|
||||||
double logRotation;
|
double _logRotation;
|
||||||
NSDate* logCreationDate;
|
NSDate* _logCreationDate;
|
||||||
NSString* password;
|
NSString* _password;
|
||||||
NSMutableDictionary* directActionStatistics;
|
NSMutableDictionary* _directActionStatistics;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)init;
|
-(id)init;
|
||||||
|
@ -78,22 +82,22 @@
|
||||||
-(void)lock;
|
-(void)lock;
|
||||||
-(id)statistics;
|
-(id)statistics;
|
||||||
-(int)sessionMovingAverageSampleSize;
|
-(int)sessionMovingAverageSampleSize;
|
||||||
-(void)setSessionMovingAverageSampleSize:(int)size_;
|
-(void)setSessionMovingAverageSampleSize:(int)aSize;
|
||||||
-(int)transactionMovingAverageSampleSize;
|
-(int)transactionMovingAverageSampleSize;
|
||||||
-(void)setTransactionMovingAverageSampleSize:(int)size_;
|
-(void)setTransactionMovingAverageSampleSize:(int)aSize;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreA)
|
@interface GSWStatisticsStore (GSWStatisticsStoreA)
|
||||||
-(void)_purgePathsStatistics;
|
-(void)_purgePathsStatistics;
|
||||||
-(void)_updatePathsStatisticsWithPaths:(id)paths_;
|
-(void)_updatePathsStatisticsWithPaths:(id)paths;
|
||||||
-(void)_updatePagesStatisticsForPage:(id)page_
|
-(void)_updatePagesStatisticsForPage:(id)page
|
||||||
timeInterval:(NSTimeInterval)timeInterval_;
|
timeInterval:(NSTimeInterval)timeInterval;
|
||||||
-(void)_updateDAStatisticsForActionNamed:(id)name_
|
-(void)_updateDAStatisticsForActionNamed:(id)name
|
||||||
timeInterval:(NSTimeInterval)timeInterval_;
|
timeInterval:(NSTimeInterval)timeInterval;
|
||||||
-(void)_sessionTerminating:(id)session_;
|
-(void)_sessionTerminating:(id)session;
|
||||||
-(void)_applicationCreatedSession:(GSWSession*)session_;
|
-(void)_applicationCreatedSession:(GSWSession*)session;
|
||||||
-(void)_applicationDidHandleComponentActionRequest;
|
-(void)_applicationDidHandleComponentActionRequest;
|
||||||
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name_;
|
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name;
|
||||||
-(double)_applicationDidHandleRequest;
|
-(double)_applicationDidHandleRequest;
|
||||||
-(void)_applicationWillHandleDirectActionRequest;
|
-(void)_applicationWillHandleDirectActionRequest;
|
||||||
-(void)_applicationWillHandleComponentActionRequest;
|
-(void)_applicationWillHandleComponentActionRequest;
|
||||||
|
@ -101,22 +105,22 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreB)
|
@interface GSWStatisticsStore (GSWStatisticsStoreB)
|
||||||
-(NSString*)descriptionForResponse:(GSWResponse*)response_
|
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)recordStatisticsForResponse:(GSWResponse*)response_
|
-(void)recordStatisticsForResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreC)
|
@interface GSWStatisticsStore (GSWStatisticsStoreC)
|
||||||
-(void)logString:(id)string_;
|
-(void)logString:(id)string;
|
||||||
-(double)logFileRotationFrequencyInDays;
|
-(double)logFileRotationFrequencyInDays;
|
||||||
-(NSString*)logFile;
|
-(NSString*)logFile;
|
||||||
-(void) setLogFile:(NSString*)logFile_
|
-(void) setLogFile:(NSString*)logFile
|
||||||
rotationFrequencyInDays:(double)rotationFrequency;
|
rotationFrequencyInDays:(double)rotationFrequency;
|
||||||
-(id)formatDescription:(id)description_
|
-(id)formatDescription:(id)description
|
||||||
forResponse:(GSWResponse*)response_
|
forResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_;
|
inContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreD)
|
@interface GSWStatisticsStore (GSWStatisticsStoreD)
|
||||||
|
@ -146,14 +150,14 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreE)
|
@interface GSWStatisticsStore (GSWStatisticsStoreE)
|
||||||
-(BOOL)validateLogin:(id)login_
|
-(BOOL)validateLogin:(id)login
|
||||||
forSession:(id)session_;
|
forSession:(id)session;
|
||||||
-(void)setPassword:(NSString*)password_;
|
-(void)setPassword:(NSString*)password;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreF)
|
@interface GSWStatisticsStore (GSWStatisticsStoreF)
|
||||||
-(BOOL)validateLogin:(id)login_;
|
-(BOOL)validateLogin:(id)login;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreG)
|
@interface GSWStatisticsStore (GSWStatisticsStoreG)
|
||||||
|
@ -162,6 +166,6 @@
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GSWStatisticsStore (GSWStatisticsStoreH)
|
@interface GSWStatisticsStore (GSWStatisticsStoreH)
|
||||||
+(id)timeIntervalDescription:(double)timeInterval_;
|
+(id)timeIntervalDescription:(double)timeInterval;
|
||||||
@end
|
@end
|
||||||
#endif //_GSWStatisticsStore_h__
|
#endif //_GSWStatisticsStore_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWStatisticsStore.m - GSWeb: Class GSWStatisticsStore
|
/** GSWStatisticsStore.m - <title>GSWeb: Class GSWStatisticsStore</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -36,11 +42,11 @@ static char rcsId[] = "$Id$";
|
||||||
//OK
|
//OK
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
transactionMovingAverageSampleCount = 100;
|
_transactionMovingAverageSampleCount = 100;
|
||||||
sessionMovingAverageSampleCount = 10;
|
_sessionMovingAverageSampleCount = 10;
|
||||||
ASSIGN(startDate, [NSDate date]);
|
ASSIGN(_startDate, [NSDate date]);
|
||||||
ASSIGN(initializationMemory, [self _memoryUsage]);
|
ASSIGN(_initializationMemory, [self _memoryUsage]);
|
||||||
selfLock = [NSRecursiveLock new];
|
_selfLock = [NSRecursiveLock new];
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
@ -50,20 +56,20 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
GSWLogC("Dealloc GSWStatisticsStore");
|
GSWLogC("Dealloc GSWStatisticsStore");
|
||||||
GSWLogC("Dealloc GSWStatisticsStore: selfLock");
|
GSWLogC("Dealloc GSWStatisticsStore: selfLock");
|
||||||
DESTROY(selfLock);
|
DESTROY(_selfLock);
|
||||||
GSWLogC("Dealloc GSWStatisticsStore: maxActiveSessionsDate");
|
GSWLogC("Dealloc GSWStatisticsStore: maxActiveSessionsDate");
|
||||||
DESTROY(maxActiveSessionsDate);
|
DESTROY(_maxActiveSessionsDate);
|
||||||
DESTROY(lastSessionStatistics);
|
DESTROY(_lastSessionStatistics);
|
||||||
DESTROY(startDate);
|
DESTROY(_startDate);
|
||||||
DESTROY(lastStatsDate);
|
DESTROY(_lastStatsDate);
|
||||||
DESTROY(initializationMemory);
|
DESTROY(_initializationMemory);
|
||||||
DESTROY(pagesStatistics);
|
DESTROY(_pagesStatistics);
|
||||||
DESTROY(currentPage);
|
DESTROY(_currentPage);
|
||||||
DESTROY(pathsStatistics);
|
DESTROY(_pathsStatistics);
|
||||||
DESTROY(logPath);
|
DESTROY(_logPath);
|
||||||
DESTROY(logCreationDate);
|
DESTROY(_logCreationDate);
|
||||||
DESTROY(password);
|
DESTROY(_password);
|
||||||
DESTROY(directActionStatistics);
|
DESTROY(_directActionStatistics);
|
||||||
GSWLogC("Dealloc GSWStatisticsStore Super");
|
GSWLogC("Dealloc GSWStatisticsStore Super");
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
GSWLogC("End Dealloc GSWStatisticsStore");
|
GSWLogC("End Dealloc GSWStatisticsStore");
|
||||||
|
@ -73,12 +79,12 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)unlock
|
-(void)unlock
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLog(@"selfLockn=%d",selfLockn);
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
||||||
TmpUnlock(selfLock);
|
TmpUnlock(_selfLock);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
selfLockn--;
|
_selfLockn--;
|
||||||
#endif
|
#endif
|
||||||
NSDebugMLog(@"selfLockn=%d",selfLockn);
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -86,12 +92,12 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)lock
|
-(void)lock
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLog(@"selfLockn=%d",selfLockn);
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
||||||
TmpLockBeforeDate(selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
selfLockn++;
|
_selfLockn++;
|
||||||
#endif
|
#endif
|
||||||
NSDebugMLog(@"selfLockn=%d",selfLockn);
|
NSDebugMLog(@"selfLockn=%d",_selfLockn);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -107,14 +113,14 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return sessionMovingAverageSampleCount;
|
return _sessionMovingAverageSampleCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setSessionMovingAverageSampleSize:(int)size_
|
-(void)setSessionMovingAverageSampleSize:(int)aSize
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
sessionMovingAverageSampleCount=size_;
|
_sessionMovingAverageSampleCount=aSize;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,14 +129,14 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return transactionMovingAverageSampleCount;
|
return _transactionMovingAverageSampleCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setTransactionMovingAverageSampleSize:(int)size_
|
-(void)setTransactionMovingAverageSampleSize:(int)aSize
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
transactionMovingAverageSampleCount=size_;
|
_transactionMovingAverageSampleCount=aSize;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -162,7 +168,7 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_updatePathsStatisticsWithPaths:(id)paths_
|
-(void)_updatePathsStatisticsWithPaths:(id)paths
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
@ -185,91 +191,93 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_updatePagesStatisticsForPage:(id)page_
|
-(void)_updatePagesStatisticsForPage:(id)aPage
|
||||||
timeInterval:(NSTimeInterval)timeInterval_
|
timeInterval:(NSTimeInterval)aTimeInterval
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSMutableDictionary* _pageStats=nil;
|
NSMutableDictionary* pageStats=nil;
|
||||||
NSNumber* _AvgRespTime=nil;
|
NSNumber* AvgRespTime=nil;
|
||||||
NSNumber* _MinRespTime=nil;
|
NSNumber* MinRespTime=nil;
|
||||||
NSNumber* _MaxRespTime=nil;
|
NSNumber* MaxRespTime=nil;
|
||||||
NSNumber* _Served=nil;
|
NSNumber* Served=nil;
|
||||||
double _AvgRespTimeValue=0;
|
double AvgRespTimeValue=0;
|
||||||
double _MinRespTimeValue=0;
|
double MinRespTimeValue=0;
|
||||||
double _MaxRespTimeValue=0;
|
double MaxRespTimeValue=0;
|
||||||
int _ServedValue=0;
|
int ServedValue=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"page_=%@",page_);
|
NSDebugMLog(@"aPage=%@",aPage);
|
||||||
if (!pagesStatistics)
|
if (!_pagesStatistics)
|
||||||
pagesStatistics=[NSMutableDictionary new];
|
_pagesStatistics=[NSMutableDictionary new];
|
||||||
else
|
else
|
||||||
_pageStats=[pagesStatistics objectForKey:page_];
|
pageStats=[_pagesStatistics objectForKey:aPage];
|
||||||
NSDebugMLog(@"pagesStatistics=%@",pagesStatistics);
|
NSDebugMLog(@"pagesStatistics=%@",_pagesStatistics);
|
||||||
NSDebugMLog(@"_pageStats=%@",_pageStats);
|
NSDebugMLog(@"pageStats=%@",pageStats);
|
||||||
if (_pageStats)
|
if (pageStats)
|
||||||
{
|
{
|
||||||
_AvgRespTime=[_pageStats objectForKey:@"Avg Resp. Time"];
|
AvgRespTime=[pageStats objectForKey:@"Avg Resp. Time"];
|
||||||
_MinRespTime=[_pageStats objectForKey:@"Min Resp. Time"];
|
MinRespTime=[pageStats objectForKey:@"Min Resp. Time"];
|
||||||
_MaxRespTime=[_pageStats objectForKey:@"Max Resp. Time"];
|
MaxRespTime=[pageStats objectForKey:@"Max Resp. Time"];
|
||||||
_Served=[_pageStats objectForKey:@"Served"];
|
Served=[pageStats objectForKey:@"Served"];
|
||||||
|
|
||||||
_ServedValue=[_Served intValue];
|
ServedValue=[Served intValue];
|
||||||
if (_MinRespTime)
|
if (MinRespTime)
|
||||||
{
|
{
|
||||||
_MinRespTimeValue=[_MinRespTime doubleValue];
|
MinRespTimeValue=[MinRespTime doubleValue];
|
||||||
_MinRespTimeValue=min(_MinRespTimeValue,timeInterval_);
|
MinRespTimeValue=min(MinRespTimeValue,aTimeInterval);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_MinRespTimeValue=timeInterval_;
|
MinRespTimeValue=aTimeInterval;
|
||||||
if (_MaxRespTime)
|
if (MaxRespTime)
|
||||||
{
|
{
|
||||||
_MaxRespTimeValue=[_MaxRespTime doubleValue];
|
MaxRespTimeValue=[MaxRespTime doubleValue];
|
||||||
_MaxRespTimeValue=max(_MaxRespTimeValue,timeInterval_);
|
MaxRespTimeValue=max(MaxRespTimeValue,aTimeInterval);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_MaxRespTimeValue=timeInterval_;
|
MaxRespTimeValue=aTimeInterval;
|
||||||
if (_AvgRespTime)
|
if (AvgRespTime)
|
||||||
{
|
{
|
||||||
_AvgRespTimeValue=[_AvgRespTime doubleValue];
|
AvgRespTimeValue=[AvgRespTime doubleValue];
|
||||||
_AvgRespTimeValue=((_AvgRespTimeValue*_ServedValue)+timeInterval_)/(_ServedValue+1);
|
AvgRespTimeValue=((AvgRespTimeValue*ServedValue)+aTimeInterval)/(ServedValue+1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_AvgRespTimeValue=timeInterval_;
|
AvgRespTimeValue=aTimeInterval;
|
||||||
_Served++;
|
Served++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_pageStats=[NSMutableDictionary dictionary];
|
pageStats=[NSMutableDictionary dictionary];
|
||||||
[pagesStatistics setObject:_pageStats
|
[_pagesStatistics setObject:pageStats
|
||||||
forKey:page_];
|
forKey:aPage];
|
||||||
_AvgRespTimeValue=timeInterval_;
|
AvgRespTimeValue=aTimeInterval;
|
||||||
_MinRespTimeValue=timeInterval_;
|
MinRespTimeValue=aTimeInterval;
|
||||||
_MaxRespTimeValue=timeInterval_;
|
MaxRespTimeValue=aTimeInterval;
|
||||||
_ServedValue=1;
|
ServedValue=1;
|
||||||
};
|
};
|
||||||
_AvgRespTime=[NSNumber numberWithDouble:_AvgRespTimeValue];
|
AvgRespTime=[NSNumber numberWithDouble:AvgRespTimeValue];
|
||||||
_MinRespTime=[NSNumber numberWithDouble:_MinRespTimeValue];
|
MinRespTime=[NSNumber numberWithDouble:MinRespTimeValue];
|
||||||
_MaxRespTime=[NSNumber numberWithDouble:_MaxRespTimeValue];
|
MaxRespTime=[NSNumber numberWithDouble:MaxRespTimeValue];
|
||||||
_Served=[NSNumber numberWithInt:_ServedValue];
|
Served=[NSNumber numberWithInt:ServedValue];
|
||||||
NSDebugMLog(@"_AvgRespTime=%@",_AvgRespTime);
|
NSDebugMLog(@"AvgRespTime=%@",AvgRespTime);
|
||||||
NSDebugMLog(@"_MinRespTime=%@",_MinRespTime);
|
NSDebugMLog(@"MinRespTime=%@",MinRespTime);
|
||||||
NSDebugMLog(@"_MaxRespTime=%@",_MaxRespTime);
|
NSDebugMLog(@"MaxRespTime=%@",MaxRespTime);
|
||||||
NSDebugMLog(@"_Served=%@",_Served);
|
NSDebugMLog(@"Served=%@",Served);
|
||||||
[_pageStats setObject:_AvgRespTime
|
[pageStats setObject:AvgRespTime
|
||||||
forKey:@"Avg Resp. Time"];
|
forKey:@"Avg Resp. Time"];
|
||||||
[_pageStats setObject:_MinRespTime
|
[pageStats setObject:MinRespTime
|
||||||
forKey:@"Min Resp. Time"];
|
forKey:@"Min Resp. Time"];
|
||||||
[_pageStats setObject:_MaxRespTime
|
[pageStats setObject:MaxRespTime
|
||||||
forKey:@"Max Resp. Time"];
|
forKey:@"Max Resp. Time"];
|
||||||
[_pageStats setObject:_Served
|
[pageStats setObject:Served
|
||||||
forKey:@"Served"];
|
forKey:@"Served"];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -280,34 +288,36 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_updateDAStatisticsForActionNamed:(id)name_
|
-(void)_updateDAStatisticsForActionNamed:(id)aName
|
||||||
timeInterval:(NSTimeInterval)timeInterval_
|
timeInterval:(NSTimeInterval)aTimeInterval
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_sessionTerminating:(id)session_
|
-(void)_sessionTerminating:(id)aSession
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
int _activeSessionsCount=[GSWApp _activeSessionsCount];
|
int activeSessionsCount=[GSWApp _activeSessionsCount];
|
||||||
NSArray* _statistics=[session_ statistics];
|
NSArray* statistics=[aSession statistics];
|
||||||
NSDate* _sessionBirthDate=nil;
|
NSDate* sessionBirthDate=nil;
|
||||||
NSTimeInterval _sessionTimeOut=0;
|
NSTimeInterval sessionTimeOut=0;
|
||||||
int _sessionRequestCounter=0;
|
int sessionRequestCounter=0;
|
||||||
[self _updatePathsStatisticsWithPaths:_statistics];
|
[self _updatePathsStatisticsWithPaths:statistics];
|
||||||
_sessionBirthDate=[session_ _birthDate];
|
sessionBirthDate=[aSession _birthDate];
|
||||||
_sessionTimeOut=[session_ timeOut];
|
sessionTimeOut=[aSession timeOut];
|
||||||
_sessionRequestCounter=[session_ _requestCounter];
|
sessionRequestCounter=[aSession _requestCounter];
|
||||||
//TODOFN
|
//TODOFN
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -318,22 +328,24 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_applicationCreatedSession:(GSWSession*)session_
|
-(void)_applicationCreatedSession:(GSWSession*)aSession
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
int _activeSessionsCount=0;
|
int activeSessionsCount=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_activeSessionsCount=[[GSWApplication application] _activeSessionsCount];
|
activeSessionsCount=[[GSWApplication application] _activeSessionsCount];
|
||||||
ASSIGN(maxActiveSessionsDate,[NSDate date]);
|
ASSIGN(_maxActiveSessionsDate,[NSDate date]);
|
||||||
maxActiveSessionsCount=max(_activeSessionsCount,maxActiveSessionsCount);
|
_maxActiveSessionsCount=max(activeSessionsCount,_maxActiveSessionsCount);
|
||||||
sessionsCount++; //ou _activeSessionsCount
|
_sessionsCount++; //ou activeSessionsCount
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -347,20 +359,22 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)_applicationDidHandleComponentActionRequest
|
-(void)_applicationDidHandleComponentActionRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
double _timeInterval=0;
|
double timeInterval=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_timeInterval=[self _applicationDidHandleRequest];
|
timeInterval=[self _applicationDidHandleRequest];
|
||||||
NSDebugMLog(@"currentPage=%@",currentPage);
|
NSDebugMLog(@"currentPage=%@",_currentPage);
|
||||||
if (currentPage)//TODO no current page if no session (error page,...)
|
if (_currentPage)//TODO no current page if no session (error page,...)
|
||||||
[self _updatePagesStatisticsForPage:currentPage
|
[self _updatePagesStatisticsForPage:_currentPage
|
||||||
timeInterval:_timeInterval];
|
timeInterval:timeInterval];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -371,7 +385,7 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)name_
|
-(void)_applicationDidHandleDirectActionRequestWithActionNamed:(id)aName
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
@ -381,11 +395,11 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
//lastDidHandleRequestTimeInterval=115.005370 (ancien=53.516954)
|
//_lastDidHandleRequestTimeInterval=115.005370 (ancien=53.516954)
|
||||||
//totalTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
|
//_totalTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
|
||||||
//movingTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
|
//_movingTransactionTimeInterval=double DOUBLE:61.488416 (ancien=0)
|
||||||
|
|
||||||
return movingTransactionTimeInterval; //??? 61.488416: ou _totalTransactionTimeInterval - precedent
|
return _movingTransactionTimeInterval; //??? 61.488416: ou _totalTransactionTimeInterval - precedent
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -396,12 +410,14 @@ static char rcsId[] = "$Id$";
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
directActionTransactionsCount++;
|
_directActionTransactionsCount++;
|
||||||
[self _applicationWillHandleRequest];
|
[self _applicationWillHandleRequest];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -419,12 +435,14 @@ static char rcsId[] = "$Id$";
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
componentActionTransactionsCount++;
|
_componentActionTransactionsCount++;
|
||||||
[self _applicationWillHandleRequest];
|
[self _applicationWillHandleRequest];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -439,13 +457,13 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
transactionsCount++;
|
_transactionsCount++;
|
||||||
/*
|
/*
|
||||||
lastWillHandleRequestTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
lastWillHandleRequestTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
||||||
totalIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
totalIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
||||||
movingIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
movingIdleTimeInterval=double DOUBLE:53.516954 [RC=4294967295]
|
||||||
*/
|
*/
|
||||||
movingAverageTransactionsCount++;
|
_movingAverageTransactionsCount++;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -454,23 +472,25 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWStatisticsStore (GSWStatisticsStoreB)
|
@implementation GSWStatisticsStore (GSWStatisticsStoreB)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)descriptionForResponse:(GSWResponse*)response_
|
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponent* _page=nil;
|
GSWComponent* page=nil;
|
||||||
NSString* _description=nil;
|
NSString* description=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_page=[context_ page];
|
page=[aContext page];
|
||||||
_description=[_page descriptionForResponse:response_
|
description=[page descriptionForResponse:aResponse
|
||||||
inContext:context_];
|
inContext:aContext];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -478,31 +498,33 @@ static char rcsId[] = "$Id$";
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _description;
|
return description;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)recordStatisticsForResponse:(GSWResponse*)response_
|
-(void)recordStatisticsForResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
GSWComponent* _page=nil;
|
GSWComponent* page=nil;
|
||||||
NSString* _pageName=nil;
|
NSString* pageName=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_page=[context_ page];
|
page=[aContext page];
|
||||||
NSDebugMLog(@"_page=%@",_page);
|
NSDebugMLog(@"page=%@",page);
|
||||||
_pageName=[_page name];
|
pageName=[page name];
|
||||||
NSDebugMLog(@"_pageName=%@",_pageName);
|
NSDebugMLog(@"pageName=%@",pageName);
|
||||||
ASSIGN(currentPage,_pageName);
|
ASSIGN(_currentPage,pageName);
|
||||||
NSDebugMLog(@"currentPage=%@",currentPage);
|
NSDebugMLog(@"_currentPage=%@",_currentPage);
|
||||||
[self _memoryUsage];//TODO Delete because it's Just for Test !
|
[self _memoryUsage];//TODO Delete because it's Just for Test !
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -518,7 +540,7 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWStatisticsStore (GSWStatisticsStoreC)
|
@implementation GSWStatisticsStore (GSWStatisticsStoreC)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)logString:(id)string_
|
-(void)logString:(id)aString
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
};
|
};
|
||||||
|
@ -528,23 +550,25 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return logRotation;
|
return _logRotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)logFile
|
-(NSString*)logFile
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSString* _logFile=nil;
|
NSString* logFile=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
_logFile=logPath;
|
logFile=_logPath;
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",localException,[localException reason],__FILE__,__LINE__);
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d]",
|
||||||
|
localException,[localException reason],
|
||||||
|
__FILE__,__LINE__);
|
||||||
//TODO
|
//TODO
|
||||||
[self unlock];
|
[self unlock];
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -552,23 +576,23 @@ static char rcsId[] = "$Id$";
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
[self unlock];
|
[self unlock];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _logFile;
|
return logFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void) setLogFile:(id)logFile_
|
-(void) setLogFile:(id)logFile
|
||||||
rotationFrequencyInDays:(double)rotationFrequency
|
rotationFrequencyInDays:(double)rotationFrequency
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(logPath,logFile_);
|
ASSIGN(_logPath,logFile);
|
||||||
logRotation=rotationFrequency;
|
_logRotation=rotationFrequency;
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)formatDescription:(id)description_
|
-(id)formatDescription:(id)description
|
||||||
forResponse:(GSWResponse*)response_
|
forResponse:(GSWResponse*)aResponse
|
||||||
inContext:(GSWContext*)context_
|
inContext:(GSWContext*)aContext
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -584,7 +608,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return password;
|
return _password;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -592,7 +616,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return pathsStatistics;
|
return _pathsStatistics;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -600,7 +624,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return pagesStatistics;
|
return _pagesStatistics;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -613,39 +637,39 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)_memoryUsage
|
-(NSDictionary*)_memoryUsage
|
||||||
{
|
{
|
||||||
struct rusage _rusage;
|
struct rusage rusageStruct;
|
||||||
int i=0;
|
int i=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
//Use NSRealMemoryAvailable ??
|
//Use NSRealMemoryAvailable ??
|
||||||
for(i=0;i<2;i++)
|
for(i=0;i<2;i++)
|
||||||
{
|
{
|
||||||
memset(&_rusage,0,sizeof(_rusage));
|
memset(&rusageStruct,0,sizeof(rusageStruct));
|
||||||
if (getrusage(i>0 ? RUSAGE_CHILDREN : RUSAGE_SELF,&_rusage)!=0)
|
if (getrusage(i>0 ? RUSAGE_CHILDREN : RUSAGE_SELF,&rusageStruct)!=0)
|
||||||
{
|
{
|
||||||
LOGError(@"getrusage faled %d",errno);
|
LOGError(@"getrusage faled %d",errno);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSTimeInterval _userTime=NSTimeIntervalFromTimeVal(&_rusage.ru_utime);
|
NSTimeInterval userTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_utime);
|
||||||
NSTimeInterval _systemTime=NSTimeIntervalFromTimeVal(&_rusage.ru_stime);
|
NSTimeInterval systemTime=NSTimeIntervalFromTimeVal(&rusageStruct.ru_stime);
|
||||||
NSDebugMLog(@"_userTime=%ld",(long)_userTime);
|
NSDebugMLog(@"userTime=%ld",(long)userTime);
|
||||||
NSDebugMLog(@"_systemTime=%ld",(long)_systemTime);
|
NSDebugMLog(@"systemTime=%ld",(long)systemTime);
|
||||||
NSDebugMLog(@"ru_maxrss=%ld",_rusage.ru_maxrss); /* maximum resident set size */
|
NSDebugMLog(@"ru_maxrss=%ld",rusageStruct.ru_maxrss); /* maximum resident set size */
|
||||||
NSDebugMLog(@"ru_ixrss=%ld",_rusage.ru_ixrss); /* integral shared memory size */
|
NSDebugMLog(@"ru_ixrss=%ld",rusageStruct.ru_ixrss); /* integral shared memory size */
|
||||||
NSDebugMLog(@"ru_idrss=%ld",_rusage.ru_idrss); /* integral unshared data size */
|
NSDebugMLog(@"ru_idrss=%ld",rusageStruct.ru_idrss); /* integral unshared data size */
|
||||||
NSDebugMLog(@"ru_isrss=%ld",_rusage.ru_isrss); /* integral unshared stack size */
|
NSDebugMLog(@"ru_isrss=%ld",rusageStruct.ru_isrss); /* integral unshared stack size */
|
||||||
NSDebugMLog(@"ru_minflt=%ld",_rusage.ru_minflt); /* page reclaims */
|
NSDebugMLog(@"ru_minflt=%ld",rusageStruct.ru_minflt); /* page reclaims */
|
||||||
NSDebugMLog(@"ru_minflt bytes=%ld",_rusage.ru_minflt*getpagesize()); /* page reclaims */
|
NSDebugMLog(@"ru_minflt bytes=%ld",rusageStruct.ru_minflt*getpagesize()); /* page reclaims */
|
||||||
NSDebugMLog(@"ru_majflt=%ld",_rusage.ru_majflt); /* page faults */
|
NSDebugMLog(@"ru_majflt=%ld",rusageStruct.ru_majflt); /* page faults */
|
||||||
NSDebugMLog(@"ru_majflt bytes=%ld",_rusage.ru_majflt*getpagesize()); /* page faults */
|
NSDebugMLog(@"ru_majflt bytes=%ld",rusageStruct.ru_majflt*getpagesize()); /* page faults */
|
||||||
NSDebugMLog(@"ru_nswap=%ld",_rusage.ru_nswap); /* swaps */
|
NSDebugMLog(@"ru_nswap=%ld",rusageStruct.ru_nswap); /* swaps */
|
||||||
NSDebugMLog(@"ru_inblock=%ld",_rusage.ru_inblock); /* block input operations */
|
NSDebugMLog(@"ru_inblock=%ld",rusageStruct.ru_inblock); /* block input operations */
|
||||||
NSDebugMLog(@"ru_oublock=%ld",_rusage.ru_oublock); /* block output operations */
|
NSDebugMLog(@"ru_oublock=%ld",rusageStruct.ru_oublock); /* block output operations */
|
||||||
NSDebugMLog(@"ru_msgsnd=%ld",_rusage.ru_msgsnd); /* messages sent */
|
NSDebugMLog(@"ru_msgsnd=%ld",rusageStruct.ru_msgsnd); /* messages sent */
|
||||||
NSDebugMLog(@"ru_msgrcv=%ld",_rusage.ru_msgrcv); /* messages received */
|
NSDebugMLog(@"ru_msgrcv=%ld",rusageStruct.ru_msgrcv); /* messages received */
|
||||||
NSDebugMLog(@"ru_nsignals=%ld",_rusage.ru_nsignals); /* signals received */
|
NSDebugMLog(@"ru_nsignals=%ld",rusageStruct.ru_nsignals); /* signals received */
|
||||||
NSDebugMLog(@"ru_nvcsw=%ld",_rusage.ru_nvcsw); /* voluntary context switches */
|
NSDebugMLog(@"ru_nvcsw=%ld",rusageStruct.ru_nvcsw); /* voluntary context switches */
|
||||||
NSDebugMLog(@"ru_nivcsw=%ld",_rusage.ru_nivcsw); /* involuntary context switches */
|
NSDebugMLog(@"ru_nivcsw=%ld",rusageStruct.ru_nivcsw); /* involuntary context switches */
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
{
|
{
|
||||||
|
@ -699,7 +723,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return movingAverageSessionLife;
|
return _movingAverageSessionLife;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -707,7 +731,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return averageSessionLife;
|
return _averageSessionLife;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -715,7 +739,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return movingAverageRequestsPerSession;
|
return _movingAverageRequestsPerSession;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -723,7 +747,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return averageRequestsPerSession;
|
return _averageRequestsPerSession;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -731,7 +755,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return maxActiveSessionsDate;
|
return _maxActiveSessionsDate;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -739,7 +763,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return maxActiveSessionsCount;
|
return _maxActiveSessionsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -747,61 +771,61 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return sessionsCount;
|
return _sessionsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_movingAverageTransactionTime
|
-(double)_movingAverageTransactionTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return movingTransactionTimeInterval/movingAverageTransactionsCount; //?
|
return _movingTransactionTimeInterval/_movingAverageTransactionsCount; //?
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_movingAverageIdleTime
|
-(double)_movingAverageIdleTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return movingIdleTimeInterval/movingAverageTransactionsCount;//??
|
return _movingIdleTimeInterval/_movingAverageTransactionsCount;//??
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_averageCATransactionTime
|
-(double)_averageCATransactionTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return totalCATransactionTimeInterval/movingAverageTransactionsCount; //??
|
return _totalCATransactionTimeInterval/_movingAverageTransactionsCount; //??
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_averageDATransactionTime
|
-(double)_averageDATransactionTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return totalDATransactionTimeInterval/movingAverageTransactionsCount; //??
|
return _totalDATransactionTimeInterval/_movingAverageTransactionsCount; //??
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_averageTransactionTime
|
-(double)_averageTransactionTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return totalTransactionTimeInterval/movingAverageTransactionsCount; //?
|
return _totalTransactionTimeInterval/_movingAverageTransactionsCount; //?
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(double)_averageIdleTime
|
-(double)_averageIdleTime
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(movingAverageTransactionsCount,@"movingAverageTransactionsCount==0");
|
NSAssert(_movingAverageTransactionsCount!=0,@"movingAverageTransactionsCount==0");
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return totalIdleTimeInterval/movingAverageTransactionsCount;//??
|
return _totalIdleTimeInterval/_movingAverageTransactionsCount;//??
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -809,7 +833,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return directActionTransactionsCount;
|
return _directActionTransactionsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -817,7 +841,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return componentActionTransactionsCount;
|
return _componentActionTransactionsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -825,7 +849,7 @@ s
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return transactionsCount;
|
return _transactionsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -834,18 +858,18 @@ s
|
||||||
@implementation GSWStatisticsStore (GSWStatisticsStoreE)
|
@implementation GSWStatisticsStore (GSWStatisticsStoreE)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)validateLogin:(id)login_
|
-(BOOL)validateLogin:(id)aLogin
|
||||||
forSession:(id)session_
|
forSession:(id)aSession
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return NO;
|
return NO;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)setPassword:(NSString*)password_
|
-(void)setPassword:(NSString*)aPassword
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
ASSIGN(password,password_);
|
ASSIGN(_password,aPassword);
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -854,7 +878,7 @@ s
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWStatisticsStore (GSWStatisticsStoreF)
|
@implementation GSWStatisticsStore (GSWStatisticsStoreF)
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)validateLogin:(id)login_
|
-(BOOL)validateLogin:(id)aLogin
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -876,7 +900,7 @@ s
|
||||||
@implementation GSWStatisticsStore (GSWStatisticsStoreH)
|
@implementation GSWStatisticsStore (GSWStatisticsStoreH)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(id)timeIntervalDescription:(double)timeInterval_
|
+(id)timeIntervalDescription:(double)aTimeInterval
|
||||||
{
|
{
|
||||||
LOGClassFnNotImplemented(); //TODOFN
|
LOGClassFnNotImplemented(); //TODOFN
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWStats.h - GSWeb: Class GSWStats
|
/** GSWStats.h - <title>GSWeb: Class GSWStats</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWStats.m - GSWeb: Class GSWStats
|
/** GSWStats.m - <title>GSWeb: Class GSWStats</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -29,8 +35,8 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWStats
|
@implementation GSWStats
|
||||||
-(id)defaultAction
|
-(id)defaultAction
|
||||||
{
|
{
|
||||||
GSWComponent* _component=[self pageWithName:@"GSWStatsPage"];
|
GSWComponent* component=[self pageWithName:@"GSWStatsPage"];
|
||||||
return _component;
|
return component;
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWTemplateParser.h - GSWeb: Class GSWTemplateParser
|
/** GSWTemplateParser - <title>GSWeb: Class GSWTemplateParser</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -43,53 +49,53 @@
|
||||||
int tagN;
|
int tagN;
|
||||||
}
|
}
|
||||||
|
|
||||||
+(GSWElement*)templateNamed:(NSString*)name_
|
+(GSWElement*)templateNamed:(NSString*)aName
|
||||||
inFrameworkNamed:(NSString*)frameworkName_
|
inFrameworkNamed:(NSString*)aFrameworkName
|
||||||
withParserClassName:(NSString*)parserClassName
|
withParserClassName:(NSString*)parserClassName
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding
|
encoding:(NSStringEncoding)encoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
definitionsString:(NSString*)pageDefString
|
definitionsString:(NSString*)pageDefString
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)someLanguages
|
||||||
definitionPath:(NSString*)definitionPath_;
|
definitionPath:(NSString*)aDefinitionPath;
|
||||||
+(GSWElement*)templateNamed:(NSString*)name_
|
+(GSWElement*)templateNamed:(NSString*)aName
|
||||||
inFrameworkNamed:(NSString*)frameworkName_
|
inFrameworkNamed:(NSString*)aFrameworkName
|
||||||
withParserClass:(Class)parserClass
|
withParserClass:(Class)parserClass
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding
|
encoding:(NSStringEncoding)encoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
definitionsString:(NSString*)pageDefString
|
definitionsString:(NSString*)pageDefString
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)someLanguages
|
||||||
definitionPath:(NSString*)definitionPath_;
|
definitionPath:(NSString*)aDefinitionPath;
|
||||||
+(void)setDefaultParserClassName:(NSString*)parserClassName;
|
+(void)setDefaultParserClassName:(NSString*)parserClassName;
|
||||||
+(NSString*)defaultParserClassName;
|
+(NSString*)defaultParserClassName;
|
||||||
+(Class)defaultParserClass;
|
+(Class)defaultParserClass;
|
||||||
-(id)initWithTemplateName:(NSString*)name_
|
-(id)initWithTemplateName:(NSString*)aName
|
||||||
inFrameworkName:(NSString*)frameworkName_
|
inFrameworkName:(NSString*)aFrameworkName
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding_
|
encoding:(NSStringEncoding)anEncoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
withDefinitionsString:(NSString*)pageDefString
|
withDefinitionsString:(NSString*)pageDefString
|
||||||
fromPath:(NSString*)definitionPath_
|
fromPath:(NSString*)aDefinitionPath
|
||||||
forLanguages:(NSArray*)languages_;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)logPrefix;
|
-(NSString*)logPrefix;
|
||||||
-(GSWElement*)template;
|
-(GSWElement*)template;
|
||||||
-(NSArray*)templateElements;
|
-(NSArray*)templateElements;
|
||||||
-(NSDictionary*)definitions;
|
-(NSDictionary*)definitions;
|
||||||
|
|
||||||
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring_
|
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring
|
||||||
named:(NSString*)localDefinitionName_
|
named:(NSString*)localDefinitionName
|
||||||
inFrameworkNamed:(NSString*)localFrameworkName_
|
inFrameworkNamed:(NSString*)localFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles;
|
processedFiles:(NSMutableSet*)processedFiles;
|
||||||
|
|
||||||
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName_
|
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName
|
||||||
fromFrameworkNamed:(NSString*)fromFrameworkName_
|
fromFrameworkNamed:(NSString*)fromFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles;
|
processedFiles:(NSMutableSet*)processedFiles;
|
||||||
|
|
||||||
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes_
|
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes
|
||||||
named:(NSString*)localDefinitionsName_
|
named:(NSString*)localDefinitionsName
|
||||||
inFrameworkNamed:(NSString*)localFrameworkName_
|
inFrameworkNamed:(NSString*)localFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles;
|
processedFiles:(NSMutableSet*)processedFiles;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
@ -72,67 +72,67 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(GSWElement*)templateNamed:(NSString*)name_
|
+(GSWElement*)templateNamed:(NSString*)aName
|
||||||
inFrameworkNamed:(NSString*)frameworkName_
|
inFrameworkNamed:(NSString*)aFrameworkName
|
||||||
withParserClassName:(NSString*)parserClassName
|
withParserClassName:(NSString*)parserClassName
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding_
|
encoding:(NSStringEncoding)anEncoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
definitionsString:(NSString*)pageDefString
|
definitionsString:(NSString*)pageDefString
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)someLanguages
|
||||||
definitionPath:(NSString*)definitionPath_
|
definitionPath:(NSString*)aDefinitionPath
|
||||||
{
|
{
|
||||||
GSWElement* resultTemplate=nil;
|
GSWElement* resultTemplate=nil;
|
||||||
Class parserClass=Nil;
|
Class parserClass=Nil;
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
|
NSDebugMLLog(@"GSWTemplateParser",@"aDefinitionPath=%@",aDefinitionPath);
|
||||||
if (parserClassName)
|
if (parserClassName)
|
||||||
{
|
{
|
||||||
parserClass=NSClassFromString(parserClassName);
|
parserClass=NSClassFromString(parserClassName);
|
||||||
NSAssert1(parserClass,@"No Parser class named %@",parserClassName);
|
NSAssert1(parserClass,@"No Parser class named %@",parserClassName);
|
||||||
};
|
};
|
||||||
resultTemplate=[self templateNamed:name_
|
resultTemplate=[self templateNamed:aName
|
||||||
inFrameworkNamed:frameworkName_
|
inFrameworkNamed:aFrameworkName
|
||||||
withParserClass:parserClass
|
withParserClass:parserClass
|
||||||
withString:HTMLString
|
withString:HTMLString
|
||||||
encoding:encoding_
|
encoding:anEncoding
|
||||||
fromPath:HTMLPath
|
fromPath:HTMLPath
|
||||||
definitionsString:pageDefString
|
definitionsString:pageDefString
|
||||||
languages:languages_
|
languages:someLanguages
|
||||||
definitionPath:definitionPath_];
|
definitionPath:aDefinitionPath];
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
return resultTemplate;
|
return resultTemplate;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(GSWElement*)templateNamed:(NSString*)name_
|
+(GSWElement*)templateNamed:(NSString*)aName
|
||||||
inFrameworkNamed:(NSString*)frameworkName_
|
inFrameworkNamed:(NSString*)aFrameworkName
|
||||||
withParserClass:(Class)parserClass
|
withParserClass:(Class)parserClass
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding_
|
encoding:(NSStringEncoding)anEncoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
definitionsString:(NSString*)pageDefString
|
definitionsString:(NSString*)pageDefString
|
||||||
languages:(NSArray*)languages_
|
languages:(NSArray*)someLanguages
|
||||||
definitionPath:(NSString*)definitionPath_
|
definitionPath:(NSString*)aDefinitionPath
|
||||||
{
|
{
|
||||||
GSWElement* resultTemplate=nil;
|
GSWElement* resultTemplate=nil;
|
||||||
GSWTemplateParser* templateParser=nil;
|
GSWTemplateParser* templateParser=nil;
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ frameworkName:%@ pageDefString=%@",name_,frameworkName_,pageDefString);
|
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ frameworkName:%@ pageDefString=%@",aName,aFrameworkName,pageDefString);
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionPath_=%@",definitionPath_);
|
NSDebugMLLog(@"GSWTemplateParser",@"aDefinitionPath=%@",aDefinitionPath);
|
||||||
if (!parserClass)
|
if (!parserClass)
|
||||||
{
|
{
|
||||||
parserClass=[self defaultParserClass];
|
parserClass=[self defaultParserClass];
|
||||||
NSAssert(parserClass,@"No defaultParser Class");
|
NSAssert(parserClass,@"No defaultParser Class");
|
||||||
};
|
};
|
||||||
templateParser=[[[parserClass alloc] initWithTemplateName:name_
|
templateParser=[[[parserClass alloc] initWithTemplateName:aName
|
||||||
inFrameworkName:frameworkName_
|
inFrameworkName:aFrameworkName
|
||||||
withString:HTMLString
|
withString:HTMLString
|
||||||
encoding:encoding_
|
encoding:anEncoding
|
||||||
fromPath:HTMLPath
|
fromPath:HTMLPath
|
||||||
withDefinitionsString:pageDefString
|
withDefinitionsString:pageDefString
|
||||||
fromPath:definitionPath_
|
fromPath:aDefinitionPath
|
||||||
forLanguages:languages_] autorelease];
|
forLanguages:someLanguages] autorelease];
|
||||||
if (templateParser)
|
if (templateParser)
|
||||||
resultTemplate=[templateParser template];
|
resultTemplate=[templateParser template];
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
|
@ -140,25 +140,25 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithTemplateName:(NSString*)name_
|
-(id)initWithTemplateName:(NSString*)aName
|
||||||
inFrameworkName:(NSString*)frameworkName_
|
inFrameworkName:(NSString*)aFrameworkName
|
||||||
withString:(NSString*)HTMLString
|
withString:(NSString*)HTMLString
|
||||||
encoding:(NSStringEncoding)encoding_
|
encoding:(NSStringEncoding)anEncoding
|
||||||
fromPath:(NSString*)HTMLPath
|
fromPath:(NSString*)HTMLPath
|
||||||
withDefinitionsString:(NSString*)pageDefString
|
withDefinitionsString:(NSString*)pageDefString
|
||||||
fromPath:(NSString*)definitionPath_
|
fromPath:(NSString*)aDefinitionPath
|
||||||
forLanguages:(NSArray*)languages_
|
forLanguages:(NSArray*)someLanguages
|
||||||
{
|
{
|
||||||
if ((self=[self init]))
|
if ((self=[self init]))
|
||||||
{
|
{
|
||||||
ASSIGN(_templateName,name_);
|
ASSIGN(_templateName,aName);
|
||||||
ASSIGN(_frameworkName,frameworkName_);
|
ASSIGN(_frameworkName,aFrameworkName);
|
||||||
ASSIGN(_string,HTMLString);
|
ASSIGN(_string,HTMLString);
|
||||||
_stringEncoding=encoding_;
|
_stringEncoding=anEncoding;
|
||||||
ASSIGN(_stringPath,HTMLPath);
|
ASSIGN(_stringPath,HTMLPath);
|
||||||
ASSIGN(_definitionsString,pageDefString);
|
ASSIGN(_definitionsString,pageDefString);
|
||||||
ASSIGN(_languages,languages_);
|
ASSIGN(_languages,someLanguages);
|
||||||
ASSIGN(_definitionFilePath,definitionPath_);
|
ASSIGN(_definitionFilePath,aDefinitionPath);
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
@ -210,7 +210,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
NSEnumerator* _enum = [definitionsElements objectEnumerator];
|
NSEnumerator* _enum = [definitionsElements objectEnumerator];
|
||||||
id _obj=nil;
|
id _obj=nil;
|
||||||
NSString* _className=nil;
|
NSString* _className=nil;
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ definitionsElements=%@",name_,definitionsElements);
|
NSDebugMLLog(@"GSWTemplateParser",@"template named:%@ definitionsElements=%@",aName,definitionsElements);
|
||||||
while ((_obj = [_enum nextObject]))
|
while ((_obj = [_enum nextObject]))
|
||||||
{
|
{
|
||||||
_className=[_obj className];
|
_className=[_obj className];
|
||||||
|
@ -300,9 +300,9 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)parseDefinitionsString:(NSString*)localDefinitionstring_
|
-(NSDictionary*)parseDefinitionsString:(NSString*)aLocalDefinitionString
|
||||||
named:(NSString*)localDefinitionName_
|
named:(NSString*)aLocalDefinitionName
|
||||||
inFrameworkNamed:(NSString*)localFrameworkName_
|
inFrameworkNamed:(NSString*)aLocalFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles
|
processedFiles:(NSMutableSet*)processedFiles
|
||||||
{
|
{
|
||||||
NSDictionary* returnedLocalDefinitions=nil;
|
NSDictionary* returnedLocalDefinitions=nil;
|
||||||
|
@ -316,7 +316,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
GSWPageDefParser* definitionsParser=nil;
|
GSWPageDefParser* definitionsParser=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
arpParse=[NSAutoreleasePool new];
|
arpParse=[NSAutoreleasePool new];
|
||||||
definitionsStream=[[ANTLRTextInputStreamString newWithString:localDefinitionstring_]
|
definitionsStream=[[ANTLRTextInputStreamString newWithString:aLocalDefinitionString]
|
||||||
autorelease];
|
autorelease];
|
||||||
definitionsLexer=[[[GSWPageDefLexer alloc]initWithTextStream:definitionsStream]
|
definitionsLexer=[[[GSWPageDefLexer alloc]initWithTextStream:definitionsStream]
|
||||||
autorelease];
|
autorelease];
|
||||||
|
@ -325,8 +325,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
autorelease];
|
autorelease];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles=%@",processedFiles);
|
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles=%@",processedFiles);
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ definitionsString=%@",
|
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ definitionsString=%@",
|
||||||
localDefinitionName_,
|
aLocalDefinitionName,
|
||||||
localDefinitionstring_);
|
aLocalDefinitionString);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSDebugMLLog0(@"low",@"Call definitionsParser");
|
NSDebugMLLog0(@"low",@"Call definitionsParser");
|
||||||
|
@ -339,9 +339,9 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"%@ Errors in Definitions parsing template named %@: %@\nString:\n%@",
|
@"%@ Errors in Definitions parsing template named %@: %@\nString:\n%@",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
localDefinitionName_,
|
aLocalDefinitionName,
|
||||||
[definitionsParser errors],
|
[definitionsParser errors],
|
||||||
localDefinitionstring_);
|
aLocalDefinitionString);
|
||||||
};
|
};
|
||||||
NSDebugMLLog0(@"low",@"Call [definitionsParser elements]");
|
NSDebugMLLog0(@"low",@"Call [definitionsParser elements]");
|
||||||
tmpDefinitions=[[[definitionsParser elements] mutableCopy] autorelease];
|
tmpDefinitions=[[[definitionsParser elements] mutableCopy] autorelease];
|
||||||
|
@ -354,7 +354,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
{
|
{
|
||||||
LOGError(@"%@ name:%@ Definitions Parse failed!",
|
LOGError(@"%@ name:%@ Definitions Parse failed!",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
localDefinitionName_);
|
aLocalDefinitionName);
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
||||||
@"%@ In [definitionsParser document]...",
|
@"%@ In [definitionsParser document]...",
|
||||||
[self logPrefix]);
|
[self logPrefix]);
|
||||||
|
@ -378,12 +378,12 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
if (localDefinitions)
|
if (localDefinitions)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionsIncludes:%@\n",definitionsIncludes);
|
NSDebugMLLog(@"GSWTemplateParser",@"definitionsIncludes:%@\n",definitionsIncludes);
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitionName_:%@\n",localDefinitionName_);
|
NSDebugMLLog(@"GSWTemplateParser",@"aLocalDefinitionName:%@\n",aLocalDefinitionName);
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"localFrameworkName_:%@\n",localFrameworkName_);
|
NSDebugMLLog(@"GSWTemplateParser",@"aLocalFrameworkName:%@\n",aLocalFrameworkName);
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles:%@\n",processedFiles);
|
NSDebugMLLog(@"GSWTemplateParser",@"processedFiles:%@\n",processedFiles);
|
||||||
tmpDefinitions=[self processIncludes:definitionsIncludes
|
tmpDefinitions=[self processIncludes:definitionsIncludes
|
||||||
named:localDefinitionName_
|
named:aLocalDefinitionName
|
||||||
inFrameworkNamed:localFrameworkName_
|
inFrameworkNamed:aLocalFrameworkName
|
||||||
processedFiles:processedFiles];
|
processedFiles:processedFiles];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||||
if (tmpDefinitions)
|
if (tmpDefinitions)
|
||||||
|
@ -393,7 +393,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
localDefinitions=nil;
|
localDefinitions=nil;
|
||||||
LOGError(@"%@ Template name:%@ componentDefinition parse failed for definitionsIncludes:%@",
|
LOGError(@"%@ Template name:%@ componentDefinition parse failed for definitionsIncludes:%@",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
localDefinitionName_,
|
aLocalDefinitionName,
|
||||||
definitionsIncludes);
|
definitionsIncludes);
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
NSDebugMLLog(@"GSWTemplateParser",@"localDefinitions:%@\n",localDefinitions);
|
||||||
|
@ -406,8 +406,8 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)parseDefinitionInclude:(NSString*)includeName_
|
-(NSDictionary*)parseDefinitionInclude:(NSString*)anIncludeName
|
||||||
fromFrameworkNamed:(NSString*)fromFrameworkName_
|
fromFrameworkNamed:(NSString*)fromFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles
|
processedFiles:(NSMutableSet*)processedFiles
|
||||||
{
|
{
|
||||||
NSDictionary* returnedLocalDefinitions=nil;
|
NSDictionary* returnedLocalDefinitions=nil;
|
||||||
|
@ -415,99 +415,99 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
NSDictionary* tmpDefinitions=nil;
|
NSDictionary* tmpDefinitions=nil;
|
||||||
NSString* localFrameworkName=nil;
|
NSString* localFrameworkName=nil;
|
||||||
NSString* localDefinitionName=nil;
|
NSString* localDefinitionName=nil;
|
||||||
NSString* _language=nil;
|
NSString* language=nil;
|
||||||
NSString* _resourceName=nil;
|
NSString* resourceName=nil;
|
||||||
NSString* localDefinitionResourceName=nil;
|
NSString* localDefinitionResourceName=nil;
|
||||||
GSWResourceManager* _resourceManager=nil;
|
GSWResourceManager* resourceManager=nil;
|
||||||
NSString* _path=nil;
|
NSString* path=nil;
|
||||||
int iLanguage=0;
|
int iLanguage=0;
|
||||||
int iName=0;
|
int iName=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"gswcomponents",@"includeName_=%@",includeName_);
|
NSDebugMLLog(@"gswcomponents",@"anIncludeName=%@",anIncludeName);
|
||||||
_resourceManager=[GSWApp resourceManager];
|
resourceManager=[GSWApp resourceManager];
|
||||||
localDefinitionName=[includeName_ lastPathComponent];
|
localDefinitionName=[anIncludeName lastPathComponent];
|
||||||
localFrameworkName=[includeName_ stringByDeletingLastPathComponent];
|
localFrameworkName=[anIncludeName stringByDeletingLastPathComponent];
|
||||||
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
|
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
|
||||||
NSDebugMLLog(@"gswcomponents",@"fromFrameworkName_=%@",fromFrameworkName_);
|
NSDebugMLLog(@"gswcomponents",@"fromFrameworkName=%@",fromFrameworkName);
|
||||||
if ([localFrameworkName length]==0)
|
if ([localFrameworkName length]==0)
|
||||||
localFrameworkName=fromFrameworkName_;
|
localFrameworkName=fromFrameworkName;
|
||||||
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
|
NSDebugMLLog(@"gswcomponents",@"localFrameworkName=%@",localFrameworkName);
|
||||||
|
|
||||||
for(iLanguage=0;iLanguage<=[_languages count] && !_path;iLanguage++)
|
for(iLanguage=0;iLanguage<=[_languages count] && !path;iLanguage++)
|
||||||
{
|
{
|
||||||
if (iLanguage<[_languages count])
|
if (iLanguage<[_languages count])
|
||||||
_language=[_languages objectAtIndex:iLanguage];
|
language=[_languages objectAtIndex:iLanguage];
|
||||||
else
|
else
|
||||||
_language=nil;
|
language=nil;
|
||||||
for(iName=0;!_path && iName<2;iName++)
|
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)]];
|
localDefinitionResourceName=[localDefinitionName stringByAppendingString:GSWComponentDefinitionPSuffix[GSWebNamingConvForRound(iName)]];
|
||||||
NSDebugMLLog(@"gswcomponents",@"_resourceName=%@ localDefinitionResourceName=%@ localDefinitionName=%@",
|
NSDebugMLLog(@"gswcomponents",@"resourceName=%@ localDefinitionResourceName=%@ localDefinitionName=%@",
|
||||||
_resourceName,
|
resourceName,
|
||||||
localDefinitionResourceName,
|
localDefinitionResourceName,
|
||||||
localDefinitionName);
|
localDefinitionName);
|
||||||
NSDebugMLLog(@"gswcomponents",@"Search %@ Language=%@",_resourceName,_language);
|
NSDebugMLLog(@"gswcomponents",@"Search %@ Language=%@",resourceName,language);
|
||||||
_path=[_resourceManager pathForResourceNamed:_resourceName
|
path=[resourceManager pathForResourceNamed:resourceName
|
||||||
inFramework:localFrameworkName
|
inFramework:localFrameworkName
|
||||||
language:_language];
|
language:language];
|
||||||
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: _language=%@ _path=%@ processedFiles=%@",
|
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: language=%@ path=%@ processedFiles=%@",
|
||||||
_language,
|
language,
|
||||||
_path,
|
path,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
if (_path)
|
if (path)
|
||||||
{
|
{
|
||||||
_path=[_path stringByAppendingPathComponent:localDefinitionResourceName];
|
path=[path stringByAppendingPathComponent:localDefinitionResourceName];
|
||||||
NSDebugMLLog(@"gswcomponents",@"Found %@ Language=%@ : %@",_resourceName,_language,_path);
|
NSDebugMLLog(@"gswcomponents",@"Found %@ Language=%@ : %@",resourceName,language,path);
|
||||||
if ([processedFiles containsObject:_path])
|
if ([processedFiles containsObject:path])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",_path);
|
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",path);
|
||||||
_path=nil;
|
path=nil;
|
||||||
if (_language)
|
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
|
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);
|
NSDebugMLLog(@"gswcomponents",@"Direct Search %@ Language=%@",localDefinitionResourceName,language);
|
||||||
_path=[_resourceManager pathForResourceNamed:localDefinitionResourceName
|
path=[resourceManager pathForResourceNamed:localDefinitionResourceName
|
||||||
inFramework:localFrameworkName
|
inFramework:localFrameworkName
|
||||||
language:_language];
|
language:language];
|
||||||
if (_path)
|
if (path)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswcomponents",@"Direct Found %@ Language=%@ : %@",localDefinitionResourceName,_language,_path);
|
NSDebugMLLog(@"gswcomponents",@"Direct Found %@ Language=%@ : %@",localDefinitionResourceName,language,path);
|
||||||
if ([processedFiles containsObject:_path])
|
if ([processedFiles containsObject:path])
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",_path);
|
NSDebugMLLog(@"gswcomponents",@"path=%@ already processed",path);
|
||||||
_path=nil;
|
path=nil;
|
||||||
if (_language)
|
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
|
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=%@)",
|
NSDebugMLLog(@"gswcomponents",@"Direct Search in Component Definition language=%@ path=%@ (processedFiles=%@)",
|
||||||
_language,
|
language,
|
||||||
_path,
|
path,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: _language=%@ _path=%@ processedFiles=%@",
|
NSDebugMLLog(@"gswcomponents",@"Search In Page Component: language=%@ path=%@ processedFiles=%@",
|
||||||
_language,
|
language,
|
||||||
_path,
|
path,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (_path)
|
if (path)
|
||||||
{
|
{
|
||||||
NSString* _pageDefString=nil;
|
NSString* pageDefString=nil;
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"_path=%@",_path);
|
NSDebugMLLog(@"GSWTemplateParser",@"path=%@",path);
|
||||||
[processedFiles addObject:_path];
|
[processedFiles addObject:path];
|
||||||
//NSString* pageDefPath=[path stringByAppendingString:_definitionPath];
|
//NSString* pageDefPath=[path stringByAppendingString:_definitionPath];
|
||||||
//TODO use encoding !
|
//TODO use encoding !
|
||||||
_pageDefString=[NSString stringWithContentsOfFile:_path];
|
pageDefString=[NSString stringWithContentsOfFile:path];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"path=%@: _pageDefString:%@\n",_path,_pageDefString);
|
NSDebugMLLog(@"GSWTemplateParser",@"path=%@: pageDefString:%@\n",path,pageDefString);
|
||||||
if (_pageDefString)
|
if (pageDefString)
|
||||||
{
|
{
|
||||||
tmpDefinitions=[self parseDefinitionsString:_pageDefString
|
tmpDefinitions=[self parseDefinitionsString:pageDefString
|
||||||
named:includeName_
|
named:anIncludeName
|
||||||
inFrameworkNamed:localFrameworkName
|
inFrameworkNamed:localFrameworkName
|
||||||
processedFiles:processedFiles];
|
processedFiles:processedFiles];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
NSDebugMLLog(@"GSWTemplateParser",@"tmpDefinitions:%@\n",tmpDefinitions);
|
||||||
|
@ -517,7 +517,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
{
|
{
|
||||||
LOGError(@"%@ Template componentDefinition parse failed for included file:%@ in framework:%@ (processedFiles=%@)",
|
LOGError(@"%@ Template componentDefinition parse failed for included file:%@ in framework:%@ (processedFiles=%@)",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
includeName_,
|
anIncludeName,
|
||||||
localFrameworkName,
|
localFrameworkName,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
};
|
};
|
||||||
|
@ -528,7 +528,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"%@ Can't load included component definition named:%@ in framework:%@ (processedFiles=%@)",
|
@"%@ Can't load included component definition named:%@ in framework:%@ (processedFiles=%@)",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
includeName_,
|
anIncludeName,
|
||||||
localFrameworkName,
|
localFrameworkName,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
};
|
};
|
||||||
|
@ -538,7 +538,7 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"%@ Can't find included component definition named:%@ in framework:%@ (processedFiles=%@)",
|
@"%@ Can't find included component definition named:%@ in framework:%@ (processedFiles=%@)",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
includeName_,
|
anIncludeName,
|
||||||
localFrameworkName,
|
localFrameworkName,
|
||||||
processedFiles);
|
processedFiles);
|
||||||
};
|
};
|
||||||
|
@ -550,45 +550,45 @@ Class GSWTemplateParser_DefaultParserClass=Nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)processIncludes:(NSArray*)definitionsIncludes_
|
-(NSDictionary*)processIncludes:(NSArray*)someDefinitionsIncludes
|
||||||
named:(NSString*)localDefinitionsName_
|
named:(NSString*)aLocalDefinitionsName
|
||||||
inFrameworkNamed:(NSString*)localFrameworkName_
|
inFrameworkNamed:(NSString*)aLocalFrameworkName
|
||||||
processedFiles:(NSMutableSet*)processedFiles
|
processedFiles:(NSMutableSet*)processedFiles
|
||||||
{
|
{
|
||||||
int _count=0;
|
int count=0;
|
||||||
NSDictionary* returnedLocalDefinitions=nil;
|
NSDictionary* returnedLocalDefinitions=nil;
|
||||||
NSMutableDictionary* localDefinitions=nil;
|
NSMutableDictionary* localDefinitions=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ frameworkName_=%@ definitionsIncludes_=%@",
|
NSDebugMLLog(@"GSWTemplateParser",@"name:%@ aFrameworkName=%@ someDefinitionsIncludes=%@",
|
||||||
localDefinitionsName_,
|
aLocalDefinitionsName,
|
||||||
localFrameworkName_,
|
aLocalFrameworkName,
|
||||||
definitionsIncludes_);
|
someDefinitionsIncludes);
|
||||||
localDefinitions=[NSMutableDictionary dictionary];
|
localDefinitions=(NSMutableDictionary*)[NSMutableDictionary dictionary];
|
||||||
_count=[definitionsIncludes_ count];
|
count=[someDefinitionsIncludes count];
|
||||||
if (_count>0)
|
if (count>0)
|
||||||
{
|
{
|
||||||
NSDictionary* tmpDefinitions=nil;
|
NSDictionary* tmpDefinitions=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
NSString* _includeName=nil;
|
NSString* includeName=nil;
|
||||||
for(i=_count-1;localDefinitions && i>=0;i--)
|
for(i=count-1;localDefinitions && i>=0;i--)
|
||||||
{
|
{
|
||||||
_includeName=[definitionsIncludes_ objectAtIndex:i];
|
includeName=[someDefinitionsIncludes objectAtIndex:i];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@",
|
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition includeName:%@",
|
||||||
_includeName);
|
includeName);
|
||||||
tmpDefinitions=[self parseDefinitionInclude:_includeName
|
tmpDefinitions=[self parseDefinitionInclude:includeName
|
||||||
fromFrameworkNamed:localFrameworkName_
|
fromFrameworkNamed:aLocalFrameworkName
|
||||||
processedFiles:processedFiles];
|
processedFiles:processedFiles];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition _includeName:%@ tmpDefinitions=%@",
|
NSDebugMLLog(@"GSWTemplateParser",@"Template componentDefinition includeName:%@ tmpDefinitions=%@",
|
||||||
_includeName,
|
includeName,
|
||||||
tmpDefinitions);
|
tmpDefinitions);
|
||||||
if (tmpDefinitions)
|
if (tmpDefinitions)
|
||||||
[localDefinitions addDefaultEntriesFromDictionary:tmpDefinitions];
|
[localDefinitions addDefaultEntriesFromDictionary:tmpDefinitions];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
localDefinitions=nil;
|
localDefinitions=nil;
|
||||||
LOGError(@"%@ Template componentDefinition parse failed for _includeName:%@",
|
LOGError(@"%@ Template componentDefinition parse failed for includeName:%@",
|
||||||
[self logPrefix],
|
[self logPrefix],
|
||||||
_includeName);
|
includeName);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWTemplateParserANTLR.h - GSWeb: Class GSWTemplateParserANTLR
|
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -46,12 +52,12 @@
|
||||||
};
|
};
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSArray*)templateElements;
|
-(NSArray*)templateElements;
|
||||||
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)_AST
|
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)AST
|
||||||
stopOnTagNamed:(NSString*)_stopTagName;
|
stopOnTagNamed:(NSString*)stopTagName;
|
||||||
|
|
||||||
-(BOOL)parseTag:(ANTLRDefAST)_AST;
|
-(BOOL)parseTag:(ANTLRDefAST)AST;
|
||||||
-(NSString*)getTagNameFor:(ANTLRDefAST)_AST;
|
-(NSString*)getTagNameFor:(ANTLRDefAST)AST;
|
||||||
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)_AST;
|
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)AST;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_GSWTemplateParserANTLR_h__
|
#endif //_GSWTemplateParserANTLR_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWTemplateParserANTLR.m - GSWeb: Class GSWTemplateParserANTLR
|
/** GSWTemplateParserANTLR.h - <title>GSWeb: Class GSWTemplateParserANTLR</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -152,18 +158,18 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)parseTag:(ANTLRDefAST)_AST
|
-(BOOL)parseTag:(ANTLRDefAST)anAST
|
||||||
{
|
{
|
||||||
BOOL htmlAttrParseOK=YES;
|
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();
|
LOGClassFnStart();
|
||||||
if (!tagName
|
if (!tagName
|
||||||
&& ([_AST tokenType]==GSWHTMLTokenType_OPENTAG
|
&& ([anAST tokenType]==GSWHTMLTokenType_OPENTAG
|
||||||
|| [_AST tokenType]==GSWHTMLTokenType_CLOSETAG))
|
|| [anAST tokenType]==GSWHTMLTokenType_CLOSETAG))
|
||||||
{
|
{
|
||||||
NSAutoreleasePool* arpParse=nil;
|
NSAutoreleasePool* arpParse=nil;
|
||||||
ANTLRTextInputStreamString* _tagStream=[[[ANTLRTextInputStreamString alloc]
|
ANTLRTextInputStreamString* _tagStream=[[[ANTLRTextInputStreamString alloc]
|
||||||
initWithString:[_AST text]]
|
initWithString:[anAST text]]
|
||||||
autorelease];
|
autorelease];
|
||||||
GSWHTMLAttrLexer* htmlAttrLexer=[[[GSWHTMLAttrLexer alloc]
|
GSWHTMLAttrLexer* htmlAttrLexer=[[[GSWHTMLAttrLexer alloc]
|
||||||
initWithTextStream:_tagStream]
|
initWithTextStream:_tagStream]
|
||||||
|
@ -173,7 +179,7 @@ static char rcsId[] = "$Id$";
|
||||||
autorelease];
|
autorelease];
|
||||||
NSString* tagName=nil;
|
NSString* tagName=nil;
|
||||||
NSDictionary* tagAttrs=nil;
|
NSDictionary* tagAttrs=nil;
|
||||||
NSDebugMLLog(@"low",@"PARSE:[%@]",[_AST text]);
|
NSDebugMLLog(@"low",@"PARSE:[%@]",[anAST text]);
|
||||||
NSDebugMLLog(@"low",@"stream:[%@]",_tagStream);
|
NSDebugMLLog(@"low",@"stream:[%@]",_tagStream);
|
||||||
htmlAttrParseOK=NO;
|
htmlAttrParseOK=NO;
|
||||||
arpParse=[NSAutoreleasePool new];
|
arpParse=[NSAutoreleasePool new];
|
||||||
|
@ -197,7 +203,7 @@ static char rcsId[] = "$Id$";
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
htmlAttrParseOK=NO;
|
htmlAttrParseOK=NO;
|
||||||
LOGError(@"PARSE PB:[%@]",[_AST text]);//TODO
|
LOGError(@"PARSE PB:[%@]",[anAST text]);//TODO
|
||||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||||
@"In [_tagParser tag]...");
|
@"In [_tagParser tag]...");
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -217,7 +223,7 @@ static char rcsId[] = "$Id$";
|
||||||
DESTROY(arpParse);
|
DESTROY(arpParse);
|
||||||
NSDebugMLLog0(@"low",@"DESTROYED(arpParse)\n");
|
NSDebugMLLog0(@"low",@"DESTROYED(arpParse)\n");
|
||||||
|
|
||||||
NSDebugMLLog(@"low",@"END PARSE:[%@]",[_AST text]);
|
NSDebugMLLog(@"low",@"END PARSE:[%@]",[anAST text]);
|
||||||
|
|
||||||
if (htmlAttrParseOK && tagName)
|
if (htmlAttrParseOK && tagName)
|
||||||
{
|
{
|
||||||
|
@ -227,17 +233,17 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"low",@"Add tagName:[%@]",
|
NSDebugMLLog(@"low",@"Add tagName:[%@]",
|
||||||
tagName);
|
tagName);
|
||||||
[_tagsNames setObject: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=%@",
|
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:[%@]",
|
NSDebugMLLog(@"low",@"Add tagsAttrs:[%@]",
|
||||||
tagAttrs);
|
tagAttrs);
|
||||||
if (tagAttrs)
|
if (tagAttrs)
|
||||||
{
|
{
|
||||||
[_tagsAttrs setObject: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=%@",
|
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();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"low",@"[%@]",[_AST text]);
|
NSDebugMLLog(@"low",@"[%@]",[anAST text]);
|
||||||
if (!tagName)
|
if (!tagName)
|
||||||
{
|
{
|
||||||
BOOL htmlAttrParseOK=[self parseTag:_AST];
|
BOOL htmlAttrParseOK=[self parseTag:anAST];
|
||||||
if (htmlAttrParseOK)
|
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);
|
NSDebugMLLog(@"low",@"tagName:[%@]",tagName);
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
|
@ -263,18 +271,18 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)_AST
|
-(NSDictionary*)getTagAttrsFor:(ANTLRDefAST)anAST
|
||||||
{
|
{
|
||||||
NSDictionary* tagAttrs=[_tagsAttrs objectForKey:
|
NSDictionary* tagAttrs=[_tagsAttrs objectForKey:
|
||||||
[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
|
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"low",@"[%@]",[_AST text]);
|
NSDebugMLLog(@"low",@"[%@]",[anAST text]);
|
||||||
if (!tagAttrs)
|
if (!tagAttrs)
|
||||||
{
|
{
|
||||||
BOOL htmlAttrParseOK=[self parseTag:_AST];
|
BOOL htmlAttrParseOK=[self parseTag:anAST];
|
||||||
if (htmlAttrParseOK)
|
if (htmlAttrParseOK)
|
||||||
tagAttrs=[_tagsAttrs objectForKey:
|
tagAttrs=[_tagsAttrs objectForKey:
|
||||||
[NSNumber numberWithUnsignedLong:(unsigned long)_AST]]; //TODO bad hack
|
[NSNumber numberWithUnsignedLong:(unsigned long)anAST]]; //TODO bad hack
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"tagAttrs:[%@]",tagAttrs);
|
NSDebugMLLog(@"low",@"tagAttrs:[%@]",tagAttrs);
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
|
@ -282,34 +290,34 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)_AST
|
-(NSArray*)createElementsStartingWithAST:(ANTLRDefAST*)anAST
|
||||||
stopOnTagNamed:(NSString*)_stopTagName
|
stopOnTagNamed:(NSString*)stopTagName
|
||||||
{
|
{
|
||||||
NSMutableArray* _elements=[NSMutableArray array];
|
NSMutableArray* elements=[NSMutableArray array];
|
||||||
ANTLRDefAST _currentAST=*_AST;
|
ANTLRDefAST currentAST=*anAST;
|
||||||
BOOL end=NO;
|
BOOL end=NO;
|
||||||
BOOL inHTMLBareString=NO;
|
BOOL inHTMLBareString=NO;
|
||||||
NSMutableString* htmlBareString=nil;
|
NSMutableString* htmlBareString=nil;
|
||||||
LOGClassFnStart();
|
LOGClassFnStart();
|
||||||
NSDebugMLLog(@"low",@"_stopTagName:[%@]",_stopTagName);
|
NSDebugMLLog(@"low",@"stopTagName:[%@]",stopTagName);
|
||||||
while(_currentAST && !end)
|
while(currentAST && !end)
|
||||||
{
|
{
|
||||||
GSWElement* element=nil;
|
GSWElement* element=nil;
|
||||||
NSString* tagName=nil;
|
NSString* tagName=nil;
|
||||||
NSDictionary* tagAttrs=nil;
|
NSDictionary* tagAttrs=nil;
|
||||||
BOOL stopBareString=NO;
|
BOOL stopBareString=NO;
|
||||||
NSDebugMLLog(@"low",@"[_currentAST: text=[%@] Type=%d",
|
NSDebugMLLog(@"low",@"[currentAST: text=[%@] Type=%d",
|
||||||
[_currentAST text],
|
[currentAST text],
|
||||||
[_currentAST tokenType]);
|
[currentAST tokenType]);
|
||||||
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
|
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
|
||||||
end ? "YES" : "NO",
|
end ? "YES" : "NO",
|
||||||
inHTMLBareString ? "YES" : "NO",
|
inHTMLBareString ? "YES" : "NO",
|
||||||
stopBareString ? "YES" : "NO");
|
stopBareString ? "YES" : "NO");
|
||||||
|
|
||||||
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG
|
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG
|
||||||
|| [_currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
|
|| [currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
|
||||||
{
|
{
|
||||||
tagName=[self getTagNameFor:_currentAST];
|
tagName=[self getTagNameFor:currentAST];
|
||||||
NSDebugMLLog(@"low",@"Result tagName:[%@]",tagName);
|
NSDebugMLLog(@"low",@"Result tagName:[%@]",tagName);
|
||||||
if (!tagName)
|
if (!tagName)
|
||||||
{
|
{
|
||||||
|
@ -317,11 +325,11 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"[_currentAST tokenType]=%d",(int)[_currentAST tokenType]);
|
NSDebugMLLog(@"low",@"[currentAST tokenType]=%d",(int)[currentAST tokenType]);
|
||||||
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
|
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
|
||||||
{
|
{
|
||||||
NSDebugMLLog0(@"low",@"Found Open Tag");
|
NSDebugMLLog0(@"low",@"Found Open Tag");
|
||||||
tagAttrs=[self getTagAttrsFor:_currentAST];
|
tagAttrs=[self getTagAttrsFor:currentAST];
|
||||||
NSDebugMLLog(@"low",@"tagAttrs=%@",tagAttrs);
|
NSDebugMLLog(@"low",@"tagAttrs=%@",tagAttrs);
|
||||||
if ([tagName caseInsensitiveCompare:GSWTag_Name[GSWNAMES_INDEX]]==NSOrderedSame
|
if ([tagName caseInsensitiveCompare:GSWTag_Name[GSWNAMES_INDEX]]==NSOrderedSame
|
||||||
|| [tagName caseInsensitiveCompare:GSWTag_Name[WONAMES_INDEX]]==NSOrderedSame)
|
|| [tagName caseInsensitiveCompare:GSWTag_Name[WONAMES_INDEX]]==NSOrderedSame)
|
||||||
|
@ -336,7 +344,7 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ANTLRDefAST nextAST=[_currentAST nextSibling];
|
ANTLRDefAST nextAST=[currentAST nextSibling];
|
||||||
NSString* name=[tagAttrs objectForKey:@"name"];
|
NSString* name=[tagAttrs objectForKey:@"name"];
|
||||||
NSDebugMLLog0(@"low",@"Process GSWeb Tag");
|
NSDebugMLLog0(@"low",@"Process GSWeb Tag");
|
||||||
NSDebugMLLog(@"low",@"GSWeb Tag: name:[%@]",
|
NSDebugMLLog(@"low",@"GSWeb Tag: name:[%@]",
|
||||||
|
@ -344,7 +352,7 @@ static char rcsId[] = "$Id$";
|
||||||
if (!name)
|
if (!name)
|
||||||
{
|
{
|
||||||
LOGError(@"No name for Element:%@",
|
LOGError(@"No name for Element:%@",
|
||||||
[_currentAST text]);//TODO
|
[currentAST text]);//TODO
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
ExceptionRaise(@"GSWTemplateParser",
|
||||||
@"GSWTemlateParser: no name for GNUstepWeb tag in template named %@",
|
@"GSWTemlateParser: no name for GNUstepWeb tag in template named %@",
|
||||||
_templateName);
|
_templateName);
|
||||||
|
@ -425,28 +433,28 @@ static char rcsId[] = "$Id$";
|
||||||
_templateName);
|
_templateName);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_currentAST=nextAST;
|
currentAST=nextAST;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_stopTagName
|
if (stopTagName
|
||||||
&& [tagName caseInsensitiveCompare:_stopTagName]==NSOrderedSame)
|
&& [tagName caseInsensitiveCompare:stopTagName]==NSOrderedSame)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"_stopTagName found: %@",_stopTagName);
|
NSDebugMLLog(@"low",@"stopTagName found: %@",stopTagName);
|
||||||
end=YES;
|
end=YES;
|
||||||
stopBareString=YES;
|
stopBareString=YES;
|
||||||
_currentAST=[_currentAST nextSibling];
|
currentAST=[currentAST nextSibling];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if ([_currentAST tokenType]==GSWHTMLTokenType_COMMENT)
|
else if ([currentAST tokenType]==GSWHTMLTokenType_COMMENT)
|
||||||
{
|
{
|
||||||
stopBareString=YES;
|
stopBareString=YES;
|
||||||
element=[GSWHTMLComment elementWithString:[_currentAST text]];
|
element=[GSWHTMLComment elementWithString:[currentAST text]];
|
||||||
_currentAST=[_currentAST nextSibling];
|
currentAST=[currentAST nextSibling];
|
||||||
}
|
}
|
||||||
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
|
NSDebugMLLog(@"low",@"end=%s inHTMLBareString=%s stopBareString=%s",
|
||||||
end ? "YES" : "NO",
|
end ? "YES" : "NO",
|
||||||
|
@ -461,17 +469,17 @@ static char rcsId[] = "$Id$";
|
||||||
inHTMLBareString=YES;
|
inHTMLBareString=YES;
|
||||||
htmlBareString=[[NSMutableString new] autorelease];
|
htmlBareString=[[NSMutableString new] autorelease];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"inHTMLBareString: adding [%@]",[_currentAST text]);
|
NSDebugMLLog(@"low",@"inHTMLBareString: adding [%@]",[currentAST text]);
|
||||||
if ([_currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
|
if ([currentAST tokenType]==GSWHTMLTokenType_OPENTAG)
|
||||||
[htmlBareString appendFormat:@"<%@>",[_currentAST text]];
|
[htmlBareString appendFormat:@"<%@>",[currentAST text]];
|
||||||
else if ([_currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
|
else if ([currentAST tokenType]==GSWHTMLTokenType_CLOSETAG)
|
||||||
[htmlBareString appendFormat:@"</%@>",[_currentAST text]];
|
[htmlBareString appendFormat:@"</%@>",[currentAST text]];
|
||||||
else
|
else
|
||||||
[htmlBareString appendString:[_currentAST text]];
|
[htmlBareString appendString:[currentAST text]];
|
||||||
NSDebugMLLog(@"low",@"htmlBareString: ==> [%@]",htmlBareString);
|
NSDebugMLLog(@"low",@"htmlBareString: ==> [%@]",htmlBareString);
|
||||||
_currentAST=[_currentAST nextSibling];
|
currentAST=[currentAST nextSibling];
|
||||||
};
|
};
|
||||||
if (inHTMLBareString && (stopBareString || !_currentAST))
|
if (inHTMLBareString && (stopBareString || !currentAST))
|
||||||
{
|
{
|
||||||
NSDebugMLLog0(@"low",@"inHTMLBareString && stopBareString");
|
NSDebugMLLog0(@"low",@"inHTMLBareString && stopBareString");
|
||||||
NSDebugMLLog(@"low",@"CREATE GSWHTMLBareString:\n%@",htmlBareString);
|
NSDebugMLLog(@"low",@"CREATE GSWHTMLBareString:\n%@",htmlBareString);
|
||||||
|
@ -483,17 +491,17 @@ static char rcsId[] = "$Id$";
|
||||||
if (element)
|
if (element)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"element to add: element=[%@]",element);
|
NSDebugMLLog(@"low",@"element to add: element=[%@]",element);
|
||||||
[_elements addObject:element];
|
[elements addObject:element];
|
||||||
element=nil;
|
element=nil;
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"element:%@",element);
|
NSDebugMLLog(@"low",@"element:%@",element);
|
||||||
NSDebugMLLog(@"low",@"inHTMLBareString:%d",(int)inHTMLBareString);
|
NSDebugMLLog(@"low",@"inHTMLBareString:%d",(int)inHTMLBareString);
|
||||||
NSDebugMLLog(@"low",@"htmlBareString:%@",htmlBareString);
|
NSDebugMLLog(@"low",@"htmlBareString:%@",htmlBareString);
|
||||||
};
|
};
|
||||||
*_AST=_currentAST;
|
*anAST=currentAST;
|
||||||
NSDebugMLLog(@"low",@"_elements]:%@",_elements);
|
NSDebugMLLog(@"low",@"elements]:%@",elements);
|
||||||
LOGClassFnStop();
|
LOGClassFnStop();
|
||||||
return _elements;
|
return elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWTemplateParserXML.h - GSWeb: Class GSWTemplateParserXML
|
/** GSWTemplateParserXML.h - <title>GSWeb: Class GSWTemplateParserXML</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Mar 1999
|
Date: Mar 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -47,7 +53,7 @@
|
||||||
+(void)setCachedDTDContent:(NSString*)externalContent
|
+(void)setCachedDTDContent:(NSString*)externalContent
|
||||||
forKey:(NSString*)url;
|
forKey:(NSString*)url;
|
||||||
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser;
|
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser;
|
||||||
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser_;
|
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser;
|
||||||
-(id)init;
|
-(id)init;
|
||||||
-(xmlParserInputPtr)resolveEntity:(NSString*)publicIdEntity
|
-(xmlParserInputPtr)resolveEntity:(NSString*)publicIdEntity
|
||||||
systemID:(NSString*)systemIdEntity;
|
systemID:(NSString*)systemIdEntity;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/** GSWTemplateParserXML.m - <title>GSWeb: Class GSWTemplateParserXML</title>
|
/** GSWTemplateParserXML.m - <title>GSWeb: Class GSWTemplateParserXML</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
@ -121,9 +122,9 @@ static NSMutableDictionary* DTDCache=nil;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser_
|
+(id)handlerWithTemplateParser:(GSWTemplateParser*)templateParser
|
||||||
{
|
{
|
||||||
return AUTORELEASE([[self alloc] initWithTemplateParser:templateParser_]);
|
return AUTORELEASE([[self alloc] initWithTemplateParser:templateParser]);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void externalSubset (void *ctx,
|
extern void externalSubset (void *ctx,
|
||||||
|
@ -132,11 +133,11 @@ extern void externalSubset (void *ctx,
|
||||||
const xmlChar *SystemID);
|
const xmlChar *SystemID);
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser_
|
-(id)initWithTemplateParser:(GSWTemplateParser*)templateParser
|
||||||
{
|
{
|
||||||
if ((self=[self init]))
|
if ((self=[self init]))
|
||||||
{
|
{
|
||||||
_templateParser=templateParser_;
|
_templateParser=templateParser;
|
||||||
//NSLog(@"my sax lib=%p",lib);
|
//NSLog(@"my sax lib=%p",lib);
|
||||||
if (lib)
|
if (lib)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* utils.h - utils
|
/** GSWUtils.m - <title>GSWeb: Utilities</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
#ifndef _GSWebUtils_h__
|
#ifndef _GSWebUtils_h__
|
||||||
#define _GSWebUtils_h__
|
#define _GSWebUtils_h__
|
||||||
|
@ -95,7 +103,7 @@ void ValidationExceptionRaiseFn0(const char *func,
|
||||||
{ ValidationExceptionRaiseFn0(__PRETTY_FUNCTION__, __FILE__, __LINE__,name_,message_,format_); }
|
{ ValidationExceptionRaiseFn0(__PRETTY_FUNCTION__, __FILE__, __LINE__,name_,message_,format_); }
|
||||||
|
|
||||||
extern BOOL boolValueFor(id id_);
|
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 BOOLNB boolNbFor(BOOL value_);
|
||||||
extern BOOL isHeaderKeysEqual(NSString* headerKey,NSString* testKey);
|
extern BOOL isHeaderKeysEqual(NSString* headerKey,NSString* testKey);
|
||||||
extern BOOL SBIsEqual(id id1,id id2);
|
extern BOOL SBIsEqual(id id1,id id2);
|
||||||
|
@ -198,22 +206,22 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSException (NSExceptionUserInfoAdd)
|
@interface NSException (NSExceptionUserInfoAdd)
|
||||||
|
|
||||||
-(NSException*)exceptionByAddingUserInfo:(NSDictionary*)userInfo_;
|
-(NSException*)exceptionByAddingUserInfo:(NSDictionary*)userInfo;
|
||||||
-(NSException*)exceptionByAddingUserInfoKey:(id)key_
|
-(NSException*)exceptionByAddingUserInfoKey:(id)key
|
||||||
format:(NSString*)format_,...;
|
format:(NSString*)format,...;
|
||||||
-(NSException*)exceptionByAddingToUserInfoKey:(id)key_
|
-(NSException*)exceptionByAddingToUserInfoKey:(id)key
|
||||||
format:(NSString*)format_,...;
|
format:(NSString*)format,...;
|
||||||
-(NSException*)exceptionByAddingUserInfoFrameInfo:(NSString*)frameInfo_;
|
-(NSException*)exceptionByAddingUserInfoFrameInfo:(NSString*)frameInfo;
|
||||||
-(NSException*)exceptionByAddingUserInfoFrameInfoFormat:(NSString*)format_,...;
|
-(NSException*)exceptionByAddingUserInfoFrameInfoFormat:(NSString*)format,...;
|
||||||
-(NSException*)exceptionByAddingUserInfoFrameInfoObject:(id)obj_
|
-(NSException*)exceptionByAddingUserInfoFrameInfoObject:(id)obj
|
||||||
sel:(SEL)sel_
|
sel:(SEL)sel
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_
|
line:(int)line
|
||||||
format:(NSString*)format_,...;
|
format:(NSString*)format,...;
|
||||||
-(NSException*)exceptionByAddingUserInfoFrameInfoFunction:(const char*)fn_
|
-(NSException*)exceptionByAddingUserInfoFrameInfoFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_
|
line:(int)line
|
||||||
format:(NSString*)format_,...;
|
format:(NSString*)format,...;
|
||||||
-(BOOL)isValidationException;
|
-(BOOL)isValidationException;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -224,41 +232,41 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSDictionary (SBDictionary)
|
@interface NSDictionary (SBDictionary)
|
||||||
-(id) objectForKey:(id)_key
|
-(id) objectForKey:(id)key
|
||||||
withDefaultObject:(id)_default;
|
withDefaultObject:(id)defaultObject;
|
||||||
+(id) dictionaryWithDictionary:(NSDictionary*)dictionary_
|
+(id) dictionaryWithDictionary:(NSDictionary*)dictionary
|
||||||
andDefaultEntriesFromDictionary:(NSDictionary*)dictionaryDefaults_;
|
andDefaultEntriesFromDictionary:(NSDictionary*)dictionaryDefaults;
|
||||||
-(id)dictionaryBySettingObject:(id)object_
|
-(id)dictionaryBySettingObject:(id)object
|
||||||
forKey:(id)key_;
|
forKey:(id)key;
|
||||||
-(id)dictionaryByAddingEntriesFromDictionary:(NSDictionary*)dictionary_;
|
-(id)dictionaryByAddingEntriesFromDictionary:(NSDictionary*)dictionary;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSMutableDictionary (SBMutableDictionary)
|
@interface NSMutableDictionary (SBMutableDictionary)
|
||||||
-(void)setDefaultObject:(id)object_
|
-(void)setDefaultObject:(id)object
|
||||||
forKey:(id)key_;
|
forKey:(id)key;
|
||||||
-(void)addDefaultEntriesFromDictionary:(NSDictionary*)dictionary_;
|
-(void)addDefaultEntriesFromDictionary:(NSDictionary*)dictionary;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSMutableOrderedArray: NSMutableArray
|
@interface NSMutableOrderedArray: NSMutableArray
|
||||||
{
|
{
|
||||||
NSMutableArray *array;
|
NSMutableArray* _array;
|
||||||
SEL compareSelector;
|
SEL _compareSelector;
|
||||||
};
|
};
|
||||||
-(id)initWithCompareSelector:(SEL)compareSelector;
|
-(id)initWithCompareSelector:(SEL)compareSelector;
|
||||||
-(void)addObject:(id)object_;
|
-(void)addObject:(id)object;
|
||||||
-(void)addObjectsFromArray:(NSArray*)array_;
|
-(void)addObjectsFromArray:(NSArray*)array;
|
||||||
-(void)insertObject:(id)object_
|
-(void)insertObject:(id)object
|
||||||
atIndex:(unsigned int)index_;
|
atIndex:(unsigned int)index;
|
||||||
-(void)replaceObjectAtIndex:(unsigned int)index_
|
-(void)replaceObjectAtIndex:(unsigned int)index
|
||||||
withObject:(id)object_;
|
withObject:(id)object;
|
||||||
-(void)replaceObjectsInRange:(NSRange)range_
|
-(void)replaceObjectsInRange:(NSRange)range
|
||||||
withObjectsFromArray:(NSArray*)array_;
|
withObjectsFromArray:(NSArray*)array;
|
||||||
-(void)replaceObjectsInRange:(NSRange)range_
|
-(void)replaceObjectsInRange:(NSRange)range
|
||||||
withObjectsFromArray:(NSArray*)array_
|
withObjectsFromArray:(NSArray*)array
|
||||||
range:(NSRange)arrayRange_;
|
range:(NSRange)arrayRange;
|
||||||
-(void)setArray:(NSArray*)array_;
|
-(void)setArray:(NSArray*)array;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -295,61 +303,68 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
@interface NSLock (NSLockBD)
|
@interface NSLock (NSLockBD)
|
||||||
-(BOOL)isLocked;
|
-(BOOL)isLocked;
|
||||||
-(BOOL)tmplock;
|
-(BOOL)tmplock;
|
||||||
-(BOOL)tmplockFromFunction:(const char*)fn_
|
-(BOOL)tmplockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(BOOL)tmptryLock;
|
-(BOOL)tmptryLock;
|
||||||
-(BOOL)tmptryLockFromFunction:(const char*)fn_
|
-(BOOL)tmptryLockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
|
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
|
||||||
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
|
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
|
||||||
fromFunction:(const char*)fn_
|
fromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
|
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
|
||||||
-(BOOL)tmplockBeforeDate:(NSDate*)limit
|
-(BOOL)tmplockBeforeDate:(NSDate*)limit
|
||||||
fromFunction:(const char*)fn_
|
fromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(void)tmpunlock;
|
-(void)tmpunlock;
|
||||||
-(void)tmpunlockFromFunction:(const char*)fn_
|
-(void)tmpunlockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSRecursiveLock (NSLockBD)
|
@interface NSRecursiveLock (NSLockBD)
|
||||||
-(BOOL)isLocked;
|
-(BOOL)isLocked;
|
||||||
-(BOOL)tmplock;
|
-(BOOL)tmplock;
|
||||||
-(BOOL)tmplockFromFunction:(const char*)fn_
|
-(BOOL)tmplockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(BOOL)tmptryLock;
|
-(BOOL)tmptryLock;
|
||||||
-(BOOL)tmptryLockFromFunction:(const char*)fn_
|
-(BOOL)tmptryLockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
|
|
||||||
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
|
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit;
|
||||||
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
|
-(BOOL)tmptryLockBeforeDate:(NSDate*)limit
|
||||||
fromFunction:(const char*)fn_
|
fromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
|
-(BOOL)tmplockBeforeDate:(NSDate*)limit;
|
||||||
-(BOOL)tmplockBeforeDate:(NSDate*)limit
|
-(BOOL)tmplockBeforeDate:(NSDate*)limit
|
||||||
fromFunction:(const char*)fn_
|
fromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
-(void)tmpunlock;
|
-(void)tmpunlock;
|
||||||
-(void)tmpunlockFromFunction:(const char*)fn_
|
-(void)tmpunlockFromFunction:(const char*)fn
|
||||||
file:(const char*)file_
|
file:(const char*)file
|
||||||
line:(int)line_;
|
line:(int)line;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSArray (NSPerformSelectorWith2Objects)
|
@interface NSArray (NSPerformSelectorWith2Objects)
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object1_
|
withObject:(id)object1
|
||||||
withObject:(id)object2_;
|
withObject:(id)object2;
|
||||||
|
|
||||||
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
|
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
|
||||||
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
|
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
|
||||||
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
|
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
|
||||||
|
@ -364,12 +379,12 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSDictionary (NSPerformSelector)
|
@interface NSDictionary (NSPerformSelector)
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_;
|
-(void)makeObjectsPerformSelector:(SEL)selector;
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object_;
|
withObject:(id)object;
|
||||||
-(void)makeObjectsPerformSelector:(SEL)selector_
|
-(void)makeObjectsPerformSelector:(SEL)selector
|
||||||
withObject:(id)object1_
|
withObject:(id)object_
|
||||||
withObject:(id)object2_;
|
withObject:(id)object2;
|
||||||
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
|
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector;
|
||||||
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
|
-(void)makeObjectsPerformIfPossible:(SEL)aSelector;
|
||||||
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
|
-(void)makeObjectsPerformSelectorIfPossible:(SEL)aSelector
|
||||||
|
@ -383,19 +398,19 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSDictionary (FromNSArray)
|
@interface NSDictionary (FromNSArray)
|
||||||
+(id)dictionaryWithArray:(NSArray*)array_
|
+(id)dictionaryWithArray:(NSArray*)array
|
||||||
onSelector:(SEL)sel_;
|
onSelector:(SEL)sel;
|
||||||
+(id)dictionaryWithArray:(NSArray*)array_
|
+(id)dictionaryWithArray:(NSArray*)array
|
||||||
onSelector:(SEL)sel_
|
onSelector:(SEL)sel
|
||||||
withObject:(id)object;
|
withObject:(id)object;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSNumber (SBNumber)
|
@interface NSNumber (SBNumber)
|
||||||
+(NSNumber*)maxValueOf:(NSNumber*)_val0
|
+(NSNumber*)maxValueOf:(NSNumber*)val0
|
||||||
and:(NSNumber*)_val1;
|
and:(NSNumber*)val1;
|
||||||
+(NSNumber*)minValueOf:(NSNumber*)_val0
|
+(NSNumber*)minValueOf:(NSNumber*)val0
|
||||||
and:(NSNumber*)_val1;
|
and:(NSNumber*)val1;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -406,15 +421,15 @@ extern NSData* HexStringToData(NSString* _string);
|
||||||
-(NSRange)rangeOfData:(NSData *)aData
|
-(NSRange)rangeOfData:(NSData *)aData
|
||||||
options:(unsigned)mask
|
options:(unsigned)mask
|
||||||
range:(NSRange)aRange;
|
range:(NSRange)aRange;
|
||||||
-(NSArray*)componentsSeparatedByData:(NSData*)separator_;
|
-(NSArray*)componentsSeparatedByData:(NSData*)separator;
|
||||||
-(NSData*)dataByDeletingFirstBytesCount:(unsigned int)bytesCount_;
|
-(NSData*)dataByDeletingFirstBytesCount:(unsigned int)bytesCount;
|
||||||
-(NSData*)dataByDeletingLastBytesCount:(unsigned int)bytesCount_;
|
-(NSData*)dataByDeletingLastBytesCount:(unsigned int)bytesCount;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSMutableData (SBNSData)
|
@interface NSMutableData (SBNSData)
|
||||||
-(void)deleteFirstBytesCount:(unsigned int)bytesCount_;
|
-(void)deleteFirstBytesCount:(unsigned int)bytesCount;
|
||||||
-(void)deleteLastBytesCount:(unsigned int)bytesCount_;
|
-(void)deleteLastBytesCount:(unsigned int)bytesCount;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
@ -427,10 +442,10 @@ typedef enum _NSNumFmtType
|
||||||
|
|
||||||
@interface NSFooNumberFormatter : NSFormatter <NSCoding, NSCopying>
|
@interface NSFooNumberFormatter : NSFormatter <NSCoding, NSCopying>
|
||||||
{
|
{
|
||||||
NSNumFmtType type;
|
NSNumFmtType _type;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initType:(NSNumFmtType)type_;
|
-(id)initType:(NSNumFmtType)type;
|
||||||
-(NSString*)stringForObjectValue:(id)anObject;
|
-(NSString*)stringForObjectValue:(id)anObject;
|
||||||
-(BOOL)getObjectValue:(id*)anObject
|
-(BOOL)getObjectValue:(id*)anObject
|
||||||
forString:(NSString*)string
|
forString:(NSString*)string
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,16 @@
|
||||||
/* GSWWOCompatibility.h - GSWeb: GSWWOCompatibility
|
/** GSWWOCompatibility.h - <title>GSWeb: GSWWOCompatibility</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Dec 2000
|
Date: Dec 2000
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* GSWWOCompatibility.m - GSWeb: GSWWOCompatibility
|
/** GSWWOCompatibility.m - <title>GSWeb: GSWWOCompatibility</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 2000-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Dec 2000
|
Date: Dec 2000
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
/* GSWeb.h - GSWeb
|
/** GSWeb.h - <title>GSWeb</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
<abstract></abstract>
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,18 @@
|
||||||
/* GSWeb.m - GSWeb
|
/** GSWeb.m - <title>GSWeb</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
<abstract></abstract>
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSNonBlockingFileHandle.h - NSNonBlockingFileHandle
|
/** NSNonBlockingFileHandle.h - <title>GSWeb: NSNonBlockingFileHandle</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSNonBlockingFileHandle.m - NSNonBlockingFileHandle
|
/** NSNonBlockingFileHandle.m - <title>GSWeb: NSNonBlockingFileHandle</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -53,11 +59,11 @@
|
||||||
// Does not block if there is no data; returns nil instead.
|
// Does not block if there is no data; returns nil instead.
|
||||||
-(NSData*)availableDataNonBlocking
|
-(NSData*)availableDataNonBlocking
|
||||||
{
|
{
|
||||||
NSData* _data=nil;
|
NSData* data=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_data=[self readDataOfLengthNonBlocking: UINT_MAX];
|
data=[self readDataOfLengthNonBlocking: UINT_MAX];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Returns an NSData object containing all of the currently available data.
|
// Returns an NSData object containing all of the currently available data.
|
||||||
|
@ -65,21 +71,21 @@
|
||||||
// Cover for #{-availableDataNonBlocking}.
|
// Cover for #{-availableDataNonBlocking}.
|
||||||
-(NSData*)readDataToEndOfFileNonBlocking
|
-(NSData*)readDataToEndOfFileNonBlocking
|
||||||
{
|
{
|
||||||
NSData* _data=nil;
|
NSData* data=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_data=[self readDataOfLengthNonBlocking: UINT_MAX];
|
data=[self readDataOfLengthNonBlocking: UINT_MAX];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(unsigned int)_availableByteCountNonBlocking
|
-(unsigned int)_availableByteCountNonBlocking
|
||||||
{
|
{
|
||||||
int numBytes;
|
int numBytes=0;
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
fd=[self fileDescriptor];
|
fd=[self fileDescriptor];
|
||||||
|
|
||||||
if(ioctl(fd, FIONREAD, (char *) &numBytes) == -1)
|
if (ioctl(fd, FIONREAD, (char *) &numBytes) == -1)
|
||||||
{
|
{
|
||||||
LOGException0(@"NSFileHandleOperationException ioctl() Err");
|
LOGException0(@"NSFileHandleOperationException ioctl() Err");
|
||||||
[NSException raise: NSFileHandleOperationException
|
[NSException raise: NSFileHandleOperationException
|
||||||
|
@ -94,7 +100,7 @@
|
||||||
-(NSData*)readDataOfLengthNonBlocking:(unsigned int)length
|
-(NSData*)readDataOfLengthNonBlocking:(unsigned int)length
|
||||||
{
|
{
|
||||||
NSData* data=nil;
|
NSData* data=nil;
|
||||||
unsigned int readLength;
|
unsigned int readLength=0;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
readLength = [self _availableByteCountNonBlocking];
|
readLength = [self _availableByteCountNonBlocking];
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSString+HTML.h
|
/** NSString+HTML.h - <title>GSWeb: NSString / HTML</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -31,13 +37,13 @@
|
||||||
-(NSString*)htmlPlus2Space;
|
-(NSString*)htmlPlus2Space;
|
||||||
-(NSString*)decodeURL;
|
-(NSString*)decodeURL;
|
||||||
-(NSString*)encodeURL;
|
-(NSString*)encodeURL;
|
||||||
-(NSString*)encodeURLWithValid:(NSString*)_valid;
|
-(NSString*)encodeURLWithValid:(NSString*)valid;
|
||||||
-(NSDictionary*)dictionaryQueryString;
|
-(NSDictionary*)dictionaryQueryString;
|
||||||
-(NSDictionary*)dictionaryWithSep1:(NSString*)p_pstrSep1
|
-(NSDictionary*)dictionaryWithSep1:(NSString*)sep1
|
||||||
withSep2:(NSString*)p_pstrSep2
|
withSep2:(NSString*)sep2
|
||||||
withOptionUnescape:(BOOL)_unescape;
|
withOptionUnescape:(BOOL)unescape;
|
||||||
-(BOOL)ismapCoordx:(int*)x_
|
-(BOOL)ismapCoordx:(int*)x
|
||||||
y:(int*)y_;
|
y:(int*)y;
|
||||||
-(NSString*)stringByEscapingHTMLString;
|
-(NSString*)stringByEscapingHTMLString;
|
||||||
-(NSString*)stringByEscapingHTMLAttributeValue;
|
-(NSString*)stringByEscapingHTMLAttributeValue;
|
||||||
-(NSString*)stringByConvertingToHTMLEntities;
|
-(NSString*)stringByConvertingToHTMLEntities;
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSString+HTML.m
|
/** NSString+HTML.m - <title>GSWeb: NSString / HTML</title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -211,18 +217,18 @@ void initHtmlChars()
|
||||||
-(NSString*)decodeURL
|
-(NSString*)decodeURL
|
||||||
{
|
{
|
||||||
//TODO speed
|
//TODO speed
|
||||||
unichar* _unichars=NULL;
|
unichar* unichars=NULL;
|
||||||
unichar _uniChar=0;
|
unichar uniChar=0;
|
||||||
NSString* _void=nil;
|
NSString* voidString=nil;
|
||||||
NSString* temp=nil;
|
NSString* temp=nil;
|
||||||
const char* p=NULL;
|
const char* p=NULL;
|
||||||
int uniCharsIndex=0;
|
int uniCharsIndex=0;
|
||||||
NSDebugMLLog(@"low",@"self=%@",self);
|
NSDebugMLLog(@"low",@"self=%@",self);
|
||||||
_void=[self htmlPlus2Space];
|
voidString=[self htmlPlus2Space];
|
||||||
NSDebugMLLog(@"low",@"_void=%@",_void);
|
NSDebugMLLog(@"low",@"voidString=%@",voidString);
|
||||||
_unichars=_fastMallocBuffer(sizeof(unichar)*([_void length]+1));
|
unichars=_fastMallocBuffer(sizeof(unichar)*([voidString length]+1));
|
||||||
NSDebugMLLog(@"low",@"[_void cString]=%s",[_void cString]);
|
NSDebugMLLog(@"low",@"[voidString cString]=%s",[voidString cString]);
|
||||||
for (p=[_void cString];p && *p;p++)
|
for (p=[voidString cString];p && *p;p++)
|
||||||
{
|
{
|
||||||
if (*p == '%')
|
if (*p == '%')
|
||||||
{
|
{
|
||||||
|
@ -230,26 +236,26 @@ void initHtmlChars()
|
||||||
// 2 hex digits follow...
|
// 2 hex digits follow...
|
||||||
//
|
//
|
||||||
int i=0;
|
int i=0;
|
||||||
_uniChar=0;
|
uniChar=0;
|
||||||
for (i=0;p[1] && i<2;i++)
|
for (i=0;p[1] && i<2;i++)
|
||||||
{
|
{
|
||||||
p++;
|
p++;
|
||||||
NSDebugMLLog(@"low",@"*p=%c %u",(char)*p,(unsigned int)*p);
|
NSDebugMLLog(@"low",@"*p=%c %u",(char)*p,(unsigned int)*p);
|
||||||
_uniChar <<= 4;
|
uniChar <<= 4;
|
||||||
NSDebugMLLog(@"low",@"_uniChar=%x",(unsigned int)_uniChar);
|
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
|
||||||
if (isdigit(*p))
|
if (isdigit(*p))
|
||||||
_uniChar+=*p-'0';
|
uniChar+=*p-'0';
|
||||||
else
|
else
|
||||||
_uniChar+=toupper(*p)-'A'+10;
|
uniChar+=toupper(*p)-'A'+10;
|
||||||
NSDebugMLLog(@"low",@"_uniChar=%x",(unsigned int)_uniChar);
|
NSDebugMLLog(@"low",@"uniChar=%x",(unsigned int)uniChar);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_uniChar=(unsigned char)*p;
|
uniChar=(unsigned char)*p;
|
||||||
_unichars[uniCharsIndex]=_uniChar;
|
unichars[uniCharsIndex]=uniChar;
|
||||||
uniCharsIndex++;
|
uniCharsIndex++;
|
||||||
};
|
};
|
||||||
temp=[NSString stringWithCharacters:_unichars
|
temp=[NSString stringWithCharacters:unichars
|
||||||
length:uniCharsIndex];
|
length:uniCharsIndex];
|
||||||
NSDebugMLLog(@"low",@"temp=%@",temp);
|
NSDebugMLLog(@"low",@"temp=%@",temp);
|
||||||
NSDebugMLLog(@"low",@"temp data=%@",[temp dataUsingEncoding:NSISOLatin1StringEncoding]);
|
NSDebugMLLog(@"low",@"temp data=%@",[temp dataUsingEncoding:NSISOLatin1StringEncoding]);
|
||||||
|
@ -270,11 +276,11 @@ void initHtmlChars()
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)encodeURLWithValid:(NSString*)_valid
|
-(NSString*)encodeURLWithValid:(NSString*)validString
|
||||||
{
|
{
|
||||||
NSMutableString* temp=[NSMutableString stringWithCapacity:[self length]];
|
NSMutableString* temp=[NSMutableString stringWithCapacity:[self length]];
|
||||||
const char* p=NULL;
|
const char* p=NULL;
|
||||||
const char* valid=[_valid cString];
|
const char* valid=[validString cString];
|
||||||
static char *digits = "0123456789ABCDEF";
|
static char *digits = "0123456789ABCDEF";
|
||||||
for (p =[self cString]; p && *p; p++)
|
for (p =[self cString]; p && *p; p++)
|
||||||
{
|
{
|
||||||
|
@ -295,34 +301,34 @@ void initHtmlChars()
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSDictionary*)dictionaryWithSep1:(NSString*)p_pstrSep1
|
-(NSDictionary*)dictionaryWithSep1:(NSString*)sep1
|
||||||
withSep2:(NSString*)p_pstrSep2
|
withSep2:(NSString*)sep2
|
||||||
withOptionUnescape:(BOOL)_unescape
|
withOptionUnescape:(BOOL)unescape
|
||||||
{
|
{
|
||||||
NSMutableDictionary* pDico=nil;
|
NSMutableDictionary* pDico=nil;
|
||||||
if ([self length]>0)
|
if ([self length]>0)
|
||||||
{
|
{
|
||||||
NSArray* listItems = [self componentsSeparatedByString:p_pstrSep1];
|
NSArray* listItems = [self componentsSeparatedByString:sep1];
|
||||||
int iCount=0;
|
int iCount=0;
|
||||||
pDico=[NSMutableDictionary dictionary];
|
pDico=(NSMutableDictionary*)[NSMutableDictionary dictionary];
|
||||||
for(iCount=0;iCount<[listItems count];iCount++)
|
for(iCount=0;iCount<[listItems count];iCount++)
|
||||||
{
|
{
|
||||||
if ([[listItems objectAtIndex:iCount] length]>0)
|
if ([[listItems objectAtIndex:iCount] length]>0)
|
||||||
{
|
{
|
||||||
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:p_pstrSep2];
|
NSArray* listParam = [[listItems objectAtIndex:iCount] componentsSeparatedByString:sep2];
|
||||||
id key=nil;
|
id key=nil;
|
||||||
id value=nil;
|
id value=nil;
|
||||||
if ([listParam count]==1)
|
if ([listParam count]==1)
|
||||||
{
|
{
|
||||||
key=[listParam objectAtIndex:0];
|
key=[listParam objectAtIndex:0];
|
||||||
if (_unescape)
|
if (unescape)
|
||||||
key=[key decodeURL];
|
key=[key decodeURL];
|
||||||
}
|
}
|
||||||
else if ([listParam count]==2)
|
else if ([listParam count]==2)
|
||||||
{
|
{
|
||||||
key=[listParam objectAtIndex:0];
|
key=[listParam objectAtIndex:0];
|
||||||
value=[listParam objectAtIndex:1];
|
value=[listParam objectAtIndex:1];
|
||||||
if (_unescape)
|
if (unescape)
|
||||||
{
|
{
|
||||||
key=[key decodeURL];
|
key=[key decodeURL];
|
||||||
value=[value decodeURL];
|
value=[value decodeURL];
|
||||||
|
@ -349,41 +355,42 @@ void initHtmlChars()
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)ismapCoordx:(int*)x_
|
-(BOOL)ismapCoordx:(int*)x
|
||||||
y:(int*)y_
|
y:(int*)y
|
||||||
{
|
{
|
||||||
BOOL _ok=NO;
|
BOOL ok=NO;
|
||||||
NSScanner* _scanner=[NSScanner scannerWithString:self];
|
NSScanner* scanner=[NSScanner scannerWithString:self];
|
||||||
if ([_scanner scanInt:x_])
|
if ([scanner scanInt:x])
|
||||||
{
|
{
|
||||||
if (x_)
|
if (x)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"x=%d",*x_);
|
NSDebugMLLog(@"low",@"x=%d",*x);
|
||||||
};
|
};
|
||||||
if ([_scanner scanString:@"," intoString:NULL])
|
if ([scanner scanString:@","
|
||||||
|
intoString:NULL])
|
||||||
{
|
{
|
||||||
if ([_scanner scanInt:y_])
|
if ([scanner scanInt:y])
|
||||||
{
|
{
|
||||||
if (y_)
|
if (y)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"low",@"y=%d",*y_);
|
NSDebugMLLog(@"low",@"y=%d",*y);
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"low",@"[_scanner isAtEnd]=%d",(int)[_scanner isAtEnd]);
|
NSDebugMLLog(@"low",@"[scanner isAtEnd]=%d",(int)[scanner isAtEnd]);
|
||||||
if ([_scanner isAtEnd])
|
if ([scanner isAtEnd])
|
||||||
{
|
{
|
||||||
_ok=YES;
|
ok=YES;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (!_ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
if (x_)
|
if (x)
|
||||||
*x_=INT_MAX;
|
*x=INT_MAX;
|
||||||
if (y_)
|
if (y)
|
||||||
*y_=INT_MAX;
|
*y=INT_MAX;
|
||||||
};
|
};
|
||||||
return _ok;
|
return ok;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSString+Trimming.h
|
/** NSString+Trimming.h - <title>GSWeb: Class NSString with Trimming </title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
@ -32,17 +38,17 @@
|
||||||
-(BOOL)isAFloatNumber;
|
-(BOOL)isAFloatNumber;
|
||||||
-(BOOL)isAnIntegerNumber;
|
-(BOOL)isAnIntegerNumber;
|
||||||
#ifdef LONG_LONG_MAX
|
#ifdef LONG_LONG_MAX
|
||||||
-(BOOL)isAnIntegerNumberWithMin:(long long)min_
|
-(BOOL)isAnIntegerNumberWithMin:(long long)min
|
||||||
max:(long long)max_;
|
max:(long long)max;
|
||||||
#else
|
#else
|
||||||
-(BOOL)isAnIntegerNumberWithMin:(long)min_
|
-(BOOL)isAnIntegerNumberWithMin:(long)min
|
||||||
max:(long)max_;
|
max:(long)max;
|
||||||
#endif
|
#endif
|
||||||
-(BOOL)isAnUnsignedIntegerNumber;
|
-(BOOL)isAnUnsignedIntegerNumber;
|
||||||
#ifdef LONG_LONG_MAX
|
#ifdef LONG_LONG_MAX
|
||||||
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max_;
|
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max;
|
||||||
#else
|
#else
|
||||||
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max_;
|
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max;
|
||||||
#endif
|
#endif
|
||||||
-(BOOL)isStartingWithNumber;
|
-(BOOL)isStartingWithNumber;
|
||||||
-(long)longValue;
|
-(long)longValue;
|
||||||
|
@ -53,37 +59,37 @@
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSString (UniqueIdString)
|
@interface NSString (UniqueIdString)
|
||||||
+(NSString*)stringUniqueIdWithLength:(int)_lentgh;
|
+(NSString*)stringUniqueIdWithLength:(int)length;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSString (stringWithObject)
|
@interface NSString (stringWithObject)
|
||||||
+(NSString*)stringWithObject:(id)object_;
|
+(NSString*)stringWithObject:(id)object;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSString (uniqueFileName)
|
@interface NSString (uniqueFileName)
|
||||||
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory_
|
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory
|
||||||
withPrefix:(NSString*)prefix_
|
withPrefix:(NSString*)prefix
|
||||||
withSuffix:(NSString*)suffix_;
|
withSuffix:(NSString*)suffix;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSString (Qutotes)
|
@interface NSString (Qutotes)
|
||||||
-(BOOL)hasPrefix:(NSString*)prefix_
|
-(BOOL)hasPrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_;
|
andSuffix:(NSString*)suffix;
|
||||||
-(NSString*)stringWithoutPrefix:(NSString*)prefix_
|
-(NSString*)stringWithoutPrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_;
|
andSuffix:(NSString*)suffix;
|
||||||
-(BOOL)isQuotedWith:(NSString*)quote_;
|
-(BOOL)isQuotedWith:(NSString*)quote;
|
||||||
-(NSString*)stringWithoutQuote:(NSString*)quote_;
|
-(NSString*)stringWithoutQuote:(NSString*)quote;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface NSMutableString (Qutotes)
|
@interface NSMutableString (Qutotes)
|
||||||
-(void)removePrefix:(NSString*)prefix_
|
-(void)removePrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_;
|
andSuffix:(NSString*)suffix;
|
||||||
-(void)removeQuote:(NSString*)quote_;
|
-(void)removeQuote:(NSString*)quote;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif //_NSString_Trimming_h__
|
#endif //_NSString_Trimming_h__
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
/* NSString+Trimming.m
|
/** NSString+Trimming.m - <title>GSWeb: Class NSString with Trimming </title>
|
||||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@sbuilders.com>
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
This file is part of the GNUstep Web Library.
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
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
|
You should have received a copy of the GNU Library General Public
|
||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
static char rcsId[] = "$Id$";
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
@ -62,18 +68,18 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
#ifdef LONG_LONG_MAX
|
#ifdef LONG_LONG_MAX
|
||||||
-(BOOL)isAnIntegerNumberWithMin:(long long)min_
|
-(BOOL)isAnIntegerNumberWithMin:(long long)min
|
||||||
max:(long long)max_
|
max:(long long)max
|
||||||
#else
|
#else
|
||||||
-(BOOL)isAnIntegerNumberWithMin:(long)min_
|
-(BOOL)isAnIntegerNumberWithMin:(long)min
|
||||||
max:(long)max_
|
max:(long)max
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if ([self isAnIntegerNumber])
|
if ([self isAnIntegerNumber])
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
long _v=[self longValue];
|
long v=[self longValue];
|
||||||
if (_v>=min_ && _v<=max_)
|
if (v>=min && v<=max)
|
||||||
return YES;
|
return YES;
|
||||||
else
|
else
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -97,16 +103,16 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
#ifdef LONG_LONG_MAX
|
#ifdef LONG_LONG_MAX
|
||||||
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max_
|
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long long)max
|
||||||
#else
|
#else
|
||||||
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max_
|
-(BOOL)isAnUnsignedIntegerNumberWithMax:(unsigned long)max
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if ([self isAnUnsignedIntegerNumber])
|
if ([self isAnUnsignedIntegerNumber])
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
unsigned long _v=[self ulongValue];
|
unsigned long v=[self ulongValue];
|
||||||
if (_v<=max_)
|
if (v<=max)
|
||||||
return YES;
|
return YES;
|
||||||
else
|
else
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -142,10 +148,10 @@ static char rcsId[] = "$Id$";
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(long long)longLongValue
|
-(long long)longLongValue
|
||||||
{
|
{
|
||||||
long long _v=0;
|
long long v=0;
|
||||||
NSScanner* _scanner = [NSScanner scannerWithString:self];
|
NSScanner* scanner = [NSScanner scannerWithString:self];
|
||||||
[_scanner scanLongLong:&_v];
|
[scanner scanLongLong:&v];
|
||||||
return _v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -153,7 +159,7 @@ static char rcsId[] = "$Id$";
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation NSString (UniqueIdString)
|
@implementation NSString (UniqueIdString)
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(NSString*)stringUniqueIdWithLength:(int)_lentgh
|
+(NSString*)stringUniqueIdWithLength:(int)length
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
NSTimeInterval ti=[[NSDate date]timeIntervalSinceReferenceDate];
|
NSTimeInterval ti=[[NSDate date]timeIntervalSinceReferenceDate];
|
||||||
|
@ -161,7 +167,7 @@ static char rcsId[] = "$Id$";
|
||||||
NSMutableData* data=nil;
|
NSMutableData* data=nil;
|
||||||
void* pData=NULL;
|
void* pData=NULL;
|
||||||
NSString* dataHex=nil;
|
NSString* dataHex=nil;
|
||||||
int intLength=(_lentgh/sizeof(int))-sizeof(ti);
|
int intLength=(length/sizeof(int))-sizeof(ti);
|
||||||
if (intLength<0)
|
if (intLength<0)
|
||||||
intLength=0;
|
intLength=0;
|
||||||
size=sizeof(ti)+intLength*sizeof(int);
|
size=sizeof(ti)+intLength*sizeof(int);
|
||||||
|
@ -183,28 +189,28 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation NSString (stringWithObject)
|
@implementation NSString (stringWithObject)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(NSString*)stringWithObject:(id)object_
|
+(NSString*)stringWithObject:(id)object
|
||||||
{
|
{
|
||||||
NSString* _string=nil;
|
NSString* string=nil;
|
||||||
if (object_)
|
if (object)
|
||||||
{
|
{
|
||||||
if ([object_ isKindOfClass:[NSString class]])
|
if ([object isKindOfClass:[NSString class]])
|
||||||
_string=[[object_ copy] autorelease];
|
string=[[object copy] autorelease];
|
||||||
#ifdef GDL2
|
#ifdef GDL2
|
||||||
else if ([object_ isKindOfClass:[EONull class]])
|
else if ([object isKindOfClass:[EONull class]])
|
||||||
_string=@"";
|
string=@"";
|
||||||
#else
|
#else
|
||||||
else if ([object_ isKindOfClass:[NSNull class]])
|
else if ([object isKindOfClass:[NSNull class]])
|
||||||
_string=@"";
|
string=@"";
|
||||||
#endif
|
#endif
|
||||||
else if ([object_ respondsToSelector:@selector(stringValue)])
|
else if ([object respondsToSelector:@selector(stringValue)])
|
||||||
_string=[object_ stringValue];
|
string=[object stringValue];
|
||||||
else if ([object_ respondsToSelector:@selector(description)])
|
else if ([object respondsToSelector:@selector(description)])
|
||||||
_string=[object_ description];
|
string=[object description];
|
||||||
else
|
else
|
||||||
_string=object_;
|
string=object;
|
||||||
};
|
};
|
||||||
return _string;
|
return string;
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -212,35 +218,35 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation NSString (uniqueFileName)
|
@implementation NSString (uniqueFileName)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory_
|
+(NSString*)stringForUniqueFilenameInDirectory:(NSString*)directory
|
||||||
withPrefix:(NSString*)prefix_
|
withPrefix:(NSString*)prefix
|
||||||
withSuffix:(NSString*)suffix_
|
withSuffix:(NSString*)suffix
|
||||||
{
|
{
|
||||||
NSString* _filename=nil;
|
NSString* filename=nil;
|
||||||
NSFileManager* _fileManager=nil;
|
NSFileManager* fileManager=nil;
|
||||||
NSArray* _directoryContents=nil;
|
NSArray* directoryContents=nil;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
_fileManager=[NSFileManager defaultManager];
|
fileManager=[NSFileManager defaultManager];
|
||||||
_directoryContents=[_fileManager directoryContentsAtPath:directory_];
|
directoryContents=[fileManager directoryContentsAtPath:directory];
|
||||||
if (!_directoryContents)
|
if (!directoryContents)
|
||||||
{
|
{
|
||||||
//ERROR
|
//ERROR
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int _attempts=16;
|
int attempts=16;
|
||||||
while(_attempts-->0 && !_filename)
|
while(attempts-->0 && !filename)
|
||||||
{
|
{
|
||||||
NSString* _unique=[NSString stringUniqueIdWithLength:16];
|
NSString* unique=[NSString stringUniqueIdWithLength:16];
|
||||||
_filename=[NSString stringWithFormat:@"%@_%@_%@",prefix_,_unique,suffix_];
|
filename=[NSString stringWithFormat:@"%@_%@_%@",prefix,unique,suffix];
|
||||||
if ([_directoryContents containsObject:_filename])
|
if ([directoryContents containsObject:filename])
|
||||||
_filename=nil;
|
filename=nil;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (_filename)
|
if (filename)
|
||||||
_filename=[directory_ stringByAppendingPathComponent:_filename];
|
filename=[directory stringByAppendingPathComponent:filename];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return _filename;
|
return filename;
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -248,30 +254,30 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation NSString (Qutotes)
|
@implementation NSString (Qutotes)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)hasPrefix:(NSString*)prefix_
|
-(BOOL)hasPrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_
|
andSuffix:(NSString*)suffix
|
||||||
{
|
{
|
||||||
return [self hasPrefix:prefix_] && [self hasSuffix:suffix_];
|
return [self hasPrefix:prefix] && [self hasSuffix:suffix];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)stringWithoutPrefix:(NSString*)prefix_
|
-(NSString*)stringWithoutPrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_
|
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_
|
return [self hasPrefix:quote
|
||||||
andSuffix:quote_];
|
andSuffix:quote];
|
||||||
};
|
};
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(NSString*)stringWithoutQuote:(NSString*)quote_
|
-(NSString*)stringWithoutQuote:(NSString*)quote
|
||||||
{
|
{
|
||||||
return [self stringWithoutPrefix:quote_
|
return [self stringWithoutPrefix:quote
|
||||||
andSuffix:quote_];
|
andSuffix:quote];
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -279,18 +285,18 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation NSMutableString (Qutotes)
|
@implementation NSMutableString (Qutotes)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)removePrefix:(NSString*)prefix_
|
-(void)removePrefix:(NSString*)prefix
|
||||||
andSuffix:(NSString*)suffix_
|
andSuffix:(NSString*)suffix
|
||||||
{
|
{
|
||||||
[self removePrefix:prefix_];
|
[self removePrefix:prefix];
|
||||||
[self removeSuffix:suffix_];
|
[self removeSuffix:suffix];
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)removeQuote:(NSString*)quote_
|
-(void)removeQuote:(NSString*)quote
|
||||||
{
|
{
|
||||||
[self removePrefix:quote_
|
[self removePrefix:quote
|
||||||
andSuffix:quote_];
|
andSuffix:quote];
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue