2002-08-04 18:00:11 +00:00
|
|
|
/** GSWComponentDefinition.m - <title>GSWeb: Class GSWComponentDefinition</title>
|
|
|
|
|
|
|
|
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
|
|
|
Date: Jan 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
<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-08-04 18:00:11 +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 GSWComponentDefinition
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithName:(NSString*)aName
|
|
|
|
path:(NSString*)aPath
|
|
|
|
baseURL:(NSString*)baseURL
|
|
|
|
frameworkName:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
if ((self=[super init]))
|
2002-07-27 23:48:47 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"gswcomponents",@"aName=%@ aFrameworkName=%@",aName,aFrameworkName);
|
|
|
|
ASSIGN(_name,aName);
|
|
|
|
_bundle=[[GSWBundle alloc] initWithPath:aPath
|
|
|
|
baseURL:baseURL
|
|
|
|
inFrameworkNamed:aFrameworkName];
|
|
|
|
_observers=nil;
|
|
|
|
ASSIGN(_frameworkName,aFrameworkName);
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"frameworkName=%@",_frameworkName);
|
|
|
|
ASSIGN(_templateName,aName);//TODOV
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"templateName=%@",_templateName);
|
|
|
|
_componentClass=Nil;
|
|
|
|
_isScriptedClass=NO;
|
|
|
|
_isCachingEnabled=NO;
|
|
|
|
_isAwake=NO;
|
2002-07-27 23:48:47 +00:00
|
|
|
[self setCachingEnabled:[GSWApplication isCachingEnabled]];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
GSWLogC("Dealloc GSWComponentDefinition");
|
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: name");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_name);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: bundle");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_bundle);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: observers");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_observers);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: frameworkName");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_frameworkName);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: templateName");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_templateName);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition: componentClass");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_componentClass);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWComponentDefinition Super");
|
|
|
|
[super dealloc];
|
|
|
|
GSWLogC("End Dealloc GSWComponentDefinition");
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithCoder:(NSCoder*)coder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2001-01-29 18:15:36 +00:00
|
|
|
if ((self = [super init]))
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_name];
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_bundle];
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_observers]; //TODOV
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_frameworkName];
|
|
|
|
[coder decodeValueOfObjCType:@encode(id)
|
|
|
|
at:&_templateName];
|
|
|
|
[coder decodeValueOfObjCType:@encode(Class)
|
|
|
|
at:&_componentClass];
|
|
|
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isScriptedClass];
|
|
|
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isCachingEnabled];
|
|
|
|
[coder decodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isAwake];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)encodeWithCoder:(NSCoder*)coder
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
[coder encodeObject:_name];
|
|
|
|
[coder encodeObject:_bundle];
|
|
|
|
[coder encodeObject:_observers]; //TODOV
|
|
|
|
[coder encodeObject:_frameworkName];
|
|
|
|
[coder encodeObject:_templateName];
|
|
|
|
[coder encodeValueOfObjCType:@encode(Class)
|
|
|
|
at:&_componentClass];
|
|
|
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isScriptedClass];
|
|
|
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isCachingEnabled];
|
|
|
|
[coder encodeValueOfObjCType:@encode(BOOL)
|
|
|
|
at:&_isAwake];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)copyWithZone:(NSZone*)zone
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWComponentDefinition* clone = [[isa allocWithZone:zone] init];
|
2000-01-22 12:49:49 +00:00
|
|
|
if (clone)
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
ASSIGNCOPY(clone->_name,_name);
|
|
|
|
ASSIGNCOPY(clone->_bundle,_bundle);
|
|
|
|
ASSIGNCOPY(clone->_observers,_observers);
|
|
|
|
ASSIGNCOPY(clone->_frameworkName,_frameworkName);
|
|
|
|
ASSIGNCOPY(clone->_templateName,_templateName);
|
|
|
|
clone->_componentClass=_componentClass;
|
|
|
|
clone->_isScriptedClass=_isScriptedClass;
|
|
|
|
clone->_isCachingEnabled=_isCachingEnabled;
|
|
|
|
clone->_isAwake=_isAwake;
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
return clone;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)frameworkName
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _frameworkName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)baseURL
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return [_bundle baseURL];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)path
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return [_bundle path];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)name
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _name;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)description
|
|
|
|
{
|
|
|
|
//TODO
|
|
|
|
return [NSString stringWithFormat:@"<%s %p - name:[%@] bundle:[%@] observers=[%@] frameworkName=[%@] templateName=[%@] componentClass=[%@] isScriptedClass=[%s] isCachingEnabled=[%s] isAwake=[%s]>",
|
|
|
|
object_get_class_name(self),
|
|
|
|
(void*)self,
|
2002-08-04 18:00:11 +00:00
|
|
|
_name,
|
|
|
|
_bundle,
|
|
|
|
_observers,
|
|
|
|
_frameworkName,
|
|
|
|
_templateName,
|
|
|
|
_componentClass,
|
|
|
|
_isScriptedClass ? "YES" : "NO",
|
|
|
|
_isCachingEnabled ? "YES" : "NO",
|
|
|
|
_isAwake ? "YES" : "NO"];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)sleep
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
_isAwake=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)awake
|
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
BOOL isCachingEnabled=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
_isAwake=YES;
|
|
|
|
isCachingEnabled=[self isCachingEnabled];
|
|
|
|
if (!isCachingEnabled) //??
|
|
|
|
[self _clearCache];
|
2000-01-22 12:49:49 +00:00
|
|
|
//call self componentClass
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWCacheManagement)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(BOOL)isCachingEnabled
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _isCachingEnabled;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)setCachingEnabled:(BOOL)flag
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
_isCachingEnabled=flag;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWComponentDefinitionA)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)_clearCache
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
[_bundle clearCache];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWComponentDefinitionB)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(GSWElement*)templateWithName:(NSString*)aName
|
|
|
|
languages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWElement* element=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
element=[_bundle templateNamed:aName
|
|
|
|
languages:languages];
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"aName=%@ languages=%@ element=%@",aName,languages,element);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return element;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
/*
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)stringForKey:(NSString*)key
|
|
|
|
inTableNamed:(NSString*)aName
|
|
|
|
withDefaultValue:(NSString*)defaultValue
|
|
|
|
languages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* string=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
string=[_bundle stringForKey:key
|
|
|
|
inTableNamed:aName
|
|
|
|
withDefaultValue:defaultValue
|
|
|
|
languages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return string;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSDictionary*)stringsTableNamed:(NSString*)aName
|
|
|
|
withLanguages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* stringsTable=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
stringsTable=[bundle stringsTableNamed:aName
|
|
|
|
withLanguages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return stringsTable;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSArray*)stringsTableArrayNamed:(NSString*)aName
|
|
|
|
withLanguages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSArray* stringsTableArray=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
stringsTableArray=[bundle stringsTableArrayNamed:aName
|
|
|
|
withLanguages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return stringsTableArray;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)urlForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)type
|
|
|
|
languages:(NSArray*)languages
|
|
|
|
request:(GSWRequest*)request
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* url=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
url=[bundle urlForResourceNamed:aName
|
|
|
|
ofType:type
|
|
|
|
languages:languages
|
|
|
|
request:request];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return url;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
*/
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)pathForResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)aType
|
|
|
|
languages:(NSArray*)languages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
path=[_bundle pathForResourceNamed:aName
|
|
|
|
ofType:aType
|
|
|
|
languages:languages];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWComponentDefinitionC)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(GSWComponent*)componentInstanceInContext:(GSWContext*)aContext
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWComponent* component=nil;
|
|
|
|
Class componentClass=nil;
|
|
|
|
NSMutableDictionary* threadDictionary=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSAssert(aContext,@"No Context");
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
|
|
|
|
componentClass=[self componentClass];
|
|
|
|
NSAssert(componentClass,@"No componentClass");
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
|
|
|
threadDictionary=GSCurrentThreadDictionary();
|
|
|
|
[threadDictionary setObject:self
|
|
|
|
forKey:GSWThreadKey_ComponentDefinition];
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
component=[[componentClass new] autorelease];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
LOGException(@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
2002-08-04 18:00:11 +00:00
|
|
|
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
2000-01-22 12:49:49 +00:00
|
|
|
// [_component context];//so what ?
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return component;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(Class)componentClass
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
return [self _componentClass];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(Class)_componentClass
|
|
|
|
{
|
|
|
|
//OK To Verify
|
2002-08-04 18:00:11 +00:00
|
|
|
Class componentClass=_componentClass;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"name=%@",_name);
|
|
|
|
if (!componentClass)
|
|
|
|
componentClass=NSClassFromString(_name);//???
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]);
|
|
|
|
if (!componentClass)
|
|
|
|
{
|
|
|
|
BOOL createClassesOk=NO;
|
|
|
|
NSString* superClassName=nil;
|
|
|
|
if (!WOStrictFlag)
|
|
|
|
{
|
|
|
|
NSDictionary* archive=[_bundle archiveNamed:_name];
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"archive=%@",archive);
|
|
|
|
superClassName=[archive objectForKey:@"superClassName"];
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
|
|
|
if (superClassName)
|
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
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
if (!NSClassFromString(superClassName))
|
|
|
|
{
|
|
|
|
ExceptionRaise(NSGenericException,@"Superclass %@ of component %@ doesn't exist",
|
|
|
|
superClassName,
|
|
|
|
_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
|
|
|
};
|
2002-08-04 18:00:11 +00:00
|
|
|
};
|
|
|
|
if (!superClassName)
|
|
|
|
superClassName=@"GSWComponent";
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
|
|
|
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
|
|
|
|
superClassName:superClassName];
|
|
|
|
componentClass=NSClassFromString(_name);
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
//call GSWApp isCaching
|
|
|
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return componentClass;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(GSWComponentReference*)componentReferenceWithAssociations:(NSDictionary*)associations
|
|
|
|
template:(GSWElement*)template
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWComponentReference* componentReference=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
componentReference=[[[GSWComponentReference alloc]initWithName:_name
|
|
|
|
associations:associations
|
|
|
|
template:template] autorelease];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return componentReference;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
//NDFN
|
|
|
|
-(NSDictionary*)componentAPI
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* componentAPI=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
componentAPI=[_bundle apiNamed:_name];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return componentAPI;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWComponentDefinitionD)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_finishInitializingComponent:(GSWComponent*)component
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* archive=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
archive=[_bundle archiveNamed:_name];
|
|
|
|
[_bundle initializeObject:component
|
|
|
|
fromArchive:archive];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWComponentDefinition (GSWComponentDefinitionE)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_notifyObserversForDyingComponent:(GSWComponent*)aComponent
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_awakeObserversForComponent:(GSWComponent*)aComponent
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_deallocForComponent:(GSWComponent*)aComponent
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_awakeForComponent:(GSWComponent*)aComponent
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)_registerObserver:(id)observer
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
+(void)_registerObserver:(id)observer
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGClassFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|