Bug fixes. See ChangeLog

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@37795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mguesdon 2014-04-13 19:34:39 +00:00
parent 0c5ba4561a
commit 3ad7066815
27 changed files with 324 additions and 291 deletions

View file

@ -1,3 +1,68 @@
2014-04-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWDatabase/WODisplayGroup.m
remove -objectsAtIndexes: (implemented in core/NSArray)
* GSWeb/GSWComponent.m
implement -baseURL
* GSWeb/GSWComponentDefinition.m
comment unused defaultFileManager
* GSWeb/GSWUtils.m
* GSWeb/GSWMessage.m
fix encoding output in logs/messages
* GSWeb/GSWString.[hm]
fix -initWithName:associations:template: definition
* GSWeb/GSWRequest.m
fix misnaming (s/WODynamicURLString/GSWDynamicURLString/)
fix encoding output in logs/messages
* GSWeb/GSWRadioButton.m
remove [_value isValueSettable] test: this value is not set
* GSWeb/GSWImage.m
fix framework name computing
* GSWeb/GSWHTTPIO.m
allow custom request class
fix warning
* GSWeb/GSWApplication.m
fix GSWFPutSL (there was no \0 at end of string)
fix -sessionIdKey
fix -instanceIdKey
remove unused -createRequestWithMethod:...
* GSWeb/GSWApplication.h
remove unused -createRequestWithMethod:...
* config.mak.in
define EOCONTROL_LIBRARY_NAME and EOACCESS_LIBRARY_NAME
* GSWeb/GSWConstants.[hm]
add GSWKey_QuestionMarkSessionID
add border__Key
* GSWeb/GSWActiveImage.h
add _border association
* GSWeb/GSWActiveImage.m
fix SessionID stuff in initWithName:...
add _border association
fix associations tests
respect GNUstep coding standard (curly brackets placement)
* GSWeb/GSWContext.m
fix -sessionID
* GSWeb/GSWForm.m
fix _appendHiddenFieldsToResponse:inContext: (convert value to string)
* GSWeb/GSWHTMLDynamicElement.m
fix _frameworkNameForAssociation:inComponent:
fix computeQueryDictionaryWithActionClassAssociation: (wosid hadcoding and
other values tests)
respect GNUstep coding standard (curly brackets placement)
rename variables to make code easier to understand
fix _appendAttributesFromAssociationsToResponse:
* GSWeb/GSWHTMLRawParser.m
fix warning
* GSWExtensions/GNUmakefile
fix FRAMEWORK_NAME for gswnames=gsw
* GSWExtensionsGSW/GSWFileUploadComponent.m
removed uneeded method
* GSWExtensionsGSW/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd
quick fix FileLinkWithPath (investigate this later)
* config.mak.in
fix gswnames problem for ./configure --with-gswnames=gsw
* README
add original developper name
2013-12-21: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* GSWeb/GSWSession.m
do not include linux/sys.h

View file

@ -69,7 +69,6 @@ static BOOL globalDefaultForValidatesChangesImmediately = NO;
@interface NSArray (Indexes)
-(NSArray*)indexesOfObjectsIdenticalTo:(NSArray*)objects;
-(NSArray*)objectsAtIndexes:(NSArray*)indexes;
@end
//====================================================================
@ -2512,40 +2511,5 @@ createObjectFailedForDataSource:_dataSource];
return indexes;
}
-(NSArray*)objectsAtIndexes:(NSArray*)indexes
{
NSArray* objects=nil;
int selfCount=0;
selfCount=[self count];
if ([self count]>0)
{
int indexesCount=[indexes count];
if (indexesCount>0)
{
NSMutableArray* tmpObjects=nil;
int i=0;
for(i=0;i<indexesCount;i++)
{
id indexObject=[indexes objectAtIndex:i];
int index=[indexObject intValue];
if (index<selfCount)
{
id object=[self objectAtIndex:index];
if (tmpObjects)
[tmpObjects addObject:object];
else
tmpObjects=(NSMutableArray*)[NSMutableArray arrayWithObject:object];
}
}
if (tmpObjects)
objects=[NSArray arrayWithArray:tmpObjects];
}
}
if (!objects)
objects=[NSArray array];
return objects;
}
@end

View file

@ -31,8 +31,8 @@ srcdir = .
# Options
ifeq ($(gswnames), gsw)
#FRAMEWORK_NAME = GSWExtensions
FRAMEWORK_NAME = WOExtensions
FRAMEWORK_NAME = GSWExtensions
#FRAMEWORK_NAME = WOExtensions
endif
ifeq ($(gswnames), wo)
FRAMEWORK_NAME = WOExtensions

View file

@ -134,11 +134,12 @@ UploadFile: GSWFileUpload
enabled=^isUploadEnabled;
};
FileLinkWithPath: GSWHyperlink
//TODO: investigate this later
FileLinkWithPath: GSWResourceURL
{
filename=fileInfo.filePath;
data=fileInfo.data;
mimeType=fileInfo.mimeType;
//data=fileInfo.data;
//mimeType=fileInfo.mimeType;
key=fileInfo.filePath;
string= ^string;
target = ^target;

View file

@ -38,15 +38,6 @@ RCS_ID("$Id$")
//====================================================================
@implementation GSWFileUploadComponent
//--------------------------------------------------------------------
-(id)init
{
if ((self=[super init]))
{
};
return self;
};
//--------------------------------------------------------------------
-(void)awake
{

View file

@ -59,7 +59,7 @@
GSWAssociation * _actionClass;
GSWAssociation * _directActionName;
NSDictionary * _sessionIDQueryAssociations;
GSWAssociation * _border;
};

View file

@ -39,6 +39,7 @@ RCS_ID("$Id$")
static NSString * static_sessionIDKey = nil;
static NSString * static_tempQueryKey = nil;
static GSWAssociation * static_defaultBorderAssociation = nil;
@implementation GSWActiveImage
@ -49,6 +50,7 @@ static NSString * static_tempQueryKey = nil;
if (!static_sessionIDKey) {
static_sessionIDKey = [[GSWApp sessionIdKey] retain];
static_tempQueryKey = [[@"?" stringByAppendingString:static_sessionIDKey] retain];
static_defaultBorderAssociation = [[GSWAssociation associationWithValue:@"0"] retain];
}
}
}
@ -66,7 +68,7 @@ static NSString * static_tempQueryKey = nil;
if (!self) {
return nil;
}
tempAssociation = [_associations objectForKey:static_tempQueryKey];
if (tempAssociation != nil) {
[tempQueryAssociations setObject:tempAssociation
@ -74,12 +76,12 @@ static NSString * static_tempQueryKey = nil;
[_associations removeObjectForKey: static_tempQueryKey];
}
if ([static_sessionIDKey isEqualToString:@"wosid"] == NO) {
tempAssociation = [_associations objectForKey:@"?wosid"];
if ([static_sessionIDKey isEqualToString:GSWKey_SessionID[GSWebNamingConv]] == NO) {
tempAssociation = [_associations objectForKey:GSWKey_QuestionMarkSessionID[GSWebNamingConv]];
if (tempAssociation != nil) {
[tempQueryAssociations setObject:@"wosid"
forKey:static_sessionIDKey];
[_associations removeObjectForKey: @"wosid"];
[tempQueryAssociations setObject:tempAssociation
forKey:GSWKey_SessionID[GSWebNamingConv]];
[_associations removeObjectForKey:GSWKey_QuestionMarkSessionID[GSWebNamingConv]];
}
}
@ -149,6 +151,13 @@ static NSString * static_tempQueryKey = nil;
if (_key != nil) {
[_associations removeObjectForKey: key__Key];
}
ASSIGN(_border, [_associations objectForKey: border__Key]);
if (_border != nil) {
[_associations removeObjectForKey: border__Key];
}
else {
ASSIGN(_border,static_defaultBorderAssociation);
}
if (_file != nil && _imageMapString != nil && _imageMapRegions != nil) {
[NSException raise:NSInvalidArgumentException
@ -159,88 +168,107 @@ static NSString * static_tempQueryKey = nil;
imageMapRegions__Key];
};
if (_action != nil) {
if (_actionClass != nil || _directActionName != nil || _href != nil) {
if (_action != nil)
{
if (_actionClass != nil || _directActionName != nil || _href != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'action' is specified, 'directActionName', 'actionClass', and 'href' must be nil.",
__PRETTY_FUNCTION__];
}
if ([_action isValueConstant])
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'action' must not be a constant.",
__PRETTY_FUNCTION__];
}
}
else if (_href != nil)
{
if (_actionClass != nil || _directActionName != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'directActionName' or 'actionClass' is specified, 'action' and 'href' must be nil.",
__PRETTY_FUNCTION__];
}
}
else if (_actionClass == nil && _directActionName == nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'action' is specified, 'directActionName', 'actionClass', and 'href' must be nil.",
__PRETTY_FUNCTION__];
format:@"%s: Either a component action or a direct action or 'href' must be specified.",
__PRETTY_FUNCTION__];
}
if ([_action isValueConstant]) {
if (_filename != nil)
{
if (_src != nil || _data != nil || _value != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'filename' is specified, 'src', 'data', and 'value' must be nil.",
__PRETTY_FUNCTION__];
}
}
else
{
if (_framework != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'framework' should not be specified if 'filename' is nil.",
__PRETTY_FUNCTION__];
}
if (_data != nil)
{
if (_mimeType == nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'mimeType' must be specified if 'data' is specified.",
__PRETTY_FUNCTION__];
}
if (_src != nil || _value != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'data' is specified, 'src', 'filename', and 'value' must be nil.",
__PRETTY_FUNCTION__];
}
}
else if (_value != nil)
{
if ([_value isValueConstant])
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'value' must not be constant.",
__PRETTY_FUNCTION__];
}
if (_src != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'value' is specified, 'data', 'filename', and 'src' must be nil.",
__PRETTY_FUNCTION__];
}
}
else if (_src == nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: One of 'filename', 'src', 'data', or 'value' must be specified.",
__PRETTY_FUNCTION__];
}
}
if (_xAssoc != nil && _yAssoc != nil)
{
if (![_xAssoc isValueSettable] || ![_yAssoc isValueSettable])
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'x' and 'y' can not be constants.",
__PRETTY_FUNCTION__];
}
}
else if (_xAssoc != nil || _yAssoc != nil)
{
[NSException raise:NSInvalidArgumentException
format:@"%s: 'action' must not be a constant.",
__PRETTY_FUNCTION__];
format:@"%s: 'x' and 'y' must both be specified or both be nil.",
__PRETTY_FUNCTION__];
}
} else {
if (_href != nil) {
if (_actionClass != nil || _directActionName != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'directActionName' or 'actionClass' is specified, 'action' and 'href' must be nil.",
__PRETTY_FUNCTION__];
}
} else {
if (_actionClass == nil && _directActionName == nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: Either a component action or a direct action or 'href' must be specified.",
__PRETTY_FUNCTION__];
}
}
}
if (_filename != nil) {
if (_src != nil || _data != nil || _value != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'filename' is specified, 'src', 'data', and 'value' must be nil.",
__PRETTY_FUNCTION__];
}
} else {
if (_framework != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'framework' should not be specified if 'filename' is nil.",
__PRETTY_FUNCTION__];
}
}
if (_data != nil) {
if (_mimeType == nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'mimeType' must be specified if 'data' is specified.",
__PRETTY_FUNCTION__];
}
if (_src != nil || _value != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'data' is specified, 'src', 'filename', and 'value' must be nil.",
__PRETTY_FUNCTION__];
}
} else
if (_value != nil) {
if ([_value isValueConstant]) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'value' must not be constant.",
__PRETTY_FUNCTION__];
}
if (_src != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: If 'value' is specified, 'data', 'filename', and 'src' must be nil.",
__PRETTY_FUNCTION__];
}
} else {
if (_src == nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: One of 'filename', 'src', 'data', or 'value' must be specified.",
__PRETTY_FUNCTION__];
}
}
if (_xAssoc != nil && _yAssoc != nil) {
if ((![_xAssoc isValueSettable]) || (![_yAssoc isValueSettable])) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'x' and 'y' can not be constants.",
__PRETTY_FUNCTION__];
}
} else {
if (_xAssoc != nil || _yAssoc != nil) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'x' and 'y' must both be specified or both be nil.",
__PRETTY_FUNCTION__];
}
}
return self;
};
@ -268,6 +296,7 @@ static NSString * static_tempQueryKey = nil;
DESTROY(_actionClass);
DESTROY(_directActionName);
DESTROY(_sessionIDQueryAssociations);
DESTROY(_border);
[super dealloc];
}
@ -493,9 +522,12 @@ static NSString * static_tempQueryKey = nil;
inContext:(GSWContext*) context
{
NSString * srcValue = nil;
id borderValue = nil;
GSWComponent * component = GSWContext_component(context);
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, @"border", @"0", NO);
borderValue=[_border valueInComponent:component];
if (borderValue != nil)
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, @"border", NSStringWithObject(borderValue), NO);
[self appendURLAttributesToResponse:response
inContext:context];

View file

@ -209,13 +209,6 @@ GSWEB_EXPORT BOOL WOStrictFlag;
-(Class)requestClass;
-(GSWRequest*)createRequestWithMethod:(NSString*)aMethod
uri:(NSString*)anURL
httpVersion:(NSString*)aVersion
headers:(NSDictionary*)headers
content:(NSData*)content
userInfo:(NSDictionary*)userInfo;
-(GSWResourceManager*)createResourceManager;
-(GSWStatisticsStore*)createStatisticsStore;

View file

@ -79,7 +79,7 @@ application unlock
@end
#define GSWFPutSL(string, file) \
do { fputs([[string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES] bytes], file); fputs("\n",file); fflush(file); } \
do { NSData* cString=[string dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSUInteger length=[cString length]; fwrite([cString bytes],1,length,file); fputs("\n",file); fflush(file); } \
while (0)
/* GSWApplication+Defaults.m */
@ -1224,7 +1224,8 @@ int GSWApplicationMain(NSString* applicationClassName,
};
//--------------------------------------------------------------------
// dw: I do not know if this exists in WO
// It's not exist in WO but enable to have custom request class
// like we can customer context and session classes
-(Class)requestClass
{
NSString* requestClassName=[self requestClassName];
@ -1233,37 +1234,6 @@ int GSWApplicationMain(NSString* applicationClassName,
return requestClass;
};
//--------------------------------------------------------------------
// dw: I do not know if this exists in WO
-(GSWRequest*)createRequestWithMethod:(NSString*)aMethod
uri:(NSString*)anURL
httpVersion:(NSString*)aVersion
headers:(NSDictionary*)headers
content:(NSData*)content
userInfo:(NSDictionary*)userInfo
{
GSWRequest* request=nil;
NSString* requestClassName=[self requestClassName];
Class requestClass=NSClassFromString(requestClassName);
NSAssert1(requestClass,@"No requestClass named '%@'",requestClassName);
if (requestClass)
{
request=[[[requestClass alloc]initWithMethod:aMethod
uri:anURL
httpVersion:aVersion
headers:headers
content:content
userInfo:userInfo]autorelease];
}
if (!request)
{
//TODO: throw cleaner exception
NSAssert(NO,@"Can't create request");
};
return request;
};
//--------------------------------------------------------------------
-(GSWResourceManager*)createResourceManager
{
@ -3827,12 +3797,12 @@ to another instance **/
- (NSString*) sessionIdKey
{
return @"wosid";
return GSWKey_SessionID[GSWebNamingConv];
}
- (NSString*) instanceIdKey
{
return @"woinst";
return GSWKey_InstanceID[GSWebNamingConv];
}

View file

@ -280,8 +280,7 @@ static Class GSWHTMLBareStringClass = Nil;
-(NSString*)baseURL
{
[self notImplemented: _cmd]; //TODOFN
return nil;
return [[self _componentDefinition] baseURL];
}

View file

@ -71,7 +71,7 @@ static GSWContext * TheTemporaryContext;
frameworkName:(NSString*)aFrameworkName
{
NSString * myBasePath = nil;
NSFileManager * defaultFileManager = nil;
//NSFileManager * defaultFileManager = nil;
[super init];
ASSIGN(_name, [aName stringByDeletingPathExtension]); // does it ever happen that
@ -98,7 +98,7 @@ static GSWContext * TheTemporaryContext;
ASSIGN(_wodPath,[myBasePath stringByAppendingPathExtension:GSWComponentDeclarationsSuffix[GSWebNamingConv]]);
ASSIGN(_wooPath,[myBasePath stringByAppendingPathExtension:GSWArchiveSuffix[GSWebNamingConv]]);
defaultFileManager = [NSFileManager defaultManager];
//defaultFileManager = [NSFileManager defaultManager];
if (_componentClass == Nil) {
[self autorelease];

View file

@ -105,6 +105,7 @@ GSWEB_EXPORT NSString* GSWClassName_DefaultRecording[2];
GSWEB_EXPORT NSString* GSWKey_InstanceID[2];
GSWEB_EXPORT NSString* GSWKey_SessionID[2];
GSWEB_EXPORT NSString* GSWKey_QuestionMarkSessionID[2];
GSWEB_EXPORT NSString* GSWKey_PageName[2];
GSWEB_EXPORT NSString* GSWKey_ContextID[2];
GSWEB_EXPORT NSString* GSWKey_ElementID[2];
@ -381,6 +382,7 @@ GSWEB_EXPORT id formValues__Key;
GSWEB_EXPORT id invokeAction__Key;
GSWEB_EXPORT id elementID__Key;
GSWEB_EXPORT id otherTagString__Key;
GSWEB_EXPORT id border__Key;
//GSWeb Additions
GSWEB_EXPORT id redirectURL__Key;

View file

@ -101,6 +101,7 @@ NSString* GSWClassName_DefaultRecording[2]={ @"GSWRecording", @"WORecording" };
NSString* GSWKey_InstanceID[2]={ @"gswinst", @"woinst" };
NSString* GSWKey_SessionID[2]={ @"gswsid", @"wosid" };
NSString* GSWKey_QuestionMarkSessionID[2]={ @"?gswsid", @"?wosid" };
NSString* GSWKey_PageName[2]={ @"gswpage", @"wopage" };
NSString* GSWKey_ContextID[2]={ @"gswcid", @"wocid" };
NSString* GSWKey_ElementID[2]={ @"gsweid", @"woeid" };
@ -378,6 +379,7 @@ id formValues__Key = @"formValues";
id invokeAction__Key = @"invokeAction";
id elementID__Key = @"elementID";
id otherTagString__Key = @"otherTagString";
id border__Key = @"border";
//GSWeb additions
id redirectURL__Key = @"redirectURL";

View file

@ -216,7 +216,7 @@ GSWEB_EXPORT BOOL GSWContext_isSenderIDSearchOver(GSWContext* aContext)
value = [self objectForKey:[GSWApp sessionIdKey]];
if (!value) {
value = [self objectForKey:@"wosid"];
value = [self objectForKey:GSWKey_SessionID[GSWebNamingConv]];
}
return value;
}

View file

@ -210,7 +210,7 @@ static Class standardClass = Nil;
value = [queryDict objectForKey:key];
GSWResponse_appendContentAsciiString(response,@"<input type=hidden");
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, name__Key, key, NO);
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, value__Key, value, NO);
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, value__Key, NSStringWithObject(value), NO);
GSWResponse_appendContentAsciiString(response,@">\n");
}

View file

@ -319,7 +319,7 @@ static inline BOOL _needQuote(NSString* str_needQuote)
name = [association valueInComponent:component];
if (name)
{
if ([@"app" caseInsensitiveCompare: name])
if ([@"app" caseInsensitiveCompare: name] == NSOrderedSame)
{
name = nil;
}
@ -470,49 +470,70 @@ static inline BOOL _needQuote(NSString* str_needQuote)
{
GSWComponent * component = GSWContext_component(context);
GSWSession * session = [context _session];
NSString * s = nil;
NSMutableDictionary *nsmutabledictionary = nil;
NSEnumerator * keyEnumerator = nil;
NSString * key = nil;
GSWAssociation *otherAssociations = nil;
id otherValue = nil;
NSString * sessionID = nil;
NSMutableDictionary *newQueryDictionary = nil;
if (queryDictionary != nil) {
NSDictionary * nsdictionary1 = [queryDictionary valueInComponent:component];
if ([nsdictionary1 isKindOfClass:NSMutableDictionaryClass]) {
nsmutabledictionary = (NSMutableDictionary*) nsdictionary1;
} else {
nsmutabledictionary = (NSMutableDictionary*) AUTORELEASE([nsdictionary1 mutableCopyWithZone:[self zone]]);
}
}
if (nsmutabledictionary == nil) {
nsmutabledictionary = [NSMutableDictionary dictionary];
}
if (session != nil) {
s = [session sessionID];
} else {
if ([context request] != nil) {
s = [[context request] stringFormValueForKey:@"wosid"];
}
}
if ((s != nil) && ((directActionName != nil) || (actionClass != nil)) && ((session == nil) || (![session storesIDsInCookies]) || ([session storesIDsInURLs]))) {
[nsmutabledictionary setObject:s forKey:@"wosid"];
}
if (otherQueryAssociations != nil) {
keyEnumerator = [otherQueryAssociations keyEnumerator];
while ((key = [keyEnumerator nextObject])) {
otherAssociations = [otherQueryAssociations objectForKey:key];
otherValue = [otherAssociations valueInComponent:component];
if (otherValue != nil && ([key isEqual:@"wosid"] || ([otherValue boolValue] == YES))) {
[nsmutabledictionary setObject: otherValue forKey:key];
} else {
[nsmutabledictionary removeObjectForKey:key];
}
if (queryDictionary != nil)
{
NSDictionary * nsdictionary1 = [queryDictionary valueInComponent:component];
if ([nsdictionary1 isKindOfClass:NSMutableDictionaryClass])
newQueryDictionary = (NSMutableDictionary*) nsdictionary1;
else
newQueryDictionary = (NSMutableDictionary*) AUTORELEASE([nsdictionary1 mutableCopyWithZone:[self zone]]);
}
}
return nsmutabledictionary;
if (newQueryDictionary == nil)
newQueryDictionary = [NSMutableDictionary dictionary];
if (session != nil)
sessionID = [session sessionID];
else
{
if ([context request] != nil)
sessionID = [[context request] stringFormValueForKey:GSWKey_SessionID[GSWebNamingConv]];
}
if (sessionID != nil
&& (directActionName != nil || actionClass != nil)
&& (session == nil || ![session storesIDsInCookies] || [session storesIDsInURLs]))
{
[newQueryDictionary setObject:sessionID
forKey:GSWKey_SessionID[GSWebNamingConv]];
}
if (otherQueryAssociations != nil)
{
GSWAssociation *otherAssociations = nil;
NSString * key = nil;
id otherValue = nil;
NSEnumerator* keyEnumerator = [otherQueryAssociations keyEnumerator];
while ((key = [keyEnumerator nextObject]))
{
otherAssociations = [otherQueryAssociations objectForKey:key];
otherValue = [otherAssociations valueInComponent:component];
if (otherValue != nil)
{
if ([key isEqual:GSWKey_SessionID[GSWebNamingConv]]
|| [key isEqual:[GSWApp sessionIdKey]])
{
if ([otherValue isKindOfClass:[NSNumber class]]
&& [otherValue boolValue] == NO)
[newQueryDictionary removeObjectForKey:key];
}
else
{
[newQueryDictionary setObject: otherValue
forKey:key];
}
}
else
{
[newQueryDictionary removeObjectForKey:key];
}
}
}
return newQueryDictionary;
}
-(void) appendConstantAttributesToResponse:(GSWResponse*) response
@ -529,38 +550,37 @@ static inline BOOL _needQuote(NSString* str_needQuote)
associations:(NSDictionary*) associations
{
if ((associations != nil) && ([associations count] > 0)) {
NSString * s1 = nil;
NSEnumerator * enumer = [associations keyEnumerator];
GSWComponent * component = GSWContext_component(context);
NSString * key = nil;
GSWAssociation * currentAssociation = nil;
id obj = nil;
if (associations != nil
&& [associations count] > 0)
{
NSString * s1 = nil;
NSEnumerator * enumer = [associations keyEnumerator];
GSWComponent * component = GSWContext_component(context);
NSString * key = nil;
GSWAssociation * currentAssociation = nil;
id obj = nil;
while ((key = [enumer nextObject])) {
currentAssociation = [associations objectForKey:key];
obj = [currentAssociation valueInComponent:component];
if (obj != nil) {
// s1 = [(NSNumber*) obj description];
// mr. ayers says that is not good..
if ([obj isKindOfClass:NSNumberClass] == YES) {
s1 = [(NSNumber*) obj stringValue];
} else {
// we have to set the value!
s1 = obj;
}
//NSLog(@"%s:class %@ '%@'", __PRETTY_FUNCTION__, [obj class] , obj);
if ([key isEqual:@"otherTagString"]) {
GSWResponse_appendContentCharacter(response,' ');
GSWResponse_appendContentString(response, s1);
} else {
[response _appendTagAttribute: key
value: s1
escapingHTMLAttributeValue: NO];
}
}
} // while
}
while ((key = [enumer nextObject]))
{
currentAssociation = [associations objectForKey:key];
obj = [currentAssociation valueInComponent:component];
if (obj != nil)
{
s1=NSStringWithObject(obj);
if ([key isEqual:@"otherTagString"])
{
GSWResponse_appendContentCharacter(response,' ');
GSWResponse_appendContentString(response, s1);
}
else
{
[response _appendTagAttribute: key
value: s1
escapingHTMLAttributeValue: NO];
}
}
}
}
}
-(void) appendNonURLAttributesToResponse:(GSWResponse*) response

View file

@ -232,15 +232,11 @@ An exception is raised if the end quote is not found,...
index:(int*)indexPtr
stopIndex:(int)stopIndex
{
int startIndex=0;
NSAssert2(_uniBuf[*indexPtr]==quote,@"First character is not a '%c' but a '%c'",
(char)quote,(char)_uniBuf[*indexPtr]);
(*indexPtr)++; //skip quote
startIndex=*indexPtr;
while(*indexPtr<=stopIndex
&& _uniBuf[*indexPtr]!=quote)
{
@ -557,7 +553,6 @@ May raise exception.
}
else
{
NSString* tagPropertiesString=nil;
NSDictionary* tagProperties;
if (_uniBuf[_index-1]=='/')
@ -565,9 +560,6 @@ May raise exception.
stopTag=YES;
tagPropertiesStopIndex--;
};
tagPropertiesString=[NSString stringWithCharacters:_uniBuf+tagPropertiesStartIndex
length:tagPropertiesStopIndex-tagPropertiesStartIndex];
tagProperties=[self tagPropertiesForType:tagType
betweenIndex:tagPropertiesStartIndex
andIndex:tagPropertiesStopIndex-1];

View file

@ -40,6 +40,7 @@
#include "GSWMessage.h"
#include "GSWResponse.h"
#include "GSWRequest.h"
#include "GSWApplication.h"
#include <netinet/in.h>
#include <arpa/inet.h>
@ -212,7 +213,7 @@ void _appendMessageHeaders(GSWResponse * message,NSMutableString * headers)
void _sendMessage(GSWResponse * message, NSFileHandle* fh, NSString * httpVersion, GSWRequest * request, NSMutableString * headers)
{
int contentLength = 0;
BOOL keepAlive = NO;
//BOOL keepAlive = NO;
BOOL requestIsHead = NO;
if (message) {
@ -222,7 +223,7 @@ void _sendMessage(GSWResponse * message, NSFileHandle* fh, NSString * httpVersio
if (request) {
NSString * connectionValue = [request headerForKey:CONNECTION];
if (connectionValue) {
keepAlive = [connectionValue isEqualToString:KEEP_ALIVE];
//keepAlive = [connectionValue isEqualToString:KEEP_ALIVE];
}
requestIsHead = [[request method] isEqualToString:HEAD];
}
@ -406,12 +407,13 @@ void _sendMessage(GSWResponse * message, NSFileHandle* fh, NSString * httpVersio
length: contentLength];
}
request = [[GSWRequest alloc] initWithMethod:method
uri:[requestArray objectAtIndex:1]
httpVersion:[requestArray objectAtIndex:2]
headers:headers
content:contentData
userInfo:nil];
request = [[[[GSWApplication application]requestClass]
alloc] initWithMethod:method
uri:[requestArray objectAtIndex:1]
httpVersion:[requestArray objectAtIndex:2]
headers:headers
content:contentData
userInfo:nil];
if (request != nil)
{

View file

@ -114,7 +114,8 @@ RCS_ID("$Id$")
resourcemanager = [GSWApp resourceManager];
component = GSWContext_component(context);
fileNameValue = [filename valueInComponent:component];
frameworkName = [framework valueInComponent:component];
frameworkName = [GSWHTMLDynamicElement _frameworkNameForAssociation:framework
inComponent:component];
resourceURL = [context _urlForResourceNamed: fileNameValue
inFramework: frameworkName];

View file

@ -825,7 +825,7 @@ static __inline__ NSMutableData *_checkBody(GSWMessage *self) {
[NSException raise:NSInvalidArgumentException
format:@"%s: could not convert '%s' non-lossy to encoding %"PRIuPTR,
__PRETTY_FUNCTION__, [lossyData bytes], _contentEncoding];
__PRETTY_FUNCTION__, [lossyData bytes], (NSUInteger)_contentEncoding];
}
_checkBody(self);

View file

@ -76,12 +76,6 @@ static Class standardClass = Nil;
return nil;
}
if ((_value != nil) && (![_value isValueSettable])) {
[NSException raise:NSInvalidArgumentException
format:@"%s: 'value' attribute is a constant",
__PRETTY_FUNCTION__];
}
ASSIGN(_selection, [_associations objectForKey: selection__Key]);
if (_selection != nil) {

View file

@ -319,9 +319,9 @@ RCS_ID("$Id$")
//--------------------------------------------------------------------
// uri
-(WODynamicURLString *)uri
-(GSWDynamicURLString *)uri
{
return (WODynamicURLString *)_uri;
return (GSWDynamicURLString *)_uri;
};
//--------------------------------------------------------------------
@ -617,8 +617,8 @@ RCS_ID("$Id$")
_headers,
_contentData,
_userInfo,
_defaultFormValueEncoding,
_formValueEncoding,
(NSUInteger)_defaultFormValueEncoding,
(NSUInteger)_formValueEncoding,
_formValues,
_uriElements,
_cookie,

View file

@ -45,7 +45,7 @@
};
-(id)initWithName:(NSString*)name
associations:(NSMutableDictionary*)associations
associations:(NSDictionary*)associations
template:(GSWElement*)template;
-(void)appendToResponse:(GSWResponse*)response

View file

@ -50,7 +50,7 @@ static Class standardClass = Nil;
//--------------------------------------------------------------------
-(id)initWithName:(NSString*)aName
associations:(NSMutableDictionary*)associations
associations:(NSDictionary*)associations
template:(GSWElement*)template
{
self = [super initWithName:nil associations:nil template:nil];

View file

@ -1968,11 +1968,11 @@ NSString* GSWGetDefaultDocRoot()
tmpString = [tmpString initWithData:tmpData
encoding:encoding];
if (!tmpString) {
NSLog(@"%s NO STRING for path '%@' encoding:%"PRIuPTR, __PRETTY_FUNCTION__, path, encoding);
NSLog(@"%s NO STRING for path '%@' encoding:%"PRIuPTR, __PRETTY_FUNCTION__, path, (NSUInteger)encoding);
[NSException raise:NSInvalidArgumentException
format:@"%s: could not open convert file contents '%@' non-lossy to encoding %"PRIuPTR,
__PRETTY_FUNCTION__, path, encoding];
__PRETTY_FUNCTION__, path, (NSUInteger)encoding];
}
AUTORELEASE(tmpString);

3
README
View file

@ -61,6 +61,9 @@ Special Thanks
* Catherine Biscourp <cbiscourp@sbuilders.com> for the
GNUstepWeb logos and some other things...
* Manuel Guesdon <mguesdon@orange-concept.com
Original developer
* David Wetzel <dave@turbocat.de> from Turbocat's Development
* David Ayers <d.ayers@inode.at>

View file

@ -32,11 +32,13 @@ GSWDEBUG_DEEP=no
#Debug elmentIDs logs and asserts
GSWDEBUG_ELEMENTSIDS=no
# use WO Names. Others are depricated. -- dw
gswnames=wo
gswnames=@GSWNAMES@
# Default (generated by configure)
ifeq ($(gswnames),)
gswnames=@GSWNAMES@
# use WO Names if none specified
gswnames=wo
endif
EOCONTROL_LIBRARY_NAME=EOControl
EOACCESS_LIBRARY_NAME=EOAccess