2002-07-04 11:01:56 +00:00
|
|
|
/** GSWBundle.m - <title>GSWeb: Class GSWBundle</title>
|
|
|
|
|
2003-01-19 15:33:07 +00:00
|
|
|
Copyright (C) 1999-2003 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: Mar 1999
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-07-04 11:01:56 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
2003-01-19 15:33:07 +00:00
|
|
|
$Id$
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-07-04 11:01:56 +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-07-04 11:01:56 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-01-19 15:33:07 +00:00
|
|
|
static const char rcsId[] = "$Id$";
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-01-22 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb.framework/Makefile.postamble:
o use $(LN_S) -f in install-WO-headers
o added $(MKDIRS) $(GNUSTEP_HEADERS)/$(GSWExtensions_wo_HEADER_FILES_INSTALL_DIR);
* GSWExtensionsGSW.framework/Makefile.postamble: use $(LN_S) -f in install-WO-headers
2003-01-20 David Ayers <d.ayers@inode.at>
* Makefile.postamble
o added support for make gswnames=(gsw,wo,all) (corrected
typo)
o reinserted support for $(INSTALL_ROOT_DIR)
* config.h.in
o added HAVE_GDL2
* configure
o added support for --with-gswnames=(gsw,wo,all)
o set LIBWRAP during configure
o added config.mak.in as configurable file
* configure.ac
o (see configure)
* config.mak: removed (replaced by config.mak.in)
* config.mak.in: new file
o added support for make gswnames=(gsw,wo,all)
* gsweb.make.in
o add GSANTLR as auxiliary lib
o add gsweb libs to AUXILIARY_GSW_LIBS
o include correct extensions for GSW/WO-libs
* gsweb_wo.make: new file
* GSWeb/GSWConfig.h
o changed support for GSWEB_WONAMES
o conditionally import file GSWWOCompatiblity
here instead of in GSWeb.h
* GSWeb/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o removed reference to unused files:
GSWeb.m, GSWWOCompatibility.m
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWeb/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
o remove Makefile.preamble during distclean
* GSWeb/Makefile.preamble.in
o fixed typo
* GSWeb/GSWeb.h
o moved GSW/WO-Name-mapping to GSWWOCompatibility.h
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWeb.m: removed
* GSWeb/GSWWOCompatibility.h
o changed GSWEB_WONAMES handling
o removed hybrid namespace WO subclasses
o moved & reorganized GSW/WO-Name-mapping from GSWeb.h
o inlucluded missing GSW/WO-Name-mappings
* GSWeb/GSWWOCompatibility.m: removed
* GSWeb/*.m
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWeb/GSWApplication.m
o remove special GSW/WO handling of WOApp
* GSWeb/WebObject/WO*: removed
* GSWeb/WebObject/WebObjects
o replaced inclusions of
<GSWeb/file.h> with "file.h"
* GSWExtensions/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new files:
GSWExtenstions.h, GSWExtWOCompatibility.h
o added support to create WO header files
* GSWExtensions/Makefile.preamble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
* GSWExtensions/Makefile.postamble
o changed support to install WO header files according to
make gswnames=(gsw,wo,all)
* GSWExtensions/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtWOCompatibility.h"
o replaces inclusions of
<GSWExtensions/file.h> with "file.h"
* GSWExtensions/GSWExtensions.h: new file
* GSWExtensions/WOExtensions.h: new file
* GSWExtensions/GSWExtWOCompatibility.h: new file
* GSWExtensionsGSW/GNUMakefile
o added support for make gswnames=(gsw,wo,all)
o ensure each lib gets built with its own object files
o removed deactivated framework extension determination code
o added references to new file GSWExtGSWWOCompatibility.h
o added support to create WO header files
* GSWExtensionsGSW/Makefile.pramble
o let gnustep make figure whether to link agains debug libs
o added support for make gswnames=(gsw,wo,all)
o removed GSWExtensions from ADDITIONAL_LIB_DIRS
* GSWExtensionsGSW/*.m
o replaced inclusions of
<GSWeb/GSWeb.h> with "GSWExtGSWWOCompatibility.h"
* GSWExtensions/GSWExtGSWWOCompatibility.h: new file
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@15675 72102866-910b-0410-8b05-ffd578937521
2003-01-22 12:24:26 +00:00
|
|
|
#include "GSWeb.h"
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2001-10-27 10:27:33 +00:00
|
|
|
#ifdef GDL2
|
2000-10-04 22:19:43 +00:00
|
|
|
//====================================================================
|
|
|
|
@interface GSWBundleUnarchiverDelegate : NSObject
|
|
|
|
{
|
|
|
|
id _object;
|
|
|
|
}
|
|
|
|
- (id) unarchiver:(EOKeyValueUnarchiver*)unarchiver
|
|
|
|
objectForReference:(NSString*)keyPath;
|
|
|
|
- (id) initWithObject:(id)object;
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundleUnarchiverDelegate
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[super dealloc];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
- (id) unarchiver:(EOKeyValueUnarchiver*)unarchiver
|
|
|
|
objectForReference:(NSString*)keyPath
|
|
|
|
{
|
|
|
|
return [_object valueForKeyPath:keyPath];
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
- (id) initWithObject:(id)object
|
|
|
|
{
|
|
|
|
if ((self=[super init]))
|
|
|
|
{
|
|
|
|
_object=object;
|
|
|
|
};
|
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
2001-10-27 10:27:33 +00:00
|
|
|
#endif // GDL2
|
2000-01-22 12:49:49 +00:00
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundle
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithPath:(NSString*)aPath
|
|
|
|
baseURL:(NSString*)aBaseURL
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return [self initWithPath:aPath
|
|
|
|
baseURL:aBaseURL
|
|
|
|
inFrameworkNamed:nil];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)initWithPath:(NSString*)aPath
|
|
|
|
baseURL:(NSString*)aBaseURL
|
|
|
|
inFrameworkNamed:(NSString*)aFrameworkName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
if ((self=[super init]))
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
|
|
|
NSDebugMLLog(@"bundles",@"aPath=%@",aPath);
|
|
|
|
NSDebugMLLog(@"bundles",@"aBaseURL=%@",aBaseURL);
|
|
|
|
ASSIGN(_path,[aPath stringGoodPath]);
|
|
|
|
NSDebugMLLog(@"bundles",@"path=%@",_path);
|
|
|
|
ASSIGN(_baseURL,aBaseURL);
|
|
|
|
ASSIGN(_frameworkName,aFrameworkName);
|
|
|
|
_archiveCache=[NSMutableDictionary new];
|
|
|
|
_apiCache=[NSMutableDictionary new];
|
|
|
|
_encodingCache=[NSMutableDictionary new];
|
2002-10-12 11:25:06 +00:00
|
|
|
_templateParserTypeCache=[NSMutableDictionary new];
|
2002-08-04 18:00:11 +00:00
|
|
|
_pathCache=[NSMutableDictionary new];
|
|
|
|
_urlCache=[NSMutableDictionary new];
|
|
|
|
_stringsTableCache=[NSMutableDictionary new];
|
|
|
|
_stringsTableArrayCache=[NSMutableDictionary new];
|
|
|
|
_templateCache=[NSMutableDictionary new];
|
|
|
|
_classCache=[NSMutableDictionary new];
|
|
|
|
_selfLock=[NSRecursiveLock new];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)dealloc
|
|
|
|
{
|
|
|
|
GSWLogC("Dealloc GSWBundle");
|
|
|
|
GSWLogC("Dealloc GSWBundle: path");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_path);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: baseURL");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_baseURL);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: archiveCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_archiveCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: apiCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_apiCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: encodingCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_encodingCache);
|
2002-10-12 11:25:06 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: templateParserTypeCache");
|
|
|
|
DESTROY(_templateParserTypeCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: pathCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_pathCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: urlCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_urlCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: stringsTableCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_stringsTableCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: stringsTableArrayCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_stringsTableArrayCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: templateCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_templateCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: classCache");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_classCache);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle: selfLock");
|
2002-08-04 18:00:11 +00:00
|
|
|
DESTROY(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
GSWLogC("Dealloc GSWBundle Super");
|
|
|
|
[super dealloc];
|
|
|
|
GSWLogC("End Dealloc GSWBundle");
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)baseURL
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _baseURL;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)path
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)frameworkName
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
return _frameworkName;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(NSString*)description
|
|
|
|
{
|
|
|
|
NSString* descr=nil;
|
|
|
|
// GSWLogC("GSWBundle description A");
|
|
|
|
// NSDebugMLLog(@"bundles",@"GSWBundle description Self=%p",self);
|
|
|
|
descr=[NSString stringWithFormat:@"<%s %p - ",
|
2002-08-04 18:00:11 +00:00
|
|
|
object_get_class_name(self),
|
|
|
|
(void*)self];
|
|
|
|
// GSWLogC("GSWBundle description B");
|
2000-01-22 12:49:49 +00:00
|
|
|
descr=[descr stringByAppendingFormat:@"path:[%@] ",
|
2002-08-04 18:00:11 +00:00
|
|
|
_path];
|
|
|
|
// GSWLogC("GSWBundle description C");
|
2000-01-22 12:49:49 +00:00
|
|
|
descr=[descr stringByAppendingFormat:@"baseURL:[%@] frameworkName:[%@]>",
|
2002-08-04 18:00:11 +00:00
|
|
|
_baseURL,
|
|
|
|
_frameworkName];
|
2000-01-22 12:49:49 +00:00
|
|
|
// GSWLogC("GSWBundle description D");
|
|
|
|
return descr;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)unlock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
|
|
|
|
TmpUnlock(_selfLock);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn--;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)lock
|
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
|
|
|
|
TmpLockBeforeDate(_selfLock,[NSDate dateWithTimeIntervalSinceNow:GSLOCK_DELAY_S]);
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
_selfLockn++;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"selfLockn=%d",_selfLockn);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundle (GSWBundleCache)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)clearCache
|
|
|
|
{
|
|
|
|
//OK
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
//TemplateCache clearr ?
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(void)loadCache
|
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundle (GSWBundleA)
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)lockedResourceNamed:(NSString*)aName
|
|
|
|
ofType:(NSString*)aType
|
|
|
|
withLanguages:(NSArray*)someLanguages
|
|
|
|
usingCache:(NSMutableDictionary*)aCache
|
|
|
|
relativePath:(NSString**)aRelativePath
|
|
|
|
absolutePath:(NSString**)anAbsolutePath
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
int languageIndex=0;
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
NSString* fileName=nil;
|
|
|
|
NSString* language=nil;
|
|
|
|
id resource=nil;
|
|
|
|
NSString* path=nil;
|
|
|
|
NSFileManager* fileManager=nil;
|
|
|
|
int languagesNb=nil;
|
|
|
|
BOOL exists=NO;
|
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
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"type=%@",aType);
|
|
|
|
languagesNb=[someLanguages count];
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
fileManager=[NSFileManager defaultManager];
|
|
|
|
NSAssert(fileManager,@"No fileManager");
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-08-04 18:00:11 +00:00
|
|
|
fileName=[NSString stringWithFormat:@"%@.%@",aName,aType];
|
|
|
|
NSDebugMLLog(@"bundles",@"fileName=%@",fileName);
|
|
|
|
for(languageIndex=0;!resource && !path && languageIndex<=languagesNb;languageIndex++)
|
|
|
|
{
|
|
|
|
language=nil;
|
|
|
|
if (languageIndex==languagesNb)
|
|
|
|
relativePath=[NSString stringWithFormat:@"/%@",
|
|
|
|
fileName];
|
|
|
|
else
|
|
|
|
{
|
|
|
|
language=[someLanguages objectAtIndex:languageIndex];
|
|
|
|
relativePath=[NSString stringWithFormat:@"/%@.%@/%@",
|
|
|
|
language,
|
|
|
|
GSLanguageSuffix,
|
|
|
|
fileName];
|
|
|
|
};
|
|
|
|
NSDebugMLLog(@"bundles",@"language=%@",language);
|
|
|
|
NSDebugMLLog(@"bundles",@"relativePath=%@",relativePath);
|
|
|
|
absolutePath=[_path stringByAppendingString:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"absolutePath=%@",absolutePath);
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
resource=[aCache objectForKey:relativePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"resource=%@",resource);
|
|
|
|
if (resource==GSNotFoundMarker)
|
|
|
|
{
|
|
|
|
resource=nil;
|
|
|
|
absolutePath=nil;
|
|
|
|
relativePath=nil;
|
|
|
|
}
|
|
|
|
else if (!resource)
|
|
|
|
{
|
|
|
|
exists=[fileManager fileExistsAtPath:absolutePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"%@ exists=%s",absolutePath,(exists ? "YES" : "NO"));
|
|
|
|
if (!exists)
|
2001-03-14 22:12:57 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
[aCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativePath];
|
|
|
|
relativePath=nil;
|
|
|
|
absolutePath=nil;
|
|
|
|
};
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
2002-08-04 18:00:11 +00:00
|
|
|
if (aRelativePath)
|
|
|
|
*aRelativePath=relativePath;
|
|
|
|
if (anAbsolutePath)
|
|
|
|
*anAbsolutePath=absolutePath;
|
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
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return resource;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundle (GSWResourceManagement)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)initializeObject:(id)anObject
|
|
|
|
fromArchiveNamed:(NSString*)aName
|
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
|
|
|
NSDebugMLLog(@"bundles",@"anObject:%@",anObject);
|
|
|
|
NSDebugMLLog(@"bundles",@"aName:%@",aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
//call application _isDynamicLoadingEnabled
|
|
|
|
//call -- isTerminating
|
|
|
|
//call -- isCachingEnabled
|
2000-10-04 22:19:43 +00:00
|
|
|
//call -- isPageRefreshOnBacktrackEnabled//0
|
2002-08-04 18:00:11 +00:00
|
|
|
archive=[self archiveNamed:aName];
|
2000-01-22 12:49:49 +00:00
|
|
|
//Verify
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"archive:%@",archive);
|
|
|
|
if (archive)
|
|
|
|
[self initializeObject:anObject
|
|
|
|
fromArchive:archive];
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(void)initializeObject:(id)anObject
|
|
|
|
fromArchive:(NSDictionary*)anArchive
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"anObject:%@",anObject);
|
|
|
|
NSDebugMLLog(@"bundles",@"anArchive:%@",anArchive);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2000-10-04 22:19:43 +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
|
|
|
if (!WOStrictFlag)
|
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* userDictionary=[anArchive objectForKey:@"userDictionary"];
|
|
|
|
NSDictionary* userAssociations=[anArchive objectForKey:@"userAssociations"];
|
|
|
|
NSDictionary* defaultAssociations=[anArchive objectForKey:@"defaultAssociations"];
|
|
|
|
NSDebugMLLog(@"bundles",@"userDictionary:%@",userDictionary);
|
|
|
|
NSDebugMLLog(@"bundles",@"userAssociations:%@",userAssociations);
|
|
|
|
NSDebugMLLog(@"bundles",@"defaultAssociations:%@",defaultAssociations);
|
|
|
|
userAssociations=[userAssociations dictionaryByReplacingStringsWithAssociations];
|
|
|
|
NSDebugMLLog(@"bundles",@"userAssociations:%@",userAssociations);
|
|
|
|
defaultAssociations=[defaultAssociations dictionaryByReplacingStringsWithAssociations];
|
|
|
|
NSDebugMLLog(@"bundles",@"defaultAssociations:%@",defaultAssociations);
|
|
|
|
if (userDictionary && [anObject respondsToSelector:@selector(setUserDictionary:)])
|
|
|
|
[anObject setUserDictionary:userDictionary];
|
|
|
|
if (userAssociations && [anObject respondsToSelector:@selector(setUserAssociations:)])
|
|
|
|
[anObject setUserAssociations:userAssociations];
|
|
|
|
if (defaultAssociations && [anObject respondsToSelector:@selector(setDefaultAssociations:)])
|
|
|
|
[anObject setDefaultAssociations:defaultAssociations];
|
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-10-04 22:19:43 +00:00
|
|
|
#if GDL2 // GDL2 implementation
|
|
|
|
{
|
|
|
|
EOKeyValueUnarchiver* unarchiver=nil;
|
|
|
|
GSWBundleUnarchiverDelegate* bundleDelegate=nil;
|
|
|
|
NSDictionary* variables=nil;
|
|
|
|
NSEnumerator* variablesEnum=nil;
|
|
|
|
id variableName=nil;
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"anArchive %p:%@",anArchive,anArchive);
|
|
|
|
unarchiver=[[[EOKeyValueUnarchiver alloc] initWithDictionary:anArchive]
|
2000-10-04 22:19:43 +00:00
|
|
|
autorelease];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"unarchiver %p:%@",unarchiver,unarchiver);
|
2002-08-04 18:00:11 +00:00
|
|
|
bundleDelegate=[[[GSWBundleUnarchiverDelegate alloc] initWithObject:anObject]
|
2000-10-04 22:19:43 +00:00
|
|
|
autorelease];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"bundleDelegate %p:%@",bundleDelegate,bundleDelegate);
|
2000-10-04 22:19:43 +00:00
|
|
|
[unarchiver setDelegate:bundleDelegate];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"decodevar here=%p",[NSString string]);
|
2000-10-04 22:19:43 +00:00
|
|
|
variables=[unarchiver decodeObjectForKey:@"variables"];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"variables %p:%@",variables,variables);
|
2000-10-04 22:19:43 +00:00
|
|
|
[unarchiver finishInitializationOfObjects];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
2000-10-04 22:19:43 +00:00
|
|
|
[unarchiver awakeObjects];
|
|
|
|
variablesEnum=[variables keyEnumerator];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"here=%p",[NSString string]);
|
|
|
|
NSDebugMLLog0(@"bundles",@"Will set variables");
|
2000-10-04 22:19:43 +00:00
|
|
|
while ((variableName = [variablesEnum nextObject]))
|
|
|
|
{
|
|
|
|
id variableValue=[variables objectForKey:variableName];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"ObjectClas=%@ variableName %p:%@ variableValue %p:%@",
|
2002-08-04 18:00:11 +00:00
|
|
|
[anObject class],
|
2002-01-26 10:43:23 +00:00
|
|
|
variableName,
|
|
|
|
variableName,
|
|
|
|
variableValue,
|
|
|
|
variableValue);
|
|
|
|
NSDebugMLLog(@"bundles",@"BEF variableValue %p:%@ [RC=%d]",
|
|
|
|
variableValue,
|
|
|
|
variableValue,
|
|
|
|
[variableValue retainCount]);
|
2002-08-04 18:00:11 +00:00
|
|
|
[anObject smartTakeValue:variableValue
|
2000-10-04 22:19:43 +00:00
|
|
|
forKey:variableName];
|
2002-01-26 10:43:23 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"AFT variableValue %p:%@ [RC=%d]",
|
|
|
|
variableValue,
|
|
|
|
variableValue,
|
|
|
|
[variableValue retainCount]);
|
2000-10-04 22:19:43 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
#else
|
|
|
|
LOGObjectFnNotImplemented();
|
|
|
|
#endif
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2000-10-04 22:19:43 +00:00
|
|
|
{
|
2002-12-06 14:28:27 +00:00
|
|
|
NSDebugMLog(@"EXCEPTION:%@ (%@) [%s %d] anObject=%p class=%@ superClass=%@ ",
|
2000-10-04 22:19:43 +00:00
|
|
|
localException,
|
|
|
|
[localException reason],
|
|
|
|
__FILE__,
|
2002-12-06 14:28:27 +00:00
|
|
|
__LINE__,
|
|
|
|
anObject,
|
|
|
|
[anObject class],
|
|
|
|
[anObject superclass]);
|
2000-10-04 22:19:43 +00:00
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(Class)scriptedClassWithName:(NSString*)aName
|
|
|
|
superclassName:(NSString*)aSuperclassName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
Class aClass=nil;
|
|
|
|
NSString* pathName=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"Name=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"aSuperclassName=%@",aSuperclassName);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
pathName=[self lockedScriptedClassPathWithName:aName];
|
|
|
|
//Verify
|
|
|
|
if (pathName)
|
|
|
|
{
|
|
|
|
aClass=[self lockedScriptedClassWithName:aName
|
|
|
|
pathName:pathName
|
|
|
|
superclassName:aSuperclassName];
|
|
|
|
};
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return aClass;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(Class)lockedScriptedClassWithName:(NSString*)aName
|
|
|
|
pathName:(NSString*)aPathName
|
|
|
|
superclassName:(NSString*)aSuperclassName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)lockedScriptedClassPathWithName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* path=nil;
|
|
|
|
id script=nil;
|
|
|
|
script=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWScriptSuffix[GSWebNamingConv]
|
|
|
|
withLanguages:nil
|
|
|
|
usingCache:_classCache
|
|
|
|
relativePath:NULL
|
|
|
|
absolutePath:&path];
|
|
|
|
if (!script && !path)
|
|
|
|
script=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWScriptSuffix[GSWebNamingConvInversed]
|
|
|
|
withLanguages:nil
|
|
|
|
usingCache:_classCache
|
|
|
|
relativePath:NULL
|
|
|
|
absolutePath:&path];
|
|
|
|
return path;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(Class)compiledClassWithName:(NSString*)aName
|
|
|
|
superclassName:(NSString*)aSuperclassName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(GSWElement*)templateNamed:(NSString*)aName
|
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWElement* template=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"Name=%@",aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
//OK
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
template=[self lockedTemplateNamed:aName
|
|
|
|
languages:someLanguages];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
|
|
|
@"In lockedTemplateNamed");
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"template=%@",template);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return template;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(GSWElement*)lockedTemplateNamed:(NSString*)aName
|
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWElement* template=nil;
|
|
|
|
NSString* relativeTemplatePath=nil;
|
|
|
|
NSString* absoluteTemplatePath=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"AName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"SomeLanguages=%@",someLanguages);
|
|
|
|
NSDebugMLLog(@"bundles",@"Path=%@",_path);
|
|
|
|
NSDebugMLLog(@"bundles",@"baseURL=%@",_baseURL);
|
|
|
|
NSDebugMLLog(@"bundles",@"frameworkName=%@",_frameworkName);
|
|
|
|
template=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWComponentTemplateSuffix
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:_templateCache
|
|
|
|
relativePath:&relativeTemplatePath
|
|
|
|
absolutePath:&absoluteTemplatePath];
|
|
|
|
if (!template)
|
|
|
|
{
|
|
|
|
if (!relativeTemplatePath)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"errors",@"No template named:%@ for languages:%@",
|
|
|
|
aName,
|
|
|
|
someLanguages);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-12 11:25:06 +00:00
|
|
|
GSWTemplateParserType templateParserType=[self templateParserTypeForResourcesNamed:aName];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSStringEncoding encoding=[self encodingForResourcesNamed:aName];
|
|
|
|
NSString* pageDefString=nil;
|
|
|
|
//TODO use encoding !
|
|
|
|
NSString* htmlString=[NSString stringWithContentsOfFile:absoluteTemplatePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"htmlPath=%@",absoluteTemplatePath);
|
|
|
|
if (!htmlString)
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"errors",@"No html file for template named:%@ for languages:%@",
|
|
|
|
aName,
|
|
|
|
someLanguages);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NSString* absoluteDefinitionPath=nil;
|
|
|
|
pageDefString=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWComponentDefinitionSuffix[GSWebNamingConv]
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:nil
|
|
|
|
relativePath:NULL
|
|
|
|
absolutePath:&absoluteDefinitionPath];
|
|
|
|
NSDebugMLLog(@"bundles",@"absoluteDefinitionPath=%@",
|
|
|
|
absoluteDefinitionPath);
|
|
|
|
if (!pageDefString && !absoluteDefinitionPath)
|
|
|
|
{
|
|
|
|
pageDefString=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWComponentDefinitionSuffix[GSWebNamingConvInversed]
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:nil
|
|
|
|
relativePath:NULL
|
|
|
|
absolutePath:&absoluteDefinitionPath];
|
|
|
|
NSDebugMLLog(@"bundles",@"absoluteDefinitionPath=%@",
|
|
|
|
absoluteDefinitionPath);
|
|
|
|
};
|
|
|
|
|
|
|
|
if (absoluteDefinitionPath)
|
|
|
|
{
|
|
|
|
//TODO use encoding !
|
|
|
|
NSDebugMLLog(@"bundles",@"absoluteDefinitionPath=%@",
|
|
|
|
absoluteDefinitionPath);
|
|
|
|
pageDefString=[NSString stringWithContentsOfFile:absoluteDefinitionPath];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
NS_DURING
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"GSWTemplateParser on template named %@",
|
|
|
|
aName);
|
2002-10-12 11:25:06 +00:00
|
|
|
template=[GSWTemplateParser templateNamed:aName
|
|
|
|
inFrameworkNamed:[self frameworkName]
|
|
|
|
withParserType:templateParserType
|
|
|
|
parserClassName:nil
|
|
|
|
withString:htmlString
|
|
|
|
encoding:encoding
|
|
|
|
fromPath:absoluteTemplatePath
|
|
|
|
definitionsString:pageDefString
|
|
|
|
languages:someLanguages
|
|
|
|
definitionPath:absoluteDefinitionPath];
|
2002-08-04 18:00:11 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
#ifndef NDEBUG
|
2002-08-04 18:00:11 +00:00
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,
|
|
|
|
[localException reason],
|
|
|
|
__FILE__,
|
|
|
|
__LINE__);
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
|
|
|
@"In template Parsing");
|
|
|
|
[localException raise];
|
|
|
|
};
|
|
|
|
NS_ENDHANDLER;
|
2000-01-22 12:49:49 +00:00
|
|
|
#endif
|
2002-08-04 18:00:11 +00:00
|
|
|
GSWLogC("TemplateParsed\n");
|
|
|
|
NSDebugMLLog(@"bundles",@"template=%@",template);
|
|
|
|
};
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
if (template)
|
|
|
|
[_templateCache setObject:template
|
|
|
|
forKey:relativeTemplatePath];
|
|
|
|
else
|
|
|
|
[_templateCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativeTemplatePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
NSDebugMLLog(@"bundles",@"template=%@",template);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return template;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSString*)stringForKey:(NSString*)aKey
|
|
|
|
inTableNamed:(NSString*)aName
|
|
|
|
withDefaultValue:(NSString*)defaultValue
|
|
|
|
languages:(NSArray*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* stringsTable=nil;
|
|
|
|
NSString* string=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"AKey=%@",aKey);
|
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"SomeLanguages=%@",someLanguages);
|
|
|
|
NSDebugMLLog(@"bundles",@"defaultValue_=%@",defaultValue);
|
|
|
|
stringsTable=[self stringsTableNamed:aName
|
|
|
|
withLanguages:someLanguages];
|
|
|
|
if (stringsTable)
|
|
|
|
string=[stringsTable objectForKey:aKey];
|
|
|
|
if (!string)
|
|
|
|
string=defaultValue;
|
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*)someLanguages
|
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
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"SomeLanguages=%@",someLanguages);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
LOGObjectFnStart();
|
|
|
|
stringsTable=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWStringTableSuffix
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:_stringsTableCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
if (!stringsTable)
|
|
|
|
{
|
|
|
|
if (absolutePath)
|
|
|
|
{
|
|
|
|
//TODO use encoding ??
|
|
|
|
stringsTable=[NSDictionary dictionaryWithContentsOfFile:absolutePath];
|
|
|
|
if (!stringsTable)
|
|
|
|
{
|
|
|
|
NSString* tmpString=[NSString stringWithContentsOfFile:absolutePath];
|
|
|
|
LOGSeriousError(@"Bad stringTable \n%@\n from file %@",
|
|
|
|
tmpString,
|
|
|
|
absolutePath);
|
|
|
|
};
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
if (stringsTable)
|
|
|
|
[_stringsTableCache setObject:stringsTable
|
|
|
|
forKey:relativePath];
|
|
|
|
else
|
|
|
|
[_stringsTableCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
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*)someLanguages
|
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
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"SomeLanguages=%@",someLanguages);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
LOGObjectFnStart();
|
|
|
|
stringsTableArray=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWStringTableArraySuffix
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:_stringsTableArrayCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
if (!stringsTableArray)
|
|
|
|
{
|
|
|
|
if (absolutePath)
|
|
|
|
{
|
|
|
|
//TODO use encoding ??
|
|
|
|
stringsTableArray=[NSArray arrayWithContentsOfFile:absolutePath];
|
|
|
|
if (!stringsTableArray)
|
|
|
|
{
|
|
|
|
NSString* tmpString=[NSString stringWithContentsOfFile:absolutePath];
|
|
|
|
LOGSeriousError(@"Bad stringTableArray \n%@\n from file %@",
|
|
|
|
tmpString,
|
|
|
|
absolutePath);
|
|
|
|
};
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
if (stringsTableArray)
|
|
|
|
[_stringsTableArrayCache setObject:stringsTableArray
|
|
|
|
forKey:relativePath];
|
|
|
|
else
|
|
|
|
[_stringsTableArrayCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
|
|
|
@"During stringsTableArrayNamed:withLanguages:");
|
|
|
|
LOGException(@"exception=%@",localException);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
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*)aType
|
|
|
|
languages:(NSArray*)someLanguages
|
|
|
|
request:(GSWRequest*)aRequest
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
BOOL isUsingWebServer=NO;
|
|
|
|
NSString* url=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
isUsingWebServer=[aRequest _isUsingWebServer];
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
NSString* baseURL=nil;
|
|
|
|
LOGObjectFnStart();
|
|
|
|
baseURL=[self lockedResourceNamed:aName
|
|
|
|
ofType:aType
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:_urlCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
if (!baseURL)
|
|
|
|
{
|
|
|
|
if (relativePath)
|
|
|
|
{
|
|
|
|
baseURL=relativePath;
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
[_pathCache setObject:baseURL
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (baseURL)
|
|
|
|
{
|
|
|
|
if (isUsingWebServer)
|
|
|
|
{
|
|
|
|
url=[_baseURL stringByAppendingString:baseURL];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NSString* completePath=[_path stringByAppendingString:baseURL];
|
|
|
|
url=(NSString*)[aRequest _urlWithRequestHandlerKey:GSWResourceRequestHandlerKey[GSWebNamingConv]
|
|
|
|
path:nil
|
|
|
|
queryString:[NSString stringWithFormat:@"%@=%@",
|
|
|
|
GSWKey_Data[GSWebNamingConv],
|
|
|
|
completePath]];//TODO Escape
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
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*)someLanguages
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSString* absolutePath=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"aType=%@",aType);
|
|
|
|
NSDebugMLLog(@"bundles",@"someLanguages=%@",someLanguages);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSString* path=nil;
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
LOGObjectFnStart();
|
|
|
|
path=[self lockedResourceNamed:aName
|
|
|
|
ofType:aType
|
|
|
|
withLanguages:someLanguages
|
|
|
|
usingCache:_stringsTableCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
if (path)
|
|
|
|
absolutePath=path;
|
|
|
|
else if (absolutePath
|
|
|
|
&&[[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
[_pathCache setObject:absolutePath
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return absolutePath;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSStringEncoding)encodingForResourcesNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* archive=nil;
|
|
|
|
NSStringEncoding encoding=GSUndefinedEncoding;
|
|
|
|
id encodingObject=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"encodingCache=%@",_encodingCache);
|
|
|
|
NSDebugMLLog(@"bundles",@"archiveCache=%@",_archiveCache);
|
|
|
|
encodingObject=[_encodingCache objectForKey:aName];
|
|
|
|
if (!encodingObject)
|
|
|
|
{
|
|
|
|
archive=[self archiveNamed:aName];
|
|
|
|
if (archive)
|
|
|
|
{
|
|
|
|
encodingObject=[archive objectForKey:@"encoding"];
|
|
|
|
if (encodingObject)
|
|
|
|
{
|
|
|
|
encodingObject=[NSNumber valueFromString:encodingObject];
|
|
|
|
[_encodingCache setObject:encodingObject
|
|
|
|
forKey:aName];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (encodingObject)
|
|
|
|
encoding=[encodingObject unsignedIntValue];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return encoding;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
2002-10-12 11:25:06 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
-(GSWTemplateParserType)templateParserTypeForResourcesNamed:(NSString*)aName
|
|
|
|
{
|
|
|
|
NSDictionary* archive=nil;
|
|
|
|
GSWTemplateParserType templateParserType=GSWTemplateParserType_Default;
|
|
|
|
id templateParserTypeObject=nil;
|
|
|
|
LOGObjectFnStart();
|
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
|
|
|
NSDebugMLLog(@"bundles",@"templateParserTypeCache=%@",_templateParserTypeCache);
|
|
|
|
NSDebugMLLog(@"bundles",@"archiveCache=%@",_archiveCache);
|
|
|
|
templateParserTypeObject=[_templateParserTypeCache objectForKey:aName];
|
|
|
|
if (!templateParserTypeObject)
|
|
|
|
{
|
|
|
|
archive=[self archiveNamed:aName];
|
|
|
|
if (archive)
|
|
|
|
{
|
|
|
|
templateParserTypeObject=[archive objectForKey:@"templateParserType"];
|
|
|
|
if (templateParserTypeObject)
|
|
|
|
{
|
2003-01-19 15:33:07 +00:00
|
|
|
templateParserTypeObject=[NSNumber numberWithInt:[GSWTemplateParser templateParserTypeFromString:templateParserTypeObject]];
|
2002-10-12 11:25:06 +00:00
|
|
|
[_templateParserTypeCache setObject:templateParserTypeObject
|
|
|
|
forKey:aName];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (templateParserTypeObject)
|
|
|
|
templateParserType=[templateParserTypeObject intValue];
|
|
|
|
}
|
|
|
|
NS_HANDLER
|
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
|
|
|
LOGObjectFnStop();
|
|
|
|
return templateParserType;
|
|
|
|
};
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSDictionary*)archiveNamed:(NSString*)aName
|
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
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
archive=[self lockedArchiveNamed:aName];
|
|
|
|
NSDebugMLLog(@"bundles",@"archive=%@",archive);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"archive=%@",archive);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return archive;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSDictionary*)lockedArchiveNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* archive=nil;
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
BOOL isCachingEnabled=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"search=%@.%@",aName,GSWArchiveSuffix[GSWebNamingConv]);
|
|
|
|
archive=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWArchiveSuffix[GSWebNamingConv]
|
|
|
|
withLanguages:nil
|
|
|
|
usingCache:_archiveCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"archive=%p absolutePath=%@",archive,absolutePath);
|
|
|
|
if (!archive && !absolutePath)
|
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
|
|
|
NSDebugMLLog(@"bundles",@"search=%@.%@",aName,GSWArchiveSuffix[GSWebNamingConvInversed]);
|
|
|
|
archive=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWArchiveSuffix[GSWebNamingConvInversed]
|
|
|
|
withLanguages:nil
|
|
|
|
usingCache:_archiveCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
NSDebugMLLog(@"bundles",@"archive=%p absolutePath=%@",archive,absolutePath);
|
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 (!archive)
|
|
|
|
{
|
|
|
|
if (absolutePath)
|
|
|
|
{
|
|
|
|
archive=[NSDictionary dictionaryWithContentsOfFile:absolutePath];
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
if (archive)
|
|
|
|
[_archiveCache setObject:archive
|
|
|
|
forKey:relativePath];
|
|
|
|
else
|
|
|
|
[_archiveCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
NSDebugMLLog(@"bundles",@"archive=%@",archive);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return archive;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSDictionary*)apiNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* api=nil;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"aName=%@",aName);
|
2000-01-22 12:49:49 +00:00
|
|
|
[self lock];
|
|
|
|
NS_DURING
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
api=[self lockedApiNamed:aName];
|
|
|
|
NSDebugMLLog(@"bundles",@"api=%@",api);
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_HANDLER
|
2002-08-04 18:00:11 +00:00
|
|
|
{
|
|
|
|
NSDebugMLLog(@"bundles",@"EXCEPTION:%@ (%@) [%s %d]",
|
|
|
|
localException,[localException reason],__FILE__,__LINE__);
|
|
|
|
//TODO
|
|
|
|
[self unlock];
|
|
|
|
[localException raise];
|
|
|
|
};
|
2000-01-22 12:49:49 +00:00
|
|
|
NS_ENDHANDLER;
|
|
|
|
[self unlock];
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDebugMLLog(@"bundles",@"api=%@",api);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return api;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(NSDictionary*)lockedApiNamed:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
//OK
|
2002-08-04 18:00:11 +00:00
|
|
|
NSDictionary* api=nil;
|
|
|
|
NSString* relativePath=nil;
|
|
|
|
NSString* absolutePath=nil;
|
|
|
|
BOOL isCachingEnabled=NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStart();
|
2002-08-04 18:00:11 +00:00
|
|
|
api=[self lockedResourceNamed:aName
|
|
|
|
ofType:GSWAPISuffix
|
|
|
|
withLanguages:nil
|
|
|
|
usingCache:_apiCache
|
|
|
|
relativePath:&relativePath
|
|
|
|
absolutePath:&absolutePath];
|
|
|
|
if (!api)
|
|
|
|
{
|
|
|
|
if (absolutePath)
|
|
|
|
{
|
|
|
|
api=[NSDictionary dictionaryWithContentsOfFile:absolutePath];
|
|
|
|
if ([[GSWApplication application] isCachingEnabled])
|
|
|
|
{
|
|
|
|
if (api)
|
|
|
|
[_apiCache setObject:api
|
|
|
|
forKey:relativePath];
|
|
|
|
else
|
|
|
|
[_apiCache setObject:GSNotFoundMarker
|
|
|
|
forKey:relativePath];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
NSDebugMLLog(@"bundles",@"api=%@",api);
|
2000-01-22 12:49:49 +00:00
|
|
|
LOGObjectFnStop();
|
2002-08-04 18:00:11 +00:00
|
|
|
return api;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
//====================================================================
|
|
|
|
@implementation GSWBundle (GSWBundleC)
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)scriptedClassNameFromClassName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
2002-08-04 18:00:11 +00:00
|
|
|
-(id)scriptPathNameFromScriptedClassName:(NSString*)aName
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
|
|
|
LOGObjectFnNotImplemented(); //TODOFN
|
|
|
|
return nil;
|
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|