* Many warnings fixed.

* Removed GDL dependency.
* NSKeyValueCoding is now MacOS X compatible.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@30172 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Dave Wetzel 2010-04-16 00:18:46 +00:00
parent 4165f5c49e
commit c7f57a1ad3
22 changed files with 635 additions and 791 deletions

View file

@ -1,3 +1,9 @@
2010-04-16 David Wetzel <dave@turbocat.de>
GSWeb.framework
* Many warnings fixed.
* Removed GDL dependency.
* NSKeyValueCoding is now MacOS X compatible.
2010-04-15 David Wetzel <dave@turbocat.de>
new GSWDatabase Framework for EOF/GDL based applications
not tested yet!

View file

@ -3656,9 +3656,9 @@ to another instance **/
+(id)defaultModelGroup
{
#ifdef TCSDB
return [NSClassFromString(@"DBModelGroup") defaultGroup];
return (id) [NSClassFromString(@"DBModelGroup") defaultGroup];
#else
return [NSClassFromString(@"EOModelGroup") defaultGroup];
return (id) [NSClassFromString(@"EOModelGroup") defaultGroup];
#endif
}

View file

@ -40,12 +40,12 @@ RCS_ID("$Id$")
#include <limits.h>
#include <float.h>
#ifdef TCSDB
#include <TCSimpleDB/TCSimpleDB.h>
#endif
#if HAVE_GDL2
#include <EOControl/EOKeyValueCoding.h>
#endif
//#ifdef TCSDB
//#include <TCSimpleDB/TCSimpleDB.h>
//#endif
//#if HAVE_GDL2
//#include <EOControl/EOKeyValueCoding.h>
//#endif
static NSDictionary* localMinMaxDictionary=nil;
static NSMutableDictionary* associationsHandlerClasses=nil;
@ -99,9 +99,9 @@ static Class NSStringClass = Nil;
[NSNumber numberWithFloat:DBL_MAX],@"DOUBLE_MAX",
nil,nil]
retain];
};
};
};
}
}
}
//--------------------------------------------------------------------
+(void)dealloc
@ -112,7 +112,7 @@ static Class NSStringClass = Nil;
DESTROY(associationsLock);
[super dealloc];
};
}
//--------------------------------------------------------------------
// init
@ -120,11 +120,11 @@ static Class NSStringClass = Nil;
{
if ((self=[super init]))
{
};
}
_negate = NO;
return self;
};
}
-(void)dealloc
{
@ -132,7 +132,7 @@ static Class NSStringClass = Nil;
DESTROY(_declarationName);
DESTROY(_declarationType);
[super dealloc];
};
}
// YES if we negate the result before returnig it.
@ -160,32 +160,32 @@ static Class NSStringClass = Nil;
declarationName:_declarationName
declarationType:_declarationType];
return clone;
};
}
//--------------------------------------------------------------------
-(NSString*)description
{
LOGObjectFnNotImplemented(); //TODOFN
return [super description];
};
}
//--------------------------------------------------------------------
-(NSString*)bindingName
{
return _bindingName;
};
}
//--------------------------------------------------------------------
-(NSString*)declarationName
{
return _declarationName;
};
}
//--------------------------------------------------------------------
-(NSString*)declarationType
{
return _declarationType;
};
}
//--------------------------------------------------------------------
// isValueConstant
@ -193,7 +193,7 @@ static Class NSStringClass = Nil;
-(BOOL)isValueConstant
{
return YES;
};
}
//--------------------------------------------------------------------
// isValueSettable
@ -234,7 +234,7 @@ static Class NSStringClass = Nil;
-(id)valueInComponent:(GSWComponent*)component;
{
return [self subclassResponsibility:_cmd];
};
}
// added in WO5?
// they call it booleanValueInComponent:
@ -312,7 +312,7 @@ static Class NSStringClass = Nil;
}
return nil;
};
}
//--------------------------------------------------------------------
@ -322,7 +322,7 @@ static Class NSStringClass = Nil;
{
//OK
return [[[GSWConstantValueAssociation alloc]initWithValue:value] autorelease];
};
}
//--------------------------------------------------------------------
// associationFromString:
@ -358,7 +358,7 @@ static Class NSStringClass = Nil;
{
ExceptionRaise(@"GSWAssociation",@"String '%@' start with a \" but doesn't finish with a \"",
trimmedString);
};
}
}
else if ([trimmedString hasPrefix:@"\'"])
{
@ -370,7 +370,7 @@ static Class NSStringClass = Nil;
{
ExceptionRaise(@"GSWAssociation",@"String '%@' starts with a \"'\" but does not end with a \"'\"",
trimmedString);
};
}
}
else if ([trimmedString hasPrefix:@"#"])
{
@ -384,7 +384,7 @@ static Class NSStringClass = Nil;
ExceptionRaise(@"GSWAssociation",@"String '%@' start with a '#' but doesn't countain an hexadecimal number (on %dth Character)",
trimmedString,
(int)(endPtr-cString+1));
};
}
assoc=[self associationWithValue:GSWIntNumber(value)];
}
else
@ -417,14 +417,14 @@ static Class NSStringClass = Nil;
ExceptionRaise(@"GSWAssociation",
@"String '%@' must be a good number",
trimmedString);
};
}
assoc=[self associationWithValue:GSWIntNumber(value)];
};
};
};
};
}
}
}
}
return assoc;
};
}
//--------------------------------------------------------------------
+(void)setClasse:(Class)class
@ -435,14 +435,14 @@ static Class NSStringClass = Nil;
{
if (class)
associationsHandlerClasses=[NSMutableDictionary new];
};
}
if (class)
[associationsHandlerClasses setObject:class
forKey:handler];
else if (associationsHandlerClasses)
[associationsHandlerClasses removeObjectForKey:handler];
LoggedUnlock(associationsLock);
};
}
//--------------------------------------------------------------------
+(void)addLogHandlerClasse:(Class)class
@ -452,11 +452,11 @@ static Class NSStringClass = Nil;
{
if (class)
associationsLogsHandlerClasses=[NSMutableArray new];
};
}
if (class)
[associationsLogsHandlerClasses addObject:class];
LoggedUnlock(associationsLock);
};
}
//--------------------------------------------------------------------
+(void)removeLogHandlerClasse:(Class)class
@ -466,9 +466,9 @@ static Class NSStringClass = Nil;
{
if (class)
[associationsLogsHandlerClasses removeObject:class];
};
}
LoggedUnlock(associationsLock);
};
}
/*
//====================================================================
@ -480,7 +480,7 @@ static Class NSStringClass = Nil;
{
GSWContext* context=[[GSWApplication application] context];
[self valueInComponent:GSWContext_component(context)];
};
}
//--------------------------------------------------------------------
// setValue:inComponent:
@ -490,7 +490,7 @@ static Class NSStringClass = Nil;
GSWContext* context=[[GSWApplication application] context];
[self setValue:(id)value
inComponent:GSWContext_component(context)];
};
}
@end
*/
//====================================================================
@ -507,7 +507,7 @@ static Class NSStringClass = Nil;
-(BOOL)isImplementedForComponent:(NSObject*)component
{
return YES;
};
}
//--------------------------------------------------------------------
@ -516,7 +516,7 @@ static Class NSStringClass = Nil;
//OK
[self subclassResponsibility:_cmd];
return nil;
};
}
//--------------------------------------------------------------------
-(void)logValue:(id)value
@ -548,7 +548,7 @@ static Class NSStringClass = Nil;
bindingNamed:_bindingName
associationDescription:debugDescription
value:value];
};
}
}
NS_HANDLER
{
@ -558,23 +558,23 @@ static Class NSStringClass = Nil;
}
NS_ENDHANDLER;
LoggedUnlock(associationsLock);
};
};
};
}
}
}
//--------------------------------------------------------------------
-(void)logTakeValue:(id)value
{
[self logValue:value
forSet:NO];
};
}
//--------------------------------------------------------------------
-(void)logSetValue:(id)value
{
[self logValue:value
forSet:YES];
};
}
//--------------------------------------------------------------------
-(void)logSynchronizeForValue:(id)value
@ -600,7 +600,7 @@ static Class NSStringClass = Nil;
[class logSynchronizeParentToComponentForValue:value
association:self
inComponent:component];
};
}
}
NS_HANDLER
{
@ -610,8 +610,8 @@ static Class NSStringClass = Nil;
}
NS_ENDHANDLER;
LoggedUnlock(associationsLock);
};
};
}
}
//--------------------------------------------------------------------
-(void)logSynchronizeComponentToParentForValue:(id)value
@ -620,7 +620,7 @@ static Class NSStringClass = Nil;
[self logSynchronizeForValue:value
inComponent:component
componentToParent:YES];
};
}
//--------------------------------------------------------------------
-(void)logSynchronizeParentToComponentForValue:(id)value
@ -629,7 +629,7 @@ static Class NSStringClass = Nil;
[self logSynchronizeForValue:value
inComponent:component
componentToParent:NO];
};
}
//--------------------------------------------------------------------
-(NSString*)debugDescription
@ -637,7 +637,7 @@ static Class NSStringClass = Nil;
//OK
[self subclassResponsibility:_cmd];
return nil;
};
}
//--------------------------------------------------------------------
@ -649,7 +649,7 @@ static Class NSStringClass = Nil;
ASSIGN(_bindingName,bindingName);
ASSIGN(_declarationName,declarationName);
ASSIGN(_declarationType,declarationType);
};
}
//--------------------------------------------------------------------
+(id)valueInComponent:(GSWComponent*)object
@ -658,209 +658,89 @@ static Class NSStringClass = Nil;
static id EONullNull=nil;
//TODO MultiThread Protection ?
if (!EONullNull)
{
#ifdef HAVE_GDL2
EONullNull=[EONull null];
#else
#ifdef TCSDB
EONullNull=[DBNull null];
#else
EONullNull=[NSNull null];
#endif
#endif
};
{
EONullNull=[NSNull null];
}
id retValue=nil;
if (keyPath && object && object!=EONullNull)
{
NS_DURING
{
#if HAVE_GDL2
NS_DURING
{
retValue=[object valueForKeyPath:keyPath];
}
NS_HANDLER
{
NSLog(@"Attempt to get %@ -%@ raised an exception (%@)",
[object class],
keyPath,
localException);
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods"
format:@"-[%@ %@]",
[object class],
keyPath];
[localException raise];
}
NS_ENDHANDLER;
if (retValue==EONullNull)
retValue=nil;
#else
#ifdef TCSDB
// the same as on GDL2
NS_DURING
{
retValue=[object valueForKeyPath:keyPath];
}
NS_HANDLER
{
NSLog(@"Attempt to get %@ -%@ raised an exception (%@)",
[object class],
keyPath,
localException);
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods"
format:@"-[%@ %@]",
[object class],
keyPath];
[localException raise];
}
NS_ENDHANDLER;
if (retValue==EONullNull)
retValue=nil;
#else // NO TCSDB and NO GDL2
NSMutableArray* keys=[[keyPath componentsSeparatedByString:@"."] mutableCopy];
id part=nil;
Class handlerClass=Nil;
retValue=object;
NSAssert(retValue,@"No Component");
while(retValue && [keys count]>0)
{
part=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
if ([part hasPrefix:@"\""])
{
part=[part stringByDeletingPrefix:@"\""];
while([keys count]>0)
{
id tmpPart=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
if ([tmpPart hasSuffix:@"\""])
{
tmpPart=[tmpPart stringByDeletingSuffix:@"\""];
part=[part stringByAppendingFormat:@".%@",tmpPart];
break;
}
else
part=[part stringByAppendingFormat:@".%@",tmpPart];
}
}
handlerClass=[associationsHandlerClasses objectForKey:part];
if (handlerClass)
retValue=[handlerClass processValueInObject:retValue
forHandler:part
forKeyPath:keys];
else if ([part isEqualToString:GSASK_Class])
{
Class class=Nil;
NSAssert2([keys count]>0,@"No class name for handler %@ in %@",
GSASK_Class,
keyPath);
part=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
class=NSClassFromString(part);
NSAssert3(class>0,@"No class named %@ for handler %@ in %@",
part,
GSASK_Class,
keyPath);
if (class)
retValue=class;
else
retValue=nil;
}
else if ([part isEqualToString:GSASK_Language])
{
NSArray* languages=[[GSWApp _context] languages];
int count=[languages count];
id v=nil;
int i=0;
for(i=0;!v && i<count;i++)
{
id language=[languages objectAtIndex:i];
v=[retValue valueForKey:language];
};
retValue=v;
}
else
{
BOOL skipping = NO;
NS_DURING
{
retValue=[retValue valueForKey:part];
}
NS_HANDLER
{
NSLog(@"Attempt to get %@ -%@ raised an exception (%@)",
[retValue class],
part,
localException);
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods"
format:@"-[%@ %@]",[retValue class],part];
[localException raise];
}
NS_ENDHANDLER;
};
if (retValue==EONullNull)
retValue=nil;
};
#endif
#endif
};
retValue=[object valueForKeyPath:keyPath];
}
NS_HANDLER
{
NSLog(@"Attempt to get %@ -%@ raised an exception (%@)",
[object class],
keyPath,
localException);
localException = [localException exceptionByAddingToUserInfoKey:@"Invalid Ivars/Methods"
format:@"-[%@ %@]",
[object class],
keyPath];
[localException raise];
}
NS_ENDHANDLER;
if (retValue==EONullNull)
retValue=nil;
}
return retValue;
};
}
//--------------------------------------------------------------------
#ifdef TCSDB
+(void)setValue:(id)value
inComponent:(GSWComponent*)object
forKeyPath:(NSString*)keyPath
{
id tmpObject = nil;
NSString *tmpKey = nil;
if (keyPath) {
NSRange r = [keyPath rangeOfString: @"."];
if (r.length == 0) {
tmpObject = object;
tmpKey = keyPath;
} else {
NSString *key = [keyPath substringToIndex: r.location];
// NSString *path = [keyPath substringFromIndex: NSMaxRange(r)];
//[[self valueForKey: key] smartTakeValue: anObject
// forKeyPath: path];
tmpObject = [object valueForKey: key];
tmpKey = [keyPath substringFromIndex: NSMaxRange(r)];
}
if (tmpObject) //&& [object isKindOfClass:[GSWComponent class]]
{
NSException* exp = [tmpObject validateValue:&value
forKey:tmpKey];
if (exp)
NSError * outError = nil;
BOOL ok = [tmpObject validateValue:&value forKey:tmpKey error:&outError];
if (ok == NO)
{
NSException* exception=nil;
NSException * exception=nil;
NSDictionary * uInfo;
NSString * errorStr = @"unknown reason";
uInfo = [NSDictionary dictionaryWithObjectsAndKeys:
(value ? value : (id)@"nil"), @"EOValidatedObjectUserInfoKey",
keyPath, @"EOValidatedPropertyUserInfoKey",
nil];
if ((outError) && ([outError userInfo])) {
errorStr = [[outError userInfo] valueForKey:NSLocalizedDescriptionKey];
}
exception=[NSException exceptionWithName:@"EOValidationException"
reason:[exp reason]
userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:
(value ? value : (id)@"nil"),@"EOValidatedObjectUserInfoKey",
keyPath,@"EOValidatedPropertyUserInfoKey",
nil,nil]];
reason:errorStr
userInfo:uInfo];
[object validationFailedWithException:exception
value:value
keyPath:keyPath];
} else
{
// no exception, set the value
} else {
// all fine, set the value
[tmpObject setValue:value
forKey:tmpKey];
}
@ -868,122 +748,6 @@ static Class NSStringClass = Nil;
}
}
#else // GDL2 or GDL1
+(void)setValue:(id)value
inComponent:(GSWComponent*)object
forKeyPath:(NSString*)keyPath
{
if ([keyPath length]==0)
{
[NSException raise:NSInvalidArgumentException
format:@"No key path when setting value %@ in object of class %@",
value,NSStringFromClass([object class])];
};
#if HAVE_GDL2
[object smartTakeValue:value
forKeyPath:keyPath];
#else // no GDL2
NSMutableArray* keys=[[keyPath componentsSeparatedByString:@"."] mutableCopy];
id part=nil;
id tmpObject=object;
Class handlerClass=Nil;
NSAssert(tmpObject,@"No Object");
while(tmpObject && [keys count]>0)
{
part=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
if ([part hasPrefix:@"\""])
{
part=[part stringByDeletingPrefix:@"\""];
while([keys count]>0)
{
id tmpPart=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
if ([tmpPart hasSuffix:@"\""])
{
tmpPart=[tmpPart stringByDeletingSuffix:@"\""];
part=[part stringByAppendingFormat:@".%@",tmpPart];
break;
}
else
part=[part stringByAppendingFormat:@".%@",tmpPart];
}
}
handlerClass=[associationsHandlerClasses objectForKey:part];
if (handlerClass)
{
tmpObject=[handlerClass processSetValue:value
inObject:tmpObject
forHandler:part
forKeyPath:keys];
}
else
{
if ([keys count]>0)
{
if ([part isEqualToString:GSASK_Class])
{
Class class=Nil;
NSAssert2([keys count]>0,@"No class name for handler %@ in %@",
GSASK_Class,
keyPath);
part=[keys objectAtIndex:0];
[keys removeObjectAtIndex:0];
class=NSClassFromString(part);
NSAssert3(class>0,@"No class named %@ for handler %@ in %@",
part,
GSASK_Class,
keyPath);
if (class)
tmpObject=class;
else
tmpObject=nil;
}
else
{
tmpObject=[tmpObject valueForKey:part];
}
}
else
{
GSWLogAssertGood(tmpObject);
[tmpObject setValue:value
forKey:part];
#ifdef HAVE_GDL2
// Turbocat
if (tmpObject && [tmpObject isKindOfClass:[GSWComponent class]])
{
NSException* exp = [tmpObject validateValue:&value
forKey:part];
if (exp)
{
NSException* exception=nil;
exception=[NSException exceptionWithName:@"EOValidationException"
reason:[exp reason]
userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:
(value ? value : @"nil"),@"EOValidatedObjectUserInfoKey",
keyPath,@"EOValidatedPropertyUserInfoKey",
nil,nil]];
[object validationFailedWithException:exception
value:value
keyPath:keyPath];
}
}
#endif
tmpObject=nil;
};
};
};
#endif
};
#endif
@end
@ -998,9 +762,9 @@ static Class NSStringClass = Nil;
{
id value=[debugAssociation valueInComponent:component];
debug=boolValueWithDefaultFor(value,NO);
};
}
return debug;
};
}
-(void)associationsSetDebugEnabled
{
@ -1014,8 +778,8 @@ static Class NSStringClass = Nil;
[association setDebugEnabledForBinding:@""
declarationName:key
declarationType:@""]; //TODO
};
};
}
}
-(void)associationsSetValuesFromObject:(id)from
inObject:(id)to
@ -1038,8 +802,8 @@ static Class NSStringClass = Nil;
key=[GSWAssociation associationWithKeyPath:key];
[key setValue:varValue
inComponent:to];
};
};
}
}
//--------------------------------------------------------------------
-(NSDictionary*)associationsWithoutPrefix:(NSString*)prefix
@ -1064,12 +828,12 @@ static Class NSStringClass = Nil;
[newAssociation setObject:value
forKey:varKeyAssociation];
[removeFrom removeObjectForKey:key];
};
};
}
}
newAssociation=[NSDictionary dictionaryWithDictionary:newAssociation];
return newAssociation;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)dictionaryByReplacingStringsWithAssociations
@ -1101,9 +865,9 @@ static Class NSStringClass = Nil;
newValue=value;
[newDictionary setObject:newValue
forKey:key];
};
}
return [NSDictionary dictionaryWithDictionary:newDictionary];
};
}
@end
@ -1134,7 +898,7 @@ static Class NSStringClass = Nil;
else
newValue=value;
[newArray addObject:newValue];
};
}
return [NSArray arrayWithArray:newArray];
};
}
@end

View file

@ -36,16 +36,15 @@ RCS_ID("$Id$")
#include "GSWeb.h"
#ifdef HAVE_GDL2
#include <EOControl/EOKeyValueCoding.h>
//#ifdef HAVE_GDL2
//#include <EOControl/EOKeyValueCoding.h>
//====================================================================
@interface GSWBundleUnarchiverDelegate : NSObject
{
id _object;
}
- (id) unarchiver:(EOKeyValueUnarchiver*)unarchiver
objectForReference:(NSString*)keyPath;
- (id) unarchiver:(NSKeyedUnarchiver*)unarchiver objectForReference:(NSString*)keyPath;
- (id) initWithObject:(id)object;
@end
@ -56,14 +55,13 @@ objectForReference:(NSString*)keyPath;
- (void) dealloc
{
[super dealloc];
};
}
//--------------------------------------------------------------------
- (id) unarchiver:(EOKeyValueUnarchiver*)unarchiver
objectForReference:(NSString*)keyPath
- (id) unarchiver:(NSKeyedUnarchiver*)unarchiver objectForReference:(NSString*)keyPath
{
return [_object valueForKeyPath:keyPath];
};
}
//--------------------------------------------------------------------
- (id) initWithObject:(id)object
@ -71,23 +69,23 @@ objectForReference:(NSString*)keyPath
if ((self=[super init]))
{
_object=object;
};
}
return self;
};
}
@end
#endif // HAVE_GDL2
//#endif // HAVE_GDL2
@implementation GSWBundle
//--------------------------------------------------------------------
-(id)initWithPath:(NSString*)aPath
baseURL:(NSString*)aBaseURL
baseURL:(NSString*)aBaseURL
{
return [self initWithPath:aPath
baseURL:aBaseURL
inFrameworkNamed:nil];
};
}
//--------------------------------------------------------------------
-(id)initWithPath:(NSString*)aPath
@ -115,9 +113,9 @@ objectForReference:(NSString*)keyPath
_classCache=[NSMutableDictionary new];
_selfLock=[NSRecursiveLock new];
LOGObjectFnStop();
};
}
return self;
};
}
//--------------------------------------------------------------------
-(void)dealloc
@ -152,25 +150,25 @@ objectForReference:(NSString*)keyPath
GSWLogC("Dealloc GSWBundle Super");
[super dealloc];
GSWLogC("End Dealloc GSWBundle");
};
}
//--------------------------------------------------------------------
-(NSString*)baseURL
{
return _baseURL;
};
}
//--------------------------------------------------------------------
-(NSString*)path
{
return _path;
};
}
//--------------------------------------------------------------------
-(NSString*)frameworkName
{
return _frameworkName;
};
}
//--------------------------------------------------------------------
-(NSString*)description
@ -190,7 +188,7 @@ objectForReference:(NSString*)keyPath
_frameworkName];
// GSWLogC("GSWBundle description D");
return descr;
};
}
//--------------------------------------------------------------------
-(void)unlock
@ -203,7 +201,7 @@ objectForReference:(NSString*)keyPath
#endif
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)lock
@ -216,7 +214,7 @@ objectForReference:(NSString*)keyPath
#endif
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
@ -237,17 +235,17 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)loadCache
{
LOGObjectFnNotImplemented(); //TODOFN
};
}
// returned relativePath won't have "/" prefix
@ -290,7 +288,7 @@ objectForReference:(NSString*)keyPath
// format like: language.languageSuffix/fileName
relativePath=[language stringByAppendingPathExtension:GSLanguageSuffix];
relativePath=[relativePath stringByAppendingPathComponent:fileName];
};
}
NSDebugMLLog(@"bundles",@"language=%@",language);
NSDebugMLLog(@"bundles",@"relativePath=%@",relativePath);
absolutePath=[_path stringByAppendingPathComponent:relativePath];
@ -315,9 +313,9 @@ objectForReference:(NSString*)keyPath
forKey:relativePath];
relativePath=nil;
absolutePath=nil;
};
};
};
}
}
}
if (aRelativePath) {
if ([relativePath length]>0) {
@ -357,7 +355,7 @@ objectForReference:(NSString*)keyPath
[self initializeObject:anObject
fromArchive:archive];
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)initializeObject:(id)anObject
@ -387,10 +385,10 @@ objectForReference:(NSString*)keyPath
[anObject setUserAssociations:userAssociations];
if (defaultAssociations && [anObject respondsToSelector:@selector(setDefaultAssociations:)])
[anObject setDefaultAssociations:defaultAssociations];
};
#if HAVE_GDL2 // GDL2 implementation
}
#if 0 //HAVE_GDL2 // GDL2 implementation
{
EOKeyValueUnarchiver* unarchiver=nil;
NSKeyedUnarchiver* unarchiver=nil;
GSWBundleUnarchiverDelegate* bundleDelegate=nil;
NSDictionary* variables=nil;
NSEnumerator* variablesEnum=nil;
@ -431,8 +429,8 @@ objectForReference:(NSString*)keyPath
variableValue,
variableValue,
[variableValue retainCount]);
};
};
}
}
#else
LOGObjectFnNotImplemented();
#endif
@ -450,11 +448,11 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(Class)scriptedClassWithName:(NSString*)aName
@ -476,7 +474,7 @@ objectForReference:(NSString*)keyPath
aClass=[self lockedScriptedClassWithName:aName
pathName:pathName
superclassName:aSuperclassName];
};
}
}
NS_HANDLER
{
@ -485,12 +483,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return aClass;
};
}
//--------------------------------------------------------------------
-(Class)lockedScriptedClassWithName:(NSString*)aName
@ -499,7 +497,7 @@ objectForReference:(NSString*)keyPath
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
-(NSString*)lockedScriptedClassPathWithName:(NSString*)aName
@ -520,7 +518,7 @@ objectForReference:(NSString*)keyPath
relativePath:NULL
absolutePath:&path];
return path;
};
}
//--------------------------------------------------------------------
-(Class)compiledClassWithName:(NSString*)aName
@ -528,7 +526,7 @@ objectForReference:(NSString*)keyPath
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
-(GSWElement*)templateNamed:(NSString*)aName
@ -551,12 +549,12 @@ objectForReference:(NSString*)keyPath
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In lockedTemplateNamed");
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
return template;
};
}
//--------------------------------------------------------------------
-(GSWElement*)lockedTemplateNamed:(NSString*)aName
@ -618,7 +616,7 @@ objectForReference:(NSString*)keyPath
absolutePath:&absoluteDefinitionPath];
NSDebugMLLog(@"bundles",@"absoluteDefinitionPath=%@",
absoluteDefinitionPath);
};
}
if (absoluteDefinitionPath)
{
@ -629,7 +627,7 @@ objectForReference:(NSString*)keyPath
pageDefString = [NSString stringWithContentsOfFile:absoluteDefinitionPath
encoding:encoding];
};
}
#ifndef NDEBUG
NS_DURING
#endif
@ -658,10 +656,10 @@ objectForReference:(NSString*)keyPath
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
@"In template Parsing");
[localException raise];
};
}
NS_ENDHANDLER;
#endif
};
}
if ([[GSWApplication application] isCachingEnabled])
{
if (template)
@ -674,12 +672,12 @@ objectForReference:(NSString*)keyPath
[_templateCache setObject:GSNotFoundMarker
forKey:relativeTemplatePath];
}
};
};
};
}
}
}
return template;
};
}
//--------------------------------------------------------------------
-(NSString*)stringForKey:(NSString*)aKey
@ -702,7 +700,7 @@ objectForReference:(NSString*)keyPath
string=defaultValue;
LOGObjectFnStop();
return string;
};
}
//--------------------------------------------------------------------
//NDFN
@ -750,9 +748,9 @@ objectForReference:(NSString*)keyPath
else
[_stringsTableCache setObject:GSNotFoundMarker
forKey:relativePath];
};
};
};
}
}
}
}
NS_HANDLER
{
@ -761,12 +759,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return stringsTable;
};
}
//--------------------------------------------------------------------
//NDFN
@ -800,7 +798,7 @@ objectForReference:(NSString*)keyPath
LOGSeriousError(@"Bad stringTableArray \n%@\n from file %@",
[NSString stringWithContentsOfFile:absolutePath],
absolutePath);
};
}
if ([[GSWApplication application] isCachingEnabled])
{
if (stringsTableArray)
@ -809,9 +807,9 @@ objectForReference:(NSString*)keyPath
else
[_stringsTableArrayCache setObject:GSNotFoundMarker
forKey:relativePath];
};
};
};
}
}
}
}
NS_HANDLER
{
@ -821,12 +819,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return stringsTableArray;
};
}
//--------------------------------------------------------------------
-(NSString*)urlForResourceNamed:(NSString*)aName
@ -863,9 +861,9 @@ objectForReference:(NSString*)keyPath
{
[_pathCache setObject:baseURL
forKey:relativePath];
};
};
};
}
}
}
if (baseURL)
{
if (isUsingWebServer)
@ -880,8 +878,8 @@ objectForReference:(NSString*)keyPath
queryString:[NSString stringWithFormat:@"%@=%@",
GSWKey_Data[GSWebNamingConv],
completePath]];//TODO Escape
};
};
}
}
}
NS_HANDLER
{
@ -890,12 +888,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return url;
};
}
//--------------------------------------------------------------------
-(NSString*)pathForResourceNamed:(NSString*)aName
@ -923,7 +921,7 @@ objectForReference:(NSString*)keyPath
{
[_pathCache setObject:absolutePath
forKey:relativePath];
};
}
}
NS_HANDLER
{
@ -932,12 +930,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
return absolutePath;
};
}
//--------------------------------------------------------------------
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)aName
@ -968,9 +966,9 @@ objectForReference:(NSString*)keyPath
encodingObject=GSWIntToNSString([NSString encodingNamed: encodingObject]);
[_encodingCache setObject:encodingObject
forKey:aName];
};
};
};
}
}
}
if (encodingObject)
encoding=[encodingObject intValue];
}
@ -981,12 +979,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return encoding;
};
}
//--------------------------------------------------------------------
-(GSWTemplateParserType)templateParserTypeForResourcesNamed:(NSString*)aName
@ -1013,9 +1011,9 @@ objectForReference:(NSString*)keyPath
templateParserTypeObject=GSWIntNumber([GSWTemplateParser templateParserTypeFromString:templateParserTypeObject]);
[_templateParserTypeCache setObject:templateParserTypeObject
forKey:aName];
};
};
};
}
}
}
if (templateParserTypeObject)
templateParserType=[templateParserTypeObject intValue];
}
@ -1026,12 +1024,12 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
LOGObjectFnStop();
return templateParserType;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)archiveNamed:(NSString*)aName
@ -1053,13 +1051,13 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
NSDebugMLLog(@"bundles",@"archive=%@",archive);
LOGObjectFnStop();
return archive;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)lockedArchiveNamed:(NSString*)aName
@ -1087,7 +1085,7 @@ objectForReference:(NSString*)keyPath
relativePath:&relativePath
absolutePath:&absolutePath];
NSDebugMLLog(@"bundles",@"archive=%p absolutePath=%@",archive,absolutePath);
};
}
if (!archive)
{
if (absolutePath)
@ -1101,13 +1099,13 @@ objectForReference:(NSString*)keyPath
else
[_archiveCache setObject:GSNotFoundMarker
forKey:relativePath];
};
};
};
}
}
}
NSDebugMLLog(@"bundles",@"archive=%@",archive);
LOGObjectFnStop();
return archive;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)apiNamed:(NSString*)aName
@ -1129,13 +1127,13 @@ objectForReference:(NSString*)keyPath
//TODO
[self unlock];
[localException raise];
};
}
NS_ENDHANDLER;
[self unlock];
NSDebugMLLog(@"bundles",@"api=%@",api);
LOGObjectFnStop();
return api;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)lockedApiNamed:(NSString*)aName
@ -1164,13 +1162,13 @@ objectForReference:(NSString*)keyPath
else
[_apiCache setObject:GSNotFoundMarker
forKey:relativePath];
};
};
};
}
}
}
NSDebugMLLog(@"bundles",@"api=%@",api);
LOGObjectFnStop();
return api;
};
}
//--------------------------------------------------------------------
@ -1178,14 +1176,14 @@ objectForReference:(NSString*)keyPath
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
-(id)scriptPathNameFromScriptedClassName:(NSString*)aName
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
@end

View file

@ -212,6 +212,16 @@ Call this method before using a component which was cached in a variable.
-(NSException*)validateValue:(id*)valuePtr
forKey:(NSString*)key;
/**
* This method is called to validate and potentially coerce
* VALUE for the receivers key path. This method also assigns
* the value if it is different from the current value.
* This method will raise an EOValidationException
* if validateValue:forKeyPath:error: returns an error.
* This method returns new value.
**/
- (id)validateTakeValue:(id)value forKeyPath:(NSString *)path;
//+(id)validateValue:(id*)valuePtr
// forKey:(id)key;

View file

@ -38,9 +38,6 @@ RCS_ID("$Id$")
#include "GSWPrivate.h"
#ifdef HAVE_GDL2
#include <EOControl/EOKeyValueCoding.h>
#endif
//====================================================================
@implementation GSWComponent
@ -144,7 +141,7 @@ static Class GSWHTMLBareStringClass = Nil;
// clone->_isParentToComponentSynchronized=_isParentToComponentSynchronized;
// clone->_isComponentToParentSynchronized=_isComponentToParentSynchronized;
return clone;
};
}
//--------------------------------------------------------------------
//-(void)encodeWithCoder:(NSCoder*)aCoder
@ -205,7 +202,7 @@ static Class GSWHTMLBareStringClass = Nil;
//// at:&_isParentToComponentSynchronized];
//// [aCoder decodeValueOfObjCType:@encode(BOOL)
//// at:&_isComponentToParentSynchronized];
// };
// }
// return self;
//}
//
@ -223,7 +220,7 @@ static Class GSWHTMLBareStringClass = Nil;
aFrameworkName=[aComponentDefinition frameworkName];
return aFrameworkName;
};
}
//--------------------------------------------------------------------
// logString:
@ -231,7 +228,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(void)logString:(NSString*)aString
{
[GSWApp logString:aString];
};
}
//--------------------------------------------------------------------
// logWithFormat:
@ -243,7 +240,7 @@ static Class GSWHTMLBareStringClass = Nil;
[self logWithFormat:aFormat
arguments:ap];
va_end(ap);
};
}
//--------------------------------------------------------------------
// logWithFormat:arguments:
@ -254,7 +251,7 @@ static Class GSWHTMLBareStringClass = Nil;
NSString* string=[NSString stringWithFormat:aFormat
arguments:arguments];
[self logString:string];
};
}
//--------------------------------------------------------------------
// name
@ -262,7 +259,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(NSString*)name
{
return _name;
};
}
//--------------------------------------------------------------------
// path
@ -273,7 +270,7 @@ static Class GSWHTMLBareStringClass = Nil;
NSBundle* bundle=[NSBundle mainBundle];
return [bundle pathForResource:_name
ofType:GSWPageSuffix[GSWebNamingConv]];
};
}
//--------------------------------------------------------------------
// baseURL
@ -282,7 +279,7 @@ static Class GSWHTMLBareStringClass = Nil;
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
@ -296,14 +293,14 @@ static Class GSWHTMLBareStringClass = Nil;
(void*)self];
return dscr;
};
}
// GSWeb Additions {
//--------------------------------------------------------------------
-(NSDictionary*)userDictionary
{
return _userDictionary;
};
}
//--------------------------------------------------------------------
-(void)setUserDictionary:(NSDictionary*)aUserDictionary
@ -315,7 +312,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(NSDictionary*)userAssociations
{
return _userAssociations;
};
}
//--------------------------------------------------------------------
-(void)setUserAssociations:(NSDictionary*)userAssociations
@ -327,21 +324,21 @@ static Class GSWHTMLBareStringClass = Nil;
-(GSWAssociation*)userAssociationForKey:(NSString*)key
{
return [[self userAssociations]objectForKey:key];
};
}
//--------------------------------------------------------------------
-(NSDictionary*)defaultAssociations
{
NSLog(@"WARNING: %s is not WebObjects API",__PRETTY_FUNCTION__);
return _defaultAssociations;
};
}
//--------------------------------------------------------------------
-(void)setDefaultAssociations:(NSDictionary*)defaultAssociations
{
NSLog(@"WARNING: %s is not WebObjects API",__PRETTY_FUNCTION__);
ASSIGN(_defaultAssociations,defaultAssociations);
};
}
//--------------------------------------------------------------------
-(GSWAssociation*)defaultAssociationForKey:(NSString*)key
@ -349,7 +346,7 @@ static Class GSWHTMLBareStringClass = Nil;
NSLog(@"WARNING: %s is not WebObjects API",__PRETTY_FUNCTION__);
return [[self defaultAssociations]objectForKey:key];
};
}
// }
@ -361,7 +358,7 @@ static Class GSWHTMLBareStringClass = Nil;
{
//OK
_isCachingEnabled=caching;
};
}
//--------------------------------------------------------------------
//isCachingEnabled
@ -370,7 +367,7 @@ static Class GSWHTMLBareStringClass = Nil;
{
//OK
return _isCachingEnabled;
};
}
-(void) _setParent:(GSWComponent*) parent
associations:(NSMutableDictionary *) assocdict
@ -441,21 +438,18 @@ static Class GSWHTMLBareStringClass = Nil;
NSString * myKey = nil;
id obj;
GSWAssociation * assoc = nil;
if (_isSynchronized && (_keyAssociations != nil)) {
enumer = [_keyAssociations keyEnumerator];
while ((myKey = [enumer nextObject])) {
assoc = [_keyAssociations objectForKey: myKey];
obj = [assoc valueInComponent:_parent];
#if HAVE_GDL2 // GDL2 implementation
[self smartTakeValue: obj
forKey: myKey];
#else
[self setValue: obj
forKey: myKey];
#endif
}
enumer = [_keyAssociations keyEnumerator];
while ((myKey = [enumer nextObject])) {
assoc = [_keyAssociations objectForKey: myKey];
obj = [assoc valueInComponent:_parent];
[self setValue: obj
forKey: myKey];
}
}
}
-(void) synchronizeParentToComponent
@ -469,7 +463,7 @@ static Class GSWHTMLBareStringClass = Nil;
{
//OK
return _childTemplate;
};
}
//--------------------------------------------------------------------
-(GSWElement*) template
@ -491,7 +485,7 @@ static Class GSWHTMLBareStringClass = Nil;
NSLog(@"WARNING: %s is deprecated. Use template instead.", __PRETTY_FUNCTION__);
return [self template];
};
}
//--------------------------------------------------------------------
-(GSWComponentDefinition*)_componentDefinition
@ -506,44 +500,44 @@ static Class GSWHTMLBareStringClass = Nil;
languages:languages];
if ([self isCachingEnabled]) {
ASSIGN(_componentDefinition,aComponentDefinition);
};
};
}
}
return aComponentDefinition;
};
}
//--------------------------------------------------------------------
-(NSString*)_templateName
{
return _templateName;
};
}
//--------------------------------------------------------------------
-(NSString*)declarationName
{
return _templateName;
};
}
//--------------------------------------------------------------------
-(BOOL)_isPage
{
//OK
return _isPage;
};
}
//--------------------------------------------------------------------
-(void)_setIsPage:(BOOL)isPage
{
//OK
_isPage=isPage;
};
}
//--------------------------------------------------------------------
-(void)_setContext:(GSWContext*)aContext
{
// Verified with WO 4.5. We DO retain!
ASSIGN(_context, aContext);
};
}
//--------------------------------------------------------------------
@ -554,7 +548,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(GSWElement*)templateWithName:(NSString*)aName
{
return [[self _componentDefinition] template];
};
}
-(GSWComponent*)subComponentForElementID:(NSString*)elementId
@ -565,7 +559,7 @@ static Class GSWHTMLBareStringClass = Nil;
subc=[_subComponents objectForKey:elementId];
return subc;
};
}
//--------------------------------------------------------------------
-(void)_setSubcomponent:(GSWComponent*)component
@ -575,7 +569,7 @@ static Class GSWHTMLBareStringClass = Nil;
_subComponents=[NSMutableDictionary new];
[_subComponents setObject:component
forKey:elementId];
};
}
//--------------------------------------------------------------------
//NDFN
@ -585,7 +579,7 @@ static Class GSWHTMLBareStringClass = Nil;
parents=[self parents];
[parents makeObjectsPerformSelectorIfPossible:aSelector];
};
}
//--------------------------------------------------------------------
//NDFN
@ -597,7 +591,7 @@ static Class GSWHTMLBareStringClass = Nil;
[parents makeObjectsPerformSelectorIfPossible:aSelector
withObject:object];
};
}
//--------------------------------------------------------------------
//NDFN
@ -613,7 +607,7 @@ static Class GSWHTMLBareStringClass = Nil;
withObject:object1
withObject:object2];
};
}
//--------------------------------------------------------------------
//NDFN
@ -631,10 +625,10 @@ static Class GSWHTMLBareStringClass = Nil;
}
else
obj=[obj parent];
};
}
return retValue;
};
}
//--------------------------------------------------------------------
//NDFN
@ -654,10 +648,10 @@ static Class GSWHTMLBareStringClass = Nil;
}
else
obj=[obj parent];
};
}
return retValue;
};
}
//--------------------------------------------------------------------
//NDFN
@ -679,10 +673,10 @@ static Class GSWHTMLBareStringClass = Nil;
}
else
obj=[obj parent];
};
}
return retValue;
};
}
//--------------------------------------------------------------------
//NDFN
@ -696,8 +690,8 @@ static Class GSWHTMLBareStringClass = Nil;
{
[component performSelectorIfPossible:aSelector];
[component makeSubComponentsPerformSelectorIfPossible:aSelector];
};
};
}
}
//--------------------------------------------------------------------
//NDFN
@ -714,8 +708,8 @@ static Class GSWHTMLBareStringClass = Nil;
withObject:object];
[component makeSubComponentsPerformSelectorIfPossible:aSelector
withObject:object];
};
};
}
}
//--------------------------------------------------------------------
//NDFN
@ -735,8 +729,8 @@ static Class GSWHTMLBareStringClass = Nil;
[component makeSubComponentsPerformSelectorIfPossible:aSelector
withObject:object1
withObject:object2];
};
};
}
}
//PRIVATE
@ -757,7 +751,7 @@ static Class GSWHTMLBareStringClass = Nil;
}
return assoc;
};
}
-(BOOL)hasBinding:(NSString*)parentBindingName
@ -776,67 +770,32 @@ static Class GSWHTMLBareStringClass = Nil;
-(void)setValue:(id)value
forBinding:(NSString*)parentBindingName
{
//OK
GSWAssociation* assoc=nil;
if (_parent)
{
assoc=[self _associationWithName:parentBindingName];
if(assoc)
[assoc setValue:value
inComponent:_parent];
/* // Why doing this ? Be carefull: it may make a loop !
#if HAVE_GDL2
else
{
NS_DURING
{
[self smartTakeValue:value_
forKey:parentBindingName_];
}
NS_HANDLER;
{
//TODO
}
NS_ENDHANDLER;
}
#endif
*/
};
};
{
assoc=[self _associationWithName:parentBindingName];
if(assoc)
[assoc setValue:value
inComponent:_parent];
}
}
//--------------------------------------------------------------------
-(id)valueForBinding:(NSString*)parentBindingName
{
//OK
id aValue=nil;
GSWAssociation* assoc=nil;
if (_parent)
{
assoc=[self _associationWithName:parentBindingName];
if(assoc)
aValue=[assoc valueInComponent:_parent];
/* // Why doing this ? Be carefull: it may make a loop !
#if HAVE_GDL2
else
{
NS_DURING
{
aValue = [self valueForKey:parentBindingName_];
}
NS_HANDLER
{
//TODO
}
NS_ENDHANDLER;
}
#endif
*/
};
{
assoc=[self _associationWithName:parentBindingName];
if(assoc)
aValue=[assoc valueInComponent:_parent];
}
return aValue;
};
}
//--------------------------------------------------------------------
//NDFN
@ -860,7 +819,7 @@ static Class GSWHTMLBareStringClass = Nil;
synchronizesParentToComponentVariablesWithBindings=[self synchronizesVariablesWithBindings];
return synchronizesParentToComponentVariablesWithBindings;
};
}
//--------------------------------------------------------------------
-(BOOL)synchronizesVariablesWithBindings
@ -879,7 +838,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(NSDictionary*)bindingAssociations
{
return _keyAssociations;
};
}
//--------------------------------------------------------------------
@ -888,7 +847,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(void)sleep
{
//Does Nothing
};
}
//--------------------------------------------------------------------
-(void)sleepInContext:(GSWContext*)aContext
@ -911,7 +870,7 @@ static Class GSWHTMLBareStringClass = Nil;
[localException raise];
}
NS_ENDHANDLER;
};
}
//--------------------------------------------------------------------
// appendToResponse:inContext:
@ -996,7 +955,7 @@ static Class GSWHTMLBareStringClass = Nil;
GSWAssertIsElementID(aContext);
GSWAssertDebugElementIDsCount(aContext);
};
}
//GSWeb Additions {
@ -1008,32 +967,32 @@ static Class GSWHTMLBareStringClass = Nil;
_validationFailureMessages=[NSMutableDictionary new];
[_validationFailureMessages setObject:message
forKey:[NSValue valueWithNonretainedObject:element]];
};
}
//--------------------------------------------------------------------
-(NSString*)validationFailureMessageForElement:(GSWDynamicElement*)element
{
return [_validationFailureMessages objectForKey:[NSValue valueWithNonretainedObject:element]];
};
}
//--------------------------------------------------------------------
-(NSString*)handleValidationExceptionDefault
{
return nil; //Raise !
};
}
//--------------------------------------------------------------------
-(BOOL)isValidationFailure
{
//TODO ameliorate
return [[self allValidationFailureMessages] count]>0;
};
}
//--------------------------------------------------------------------
-(NSDictionary*)validationFailureMessages
{
return _validationFailureMessages;
};
}
//--------------------------------------------------------------------
-(NSArray*)allValidationFailureMessages
@ -1047,11 +1006,11 @@ static Class GSWHTMLBareStringClass = Nil;
while((component=[subComponentsEnum nextObject]))
{
[msgs addObjectsFromArray:[component allValidationFailureMessages]];
};
}
msgs=[NSArray arrayWithArray:msgs];
return msgs;
};
}
// }
@ -1088,7 +1047,7 @@ Call this method before using a component which was cached in a variable.
if ([self context] != aContext) {
[self _awakeInContext:aContext];
}
};
}
//--------------------------------------------------------------------
-(void) reset
@ -1133,14 +1092,14 @@ Call this method before using a component which was cached in a variable.
[context _setCurrentComponent:self];
return actionresults;
};
}
//--------------------------------------------------------------------
-(GSWComponent*)parent
{
//OK
return _parent;
};
}
//--------------------------------------------------------------------
//NDFN
@ -1152,9 +1111,9 @@ Call this method before using a component which was cached in a variable.
{
topParent=parent;
parent=[parent parent];
};
}
return topParent;
};
}
//--------------------------------------------------------------------
//NDFN
@ -1166,9 +1125,9 @@ Call this method before using a component which was cached in a variable.
{
[parents addObject:parent];
parent=[parent parent];
};
}
return [NSArray arrayWithArray:parents];
};
}
//--------------------------------------------------------------------
//NDFN
@ -1180,9 +1139,9 @@ Call this method before using a component which was cached in a variable.
{
[parents addObject:[parent class]];
parent=[parent parent];
};
}
return [NSArray arrayWithArray:parents];
};
}
-(GSWComponent*)pageWithName:(NSString*)aName
{
@ -1195,7 +1154,7 @@ Call this method before using a component which was cached in a variable.
inContext:aContext];
return page;
};
}
//--------------------------------------------------------------------
// session
@ -1208,13 +1167,13 @@ Call this method before using a component which was cached in a variable.
else if (_context)
session=[_context session];
return session;
};
}
//--------------------------------------------------------------------
-(BOOL)hasSession
{
return (_session!=nil);
};
}
//--------------------------------------------------------------------
// application
@ -1222,7 +1181,7 @@ Call this method before using a component which was cached in a variable.
-(GSWApplication*)application
{
return [GSWApplication application];
};
}
//--------------------------------------------------------------------
// context
@ -1248,7 +1207,7 @@ Call this method before using a component which was cached in a variable.
languages=[[self context] languages];
return languages;
};
}
//--------------------------------------------------------------------
//Called when an Enterprise Object or formatter failed validation during an
@ -1293,17 +1252,17 @@ Call this method before using a component which was cached in a variable.
{
NSDebugMLLog(@"GSWComponent",@"component is already awaken, but has not the current context, we awake it twice with current context = %@",self);
[self awakeInContext:aContext];
};
};
}
}
LOGObjectFnStop();
*/
};
}
//--------------------------------------------------------------------
-(void)debugWithFormat:(NSString*)aFormat,...
{
LOGObjectFnNotImplemented(); //TODOFN
};
}
//--------------------------------------------------------------------
+(void)logWithFormat:(NSString*)aFormat,...
@ -1313,14 +1272,14 @@ Call this method before using a component which was cached in a variable.
[[GSWApplication application] logWithFormat:aFormat
arguments:ap];
va_end(ap);
};
}
-(NSString*)_uniqueID
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
@ -1383,10 +1342,10 @@ Call this method before using a component which was cached in a variable.
LOGException(@"%@ (%@)",localException,[localException reason]);
[localException raise];
};
}
NS_ENDHANDLER;
};
}
//--------------------------------------------------------------------
-(GSWResponse*)_generateResponseInContext:(GSWContext*)aContext
@ -1401,7 +1360,7 @@ Call this method before using a component which was cached in a variable.
inContext:aContext];
return response;
};
}
//--------------------------------------------------------------------
@ -1418,7 +1377,55 @@ Call this method before using a component which was cached in a variable.
forKey:key];
*/
return exception;
};
}
/**
* This method is called to validate and potentially coerce
* VALUE for the receivers key path. This method also assigns
* the value if it is different from the current value.
* This method will raise an EOValidationException
* if validateValue:forKeyPath:error: returns an error.
* This method returns new value.
**/
- (id)validateTakeValue:(id)value forKeyPath:(NSString *)path
{
NSError *outError = nil;
BOOL ok = [self validateValue:&value
forKeyPath:path
error:&outError];
if (ok) { // value is ok
[self setValue:value
forKeyPath:path];
return value;
} else {
NSException * exception=nil;
NSDictionary * uInfo;
NSString * errorStr = @"unknown reason";
uInfo = [NSDictionary dictionaryWithObjectsAndKeys:
(value ? value : (id)@"nil"), @"EOValidatedObjectUserInfoKey",
path, @"EOValidatedPropertyUserInfoKey",
nil];
if ((outError) && ([outError userInfo])) {
errorStr = [[outError userInfo] valueForKey:NSLocalizedDescriptionKey];
}
exception=[NSException exceptionWithName:@"EOValidationException"
reason:errorStr
userInfo:uInfo];
if (exception) {
[exception raise];
}
}
return value;
}
//--------------------------------------------------------------------
// stringForKey:inTableNamed:withDefaultValue:
@ -1436,7 +1443,7 @@ Call this method before using a component which was cached in a variable.
inFramework:[self frameworkName]
languages:[self languages]];
return string;
};
}
//--------------------------------------------------------------------
//NDFN
@ -1449,7 +1456,7 @@ Call this method before using a component which was cached in a variable.
inFramework:[self frameworkName]
languages:[self languages]];
return stringsTable;
};
}
//--------------------------------------------------------------------
//NDFN
@ -1463,7 +1470,7 @@ Call this method before using a component which was cached in a variable.
languages:[self languages]];
return stringsTableArray;
};
}
//--------------------------------------------------------------------
@ -1488,7 +1495,7 @@ Call this method before using a component which was cached in a variable.
request:nil];//TODO
return url;
};
}
//--------------------------------------------------------------------
-(NSString*)_urlForResourceNamed:(NSString*)aName
@ -1496,7 +1503,7 @@ Call this method before using a component which was cached in a variable.
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
//--------------------------------------------------------------------
// pathForResourceNamed:ofType:
@ -1512,7 +1519,7 @@ Call this method before using a component which was cached in a variable.
languages:[self languages]];
return path;
};
}
//--------------------------------------------------------------------
//NDFN
@ -1554,7 +1561,7 @@ Call this method before using a component which was cached in a variable.
return [GSWApp stringsTableNamed:aName
inFramework:aFrameworkName
languages:[self languages]];
};
}
//--------------------------------------------------------------------
//NDFN
@ -1564,7 +1571,7 @@ Call this method before using a component which was cached in a variable.
return [GSWApp stringsTableArrayNamed:aName
inFramework:aFrameworkName
languages:[self languages]];
};
}
//--------------------------------------------------------------------
//NDFN
@ -1585,7 +1592,7 @@ Call this method before using a component which was cached in a variable.
inFramework:aFrameworkName
languages:[self languages]
request:nil];//TODO
};
}
//--------------------------------------------------------------------
//NDFN
@ -1597,7 +1604,7 @@ Call this method before using a component which was cached in a variable.
ofType:(NSString*)extension
inFramework:aFrameworkName
languages:[self languages]];
};
}
//--------------------------------------------------------------------
@ -1614,7 +1621,7 @@ Call this method before using a component which was cached in a variable.
declarationString:pageDefString
languages:languages];
return rootElement;
};
}
//--------------------------------------------------------------------
// templateWithHTMLString:declarationString:
@ -1625,7 +1632,7 @@ Call this method before using a component which was cached in a variable.
return [self templateWithHTMLString:htmlString
declarationString:pageDefString
languages:nil];
};
}
@ -1644,12 +1651,12 @@ Call this method before using a component which was cached in a variable.
{
LOGObjectFnNotImplemented(); //TODOFN
return nil;
};
}
+(void)_registerObserver:(id)observer
{
LOGClassFnNotImplemented(); //TODOFN
};
}
-(void)validateAPIAssociations
{
@ -1672,10 +1679,10 @@ Call this method before using a component which was cached in a variable.
[_parent class],
[self class],
[self parentsClasses]];
};
};
};
};
}
}
}
}
@end

View file

@ -110,7 +110,7 @@ RCS_ID("$Id$")
pageName = [pathArray objectAtIndex:0];
} else {
int i;
pageName = [[NSMutableString alloc] initWithCapacity:256];
pageName = [(NSMutableString*) [NSMutableString alloc] initWithCapacity:256];
[pageName autorelease];
for (i = pageNameLocation; i < pageNameLength - pageNameLocation; i++) {

View file

@ -90,6 +90,11 @@ accumulated instead of blocking on first error) **/
@protocol GSWDeclarationParserPragmaDelegate
-(NSDictionary*)includedDeclarationsFromFilePath:(NSString*)file
fromFrameworkNamed:(NSString*)frameworkName;
- (id) retain;
- (oneway void)release;
- (id)autorelease;
@end
//====================================================================

View file

@ -1542,5 +1542,22 @@ Returns a GSWDeclaration.
return declaration;
};
// those are here because a protocol forces us to implement them -- dw
- (id) retain
{
return [super retain];
}
- (oneway void)release
{
return [super release];
}
- (id)autorelease
{
return [super autorelease];
}
@end

View file

@ -72,9 +72,9 @@ static SEL appendStringSel = NULL;
length:(unsigned int)length
freeWhenDone:(BOOL)flag
{
_url=[[NSMutableString alloc]initWithCharactersNoCopy:chars
length:length
freeWhenDone:flag];
_url=[(NSMutableString*) [NSMutableString alloc] initWithCharactersNoCopy:chars
length:length
freeWhenDone:flag];
if (chars) {
[self _parse];
}
@ -86,8 +86,8 @@ static SEL appendStringSel = NULL;
-(id)initWithCharacters:(const unichar*)chars
length:(unsigned int)length
{
_url = [[NSMutableString alloc] initWithCharacters:chars
length:length];
_url = [(NSMutableString*)[NSMutableString alloc] initWithCharacters:chars
length:length];
if (chars) {
[self _parse];
}
@ -99,9 +99,9 @@ static SEL appendStringSel = NULL;
length:(unsigned int)length
freeWhenDone:(BOOL)flag
{
_url = [[NSMutableString alloc] initWithCStringNoCopy:byteString
length:length
freeWhenDone:flag];
_url = [(NSMutableString*) [NSMutableString alloc] initWithCStringNoCopy:byteString
length:length
freeWhenDone:flag];
if (byteString) {
[self _parse];
}
@ -112,8 +112,8 @@ static SEL appendStringSel = NULL;
-(id)initWithCString:(const char*)byteString
length:(unsigned int)length;
{
_url = [[NSMutableString alloc] initWithCString:byteString
length:length];
_url = [(NSMutableString*) [NSMutableString alloc] initWithCString:byteString
length:length];
if (byteString) {
[self _parse];
}

View file

@ -319,7 +319,7 @@ static inline BOOL _needQuote(NSString* str_needQuote)
name = [association valueInComponent:component];
if (name)
{
if ([@"app" caseInsensativeCompare: name])
if ([@"app" caseInsensitiveCompare: name])
{
name = nil;
}
@ -333,7 +333,7 @@ static inline BOOL _needQuote(NSString* str_needQuote)
[GSWApp debugWithFormat:@"%s evaluated to nil. Defaulting to %@",
__PRETTY_FUNCTION__,
(name ? name : @"app")];
(name ? name : (NSString*) @"app")];
}
}
else

View file

@ -261,5 +261,22 @@ Creates a GSWHTMLComment with the comment text
LOGObjectFnStop();
}
// those are here because a protocol forces us to implement them -- dw
- (id) retain
{
return [super retain];
}
- (oneway void)release
{
return [super release];
}
- (id)autorelease
{
return [super autorelease];
}
@end

View file

@ -220,8 +220,8 @@ RCS_ID("$Id$")
{
GSWComponent * component = GSWContext_component(context);
NSString * fname = [_filename valueInComponent: component];
NSString * fwname = [self _frameworkNameForAssociation: _framework
inComponent: component];
NSString * fwname = [[self class] _frameworkNameForAssociation: _framework
inComponent: component];
NSString * url = [context _urlForResourceNamed: fname
inFramework: fwname];

View file

@ -36,7 +36,7 @@
}
+ _setAlwaysAppendContentLength:(BOOL) yn;
+ (void) _setAlwaysAppendContentLength:(BOOL) yn;
+ (BOOL) _alwaysAppendContentLength;

View file

@ -41,6 +41,7 @@
#include "GSWResponse.h"
#include "GSWRequest.h"
#include <netinet/in.h>
#include <arpa/inet.h>
#define READ_SIZE 2048
@ -113,7 +114,7 @@ static BOOL _alwaysAppendContentLength = YES;
@implementation GSWHTTPIO
/* Apple is accessing this in Application.java in wotaskd example code -- dw */
+ _setAlwaysAppendContentLength:(BOOL) yn
+ (void) _setAlwaysAppendContentLength:(BOOL) yn
{
_alwaysAppendContentLength = yn;
}
@ -259,7 +260,6 @@ void _sendMessage(GSWMessage * message, NSFileHandle* fh, NSString * httpVersion
int fileDescriptor = [(GSFileHandle*) fh fileDescriptor];
struct sockaddr_in sockAddress;
socklen_t address_len = sizeof(sockAddress);
struct sockaddr_in sockaddrIn;
char str[INET_ADDRSTRLEN];
if (getpeername(fileDescriptor, (struct sockaddr *) &sockAddress, &address_len) == 0) {

View file

@ -112,7 +112,7 @@ RCS_ID("$Id$")
- (void) _setValueNoValidation:(id) aValue inComponent:(GSWComponent*) component
{
if (_isValueSettable) {
[component takeValue:aValue forKeyPath:_keyPath];
[component setValue:aValue forKeyPath:_keyPath];
}
}

View file

@ -396,7 +396,7 @@ void GetGSWMessageIMPs(GSWMessageIMPs* impsPtr,GSWMessage* message)
static __inline__ NSMutableData *_checkBody(GSWMessage *self) {
if (self->_contentData == nil) {
self->_contentData = [[NSMutableData alloc] initWithCapacity:DEF_CONTENT_SIZE];
self->_contentData = [(NSMutableData*)[NSMutableData alloc] initWithCapacity:DEF_CONTENT_SIZE];
}
if (!self->_contentDataADImp) {
self->_contentDataADImp=[self->_contentData methodForSelector:appendDataSel];

View file

@ -258,11 +258,9 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
//--------------------------------------------------------------------
-(void)_finalizeContentEncodingInContext:(GSWContext*)aContext
{
#ifdef HAVE_LIBZ
int dataLength=0;
LOGObjectFnStart();
#ifdef HAVE_LIBZ
dataLength=[self _contentLength];
NSDebugMLog(@"dataLength=%d",dataLength);
// Now we see if we can gzip the content
@ -311,9 +309,7 @@ void GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(GSWResponse*
};
};
#endif
LOGObjectFnStop();
};
}
//--------------------------------------------------------------------
-(void)_finalizeInContext:(GSWContext*)aContext

View file

@ -70,7 +70,7 @@ extern id gcObjectsToBeVisited;
[self setTimeOut:mySessionTimeOut];
[self _initWithSessionID:[[self class] createSessionID]];
};
}
return self;
}
@ -103,7 +103,7 @@ extern id gcObjectsToBeVisited;
[clone setStoresIDsInCookies:_storesIDsInCookies];
//_hasSessionLockedEditingContext: no
return clone;
};
}
//--------------------------------------------------------------------
+(NSString*)createSessionID
@ -156,7 +156,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.uptime)) ^ rnd);
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.loads[0]>0)
{
@ -165,7 +165,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.loads[0] >> 4)) ^ rnd);
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.loads[1]>0)
{
@ -174,7 +174,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.loads[1] >> 4)) ^ rnd);
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.loads[2]>0)
{
@ -183,7 +183,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.loads[2] >> 4)) ^ rnd);
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.freeram>0)
{
@ -192,7 +192,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.freeram >> 4)) ^ rnd); // Drop 4 minor bits
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.sharedram>0)
{
@ -201,7 +201,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.sharedram >> 4)) ^ rnd); // Drop 4 minor bits
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.freeswap>0)
{
@ -210,7 +210,7 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.freeswap >> 4)) ^ rnd); // Drop 4 minor bits
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
}
if (sizeToFill>=sizeof(unsigned int) && info.bufferram>0)
{
@ -219,9 +219,9 @@ extern id gcObjectsToBeVisited;
*((unsigned int*)pMd5Data)=(((unsigned int)(info.bufferram >> 4)) ^ rnd); // Drop 4 minor bits
sizeToFill-=sizeof(unsigned int);
pMd5Data+=sizeof(unsigned int);
};
};
};
}
}
}
#endif
NSDebugMLog(@"sizeToFill %d",sizeToFill);
while(sizeToFill>0)
@ -229,13 +229,13 @@ extern id gcObjectsToBeVisited;
*((unsigned char*)pMd5Data)=(unsigned char)(256.0*rand()/(RAND_MAX+1.0));
sizeToFill--;
pMd5Data++;
};
}
//Now do md5 on bytes after sizeof(ts)
md5Sum=[md5Data md5Digest];
[data appendData:md5Sum];
sessionID=[data hexadecimalRepresentation];
return sessionID;
};
}
//--------------------------------------------------------------------
-(void)encodeWithCoder:(NSCoder*)coder
{
@ -331,7 +331,7 @@ extern id gcObjectsToBeVisited;
_hasSessionLockedEditingContext ? "YES" : "NO"];
return dscr;
};
}
//--------------------------------------------------------------------
// sessionID
@ -339,7 +339,7 @@ extern id gcObjectsToBeVisited;
-(NSString*)sessionID
{
return _sessionID;
};
}
//--------------------------------------------------------------------
// sessionID
@ -347,7 +347,7 @@ extern id gcObjectsToBeVisited;
-(void)setSessionID:(NSString*)sessionID
{
ASSIGN(_sessionID,sessionID);
};
}
//--------------------------------------------------------------------
-(NSString*)domainForIDCookies
@ -373,20 +373,20 @@ extern id gcObjectsToBeVisited;
adaptorPrefix,
applicationName,
GSWApplicationSuffix[GSWebNamingConv]]));
};
}
NSDebugMLLog(@"sessions",@"_domainForIDCookies=%@",_domainForIDCookies);
return _domainForIDCookies;
};
}
//--------------------------------------------------------------------
-(BOOL)storesIDsInURLs
{
return _storesIDsInURLs;
};
}
//--------------------------------------------------------------------
-(void)setStoresIDsInURLs:(BOOL)flag
@ -396,7 +396,7 @@ extern id gcObjectsToBeVisited;
_storesIDsInURLs=flag;
};
}
//--------------------------------------------------------------------
-(NSDate*)expirationDateForIDCookies
@ -408,13 +408,13 @@ extern id gcObjectsToBeVisited;
expirationDateForIDCookies,
[expirationDateForIDCookies htmlDescription]);
return expirationDateForIDCookies;
};
}
//--------------------------------------------------------------------
-(BOOL)storesIDsInCookies
{
return _storesIDsInCookies;
};
}
//--------------------------------------------------------------------
-(void)setStoresIDsInCookies:(BOOL)flag
@ -424,9 +424,9 @@ extern id gcObjectsToBeVisited;
{
_storesIDsInCookies=flag;
[_currentContext _synchronizeForDistribution];
};
}
};
}
//--------------------------------------------------------------------
/** Returns NO if URLs contains application number so requests are
@ -438,7 +438,7 @@ extern id gcObjectsToBeVisited;
-(BOOL)isDistributionEnabled
{
return _isDistributionEnabled;
};
}
//--------------------------------------------------------------------
/** Enables or disables application instance number in URLs.
@ -453,9 +453,9 @@ extern id gcObjectsToBeVisited;
{
_isDistributionEnabled=flag;
[_currentContext _synchronizeForDistribution];
};
}
};
}
//--------------------------------------------------------------------
@ -521,7 +521,7 @@ extern id gcObjectsToBeVisited;
if (_sessionID)
{
NSDebugMLLog(@"sessions",@"sessionIDCount=%u",[_sessionID retainCount]);
};
}
application=[GSWApplication application];
//applic statisticsStore
//applic _activeSessionsCount
@ -531,7 +531,7 @@ extern id gcObjectsToBeVisited;
[application _finishInitializingSession:self];
return self;
};
}
//--------------------------------------------------------------------
@ -541,7 +541,7 @@ extern id gcObjectsToBeVisited;
-(BOOL)isTerminating
{
return _isTerminating;
};
}
//--------------------------------------------------------------------
// terminate
@ -568,17 +568,17 @@ extern id gcObjectsToBeVisited;
{
[_editingContext unlock];
_hasSessionLockedEditingContext = NO;
};
}
DESTROY(_editingContext);
};
}
/*
[self setTimeOut:(NSTimeInterval) 1]; // forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
//TODO: VERIFY
[self setTimeOut:(NSTimeInterval) 1]; // forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
*/
};
}
};
}
//--------------------------------------------------------------------
-(void)_terminateByTimeout
@ -596,7 +596,7 @@ extern id gcObjectsToBeVisited;
-(NSTimeInterval)timeOut
{
return _timeOut;
};
}
//--------------------------------------------------------------------
// setTimeOut:
@ -607,7 +607,7 @@ extern id gcObjectsToBeVisited;
_timeOut=[[NSDate distantFuture]timeIntervalSinceDate:_birthDate];
else
_timeOut=timeOut;
};
}
//--------------------------------------------------------------------
@ -618,14 +618,14 @@ extern id gcObjectsToBeVisited;
[GSWApp debugWithFormat:aFormat
arguments:ap];
va_end(ap);
};
}
//--------------------------------------------------------------------
-(void)_debugWithString:(NSString*)string
{
[GSWApp debugWithString:string];
};
}
//--------------------------------------------------------------------
@ -693,7 +693,7 @@ extern id gcObjectsToBeVisited;
[_contextRecords removeObjectForKey:[stackArray objectAtIndex:0]];
}
}
};
}
//--------------------------------------------------------------------
-(GSWComponent*)restorePageForContextID:(NSString*)aContextID
@ -713,7 +713,7 @@ extern id gcObjectsToBeVisited;
{
page=[transactionRecord responsePage];
GSWLogAssertGood(page);
};
}
if (page) // will put it at the end of the stack
{
@ -730,9 +730,9 @@ extern id gcObjectsToBeVisited;
{
[_contextArrayStack addObject:contextArray]; //add before removing to avoid release
[_contextArrayStack removeObjectAtIndex:stackIndex];
};
};
};
}
}
}
if ([_permanentPageCache objectForKey:aContextID])
page=[self _permanentPageWithContextID:aContextID];
@ -742,14 +742,14 @@ extern id gcObjectsToBeVisited;
[page _awakeInContext:_currentContext];
return page;
};
}
//--------------------------------------------------------------------
//NDFN
-(unsigned int)permanentPageCacheSize
{
return [GSWApp permanentPageCacheSize];
};
}
//--------------------------------------------------------------------
-(void)savePageInPermanentCache:(GSWComponent*)page
@ -788,7 +788,7 @@ extern id gcObjectsToBeVisited;
NSDebugMLLog(@"sessions",@"SESSION REMOVE: %p",[permanentPageCache objectForKey:deleteContextID]);
[permanentPageCache removeObjectForKey:deleteContextID];
RELEASE(deleteContextID);
};
}
contextID=[context contextID];
NSAssert(contextID,@"No contextID");
@ -802,14 +802,14 @@ extern id gcObjectsToBeVisited;
if (![permanentPageCache objectForKey:contextID])
{
LOGSeriousError0(@"but not present in cache");
};
}
}
else if ([permanentPageCache objectForKey:contextID])
{
LOGSeriousError(@"page of class %@ contextID %@ in permanent cache but not in stack",
[page class],
contextID);
};
}
NSDebugMLLog(@"sessions",@"SESSION REPLACE: %p",[permanentPageCache objectForKey:contextID]);
[permanentPageCache setObject:page
@ -825,17 +825,17 @@ extern id gcObjectsToBeVisited;
anotherContextID=[_permanentContextIDArray objectAtIndex:i];
anObject=[permanentPageCache objectForKey:anotherContextID];
[GSWApplication statusLogWithFormat:@"%d contextID=%@ page class=%@",i,anotherContextID,[anObject class]];
};
};
}
}
*/
if ([_permanentContextIDArray count]!=[permanentPageCache count])
{
LOGSeriousError(@"[permanentContextIDArray count] %d != [permanentPageCache count] %d",
(int)[_permanentContextIDArray count],
(int)[permanentPageCache count]);
};
}
};
}
//--------------------------------------------------------------------
@ -873,7 +873,7 @@ extern id gcObjectsToBeVisited;
[aResponse addCookie:instanceIDCookie];
};
}
//--------------------------------------------------------------------
-(void)appendCookieToResponse:(GSWResponse*)aResponse
@ -893,7 +893,7 @@ extern id gcObjectsToBeVisited;
{
sessionID=[self sessionID];
anExpireDate=[self expirationDateForIDCookies];
};
}
// SessionID cookie
[aResponse addCookie:[GSWCookie cookieWithName:GSWKey_SessionID[GSWebNamingConv]
@ -917,7 +917,7 @@ extern id gcObjectsToBeVisited;
instance=[request applicationNumber]; // use the request instance number
else
instance=-1;
};
}
[aResponse addCookie:[GSWCookie cookieWithName:GSWKey_InstanceID[GSWebNamingConv]
value:GSWIntToNSString(instance)
path:domainForIDCookies
@ -925,9 +925,9 @@ extern id gcObjectsToBeVisited;
expires:anExpireDate
isSecure:NO]];
};
}
};
}
@ -944,7 +944,7 @@ extern id gcObjectsToBeVisited;
// printf("session %p _releaseAutoreleasePool STOP\n",self);
// fprintf(stderr,"session %p _releaseAutoreleasePool STOP\n",self);
};
}
//--------------------------------------------------------------------
-(void)_createAutoreleasePool
@ -955,7 +955,7 @@ extern id gcObjectsToBeVisited;
GSWLogMemCF("New NSAutoreleasePool: %p",_autoreleasePool);
}
};
}
//--------------------------------------------------------------------
-(GSWComponent*)_permanentPageWithContextID:(NSString*)aContextID
@ -964,7 +964,7 @@ extern id gcObjectsToBeVisited;
page=[_permanentPageCache objectForKey:aContextID];
return page;
};
}
//--------------------------------------------------------------------
-(NSMutableDictionary*)_permanentPageCache
@ -975,7 +975,7 @@ extern id gcObjectsToBeVisited;
_permanentContextIDArray=[NSMutableArray new];
return _permanentPageCache;
};
}
//--------------------------------------------------------------------
-(NSString*)_contextIDMatchingContextID:(NSString*)aContextID
@ -983,7 +983,7 @@ extern id gcObjectsToBeVisited;
{
NSAssert(NO,@"Deprecated. use _contextIDMatchingIDsInContext:");
return nil;
};
}
//--------------------------------------------------------------------
-(NSString*)_contextIDMatchingIDsInContext:(GSWContext*)aContext
@ -1005,7 +1005,7 @@ extern id gcObjectsToBeVisited;
GSWTransactionRecord* aTransactionRecord=[_contextRecords objectForKey:aContextID];
if ([aTransactionRecord isMatchingIDsInContext:aContext])
contextID=aContextID;
};
}
}
@ -1034,10 +1034,10 @@ extern id gcObjectsToBeVisited;
// Put it at the stack end
[_contextArrayStack addObject:contextArray]; //add before removing to avoid release
[_contextArrayStack removeObjectAtIndex:stackIndex];
};
}
}
};
}
//--------------------------------------------------------------------
-(NSMutableArray*)_contextArrayForContextID:(NSString*)aContextID
@ -1058,30 +1058,30 @@ extern id gcObjectsToBeVisited;
*pStackIndex=i;
if (pContextArrayIndex)
*pContextArrayIndex=contextArrayIndex;
};
};
}
}
if (!contextArray)
{
if (pStackIndex)
*pStackIndex=NSNotFound;
if (pContextArrayIndex)
*pContextArrayIndex=NSNotFound;
};
}
return contextArray;
};
}
//--------------------------------------------------------------------
-(void)_replacePage:(GSWComponent*)page
{
LOGObjectFnNotImplemented(); //TODOFN
};
}
//--------------------------------------------------------------------
//NDFN
-(unsigned int)pageCacheSize
{
return [GSWApp pageCacheSize];
};
}
//--------------------------------------------------------------------
@ -1106,32 +1106,32 @@ extern id gcObjectsToBeVisited;
{
if ([self pageCacheSize]>0)
[self savePage:component];
};
};
};
};
}
}
}
}
};
}
//--------------------------------------------------------------------
-(int)_requestCounter
{
//OK
return _requestCounter;
};
}
//--------------------------------------------------------------------
-(void)_contextDidIncrementContextID
{
_contextCounter++;
};
}
//--------------------------------------------------------------------
-(int)_contextCounter
{
//OK
return _contextCounter;
};
}
//--------------------------------------------------------------------
-(void)_setContext:(GSWContext*)aContext
@ -1141,7 +1141,7 @@ extern id gcObjectsToBeVisited;
if (aContext!=_currentContext)
_currentContext=aContext;
};
}
//--------------------------------------------------------------------
-(void)sleepInContext:(GSWContext*)aContext
@ -1155,7 +1155,7 @@ extern id gcObjectsToBeVisited;
}
[self _setContext:nil];
};
}
//--------------------------------------------------------------------
-(void)awakeInContext:(GSWContext*)aContext
@ -1168,8 +1168,8 @@ extern id gcObjectsToBeVisited;
{
_contextCounter++;
_requestCounter++;
};
};
}
}
NSDebugMLLog(@"sessions",@"contextCounter=%i",_contextCounter);
if (_editingContext
&& !_hasSessionLockedEditingContext
@ -1177,10 +1177,10 @@ extern id gcObjectsToBeVisited;
{
[_editingContext lock];
_hasSessionLockedEditingContext=YES;
};
}
[self awake];
};
}
//--------------------------------------------------------------------
@ -1192,11 +1192,11 @@ extern id gcObjectsToBeVisited;
if (!someLanguages)
{
LOGError0(@"No languages");
};
}
ASSIGN(_languages,someLanguages);
};
}
//--------------------------------------------------------------------
/** GSWeb specific
@ -1217,13 +1217,13 @@ Insert language language at the begining of session languages array
[mutableLanguages insertObject:language
atIndex:0];
[self setLanguages:mutableLanguages];
};
}
}
else
[self setLanguages:[NSArray arrayWithObject:language]];
};
}
};
}
//--------------------------------------------------------------------
/** GSWeb specific
@ -1243,9 +1243,9 @@ is not present
}
else
[self setLanguages:[NSArray arrayWithObject:language]];
};
}
};
}
//--------------------------------------------------------------------
/** GSWeb specific
@ -1263,7 +1263,7 @@ Returns first element of languages or nil if languages is empty
return firstLanguage;
};
}
//--------------------------------------------------------------------
-(NSArray*)languages
@ -1278,12 +1278,12 @@ Returns first element of languages or nil if languages is empty
NSArray* languages=[request browserLanguages];
[self setLanguages:languages];
NSDebugMLLog(@"sessions",@"_languages=%@",_languages);
};
}
return _languages;
};
}
//--------------------------------------------------------------------
-(NSArray*)_languages
@ -1291,7 +1291,7 @@ Returns first element of languages or nil if languages is empty
return _languages;
};
}
//--------------------------------------------------------------------
@ -1303,7 +1303,7 @@ Returns first element of languages or nil if languages is empty
NSDebugMLLog(@"sessions",@"key=%@ object=%@",key,object);
return object;
};
}
//--------------------------------------------------------------------
// setObject:forKey:
@ -1320,7 +1320,7 @@ Returns first element of languages or nil if languages is empty
[_componentState setObject:object
forKey:key];
};
}
//--------------------------------------------------------------------
-(void)removeObjectForKey:(NSString*)key
@ -1328,34 +1328,33 @@ Returns first element of languages or nil if languages is empty
NSDebugMLLog(@"sessions",@"key=%@",key);
[_componentState removeObjectForKey:key];
};
}
//--------------------------------------------------------------------
//NDFN
-(NSMutableDictionary*)componentState
{
return _componentState;
};
}
//--------------------------------------------------------------------
-(EOEditingContext*)defaultEditingContext
{
#if HAVE_GDL2
if(!_editingContext)
{
ASSIGN(_editingContext,[[[NSClassFromString(@"EOEditingContext") alloc] init] autorelease]);
[_editingContext setLevelsOfUndo:[GSWApplication defaultUndoStackLimit]];
if ([GSWApplication _lockDefaultEditingContext])
{
ASSIGN(_editingContext,[[[EOEditingContext alloc] init] autorelease]);
[_editingContext setLevelsOfUndo:[GSWApplication defaultUndoStackLimit]];
if ([GSWApplication _lockDefaultEditingContext])
{
[_editingContext lock];
_hasSessionLockedEditingContext=YES;
};
[_editingContext lock];
_hasSessionLockedEditingContext=YES;
}
#endif
}
return _editingContext;
};
}
//--------------------------------------------------------------------
-(void)setDefaultEditingContext:(EOEditingContext*)editingContext
@ -1374,22 +1373,22 @@ Returns first element of languages or nil if languages is empty
{
[_editingContext lock];
_hasSessionLockedEditingContext=YES;
};
};
};
}
}
}
//--------------------------------------------------------------------
-(GSWContext*)context
{
return _currentContext;
};
}
//--------------------------------------------------------------------
// awake
-(void)awake
{
DESTROY(_domainForIDCookies);
};
}
//--------------------------------------------------------------------
// sleep
@ -1399,7 +1398,7 @@ Returns first element of languages or nil if languages is empty
// We destroy domainForIDCookies because applictaion name may
// change between pages
DESTROY(_domainForIDCookies);
};
}
//--------------------------------------------------------------------
// takeValuesFromRequest:inContext:
@ -1418,7 +1417,7 @@ Returns first element of languages or nil if languages is empty
inContext:aContext];
[aContext _setCurrentComponent:nil];
};
}
//--------------------------------------------------------------------
// invokeActionForRequest:inContext:
@ -1510,11 +1509,11 @@ Returns first element of languages or nil if languages is empty
_formattedStatistics = [NSMutableString new];
[_formattedStatistics appendString:formattedDescr];
}
};
};
};
}
}
}
};
}
@ -1522,25 +1521,25 @@ Returns first element of languages or nil if languages is empty
-(NSArray*)statistics
{
return _statistics;
};
}
//--------------------------------------------------------------------
-(BOOL)_allowedToViewStatistics
{
return _isAllowedToViewStatistics;
};
}
//--------------------------------------------------------------------
-(void)_allowToViewStatistics
{
_isAllowedToViewStatistics=YES;
};
}
//--------------------------------------------------------------------
-(void)_setAllowedToViewStatistics:(BOOL)flag
{
_isAllowedToViewStatistics=flag;
};
}
//--------------------------------------------------------------------
-(BOOL)validateStatisticsLogin:(NSString*)login
@ -1560,13 +1559,13 @@ Returns first element of languages or nil if languages is empty
-(NSString*)_formattedStatistics
{
return [NSString stringWithString:_formattedStatistics];
};
}
//--------------------------------------------------------------------
-(NSDate*)_birthDate
{
return _birthDate;
};
}
//--------------------------------------------------------------------
-(void)_setBirthDate:(NSDate*)birthDate
@ -1578,19 +1577,19 @@ Returns first element of languages or nil if languages is empty
-(BOOL)_allowedToViewEvents
{
return _isAllowedToViewEvents;
};
}
//--------------------------------------------------------------------
-(void)_allowToViewEvents
{
_isAllowedToViewEvents=YES;
};
}
//--------------------------------------------------------------------
-(void)_setAllowedToViewEvents:(BOOL)flag
{
_isAllowedToViewEvents=flag;
};
}
-(void) _clearCookieFromResponse:(GSWResponse*) aResponse
{
@ -1639,26 +1638,26 @@ Returns first element of languages or nil if languages is empty
-(GSWApplication*)application
{
return [GSWApplication application];
};
}
//--------------------------------------------------------------------
-(void)_validateAPI
{
LOGObjectFnNotImplemented(); //TODOFN
};
}
//--------------------------------------------------------------------
+(void)__setContextCounterIncrementingEnabled:(BOOL)flag
{
LOGClassFnNotImplemented(); //TODOFN
};
}
//--------------------------------------------------------------------
+(int)__counterIncrementingEnabledFlag
{
LOGClassFnNotImplemented(); //TODOFN
return 1;
};
}
@end

View file

@ -128,6 +128,11 @@ Creates a GSWHTMLComment with the comment text
**/
-(void) parser:(GSWBaseParser*)parser
didParseComment:(NSString*)text;
- (id) retain;
- (oneway void)release;
- (id)autorelease;
@end
@ -207,6 +212,7 @@ Creates a GSWHTMLComment with the comment text
-(NSDictionary*)parseDeclarationsString:(NSString*)declarationsString
named:(NSString*)declarationsName
inFrameworkNamed:(NSString*)declarationsFrameworkName;
@end
#endif //_GSWTemplateParser_h__

View file

@ -727,5 +727,24 @@ declarations **/
};
// those are here because a protocol forces us to implement them -- dw
- (id) retain
{
return [super retain];
}
- (oneway void)release
{
return [super release];
}
- (id)autorelease
{
return [super autorelease];
}
@end

View file

@ -2,14 +2,14 @@
#
#
DYNAMIC_LINKER=simple
GDL2=@GDL2@
#GDL2=@GDL2@
AUX_LIBS=@AUX_LIBS@
#EOControl dependancy
ifeq ($(GDL2),yes)
EOCONTROL_LIBRARY_NAME=EOControl
EOACCESS_LIBRARY_NAME=EOAccess
endif
#ifeq ($(GDL2),yes)
#EOCONTROL_LIBRARY_NAME=EOControl
#EOACCESS_LIBRARY_NAME=EOAccess
#endif
#Native Framework support
ifeq ($(OBJC_RUNTIME_LIB),apple)