From 5b3510e409d1e3c544a57cc5bb3b4ce73b130692 Mon Sep 17 00:00:00 2001 From: mguesdon Date: Mon, 1 Mar 2004 16:46:26 +0000 Subject: [PATCH] o handle cidStore and cidKey git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18737 72102866-910b-0410-8b05-ffd578937521 --- GSWeb.framework/GSWImageButton.h | 6 ++- GSWeb.framework/GSWImageButton.m | 83 +++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 10 deletions(-) diff --git a/GSWeb.framework/GSWImageButton.h b/GSWeb.framework/GSWImageButton.h index 72efed8..6f1c9fb 100644 --- a/GSWeb.framework/GSWImageButton.h +++ b/GSWeb.framework/GSWImageButton.h @@ -1,9 +1,9 @@ /** GSWImageButton.h - GSWeb: Class GSWImageButton - Copyright (C) 1999-2002 Free Software Foundation, Inc. + Copyright (C) 1999-2004 Free Software Foundation, Inc. Written by: Manuel Guesdon - Date: Jan 1999 + Date: Jan 1999 $Revision$ $Date$ @@ -40,6 +40,8 @@ //GSWeb Additions { GSWAssociation* _imageMapString; GSWAssociation* _imageMapRegions; + GSWAssociation* _cidStore; + GSWAssociation* _cidKey; // } GSWAssociation* _action; GSWAssociation* _actionClass; diff --git a/GSWeb.framework/GSWImageButton.m b/GSWeb.framework/GSWImageButton.m index 2cbd7a6..438c644 100644 --- a/GSWeb.framework/GSWImageButton.m +++ b/GSWeb.framework/GSWImageButton.m @@ -1,6 +1,6 @@ /** GSWImageButton.m - GSWeb: Class GSWImageButton - Copyright (C) 1999-2003 Free Software Foundation, Inc. + Copyright (C) 1999-2004 Free Software Foundation, Inc. Written by: Manuel Guesdon Date: Jan 1999 @@ -52,6 +52,8 @@ RCS_ID("$Id$") { [tmpAssociations removeObjectForKey:imageMapString__Key]; [tmpAssociations removeObjectForKey:imageMapRegions__Key]; + [tmpAssociations removeObjectForKey:cidStore__Key]; + [tmpAssociations removeObjectForKey:cidKey__Key]; }; [tmpAssociations removeObjectForKey:action__Key]; [tmpAssociations removeObjectForKey:actionClass__Key]; @@ -101,6 +103,14 @@ RCS_ID("$Id$") imageMapString__Key, imageMapRegions__Key); }; + + _cidStore = [[associations objectForKey:cidStore__Key + withDefaultObject:[_cidStore autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"cidStore=%@",_cidStore); + + _cidKey = [[associations objectForKey:cidKey__Key + withDefaultObject:[_cidKey autorelease]] retain]; + NSDebugMLLog(@"gswdync",@"cidKey=%@",_cidKey); }; _actionClass = [[associations objectForKey:actionClass__Key withDefaultObject:[_actionClass autorelease]] retain]; @@ -145,6 +155,8 @@ RCS_ID("$Id$") DESTROY(_imageMapFileName); DESTROY(_imageMapString);//GSWeb only DESTROY(_imageMapRegions);//GSWeb Only + DESTROY(_cidStore);//GSWeb only + DESTROY(_cidKey);//GSWeb only DESTROY(_action); DESTROY(_actionClass); DESTROY(_directActionName); @@ -207,25 +219,55 @@ RCS_ID("$Id$") GSWResourceManager* resourceManager=nil; GSWURLValuedElementData* dataValue=nil; NSString* keyValue=nil; + id cidStoreValue=nil; + LOGObjectFnStart(); + disabledInContext=[self disabledInContext:context]; + [response _appendContentAsciiString:@" type=image"]; + name=[self nameInContext:context]; NSDebugMLLog(@"gswdync",@"definition name=%@ name=%@", [self definitionName],name); [response _appendContentAsciiString:@" name=\""]; + [response appendContentHTMLAttributeValue:name]; [response appendContentCharacter:'"']; + component=[context component]; + + cidStoreValue=[_cidStore valueInComponent:component]; + NSDebugMLLog(@"gswdync",@"cidStoreValue=%@",cidStoreValue); + resourceManager=[[GSWApplication application]resourceManager]; + if (_src) - urlValue=[_src valueInComponent:component]; + { + urlValue=[_src valueInComponent:component]; + if (cidStoreValue) + { + urlValue=[self addURL:urlValue + forCIDKeyAssociation:_cidKey + CIDStoreAssociation:_cidStore + inContext:context]; + NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue); + }; + } else { if (_key) { keyValue=[_key valueInComponent:component]; dataValue=[resourceManager _cachedDataForKey:keyValue]; + if (cidStoreValue && dataValue) + { + urlValue=[self addURLValuedElementData:dataValue + forCIDKeyAssociation:_cidKey + CIDStoreAssociation:_cidStore + inContext:context]; + NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue); + } }; if (!dataValue && _data) { @@ -235,6 +277,14 @@ RCS_ID("$Id$") mimeType:mimeTypeValue key:keyValue] autorelease]; [resourceManager setURLValuedElementData:dataValue]; + if (cidStoreValue && dataValue) + { + urlValue=[self addURLValuedElementData:dataValue + forCIDKeyAssociation:_cidKey + CIDStoreAssociation:_cidStore + inContext:context]; + NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue); + } } else if (_filename) { @@ -249,10 +299,24 @@ RCS_ID("$Id$") NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue); request=[context request]; languages=[context languages]; - urlValue=[resourceManager urlForResourceNamed:filenameValue - inFramework:frameworkValue - languages:languages - request:request]; + if (cidStoreValue) + { + NSString* path=[resourceManager pathForResourceNamed:filenameValue + inFramework:frameworkValue + languages:languages]; + urlValue=[self addPath:path + forCIDKeyAssociation:_cidKey + CIDStoreAssociation:_cidStore + inContext:context]; + NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue); + } + else + { + urlValue=[resourceManager urlForResourceNamed:filenameValue + inFramework:frameworkValue + languages:languages + request:request]; + }; }; }; @@ -265,8 +329,11 @@ RCS_ID("$Id$") { if (_key || _data) { - [dataValue appendDataURLToResponse:response - inContext:context]; + if (cidStoreValue) + [response appendContentString:urlValue]; + else + [dataValue appendDataURLToResponse:response + inContext:context]; } else if (_filename) {