2002-05-14 11:28:50 +00:00
|
|
|
/** GSWForm.m - <title>GSWeb: Class GSWForm</title>
|
|
|
|
|
2005-04-05 15:54:24 +00:00
|
|
|
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
Written by: David Wetzel <dave@turbocat.de> http://www.turbocat.de/
|
|
|
|
Date: Jan 2006
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
$Revision$
|
|
|
|
$Date$
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
This file is part of the GNUstep Web Library.
|
|
|
|
|
2002-05-14 11:28:50 +00:00
|
|
|
<license>
|
2000-01-22 12:49:49 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2002-05-14 11:28:50 +00:00
|
|
|
</license>
|
|
|
|
**/
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2003-03-21 14:32:57 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
RCS_ID("$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
|
|
|
|
2004-12-31 14:33:16 +00:00
|
|
|
static GSWIMP_BOOL standardEvaluateConditionInContextIMP = NULL;
|
|
|
|
|
|
|
|
static Class standardClass = Nil;
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
//====================================================================
|
|
|
|
@implementation GSWForm
|
|
|
|
|
2004-12-31 14:33:16 +00:00
|
|
|
//--------------------------------------------------------------------
|
|
|
|
+ (void) initialize
|
|
|
|
{
|
|
|
|
if (self == [GSWForm class])
|
|
|
|
{
|
|
|
|
standardClass=[GSWForm class];
|
|
|
|
|
|
|
|
standardEvaluateConditionInContextIMP =
|
|
|
|
(GSWIMP_BOOL)[self instanceMethodForSelector:evaluateConditionInContextSEL];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(id)initWithName:(NSString*)name
|
2002-05-14 11:28:50 +00:00
|
|
|
associations:(NSDictionary*)associations
|
2007-04-13 18:32:02 +00:00
|
|
|
template:(GSWElement*)template
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
GSWConstantValueAssociation * methodAssoc = nil;
|
|
|
|
|
|
|
|
self = [super initWithName:@"form" associations:associations template:template];
|
|
|
|
if (!self) {
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
DESTROY(_otherQueryAssociations);
|
|
|
|
_otherQueryAssociations = RETAIN([_associations extractObjectsForKeysWithPrefix:@"?" removePrefix: YES]);
|
|
|
|
|
|
|
|
if ((_otherQueryAssociations != nil) && ([_otherQueryAssociations count] == 0)) {
|
|
|
|
DESTROY(_otherQueryAssociations);
|
|
|
|
}
|
|
|
|
ASSIGN(_action, [_associations objectForKey: action__Key]);
|
|
|
|
if (_action != nil) {
|
|
|
|
[_associations removeObjectForKey: action__Key];
|
|
|
|
}
|
|
|
|
ASSIGN(_href, [_associations objectForKey: href__Key]);
|
|
|
|
if (_href != nil) {
|
|
|
|
[_associations removeObjectForKey: href__Key];
|
|
|
|
}
|
|
|
|
ASSIGN(_multipleSubmit, [_associations objectForKey: multipleSubmit__Key]);
|
|
|
|
if (_multipleSubmit != nil) {
|
|
|
|
[_associations removeObjectForKey: multipleSubmit__Key];
|
|
|
|
}
|
|
|
|
ASSIGN(_actionClass, [_associations objectForKey: actionClass__Key]);
|
|
|
|
if (_actionClass != nil) {
|
|
|
|
[_associations removeObjectForKey: actionClass__Key];
|
|
|
|
}
|
|
|
|
ASSIGN(_queryDictionary, [_associations objectForKey: queryDictionary__Key]);
|
|
|
|
if (_queryDictionary != nil) {
|
|
|
|
[_associations removeObjectForKey: queryDictionary__Key];
|
|
|
|
}
|
|
|
|
ASSIGN(_directActionName, [_associations objectForKey: directActionName__Key]);
|
|
|
|
if (_directActionName != nil) {
|
|
|
|
[_associations removeObjectForKey: directActionName__Key];
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((([_associations objectForKey:method__Key] == nil) &&
|
|
|
|
([_associations objectForKey:@"Method"] == nil)) &&
|
|
|
|
([_associations objectForKey:@"METHOD"] == nil)) {
|
|
|
|
|
|
|
|
methodAssoc = [[GSWConstantValueAssociation alloc] initWithValue:post__Key];
|
|
|
|
[_associations setObject: methodAssoc
|
|
|
|
forKey:method__Key];
|
|
|
|
DESTROY(methodAssoc);
|
|
|
|
}
|
|
|
|
if (((_action != nil) && (_href != nil)) ||
|
|
|
|
((_action != nil) && (_directActionName != nil)) ||
|
|
|
|
((_href != nil) && (_directActionName != nil)) ||
|
|
|
|
((_action != nil) && (_actionClass != nil)) ||
|
|
|
|
((_href != nil) && (_actionClass != nil))) {
|
|
|
|
|
|
|
|
[NSException raise:NSInvalidArgumentException
|
|
|
|
format:@"%s: At least two of these conflicting attributes are present: 'action', 'href', 'directActionName', 'actionClass'",
|
|
|
|
__PRETTY_FUNCTION__];
|
|
|
|
}
|
|
|
|
if ((_action != nil) && ([_action isValueConstant])) {
|
|
|
|
[NSException raise:NSInvalidArgumentException
|
|
|
|
format:@"%s: 'action' is a constant.",
|
|
|
|
__PRETTY_FUNCTION__];
|
|
|
|
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
return self;
|
2007-04-13 18:32:02 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(void) dealloc
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2002-05-14 11:28:50 +00:00
|
|
|
DESTROY(_action);
|
|
|
|
DESTROY(_href);
|
|
|
|
DESTROY(_multipleSubmit);
|
|
|
|
DESTROY(_actionClass);
|
|
|
|
DESTROY(_queryDictionary);
|
|
|
|
DESTROY(_otherQueryAssociations);
|
2007-04-13 18:32:02 +00:00
|
|
|
DESTROY(_directActionName);
|
|
|
|
|
2000-01-22 12:49:49 +00:00
|
|
|
[super dealloc];
|
2007-04-13 18:32:02 +00:00
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(id) description
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
return [NSString stringWithFormat:@"<%s %p action: %@ actionClass: %@ directActionName: %@ href:%@ multipleSubmit: %@ queryDictionary: %@ otherQueryAssociations: %@ >",
|
2010-04-22 04:28:50 +00:00
|
|
|
object_getClassName(self),
|
2007-04-13 18:32:02 +00:00
|
|
|
(void*)self, _action, _actionClass, _directActionName, _href, _multipleSubmit,
|
|
|
|
_queryDictionary, _otherQueryAssociations];
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
- (void) _enterFormInContext:(GSWContext *) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
[context setInForm:YES];
|
|
|
|
if ([[context elementID] isEqual:[context senderID]]) {
|
|
|
|
[context _setFormSubmitted:YES];
|
|
|
|
}
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
- (void) _exitFormInContext:(GSWContext *) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
[context setInForm:NO];
|
|
|
|
[context _setFormSubmitted:NO];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(void)takeValuesFromRequest:(GSWRequest*)request
|
|
|
|
inContext:(GSWContext*)context;
|
2003-01-19 15:33:07 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
[self _enterFormInContext:context];
|
|
|
|
[super takeValuesFromRequest:request
|
2003-01-19 15:33:07 +00:00
|
|
|
inContext:context];
|
2007-04-13 18:32:02 +00:00
|
|
|
[self _exitFormInContext:context];
|
|
|
|
}
|
2004-12-14 12:54:40 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*) request
|
|
|
|
inContext:(GSWContext*) context
|
2004-12-14 23:48:51 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
{
|
|
|
|
id supervalue = nil;
|
|
|
|
|
|
|
|
[self _enterFormInContext:context];
|
|
|
|
[context _setActionInvoked:NO];
|
|
|
|
[context _setIsMultipleSubmitForm:(_multipleSubmit == nil ? NO : [_multipleSubmit boolValueInComponent:[context component]])];
|
|
|
|
|
|
|
|
supervalue = [super invokeActionForRequest:request inContext:context];
|
|
|
|
if ((![context _wasActionInvoked]) && ([context _wasFormSubmitted])) {
|
|
|
|
if (_action != nil) {
|
|
|
|
supervalue = [_action valueInComponent:[context component]];
|
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
|
|
|
}
|
2007-04-13 18:32:02 +00:00
|
|
|
if (supervalue == nil) {
|
|
|
|
supervalue = [context page];
|
2004-12-14 12:54:40 +00:00
|
|
|
}
|
2007-04-13 18:32:02 +00:00
|
|
|
}
|
|
|
|
[context _setIsMultipleSubmitForm:NO];
|
|
|
|
[self _exitFormInContext:context];
|
|
|
|
|
|
|
|
return supervalue;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) _appendHiddenFieldsToResponse:(GSWResponse*) response
|
|
|
|
inContext:(GSWContext*) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
NSEnumerator * myEnumer = nil;
|
|
|
|
NSString * key = nil;
|
|
|
|
NSString * value = nil;
|
|
|
|
NSDictionary * queryDict = [self computeQueryDictionaryWithActionClassAssociation: _actionClass
|
|
|
|
directActionNameAssociation: _directActionName
|
|
|
|
queryDictionaryAssociation: _queryDictionary
|
|
|
|
otherQueryAssociations: _otherQueryAssociations
|
|
|
|
inContext: context];
|
|
|
|
if ([queryDict count] > 0) {
|
|
|
|
myEnumer = [queryDict keyEnumerator];
|
|
|
|
|
|
|
|
while ((key = [myEnumer nextObject])) {
|
|
|
|
value = [queryDict objectForKey:key];
|
|
|
|
GSWResponse_appendContentAsciiString(response,@"<input type=hidden");
|
|
|
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, name__Key, key, NO);
|
|
|
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, value__Key, value, NO);
|
|
|
|
GSWResponse_appendContentAsciiString(response,@">\n");
|
2002-01-26 10:43:23 +00:00
|
|
|
}
|
2004-03-01 16:47:04 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
}
|
|
|
|
}
|
2004-03-01 16:47:04 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(void) appendToResponse:(GSWResponse *) response
|
|
|
|
inContext:(GSWContext*) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
[context setInForm:YES];
|
|
|
|
[super appendToResponse: response inContext: context];
|
|
|
|
[context setInForm:NO];
|
|
|
|
}
|
2004-12-14 23:48:51 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(void) appendChildrenToResponse:(GSWResponse *) response
|
|
|
|
inContext:(GSWContext*) context
|
|
|
|
{
|
|
|
|
[super appendChildrenToResponse:response
|
|
|
|
inContext:context];
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
[self _appendHiddenFieldsToResponse:response
|
|
|
|
inContext:context];
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
2007-04-13 18:32:02 +00:00
|
|
|
-(void) _appendCGIActionToResponse:(GSWResponse *) response
|
|
|
|
inContext:(GSWContext*) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
NSString *str = [self computeActionStringWithActionClassAssociation: _actionClass
|
|
|
|
directActionNameAssociation: _directActionName
|
|
|
|
inContext: context];
|
|
|
|
|
|
|
|
NSString * myActionURL = [context directActionURLForActionNamed: str
|
|
|
|
queryDictionary: nil];
|
|
|
|
|
|
|
|
|
|
|
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, action__Key, myActionURL, NO);
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) appendAttributesToResponse:(GSWResponse *) response
|
|
|
|
inContext:(GSWContext*) context
|
2000-01-22 12:49:49 +00:00
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
NSString * value = nil;
|
|
|
|
GSWComponent * component = [context component];
|
|
|
|
|
|
|
|
[super appendAttributesToResponse:response inContext:context];
|
|
|
|
if (_href != nil) {
|
|
|
|
value = [_href valueInComponent:component];
|
|
|
|
}
|
|
|
|
if (_directActionName != nil || _actionClass != nil) {
|
|
|
|
[self _appendCGIActionToResponse:response inContext: context];
|
|
|
|
} else {
|
|
|
|
if (value != nil) {
|
|
|
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response, action__Key, value, NO);
|
|
|
|
} else {
|
|
|
|
if (_href == nil) {
|
|
|
|
GSWResponse_appendTagAttributeValueEscapingHTMLAttributeValue(response,
|
|
|
|
action__Key, [context componentActionURL], NO);
|
|
|
|
} else {
|
|
|
|
NSLog(@"%s: action attribute evaluates to null. %@", __PRETTY_FUNCTION__, self);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-01-22 12:49:49 +00:00
|
|
|
|
|
|
|
+(BOOL)hasGSWebObjectsAssociations
|
|
|
|
{
|
2007-04-13 18:32:02 +00:00
|
|
|
return NO;
|
2000-01-22 12:49:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
@end
|
|
|
|
|