2002-03-06 23:13:23 +00:00
|
|
|
/** GSWComponent.m - <title>GSWeb: Class GSWComponent</title>
|
2002-05-14 11:28:50 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
2000-01-22 12:49:49 +00:00
|
|
|
Date: Jan 1999
|
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-03-06 23:13:23 +00:00
|
|
|
<abstract></abstract>
|
|
|
|
|
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-03-06 23:13:23 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
static char rcsId[] = "$Id$";
|
|
|
|
|
2000-10-30 15:36:50 +00:00
|
|
|
#include <GSWeb/GSWeb.h>
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// init
|
|
|
|
|
|
|
|
-(id)init
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
|
|
|
if ((self=[super init]))
|
2002-05-14 11:28:50 +00:00
|
|
|
{
|
|
|
|
NSMutableDictionary* currentThreadDictionary=GSCurrentThreadDictionary();
|
|
|
|
GSWContext* aContext=[currentThreadDictionary objectForKey:GSWThreadKey_Context];
|
|
|
|
GSWComponentDefinition* aComponentDefinition=[currentThreadDictionary objectForKey:GSWThreadKey_ComponentDefinition];
|
|
|
|
NSAssert(aContext,@"No Context in GSWComponent Init");
|
|
|
|
NSAssert(aComponentDefinition,@"No ComponentDefinition in GSWComponent Init");
|
|
|
|
ASSIGN(_componentDefinition,aComponentDefinition);
|
|
|
|
_name=[[NSString stringWithCString:object_get_class_name(self)]retain];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_name=%@",_name);
|
2002-05-14 11:28:50 +00:00
|
|
|
_isCachingEnabled=YES;
|
|
|
|
[self _setContext:aContext];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_context=%@",_context);
|
2002-05-14 11:28:50 +00:00
|
|
|
_templateName=[[self _templateNameFromClass:[self class]] retain];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_templateName=%@",_templateName);
|
2002-05-14 11:28:50 +00:00
|
|
|
[self setCachingEnabled:[GSWApp isCachingEnabled]];
|
|
|
|
[_componentDefinition _finishInitializingComponent:self];
|
|
|
|
_isSynchronized=[self synchronizesVariablesWithBindings];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_isSynchronized=%s",(_isSynchronized ? "YES" : "NO"));
|
2002-05-14 11:28:50 +00:00
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
2000-03-20 15:50:51 +00:00
|
|
|
GSWLogAssertGood(self);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent");
|
|
|
|
GSWLogC("Dealloc GSWComponent: name");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_name);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: subComponents");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_subComponents);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: templateName");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_templateName);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: template");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_template);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: componentDefinition");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_componentDefinition);
|
|
|
|
_parent=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: associationsKeys");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_associationsKeys);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: associations");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_associations);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: childTemplate");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_childTemplate);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: userDictionary");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_userDictionary);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: userAssociations");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_userAssociations);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: defaultAssociations");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_defaultAssociations);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: validationFailureMessages");
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_validationFailureMessages);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: context (set to nil)");
|
2002-05-14 11:28:50 +00:00
|
|
|
_context=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent: session (set to nil)");
|
2002-05-14 11:28:50 +00:00
|
|
|
_session=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponent Super");
|
|
|
|
[super dealloc];
|
|
|
|
GSWLogC("End Dealloc GSWComponent");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(id)copyWithZone: (NSZone*)zone
|
|
|
|
{
|
|
|
|
GSWComponent* clone = [[isa allocWithZone: zone] init];
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGNCOPY(clone->_name,_name);
|
|
|
|
ASSIGNCOPY(clone->_subComponents,_subComponents);
|
|
|
|
ASSIGNCOPY(clone->_templateName,_templateName);
|
|
|
|
ASSIGN(clone->_template,_template);
|
|
|
|
ASSIGN(clone->_componentDefinition,_componentDefinition);
|
|
|
|
ASSIGN(clone->_parent,_parent);
|
|
|
|
ASSIGNCOPY(clone->_associationsKeys,_associationsKeys);
|
|
|
|
ASSIGNCOPY(clone->_associations,_associations);
|
|
|
|
ASSIGNCOPY(clone->_childTemplate,_childTemplate);
|
|
|
|
ASSIGNCOPY(clone->_context,_context);
|
|
|
|
ASSIGNCOPY(clone->_session,_session);
|
|
|
|
clone->_isPage=_isPage;
|
|
|
|
clone->_isCachingEnabled=_isCachingEnabled;
|
|
|
|
clone->_isSynchronized=_isSynchronized;
|
2000-01-22 12:49:49 +00:00
|
|
|
return clone;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)encodeWithCoder:(NSCoder*)aCoder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//TODOV
|
2002-05-14 11:28:50 +00:00
|
|
|
[super encodeWithCoder:aCoder];
|
|
|
|
[aCoder encodeObject:_name];
|
|
|
|
[aCoder encodeObject:_subComponents];
|
|
|
|
[aCoder encodeObject:_templateName];
|
|
|
|
[aCoder encodeObject:_template];
|
|
|
|
[aCoder encodeObject:_componentDefinition];
|
|
|
|
[aCoder encodeObject:_parent];
|
|
|
|
[aCoder encodeObject:_associationsKeys];
|
|
|
|
[aCoder encodeObject:_associations];
|
|
|
|
[aCoder encodeObject:_childTemplate];
|
|
|
|
[aCoder encodeObject:_context];
|
|
|
|
[aCoder encodeObject:_session];
|
|
|
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isPage];
|
|
|
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isCachingEnabled];
|
|
|
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isSynchronized];
|
2000-01-22 12:49:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(id)initWithCoder:(NSCoder*)aCoder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//TODOV
|
2002-05-14 11:28:50 +00:00
|
|
|
if ((self = [super initWithCoder:aCoder]))
|
|
|
|
{
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_name];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_subComponents];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_templateName];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_template];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_componentDefinition];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_parent];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_associationsKeys];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_associations];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_childTemplate];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_context];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_session];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isPage];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isCachingEnabled];
|
|
|
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isSynchronized];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// frameworkName
|
|
|
|
|
|
|
|
-(NSString*)frameworkName
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* aFrameworkName=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
aFrameworkName=[aComponentDefinition frameworkName];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aFrameworkName=%@",aFrameworkName);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return aFrameworkName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// logWithFormat:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)logWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// logWithFormat:arguments:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)logWithFormat:(NSString*)format
|
|
|
|
arguments:(va_list)arguments
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// name
|
|
|
|
|
|
|
|
-(NSString*)name
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _name;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// path
|
|
|
|
|
|
|
|
-(NSString*)path
|
|
|
|
{
|
|
|
|
//TODOV
|
|
|
|
NSBundle* bundle=[NSBundle mainBundle];
|
2002-05-14 11:28:50 +00:00
|
|
|
return [bundle pathForResource:_name
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
ofType:GSWPageSuffix[GSWebNamingConv]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// baseURL
|
|
|
|
|
|
|
|
-(NSString*)baseURL
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)_templateNameFromClass:(Class)aClass
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* aTemplateName=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
aTemplateName=[NSString stringWithCString:[aClass name]];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return aTemplateName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)description
|
|
|
|
{
|
|
|
|
//TODO
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* dscr=nil;
|
2000-03-20 15:50:51 +00:00
|
|
|
GSWLogAssertGood(self);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"GSWComponent description self=%p",self);
|
2002-05-14 11:28:50 +00:00
|
|
|
dscr=[NSString stringWithFormat:@"<%s %p>",
|
2000-01-22 12:49:49 +00:00
|
|
|
object_get_class_name(self),
|
|
|
|
(void*)self];
|
2002-05-14 11:28:50 +00:00
|
|
|
return dscr;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
// GSWeb Additions {
|
2000-01-22 12:49:49 +00:00
|
|
|
-(NSDictionary*)userDictionary
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _userDictionary;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setUserDictionary:(NSDictionary*)aUserDictionary
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGN(_userDictionary,aUserDictionary);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"userDictionary:%@",_userDictionary);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
-(NSDictionary*)userAssociations
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _userAssociations;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setUserAssociations:(NSDictionary*)userAssociations
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGN(_userAssociations,userAssociations);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"userAssociations:%@",_userAssociations);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
-(NSDictionary*)defaultAssociations
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _defaultAssociations;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setDefaultAssociations:(NSDictionary*)defaultAssociations
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGN(_defaultAssociations,defaultAssociations);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defaultAssociations:%@",_defaultAssociations);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
// }
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWCachingPolicy)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//setCachingEnabled:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setCachingEnabled:(BOOL)caching
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
_isCachingEnabled=caching;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//isCachingEnabled
|
|
|
|
|
|
|
|
-(BOOL)isCachingEnabled
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
return _isCachingEnabled;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentA)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setParent:(GSWComponent*)parent
|
|
|
|
associationsKeys:(NSArray*)associationsKeys
|
|
|
|
associations:(NSArray*)associations
|
|
|
|
template:(GSWElement*)template
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
_parent=parent;
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"name=%@ parent=%p (%@)",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
|
|
|
(void*)parent,[parent class]);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"associations=%@",_associations);
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGN(_associations,associations);
|
|
|
|
ASSIGN(_associationsKeys,associationsKeys);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"associationsKeys=%@",_associationsKeys);
|
2002-05-14 11:28:50 +00:00
|
|
|
ASSIGN(_childTemplate,template);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"template=%@",_childTemplate);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self validateAPIAssociations];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)synchronizeComponentToParent
|
|
|
|
{
|
|
|
|
//OK
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
|
|
|
if (_isSynchronized)
|
|
|
|
{
|
|
|
|
int i=0;
|
|
|
|
id aKey=nil;
|
|
|
|
GSWAssociation* anAssociation=nil;
|
|
|
|
id aValue=nil;
|
|
|
|
id logValue=[self valueForBinding:@"GSWDebug"];
|
|
|
|
BOOL doLog=boolValueWithDefaultFor(logValue,NO);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - Synchro SubComponent->Component",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self definitionName]);
|
|
|
|
for(i=0;i<[_associationsKeys count];i++)
|
|
|
|
{
|
|
|
|
aKey=[_associationsKeys objectAtIndex:i];
|
|
|
|
anAssociation=[_associations objectAtIndex:i];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
2002-05-14 11:28:50 +00:00
|
|
|
if ([anAssociation isValueSettable]
|
|
|
|
&& ![anAssociation isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
|
|
|
{
|
|
|
|
//MGNEW aValue=[self getIVarNamed:aKey];
|
|
|
|
aValue=[self valueForKey:aKey];//MGNEW
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (doLog)
|
|
|
|
[anAssociation logSynchronizeComponentToParentForValue:aValue
|
|
|
|
inComponent:_parent];
|
|
|
|
[anAssociation setValue:aValue
|
|
|
|
inComponent:_parent];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)synchronizeParentToComponent
|
|
|
|
{
|
|
|
|
//OK
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
|
|
|
if (_isSynchronized)
|
|
|
|
{
|
|
|
|
//Synchro Component->SubComponent
|
|
|
|
int i=0;
|
|
|
|
id aKey=nil;
|
|
|
|
GSWAssociation* anAssociation=nil;
|
|
|
|
id aValue=nil;
|
|
|
|
id logValue=[self valueForBinding:@"GSWDebug"];
|
|
|
|
BOOL doLog=boolValueWithDefaultFor(logValue,NO);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"Name=%@ - Synchro Component->SubComponent",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self definitionName]);
|
|
|
|
for(i=0;i<[_associationsKeys count];i++)
|
|
|
|
{
|
|
|
|
aKey=[_associationsKeys objectAtIndex:i];
|
|
|
|
anAssociation=[_associations objectAtIndex:i];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aKey=%@ anAssociation=%@",aKey,anAssociation);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (![anAssociation isKindOfClass:[GSWBindingNameAssociation class]]) //TODOV
|
|
|
|
{
|
|
|
|
aValue=[anAssociation valueInComponent:_parent];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (doLog)
|
|
|
|
[anAssociation logSynchronizeParentToComponentForValue:aValue
|
|
|
|
inComponent:self];
|
|
|
|
/*//MGNEW [self setIVarNamed:aKey
|
|
|
|
withValue:aValue];*/
|
2002-06-03 08:27:15 +00:00
|
|
|
#if GDL2 // GDL2 implementation
|
|
|
|
[self smartTakeValue:aValue
|
|
|
|
forKey:aKey];
|
|
|
|
#else
|
2002-05-14 11:28:50 +00:00
|
|
|
[self takeValue:aValue
|
|
|
|
forKey:aKey];
|
2002-06-03 08:27:15 +00:00
|
|
|
#endif
|
2002-05-14 11:28:50 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWElement*)_childTemplate
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
return _childTemplate;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWElement*)_template
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElement* template=_template;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
if (!template)
|
|
|
|
{
|
|
|
|
template=[self templateWithName:[self _templateName]];
|
|
|
|
if ([self isCachingEnabled])
|
|
|
|
{
|
|
|
|
ASSIGN(_template,template);
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return template;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWComponentDefinition*)_componentDefinition
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
if (_componentDefinition)
|
|
|
|
aComponentDefinition=_componentDefinition;
|
2000-01-22 12:49:49 +00:00
|
|
|
else
|
2002-05-14 11:28:50 +00:00
|
|
|
{
|
|
|
|
NSArray* languages=[self languages];
|
|
|
|
aComponentDefinition=[GSWApp componentDefinitionWithName:_name
|
|
|
|
languages:languages];
|
|
|
|
if ([self isCachingEnabled])
|
|
|
|
{
|
|
|
|
ASSIGN(_componentDefinition,aComponentDefinition);
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return aComponentDefinition;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)_templateName
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _templateName;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)definitionName
|
|
|
|
{
|
|
|
|
return [self _templateName];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)_isPage
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
return _isPage;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)_setIsPage:(BOOL)isPage
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
_isPage=isPage;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)_setContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aContext=%p",(void*)aContext);
|
2002-05-14 11:28:50 +00:00
|
|
|
_context=aContext;//NO retain !
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWResourceManagement)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// templateWithName:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWElement*)templateWithName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElement* template=nil;
|
|
|
|
NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
template=[aComponentDefinition templateWithName:aName
|
|
|
|
languages:languages];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"template=%@",template);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return template;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentC)
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWComponent*)subComponentForElementID:(NSString*)elementId
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponent* subc=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_elementId=%@",elementId);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"subComponents=%@",_subComponents);
|
2002-05-14 11:28:50 +00:00
|
|
|
subc=[_subComponents objectForKey:elementId];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"subc=%@",subc);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"subComponent %@ for _elementId=%@",[subc class],elementId);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return subc;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setSubComponent:(GSWComponent*)component
|
|
|
|
forElementID:(NSString*)elementId
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"setSubComponent %@ for _elementId=%@",[component class],elementId);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"elementId=%@",elementId);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"component=%@",component);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (!_subComponents)
|
|
|
|
_subComponents=[NSMutableDictionary new];
|
|
|
|
[_subComponents setObject:component
|
|
|
|
forKey:elementId];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeParentsPerformSelectorIfPossible:(SEL)aSelector
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* parents=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
parents=[self parents];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
2002-05-14 11:28:50 +00:00
|
|
|
[parents makeObjectsPerformSelectorIfPossible:aSelector];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeParentsPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* parents=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
parents=[self parents];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
2002-05-14 11:28:50 +00:00
|
|
|
[parents makeObjectsPerformSelectorIfPossible:aSelector
|
|
|
|
withObject:object];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeParentsPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object1
|
|
|
|
withObject:(id)object2
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* parents=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
parents=[self parents];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"parents=%@",parents);
|
2002-05-14 11:28:50 +00:00
|
|
|
[parents makeObjectsPerformSelectorIfPossible:aSelector
|
|
|
|
withObject:object1
|
|
|
|
withObject:object2];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(id)makeAParentPerformSelectorIfPossible:(SEL)aSelector
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
id retValue=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
id obj=[self parent];
|
|
|
|
LOGObjectFnStart();
|
|
|
|
while(obj)
|
|
|
|
{
|
|
|
|
if ([obj respondsToSelector:aSelector])
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
retValue=[obj performSelector:aSelector];
|
2000-01-22 12:49:49 +00:00
|
|
|
obj=nil;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
obj=[obj parent];
|
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return retValue;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(id)makeAParentPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
id retValue=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
id obj=[self parent];
|
|
|
|
LOGObjectFnStart();
|
|
|
|
while(obj)
|
|
|
|
{
|
|
|
|
if ([obj respondsToSelector:aSelector])
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
retValue=[obj performSelector:aSelector
|
|
|
|
withObject:object];
|
2000-01-22 12:49:49 +00:00
|
|
|
obj=nil;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
obj=[obj parent];
|
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return retValue;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(id)makeAParentPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object1
|
|
|
|
withObject:(id)object2
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
id retValue=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
id obj=[self parent];
|
|
|
|
LOGObjectFnStart();
|
|
|
|
while(obj)
|
|
|
|
{
|
|
|
|
if ([obj respondsToSelector:aSelector])
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
retValue=[obj performSelector:aSelector
|
|
|
|
withObject:object1
|
|
|
|
withObject:object2];
|
2000-01-22 12:49:49 +00:00
|
|
|
obj=nil;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
obj=[obj parent];
|
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return retValue;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeSubComponentsPerformSelectorIfPossible:(SEL)aSelector
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSEnumerator* enumerator=nil;
|
|
|
|
id component=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
2002-05-14 11:28:50 +00:00
|
|
|
enumerator= [_subComponents objectEnumerator];
|
|
|
|
while ((component=[enumerator nextObject]))
|
|
|
|
{
|
|
|
|
[component performSelectorIfPossible:aSelector];
|
|
|
|
[component makeSubComponentsPerformSelectorIfPossible:aSelector];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeSubComponentsPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSEnumerator* enumerator=nil;
|
|
|
|
id component=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
2002-05-14 11:28:50 +00:00
|
|
|
enumerator= [_subComponents objectEnumerator];
|
|
|
|
while ((component=[enumerator nextObject]))
|
|
|
|
{
|
|
|
|
[component performSelectorIfPossible:aSelector
|
|
|
|
withObject:object];
|
|
|
|
[component makeSubComponentsPerformSelectorIfPossible:aSelector
|
|
|
|
withObject:object];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(void)makeSubComponentsPerformSelectorIfPossible:(SEL)aSelector
|
2002-05-14 11:28:50 +00:00
|
|
|
withObject:(id)object1
|
|
|
|
withObject:(id)object2
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSEnumerator* enumerator=nil;
|
|
|
|
id component=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_subComponents=%@",_subComponents);
|
2002-05-14 11:28:50 +00:00
|
|
|
enumerator= [_subComponents objectEnumerator];
|
|
|
|
while ((component=[enumerator nextObject]))
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
[component performSelectorIfPossible:aSelector
|
|
|
|
withObject:object1
|
|
|
|
withObject:object2];
|
|
|
|
[component makeSubComponentsPerformSelectorIfPossible:aSelector
|
|
|
|
withObject:object1
|
|
|
|
withObject:object2];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentD)
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWAssociation*)_associationWithName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWAssociation* assoc=nil;
|
|
|
|
unsigned int index=NSNotFound;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"_associationsKeys=%@",_associationsKeys);
|
|
|
|
//NSDebugMLLog(@"GSWComponent",@"_associations=%@",[_associations description]);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (_associationsKeys)
|
|
|
|
{
|
|
|
|
index=[_associationsKeys indexOfObject:aName];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"index=%u",index);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (index!=NSNotFound)
|
|
|
|
assoc=[_associations objectAtIndex:index];
|
|
|
|
};
|
|
|
|
if (!WOStrictFlag && index==NSNotFound)
|
|
|
|
{
|
|
|
|
assoc=[_defaultAssociations objectForKey:aName];
|
|
|
|
};
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return assoc;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWSynchronizing)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(BOOL)hasBinding:(NSString*)parentBindingName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
BOOL hasBinding=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - parentBindingName_=%@",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
2002-05-14 11:28:50 +00:00
|
|
|
parentBindingName);
|
|
|
|
if (_associationsKeys)
|
|
|
|
{
|
|
|
|
int index=[_associationsKeys indexOfObject:parentBindingName];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"index=%u",index);
|
2002-05-14 11:28:50 +00:00
|
|
|
hasBinding=(index!=NSNotFound);
|
|
|
|
};
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - hasBinding=%s",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
2002-05-14 11:28:50 +00:00
|
|
|
(hasBinding ? "YES" : "NO"));
|
|
|
|
if (!WOStrictFlag && !hasBinding)
|
|
|
|
{
|
|
|
|
hasBinding=([_defaultAssociations objectForKey:parentBindingName]!=nil);
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return hasBinding;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)setValue:(id)value
|
|
|
|
forBinding:(NSString*)parentBindingName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWAssociation* assoc=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - parentBindingName_=%@",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
2002-05-14 11:28:50 +00:00
|
|
|
parentBindingName);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"value_=%@",value);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"_parent=%p",(void*)_parent);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (_parent)
|
|
|
|
{
|
|
|
|
assoc=[self _associationWithName:parentBindingName];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
2002-05-14 11:28:50 +00:00
|
|
|
if(assoc)
|
|
|
|
[assoc setValue:value
|
|
|
|
inComponent:_parent];
|
|
|
|
/* // Why doing this ? Be carefull: it may make a loop !
|
2000-07-27 21:53:39 +00:00
|
|
|
#if GDL2
|
|
|
|
else
|
2002-05-14 11:28:50 +00:00
|
|
|
{
|
|
|
|
NS_DURING
|
2002-01-26 10:43:23 +00:00
|
|
|
{
|
2002-06-03 08:27:15 +00:00
|
|
|
[self smartTakeValue:value_
|
2002-01-26 10:43:23 +00:00
|
|
|
forKey:parentBindingName_];
|
|
|
|
}
|
2000-07-27 21:53:39 +00:00
|
|
|
NS_HANDLER;
|
2002-01-26 10:43:23 +00:00
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
}
|
2000-07-27 21:53:39 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
}
|
|
|
|
#endif
|
2002-01-26 10:43:23 +00:00
|
|
|
*/
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(id)valueForBinding:(NSString*)parentBindingName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
id aValue=nil;
|
|
|
|
GSWAssociation* assoc=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName]);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"parentBindingName=%@",
|
2002-05-14 11:28:50 +00:00
|
|
|
parentBindingName);
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"parent=%p of class %@",(void*)_parent,[_parent class]);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (_parent)
|
|
|
|
{
|
|
|
|
assoc=[self _associationWithName:parentBindingName];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"assoc=%@",assoc);
|
2002-05-14 11:28:50 +00:00
|
|
|
if(assoc)
|
|
|
|
aValue=[assoc valueInComponent:_parent];
|
2002-01-26 10:43:23 +00:00
|
|
|
/* // Why doing this ? Be carefull: it may make a loop !
|
2000-07-27 21:53:39 +00:00
|
|
|
#if GDL2
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NS_DURING
|
2002-01-26 10:43:23 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
aValue = [self valueForKey:parentBindingName_];
|
2002-01-26 10:43:23 +00:00
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
}
|
2000-07-27 21:53:39 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
}
|
|
|
|
#endif
|
2002-01-26 10:43:23 +00:00
|
|
|
*/
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aValue=%@",aValue);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return aValue;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)synchronizesVariablesWithBindings
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSDictionary* userDictionary=nil;
|
|
|
|
id synchronizesVariablesWithBindingsValue=nil;
|
|
|
|
BOOL synchronizesVariablesWithBindings=YES;
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
userDictionary=[self userDictionary];
|
|
|
|
synchronizesVariablesWithBindingsValue=[userDictionary objectForKey:@"synchronizesVariablesWithBindings"];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
2002-05-14 11:28:50 +00:00
|
|
|
synchronizesVariablesWithBindingsValue);
|
2000-01-22 12:49:49 +00:00
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
if (synchronizesVariablesWithBindingsValue)
|
|
|
|
{
|
|
|
|
synchronizesVariablesWithBindings=[synchronizesVariablesWithBindingsValue boolValue];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"userDictionary synchronizesVariablesWithBindings=%s",
|
2002-05-14 11:28:50 +00:00
|
|
|
(synchronizesVariablesWithBindings ? "YES" : "NO"));
|
|
|
|
};
|
2002-03-06 23:13:23 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return synchronizesVariablesWithBindings;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(NSDictionary*)bindingAssociations
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [NSDictionary dictionaryWithObjects:_associations
|
|
|
|
forKeys:_associationsKeys];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWRequestHandling)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// sleep
|
|
|
|
|
|
|
|
-(void)sleep
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
//Does Nothing
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)sleepInContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
[aComponentDefinition sleep];
|
|
|
|
[self sleep];
|
|
|
|
[self _setContext:nil];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - subComponents=%@",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self definitionName],
|
|
|
|
_subComponents);
|
|
|
|
[_subComponents makeObjectsPerformSelector:@selector(sleepInContext:)
|
|
|
|
withObject:aContext];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,@"In sleepInContext:");
|
|
|
|
LOGException(@"%@ (%@)",localException,[localException reason]);
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// appendToResponse:inContext:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElement* template=nil;
|
|
|
|
GSWRequest* request=nil;
|
|
|
|
BOOL isFromClientComponent=NO;
|
|
|
|
GSWComponent* component=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElementIDString* debugElementID=[aContext elementID];
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
|
|
|
LOGObjectFnStart();
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStartElement(aContext);
|
|
|
|
GSWSaveAppendToResponseElementID(aContext);
|
2001-10-28 10:29:17 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
template=[self _template];
|
2002-05-16 18:01:40 +00:00
|
|
|
|
|
|
|
#ifndef NDEBUG
|
2000-08-01 10:03:56 +00:00
|
|
|
if(GSDebugSet(@"gswcomponents") == YES)
|
2002-05-16 18:01:40 +00:00
|
|
|
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"Start %@",[self _templateName]]];
|
|
|
|
#endif
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
request=[aContext request];
|
|
|
|
isFromClientComponent=[request isFromClientComponent];
|
|
|
|
component=[aContext component];
|
|
|
|
[aContext appendZeroElementIDComponent];
|
|
|
|
NS_DURING
|
|
|
|
{
|
2002-05-16 18:01:40 +00:00
|
|
|
[aResponse appendDebugCommentContentString:[NSString stringWithFormat:@"defName=%@ ID=%@",[self definitionName],[aContext elementID]]];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
2002-05-14 11:28:50 +00:00
|
|
|
[template appendToResponse:aResponse
|
|
|
|
inContext:aContext];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
LOGException0(@"exception in GSWComponent invokeActionForRequest:inContext");
|
|
|
|
LOGException(@"exception=%@",localException);
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
|
|
|
@"In GSWComponent invokeActionForRequest:inContext");
|
|
|
|
LOGException(@"exception=%@",localException);
|
|
|
|
[localException raise];
|
|
|
|
}
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[aContext deleteLastElementIDComponent];
|
2001-10-28 10:29:17 +00:00
|
|
|
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStopElement(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
if (![debugElementID isEqualToString:[aContext elementID]])
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self class],debugElementID,[aContext elementID]);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
#endif
|
2000-08-01 10:03:56 +00:00
|
|
|
if(GSDebugSet(@"gswcomponents") == YES)
|
2002-05-14 11:28:50 +00:00
|
|
|
[aResponse appendContentString:[NSString stringWithFormat:@"\n<!-- Stop %@ -->\n",
|
|
|
|
[self _templateName]]];//TODO enlever
|
2001-10-28 10:29:17 +00:00
|
|
|
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWAssertIsElementID(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// invokeActionForRequest:inContext:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
|
|
|
GSWElement* element=nil;
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElement* template=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElementIDString* debugElementID=[aContext elementID];
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
|
|
|
LOGObjectFnStart();
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStartElement(aContext);
|
2000-02-12 13:08:41 +00:00
|
|
|
NS_DURING
|
2002-05-14 11:28:50 +00:00
|
|
|
{
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWAssertCorrectElementID(aContext);
|
2002-05-14 11:28:50 +00:00
|
|
|
template=[self _template];
|
|
|
|
[aContext appendZeroElementIDComponent];
|
|
|
|
element=[[self _template] invokeActionForRequest:aRequest
|
|
|
|
inContext:aContext];
|
|
|
|
[aContext deleteLastElementIDComponent];
|
|
|
|
}
|
2000-02-12 13:08:41 +00:00
|
|
|
NS_HANDLER
|
2002-05-14 11:28:50 +00:00
|
|
|
{
|
|
|
|
LOGException0(@"exception in GSWComponent invokeActionForRequest:inContext");
|
|
|
|
LOGException(@"exception=%@",localException);
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo(localException,
|
|
|
|
@"In GSWComponent invokeActionForRequest:inContext");
|
|
|
|
LOGException(@"exception=%@",localException);
|
|
|
|
[localException raise];
|
|
|
|
}
|
2000-02-12 13:08:41 +00:00
|
|
|
NS_ENDHANDLER;
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStopElement(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
if (![debugElementID isEqualToString:[aContext elementID]])
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self class],debugElementID,[aContext elementID]);
|
|
|
|
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-05-14 11:28:50 +00:00
|
|
|
// if (![aContext _wasActionInvoked] && [[[aContext elementID] parentElementIDString] compare:[aContext senderID]]==NSOrderedDescending)
|
|
|
|
if (![aContext _wasActionInvoked]
|
|
|
|
&& [[[aContext elementID] parentElementIDString] isSearchOverForSenderID:[aContext senderID]])
|
|
|
|
{
|
|
|
|
LOGError(@"Action not invoked at the end of %@ (id=%@) senderId=%@",
|
|
|
|
[self class],
|
|
|
|
[aContext elementID],
|
|
|
|
[aContext senderID]);
|
|
|
|
};
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWAssertIsElementID(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
return element;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// takeValuesFromRequest:inContext:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)takeValuesFromRequest:(GSWRequest*)aRequest
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
BOOL oldValidateFlag=NO;
|
|
|
|
GSWElement* template=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWElementIDString* debugElementID=[aContext elementID];
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
|
|
|
LOGObjectFnStart();
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStartElement(aContext);
|
|
|
|
GSWAssertCorrectElementID(aContext);
|
2000-02-14 10:57:55 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
[_validationFailureMessages removeAllObjects];
|
|
|
|
oldValidateFlag=[aContext isValidate];
|
|
|
|
[aContext setValidate:YES];
|
|
|
|
template=[self _template];
|
|
|
|
[aContext appendZeroElementIDComponent];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"COMPONENT %p defName=%@ [aContext elementID]=%@",self,[self definitionName],[aContext elementID]);
|
2002-05-14 11:28:50 +00:00
|
|
|
[template takeValuesFromRequest:aRequest
|
|
|
|
inContext:aContext];
|
|
|
|
[aContext deleteLastElementIDComponent];
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWStopElement(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-05-14 11:28:50 +00:00
|
|
|
if (![debugElementID isEqualToString:[aContext elementID]])
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"class=%@ debugElementID=%@ [aContext elementID]=%@",
|
2002-05-14 11:28:50 +00:00
|
|
|
[self class],debugElementID,[aContext elementID]);
|
|
|
|
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-05-14 11:28:50 +00:00
|
|
|
[aContext setValidate:oldValidateFlag];
|
2002-05-16 18:01:40 +00:00
|
|
|
GSWAssertIsElementID(aContext);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
//GSWeb Additions {
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)setValidationFailureMessage:(NSString*)message
|
2002-05-14 11:28:50 +00:00
|
|
|
forElement:(GSWDynamicElement*)element
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
if (!_validationFailureMessages)
|
|
|
|
_validationFailureMessages=[NSMutableDictionary new];
|
|
|
|
[_validationFailureMessages setObject:message
|
|
|
|
forKey:[NSValue valueWithNonretainedObject:element]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)validationFailureMessageForElement:(GSWDynamicElement*)element
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [_validationFailureMessages objectForKey:[NSValue valueWithNonretainedObject:element]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)handleValidationExceptionDefault
|
|
|
|
{
|
|
|
|
return nil; //Raise !
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)isValidationFailure
|
|
|
|
{
|
|
|
|
//TODO ameliorate
|
|
|
|
return [[self allValidationFailureMessages] count]>0;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSDictionary*)validationFailureMessages
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return _validationFailureMessages;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSArray*)allValidationFailureMessages
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSMutableArray* msgs=[NSMutableArray array];
|
|
|
|
NSEnumerator* subComponentsEnum=nil;
|
|
|
|
GSWComponent* component=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
// NSDebugMLLog(@"GSWComponent",@"validationFailureMessages=%@",validationFailureMessages);
|
2002-05-14 11:28:50 +00:00
|
|
|
[msgs addObjectsFromArray:[[self validationFailureMessages] allValues]];
|
2002-07-04 11:01:56 +00:00
|
|
|
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
2002-05-14 11:28:50 +00:00
|
|
|
subComponentsEnum=[_subComponents objectEnumerator];
|
|
|
|
while((component=[subComponentsEnum nextObject]))
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
// NSDebugMLLog(@"GSWComponent",@"_component=%@",_component);
|
2002-05-14 11:28:50 +00:00
|
|
|
[msgs addObjectsFromArray:[component allValidationFailureMessages]];
|
2002-07-04 11:01:56 +00:00
|
|
|
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
2002-05-14 11:28:50 +00:00
|
|
|
};
|
|
|
|
msgs=[NSArray arrayWithArray:msgs];
|
2002-07-04 11:01:56 +00:00
|
|
|
// NSDebugMLLog(@"GSWComponent",@"_msgs=%@",_msgs);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return msgs;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2001-03-11 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/GSWWOCompatibility.h/.m: added
* GSWeb.framework/GNUmakefile: added GSWWOCompatibility.h/.m
* GSWeb.framework/GSWApplication.h/m: added WOApplicationMain, handle WO/GSWeb names
* GSWeb.framework/GSWContext.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWConstants.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWDynamicURLString.m: handle WO/GSWeb names
* GSWeb.framework/GSWProjectBundle.m/.h: handle WO/GSWeb names, suppress warnings
* GSWeb.framework/GSWSession.m: handle WO/GSWeb names
* GSWeb.framework/GSWRequest.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParser.m: handle WO/GSWeb names,
added tag counts to help errors hunt
* GSWeb.framework/GSWBundle.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWResourceManager.m: handle WO/GSWeb names
* GSWeb.framework/GSWURLValuedElementData.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectAction.m: handle WO/GSWeb names
* GSWeb.framework/GSWForm.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWHyperlink.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWResourceRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWDirectActionRequestHandler.m: handle WO/GSWeb names
* GSWeb.framework/GSWActiveImage.m/.h: handle WO/GSWeb names
* GSWeb.framework/GSWBindingNameAssociation.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWBrowser.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponent.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWHTMLURLValuedElement.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWImageButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWInput.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWPopUpButton.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWString.h/.m: handle WO/GSWeb names
* GSWeb.framework/GSWAssociation.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBox.m: handle WO/GSWeb names
* GSWeb.framework/GSWCheckBoxList.m: handle WO/GSWeb names
* GSWeb.framework/GSWComponentDefinition.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButton.m: handle WO/GSWeb names
* GSWeb.framework/GSWRadioButtonList.m: handle WO/GSWeb names
* GSWeb.framework/GSWText.m: handle WO/GSWeb names
* GSWeb.framework/GSWTextField.m: handle WO/GSWeb names
* GSWeb.framework/GSWDeployedBundle.m: warnings
* GSWeb.framework/GSWeb.h: added include GSWeb/GSWSessionTimeOut.h, GSWWOCompatibility.h
* GSWeb.framework/GSWAdaptor.m: traces
* GSWeb.framework/GSWDefaultAdaptor.m: handle WO/GSWeb names, added traces
* GSWeb.framework/GSWDefaultAdaptorThread.m/.h: handle WO/GSWeb names
* GSWeb.framework/NSNonBlockingFileHandle.m: added traces
* GSWeb.framework/GSWTemplateParserANTLR.m: handle WO/GSWeb names
* GSWeb.framework/GSWTemplateParserXML.m: handle WO/GSWeb names
added tag count to help errors hunt
remove "Tag gsweb invalid" message
handle unicode strings in node content traces
remove html and body tags if they are not present in the template
* GSWeb.framework/GSWTemplateParseXML.h: added ivar _isHTMLTag, _isBodyTag
* GSWeb.framework/GSWSessionTimeOutManager.m: dealloc sessionOrderedTimeOuts instead
of deallocating 2 times sessionTimeOuts
* GSWExtensions.framework/French.lproj/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch, Encode french characters
* GSWExtensions.framework/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html:
tag mismatch
* GSWHTMLBareString.m: handle unicode strings in description
* GSWExtensions.framework/French.lproj/GSWExceptionPage.gswc/GSWExceptionPage.html:
Encode french characters, Tag Mismatch
* GSWExtensions.framework/French.lproj/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.html:
Encode french characters
* GSWExtensions.framework/French.lproj/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.html:
Encode french characters
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.html:
Tag Mismatch
* GSWExtensions.framework/GSWExceptionPage.gswc/GSWExceptionPage.gswd:
added convertHTMLEntities for strings
* GSWeb.framework/GSWRepetition.m: added traces, fix "count" property bug, standardize ivars
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m: added traces, handle underscored ivars search
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@9332 72102866-910b-0410-8b05-ffd578937521
2001-03-11 17:15:44 +00:00
|
|
|
// }
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)ensureAwakeInContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com>
Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff
except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it)
* GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo
* GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes
* GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find*
* GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter,
o management of AppInfo
* GSWAdaptors/common/GSWAppRequest.c: managing refused connections
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes
* GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation
o -awake added
* GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions
* GSWeb.framework/GSWBundle.m: debug traces commented
* GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext:
* GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?)
* GSWeb.framework/GSWComponentRequestHandler.m: comments added
* GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces
* GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction
* GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex,
o correct misspelled names,
o added -description,
o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:,
o changes in -deleteObjectAtIndex:,
* GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount,
handle bug in omniweb-browser
* GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWPopUpButton.m:
o use [response_ appendContentString:_noSelectionStringValue] instead of
[response_ appendContentHTMLString:_noSelectionStringValue]
o handle no displayString case
o use [response_ appendContentString:_displayStringValue] instead of
[response_ appendContentHTMLString:_displayStringValue]
* GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO
* GSWeb.framework/GSWElementIDString.m: comment some debug traces
* GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType
* GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace
* GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class])
instead of [retValue class] for log
* GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers;
o added test on _contentType in _contentType
o autorelease _dict in -uriElements
* GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers
o Added GSWResponse (GSWResponseRefused)
o return self in -generateResponse
* GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo)
o added refusing session management
* GSWeb.framework/GSWSession.m:
o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
* GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts;
by NSMutableArray* sessionOrderedTimeOuts;
o added traces
o added GSWSessionTimeOutManager (GSWSessionRefused)
* GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned
* GSWeb.framework/GSWTemplateParser.m: added doctype management
* GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__
* GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink
* GSWeb.framework/attach.m: added if defined for __NetBSD__
* GSWeb.framework/stacktrace.m: added if defined for __NetBSD__
* GSWeb.framework/GSWTemplateParserXML.m: traces commented
o test XML node content before adding it
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m
o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters)
* GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse()
o debug traces removed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
|
|
|
//LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
if (![self context])
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"component sleeps, we awake it = %@",self);
|
2002-05-14 11:28:50 +00:00
|
|
|
[self awakeInContext:aContext];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ([self context] != aContext)
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",
|
2002-05-14 11:28:50 +00:00
|
|
|
@"component is already awaken, but has not the current context, we awake it twice with current context = %@",
|
|
|
|
self);
|
|
|
|
[self awakeInContext:aContext];
|
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com>
Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff
except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it)
* GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo
* GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes
* GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find*
* GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter,
o management of AppInfo
* GSWAdaptors/common/GSWAppRequest.c: managing refused connections
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes
* GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation
o -awake added
* GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions
* GSWeb.framework/GSWBundle.m: debug traces commented
* GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext:
* GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?)
* GSWeb.framework/GSWComponentRequestHandler.m: comments added
* GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces
* GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction
* GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex,
o correct misspelled names,
o added -description,
o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:,
o changes in -deleteObjectAtIndex:,
* GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount,
handle bug in omniweb-browser
* GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWPopUpButton.m:
o use [response_ appendContentString:_noSelectionStringValue] instead of
[response_ appendContentHTMLString:_noSelectionStringValue]
o handle no displayString case
o use [response_ appendContentString:_displayStringValue] instead of
[response_ appendContentHTMLString:_displayStringValue]
* GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO
* GSWeb.framework/GSWElementIDString.m: comment some debug traces
* GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType
* GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace
* GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class])
instead of [retValue class] for log
* GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers;
o added test on _contentType in _contentType
o autorelease _dict in -uriElements
* GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers
o Added GSWResponse (GSWResponseRefused)
o return self in -generateResponse
* GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo)
o added refusing session management
* GSWeb.framework/GSWSession.m:
o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
* GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts;
by NSMutableArray* sessionOrderedTimeOuts;
o added traces
o added GSWSessionTimeOutManager (GSWSessionRefused)
* GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned
* GSWeb.framework/GSWTemplateParser.m: added doctype management
* GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__
* GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink
* GSWeb.framework/attach.m: added if defined for __NetBSD__
* GSWeb.framework/stacktrace.m: added if defined for __NetBSD__
* GSWeb.framework/GSWTemplateParserXML.m: traces commented
o test XML node content before adding it
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m
o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters)
* GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse()
o debug traces removed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
|
|
|
}
|
2002-05-14 11:28:50 +00:00
|
|
|
}
|
2001-10-25 Manuel Guesdon <mguesdon@orange-concept.com>
Applied patch from Turbocat (www.turbocat.de): GSWPatch_04-JUL_2001.diff
except GSWeb.framework/GSWInput.m/.h one (have to verify coherence of it)
* GSWAdaptors/common/GSWApp.c/.h: Added GSWAppInfo
* GSWAdaptors/common/GSWAppConnectNSSocket.c: Changes on includes
* GSWAdaptors/common/GSWLoadBalancing.h: Added parameter to GSWLoadBalancing_Find*
* GSWAdaptors/common/GSWLoadBalancing.c: added p_pURLComponents parameter,
o management of AppInfo
* GSWAdaptors/common/GSWAppRequest.c: managing refused connections
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.gswd: misspelling correction
* GSWExtensions.framework/GSWStatsPage.gswc/GSWStatsPage.html: Various Changes
* GSWExtensions.framework/GSWStatsPage.m: changes in login/password validation
o -awake added
* GSWeb.framework/GSWApplication.m/.h: Manage refusing new sessions
* GSWeb.framework/GSWBundle.m: debug traces commented
* GSWeb.framework/GSWComponent.m: implementation of ensureAwakeInContext:
* GSWeb.framework/GSWAssociation.m: special case for returned value of type GSMutableArray (Why ?)
* GSWeb.framework/GSWComponentRequestHandler.m: comments added
* GSWeb.framework/GSWDefaultAdaptorThread.m: added debug traces
* GSWeb.framework/GSWDirectActionRequestHandler.m: replaced GSWDirectAction by DirectAction
* GSWeb.framework/GSWDisplayGroup.m: initialize _baseIndex,
o correct misspelled names,
o added -description,
o use delegate in _changedInEditingContext:, _invalidatedAllObjectsInStore:,
o changes in -deleteObjectAtIndex:,
* GSWeb.framework/GSWFileUpload.m: different handling of _fileDatasCount,
handle bug in omniweb-browser
* GSWeb.framework/GSWHyperlink.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWImageButton.m: added ensureAwakeInContext: call
* GSWeb.framework/GSWPopUpButton.m:
o use [response_ appendContentString:_noSelectionStringValue] instead of
[response_ appendContentHTMLString:_noSelectionStringValue]
o handle no displayString case
o use [response_ appendContentString:_displayStringValue] instead of
[response_ appendContentHTMLString:_displayStringValue]
* GSWeb.framework/GSWConfig.h: set GSWOPTVALUE_AutoOpenInBrowser to NO
* GSWeb.framework/GSWElementIDString.m: comment some debug traces
* GSWeb.framework/GSWHTMLStaticGroup.m/.h: added support of documentType
* GSWeb.framework/GSWHTMLURLValuedElement.m: addeded debug trace
* GSWeb.framework/GSWKeyValueAssociation.m: use NSStringFromClass([retValue class])
instead of [retValue class] for log
* GSWeb.framework/GSWRequest.m/.h: added -(NSDictionary*)headers;
o added test on _contentType in _contentType
o autorelease _dict in -uriElements
* GSWeb.framework/GSWResponse.m/.h: added -setHeaders: and -headers
o Added GSWResponse (GSWResponseRefused)
o return self in -generateResponse
* GSWeb.framework/GSWServerSessionStore.m/.h: added @interface GSWServerSessionStore (GSWServerSessionStoreInfo)
o added refusing session management
* GSWeb.framework/GSWSession.m:
o in -terminate forces to call removeSessionWithID in GSWServerSessionStore to dealloc it
* GSWeb.framework/GSWSessionTimeOutManager.m/.h: replace NSMutableOrderedArray* sessionOrderedTimeOuts;
by NSMutableArray* sessionOrderedTimeOuts;
o added traces
o added GSWSessionTimeOutManager (GSWSessionRefused)
* GSWeb.framework/GSWSubmitButton.m: raise exception if no element is returned
* GSWeb.framework/GSWTemplateParser.m: added doctype management
* GSWeb.framework/GSWUtils.h: added if defined for __NetBSD__
* GSWeb.framework/GSWWOCompatibility.m/.h: added WOGenericContainer, WOImageButton, WOHyperlink
* GSWeb.framework/attach.m: added if defined for __NetBSD__
* GSWeb.framework/stacktrace.m: added if defined for __NetBSD__
* GSWeb.framework/GSWTemplateParserXML.m: traces commented
o test XML node content before adding it
* GSWeb.framework/NSObject+IVarAccess+PerformSel.m
o changes in -getIVarNamed: and in setIVarNamed:withValue: (use of sel+imp, tests on parameters)
* GSWAdaptors/common/GSWHTTPResponse.c: change in GSWHTTPResponse_GetResponse()
o debug traces removed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11251 72102866-910b-0410-8b05-ffd578937521
2001-10-26 08:50:52 +00:00
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// awake
|
|
|
|
|
|
|
|
-(void)awake
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
//Does Nothing
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)awakeInContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"aContext=%@",aContext);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"defName=%@",[self definitionName]);
|
2002-05-14 11:28:50 +00:00
|
|
|
NSAssert(aContext,@"No Context");
|
|
|
|
[self _setContext:aContext];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
[aComponentDefinition setCachingEnabled:[self isCachingEnabled]];
|
|
|
|
[aComponentDefinition awake];
|
|
|
|
[_subComponents makeObjectsPerformSelector:@selector(awakeInContext:)
|
|
|
|
withObject:aContext];
|
|
|
|
[aComponentDefinition _awakeObserversForComponent:self];
|
2000-01-22 12:49:49 +00:00
|
|
|
[self awake];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWActionInvocation)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// performParentAction:
|
|
|
|
|
2000-12-03 00:00:18 +00:00
|
|
|
- (id)performParentAction:(NSString *)attribute
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWAssociation *assoc=nil;
|
|
|
|
id ret=nil;
|
2000-12-03 00:00:18 +00:00
|
|
|
|
|
|
|
LOGObjectFnStart();
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent", @"name=%@ - parent=%p",
|
2002-01-26 10:43:23 +00:00
|
|
|
[self definitionName],
|
2002-05-14 11:28:50 +00:00
|
|
|
(void*)_parent);
|
|
|
|
if (_parent)
|
2000-12-03 00:00:18 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
assoc = [self _associationWithName:attribute];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent", @"assoc=%@", assoc);
|
2000-12-03 00:00:18 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
if(assoc && [assoc isValueConstant] == YES)
|
2000-12-03 00:00:18 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString *aValue = [assoc valueInComponent:self];
|
2000-12-03 00:00:18 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
if(aValue)
|
|
|
|
ret = [_parent performSelector:NSSelectorFromString(aValue)];
|
2000-12-03 00:00:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LOGObjectFnStop();
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
return ret;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWComponent*)parent
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
return _parent;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(GSWComponent*)topParent
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponent* parent=[self parent];
|
|
|
|
GSWComponent* topParent=parent;
|
|
|
|
while (parent)
|
|
|
|
{
|
|
|
|
topParent=parent;
|
|
|
|
parent=[parent parent];
|
|
|
|
};
|
|
|
|
return topParent;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(NSArray*)parents
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSMutableArray* parents=[NSMutableArray array];
|
|
|
|
GSWComponent* parent=[self parent];
|
|
|
|
while (parent)
|
|
|
|
{
|
|
|
|
[parents addObject:parent];
|
|
|
|
parent=[parent parent];
|
|
|
|
};
|
|
|
|
return [NSArray arrayWithArray:parents];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(NSArray*)parentsClasses
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSMutableArray* parents=[NSMutableArray array];
|
|
|
|
GSWComponent* parent=[self parent];
|
|
|
|
while (parent)
|
|
|
|
{
|
|
|
|
[parents addObject:[parent class]];
|
|
|
|
parent=[parent parent];
|
|
|
|
};
|
|
|
|
return [NSArray arrayWithArray:parents];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWConveniences)
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWComponent*)pageWithName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWComponent* page=nil;
|
|
|
|
GSWContext* aContext=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
aContext=[self context];
|
|
|
|
page=[GSWApp pageWithName:aName
|
|
|
|
inContext:aContext];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return page;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// session
|
|
|
|
|
|
|
|
-(GSWSession*)session
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWSession* session=nil;
|
|
|
|
if (_session)
|
|
|
|
session=_session;
|
|
|
|
else if (_context)
|
|
|
|
session=[_context session];
|
|
|
|
return session;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)hasSession
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return (_session!=nil);
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// application
|
|
|
|
|
|
|
|
-(GSWApplication*)application
|
|
|
|
{
|
|
|
|
return [GSWApplication application];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// context
|
|
|
|
|
|
|
|
-(GSWContext*)context
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return _context;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(NSArray*)languages
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* languages=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[[self context] languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return languages;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWLogging)
|
2001-10-27 10:27:33 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//Called when an Enterprise Object or formatter failed validation during an
|
|
|
|
//assignment.
|
|
|
|
//The default implementation ignores the error. Subclassers can override to
|
|
|
|
// record the error and possibly return a different page for the current action.
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)validationFailedWithException:(NSException*)exception
|
|
|
|
value:(id)aValue
|
|
|
|
keyPath:(id)keyPath
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-10-27 10:27:33 +00:00
|
|
|
// Does nothing
|
|
|
|
LOGObjectFnStart();
|
|
|
|
LOGObjectFnStop();
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)_debugWithString:(NSString*)string
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
2001-10-28 10:29:17 +00:00
|
|
|
/* Seems there's a problem with patches... Why this code is here ?
|
|
|
|
LOGObjectFnStart();
|
|
|
|
if (![self context])
|
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"component sleeps, we awake it = %@",self);
|
2002-05-14 11:28:50 +00:00
|
|
|
[self awakeInContext:aContext];
|
2001-10-28 10:29:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
if ([self context] != aContext)
|
2001-10-28 10:29:17 +00:00
|
|
|
{
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"component is already awaken, but has not the current context, we awake it twice with current context = %@",self);
|
2002-05-14 11:28:50 +00:00
|
|
|
[self awakeInContext:aContext];
|
2001-10-28 10:29:17 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
LOGObjectFnStop();
|
|
|
|
*/
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)debugWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)logWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(void)logWithFormat:(NSString*)format
|
|
|
|
arguments:(va_list)argList
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
+(void)logWithFormat:(NSString*)format,...
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentJ)
|
|
|
|
|
|
|
|
-(NSString*)_uniqueID
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentK)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(GSWResponse*)_generateResponseInContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWResponse* response=nil;
|
|
|
|
GSWSession* session=nil;
|
|
|
|
GSWRequest* request=nil;
|
|
|
|
NSString* httpVersion=nil;
|
|
|
|
GSWElement* pageElement=nil;
|
|
|
|
BOOL pageChanged=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
response=[[GSWResponse new]autorelease];
|
|
|
|
session=[aContext existingSession];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"session=%@",session);
|
2002-05-14 11:28:50 +00:00
|
|
|
if (session)
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
};
|
|
|
|
[aContext deleteAllElementIDComponents];
|
|
|
|
request=[aContext request];
|
|
|
|
httpVersion=[request httpVersion];
|
|
|
|
[response setHTTPVersion:httpVersion];
|
|
|
|
[response setHeader:@"text/html"
|
|
|
|
forKey:@"content-type"];
|
|
|
|
[aContext _setResponse:response];
|
2001-10-28 10:29:17 +00:00
|
|
|
//====>
|
2002-05-14 11:28:50 +00:00
|
|
|
pageElement=[aContext _pageElement];
|
|
|
|
pageChanged=(self!=(GSWComponent*)pageElement);
|
|
|
|
[aContext _setPageChanged:pageChanged];
|
2001-10-28 10:29:17 +00:00
|
|
|
//====>
|
2002-05-14 11:28:50 +00:00
|
|
|
if (pageChanged)
|
|
|
|
[aContext _setPageElement:self];
|
|
|
|
[aContext _setCurrentComponent:self];
|
2001-10-28 10:29:17 +00:00
|
|
|
//====>
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
[self appendToResponse:response
|
|
|
|
inContext:aContext];
|
2001-10-28 10:29:17 +00:00
|
|
|
|
|
|
|
//----------------
|
|
|
|
//==>10
|
2002-05-14 11:28:50 +00:00
|
|
|
session=[aContext session];
|
2002-07-04 11:01:56 +00:00
|
|
|
NSDebugMLLog(@"GSWComponent",@"session=%@",session);
|
|
|
|
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
2002-05-14 11:28:50 +00:00
|
|
|
[session appendCookieToResponse:response];
|
2001-10-28 10:29:17 +00:00
|
|
|
//==>11
|
2002-05-14 11:28:50 +00:00
|
|
|
[session _saveCurrentPage];
|
|
|
|
[aContext _incrementContextID];
|
|
|
|
[aContext deleteAllElementIDComponents];
|
|
|
|
[aContext _setPageChanged:pageChanged];
|
|
|
|
[aContext _setPageReplaced:NO];
|
2001-10-28 10:29:17 +00:00
|
|
|
|
|
|
|
//<==========
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return response;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(id)validateValue:(id*)valuePtr
|
|
|
|
forKey:(id)key
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
+(id)validateValue:(id*)valuePtr
|
|
|
|
forKey:(id)key
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentL)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// stringForKey:inTableNamed:withDefaultValue:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)stringForKey:(NSString*)key
|
|
|
|
inTableNamed:(NSString*)tableName
|
|
|
|
withDefaultValue:(NSString*)defaultValue
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* string=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
/*
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
string=[aComponentDefinition stringForKey:key
|
|
|
|
inTableNamed:tableName
|
|
|
|
withDefaultValue:defaultValue
|
|
|
|
languages:languages];
|
|
|
|
else
|
|
|
|
string=defaultValue;
|
2000-01-22 12:49:49 +00:00
|
|
|
*/
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
string=[GSWApp stringForKey:key
|
|
|
|
inTableNamed:tableName
|
|
|
|
withDefaultValue:defaultValue
|
|
|
|
inFramework:[self frameworkName]
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return string;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSDictionary* stringsTable=nil;
|
|
|
|
/* NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
stringsTable=[aComponentDefinition stringsTableNamed:aName
|
|
|
|
withLanguages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
*/
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
stringsTable=[GSWApp stringsTableNamed:aName
|
|
|
|
inFramework:[self frameworkName]
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return stringsTable;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* stringsTableArray=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
/*
|
2002-05-14 11:28:50 +00:00
|
|
|
NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
stringsTableArray=[aComponentDefinition stringsTableArrayNamed:aName
|
|
|
|
withLanguages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
*/
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
stringsTableArray=[GSWApp stringsTableArrayNamed:aName
|
|
|
|
inFramework:[self frameworkName]
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return stringsTableArray;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// urlForResourceNamed:ofType:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)type
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//TODO
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* url=nil;
|
|
|
|
/* NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
url=[aComponentDefinition urlForResourceNamed:aName
|
|
|
|
ofType:type
|
|
|
|
languages:languages
|
|
|
|
request:nil];//TODO
|
2000-01-22 12:49:49 +00:00
|
|
|
*/
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
url=[GSWApp urlForResourceNamed:(type ? [NSString stringWithFormat:@"%@.%@",aName,type] : aName)
|
|
|
|
inFramework:[self frameworkName]
|
|
|
|
languages:[self languages]
|
|
|
|
request:nil];//TODO
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return url;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)_urlForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)type
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// pathForResourceNamed:ofType:
|
|
|
|
// Normally: local search. Here we do a resourceManager serahc.
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)type
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* path=nil;
|
|
|
|
/* NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
path=[aComponentDefinition pathForResourceNamed:aName
|
|
|
|
ofType:type
|
|
|
|
languages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
*/
|
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
path=[GSWApp pathForResourceNamed:aName
|
|
|
|
ofType:type
|
|
|
|
inFramework:[self frameworkName]
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)pathForComponentResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)type_
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSString* path=nil;
|
|
|
|
NSArray* languages=nil;
|
|
|
|
GSWComponentDefinition* aComponentDefinition=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
languages=[self languages];
|
|
|
|
aComponentDefinition=[self _componentDefinition];
|
|
|
|
if (aComponentDefinition)
|
|
|
|
path=[aComponentDefinition pathForResourceNamed:aName
|
|
|
|
ofType:type_
|
|
|
|
languages:languages];
|
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)stringForKey:(id)key
|
|
|
|
inTableNamed:(NSString*)aName
|
|
|
|
withDefaultValue:(NSString*)defaultValue
|
|
|
|
inFramework:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [GSWApp stringForKey:key
|
|
|
|
inTableNamed:aName
|
|
|
|
withDefaultValue:defaultValue
|
|
|
|
inFramework:aFrameworkName
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
|
|
|
inFramework:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [GSWApp stringsTableNamed:aName
|
|
|
|
inFramework:aFrameworkName
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
|
|
|
inFramework:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [GSWApp stringsTableArrayNamed:aName
|
|
|
|
inFramework:aFrameworkName
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)extension
|
|
|
|
inFramework:(NSString*)aFrameworkName;
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [GSWApp urlForResourceNamed:(extension ? [NSString stringWithFormat:@"%@.%@",aName,extension] : aName)
|
|
|
|
inFramework:aFrameworkName
|
|
|
|
languages:[self languages]
|
|
|
|
request:nil];//TODO
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)extension
|
|
|
|
inFramework:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [GSWApp pathForResourceNamed:aName
|
|
|
|
ofType:(NSString*)extension
|
|
|
|
inFramework:aFrameworkName
|
|
|
|
languages:[self languages]];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWTemplateParsing)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// templateWithHTMLString:declarationString:languages
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-05-14 11:28:50 +00:00
|
|
|
+(GSWElement*)templateWithHTMLString:(NSString*)htmlString
|
|
|
|
declarationString:(NSString*)pageDefString
|
|
|
|
languages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
GSWElement* rootElement=nil;
|
|
|
|
NSDebugMLog0(@"Begin GSWComponent:templateWithHTMLString...\n");
|
2002-05-14 11:28:50 +00:00
|
|
|
rootElement=[GSWTemplateParser templateWithHTMLString:htmlString
|
|
|
|
declarationString:pageDefString
|
|
|
|
languages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
return rootElement;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWTemplateParsingOldFn)
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// templateWithHTMLString:declarationString:
|
|
|
|
//old
|
2002-05-14 11:28:50 +00:00
|
|
|
+(GSWElement*)templateWithHTMLString:(NSString*)htmlString
|
|
|
|
declarationString:(NSString*)pageDefString
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
return [self templateWithHTMLString:htmlString
|
|
|
|
declarationString:pageDefString
|
|
|
|
languages:nil];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWActionResults)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWResponse*)generateResponse
|
|
|
|
{
|
|
|
|
//OK
|
2002-05-14 11:28:50 +00:00
|
|
|
GSWResponse* response=nil;
|
|
|
|
GSWContext* aContext=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-05-14 11:28:50 +00:00
|
|
|
aContext=[self context];
|
|
|
|
response=[self _generateResponseInContext:aContext];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-05-14 11:28:50 +00:00
|
|
|
return response;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWStatistics)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
// descriptionForResponse:inContext:
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
-(NSString*)descriptionForResponse:(GSWResponse*)aResponse
|
|
|
|
inContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWComponentClassA)
|
2002-05-14 11:28:50 +00:00
|
|
|
+(void)_registerObserver:(id)observer
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponent (GSWVerifyAPI)
|
|
|
|
-(void)validateAPIAssociations
|
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
NSDictionary* api=[[self _componentDefinition] componentAPI];
|
|
|
|
if (api)
|
|
|
|
{
|
|
|
|
NSArray* required=[api objectForKey:@"Required"];
|
|
|
|
NSArray* optional=[api objectForKey:@"Optional"];
|
|
|
|
int i=0;
|
|
|
|
int count=[required count];
|
|
|
|
id aName=nil;
|
|
|
|
for(i=0;i<count;i++)
|
|
|
|
{
|
|
|
|
aName=[required objectAtIndex:i];
|
|
|
|
if (![self hasBinding:aName])
|
|
|
|
{
|
|
|
|
[NSException raise:NSGenericException
|
|
|
|
format:@"There is no binding for '%@' in parent '%@' for component '%@' [parents : %@]",
|
|
|
|
aName,
|
|
|
|
[_parent class],
|
|
|
|
[self class],
|
|
|
|
[self parentsClasses]];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
@end
|