mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-24 04:01:16 +00:00
o handle cidStore and cidKey
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@18737 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f628ba895a
commit
5b3510e409
2 changed files with 79 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
/** GSWImageButton.h - <title>GSWeb: Class GSWImageButton</title>
|
/** GSWImageButton.h - <title>GSWeb: Class GSWImageButton</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2002 Free Software Foundation, Inc.
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
@ -40,6 +40,8 @@
|
||||||
//GSWeb Additions {
|
//GSWeb Additions {
|
||||||
GSWAssociation* _imageMapString;
|
GSWAssociation* _imageMapString;
|
||||||
GSWAssociation* _imageMapRegions;
|
GSWAssociation* _imageMapRegions;
|
||||||
|
GSWAssociation* _cidStore;
|
||||||
|
GSWAssociation* _cidKey;
|
||||||
// }
|
// }
|
||||||
GSWAssociation* _action;
|
GSWAssociation* _action;
|
||||||
GSWAssociation* _actionClass;
|
GSWAssociation* _actionClass;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/** GSWImageButton.m - <title>GSWeb: Class GSWImageButton</title>
|
/** GSWImageButton.m - <title>GSWeb: Class GSWImageButton</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2003 Free Software Foundation, Inc.
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
@ -52,6 +52,8 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
[tmpAssociations removeObjectForKey:imageMapString__Key];
|
[tmpAssociations removeObjectForKey:imageMapString__Key];
|
||||||
[tmpAssociations removeObjectForKey:imageMapRegions__Key];
|
[tmpAssociations removeObjectForKey:imageMapRegions__Key];
|
||||||
|
[tmpAssociations removeObjectForKey:cidStore__Key];
|
||||||
|
[tmpAssociations removeObjectForKey:cidKey__Key];
|
||||||
};
|
};
|
||||||
[tmpAssociations removeObjectForKey:action__Key];
|
[tmpAssociations removeObjectForKey:action__Key];
|
||||||
[tmpAssociations removeObjectForKey:actionClass__Key];
|
[tmpAssociations removeObjectForKey:actionClass__Key];
|
||||||
|
@ -101,6 +103,14 @@ RCS_ID("$Id$")
|
||||||
imageMapString__Key,
|
imageMapString__Key,
|
||||||
imageMapRegions__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
|
_actionClass = [[associations objectForKey:actionClass__Key
|
||||||
withDefaultObject:[_actionClass autorelease]] retain];
|
withDefaultObject:[_actionClass autorelease]] retain];
|
||||||
|
@ -145,6 +155,8 @@ RCS_ID("$Id$")
|
||||||
DESTROY(_imageMapFileName);
|
DESTROY(_imageMapFileName);
|
||||||
DESTROY(_imageMapString);//GSWeb only
|
DESTROY(_imageMapString);//GSWeb only
|
||||||
DESTROY(_imageMapRegions);//GSWeb Only
|
DESTROY(_imageMapRegions);//GSWeb Only
|
||||||
|
DESTROY(_cidStore);//GSWeb only
|
||||||
|
DESTROY(_cidKey);//GSWeb only
|
||||||
DESTROY(_action);
|
DESTROY(_action);
|
||||||
DESTROY(_actionClass);
|
DESTROY(_actionClass);
|
||||||
DESTROY(_directActionName);
|
DESTROY(_directActionName);
|
||||||
|
@ -207,25 +219,55 @@ RCS_ID("$Id$")
|
||||||
GSWResourceManager* resourceManager=nil;
|
GSWResourceManager* resourceManager=nil;
|
||||||
GSWURLValuedElementData* dataValue=nil;
|
GSWURLValuedElementData* dataValue=nil;
|
||||||
NSString* keyValue=nil;
|
NSString* keyValue=nil;
|
||||||
|
id cidStoreValue=nil;
|
||||||
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
|
|
||||||
disabledInContext=[self disabledInContext:context];
|
disabledInContext=[self disabledInContext:context];
|
||||||
|
|
||||||
[response _appendContentAsciiString:@" type=image"];
|
[response _appendContentAsciiString:@" type=image"];
|
||||||
|
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
NSDebugMLLog(@"gswdync",@"definition name=%@ name=%@",
|
NSDebugMLLog(@"gswdync",@"definition name=%@ name=%@",
|
||||||
[self definitionName],name);
|
[self definitionName],name);
|
||||||
[response _appendContentAsciiString:@" name=\""];
|
[response _appendContentAsciiString:@" name=\""];
|
||||||
|
|
||||||
[response appendContentHTMLAttributeValue:name];
|
[response appendContentHTMLAttributeValue:name];
|
||||||
[response appendContentCharacter:'"'];
|
[response appendContentCharacter:'"'];
|
||||||
|
|
||||||
component=[context component];
|
component=[context component];
|
||||||
|
|
||||||
|
cidStoreValue=[_cidStore valueInComponent:component];
|
||||||
|
NSDebugMLLog(@"gswdync",@"cidStoreValue=%@",cidStoreValue);
|
||||||
|
|
||||||
resourceManager=[[GSWApplication application]resourceManager];
|
resourceManager=[[GSWApplication application]resourceManager];
|
||||||
|
|
||||||
if (_src)
|
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
|
else
|
||||||
{
|
{
|
||||||
if (_key)
|
if (_key)
|
||||||
{
|
{
|
||||||
keyValue=[_key valueInComponent:component];
|
keyValue=[_key valueInComponent:component];
|
||||||
dataValue=[resourceManager _cachedDataForKey:keyValue];
|
dataValue=[resourceManager _cachedDataForKey:keyValue];
|
||||||
|
if (cidStoreValue && dataValue)
|
||||||
|
{
|
||||||
|
urlValue=[self addURLValuedElementData:dataValue
|
||||||
|
forCIDKeyAssociation:_cidKey
|
||||||
|
CIDStoreAssociation:_cidStore
|
||||||
|
inContext:context];
|
||||||
|
NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
if (!dataValue && _data)
|
if (!dataValue && _data)
|
||||||
{
|
{
|
||||||
|
@ -235,6 +277,14 @@ RCS_ID("$Id$")
|
||||||
mimeType:mimeTypeValue
|
mimeType:mimeTypeValue
|
||||||
key:keyValue] autorelease];
|
key:keyValue] autorelease];
|
||||||
[resourceManager setURLValuedElementData:dataValue];
|
[resourceManager setURLValuedElementData:dataValue];
|
||||||
|
if (cidStoreValue && dataValue)
|
||||||
|
{
|
||||||
|
urlValue=[self addURLValuedElementData:dataValue
|
||||||
|
forCIDKeyAssociation:_cidKey
|
||||||
|
CIDStoreAssociation:_cidStore
|
||||||
|
inContext:context];
|
||||||
|
NSDebugMLLog(@"gswdync",@"urlValue=%@",urlValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (_filename)
|
else if (_filename)
|
||||||
{
|
{
|
||||||
|
@ -249,12 +299,26 @@ RCS_ID("$Id$")
|
||||||
NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue);
|
NSDebugMLLog(@"gswdync",@"frameworkValue=%@",frameworkValue);
|
||||||
request=[context request];
|
request=[context request];
|
||||||
languages=[context languages];
|
languages=[context languages];
|
||||||
|
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
|
urlValue=[resourceManager urlForResourceNamed:filenameValue
|
||||||
inFramework:frameworkValue
|
inFramework:frameworkValue
|
||||||
languages:languages
|
languages:languages
|
||||||
request:request];
|
request:request];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
[response _appendContentAsciiString:@" src=\""];
|
[response _appendContentAsciiString:@" src=\""];
|
||||||
if (_src)
|
if (_src)
|
||||||
|
@ -265,6 +329,9 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
if (_key || _data)
|
if (_key || _data)
|
||||||
{
|
{
|
||||||
|
if (cidStoreValue)
|
||||||
|
[response appendContentString:urlValue];
|
||||||
|
else
|
||||||
[dataValue appendDataURLToResponse:response
|
[dataValue appendDataURLToResponse:response
|
||||||
inContext:context];
|
inContext:context];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue