mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 19:21:23 +00:00
2002-11-18 Manuel Guesdon <mguesdon@orange-concept.com>
I've rewritten AutoValue handling in GSWBrowser,GSWCheckBoxList, GSWRadioButtonList, GSWPopUpButton to make it coherent and working like specifications. * GSWeb/GSWSwitchComponent.m: o add more information when componentName is null * GSWRepetition.h/.m: o added startIndex, stopIndex * GSWeb/GSWConstants.h/.m: o added startIndex__Key,stopIndex__Key * GSWeb/GSWComponent.h/.m: o replace _isSynchronized by _isParentToComponentSynchronized and _isComponentToParentSynchronized; o added -synchronizesParentToComponentVariablesWithBindings and -synchronizesComponentToParentVariablesWithBindings * GSWeb/GSWApplication.m: o doc/comments o Exception when no session class found * GSWeb/GSWComponentDefinition.m o doc/comments * GSWeb/GSWComponentRequestHandler.m o doc/comments o response message changed when request handling failed * GSWeb/GSWMailDelivery.m o implemented composeEmail...component: methods o change mail sending code * GSWeb/GSWContext.h/.m: o replace ASSIGNCOPY by ASSIGN in -copy for _awakePageComponents); * GSWeb/GSWHyperlink.m: o replaced otherAssociations by otherQueryAssociations in -computeQueryDictionaryInContext o hanldle queryDictionary association o GSWPopUpButton.m: * GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html: o replaced <br> by <br/> * GSWeb/GSWInput.h o removed autoValue variable (static var may cause multithread problems and there were different autoValue implementation). o remove name key to avoid duplicate name in html produced code o some rewrite for auto value o doc/comments * GSWeb/GSWPopUpButton.h/.m: o use super appendToResponse:inContext: (no more name problem) o rewriten auto value handling (see Testing/DynamicElements for test) o doc/comments * GSWeb/GSWBrowser.h/.m: o use super appendToResponse:inContext: (no more name problem) o rewriten auto value handling (see Testing/DynamicElements for test) o doc/comments * GSWeb/GSWCheckBoxList.h/.m: o rewriten auto value handling (see Testing/DynamicElements for test) o handling disabled binding o doc/comments * GSWeb/GSWRadioButtonList.h/.m: o rewriten auto value handling (see Testing/DynamicElements for test) o handling disabled binding o doc/comments * GSWeb/GSWTextField.h/.m: o output value in appendValueToResponse:inContext: instead of appendGSWebObjectsAssociationsToResponse:inContext: * GSWExtensions.framework/GSWLongResponsePage.h/.m o added git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@15008 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3cde2f785b
commit
c5edf863de
97 changed files with 3815 additions and 794 deletions
62
ChangeLog
62
ChangeLog
|
@ -1,3 +1,65 @@
|
||||||
|
2002-11-18 Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
I've rewritten AutoValue handling in GSWBrowser,GSWCheckBoxList,
|
||||||
|
GSWRadioButtonList, GSWPopUpButton to make it coherent
|
||||||
|
and working like specifications.
|
||||||
|
|
||||||
|
* GSWeb/GSWSwitchComponent.m:
|
||||||
|
o add more information when componentName is null
|
||||||
|
* GSWRepetition.h/.m:
|
||||||
|
o added startIndex, stopIndex
|
||||||
|
* GSWeb/GSWConstants.h/.m:
|
||||||
|
o added startIndex__Key,stopIndex__Key
|
||||||
|
* GSWeb/GSWComponent.h/.m:
|
||||||
|
o replace _isSynchronized by _isParentToComponentSynchronized and
|
||||||
|
_isComponentToParentSynchronized;
|
||||||
|
o added -synchronizesParentToComponentVariablesWithBindings and
|
||||||
|
-synchronizesComponentToParentVariablesWithBindings
|
||||||
|
* GSWeb/GSWApplication.m:
|
||||||
|
o doc/comments
|
||||||
|
o Exception when no session class found
|
||||||
|
* GSWeb/GSWComponentDefinition.m
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWComponentRequestHandler.m
|
||||||
|
o doc/comments
|
||||||
|
o response message changed when request handling failed
|
||||||
|
* GSWeb/GSWMailDelivery.m
|
||||||
|
o implemented composeEmail...component: methods
|
||||||
|
o change mail sending code
|
||||||
|
* GSWeb/GSWContext.h/.m:
|
||||||
|
o replace ASSIGNCOPY by ASSIGN in -copy for _awakePageComponents);
|
||||||
|
* GSWeb/GSWHyperlink.m:
|
||||||
|
o replaced otherAssociations by otherQueryAssociations in -computeQueryDictionaryInContext
|
||||||
|
o hanldle queryDictionary association
|
||||||
|
o GSWPopUpButton.m:
|
||||||
|
* GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html:
|
||||||
|
o replaced <br> by <br/>
|
||||||
|
* GSWeb/GSWInput.h
|
||||||
|
o removed autoValue variable (static var may cause multithread problems and there were different autoValue implementation).
|
||||||
|
o remove name key to avoid duplicate name in html produced code
|
||||||
|
o some rewrite for auto value
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWPopUpButton.h/.m:
|
||||||
|
o use super appendToResponse:inContext: (no more name problem)
|
||||||
|
o rewriten auto value handling (see Testing/DynamicElements for test)
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWBrowser.h/.m:
|
||||||
|
o use super appendToResponse:inContext: (no more name problem)
|
||||||
|
o rewriten auto value handling (see Testing/DynamicElements for test)
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWCheckBoxList.h/.m:
|
||||||
|
o rewriten auto value handling (see Testing/DynamicElements for test)
|
||||||
|
o handling disabled binding
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWRadioButtonList.h/.m:
|
||||||
|
o rewriten auto value handling (see Testing/DynamicElements for test)
|
||||||
|
o handling disabled binding
|
||||||
|
o doc/comments
|
||||||
|
* GSWeb/GSWTextField.h/.m:
|
||||||
|
o output value in appendValueToResponse:inContext: instead of
|
||||||
|
appendGSWebObjectsAssociationsToResponse:inContext:
|
||||||
|
* GSWExtensions.framework/GSWLongResponsePage.h/.m
|
||||||
|
o added
|
||||||
|
|
||||||
2002-10-28 David Wetzel <dave@turbocat.de>
|
2002-10-28 David Wetzel <dave@turbocat.de>
|
||||||
* a start to make statistics work
|
* a start to make statistics work
|
||||||
Modified Files:
|
Modified Files:
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Hello.wod
|
* HelloPage.gswd
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* NeXT disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* This example was written with a Beta version of WebObjects.
|
|
||||||
*
|
|
||||||
* Written by WebObjects Development Team
|
|
||||||
*
|
|
||||||
* This is the declarations file for the second page (Hello) of the
|
* This is the declarations file for the second page (Hello) of the
|
||||||
* HelloWorld ObjC application.
|
* HelloWorld ObjC application.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* HelloPage.h
|
* HelloPage.h
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* Apple disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* This file declares the interface to the object that controls the Hello
|
* This file declares the interface to the object that controls the Hello
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* HelloPage.m
|
* HelloPage.m
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* Apple disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* This is the implementation file for the object that controls the Hello
|
* This is the implementation file for the object that controls the Hello
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* Main.wod
|
* Main.gswd
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* NeXT disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* Written by WebObjects Development Team
|
* This is the declarations file for the Main page of the
|
||||||
*
|
* HelloWorld ObjC application. Each declaration corresponds to a GNUstepWeb
|
||||||
* This is the declarations file for the first page (Main) of the
|
* element in Main.html.
|
||||||
* HelloWorldObjC application. Each declaration corresponds to a WEBOBJECT
|
|
||||||
* element in Main.html. The declarations specify a WODynamicElement to
|
|
||||||
* represent the corresponding WEBOBJECT element and configure the dynamic
|
|
||||||
* element with variables and methods defined in the Main object.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Main.h
|
* Main.h
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* Apple disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* This file declares the interface to the object that controls the Main
|
* This file declares the interface to the object that controls the Main
|
||||||
|
|
|
@ -2,11 +2,9 @@
|
||||||
* Main.m
|
* Main.m
|
||||||
*
|
*
|
||||||
* You may freely copy, distribute and reuse the code in this example.
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
* Apple disclaims any warranty of any kind, expressed or implied, as to
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
* its fitness for any particular use.
|
* its fitness for any particular use.
|
||||||
*
|
*
|
||||||
* Written by WebObjects Development Team
|
|
||||||
*
|
|
||||||
* This is the implementation file for the object that controls the Main
|
* This is the implementation file for the object that controls the Main
|
||||||
* page.
|
* page.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -115,7 +115,8 @@ GSWExceptionPage.m \
|
||||||
GSWDictionaryRepetition.m \
|
GSWDictionaryRepetition.m \
|
||||||
GSWRedirect.m \
|
GSWRedirect.m \
|
||||||
GSWIFrame.m \
|
GSWIFrame.m \
|
||||||
GSWMetaRefresh.m
|
GSWMetaRefresh.m \
|
||||||
|
GSWLongResponsePage.m \
|
||||||
|
|
||||||
#GSWCompletionBar.m
|
#GSWCompletionBar.m
|
||||||
|
|
||||||
|
@ -130,7 +131,8 @@ GSWPageRestorationErrorPage.h \
|
||||||
GSWRedirect.h \
|
GSWRedirect.h \
|
||||||
GSWSessionCreationErrorPage.h \
|
GSWSessionCreationErrorPage.h \
|
||||||
GSWSessionRestorationErrorPage.h \
|
GSWSessionRestorationErrorPage.h \
|
||||||
GSWStatsPage.h
|
GSWStatsPage.h \
|
||||||
|
GSWLongResponsePage.h
|
||||||
|
|
||||||
#GSWCompletionBar.h
|
#GSWCompletionBar.h
|
||||||
#GSWThresholdColoredNumber.h
|
#GSWThresholdColoredNumber.h
|
||||||
|
|
108
GSWExtensions.framework/GSWLongResponsePage.h
Normal file
108
GSWExtensions.framework/GSWLongResponsePage.h
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
/** GSWLongResponsePage.m - <title>GSWeb: Class GSWLongResponsePage</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Sep 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _GSWLongResponsePage_h__
|
||||||
|
#define _GSWLongResponsePage_h__
|
||||||
|
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
@interface GSWLongResponsePage: GSWComponent <NSLocking>
|
||||||
|
{
|
||||||
|
@private
|
||||||
|
id _status;
|
||||||
|
id _result;
|
||||||
|
NSException *_exception;
|
||||||
|
NSRecursiveLock *_selfLock;
|
||||||
|
NSTimeInterval _refreshInterval;
|
||||||
|
BOOL _performingAction;
|
||||||
|
BOOL _cancelled;
|
||||||
|
BOOL _done;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Locks the page **/
|
||||||
|
- (void)lock;
|
||||||
|
|
||||||
|
/** Unlock the page **/
|
||||||
|
- (void)unlock;
|
||||||
|
|
||||||
|
/** Set status (Lock protected) **/
|
||||||
|
- (void)setStatus:(id)status;
|
||||||
|
|
||||||
|
/** Set the refresh interval. Default is 0. If >0, a refresh header is appended to the response **/
|
||||||
|
- (void)setRefreshInterval:(NSTimeInterval)interval;
|
||||||
|
|
||||||
|
/** Get the refresh interval. **/
|
||||||
|
- (NSTimeInterval)refreshInterval;
|
||||||
|
|
||||||
|
/** Return YES if action is canceled by the user. Used to abort thread. (Lock protected) **/
|
||||||
|
- (BOOL)isCancelled;
|
||||||
|
|
||||||
|
/** This method should be overwritten to return a result. Default implementation raise an exception
|
||||||
|
Warning: you should first increase app worker thread count.
|
||||||
|
count=1 ==> you code don't nead to be thread safe
|
||||||
|
count>1 ==> if your code is not thread safe, you should disable concurrent request handling
|
||||||
|
count>1 ==> if your code is thread safe, you can enable concurrent request handling
|
||||||
|
**/
|
||||||
|
- (id)performAction;
|
||||||
|
|
||||||
|
/** This method is call by GSWMetaRefresh -invokeAction.
|
||||||
|
It can be manually called (for example if the page does not refresh itself.
|
||||||
|
Status value make it call -pageForException:, -pageForResult:, -refreshPageForStatus: or -cancelPageForStatus:
|
||||||
|
Don't override it
|
||||||
|
**/
|
||||||
|
- (WOComponent *)refresh;
|
||||||
|
|
||||||
|
|
||||||
|
- (WOComponent *)cancel;
|
||||||
|
/* TODO the cancel action sets cancel to yes and calls cancelPageForStatus:. DO NOT OVERRIDE */
|
||||||
|
|
||||||
|
/** Called when an exception occur in the process thread. Replace -pageForResult: call.
|
||||||
|
Default implemnetation raise the exception **/
|
||||||
|
- (WOComponent *)pageForException:(NSException *)exception;
|
||||||
|
|
||||||
|
/** Called when the process thread is done.
|
||||||
|
Default implementation stops automatic refresh and returns self.
|
||||||
|
You can override this to return a newly created result page
|
||||||
|
**/
|
||||||
|
- (WOComponent *)pageForResult:(id) result;
|
||||||
|
|
||||||
|
/** Called on each refresh. Should return self. **/
|
||||||
|
- (WOComponent *)refreshPageForStatus:(id) status;
|
||||||
|
|
||||||
|
/** Called when the process thread is cancelled. Replace -pageForResult: call.
|
||||||
|
Default implementation stops automatic refresh and returns self.
|
||||||
|
**/
|
||||||
|
- (WOComponent *)cancelPageForStatus:(id) status;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_GSWLongResponsePage_h__
|
405
GSWExtensions.framework/GSWLongResponsePage.m
Normal file
405
GSWExtensions.framework/GSWLongResponsePage.m
Normal file
|
@ -0,0 +1,405 @@
|
||||||
|
/** GSWLongResponsePage.m - <title>GSWeb: Class GSWLongResponsePage</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Sep 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
<abstract></abstract>
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include <GSWExtensions/GSWLongResponsePage.h>
|
||||||
|
|
||||||
|
//===================================================================================
|
||||||
|
@implementation GSWLongResponsePage
|
||||||
|
|
||||||
|
-(id)init
|
||||||
|
{
|
||||||
|
if ((self=[super init]))
|
||||||
|
{
|
||||||
|
_selfLock=[NSRecursiveLock new];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)dealloc
|
||||||
|
{
|
||||||
|
DESTROY(_selfLock);
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Locks the page **/
|
||||||
|
-(void) lock
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Unlock the page **/
|
||||||
|
-(void) unlock
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(void)appendToResponse:(GSWResponse*)aResponse
|
||||||
|
inContext:(GSWContext*)aContext
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[self lock];
|
||||||
|
NSDebugMLog(@"_refreshInterval=%f",(double)_refreshInterval);
|
||||||
|
NSDebugMLog(@"_done=%d",(int)_done);
|
||||||
|
NSDebugMLog(@"_performingAction=%d",(int)_performingAction);
|
||||||
|
//
|
||||||
|
if (_refreshInterval>0 && !_done/*_keepRefreshing*/)
|
||||||
|
{
|
||||||
|
NSString *url=nil;
|
||||||
|
NSString *header=nil;
|
||||||
|
|
||||||
|
url=[aContext urlWithRequestHandlerKey:@"cr"
|
||||||
|
path:nil
|
||||||
|
queryString:nil];
|
||||||
|
NSDebugMLog(@"url=%@",url);
|
||||||
|
header=[NSString stringWithFormat:@"%d;url=%@%@/%@.GSWMetaRefresh",
|
||||||
|
(int)_refreshInterval,
|
||||||
|
url,
|
||||||
|
[[aContext session]sessionID],
|
||||||
|
[aContext contextID]];
|
||||||
|
NSDebugMLog(@"header=%@",header);
|
||||||
|
[aResponse setHeader:header
|
||||||
|
forKey:@"Refresh"];
|
||||||
|
};
|
||||||
|
// Exec action on the first time
|
||||||
|
if (!_performingAction)
|
||||||
|
{
|
||||||
|
_performingAction = YES;
|
||||||
|
NSDebugMLog(@"BEFORE performAction thread=%p",[NSThread currentThread]);
|
||||||
|
[NSThread detachNewThreadSelector:@selector(_perform)
|
||||||
|
toTarget:self
|
||||||
|
withObject:nil];
|
||||||
|
};
|
||||||
|
[super appendToResponse:aResponse
|
||||||
|
inContext:aContext];
|
||||||
|
[self unlock];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(id)threadExited:(NSNotification*)notif
|
||||||
|
{
|
||||||
|
NSThread* thread=nil;
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
thread=[notif object];
|
||||||
|
NSDebugMLog(@"threadExited thread=%@",thread);
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
// threadDict = [thread threadDictionary];
|
||||||
|
// NSDebugMLLog(@"low",@"threadDict=%@",threadDict);
|
||||||
|
// adaptorThread=[threadDict objectForKey:GSWThreadKey_DefaultAdaptorThread];
|
||||||
|
// NSDebugMLLog(@"low",@"adaptorThread=%@",adaptorThread);
|
||||||
|
// [threadDict removeObjectForKey:GSWThreadKey_DefaultAdaptorThread];
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver:self
|
||||||
|
name:NSThreadExiting//NSThreadWillExitNotification
|
||||||
|
object:thread];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return nil; //??
|
||||||
|
};
|
||||||
|
|
||||||
|
-(void)_perform
|
||||||
|
{
|
||||||
|
id result=nil;
|
||||||
|
NSAutoreleasePool* arp = nil;
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
arp = [NSAutoreleasePool new];
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(threadExited:)
|
||||||
|
name:NSThreadExiting//NSThreadWillExitNotification
|
||||||
|
object:[NSThread currentThread]];
|
||||||
|
NS_DURING
|
||||||
|
{
|
||||||
|
[self _setResult:nil];
|
||||||
|
NSDebugMLog(@"CALL performAction thread=%p",[NSThread currentThread]);
|
||||||
|
NSDebugMLog(@"CALL performAction thread=%@",[NSThread currentThread]);
|
||||||
|
result=[self performAction];
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
printf("==AFTER performAction");
|
||||||
|
NSDebugMLog(@"result=%@",result);
|
||||||
|
NSDebugMLog(@"AFTER performAction");
|
||||||
|
printf("AFTER performAction");
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
if (!_cancelled)
|
||||||
|
_done=YES; //???
|
||||||
|
[self _setResult:result];
|
||||||
|
}
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
RETAIN(localException);
|
||||||
|
NSLog(@"EXCEPTION %@",localException);
|
||||||
|
NSDebugMLog(@"EXCEPTION %@",localException);
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
DESTROY(arp);
|
||||||
|
AUTORELEASE(localException);
|
||||||
|
[localException raise];
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
|
DESTROY(arp);
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
fflush(stdout);
|
||||||
|
fflush(stderr);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Set status (Lock protected) **/
|
||||||
|
-(void)setStatus:(id)status
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if (status!=_status)
|
||||||
|
{
|
||||||
|
[self lock];
|
||||||
|
ASSIGN(_status,status);
|
||||||
|
[self unlock];
|
||||||
|
};
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(id) _status
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return _status;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Set the refresh interval. Default is 0. If >0, a refresh header is appended to the response **/
|
||||||
|
-(void)setRefreshInterval:(NSTimeInterval)interval
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if (interval>0)
|
||||||
|
_refreshInterval = interval;
|
||||||
|
else
|
||||||
|
_refreshInterval = 0;
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Get the refresh interval. **/
|
||||||
|
-(NSTimeInterval)refreshInterval
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return _refreshInterval;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Return YES if action is canceled by the user. Used to abort thread. (Lock protected) **/
|
||||||
|
-(BOOL)isCancelled
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return _cancelled;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** This method should be overwritten to return a result. Default implementation raise an exception
|
||||||
|
Warning: you should first increase app worker thread count.
|
||||||
|
count=1 ==> you code don't nead to be thread safe
|
||||||
|
count>1 ==> if your code is not thread safe, you should disable concurrent request handling
|
||||||
|
count>1 ==> if your code is thread safe, you can enable concurrent request handling
|
||||||
|
**/
|
||||||
|
-(id) performAction
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[self subclassResponsibility:_cmd];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return nil;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** This method is call by GSWMetaRefresh -invokeAction.
|
||||||
|
It can be manually called (for example if the page does not refresh itself.
|
||||||
|
Status value make it call -pageForException:, -pageForResult:, -refreshPageForStatus: or -cancelPageForStatus:
|
||||||
|
Don't override it
|
||||||
|
**/
|
||||||
|
-(GSWComponent*)refresh
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
GSWComponent *page=nil;
|
||||||
|
NSException *exception=nil;
|
||||||
|
id result=[self _result];//OK
|
||||||
|
id status=nil;
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
exception=[self _exception];
|
||||||
|
status=[self _status];
|
||||||
|
if (exception)
|
||||||
|
page=[self pageForException:exception];
|
||||||
|
else if (_done)//OK
|
||||||
|
{
|
||||||
|
//_keepRefreshing = NO;
|
||||||
|
page=[self pageForResult:result];//OK
|
||||||
|
}
|
||||||
|
else if (_cancelled)
|
||||||
|
page=[self cancelPageForStatus:status];
|
||||||
|
else
|
||||||
|
page=[self refreshPageForStatus:status];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return page;
|
||||||
|
};
|
||||||
|
|
||||||
|
-(GSWComponent*)cancel
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
GSWComponent *page=nil;
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[self _setCancelled:YES];
|
||||||
|
page=[self cancelPage];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return page;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Called when an exception occur in the process thread. Replace -pageForResult: call.
|
||||||
|
Default implemnetation raise the exception **/
|
||||||
|
-(GSWComponent *)pageForException:(NSException *)exception
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
[exception raise];//??
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return nil;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/** Called when the process thread is done.
|
||||||
|
Default implementation stops automatic refresh and returns self.
|
||||||
|
You can override this to return a newly created result page
|
||||||
|
**/
|
||||||
|
-(GSWComponent *)pageForResult:(id) result
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
//TODO: stop refreshing ?
|
||||||
|
_done=YES;
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return self;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Called on each refresh. Should return self. **/
|
||||||
|
-(GSWComponent *)refreshPageForStatus:(id) status
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return self;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Called when the process thread is cancelled. Replace -pageForResult: call.
|
||||||
|
Default implementation stops automatic refresh and returns self.
|
||||||
|
**/
|
||||||
|
-(GSWComponent *)cancelPageForStatus:(id) status;
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
//[self subclassResponsibility: _cmd];
|
||||||
|
_cancelled=YES;
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return self;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-(GSWElement*)invokeActionForRequest:(GSWRequest*)aRequest
|
||||||
|
inContext:(GSWContext*)aContext
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
GSWElement *element=nil;
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if ([[aContext senderID] isEqualToString:@"GSWMetaRefresh"])//GSWMetaRefreshSenderId])//senderID ret: GSWMetaRefresh // Seems OK
|
||||||
|
{
|
||||||
|
element=[self refresh];//OK
|
||||||
|
}
|
||||||
|
else
|
||||||
|
element=[super invokeActionForRequest:aRequest
|
||||||
|
inContext:aContext];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return element;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
-(void) _setCancelled:(BOOL)cancelled
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if (cancelled!=_cancelled)
|
||||||
|
{
|
||||||
|
[self lock];
|
||||||
|
_cancelled=cancelled;
|
||||||
|
[self unlock];
|
||||||
|
};
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(void) _setResult:(id)result
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if (result!=_result)
|
||||||
|
{
|
||||||
|
[self lock];
|
||||||
|
_result=result;
|
||||||
|
[self unlock];
|
||||||
|
};
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(id)_result
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return _result;
|
||||||
|
};
|
||||||
|
|
||||||
|
-(void)_setException:(NSException*)exception
|
||||||
|
{
|
||||||
|
//??
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
if (exception!=_exception)
|
||||||
|
{
|
||||||
|
[self lock];
|
||||||
|
_exception=exception;
|
||||||
|
[self unlock];
|
||||||
|
};
|
||||||
|
[self subclassResponsibility: _cmd];
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
};
|
||||||
|
|
||||||
|
-(NSException*)_exception
|
||||||
|
{
|
||||||
|
LOGObjectFnStartC("GSWLongResponsePage");
|
||||||
|
LOGObjectFnStopC("GSWLongResponsePage");
|
||||||
|
return _exception;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
|
@ -1,7 +1,7 @@
|
||||||
<gsweb name="ValidationFailureCondition">
|
<gsweb name="ValidationFailureCondition">
|
||||||
<font color="#FF0000">
|
<font color="#FF0000">
|
||||||
<gsweb name="ValidationFailureRepetition">
|
<gsweb name="ValidationFailureRepetition">
|
||||||
<gsweb name="ValidationFailure"></gsweb><br>
|
<gsweb name="ValidationFailure"></gsweb><br/>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
</font>
|
</font>
|
||||||
</gsweb>
|
</gsweb>
|
||||||
|
|
|
@ -2021,6 +2021,7 @@ selfLockn,
|
||||||
{
|
{
|
||||||
//TODO erreur
|
//TODO erreur
|
||||||
NSDebugMLLog0(@"application",@"No Session Class");
|
NSDebugMLLog0(@"application",@"No Session Class");
|
||||||
|
NSAssert(NO,@"Can't find session class");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2123,11 +2124,17 @@ selfLockn,
|
||||||
[self lock];
|
[self lock];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
|
// If the pageName is empty, try to get one from -defaultPageName
|
||||||
if ([aName length]<=0)
|
if ([aName length]<=0)
|
||||||
aName=[self defaultPageName];//NDFN
|
aName=[self defaultPageName];//NDFN
|
||||||
|
// If the pageName is still empty, use a default one ("Main")
|
||||||
if ([aName length]<=0)
|
if ([aName length]<=0)
|
||||||
aName=GSWMainPageName;
|
aName=GSWMainPageName;
|
||||||
|
|
||||||
|
// Retrieve context languages
|
||||||
languages=[aContext languages];
|
languages=[aContext languages];
|
||||||
|
|
||||||
|
// Find component definition for pageName and languages
|
||||||
componentDefinition=[self lockedComponentDefinitionWithName:aName
|
componentDefinition=[self lockedComponentDefinitionWithName:aName
|
||||||
languages:languages];
|
languages:languages];
|
||||||
NSDebugMLLog(@"info",@"componentDefinition %p=%@ (%@)",
|
NSDebugMLLog(@"info",@"componentDefinition %p=%@ (%@)",
|
||||||
|
@ -2154,10 +2161,14 @@ selfLockn,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// As we've found a component defintion, we create an instance (an object of class GSWComponent)
|
||||||
NSAssert(aContext,@"No Context");
|
NSAssert(aContext,@"No Context");
|
||||||
component=[componentDefinition componentInstanceInContext:aContext];
|
component=[componentDefinition componentInstanceInContext:aContext];
|
||||||
NSAssert(aContext,@"No Context");
|
NSAssert(aContext,@"No Context");
|
||||||
|
// Next we awake it
|
||||||
[component awakeInContext:aContext];
|
[component awakeInContext:aContext];
|
||||||
|
|
||||||
|
// And flag it as a page.
|
||||||
[component _setIsPage:YES];
|
[component _setIsPage:YES];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -772,6 +772,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
|
||||||
};
|
};
|
||||||
if (retValue)
|
if (retValue)
|
||||||
{
|
{
|
||||||
|
NSDebugMLLog(@"associations",@"retValue ptr=%p",retValue);
|
||||||
NSDebugMLLog(@"associations",@"retValue=%@",retValue);
|
NSDebugMLLog(@"associations",@"retValue=%@",retValue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
{
|
{
|
||||||
GSWAssociation* _list;
|
GSWAssociation* _list;
|
||||||
GSWAssociation* _item;
|
GSWAssociation* _item;
|
||||||
|
//GSWeb Additions {
|
||||||
|
GSWAssociation* _index;
|
||||||
|
// }
|
||||||
GSWAssociation* _displayString;
|
GSWAssociation* _displayString;
|
||||||
GSWAssociation* _selections;
|
GSWAssociation* _selections;
|
||||||
//GSWeb Additions {
|
//GSWeb Additions {
|
||||||
|
|
|
@ -31,6 +31,35 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
list Array of objects that the dynamic element iterate through.
|
||||||
|
|
||||||
|
index On each iteration the element put the current index in this binding
|
||||||
|
|
||||||
|
item On each iteration the element take the item at the current index and put it in this binding
|
||||||
|
|
||||||
|
displayString String to display for each check box.
|
||||||
|
|
||||||
|
value Value for each OPTION tag
|
||||||
|
|
||||||
|
selections Array of selected objects (used to pre-select items and modified to reflect user choices)
|
||||||
|
It contains objects from list, not value binding evaluated ones !
|
||||||
|
|
||||||
|
selectedValues Array of pre selected values (not objects !)
|
||||||
|
|
||||||
|
name Name of the element in the form (should be unique). If not specified, GSWeb assign one.
|
||||||
|
|
||||||
|
disabled If evaluated to yes, the check box appear inactivated.
|
||||||
|
|
||||||
|
escapeHTML If evaluated to yes, escape displayString
|
||||||
|
|
||||||
|
size show 'size' iems at one time. Default=5. Must be > 1
|
||||||
|
|
||||||
|
multiple multiple selection allowed
|
||||||
|
**/
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWBrowser
|
@implementation GSWBrowser
|
||||||
|
|
||||||
|
@ -47,6 +76,10 @@ static char rcsId[] = "$Id$";
|
||||||
tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
||||||
[tmpAssociations removeObjectForKey:list__Key];
|
[tmpAssociations removeObjectForKey:list__Key];
|
||||||
[tmpAssociations removeObjectForKey:item__Key];
|
[tmpAssociations removeObjectForKey:item__Key];
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
{
|
||||||
|
[tmpAssociations removeObjectForKey:index__Key];
|
||||||
|
};
|
||||||
[tmpAssociations removeObjectForKey:displayString__Key];
|
[tmpAssociations removeObjectForKey:displayString__Key];
|
||||||
[tmpAssociations removeObjectForKey:selections__Key];
|
[tmpAssociations removeObjectForKey:selections__Key];
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
|
@ -62,24 +95,41 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
_list=[[associations objectForKey:list__Key
|
_list=[[associations objectForKey:list__Key
|
||||||
withDefaultObject:[_list autorelease]] retain];
|
withDefaultObject:[_list autorelease]] retain];
|
||||||
|
|
||||||
_item=[[associations objectForKey:item__Key
|
_item=[[associations objectForKey:item__Key
|
||||||
withDefaultObject:[_item autorelease]] retain];
|
withDefaultObject:[_item autorelease]] retain];
|
||||||
|
if (_item && ![_item isValueSettable])
|
||||||
|
{
|
||||||
|
ExceptionRaise0(@"GSWBrowser",@"'item' parameter must be settable");
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
{
|
||||||
|
_index = [[associations objectForKey:index__Key
|
||||||
|
withDefaultObject:[_index autorelease]] retain];
|
||||||
|
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
||||||
|
if (_index && ![_index isValueSettable])
|
||||||
|
{
|
||||||
|
ExceptionRaise0(@"GSWBrowser",@"'index' parameter must be settable");
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
_displayString=[[associations objectForKey:displayString__Key
|
_displayString=[[associations objectForKey:displayString__Key
|
||||||
withDefaultObject:[_displayString autorelease]] retain];
|
withDefaultObject:[_displayString autorelease]] retain];
|
||||||
_selections=[[associations objectForKey:selections__Key
|
_selections=[[associations objectForKey:selections__Key
|
||||||
withDefaultObject:[_selections autorelease]] retain];
|
withDefaultObject:[_selections autorelease]] retain];
|
||||||
if (_selections && ![_selections isValueSettable])
|
if (_selections && ![_selections isValueSettable])
|
||||||
{
|
{
|
||||||
//TODO
|
ExceptionRaise0(@"GSWBrowser",@"'selections' parameter must be settable");
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
{
|
{
|
||||||
_selectionValues=[[associations objectForKey:selectionValue__Key
|
_selectionValues=[[associations objectForKey:selectionValues__Key
|
||||||
withDefaultObject:[_selectionValues autorelease]] retain];
|
withDefaultObject:[_selectionValues autorelease]] retain];
|
||||||
if (_selectionValues && ![_selectionValues isValueSettable])
|
if (_selectionValues && ![_selectionValues isValueSettable])
|
||||||
{
|
{
|
||||||
//TODO
|
ExceptionRaise0(@"GSWBrowser",@"'selectionValues' parameter must be settable");
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -101,6 +151,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
DESTROY(_list);
|
DESTROY(_list);
|
||||||
DESTROY(_item);
|
DESTROY(_item);
|
||||||
|
DESTROY(_index);
|
||||||
DESTROY(_displayString);
|
DESTROY(_displayString);
|
||||||
DESTROY(_selections);
|
DESTROY(_selections);
|
||||||
DESTROY(_selectionValues);
|
DESTROY(_selectionValues);
|
||||||
|
@ -131,8 +182,7 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWBrowser (GSWBrowserA)
|
@implementation GSWBrowser (GSWBrowserA)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
On WO it looks like that when value is not binded:
|
||||||
On WO it looks like that:
|
|
||||||
|
|
||||||
<SELECT name="4.2.7" size=5 multiple>
|
<SELECT name="4.2.7" size=5 multiple>
|
||||||
<OPTION value="0">blau</OPTION>
|
<OPTION value="0">blau</OPTION>
|
||||||
|
@ -158,28 +208,21 @@ static char rcsId[] = "$Id$";
|
||||||
id valueValue=nil;
|
id valueValue=nil;
|
||||||
id itemValue=nil;
|
id itemValue=nil;
|
||||||
id displayStringValue=nil;
|
id displayStringValue=nil;
|
||||||
NSString * browserName=nil;
|
|
||||||
BOOL escapeHTMLBoolValue=YES;
|
BOOL escapeHTMLBoolValue=YES;
|
||||||
id escapeHTMLValue=nil;
|
id escapeHTMLValue=nil;
|
||||||
BOOL isMultiple=NO;
|
|
||||||
int i=0;
|
int i=0;
|
||||||
BOOL inOptGroup=NO;
|
BOOL inOptGroup=NO;
|
||||||
#ifndef ENABLE_OPTGROUP
|
#ifndef ENABLE_OPTGROUP
|
||||||
BOOL optGroupLabel=NO;
|
BOOL optGroupLabel=NO;
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStartC("GSWBrowser");
|
LOGObjectFnStartC("GSWBrowser");
|
||||||
[self resetAutoValue];
|
|
||||||
_autoValue = NO;
|
|
||||||
request=[context request];
|
request=[context request];
|
||||||
isFromClientComponent=[request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
component=[context component];
|
component=[context component];
|
||||||
browserName=[self nameInContext:context];
|
|
||||||
|
|
||||||
//TODO: multiple
|
[super appendToResponse:response
|
||||||
// [super appendToResponse:response
|
inContext:context];
|
||||||
// inContext:context];
|
|
||||||
|
|
||||||
[response _appendContentAsciiString:@"<SELECT"];
|
|
||||||
|
|
||||||
listValue=[_list valueInComponent:component];
|
listValue=[_list valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"listValue=%@",listValue);
|
NSDebugMLLog(@"gswdync",@"listValue=%@",listValue);
|
||||||
|
@ -188,41 +231,21 @@ static char rcsId[] = "$Id$";
|
||||||
_list,
|
_list,
|
||||||
listValue,
|
listValue,
|
||||||
[listValue class]);
|
[listValue class]);
|
||||||
|
|
||||||
selectionsValue=[_selections valueInComponent:component];
|
selectionsValue=[_selections valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
||||||
NSDebugMLLog(@"gswdync",@"selectionsValue=%@",selectionsValue);
|
NSDebugMLLog(@"gswdync",@"selectionsValue=%@",selectionsValue);
|
||||||
|
|
||||||
selectedValuesValue=[_selectedValues valueInComponent:component];
|
selectedValuesValue=[_selectedValues valueInComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"selectedValues=%@",_selectedValues);
|
NSDebugMLLog(@"gswdync",@"selectedValues=%@",_selectedValues);
|
||||||
NSDebugMLLog(@"gswdync",@"selectedValuesValue=%@",selectedValuesValue);
|
NSDebugMLLog(@"gswdync",@"selectedValuesValue=%@",selectedValuesValue);
|
||||||
|
|
||||||
if (_escapeHTML)
|
if (_escapeHTML)
|
||||||
{
|
{
|
||||||
escapeHTMLValue=[_escapeHTML valueInComponent:component];
|
escapeHTMLValue=[_escapeHTML valueInComponent:component];
|
||||||
escapeHTMLBoolValue=boolValueFor(escapeHTMLValue);
|
escapeHTMLBoolValue=boolValueFor(escapeHTMLValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
[response _appendContentAsciiString:[NSString stringWithFormat:@" NAME=\"%@\"",browserName]];
|
|
||||||
|
|
||||||
|
|
||||||
if (_size)
|
|
||||||
{
|
|
||||||
[response _appendContentAsciiString:@" SIZE="];
|
|
||||||
[response _appendContentAsciiString:[_size valueInComponent:component]];
|
|
||||||
} else {
|
|
||||||
// do we get an PopUp if we leave that out?
|
|
||||||
[response _appendContentAsciiString:@" SIZE=1"];
|
|
||||||
}
|
|
||||||
if (_multiple)
|
|
||||||
{
|
|
||||||
id multipleValue=nil;
|
|
||||||
multipleValue=[_multiple valueInComponent:component];
|
|
||||||
isMultiple=boolValueFor(multipleValue);
|
|
||||||
|
|
||||||
if (isMultiple) {
|
|
||||||
[response _appendContentAsciiString:@" MULTIPLE"];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
[response _appendContentAsciiString:@">"];
|
|
||||||
|
|
||||||
for(i=0;i<[listValue count];i++)
|
for(i=0;i<[listValue count];i++)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"inOptGroup=%s",(inOptGroup ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"inOptGroup=%s",(inOptGroup ? "YES" : "NO"));
|
||||||
|
@ -231,52 +254,52 @@ static char rcsId[] = "$Id$";
|
||||||
[_item setValue:itemValue
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
|
|
||||||
|
if (_index)
|
||||||
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
|
inComponent:component];
|
||||||
|
|
||||||
if (itemValue)
|
if (itemValue)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
NSDebugMLLog(@"gswdync",@"_value (class: %@): %@",[_value class],_value);
|
||||||
valueValue=[self valueInContext:context];
|
// Value property of the INPUT tag
|
||||||
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
BOOL isEqual;
|
BOOL isEqual=NO;
|
||||||
|
|
||||||
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
|
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
|
||||||
[response _appendContentAsciiString:@"\n<OPTION"];
|
[response _appendContentAsciiString:@"\n<OPTION"];
|
||||||
if (_selections)
|
|
||||||
{
|
|
||||||
if(_value)
|
|
||||||
isEqual=SBIsValueIsIn(valueValue,selectionsValue);
|
|
||||||
else
|
|
||||||
isEqual=SBIsValueIsIn(itemValue,selectionsValue);
|
|
||||||
|
|
||||||
if (isEqual)
|
NSDebugMLLog(@"gswdync",@"selectionsValue=%@",selectionsValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionsValue classes=%@",[selectionsValue valueForKey:@"class"]);
|
||||||
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"itemValue class=%@",[itemValue class]);
|
||||||
|
if (selectionsValue)
|
||||||
{
|
{
|
||||||
[response appendContentCharacter:' '];
|
isEqual = [selectionsValue containsObject:itemValue];
|
||||||
[response _appendContentAsciiString:@"selected"];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
if (isEqual == NO && _selectedValues)
|
if (isEqual == NO && _selectedValues)
|
||||||
{
|
{
|
||||||
if(_value)
|
// selected values is selections but on valueValue not itemValue
|
||||||
isEqual=SBIsValueIsIn(valueValue,selectedValuesValue);
|
isEqual = [selectionsValue containsObject:valueValue];
|
||||||
else
|
};
|
||||||
isEqual=SBIsValueIsIn(itemValue,selectedValuesValue);
|
|
||||||
|
|
||||||
if (isEqual)
|
if (isEqual)
|
||||||
{
|
{
|
||||||
[response appendContentCharacter:' '];
|
[response appendContentCharacter:' '];
|
||||||
[response _appendContentAsciiString:@"selected"];
|
[response _appendContentAsciiString:@"selected"];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
if (_value == nil)
|
|
||||||
_autoValue = YES;
|
|
||||||
if (valueValue)
|
|
||||||
{
|
|
||||||
[response _appendContentAsciiString:@" value=\""];
|
[response _appendContentAsciiString:@" value=\""];
|
||||||
// [response _appendContentAsciiString:valueValue];
|
[response _appendContentAsciiString:valueValue];
|
||||||
[response _appendContentAsciiString:[NSString stringWithFormat:@"%d",i]];
|
|
||||||
[response appendContentCharacter:'"'];
|
[response appendContentCharacter:'"'];
|
||||||
};
|
|
||||||
[response appendContentCharacter:'>'];
|
[response appendContentCharacter:'>'];
|
||||||
};
|
};
|
||||||
displayStringValue=nil;
|
displayStringValue=nil;
|
||||||
|
@ -328,7 +351,6 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
//NSDebugMLLog0(@"gswdync",@"Adding /OPTION");
|
|
||||||
// K2- No /OPTION TAG
|
// K2- No /OPTION TAG
|
||||||
//[response _appendContentAsciiString:@"</OPTION>"];
|
//[response _appendContentAsciiString:@"</OPTION>"];
|
||||||
}
|
}
|
||||||
|
@ -377,30 +399,25 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
BOOL disabledValue=NO;
|
BOOL disabledValue=NO;
|
||||||
BOOL wasFormSubmitted=NO;
|
|
||||||
id selectionsValue=nil;
|
|
||||||
BOOL selectionsAreMutable=NO;
|
|
||||||
|
|
||||||
LOGObjectFnStartC("GSWPopUpButton");
|
LOGObjectFnStartC("GSWPopUpButton");
|
||||||
[self resetAutoValue];
|
|
||||||
disabledValue=[self disabledInContext:context];
|
disabledValue=[self disabledInContext:context];
|
||||||
if (!disabledValue)
|
if (!disabledValue)
|
||||||
{
|
{
|
||||||
wasFormSubmitted=[context _wasFormSubmitted];
|
BOOL wasFormSubmitted=[context _wasFormSubmitted];
|
||||||
if (wasFormSubmitted)
|
if (wasFormSubmitted)
|
||||||
{
|
{
|
||||||
BOOL isMultiple=NO;
|
BOOL isMultiple=NO;
|
||||||
NSArray* foundValues=nil;
|
NSMutableArray* selectionsValue=nil;
|
||||||
NSMutableArray* mutableFoundValues=[NSMutableArray array];
|
NSMutableArray* selectionValuesValue=nil;
|
||||||
GSWComponent* component=nil;
|
GSWComponent* component=nil;
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil;
|
||||||
|
NSString* valueValueString=nil;
|
||||||
id itemValue=nil;
|
id itemValue=nil;
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
NSArray* formValues=nil;
|
NSArray* formValues=nil;
|
||||||
id formValue=nil;
|
|
||||||
BOOL found=NO;
|
|
||||||
int i=0;
|
|
||||||
component=[context component];
|
component=[context component];
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
||||||
|
@ -417,14 +434,10 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
if (formValues && [formValues count])
|
if (formValues && [formValues count])
|
||||||
{
|
{
|
||||||
BOOL isEqual=NO;
|
BOOL found=NO;
|
||||||
|
int i=0;
|
||||||
formValue=[formValues objectAtIndex:0];
|
|
||||||
NSDebugMLLog(@"gswdync",@"formValue=%@",formValue);
|
|
||||||
|
|
||||||
listValue=[_list valueInComponent:component];
|
listValue=[_list valueInComponent:component];
|
||||||
selectionsValue=[_selections valueInComponent:component];
|
|
||||||
|
|
||||||
|
|
||||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||||
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
||||||
|
@ -440,47 +453,78 @@ static char rcsId[] = "$Id$";
|
||||||
if (_item)
|
if (_item)
|
||||||
[_item setValue:itemValue
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
|
if (_index)
|
||||||
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
|
inComponent:component];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
||||||
if ([formValues containsObject:[NSString stringWithFormat:@"%d",i]])
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
valueValueString=[NSString stringWithFormat:@"%@",valueValue];
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
|
if (valueValue)
|
||||||
{
|
{
|
||||||
[mutableFoundValues addObject:itemValue];
|
// we compare (with object equality not pointer equality)
|
||||||
found=YES;
|
found=[formValues containsObject:valueValueString];
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
foundValues=[NSArray arrayWithArray:mutableFoundValues];
|
|
||||||
// NSLog(@"new foundValues = %@",foundValues);
|
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
// We add list object
|
||||||
if (_selections)
|
if (_selections)
|
||||||
{
|
{
|
||||||
if (!WOStrictFlag)
|
if (!selectionsValue)
|
||||||
|
selectionsValue=[NSMutableArray array];
|
||||||
|
|
||||||
|
[selectionsValue addObject:itemValue];
|
||||||
|
};
|
||||||
|
|
||||||
|
// We add valueValue
|
||||||
|
if (_selectionValues)
|
||||||
|
{
|
||||||
|
if (!selectionValuesValue)
|
||||||
|
selectionValuesValue=[NSMutableArray array];
|
||||||
|
|
||||||
|
[selectionValuesValue addObject:valueValue];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
||||||
|
};
|
||||||
|
|
||||||
|
if (_selections)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_selections setValue:foundValues
|
[_selections setValue:selectionsValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
};
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
[self handleValidationException:localException
|
LOGException(@"GSWBrowser _selections=%@ itemValueToSet=%@ exception=%@",
|
||||||
inContext:context];
|
_selections,itemValueToSet,localException);
|
||||||
}
|
if (WOStrictFlag)
|
||||||
NS_ENDHANDLER;
|
{
|
||||||
|
[localException raise];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[_selections setValue:foundValues
|
[self handleValidationException:localException
|
||||||
inComponent:component];
|
inContext:context];
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag && _selectionValues)
|
||||||
{
|
|
||||||
if (_selectionValues)
|
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_selectionValues setValue:foundValues
|
[_selectionValues setValue:selectionValuesValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
};
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
|
@ -492,7 +536,6 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
LOGObjectFnStopC("GSWPopUpButton");
|
LOGObjectFnStopC("GSWPopUpButton");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -511,15 +554,42 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response
|
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
BOOL isMultiple=NO;
|
||||||
|
id sizeValue=nil;
|
||||||
|
GSWComponent* component=nil;
|
||||||
|
LOGObjectFnStartC("GSWPopUpButton");
|
||||||
|
|
||||||
|
[super appendGSWebObjectsAssociationsToResponse:response
|
||||||
|
inContext:context];
|
||||||
|
|
||||||
|
component=[context component];
|
||||||
|
|
||||||
|
if (_size)
|
||||||
|
sizeValue=[_size valueInComponent:component];
|
||||||
|
else
|
||||||
|
sizeValue=@"5"; //Default is 5
|
||||||
|
|
||||||
|
[response _appendContentAsciiString:@" SIZE="];
|
||||||
|
[response _appendContentAsciiString:sizeValue];
|
||||||
|
|
||||||
|
if (_multiple)
|
||||||
|
{
|
||||||
|
id multipleValue=nil;
|
||||||
|
multipleValue=[_multiple valueInComponent:component];
|
||||||
|
isMultiple=boolValueFor(multipleValue);
|
||||||
|
|
||||||
|
if (isMultiple)
|
||||||
|
[response _appendContentAsciiString:@" MULTIPLE"];
|
||||||
|
};
|
||||||
|
// [response _appendContentAsciiString:@">"];
|
||||||
|
LOGObjectFnStopC("GSWPopUpButton");
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
-(void)appendValueToResponse:(GSWResponse*)response
|
-(void)appendValueToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
//Does nothing because value is only printed in OPTION tag
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
|
@ -39,13 +39,15 @@
|
||||||
GSWAssociation* _item;
|
GSWAssociation* _item;
|
||||||
GSWAssociation* _index;
|
GSWAssociation* _index;
|
||||||
GSWAssociation* _selections;
|
GSWAssociation* _selections;
|
||||||
|
//GSWeb Additions {
|
||||||
|
GSWAssociation* _selectionValues;
|
||||||
|
// }
|
||||||
GSWAssociation* _prefix;
|
GSWAssociation* _prefix;
|
||||||
GSWAssociation* _suffix;
|
GSWAssociation* _suffix;
|
||||||
GSWAssociation* _displayString;
|
GSWAssociation* _displayString;
|
||||||
GSWAssociation* _escapeHTML;
|
GSWAssociation* _escapeHTML;
|
||||||
GSWAssociation* _itemDisabled;
|
GSWAssociation* _itemDisabled;
|
||||||
BOOL _defaultEscapeHTML;
|
BOOL _defaultEscapeHTML;
|
||||||
BOOL _autoValue;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)initWithName:(NSString*)name
|
-(id)initWithName:(NSString*)name
|
||||||
|
|
|
@ -31,6 +31,36 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
list Array of objects that the dynamic element iterate through.
|
||||||
|
|
||||||
|
index On each iteration the element put the current index in this binding
|
||||||
|
|
||||||
|
item On each iteration the element take the item at the current index and put it in this binding
|
||||||
|
|
||||||
|
displayString String to display for each check box.
|
||||||
|
|
||||||
|
value Value for the INPUT tag for each check box
|
||||||
|
|
||||||
|
prefix An html string to insert before each value.
|
||||||
|
|
||||||
|
suffix An html string to insert after each value.
|
||||||
|
|
||||||
|
selections Array of selected objects (used to pre-check checkboxes and modified to reflect user choices)
|
||||||
|
It contains objects from list, not value binding evaluated ones !
|
||||||
|
|
||||||
|
selectionValues Array of selected values (used to pre-check checkboxes and modified to reflect user choices)
|
||||||
|
It contains evaluated values binding !
|
||||||
|
|
||||||
|
name Name of the element in the form (should be unique). If not specified, GSWeb assign one.
|
||||||
|
|
||||||
|
disabled If evaluated to yes, the check box appear inactivated.
|
||||||
|
|
||||||
|
escapeHTML If evaluated to yes, escape displayString
|
||||||
|
**/
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWCheckBoxList
|
@implementation GSWCheckBoxList
|
||||||
|
|
||||||
|
@ -50,7 +80,6 @@ static char rcsId[] = "$Id$";
|
||||||
[tmpAssociations removeObjectForKey:suffix__Key];
|
[tmpAssociations removeObjectForKey:suffix__Key];
|
||||||
[tmpAssociations removeObjectForKey:selections__Key];
|
[tmpAssociations removeObjectForKey:selections__Key];
|
||||||
[tmpAssociations removeObjectForKey:displayString__Key];
|
[tmpAssociations removeObjectForKey:displayString__Key];
|
||||||
[tmpAssociations removeObjectForKey:disabled__Key];
|
|
||||||
[tmpAssociations removeObjectForKey:escapeHTML__Key];
|
[tmpAssociations removeObjectForKey:escapeHTML__Key];
|
||||||
if ((self=[super initWithName:aName
|
if ((self=[super initWithName:aName
|
||||||
associations:tmpAssociations
|
associations:tmpAssociations
|
||||||
|
@ -65,7 +94,7 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
||||||
if (_item && ![_item isValueSettable])
|
if (_item && ![_item isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'item' parameter must be settable");
|
ExceptionRaise0(@"GSWCheckBoxList",@"'item' parameter must be settable");
|
||||||
};
|
};
|
||||||
|
|
||||||
_value = [[associations objectForKey:value__Key
|
_value = [[associations objectForKey:value__Key
|
||||||
|
@ -77,7 +106,7 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
||||||
if (_index && ![_index isValueSettable])
|
if (_index && ![_index isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'index' parameter must be settable");
|
ExceptionRaise0(@"GSWCheckBoxList",@"'index' parameter must be settable");
|
||||||
};
|
};
|
||||||
|
|
||||||
_prefix = [[associations objectForKey:prefix__Key
|
_prefix = [[associations objectForKey:prefix__Key
|
||||||
|
@ -93,17 +122,23 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
||||||
if (![_selections isValueSettable])
|
if (![_selections isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'selection' parameter must be settable");
|
ExceptionRaise0(@"GSWCheckBoxList",@"'selection' parameter must be settable");
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
{
|
||||||
|
_selectionValues=[[associations objectForKey:selectionValues__Key
|
||||||
|
withDefaultObject:[_selectionValues autorelease]] retain];
|
||||||
|
if (_selectionValues && ![_selectionValues isValueSettable])
|
||||||
|
{
|
||||||
|
ExceptionRaise0(@"GSWCheckBoxList",@"'selectionValues' parameter must be settable");
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_displayString = [[associations objectForKey:displayString__Key
|
_displayString = [[associations objectForKey:displayString__Key
|
||||||
withDefaultObject:[_displayString autorelease]] retain];
|
withDefaultObject:[_displayString autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"displayString=%@",_displayString);
|
NSDebugMLLog(@"gswdync",@"displayString=%@",_displayString);
|
||||||
|
|
||||||
_itemDisabled = [[associations objectForKey:disabled__Key
|
|
||||||
withDefaultObject:[_itemDisabled autorelease]] retain];
|
|
||||||
NSDebugMLLog(@"gswdync",@"itemDisabled=%@",_itemDisabled);
|
|
||||||
|
|
||||||
_escapeHTML = [[associations objectForKey:escapeHTML__Key
|
_escapeHTML = [[associations objectForKey:escapeHTML__Key
|
||||||
withDefaultObject:[_escapeHTML autorelease]] retain];
|
withDefaultObject:[_escapeHTML autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"escapeHTML=%@",_escapeHTML);
|
NSDebugMLLog(@"gswdync",@"escapeHTML=%@",_escapeHTML);
|
||||||
|
@ -119,6 +154,7 @@ static char rcsId[] = "$Id$";
|
||||||
DESTROY(_item);
|
DESTROY(_item);
|
||||||
DESTROY(_index);
|
DESTROY(_index);
|
||||||
DESTROY(_selections);
|
DESTROY(_selections);
|
||||||
|
DESTROY(_selectionValues);//GSWeb Only
|
||||||
DESTROY(_prefix);
|
DESTROY(_prefix);
|
||||||
DESTROY(_suffix);
|
DESTROY(_suffix);
|
||||||
DESTROY(_displayString);
|
DESTROY(_displayString);
|
||||||
|
@ -165,24 +201,29 @@ static char rcsId[] = "$Id$";
|
||||||
BOOL disabledInContext=NO;
|
BOOL disabledInContext=NO;
|
||||||
LOGObjectFnStartC("GSWCheckBoxList");
|
LOGObjectFnStartC("GSWCheckBoxList");
|
||||||
|
|
||||||
[self resetAutoValue];
|
|
||||||
disabledInContext=[self disabledInContext:context];
|
disabledInContext=[self disabledInContext:context];
|
||||||
if (!disabledInContext)
|
if (!disabledInContext)
|
||||||
{
|
{
|
||||||
if ([context _wasFormSubmitted])
|
if ([context _wasFormSubmitted])
|
||||||
{
|
{
|
||||||
GSWComponent* component=[context component];
|
GSWComponent* component=[context component];
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil; // _list value
|
||||||
NSMutableArray* selectionsValues=nil;
|
NSMutableArray* selectionsValue=nil;
|
||||||
|
NSMutableArray* selectionValuesValue=nil;
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
NSArray* formValues=nil;
|
NSArray* formValues=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil; // _value value
|
||||||
|
NSString* valueValueString=nil; // _value value
|
||||||
|
id itemValue=nil; // _item value
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
||||||
|
|
||||||
formValues=[request formValuesForKey:name];
|
formValues=[request formValuesForKey:name];
|
||||||
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
|
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
|
||||||
|
NSDebugMLLog(@"gswdync",@"formValues class=%@",[formValues valueForKey:@"class"]);
|
||||||
|
|
||||||
listValue=[_list valueInComponent:component];
|
listValue=[_list valueInComponent:component];
|
||||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||||
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
||||||
|
@ -196,57 +237,99 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
||||||
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
||||||
|
|
||||||
|
itemValue=[listValue objectAtIndex:i];
|
||||||
if (_item)
|
if (_item)
|
||||||
[_item setValue:[listValue objectAtIndex:i]
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
else if (_index)
|
|
||||||
|
if (_index)
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
|
||||||
|
|
||||||
valueValue=[self valueInContext:context];
|
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
||||||
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
valueValueString=[NSString stringWithFormat:@"%@",valueValue];
|
||||||
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
BOOL found=[formValues containsObject:valueValue];
|
// we compare (with object equality not pointer equality)
|
||||||
|
BOOL found=[formValues containsObject:valueValueString];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
if (!selectionsValues)
|
if (_selections)
|
||||||
selectionsValues=[NSMutableArray array];
|
{
|
||||||
|
if (!selectionsValue)
|
||||||
|
selectionsValue=[NSMutableArray array];
|
||||||
|
|
||||||
if(_autoValue == NO)
|
// We add list object
|
||||||
[selectionsValues addObject:valueValue];
|
[selectionsValue addObject:itemValue];
|
||||||
else
|
};
|
||||||
[selectionsValues addObject:[listValue objectAtIndex:i]];
|
|
||||||
|
if (_selectionValues)
|
||||||
|
{
|
||||||
|
if (!selectionValuesValue)
|
||||||
|
selectionValuesValue=[NSMutableArray array];
|
||||||
|
|
||||||
|
// We add list object
|
||||||
|
[selectionValuesValue addObject:valueValue];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"component=%@",component);
|
NSDebugMLLog(@"gswdync",@"component=%@",component);
|
||||||
NSDebugMLLog(@"gswdync",@"selectionsValues=%d",selectionsValues);
|
NSDebugMLLog(@"gswdync",@"selectionsValue=%d",selectionsValue);
|
||||||
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
NSDebugMLLog(@"gswdync",@"selections=%@",_selections);
|
||||||
GSWLogAssertGood(component);
|
GSWLogAssertGood(component);
|
||||||
if (!WOStrictFlag)
|
|
||||||
{
|
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_selections setValue:selectionsValues
|
[_selections setValue:selectionsValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
};
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
[self handleValidationException:localException
|
LOGException(@"GSWCheckBoxList _selections=%@ selectionsValue=%@ exception=%@",
|
||||||
inContext:context];
|
_selections,selectionsValue,localException);
|
||||||
}
|
if (WOStrictFlag)
|
||||||
NS_ENDHANDLER;
|
{
|
||||||
|
[localException raise];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[_selections setValue:selectionsValues
|
[self handleValidationException:localException
|
||||||
|
inContext:context];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
|
|
||||||
|
if (!WOStrictFlag && _selectionValues)
|
||||||
|
{
|
||||||
|
NS_DURING
|
||||||
|
{
|
||||||
|
[_selectionValues setValue:selectionValuesValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
};
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
LOGException(@"GSWCheckBoxList _selectionValues=%@ selectionValuesValue=%@ exception=%@",
|
||||||
|
_selectionValues,selectionValuesValue,localException);
|
||||||
|
if (WOStrictFlag)
|
||||||
|
{
|
||||||
|
[localException raise];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[self handleValidationException:localException
|
||||||
|
inContext:context];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
LOGObjectFnStopC("GSWCheckBoxList");
|
LOGObjectFnStopC("GSWCheckBoxList");
|
||||||
|
@ -270,13 +353,10 @@ static char rcsId[] = "$Id$";
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
GSWComponent* component=nil;
|
GSWComponent* component=nil;
|
||||||
NSArray* selectionsValue=nil;
|
NSArray* selectionsValue=nil;
|
||||||
BOOL isEqual=NO;
|
NSArray* selectionValuesValue=nil;
|
||||||
|
|
||||||
LOGObjectFnStartC("GSWCheckBoxList");
|
LOGObjectFnStartC("GSWCheckBoxList");
|
||||||
|
|
||||||
[self resetAutoValue];
|
|
||||||
_autoValue = NO;
|
|
||||||
|
|
||||||
request=[context request];
|
request=[context request];
|
||||||
isFromClientComponent=[request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
|
@ -289,6 +369,16 @@ static char rcsId[] = "$Id$";
|
||||||
selectionsValue,
|
selectionsValue,
|
||||||
[selectionsValue class]);
|
[selectionsValue class]);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
selectionValuesValue=[_selectionValues valueInComponent:component];
|
||||||
|
if (selectionValuesValue && ![selectionValuesValue isKindOfClass:[NSArray class]])
|
||||||
|
{
|
||||||
|
ExceptionRaise(@"GSWCheckBoxList",
|
||||||
|
@"GSWCheckBoxList: selectionValues is not a NSArray: %@ %@",
|
||||||
|
selectionValuesValue,
|
||||||
|
[selectionValuesValue class]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
@ -296,7 +386,8 @@ static char rcsId[] = "$Id$";
|
||||||
id prefixValue=nil;
|
id prefixValue=nil;
|
||||||
id suffixValue=nil;
|
id suffixValue=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil;
|
||||||
BOOL disableValue=NO;
|
id itemValue=nil;
|
||||||
|
BOOL disabledInContext=NO;
|
||||||
NSArray* listValue=[_list valueInComponent:component];
|
NSArray* listValue=[_list valueInComponent:component];
|
||||||
|
|
||||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||||
|
@ -307,37 +398,65 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
for(i=0;i<[listValue count];i++)
|
for(i=0;i<[listValue count];i++)
|
||||||
{
|
{
|
||||||
[_item setValue:[listValue objectAtIndex:i]
|
BOOL isEqual=NO;
|
||||||
|
|
||||||
|
disabledInContext=[self disabledInContext:context];
|
||||||
|
|
||||||
|
itemValue=[listValue objectAtIndex:i];
|
||||||
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
prefixValue=[_prefix valueInComponent:component];
|
prefixValue=[_prefix valueInComponent:component];
|
||||||
suffixValue=[_suffix valueInComponent:component];
|
suffixValue=[_suffix valueInComponent:component];
|
||||||
disableValue=[self evaluateCondition:_itemDisabled
|
|
||||||
inContext:context];
|
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
displayStringValue=[_displayString valueInComponent:component];
|
displayStringValue=[_displayString valueInComponent:component];
|
||||||
|
|
||||||
[response appendContentString:@"<INPUT NAME=\""];
|
[response appendContentString:@"<INPUT NAME=\""];
|
||||||
[response appendContentString:name];
|
[response appendContentString:name];
|
||||||
|
|
||||||
[response appendContentString:@"\" TYPE=checkbox VALUE=\""];
|
[response appendContentString:@"\" TYPE=checkbox VALUE=\""];
|
||||||
valueValue = [self valueInContext:context];
|
|
||||||
|
NSDebugMLLog(@"gswdync",@"_value (class: %@): %@",[_value class],_value);
|
||||||
|
// Value property of the INPUT tag
|
||||||
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
[response appendContentHTMLAttributeValue:valueValue];
|
[response appendContentHTMLAttributeValue:valueValue];
|
||||||
[response appendContentCharacter:'"'];
|
[response appendContentCharacter:'"'];
|
||||||
|
|
||||||
//TODOV
|
NSDebugMLLog(@"gswdync",@"selectionsValue=%@",selectionsValue);
|
||||||
if(_value)
|
NSDebugMLLog(@"gswdync",@"selectionsValue classes=%@",[selectionsValue valueForKey:@"class"]);
|
||||||
isEqual = [selectionsValue containsObject:valueValue];
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
else
|
NSDebugMLLog(@"gswdync",@"itemValue class=%@",[itemValue class]);
|
||||||
|
if (_selections)
|
||||||
{
|
{
|
||||||
isEqual = [selectionsValue containsObject:[listValue objectAtIndex:i]];
|
// we compare (with object equality not pointer equality) on list object, not valueValue !
|
||||||
|
isEqual = [selectionsValue containsObject:itemValue];
|
||||||
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
|
}
|
||||||
|
|
||||||
_autoValue = YES;
|
NSDebugMLLog(@"gswdync",@"selectionValuesValue=%@",selectionValuesValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionValuesValue classes=%@",[selectionValuesValue valueForKey:@"class"]);
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue class=%@",[valueValue class]);
|
||||||
|
if (isEqual==NO && _selectionValues)
|
||||||
|
{
|
||||||
|
// we compare (with object equality not pointer equality) on valueValue !
|
||||||
|
isEqual = [selectionValuesValue containsObject:valueValue];
|
||||||
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isEqual)
|
if(isEqual)
|
||||||
[response appendContentString:@"\" CHECKED"];
|
[response appendContentString:@" CHECKED"];
|
||||||
|
|
||||||
if (disableValue)
|
if (disabledInContext)
|
||||||
[response appendContentString:@"\" DISABLED"];
|
[response appendContentString:@" DISABLED"];
|
||||||
|
|
||||||
[response appendContentCharacter:'>'];
|
[response appendContentCharacter:'>'];
|
||||||
[response appendContentString:prefixValue];
|
[response appendContentString:prefixValue];
|
||||||
|
@ -345,6 +464,7 @@ static char rcsId[] = "$Id$";
|
||||||
[response appendContentString:suffixValue];
|
[response appendContentString:suffixValue];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
LOGObjectFnStopC("GSWCheckBoxList");
|
LOGObjectFnStopC("GSWCheckBoxList");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,9 @@
|
||||||
// }
|
// }
|
||||||
BOOL _isPage;
|
BOOL _isPage;
|
||||||
BOOL _isCachingEnabled;
|
BOOL _isCachingEnabled;
|
||||||
BOOL _isSynchronized;
|
BOOL _isParentToComponentSynchronized;
|
||||||
|
BOOL _isComponentToParentSynchronized;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
-(id)init;
|
-(id)init;
|
||||||
|
@ -160,6 +162,8 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
forBinding:(NSString*)parentBindingName;
|
forBinding:(NSString*)parentBindingName;
|
||||||
-(id)valueForBinding:(NSString*)parentBindingName;
|
-(id)valueForBinding:(NSString*)parentBindingName;
|
||||||
-(BOOL)synchronizesVariablesWithBindings;
|
-(BOOL)synchronizesVariablesWithBindings;
|
||||||
|
-(BOOL)synchronizesParentToComponentVariablesWithBindings;
|
||||||
|
-(BOOL)synchronizesComponentToParentVariablesWithBindings;
|
||||||
-(NSDictionary*)bindingAssociations;
|
-(NSDictionary*)bindingAssociations;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
NSMutableDictionary* currentThreadDictionary=GSCurrentThreadDictionary();
|
NSMutableDictionary* currentThreadDictionary=GSCurrentThreadDictionary();
|
||||||
GSWContext* aContext=[currentThreadDictionary objectForKey:GSWThreadKey_Context];
|
GSWContext* aContext=[currentThreadDictionary objectForKey:GSWThreadKey_Context];
|
||||||
|
// This was set by GSWComponentDefintion -componentInstanceInContext:
|
||||||
GSWComponentDefinition* aComponentDefinition=[currentThreadDictionary objectForKey:GSWThreadKey_ComponentDefinition];
|
GSWComponentDefinition* aComponentDefinition=[currentThreadDictionary objectForKey:GSWThreadKey_ComponentDefinition];
|
||||||
NSAssert(aContext,@"No Context in GSWComponent Init");
|
NSAssert(aContext,@"No Context in GSWComponent Init");
|
||||||
NSAssert(aComponentDefinition,@"No ComponentDefinition in GSWComponent Init");
|
NSAssert(aComponentDefinition,@"No ComponentDefinition in GSWComponent Init");
|
||||||
|
@ -60,8 +61,10 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"GSWComponent",@"_templateName=%@",_templateName);
|
NSDebugMLLog(@"GSWComponent",@"_templateName=%@",_templateName);
|
||||||
[self setCachingEnabled:[GSWApp isCachingEnabled]];
|
[self setCachingEnabled:[GSWApp isCachingEnabled]];
|
||||||
[_componentDefinition _finishInitializingComponent:self];
|
[_componentDefinition _finishInitializingComponent:self];
|
||||||
_isSynchronized=[self synchronizesVariablesWithBindings];
|
_isParentToComponentSynchronized=[self synchronizesParentToComponentVariablesWithBindings];
|
||||||
NSDebugMLLog(@"GSWComponent",@"_isSynchronized=%s",(_isSynchronized ? "YES" : "NO"));
|
_isComponentToParentSynchronized=[self synchronizesComponentToParentVariablesWithBindings];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"_isParentToComponentSynchronized=%s",(_isParentToComponentSynchronized ? "YES" : "NO"));
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"_isComponentToParentSynchronized=%s",(_isComponentToParentSynchronized ? "YES" : "NO"));
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return self;
|
return self;
|
||||||
|
@ -123,7 +126,8 @@ static char rcsId[] = "$Id$";
|
||||||
ASSIGNCOPY(clone->_session,_session);
|
ASSIGNCOPY(clone->_session,_session);
|
||||||
clone->_isPage=_isPage;
|
clone->_isPage=_isPage;
|
||||||
clone->_isCachingEnabled=_isCachingEnabled;
|
clone->_isCachingEnabled=_isCachingEnabled;
|
||||||
clone->_isSynchronized=_isSynchronized;
|
clone->_isParentToComponentSynchronized=_isParentToComponentSynchronized;
|
||||||
|
clone->_isComponentToParentSynchronized=_isComponentToParentSynchronized;
|
||||||
return clone;
|
return clone;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -148,7 +152,9 @@ static char rcsId[] = "$Id$";
|
||||||
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&_isCachingEnabled];
|
at:&_isCachingEnabled];
|
||||||
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&_isSynchronized];
|
at:&_isParentToComponentSynchronized];
|
||||||
|
[aCoder encodeValueOfObjCType:@encode(BOOL)
|
||||||
|
at:&_isComponentToParentSynchronized];
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -184,7 +190,9 @@ static char rcsId[] = "$Id$";
|
||||||
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&_isCachingEnabled];
|
at:&_isCachingEnabled];
|
||||||
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
||||||
at:&_isSynchronized];
|
at:&_isParentToComponentSynchronized];
|
||||||
|
[aCoder decodeValueOfObjCType:@encode(BOOL)
|
||||||
|
at:&_isComponentToParentSynchronized];
|
||||||
};
|
};
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -365,9 +373,9 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isComponentToParentSynchronized=%s",
|
||||||
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
[self definitionName],(_isComponentToParentSynchronized ? "YES" : "NO"));
|
||||||
if (_isSynchronized)
|
if (_isComponentToParentSynchronized)
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
id aKey=nil;
|
id aKey=nil;
|
||||||
|
@ -404,9 +412,9 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s",
|
NSDebugMLLog(@"GSWComponent",@"Name=%@ - isParentToComponentSynchronized=%s",
|
||||||
[self definitionName],(_isSynchronized ? "YES" : "NO"));
|
[self definitionName],(_isParentToComponentSynchronized ? "YES" : "NO"));
|
||||||
if (_isSynchronized)
|
if (_isParentToComponentSynchronized)
|
||||||
{
|
{
|
||||||
//Synchro Component->SubComponent
|
//Synchro Component->SubComponent
|
||||||
int i=0;
|
int i=0;
|
||||||
|
@ -906,6 +914,62 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
return aValue;
|
return aValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//NDFN
|
||||||
|
/** Do we need to synchronize parent to component **/
|
||||||
|
-(BOOL)synchronizesParentToComponentVariablesWithBindings
|
||||||
|
{
|
||||||
|
//OK
|
||||||
|
NSDictionary* userDictionary=nil;
|
||||||
|
id synchronizesParentToComponentVariablesWithBindingsValue=nil;
|
||||||
|
BOOL synchronizesParentToComponentVariablesWithBindings=YES;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
userDictionary=[self userDictionary];
|
||||||
|
synchronizesParentToComponentVariablesWithBindingsValue=[userDictionary objectForKey:@"synchronizesParentToComponentVariablesWithBindings"];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
||||||
|
[self definitionName],
|
||||||
|
synchronizesParentToComponentVariablesWithBindingsValue);
|
||||||
|
//NDFN
|
||||||
|
if (synchronizesParentToComponentVariablesWithBindingsValue)
|
||||||
|
{
|
||||||
|
synchronizesParentToComponentVariablesWithBindings=[synchronizesParentToComponentVariablesWithBindingsValue boolValue];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"userDictionary synchronizesParentToComponentVariablesWithBindings=%s",
|
||||||
|
(synchronizesParentToComponentVariablesWithBindings ? "YES" : "NO"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
synchronizesParentToComponentVariablesWithBindings=[self synchronizesVariablesWithBindings];
|
||||||
|
LOGObjectFnStop();
|
||||||
|
return synchronizesParentToComponentVariablesWithBindings;
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
//NDFN
|
||||||
|
/** Do we need to synchronize component to parent **/
|
||||||
|
-(BOOL)synchronizesComponentToParentVariablesWithBindings
|
||||||
|
{
|
||||||
|
//OK
|
||||||
|
NSDictionary* userDictionary=nil;
|
||||||
|
id synchronizesComponentToParentVariablesWithBindingsValue=nil;
|
||||||
|
BOOL synchronizesComponentToParentVariablesWithBindings=YES;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
userDictionary=[self userDictionary];
|
||||||
|
synchronizesComponentToParentVariablesWithBindingsValue=[userDictionary objectForKey:@"synchronizesComponentToParentVariablesWithBindings"];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"defName=%@ - userDictionary _synchronizesVariablesWithBindingsValue=%@",
|
||||||
|
[self definitionName],
|
||||||
|
synchronizesComponentToParentVariablesWithBindingsValue);
|
||||||
|
//NDFN
|
||||||
|
if (synchronizesComponentToParentVariablesWithBindingsValue)
|
||||||
|
{
|
||||||
|
synchronizesComponentToParentVariablesWithBindings=[synchronizesComponentToParentVariablesWithBindingsValue boolValue];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"userDictionary synchronizesComponentToParentVariablesWithBindings=%s",
|
||||||
|
(synchronizesComponentToParentVariablesWithBindings ? "YES" : "NO"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
synchronizesComponentToParentVariablesWithBindings=[self synchronizesVariablesWithBindings];
|
||||||
|
LOGObjectFnStop();
|
||||||
|
return synchronizesComponentToParentVariablesWithBindings;
|
||||||
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)synchronizesVariablesWithBindings
|
-(BOOL)synchronizesVariablesWithBindings
|
||||||
{
|
{
|
||||||
|
@ -1535,11 +1599,13 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
||||||
[session appendCookieToResponse:response];
|
[session appendCookieToResponse:response];
|
||||||
//==>11
|
//==>11
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
||||||
[session _saveCurrentPage];
|
[session _saveCurrentPage];
|
||||||
[aContext _incrementContextID];
|
[aContext _incrementContextID];
|
||||||
[aContext deleteAllElementIDComponents];
|
[aContext deleteAllElementIDComponents];
|
||||||
[aContext _setPageChanged:pageChanged];
|
[aContext _setPageChanged:pageChanged];
|
||||||
[aContext _setPageReplaced:NO];
|
[aContext _setPageReplaced:NO];
|
||||||
|
NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]);
|
||||||
|
|
||||||
//<==========
|
//<==========
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -1895,3 +1961,4 @@ associationsKeys:(NSArray*)associationsKeys
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -350,14 +350,19 @@ languages:(NSArray*)languages
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
NSAssert(aContext,@"No Context");
|
NSAssert(aContext,@"No Context");
|
||||||
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
|
NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext);
|
||||||
|
|
||||||
|
// Get component class
|
||||||
componentClass=[self componentClass];
|
componentClass=[self componentClass];
|
||||||
NSAssert(componentClass,@"No componentClass");
|
NSAssert(componentClass,@"No componentClass");
|
||||||
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
||||||
|
|
||||||
|
// Put the component definition in the thread dictionary because we need it during component initialization
|
||||||
threadDictionary=GSCurrentThreadDictionary();
|
threadDictionary=GSCurrentThreadDictionary();
|
||||||
[threadDictionary setObject:self
|
[threadDictionary setObject:self
|
||||||
forKey:GSWThreadKey_ComponentDefinition];
|
forKey:GSWThreadKey_ComponentDefinition];
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
|
// Now, create the component by allocation a new instance of the class.
|
||||||
component=[[componentClass new] autorelease];
|
component=[[componentClass new] autorelease];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
|
@ -368,6 +373,8 @@ languages:(NSArray*)languages
|
||||||
[localException raise];
|
[localException raise];
|
||||||
};
|
};
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
|
|
||||||
|
// Remove the component from the thread dictionary
|
||||||
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
[threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition];
|
||||||
// [_component context];//so what ?
|
// [_component context];//so what ?
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
|
@ -382,6 +389,7 @@ languages:(NSArray*)languages
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
/** Find the class of the component **/
|
||||||
-(Class)_componentClass
|
-(Class)_componentClass
|
||||||
{
|
{
|
||||||
//OK To Verify
|
//OK To Verify
|
||||||
|
@ -393,12 +401,13 @@ languages:(NSArray*)languages
|
||||||
componentClass=NSClassFromString(_name);//???
|
componentClass=NSClassFromString(_name);//???
|
||||||
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass);
|
||||||
NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]);
|
NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]);
|
||||||
if (!componentClass)
|
if (!componentClass) // There's no class with that name
|
||||||
{
|
{
|
||||||
BOOL createClassesOk=NO;
|
BOOL createClassesOk=NO;
|
||||||
NSString* superClassName=nil;
|
NSString* superClassName=nil;
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
{
|
{
|
||||||
|
// Search component archive for a superclass (superClassName keyword)
|
||||||
NSDictionary* archive=[_bundle archiveNamed:_name];
|
NSDictionary* archive=[_bundle archiveNamed:_name];
|
||||||
NSDebugMLLog(@"gswcomponents",@"archive=%@",archive);
|
NSDebugMLLog(@"gswcomponents",@"archive=%@",archive);
|
||||||
superClassName=[archive objectForKey:@"superClassName"];
|
superClassName=[archive objectForKey:@"superClassName"];
|
||||||
|
@ -413,11 +422,16 @@ languages:(NSArray*)languages
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
// If we haven't found a superclass, use GSWComponent as the superclass
|
||||||
if (!superClassName)
|
if (!superClassName)
|
||||||
superClassName=@"GSWComponent";
|
superClassName=@"GSWComponent";
|
||||||
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName);
|
||||||
|
|
||||||
|
// Create class
|
||||||
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
|
createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name]
|
||||||
superClassName:superClassName];
|
superClassName:superClassName];
|
||||||
|
|
||||||
|
// Use it
|
||||||
componentClass=NSClassFromString(_name);
|
componentClass=NSClassFromString(_name);
|
||||||
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass);
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,9 @@ static char rcsId[] = "$Id$";
|
||||||
@implementation GSWComponentRequestHandler
|
@implementation GSWComponentRequestHandler
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
/** Handle request aRequest and return the response
|
||||||
|
This lock application
|
||||||
|
**/
|
||||||
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
-(GSWResponse*)handleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
|
@ -45,7 +48,7 @@ static char rcsId[] = "$Id$";
|
||||||
response=[self lockedHandleRequest:aRequest];
|
response=[self lockedHandleRequest:aRequest];
|
||||||
if (!response)
|
if (!response)
|
||||||
{
|
{
|
||||||
response=[GSWResponse responseWithMessage:@"Component Handle request failed"
|
response=[GSWResponse responseWithMessage:@"Component Handle request failed. No Response"
|
||||||
inContext:nil
|
inContext:nil
|
||||||
forRequest:aRequest];
|
forRequest:aRequest];
|
||||||
[response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
|
[response _finalizeInContext:nil]; //DO Call _finalizeInContext: !
|
||||||
|
@ -57,6 +60,9 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
/** Handle request aRequest and return the response
|
||||||
|
Application should be locked before this
|
||||||
|
**/
|
||||||
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest
|
-(GSWResponse*)lockedHandleRequest:(GSWRequest*)aRequest
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
|
@ -190,6 +196,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
// check for refuseNewSessions
|
// check for refuseNewSessions
|
||||||
session=[application _initializeSessionInContext:aContext];
|
session=[application _initializeSessionInContext:aContext];
|
||||||
|
NSDebugMLLog(@"requests",@"session=%@",session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
|
|
|
@ -314,6 +314,8 @@ extern id imageMapString__Key;
|
||||||
extern id imageMapRegions__Key;
|
extern id imageMapRegions__Key;
|
||||||
extern id handleValidationException__Key;
|
extern id handleValidationException__Key;
|
||||||
extern id selectedValues__Key;
|
extern id selectedValues__Key;
|
||||||
|
extern id startIndex__Key;
|
||||||
|
extern id stopIndex__Key;
|
||||||
|
|
||||||
|
|
||||||
#endif // _GSWebConstants_h__
|
#endif // _GSWebConstants_h__
|
||||||
|
|
|
@ -318,4 +318,6 @@ id imageMapString__Key = @"imageMapString";
|
||||||
id imageMapRegions__Key = @"imageMapRegions";
|
id imageMapRegions__Key = @"imageMapRegions";
|
||||||
id handleValidationException__Key = @"handleValidationException";
|
id handleValidationException__Key = @"handleValidationException";
|
||||||
id selectedValues__Key = @"selectedValues";
|
id selectedValues__Key = @"selectedValues";
|
||||||
|
id startIndex__Key = @"startIndex";
|
||||||
|
id stopIndex__Key = @"stopIndex";
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ static int dontTraceComponentActionURL=0;
|
||||||
ASSIGN(clone->_pageComponent,_pageComponent);
|
ASSIGN(clone->_pageComponent,_pageComponent);
|
||||||
ASSIGN(clone->_currentComponent,_currentComponent);
|
ASSIGN(clone->_currentComponent,_currentComponent);
|
||||||
ASSIGNCOPY(clone->_url,_url);
|
ASSIGNCOPY(clone->_url,_url);
|
||||||
ASSIGNCOPY(clone->_awakePageComponents,_awakePageComponents);
|
ASSIGN(clone->_awakePageComponents,_awakePageComponents);
|
||||||
clone->_urlApplicationNumber=_urlApplicationNumber;
|
clone->_urlApplicationNumber=_urlApplicationNumber;
|
||||||
clone->_isClientComponentRequest=_isClientComponentRequest;
|
clone->_isClientComponentRequest=_isClientComponentRequest;
|
||||||
clone->_distributionEnabled=_distributionEnabled;
|
clone->_distributionEnabled=_distributionEnabled;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define _GSWebDebug_h__
|
#define _GSWebDebug_h__
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
extern NSString* GSWDebugMethodMsg(id obj, SEL sel, const char *file, int line, NSString *fmt);
|
||||||
extern void GSWLogC_(CONST char* file,int line,CONST char* string);
|
extern void GSWLogC_(CONST char* file,int line,CONST char* string);
|
||||||
extern void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep);
|
extern void GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep);
|
||||||
extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
@ -69,6 +70,7 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
// Normal Debug
|
// Normal Debug
|
||||||
#ifdef GSWDEBUG
|
#ifdef GSWDEBUG
|
||||||
|
|
||||||
#define LOGClassFnStart() \
|
#define LOGClassFnStart() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
|
@ -111,47 +113,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define LOGObjectFnStart() \
|
#define LOGObjectFnStart() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStop() \
|
#define LOGObjectFnStop() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStartC(comment) \
|
#define LOGObjectFnStartC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStopC(comment) \
|
#define LOGObjectFnStopC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStartCond(cond) \
|
#define LOGObjectFnStartCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStopCond(cond) \
|
#define LOGObjectFnStopCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStartCondC(cond,comment) \
|
#define LOGObjectFnStartCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnStopCondC(cond,comment) \
|
#define LOGObjectFnStopCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGObjectFnNotImplemented() \
|
#define LOGObjectFnNotImplemented() \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGClassFnNotImplemented() \
|
#define LOGClassFnNotImplemented() \
|
||||||
|
@ -202,25 +204,25 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define NSDebugMLLogCond(cond, level, format, args...) \
|
#define NSDebugMLLogCond(cond, level, format, args...) \
|
||||||
do { if (cond && GSDebugSet(level) == YES) { \
|
do { if (cond && GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugMLogCond(cond, format, args...) \
|
#define NSDebugMLogCond(cond, format, args...) \
|
||||||
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugMLog0(format) \
|
#define NSDebugMLog0(format) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define NSDebugMLLog0(level,format) \
|
#define NSDebugMLLog0(level,format) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
|
@ -313,47 +315,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStart() \
|
#define LOGDEEPObjectFnStart() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStop() \
|
#define LOGDEEPObjectFnStop() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStartC(comment) \
|
#define LOGDEEPObjectFnStartC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStopC(comment) \
|
#define LOGDEEPObjectFnStopC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStartCond(cond) \
|
#define LOGDEEPObjectFnStartCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStopCond(cond) \
|
#define LOGDEEPObjectFnStopCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStartCondC(cond,comment) \
|
#define LOGDEEPObjectFnStartCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnStopCondC(cond,comment) \
|
#define LOGDEEPObjectFnStopCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPObjectFnNotImplemented() \
|
#define LOGDEEPObjectFnNotImplemented() \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGDEEPClassFnNotImplemented() \
|
#define LOGDEEPClassFnNotImplemented() \
|
||||||
|
@ -404,37 +406,37 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define NSDebugDeepMLLogCond(cond, level, format, args...) \
|
#define NSDebugDeepMLLogCond(cond, level, format, args...) \
|
||||||
do { if (cond && GSDebugSet(level) == YES) { \
|
do { if (cond && GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugDeepMLog(format, args...) \
|
#define NSDebugDeepMLog(format, args...) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugDeepMLLog(level, format, args...) \
|
#define NSDebugDeepMLLog(level, format, args...) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugDeepMLogCond(cond, format, args...) \
|
#define NSDebugDeepMLogCond(cond, format, args...) \
|
||||||
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugDeepMLog0(format) \
|
#define NSDebugDeepMLog0(format) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define NSDebugDeepMLLog0(level,format) \
|
#define NSDebugDeepMLLog0(level,format) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
|
@ -529,47 +531,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStart() \
|
#define LOGLOCKObjectFnStart() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStop() \
|
#define LOGLOCKObjectFnStop() \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStartC(comment) \
|
#define LOGLOCKObjectFnStartC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStopC(comment) \
|
#define LOGLOCKObjectFnStopC(comment) \
|
||||||
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStartCond(cond) \
|
#define LOGLOCKObjectFnStartCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStopCond(cond) \
|
#define LOGLOCKObjectFnStopCond(cond) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStartCondC(cond,comment) \
|
#define LOGLOCKObjectFnStartCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTART %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnStopCondC(cond,comment) \
|
#define LOGLOCKObjectFnStopCondC(cond,comment) \
|
||||||
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
do { if (cond && GSDebugSet(@"GSWebFn") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"FNSTOP %s"); \
|
||||||
NSLog(fmt,comment); }} while (0)
|
NSLog(fmt,comment); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKObjectFnNotImplemented() \
|
#define LOGLOCKObjectFnNotImplemented() \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
NSString *fmt = GSWDebugMethodMsg(self, _cmd, __FILE__, __LINE__,@"NOT IMPLEMENTED"); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define LOGLOCKClassFnNotImplemented() \
|
#define LOGLOCKClassFnNotImplemented() \
|
||||||
|
@ -620,37 +622,37 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object);
|
||||||
|
|
||||||
#define NSDebugLockMLLogCond(cond, level, format, args...) \
|
#define NSDebugLockMLLogCond(cond, level, format, args...) \
|
||||||
do { if (cond && GSDebugSet(level) == YES) { \
|
do { if (cond && GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugLockMLLog(level, format, args...) \
|
#define NSDebugLockMLLog(level, format, args...) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugLockMLogCond(cond, format, args...) \
|
#define NSDebugLockMLogCond(cond, format, args...) \
|
||||||
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
do { if (cond && GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugLockMLog(format, args...) \
|
#define NSDebugLockMLog(format, args...) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt, ## args); }} while (0)
|
NSLog(fmt, ## args); }} while (0)
|
||||||
|
|
||||||
#define NSDebugLockMLog0(format) \
|
#define NSDebugLockMLog0(format) \
|
||||||
do { if (GSDebugSet(@"dflt") == YES) { \
|
do { if (GSDebugSet(@"dflt") == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
#define NSDebugLockMLLog0(level,format) \
|
#define NSDebugLockMLLog0(level,format) \
|
||||||
do { if (GSDebugSet(level) == YES) { \
|
do { if (GSDebugSet(level) == YES) { \
|
||||||
NSString *fmt = GSDebugMethodMsg( \
|
NSString *fmt = GSWDebugMethodMsg( \
|
||||||
self, _cmd, __FILE__, __LINE__, format); \
|
self, _cmd, __FILE__, __LINE__, format); \
|
||||||
NSLog(fmt); }} while (0)
|
NSLog(fmt); }} while (0)
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,22 @@ static char rcsId[] = "$Id$";
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
NSString* GSWDebugMethodMsg(id obj, SEL sel, const char *file, int line, NSString *fmt)
|
||||||
|
{
|
||||||
|
NSString *message;
|
||||||
|
Class cls = (Class)obj;
|
||||||
|
char c = '+';
|
||||||
|
|
||||||
|
if ([obj isInstance] == YES)
|
||||||
|
{
|
||||||
|
c = '-';
|
||||||
|
cls = [obj class];
|
||||||
|
}
|
||||||
|
message = [NSString stringWithFormat: @"File %s: %d. In object %p [%@ %c%@] %@",
|
||||||
|
file, line, obj,NSStringFromClass(cls), c, NSStringFromSelector(sel), fmt];
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
void GSWLogC_(CONST char* file,int line,CONST char* string)
|
void GSWLogC_(CONST char* file,int line,CONST char* string)
|
||||||
{
|
{
|
||||||
|
|
|
@ -513,17 +513,37 @@ static char rcsId[] = "$Id$";
|
||||||
//TODOV
|
//TODOV
|
||||||
if (_otherQueryAssociations)
|
if (_otherQueryAssociations)
|
||||||
{
|
{
|
||||||
NSEnumerator *enumerator = [_otherAssociations keyEnumerator];
|
NSEnumerator *enumerator = [_otherQueryAssociations keyEnumerator];
|
||||||
id oaKey=nil;
|
id oaKey=nil;
|
||||||
while ((oaKey = [enumerator nextObject]))
|
while ((oaKey = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
id oaValue=[[_otherAssociations objectForKey:oaKey] valueInComponent:component];
|
id oaValue=[[_otherQueryAssociations objectForKey:oaKey] valueInComponent:component];
|
||||||
if (!oaValue)
|
if (!oaValue)
|
||||||
oaValue=[NSString string];
|
oaValue=[NSString string];
|
||||||
[queryDictionary setObject:oaValue
|
[queryDictionary setObject:oaValue
|
||||||
forKey:oaKey];
|
forKey:oaKey];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
if (_queryDictionary)
|
||||||
|
{
|
||||||
|
NSEnumerator *enumerator = nil;
|
||||||
|
NSDictionary* queryDictionaryValue=[_queryDictionary valueInComponent:component];
|
||||||
|
NSAssert3(!queryDictionaryValue || [queryDictionaryValue isKindOfClass:[NSDictionary class]],
|
||||||
|
@"queryDictionary value is not a dictionary but a %@. association was: %@. queryDictionaryValue is:",
|
||||||
|
[queryDictionaryValue class],
|
||||||
|
_queryDictionary,
|
||||||
|
queryDictionaryValue);
|
||||||
|
enumerator = [queryDictionaryValue keyEnumerator];
|
||||||
|
id oaKey=nil;
|
||||||
|
while ((oaKey = [enumerator nextObject]))
|
||||||
|
{
|
||||||
|
id oaValue=[queryDictionaryValue objectForKey:oaKey];
|
||||||
|
if (!oaValue)
|
||||||
|
oaValue=@"";
|
||||||
|
[queryDictionary setObject:oaValue
|
||||||
|
forKey:oaKey];
|
||||||
|
};
|
||||||
|
};
|
||||||
//TODO finished ??
|
//TODO finished ??
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
return queryDictionary;
|
return queryDictionary;
|
||||||
|
|
|
@ -60,9 +60,14 @@
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWInput (GSWInputA)
|
@interface GSWInput (GSWInputA)
|
||||||
|
|
||||||
|
/** Return the name for html output.
|
||||||
|
If no name is binded, it return the context id **/
|
||||||
-(NSString*)nameInContext:(GSWContext*)context;
|
-(NSString*)nameInContext:(GSWContext*)context;
|
||||||
-(NSString*)valueInContext:(GSWContext*)context;
|
|
||||||
-(void)resetAutoValue;
|
/** Return YES if element is disabled, NO otherwise,
|
||||||
|
depending on disabled/enabled binding
|
||||||
|
**/
|
||||||
-(BOOL)disabledInContext:(GSWContext*)context;
|
-(BOOL)disabledInContext:(GSWContext*)context;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -75,10 +80,24 @@
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@interface GSWInput (GSWInputC)
|
@interface GSWInput (GSWInputC)
|
||||||
|
/** Append the following elements to response:
|
||||||
|
tag
|
||||||
|
name (by calling -appendNameToResponse:inContext:)
|
||||||
|
value (by calling -appendValueToResponse:inContext:)
|
||||||
|
and others specified tag properties
|
||||||
|
**/
|
||||||
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response
|
-(void)appendGSWebObjectsAssociationsToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context;
|
inContext:(GSWContext*)context;
|
||||||
|
|
||||||
|
/** Append value property to response.
|
||||||
|
(Called by -appendGSWebObjectsAssociationsToResponse:inContext:)
|
||||||
|
**/
|
||||||
-(void)appendValueToResponse:(GSWResponse*)response
|
-(void)appendValueToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context;
|
inContext:(GSWContext*)context;
|
||||||
|
|
||||||
|
/** Append name property to response.
|
||||||
|
name come from -nameInContext:
|
||||||
|
*/
|
||||||
-(void)appendNameToResponse:(GSWResponse*)response
|
-(void)appendNameToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context;
|
inContext:(GSWContext*)context;
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,9 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStartC("GSWInput");
|
LOGObjectFnStartC("GSWInput");
|
||||||
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
|
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
|
||||||
[attributedAssociations removeObjectForKey:disabled__Key];
|
[attributedAssociations removeObjectForKey:disabled__Key];
|
||||||
[attributedAssociations removeObjectForKey:enabled__Key];//??
|
[attributedAssociations removeObjectForKey:enabled__Key];
|
||||||
[attributedAssociations removeObjectForKey:value__Key];//??
|
[attributedAssociations removeObjectForKey:value__Key];
|
||||||
|
[attributedAssociations removeObjectForKey:name__Key];
|
||||||
if (!WOStrictFlag)
|
if (!WOStrictFlag)
|
||||||
[attributedAssociations removeObjectForKey:handleValidationException__Key];
|
[attributedAssociations removeObjectForKey:handleValidationException__Key];
|
||||||
_value = [[associations objectForKey:value__Key
|
_value = [[associations objectForKey:value__Key
|
||||||
|
@ -131,50 +132,15 @@ static char rcsId[] = "$Id$";
|
||||||
nameValue=[context elementID];
|
nameValue=[context elementID];
|
||||||
NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]);
|
NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]);
|
||||||
};
|
};
|
||||||
|
NSDebugMLLog(@"gswdync",@"nameValue=%@",nameValue);
|
||||||
GSWAssertIsElementID(context);
|
GSWAssertIsElementID(context);
|
||||||
LOGObjectFnStopC("GSWInput");
|
LOGObjectFnStopC("GSWInput");
|
||||||
return nameValue;
|
return nameValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int countAutoValue = 0;
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
-(NSString*)valueInContext:(GSWContext*)context
|
|
||||||
{
|
|
||||||
//OK
|
|
||||||
GSWComponent *component=nil;
|
|
||||||
NSString *valueValue=nil;
|
|
||||||
|
|
||||||
LOGObjectFnStartC("GSWInput");
|
|
||||||
countAutoValue++;
|
|
||||||
if(_value)
|
|
||||||
{
|
|
||||||
component=[context component];
|
|
||||||
valueValue=[_value valueInComponent:component];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
valueValue=[NSString stringWithFormat:@"%@.%d", [context elementID], countAutoValue];
|
|
||||||
NSDebugMLLog(@"gswdync",@"elementID=%@ _countAutoValue",[context elementID], countAutoValue);
|
|
||||||
}
|
|
||||||
LOGObjectFnStopC("GSWInput");
|
|
||||||
return valueValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
|
||||||
- (void)resetAutoValue
|
|
||||||
{
|
|
||||||
LOGObjectFnStartC("GSWInput");
|
|
||||||
|
|
||||||
countAutoValue = 0;
|
|
||||||
|
|
||||||
LOGObjectFnStopC("GSWInput");
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(BOOL)disabledInContext:(GSWContext*)context
|
-(BOOL)disabledInContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
//OK
|
|
||||||
if (!WOStrictFlag && _enabled)
|
if (!WOStrictFlag && _enabled)
|
||||||
return ![self evaluateCondition:_enabled
|
return ![self evaluateCondition:_enabled
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
@ -249,10 +215,10 @@ static int countAutoValue = 0;
|
||||||
disabledInContext=[self disabledInContext:context]; //return 0
|
disabledInContext=[self disabledInContext:context]; //return 0
|
||||||
if (disabledInContext)
|
if (disabledInContext)
|
||||||
[response _appendContentAsciiString:@" disabled"];
|
[response _appendContentAsciiString:@" disabled"];
|
||||||
[self appendValueToResponse:response
|
|
||||||
inContext:context];
|
|
||||||
[self appendNameToResponse:response
|
[self appendNameToResponse:response
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
[self appendValueToResponse:response
|
||||||
|
inContext:context];
|
||||||
LOGObjectFnStopC("GSWInput");
|
LOGObjectFnStopC("GSWInput");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,15 @@
|
||||||
plainText:(NSString*)plainTextMessage
|
plainText:(NSString*)plainTextMessage
|
||||||
send:(BOOL)sendNow;
|
send:(BOOL)sendNow;
|
||||||
|
|
||||||
|
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
to:(NSArray*)to
|
to:(NSArray*)to
|
||||||
cc:(NSArray*)cc
|
cc:(NSArray*)cc
|
||||||
subject:(NSString*)subject
|
subject:(NSString*)subject
|
||||||
component:(GSWComponent*)component
|
component:(GSWComponent*)component
|
||||||
send:(BOOL)sendNow;
|
send:(BOOL)sendNow;
|
||||||
|
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
to:(NSArray*)to
|
to:(NSArray*)to
|
||||||
|
@ -60,6 +63,9 @@
|
||||||
subject:(NSString*)subject
|
subject:(NSString*)subject
|
||||||
plainText:(NSString*)plainTextMessage
|
plainText:(NSString*)plainTextMessage
|
||||||
send:(BOOL)sendNow;
|
send:(BOOL)sendNow;
|
||||||
|
|
||||||
|
//NDFN
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
to:(NSArray*)to
|
to:(NSArray*)to
|
||||||
|
@ -69,6 +75,7 @@
|
||||||
component:(GSWComponent*)component
|
component:(GSWComponent*)component
|
||||||
send:(BOOL)sendNow;
|
send:(BOOL)sendNow;
|
||||||
|
|
||||||
|
|
||||||
-(void)sendEmail:(NSString*)emailString;
|
-(void)sendEmail:(NSString*)emailString;
|
||||||
-(void)_invokeGSWSendMailAt:(id)at
|
-(void)_invokeGSWSendMailAt:(id)at
|
||||||
withEmail:(id)email;
|
withEmail:(id)email;
|
||||||
|
|
|
@ -54,19 +54,24 @@ static GSWMailDelivery *sharedInstance;
|
||||||
plainText:(NSString*)plainTextMessage
|
plainText:(NSString*)plainTextMessage
|
||||||
send:(BOOL)sendNow
|
send:(BOOL)sendNow
|
||||||
{
|
{
|
||||||
|
NSString* emailString=nil;
|
||||||
|
LOGObjectFnStart();
|
||||||
NSDebugMLog(@"sender=%@",sender);
|
NSDebugMLog(@"sender=%@",sender);
|
||||||
NSDebugMLog(@"to=%@",to);
|
NSDebugMLog(@"to=%@",to);
|
||||||
NSDebugMLog(@"cc=%@",cc);
|
NSDebugMLog(@"cc=%@",cc);
|
||||||
NSDebugMLog(@"subject=%@",subject);
|
NSDebugMLog(@"subject=%@",subject);
|
||||||
NSDebugMLog(@"plainTextMessage=%@",plainTextMessage);
|
NSDebugMLog(@"plainTextMessage=%@",plainTextMessage);
|
||||||
NSDebugMLog(@"sendNow=%d",(int)sendNow);
|
NSDebugMLog(@"sendNow=%d",(int)sendNow);
|
||||||
return [self composeEmailFrom:sender
|
emailString=[self composeEmailFrom:sender
|
||||||
to:to
|
to:to
|
||||||
cc:cc
|
cc:cc
|
||||||
bcc:nil
|
bcc:nil
|
||||||
subject:subject
|
subject:subject
|
||||||
plainText:plainTextMessage
|
plainText:plainTextMessage
|
||||||
send:sendNow];
|
send:sendNow];
|
||||||
|
NSDebugMLog(@"emailString=%@",emailString);
|
||||||
|
LOGObjectFnStop();
|
||||||
|
return emailString;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
|
@ -76,10 +81,27 @@ static GSWMailDelivery *sharedInstance;
|
||||||
component:(GSWComponent*)component
|
component:(GSWComponent*)component
|
||||||
send:(BOOL)sendNow
|
send:(BOOL)sendNow
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
NSString* emailString=nil;
|
||||||
return nil;
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLog(@"sender=%@",sender);
|
||||||
|
NSDebugMLog(@"to=%@",to);
|
||||||
|
NSDebugMLog(@"cc=%@",cc);
|
||||||
|
NSDebugMLog(@"subject=%@",subject);
|
||||||
|
NSDebugMLog(@"component=%@",component);
|
||||||
|
NSDebugMLog(@"sendNow=%d",(int)sendNow);
|
||||||
|
emailString=[self composeEmailFrom:sender
|
||||||
|
to:to
|
||||||
|
cc:cc
|
||||||
|
bcc:nil
|
||||||
|
subject:subject
|
||||||
|
component:component
|
||||||
|
send:sendNow];
|
||||||
|
NSDebugMLog(@"emailString=%@",emailString);
|
||||||
|
LOGObjectFnStop();
|
||||||
|
return emailString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
to:(NSArray*)to
|
to:(NSArray*)to
|
||||||
|
@ -93,7 +115,10 @@ static GSWMailDelivery *sharedInstance;
|
||||||
NSMutableString* toString=nil;
|
NSMutableString* toString=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
int count=0;
|
int count=0;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
NSAssert1(!to || [to isKindOfClass:[NSArray class]],@"to is a %@, not a NSArray",[to class]);
|
||||||
|
NSAssert1(!cc || [cc isKindOfClass:[NSArray class]],@"cc is a %@, not a NSArray",[cc class]);
|
||||||
|
NSAssert1(!bcc || [bcc isKindOfClass:[NSArray class]],@"bcc is a %@, not a NSArray",[bcc class]);
|
||||||
count=[to count];
|
count=[to count];
|
||||||
NSDebugMLog(@"sender=%@",sender);
|
NSDebugMLog(@"sender=%@",sender);
|
||||||
NSDebugMLog(@"to=%@",to);
|
NSDebugMLog(@"to=%@",to);
|
||||||
|
@ -147,10 +172,12 @@ static GSWMailDelivery *sharedInstance;
|
||||||
NSDebugMLog(@"messageString=%@",messageString);
|
NSDebugMLog(@"messageString=%@",messageString);
|
||||||
if (sendNow)
|
if (sendNow)
|
||||||
[self sendEmail:messageString];
|
[self sendEmail:messageString];
|
||||||
|
LOGObjectFnStop();
|
||||||
return messageString;
|
return messageString;
|
||||||
};
|
};
|
||||||
|
|
||||||
//NDFN
|
//NDFN
|
||||||
|
// Be carefull: this call [context _generateCompleteURLs]
|
||||||
-(NSString*)composeEmailFrom:(NSString*)sender
|
-(NSString*)composeEmailFrom:(NSString*)sender
|
||||||
to:(NSArray*)to
|
to:(NSArray*)to
|
||||||
cc:(NSArray*)cc
|
cc:(NSArray*)cc
|
||||||
|
@ -159,16 +186,107 @@ static GSWMailDelivery *sharedInstance;
|
||||||
component:(GSWComponent*)component
|
component:(GSWComponent*)component
|
||||||
send:(BOOL)sendNow
|
send:(BOOL)sendNow
|
||||||
{
|
{
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
//TODO setting the content type of the email as Content-type: text/html.
|
||||||
return nil;
|
GSWContext* context=nil;
|
||||||
|
NSString* plainTextMessage=nil;
|
||||||
|
NSString* messageString=nil;
|
||||||
|
GSWResponse* response=nil;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
NSDebugMLog(@"component=%@",component);
|
||||||
|
context=[component context];
|
||||||
|
NSDebugMLog(@"context=%@",context);
|
||||||
|
[context _generateCompleteURLs];
|
||||||
|
response=[component generateResponse];
|
||||||
|
NSDebugMLog(@"response=%@",response);
|
||||||
|
plainTextMessage=[[[NSString alloc]initWithData:[response content]
|
||||||
|
encoding:[response contentEncoding]] autorelease];
|
||||||
|
NSDebugMLog(@"plainTextMessage=%@",plainTextMessage);
|
||||||
|
messageString=[self composeEmailFrom:sender
|
||||||
|
to:to
|
||||||
|
cc:cc
|
||||||
|
bcc:bcc
|
||||||
|
subject:subject
|
||||||
|
plainText:plainTextMessage
|
||||||
|
send:sendNow];
|
||||||
|
messageString=[[response content]description];
|
||||||
|
NSDebugMLog(@"messageString=%@",messageString);
|
||||||
|
LOGObjectFnStop();
|
||||||
|
return messageString;
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)sendEmail:(NSString *)emailString_
|
|
||||||
{
|
|
||||||
int files[2];
|
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
NSDebugMLog(@"emailString_=%@",emailString_);
|
-(void)sendEmail:(NSString *)emailString
|
||||||
|
{
|
||||||
|
FILE* sendmailFile=NULL;
|
||||||
|
NSString* sendmailPath=nil;
|
||||||
|
NSString* sendmailCommand=nil;
|
||||||
|
NSFileManager* fileManager=nil;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
//TODO: here we should contact smtp server,... instead au using sendmail
|
||||||
|
NSDebugMLog(@"emailString=%@",emailString);
|
||||||
|
fileManager=[NSFileManager defaultManager];
|
||||||
|
NSAssert(fileManager,@"No fileManager");
|
||||||
|
sendmailPath=@"/usr/bin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/usr/lib/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/usr/sbin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/bin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/sbin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/usr/local/bin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/usr/local/lib/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"/usr/local/sbin/sendmail";
|
||||||
|
if (![fileManager isExecutableFileAtPath:sendmailPath])
|
||||||
|
{
|
||||||
|
sendmailPath=@"sendmail"; //try without absolute path
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
NSDebugMLog(@"sendmailPath=%@",sendmailPath);
|
||||||
|
// -i When reading a message from standard input, don't treat a line with only a . character as the end of input.
|
||||||
|
// -t Extract recipients from message headers. This requires that no recipients be specified on the command line.
|
||||||
|
sendmailCommand=[NSString stringWithFormat:@"%@ -i -t",sendmailPath];
|
||||||
|
NSDebugMLog(@"sendmailCommand=%@",sendmailCommand);
|
||||||
|
sendmailFile=popen([sendmailCommand lossyCString],"w");
|
||||||
|
if (sendmailFile)
|
||||||
|
{
|
||||||
|
const char* cString=[emailString lossyCString];
|
||||||
|
size_t len=strlen(cString);
|
||||||
|
size_t written=fwrite(cString, sizeof(char),len,sendmailFile);
|
||||||
|
if (written!=len)
|
||||||
|
{
|
||||||
|
NSDebugMLog(@"Error writing to sendmail (written %d / %d",written,len);
|
||||||
|
};
|
||||||
|
fclose(sendmailFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSDebugMLog(@"Can't run sendmail (%@)",sendmailCommand);
|
||||||
|
};
|
||||||
|
LOGObjectFnStop();
|
||||||
|
|
||||||
|
/* int files[2];
|
||||||
|
pid_t pid;
|
||||||
|
LOGObjectFnStart();
|
||||||
|
|
||||||
|
NSDebugMLog(@"emailString=%@",emailString);
|
||||||
|
|
||||||
if(pipe(files))
|
if(pipe(files))
|
||||||
[NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot create pipe",
|
[NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot create pipe",
|
||||||
|
@ -179,6 +297,7 @@ static GSWMailDelivery *sharedInstance;
|
||||||
switch(pid = fork())
|
switch(pid = fork())
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
NSDebugMLog(@"FORK0");
|
||||||
close(0);
|
close(0);
|
||||||
dup(files[0]);
|
dup(files[0]);
|
||||||
close(files[0]);
|
close(files[0]);
|
||||||
|
@ -189,6 +308,7 @@ static GSWMailDelivery *sharedInstance;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
|
NSDebugMLog(@"FORK-1");
|
||||||
close(files[0]);
|
close(files[0]);
|
||||||
close(files[1]);
|
close(files[1]);
|
||||||
[NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot fork process",
|
[NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot fork process",
|
||||||
|
@ -198,13 +318,16 @@ static GSWMailDelivery *sharedInstance;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
write(files[1], [emailString_ cString], strlen([emailString_ cString]));
|
NSDebugMLog(@"FORKDEF");
|
||||||
|
write(files[1], [emailString cString], strlen([emailString cString]));
|
||||||
close(files[0]);
|
close(files[0]);
|
||||||
close(files[1]);
|
close(files[1]);
|
||||||
|
|
||||||
waitpid(pid, NULL, 0);
|
waitpid(pid, NULL, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
LOGObjectFnStop();
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
-(void)_invokeGSWSendMailAt:(id)at
|
-(void)_invokeGSWSendMailAt:(id)at
|
||||||
|
@ -215,3 +338,4 @@ static GSWMailDelivery *sharedInstance;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
GSWAssociation* _noSelectionString;
|
GSWAssociation* _noSelectionString;
|
||||||
GSWAssociation* _escapeHTML;
|
GSWAssociation* _escapeHTML;
|
||||||
//GSWeb Additions {
|
//GSWeb Additions {
|
||||||
BOOL _autoValue;
|
|
||||||
GSWAssociation* _count;
|
GSWAssociation* _count;
|
||||||
GSWAssociation* _index;
|
GSWAssociation* _index;
|
||||||
// }
|
// }
|
||||||
|
|
|
@ -31,6 +31,35 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
list Array of objects that the dynamic element iterate through.
|
||||||
|
|
||||||
|
index On each iteration the element put the current index in this binding
|
||||||
|
|
||||||
|
item On each iteration the element take the item at the current index and put it in this binding
|
||||||
|
|
||||||
|
displayString String to display for each item.
|
||||||
|
|
||||||
|
value Value for each OPTION tag
|
||||||
|
|
||||||
|
selection Selected object (used to pre-select item and modified to reflect user choice)
|
||||||
|
It contains object from list, not value binding evaluated one !
|
||||||
|
|
||||||
|
selectedValue Array of pre selected values (not objects !)
|
||||||
|
|
||||||
|
name Name of the element in the form (should be unique). If not specified, GSWeb assign one.
|
||||||
|
|
||||||
|
disabled If evaluated to yes, the check box appear inactivated.
|
||||||
|
|
||||||
|
escapeHTML If evaluated to yes, escape displayString
|
||||||
|
|
||||||
|
noSelectionString If binded, displayed as the first item. If selected, considered as
|
||||||
|
an empty selection (selection is set to nil, selectionValue too)
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWPopUpButton
|
@implementation GSWPopUpButton
|
||||||
|
|
||||||
|
@ -147,7 +176,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
On WO it looks like that:
|
On WO it looks like that when value is not binded:
|
||||||
|
|
||||||
<SELECT name="4.2.7">
|
<SELECT name="4.2.7">
|
||||||
<OPTION value="0">blau</OPTION>
|
<OPTION value="0">blau</OPTION>
|
||||||
|
@ -181,8 +210,6 @@ static char rcsId[] = "$Id$";
|
||||||
id escapeHTMLValue=nil;
|
id escapeHTMLValue=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
BOOL inOptGroup=NO;
|
BOOL inOptGroup=NO;
|
||||||
NSString * popupName=nil;
|
|
||||||
|
|
||||||
#ifndef ENABLE_OPTGROUP
|
#ifndef ENABLE_OPTGROUP
|
||||||
BOOL optGroupLabel=NO;
|
BOOL optGroupLabel=NO;
|
||||||
#endif
|
#endif
|
||||||
|
@ -190,17 +217,13 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStartC("GSWPopUpButton");
|
LOGObjectFnStartC("GSWPopUpButton");
|
||||||
GSWStartElement(context);
|
GSWStartElement(context);
|
||||||
GSWSaveAppendToResponseElementID(context);
|
GSWSaveAppendToResponseElementID(context);
|
||||||
[self resetAutoValue];
|
|
||||||
_autoValue = NO;
|
|
||||||
request=[context request];
|
request=[context request];
|
||||||
isFromClientComponent=[request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
component=[context component];
|
component=[context component];
|
||||||
popupName=[self nameInContext:context];
|
|
||||||
|
|
||||||
//[super appendToResponse:response
|
[super appendToResponse:response
|
||||||
// inContext:context];
|
inContext:context];
|
||||||
[response _appendContentAsciiString:@"<SELECT"];
|
|
||||||
[response _appendContentAsciiString:[NSString stringWithFormat:@" NAME=\"%@\">",popupName]];
|
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"_list=%@",_list);
|
NSDebugMLLog(@"gswdync",@"_list=%@",_list);
|
||||||
if (_list)
|
if (_list)
|
||||||
|
@ -215,8 +238,6 @@ static char rcsId[] = "$Id$";
|
||||||
countValue=[listValue count];
|
countValue=[listValue count];
|
||||||
};
|
};
|
||||||
|
|
||||||
// NSLog(@"listValue=%@",listValue);
|
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"_count=%@",_count);
|
NSDebugMLLog(@"gswdync",@"_count=%@",_count);
|
||||||
if (_count)
|
if (_count)
|
||||||
{
|
{
|
||||||
|
@ -246,6 +267,7 @@ static char rcsId[] = "$Id$";
|
||||||
escapeHTMLValue=[_escapeHTML valueInComponent:component];
|
escapeHTMLValue=[_escapeHTML valueInComponent:component];
|
||||||
escapeHTMLBoolValue=boolValueFor(escapeHTMLValue);
|
escapeHTMLBoolValue=boolValueFor(escapeHTMLValue);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_noSelectionString)
|
if (_noSelectionString)
|
||||||
{
|
{
|
||||||
id noSelectionStringValue=nil;
|
id noSelectionStringValue=nil;
|
||||||
|
@ -256,6 +278,7 @@ static char rcsId[] = "$Id$";
|
||||||
[response _appendContentAsciiString:@"selected"];//TODO
|
[response _appendContentAsciiString:@"selected"];//TODO
|
||||||
};
|
};
|
||||||
[response appendContentCharacter:'>'];
|
[response appendContentCharacter:'>'];
|
||||||
|
|
||||||
noSelectionStringValue=[_noSelectionString valueInComponent:component];
|
noSelectionStringValue=[_noSelectionString valueInComponent:component];
|
||||||
if (escapeHTMLBoolValue)
|
if (escapeHTMLBoolValue)
|
||||||
noSelectionStringValue=[GSWResponse stringByEscapingHTMLString:noSelectionStringValue];
|
noSelectionStringValue=[GSWResponse stringByEscapingHTMLString:noSelectionStringValue];
|
||||||
|
@ -264,6 +287,7 @@ static char rcsId[] = "$Id$";
|
||||||
// There is no close tag on OPTION
|
// There is no close tag on OPTION
|
||||||
//[response _appendContentAsciiString:@"</OPTION>"];
|
//[response _appendContentAsciiString:@"</OPTION>"];
|
||||||
};
|
};
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
|
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
|
||||||
for(i=0;i<countValue;i++)
|
for(i=0;i<countValue;i++)
|
||||||
{
|
{
|
||||||
|
@ -278,18 +302,18 @@ static char rcsId[] = "$Id$";
|
||||||
if (_index)
|
if (_index)
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
if (itemValue)
|
if (itemValue)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
NSDebugMLLog(@"gswdync",@"_value (class: %@): %@",[_value class],_value);
|
||||||
if (_value)
|
// Value property of the INPUT tag
|
||||||
valueValue=[self valueInContext:context];
|
if (_value) // Binded Value
|
||||||
else
|
valueValue = [_value valueInComponent:component];
|
||||||
{
|
else // Auto Value
|
||||||
_autoValue = YES;
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
valueValue = itemValue;
|
|
||||||
};
|
|
||||||
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
BOOL isEqual=NO;
|
BOOL isEqual=NO;
|
||||||
|
@ -297,25 +321,15 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
|
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
|
||||||
[response _appendContentAsciiString:@"\n<OPTION"];
|
[response _appendContentAsciiString:@"\n<OPTION"];
|
||||||
NSDebugMLLog(@"gswdync",@"selectionValue=%@",selectionValue);
|
NSDebugMLLog(@"gswdync",@"selectionValue=%@",selectionValue);
|
||||||
if (_selection)
|
|
||||||
{
|
|
||||||
if (_value)
|
|
||||||
{
|
|
||||||
//NSLog(@"%s:%d valueValue:%@ selectionValue:%@",__FILE__,__LINE__,valueValue,selectionValue);
|
|
||||||
isEqual=SBIsValueEqual(valueValue,selectionValue);
|
|
||||||
// dave
|
|
||||||
// isEqual=[valueValue isEqual:selectionValue];
|
|
||||||
//We can have a value but want to compare on item/selection object
|
|
||||||
if (!isEqual) {
|
|
||||||
// isEqual=(itemValue && (itemValue==selectionValue));
|
|
||||||
isEqual=(itemValue && ([itemValue isEqual:selectionValue]));
|
|
||||||
} // ??
|
|
||||||
} else {
|
|
||||||
//NSLog(@"%s:%d itemValue:%@ selectionValue:%@",__FILE__,__LINE__,itemValue,selectionValue);
|
|
||||||
|
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionValue=%@",selectionValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionValue class=%@",[selectionValue class]);
|
||||||
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"itemValue class=%@",[itemValue class]);
|
||||||
|
if (selectionValue)
|
||||||
|
{
|
||||||
isEqual=SBIsValueEqual(itemValue,selectionValue);
|
isEqual=SBIsValueEqual(itemValue,selectionValue);
|
||||||
|
|
||||||
}
|
|
||||||
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
if (isEqual)
|
if (isEqual)
|
||||||
{
|
{
|
||||||
|
@ -323,15 +337,12 @@ static char rcsId[] = "$Id$";
|
||||||
[response _appendContentAsciiString:@"selected"];
|
[response _appendContentAsciiString:@"selected"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isEqual == NO && _selectedValue)
|
if (isEqual == NO && _selectedValue)
|
||||||
{
|
{
|
||||||
if(_value) {
|
// selected values is selections but on valueValue not itemValue
|
||||||
//NSLog(@"%s:%d valueValue:%@ selectedValueValue:%@",__FILE__,__LINE__,valueValue,selectedValueValue);
|
|
||||||
isEqual=SBIsValueEqual(valueValue,selectedValueValue);
|
isEqual=SBIsValueEqual(valueValue,selectedValueValue);
|
||||||
} else {
|
|
||||||
//NSLog(@"%s:%d itemValue:%@ selectedValueValue:%@",__FILE__,__LINE__,itemValue,selectedValueValue);
|
|
||||||
isEqual=SBIsValueEqual(itemValue,selectedValueValue);
|
|
||||||
}
|
|
||||||
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
if (isEqual)
|
if (isEqual)
|
||||||
{
|
{
|
||||||
|
@ -339,13 +350,10 @@ static char rcsId[] = "$Id$";
|
||||||
[response _appendContentAsciiString:@"selected"];
|
[response _appendContentAsciiString:@"selected"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if (valueValue)
|
|
||||||
{
|
|
||||||
[response _appendContentAsciiString:@" value=\""];
|
[response _appendContentAsciiString:@" value=\""];
|
||||||
//[response _appendContentAsciiString:valueValue];
|
[response _appendContentAsciiString:valueValue];
|
||||||
[response _appendContentAsciiString:[NSString stringWithFormat:@"%d",i]];
|
|
||||||
[response appendContentCharacter:'"'];
|
[response appendContentCharacter:'"'];
|
||||||
};
|
|
||||||
[response appendContentCharacter:'>'];
|
[response appendContentCharacter:'>'];
|
||||||
};
|
};
|
||||||
displayStringValue=nil;
|
displayStringValue=nil;
|
||||||
|
@ -402,7 +410,6 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
//NSDebugMLLog0(@"gswdync",@"Adding /OPTION");
|
|
||||||
// K2- No /OPTION TAG
|
// K2- No /OPTION TAG
|
||||||
//[response _appendContentAsciiString:@"</OPTION>"];
|
//[response _appendContentAsciiString:@"</OPTION>"];
|
||||||
}
|
}
|
||||||
|
@ -439,8 +446,7 @@ static char rcsId[] = "$Id$";
|
||||||
-(void)appendValueToResponse:(GSWResponse*)response
|
-(void)appendValueToResponse:(GSWResponse*)response
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
//OK
|
//Does nothing because value is only printed in OPTION tag
|
||||||
//Does nothing !
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
@ -475,7 +481,6 @@ static char rcsId[] = "$Id$";
|
||||||
LOGObjectFnStartC("GSWPopUpButton");
|
LOGObjectFnStartC("GSWPopUpButton");
|
||||||
GSWStartElement(context);
|
GSWStartElement(context);
|
||||||
GSWAssertCorrectElementID(context);
|
GSWAssertCorrectElementID(context);
|
||||||
[self resetAutoValue];
|
|
||||||
disabledValue=[self disabledInContext:context];
|
disabledValue=[self disabledInContext:context];
|
||||||
if (!disabledValue)
|
if (!disabledValue)
|
||||||
{
|
{
|
||||||
|
@ -485,6 +490,7 @@ static char rcsId[] = "$Id$";
|
||||||
GSWComponent* component=nil;
|
GSWComponent* component=nil;
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil;
|
||||||
|
NSString* valueValueString=nil;
|
||||||
id itemValue=nil;
|
id itemValue=nil;
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
NSArray* formValues=nil;
|
NSArray* formValues=nil;
|
||||||
|
@ -492,16 +498,18 @@ static char rcsId[] = "$Id$";
|
||||||
BOOL found=NO;
|
BOOL found=NO;
|
||||||
int i=0;
|
int i=0;
|
||||||
int countValue=0;
|
int countValue=0;
|
||||||
|
id itemValueToSet=nil; // Object from list found (==> _selection)
|
||||||
|
id valueValueToSet=nil; // Value Found (==> _selectionValue)
|
||||||
|
|
||||||
component=[context component];
|
component=[context component];
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
||||||
formValues=[request formValuesForKey:name];
|
formValues=[request formValuesForKey:name];
|
||||||
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
|
NSDebugMLLog(@"gswdync",@"formValues=%@",formValues);
|
||||||
|
|
||||||
if (formValues && [formValues count]>0)
|
if (formValues && [formValues count]>0)
|
||||||
{
|
{
|
||||||
BOOL isEqual=NO;
|
|
||||||
formValue=[formValues objectAtIndex:0];
|
formValue=[formValues objectAtIndex:0];
|
||||||
//NSLog(@"GSWPopUpButton formValue=%@",formValue);
|
|
||||||
NSDebugMLLog(@"gswdync",@"formValue=%@",formValue);
|
NSDebugMLLog(@"gswdync",@"formValue=%@",formValue);
|
||||||
if (_list)
|
if (_list)
|
||||||
{
|
{
|
||||||
|
@ -530,30 +538,55 @@ static char rcsId[] = "$Id$";
|
||||||
countValue=tmpCount;
|
countValue=tmpCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=0;!found && i<countValue;i++) {
|
for(i=0;!found && i<countValue;i++)
|
||||||
|
{
|
||||||
|
if (listValue)
|
||||||
itemValue=[listValue objectAtIndex:i];
|
itemValue=[listValue objectAtIndex:i];
|
||||||
// NSDebugMLLog(@"gswdync",@"_itemValue=%@",itemValue);
|
else
|
||||||
// NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
itemValue=[NSNumber numberWithShort:i];
|
||||||
|
NSDebugMLLog(@"gswdync",@"_itemValue=%@",itemValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"_item=%@",_item);
|
||||||
|
|
||||||
if (_item)
|
if (_item)
|
||||||
[_item setValue:itemValue
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
//NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
|
||||||
if ([formValues containsObject:[NSString stringWithFormat:@"%d",i]])
|
if (_index)
|
||||||
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
|
inComponent:component];
|
||||||
|
|
||||||
|
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
||||||
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
valueValueString=[NSString stringWithFormat:@"%@",valueValue];
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
|
if (valueValue)
|
||||||
{
|
{
|
||||||
found=YES;
|
// we compare (with object equality not pointer equality)
|
||||||
|
found=[formValues containsObject:valueValueString];
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
itemValueToSet=itemValue;
|
||||||
|
valueValueToSet=valueValue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
if (_selection)
|
if (_selection)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
[_selection setValue:itemValue
|
[_selection setValue:itemValueToSet
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException(@"GSWPopUpButton _value=%@ resultValue=%@ exception=%@",
|
LOGException(@"GSWPopUpButton _selection=%@ itemValueToSet=%@ exception=%@",
|
||||||
_value,resultValue,localException);
|
_selection,itemValueToSet,localException);
|
||||||
if (WOStrictFlag)
|
if (WOStrictFlag)
|
||||||
{
|
{
|
||||||
[localException raise];
|
[localException raise];
|
||||||
|
@ -567,47 +600,18 @@ static char rcsId[] = "$Id$";
|
||||||
NS_ENDHANDLER;
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
NSDebugMLLog(@"gswdync",@"selectionValue=%@",_selectionValue);
|
||||||
};// for
|
|
||||||
|
|
||||||
};
|
|
||||||
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
|
||||||
if (!found)
|
|
||||||
{
|
|
||||||
if (_selection)
|
|
||||||
{
|
|
||||||
NS_DURING
|
|
||||||
{
|
|
||||||
[_selection setValue:nil
|
|
||||||
inComponent:component];
|
|
||||||
}
|
|
||||||
NS_HANDLER
|
|
||||||
{
|
|
||||||
LOGException(@"GSWPopUpButton _selection=%@ exception=%@",
|
|
||||||
_selection,localException);
|
|
||||||
if (WOStrictFlag)
|
|
||||||
{
|
|
||||||
[localException raise];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[self handleValidationException:localException
|
|
||||||
inContext:context];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
NS_ENDHANDLER;
|
|
||||||
};
|
|
||||||
if (!WOStrictFlag && _selectionValue)
|
if (!WOStrictFlag && _selectionValue)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
[_selectionValue setValue:nil
|
[_selectionValue setValue:valueValueToSet
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
LOGException(@"GSWPopUpButton _selectionValue=%@ exception=%@",
|
LOGException(@"GSWPopUpButton _selectionValue=%@ valueValueToSet=%@ exception=%@",
|
||||||
_selectionValue,localException);
|
_selectionValue,valueValue,localException);
|
||||||
[self handleValidationException:localException
|
[self handleValidationException:localException
|
||||||
inContext:context];
|
inContext:context];
|
||||||
}
|
}
|
||||||
|
@ -615,7 +619,6 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
GSWStopElement(context);
|
GSWStopElement(context);
|
||||||
GSWAssertIsElementID(context);
|
GSWAssertIsElementID(context);
|
||||||
LOGObjectFnStopC("GSWPopUpButton");
|
LOGObjectFnStopC("GSWPopUpButton");
|
||||||
|
|
|
@ -39,6 +39,9 @@
|
||||||
GSWAssociation* _item;
|
GSWAssociation* _item;
|
||||||
GSWAssociation* _index;
|
GSWAssociation* _index;
|
||||||
GSWAssociation* _selection;
|
GSWAssociation* _selection;
|
||||||
|
//GSWeb Additions {
|
||||||
|
GSWAssociation* _selectionValue;
|
||||||
|
// }
|
||||||
GSWAssociation* _prefix;
|
GSWAssociation* _prefix;
|
||||||
GSWAssociation* _suffix;
|
GSWAssociation* _suffix;
|
||||||
GSWAssociation* _displayString;
|
GSWAssociation* _displayString;
|
||||||
|
|
|
@ -31,6 +31,36 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
#include <GSWeb/GSWeb.h>
|
#include <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
Bindings
|
||||||
|
|
||||||
|
list Array of objects that the dynamic element iterate through.
|
||||||
|
|
||||||
|
index On each iteration the element put the current index in this binding
|
||||||
|
|
||||||
|
item On each iteration the element take the item at the current index and put it in this binding
|
||||||
|
|
||||||
|
displayString String to display for each radio button.
|
||||||
|
|
||||||
|
value Value for the INPUT tag for each radio button
|
||||||
|
|
||||||
|
prefix An html string to insert before each value.
|
||||||
|
|
||||||
|
suffix An html string to insert after each value.
|
||||||
|
|
||||||
|
selection Selected object (used to pre-check radio button and modified to reflect user choice)
|
||||||
|
It contains object from list, not value binding evaluated one !
|
||||||
|
|
||||||
|
selectionValue Selected value (used to pre-check radio button and modified to reflect user choice)
|
||||||
|
It contains evaluated value binding !
|
||||||
|
|
||||||
|
name Name of the element in the form (should be unique). If not specified, GSWeb assign one.
|
||||||
|
|
||||||
|
disabled If evaluated to yes, the radio button appear inactivated.
|
||||||
|
|
||||||
|
escapeHTML If evaluated to yes, escape displayString
|
||||||
|
|
||||||
|
**/
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWRadioButtonList
|
@implementation GSWRadioButtonList
|
||||||
|
|
||||||
|
@ -41,7 +71,7 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStartC("GSWRadioButtonList");
|
||||||
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",
|
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",
|
||||||
aName,associations,elements);
|
aName,associations,elements);
|
||||||
_defaultEscapeHTML=1;
|
_defaultEscapeHTML=1;
|
||||||
|
@ -49,6 +79,8 @@ static char rcsId[] = "$Id$";
|
||||||
[tmpAssociations removeObjectForKey:item__Key];
|
[tmpAssociations removeObjectForKey:item__Key];
|
||||||
[tmpAssociations removeObjectForKey:index__Key];
|
[tmpAssociations removeObjectForKey:index__Key];
|
||||||
[tmpAssociations removeObjectForKey:selection__Key];
|
[tmpAssociations removeObjectForKey:selection__Key];
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
[tmpAssociations removeObjectForKey:selectionValue__Key];
|
||||||
[tmpAssociations removeObjectForKey:prefix__Key];
|
[tmpAssociations removeObjectForKey:prefix__Key];
|
||||||
[tmpAssociations removeObjectForKey:suffix__Key];
|
[tmpAssociations removeObjectForKey:suffix__Key];
|
||||||
[tmpAssociations removeObjectForKey:displayString__Key];
|
[tmpAssociations removeObjectForKey:displayString__Key];
|
||||||
|
@ -63,20 +95,29 @@ static char rcsId[] = "$Id$";
|
||||||
withDefaultObject:[_item autorelease]] retain];
|
withDefaultObject:[_item autorelease]] retain];
|
||||||
if (_item && ![_item isValueSettable])
|
if (_item && ![_item isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'item' parameter must be settable");
|
ExceptionRaise0(@"GSWRadioButtonList",@"'item' parameter must be settable");
|
||||||
};
|
};
|
||||||
_index=[[associations objectForKey:index__Key
|
_index=[[associations objectForKey:index__Key
|
||||||
withDefaultObject:[_index autorelease]] retain];
|
withDefaultObject:[_index autorelease]] retain];
|
||||||
if (_index && ![_index isValueSettable])
|
if (_index && ![_index isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'index' parameter must be settable");
|
ExceptionRaise0(@"GSWRadioButtonList",@"'index' parameter must be settable");
|
||||||
};
|
};
|
||||||
|
|
||||||
_selection=[[associations objectForKey:selection__Key
|
_selection=[[associations objectForKey:selection__Key
|
||||||
withDefaultObject:[_selection autorelease]] retain];
|
withDefaultObject:[_selection autorelease]] retain];
|
||||||
if (![_selection isValueSettable])
|
if (_selection && ![_selection isValueSettable])
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWCheckBox",@"'selection' parameter must be settable");
|
ExceptionRaise0(@"GSWRadioButtonList",@"'selection' parameter must be settable");
|
||||||
|
};
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
{
|
||||||
|
_selectionValue=[[associations objectForKey:selectionValue__Key
|
||||||
|
withDefaultObject:[_selectionValue autorelease]] retain];
|
||||||
|
if (_selectionValue && ![_selectionValue isValueSettable])
|
||||||
|
{
|
||||||
|
ExceptionRaise0(@"GSWRadioButtonList",@"'selectionValue' parameter must be settable");
|
||||||
|
};
|
||||||
};
|
};
|
||||||
_prefix=[[associations objectForKey:prefix__Key
|
_prefix=[[associations objectForKey:prefix__Key
|
||||||
withDefaultObject:[_prefix autorelease]] retain];
|
withDefaultObject:[_prefix autorelease]] retain];
|
||||||
|
@ -97,6 +138,7 @@ static char rcsId[] = "$Id$";
|
||||||
DESTROY(_item);
|
DESTROY(_item);
|
||||||
DESTROY(_index);
|
DESTROY(_index);
|
||||||
DESTROY(_selection);
|
DESTROY(_selection);
|
||||||
|
DESTROY(_selectionValue);//GSWeb Only
|
||||||
DESTROY(_prefix);
|
DESTROY(_prefix);
|
||||||
DESTROY(_suffix);
|
DESTROY(_suffix);
|
||||||
DESTROY(_displayString);
|
DESTROY(_displayString);
|
||||||
|
@ -128,10 +170,10 @@ static char rcsId[] = "$Id$";
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStartC("GSWRadioButtonList");
|
||||||
[self _slowTakeValuesFromRequest:request
|
[self _slowTakeValuesFromRequest:request
|
||||||
inContext:context];
|
inContext:context];
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStopC("GSWRadioButtonList");
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
|
@ -140,26 +182,31 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
BOOL disabledInContext=NO;
|
BOOL disabledInContext=NO;
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStartC("GSWRadioButtonList");
|
||||||
|
|
||||||
[self resetAutoValue];
|
|
||||||
disabledInContext=[self disabledInContext:context];
|
disabledInContext=[self disabledInContext:context];
|
||||||
if (!disabledInContext)
|
if (!disabledInContext)
|
||||||
{
|
{
|
||||||
if ([context _wasFormSubmitted])
|
if ([context _wasFormSubmitted])
|
||||||
{
|
{
|
||||||
GSWComponent* component=[context component];
|
GSWComponent* component=[context component];
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil; // _list value
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
int foundIndex=-1;
|
BOOL found=NO;
|
||||||
id formValue=nil;
|
id formValue=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil; // _value value (or autoValue)
|
||||||
id valueToSet=nil;
|
id itemValue=nil; // _item value
|
||||||
|
NSString* valueValueString=nil; // _value value as string
|
||||||
|
id itemValueToSet=nil; // item value to set to _selection
|
||||||
|
id valueValueToSet=nil; // valueValue to set to _selectionValue
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
NSDebugMLLog(@"gswdync",@"name=%@",name);
|
||||||
|
|
||||||
formValue=[request formValueForKey:name];
|
formValue=[request formValueForKey:name];
|
||||||
NSDebugMLLog(@"gswdync",@"formValue=%@",formValue);
|
NSDebugMLLog(@"gswdync",@"formValue=%@",formValue);
|
||||||
|
|
||||||
listValue=[_list valueInComponent:component];
|
listValue=[_list valueInComponent:component];
|
||||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||||
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
||||||
|
@ -167,78 +214,103 @@ static char rcsId[] = "$Id$";
|
||||||
listValue,
|
listValue,
|
||||||
[listValue class]);
|
[listValue class]);
|
||||||
NSDebugMLLog(@"gswdync",@"listValue=%@",listValue);
|
NSDebugMLLog(@"gswdync",@"listValue=%@",listValue);
|
||||||
for(i=0;i<[listValue count] && foundIndex<0;i++)
|
|
||||||
|
for(i=0;i<[listValue count] && !found;i++)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
NSDebugMLLog(@"gswdync",@"item=%@",_item);
|
||||||
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
NSDebugMLLog(@"gswdync",@"index=%@",_index);
|
||||||
|
|
||||||
|
itemValue=[listValue objectAtIndex:i];
|
||||||
if (_item)
|
if (_item)
|
||||||
[_item setValue:[listValue objectAtIndex:i]
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
else if (_index)
|
|
||||||
|
if (_index)
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
|
||||||
|
|
||||||
//TODOV
|
NSDebugMLLog(@"gswdync",@"value=%@",_value);
|
||||||
valueValue=[self valueInContext:context];
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
valueValueString=[NSString stringWithFormat:@"%@",valueValue];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
if (valueValue)
|
if (valueValue)
|
||||||
{
|
{
|
||||||
BOOL isEqual=SBIsValueEqual(valueValue,formValue);
|
// we compare (with object equality not pointer equality)
|
||||||
|
BOOL isEqual=SBIsValueEqual(valueValueString,formValue);
|
||||||
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
|
|
||||||
if (isEqual)
|
if (isEqual)
|
||||||
{
|
{
|
||||||
if(_autoValue == NO)
|
itemValueToSet=itemValue;
|
||||||
valueToSet=valueValue;
|
valueValueToSet=valueValue;
|
||||||
else
|
found=YES;
|
||||||
valueToSet=[listValue objectAtIndex:i];
|
|
||||||
foundIndex=i;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"component=%@",component);
|
NSDebugMLLog(@"gswdync",@"component=%@",component);
|
||||||
NSDebugMLLog(@"gswdync",@"foundIndex=%d",foundIndex);
|
NSDebugMLLog(@"gswdync",@"found=%s",(found ? "YES" : "NO"));
|
||||||
NSDebugMLLog(@"gswdync",@"selection=%@",_selection);
|
NSDebugMLLog(@"gswdync",@"selection=%@",_selection);
|
||||||
GSWLogAssertGood(component);
|
GSWLogAssertGood(component);
|
||||||
if (!WOStrictFlag)
|
|
||||||
{
|
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
if (foundIndex>=0)
|
[_selection setValue:itemValueToSet
|
||||||
[_selection setValue:valueToSet
|
|
||||||
inComponent:component];
|
|
||||||
else
|
|
||||||
[_selection setValue:nil
|
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
};
|
};
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
[self handleValidationException:localException
|
LOGException(@"GSWRadioButtonList _selection=%@ itemValueToSet=%@ exception=%@",
|
||||||
inContext:context];
|
_selection,itemValueToSet,localException);
|
||||||
}
|
if (WOStrictFlag)
|
||||||
NS_ENDHANDLER;
|
{
|
||||||
|
[localException raise];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (foundIndex>=0)
|
[self handleValidationException:localException
|
||||||
[_selection setValue:valueToSet
|
inContext:context];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
|
if (!WOStrictFlag && _selectionValue)
|
||||||
|
{
|
||||||
|
NS_DURING
|
||||||
|
{
|
||||||
|
[_selectionValue setValue:valueValueToSet
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
};
|
||||||
|
NS_HANDLER
|
||||||
|
{
|
||||||
|
LOGException(@"GSWRadioButtonList _selectionValue=%@ valueValueToSet=%@ exception=%@",
|
||||||
|
_selectionValue,valueValueToSet,localException);
|
||||||
|
if (WOStrictFlag)
|
||||||
|
{
|
||||||
|
[localException raise];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
[_selection setValue:nil
|
{
|
||||||
inComponent:component];
|
[self handleValidationException:localException
|
||||||
|
inContext:context];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
NS_ENDHANDLER;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStopC("GSWRadioButtonList");
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
-(void)_fastTakeValuesFromRequest:(GSWRequest*)request
|
-(void)_fastTakeValuesFromRequest:(GSWRequest*)request
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStartC("GSWRadioButtonList");
|
||||||
LOGObjectFnNotImplemented(); //TODOFN
|
LOGObjectFnNotImplemented(); //TODOFN
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStopC("GSWRadioButtonList");
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
|
@ -248,24 +320,28 @@ static char rcsId[] = "$Id$";
|
||||||
//OK
|
//OK
|
||||||
GSWRequest* request=nil;
|
GSWRequest* request=nil;
|
||||||
BOOL isFromClientComponent=NO;
|
BOOL isFromClientComponent=NO;
|
||||||
|
BOOL disabledInContext=NO;
|
||||||
NSString* name=nil;
|
NSString* name=nil;
|
||||||
GSWComponent* component=nil;
|
GSWComponent* component=nil;
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
id selectionValue=nil;
|
id selectionValue=nil;
|
||||||
|
id selectionValueValue=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
id displayStringValue=nil;
|
id displayStringValue=nil;
|
||||||
id prefixValue=nil;
|
id prefixValue=nil;
|
||||||
id suffixValue=nil;
|
id suffixValue=nil;
|
||||||
id valueValue=nil;
|
id valueValue=nil; // _value value (or auto value)
|
||||||
BOOL isEqual=NO;
|
id itemValue=nil; // _item value
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStartC("GSWRadioButtonList");
|
||||||
[self resetAutoValue];
|
|
||||||
_autoValue = NO;
|
|
||||||
request=[context request];
|
request=[context request];
|
||||||
isFromClientComponent=[request isFromClientComponent];
|
isFromClientComponent=[request isFromClientComponent];
|
||||||
name=[self nameInContext:context];
|
name=[self nameInContext:context];
|
||||||
component=[context component];
|
component=[context component];
|
||||||
|
|
||||||
selectionValue=[_selection valueInComponent:component];
|
selectionValue=[_selection valueInComponent:component];
|
||||||
|
selectionValueValue=[_selectionValue valueInComponent:component];
|
||||||
|
|
||||||
listValue=[_list valueInComponent:component];
|
listValue=[_list valueInComponent:component];
|
||||||
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert3(!listValue || [listValue respondsToSelector:@selector(count)],
|
||||||
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
@"The list (%@) (%@ of class:%@) doesn't respond to 'count'",
|
||||||
|
@ -274,35 +350,70 @@ static char rcsId[] = "$Id$";
|
||||||
[listValue class]);
|
[listValue class]);
|
||||||
for(i=0;i<[listValue count];i++)
|
for(i=0;i<[listValue count];i++)
|
||||||
{
|
{
|
||||||
[_item setValue:[listValue objectAtIndex:i]
|
BOOL isEqual=NO;
|
||||||
|
|
||||||
|
disabledInContext=[self disabledInContext:context];
|
||||||
|
|
||||||
|
itemValue=[listValue objectAtIndex:i];
|
||||||
|
[_item setValue:itemValue
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
prefixValue=[_prefix valueInComponent:component];
|
prefixValue=[_prefix valueInComponent:component];
|
||||||
suffixValue=[_suffix valueInComponent:component];
|
suffixValue=[_suffix valueInComponent:component];
|
||||||
|
|
||||||
[_index setValue:[NSNumber numberWithShort:i]
|
[_index setValue:[NSNumber numberWithShort:i]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
|
|
||||||
displayStringValue=[_displayString valueInComponent:component];
|
displayStringValue=[_displayString valueInComponent:component];
|
||||||
|
|
||||||
[response appendContentString:@"<INPUT NAME=\""];
|
[response appendContentString:@"<INPUT NAME=\""];
|
||||||
[response appendContentString:name];
|
[response appendContentString:name];
|
||||||
|
|
||||||
[response appendContentString:@"\" TYPE=radio VALUE=\""];
|
[response appendContentString:@"\" TYPE=radio VALUE=\""];
|
||||||
valueValue=[self valueInContext:context];
|
|
||||||
|
NSDebugMLLog(@"gswdync",@"_value (class: %@): %@",[_value class],_value);
|
||||||
|
// Value property of the INPUT tag
|
||||||
|
if (_value) // Binded Value
|
||||||
|
valueValue = [_value valueInComponent:component];
|
||||||
|
else // Auto Value
|
||||||
|
valueValue = [NSNumber numberWithInt:i];
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
|
||||||
[response appendContentHTMLAttributeValue:valueValue];
|
[response appendContentHTMLAttributeValue:valueValue];
|
||||||
[response appendContentCharacter:'"'];
|
[response appendContentCharacter:'"'];
|
||||||
//TODOV
|
|
||||||
if(_value)
|
NSDebugMLLog(@"gswdync",@"selectionValue=%@",selectionValue);
|
||||||
isEqual=SBIsValueEqual(valueValue,selectionValue);
|
NSDebugMLLog(@"gswdync",@"selectionValue class=%@",[selectionValue class]);
|
||||||
else
|
NSDebugMLLog(@"gswdync",@"itemValue=%@",itemValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"itemValue class=%@",[itemValue class]);
|
||||||
|
if (selectionValue)
|
||||||
{
|
{
|
||||||
isEqual=SBIsValueEqual([listValue objectAtIndex:i],selectionValue);
|
isEqual=SBIsValueEqual(itemValue,selectionValue);
|
||||||
_autoValue = YES;
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionValueValue=%@",selectionValueValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"selectionValueValue class=%@",[selectionValueValue class]);
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue=%@",valueValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"valueValue class=%@",[valueValue class]);
|
||||||
|
if (isEqual==NO && selectionValueValue)
|
||||||
|
{
|
||||||
|
isEqual=SBIsValueEqual(valueValue,selectionValueValue);
|
||||||
|
NSDebugMLLog(@"gswdync",@"isEqual=%s",(isEqual ? "YES" : "NO"));
|
||||||
|
}
|
||||||
|
|
||||||
if (isEqual)
|
if (isEqual)
|
||||||
[response appendContentString:@"\" CHECKED"];
|
[response appendContentString:@" CHECKED"];
|
||||||
|
|
||||||
|
if (disabledInContext)
|
||||||
|
[response _appendContentAsciiString:@" DISABLED"];
|
||||||
|
|
||||||
[response appendContentCharacter:'>'];
|
[response appendContentCharacter:'>'];
|
||||||
[response appendContentString:prefixValue];
|
[response appendContentString:prefixValue];
|
||||||
[response appendContentHTMLString:displayStringValue];
|
[response appendContentHTMLString:displayStringValue];
|
||||||
[response appendContentString:suffixValue];
|
[response appendContentString:suffixValue];
|
||||||
};
|
};
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStopC("GSWRadioButtonList");
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -42,6 +42,10 @@
|
||||||
GSWAssociation* _identifier;
|
GSWAssociation* _identifier;
|
||||||
GSWAssociation* _count;
|
GSWAssociation* _count;
|
||||||
GSWAssociation* _index;
|
GSWAssociation* _index;
|
||||||
|
//GSWeb Additions {
|
||||||
|
GSWAssociation* _startIndex; /** Don't begin à 0 but at startIndex **/
|
||||||
|
GSWAssociation* _stopIndex; /** Don't end à count-1 or list count -1 but at stopIndex **/
|
||||||
|
//}
|
||||||
GSWHTMLStaticGroup* _childrenGroup;
|
GSWHTMLStaticGroup* _childrenGroup;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,10 +79,12 @@
|
||||||
inContext:(GSWContext*)aContext;
|
inContext:(GSWContext*)aContext;
|
||||||
|
|
||||||
-(void)stopOneIterationWithIndex:(int)index
|
-(void)stopOneIterationWithIndex:(int)index
|
||||||
|
stopIndex:(int)stopIndex
|
||||||
count:(int)count
|
count:(int)count
|
||||||
isLastOne:(BOOL)isLastOne
|
isLastOne:(BOOL)isLastOne
|
||||||
inContext:(GSWContext*)aContext;
|
inContext:(GSWContext*)aContext;
|
||||||
-(void)startOneIterationWithIndex:(unsigned int)index
|
-(void)startOneIterationWithIndex:(unsigned int)index
|
||||||
|
startIndex:(unsigned int)startIndex
|
||||||
list:(NSArray*)aList
|
list:(NSArray*)aList
|
||||||
inContext:(GSWContext*)aContext;
|
inContext:(GSWContext*)aContext;
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -70,6 +70,18 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWRepetition",@"'index' parameter must be settable");
|
ExceptionRaise0(@"GSWRepetition",@"'index' parameter must be settable");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!WOStrictFlag)
|
||||||
|
{
|
||||||
|
_startIndex=[[associations objectForKey:startIndex__Key
|
||||||
|
withDefaultObject:[_startIndex autorelease]] retain];
|
||||||
|
NSDebugMLLog(@"gswdync",@"startIndex=%@",_startIndex);
|
||||||
|
|
||||||
|
_stopIndex=[[associations objectForKey:stopIndex__Key
|
||||||
|
withDefaultObject:[_stopIndex autorelease]] retain];
|
||||||
|
NSDebugMLLog(@"gswdync",@"stopIndex=%@",_stopIndex);
|
||||||
|
};
|
||||||
|
|
||||||
if (elements)
|
if (elements)
|
||||||
{
|
{
|
||||||
_childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
|
_childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements];
|
||||||
|
@ -100,6 +112,8 @@ static char rcsId[] = "$Id$";
|
||||||
DESTROY(_identifier);
|
DESTROY(_identifier);
|
||||||
DESTROY(_count);
|
DESTROY(_count);
|
||||||
DESTROY(_index);
|
DESTROY(_index);
|
||||||
|
DESTROY(_startIndex);
|
||||||
|
DESTROY(_stopIndex);
|
||||||
DESTROY(_childrenGroup);
|
DESTROY(_childrenGroup);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
@ -123,31 +137,22 @@ static char rcsId[] = "$Id$";
|
||||||
//====================================================================
|
//====================================================================
|
||||||
@implementation GSWRepetition (GSWRepetitionA)
|
@implementation GSWRepetition (GSWRepetitionA)
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
-(void)getParameterValuesReturnList:(NSArray**)listValuePtr
|
||||||
-(void)appendToResponse:(GSWResponse*)response
|
count:(int*)countValuePtr
|
||||||
inContext:(GSWContext*)context
|
startIndex:(int*)startIndexValuePtr
|
||||||
|
stopIndex:(int*)stopIndexValuePtr
|
||||||
|
withComponent:(GSWComponent*)component
|
||||||
{
|
{
|
||||||
//OK
|
|
||||||
GSWComponent* component=nil;
|
|
||||||
NSArray* listValue=nil;
|
|
||||||
int i=0;
|
|
||||||
int countValue=0;
|
|
||||||
#ifndef NDEBBUG
|
|
||||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
|
||||||
#endif
|
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
GSWStartElement(context);
|
|
||||||
GSWSaveAppendToResponseElementID(context);
|
|
||||||
component=[context component];
|
|
||||||
NSDebugMLLog(@"gswdync",@"_list=%@",_list);
|
NSDebugMLLog(@"gswdync",@"_list=%@",_list);
|
||||||
if (_list)
|
if (_list)
|
||||||
{
|
{
|
||||||
listValue=[_list valueInComponent:component];
|
*listValuePtr=[_list valueInComponent:component];
|
||||||
NSAssert2(!listValue || [listValue respondsToSelector:@selector(count)],
|
NSAssert2(!(*listValuePtr) || [(*listValuePtr) respondsToSelector:@selector(count)],
|
||||||
@"The list (%@) (of class:%@) doesn't respond to 'count'",
|
@"The list (%@) (of class:%@) doesn't respond to 'count'",
|
||||||
_list,
|
_list,
|
||||||
[listValue class]);
|
[(*listValuePtr) class]);
|
||||||
countValue=[listValue count];
|
*countValuePtr=[(*listValuePtr) count];
|
||||||
};
|
};
|
||||||
NSDebugMLLog(@"gswdync",@"_count=%@",_count);
|
NSDebugMLLog(@"gswdync",@"_count=%@",_count);
|
||||||
if (_count)
|
if (_count)
|
||||||
|
@ -162,19 +167,91 @@ static char rcsId[] = "$Id$";
|
||||||
tmpCount=[tmpCountValue intValue];
|
tmpCount=[tmpCountValue intValue];
|
||||||
NSDebugMLLog(@"gswdync",@"tmpCount=%d",tmpCount);
|
NSDebugMLLog(@"gswdync",@"tmpCount=%d",tmpCount);
|
||||||
if (_list)
|
if (_list)
|
||||||
countValue=min(tmpCount,countValue);
|
*countValuePtr=min(tmpCount,(*countValuePtr));
|
||||||
else
|
else
|
||||||
countValue=tmpCount;
|
*countValuePtr=tmpCount;
|
||||||
};
|
};
|
||||||
|
if (WOStrictFlag)
|
||||||
|
*stopIndexValuePtr=(*countValuePtr)-1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSDebugMLLog(@"gswdync",@"_startIndex=%@",_startIndex);
|
||||||
|
if (_startIndex)
|
||||||
|
{
|
||||||
|
id tmpStartIndexValue=[_startIndex valueInComponent:component];
|
||||||
|
NSAssert3(!tmpStartIndexValue || [tmpStartIndexValue respondsToSelector:@selector(intValue)],
|
||||||
|
@"The 'startIndex' (%@) value %@ (of class:%@) doesn't respond to 'intValue'",
|
||||||
|
_count,
|
||||||
|
tmpStartIndexValue,
|
||||||
|
[tmpStartIndexValue class]);
|
||||||
|
*startIndexValuePtr=[tmpStartIndexValue intValue];
|
||||||
|
*startIndexValuePtr=max(0,(*startIndexValuePtr));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*startIndexValuePtr=0;
|
||||||
|
NSDebugMLLog(@"gswdync",@"*startIndexValuePtr=%d",(*startIndexValuePtr));
|
||||||
|
NSDebugMLLog(@"gswdync",@"_stopIndex=%@",_stopIndex);
|
||||||
|
if (_stopIndex)
|
||||||
|
{
|
||||||
|
id tmpStopIndexValue=[_stopIndex valueInComponent:component];
|
||||||
|
NSAssert3(!tmpStopIndexValue || [tmpStopIndexValue respondsToSelector:@selector(intValue)],
|
||||||
|
@"The 'startIndex' (%@) value %@ (of class:%@) doesn't respond to 'intValue'",
|
||||||
|
_count,
|
||||||
|
tmpStopIndexValue,
|
||||||
|
[tmpStopIndexValue class]);
|
||||||
|
*stopIndexValuePtr=[tmpStopIndexValue intValue];
|
||||||
|
NSDebugMLLog(@"gswdync",@"*stopIndexValuePtr=%d",(*stopIndexValuePtr));
|
||||||
|
if ((*countValuePtr)>((*stopIndexValuePtr)+1))
|
||||||
|
*countValuePtr=(*stopIndexValuePtr)+1;
|
||||||
|
else
|
||||||
|
*stopIndexValuePtr=(*countValuePtr)-1;
|
||||||
|
NSDebugMLLog(@"gswdync",@"*stopIndexValuePtr=%d",(*stopIndexValuePtr));
|
||||||
|
NSDebugMLLog(@"gswdync",@"*countValuePtr=%d",(*countValuePtr));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*stopIndexValuePtr=(*countValuePtr)-1;
|
||||||
|
NSDebugMLLog(@"gswdync",@"*stopIndexValuePtr=%d",(*stopIndexValuePtr));
|
||||||
|
};
|
||||||
|
NSDebugMLLog(@"gswdync",@"PARAMETERS: list: %p startIndex: %d stopIndex: %d count: %d",
|
||||||
|
*listValuePtr,
|
||||||
|
*startIndexValuePtr,
|
||||||
|
*stopIndexValuePtr,
|
||||||
|
*countValuePtr);
|
||||||
|
LOGObjectFnStop();
|
||||||
|
};
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)appendToResponse:(GSWResponse*)response
|
||||||
|
inContext:(GSWContext*)context
|
||||||
|
{
|
||||||
|
//OK
|
||||||
|
GSWComponent* component=nil;
|
||||||
|
NSArray* listValue=nil;
|
||||||
|
int i=0;
|
||||||
|
int countValue=0;
|
||||||
|
int startIndexValue = 0;
|
||||||
|
int stopIndexValue = 0;
|
||||||
|
#ifndef NDEBBUG
|
||||||
|
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||||
|
#endif
|
||||||
|
LOGObjectFnStart();
|
||||||
|
GSWStartElement(context);
|
||||||
|
GSWSaveAppendToResponseElementID(context);
|
||||||
|
component=[context component];
|
||||||
|
[self getParameterValuesReturnList:&listValue
|
||||||
|
count:&countValue
|
||||||
|
startIndex:&startIndexValue
|
||||||
|
stopIndex:&stopIndexValue
|
||||||
|
withComponent:component];
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
|
NSDebugMLLog(@"gswdync",@"countValue=%d",countValue);
|
||||||
[context incrementLoopLevel];
|
[context incrementLoopLevel];
|
||||||
for(i=0;i<countValue;i++)
|
for(i=startIndexValue;i<=stopIndexValue;i++)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
GSWElementIDString* debugElementID=[context elementID];
|
GSWElementIDString* debugElementID=[context elementID];
|
||||||
#endif
|
#endif
|
||||||
[self startOneIterationWithIndex:i
|
[self startOneIterationWithIndex:i
|
||||||
|
startIndex:startIndexValue
|
||||||
list:listValue
|
list:listValue
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
|
@ -182,6 +259,7 @@ static char rcsId[] = "$Id$";
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context deleteLastElementIDComponent];
|
[context deleteLastElementIDComponent];
|
||||||
[self stopOneIterationWithIndex:i
|
[self stopOneIterationWithIndex:i
|
||||||
|
stopIndex:stopIndexValue
|
||||||
count:countValue
|
count:countValue
|
||||||
isLastOne:NO
|
isLastOne:NO
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
@ -197,8 +275,12 @@ static char rcsId[] = "$Id$";
|
||||||
[context decrementLoopLevel];
|
[context decrementLoopLevel];
|
||||||
GSWStopElement(context);
|
GSWStopElement(context);
|
||||||
#ifndef NDEBBUG
|
#ifndef NDEBBUG
|
||||||
NSAssert(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
NSAssert4(elementsNb==[(GSWElementIDString*)[context elementID]elementsNb],
|
||||||
@"GSWRepetion appendToResponse: bad elementID");
|
@"GSWRepetion %p appendToResponse: bad elementID %d!=%d (%@)",
|
||||||
|
self,
|
||||||
|
elementsNb,
|
||||||
|
[(GSWElementIDString*)[context elementID]elementsNb],
|
||||||
|
[context elementID]);
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStop();
|
LOGObjectFnStop();
|
||||||
};
|
};
|
||||||
|
@ -243,6 +325,8 @@ static char rcsId[] = "$Id$";
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
int countValue=0;
|
int countValue=0;
|
||||||
|
int startIndexValue = 0;
|
||||||
|
int stopIndexValue = 0;
|
||||||
#ifndef NDEBBUG
|
#ifndef NDEBBUG
|
||||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||||
#endif
|
#endif
|
||||||
|
@ -250,36 +334,19 @@ static char rcsId[] = "$Id$";
|
||||||
GSWStartElement(context);
|
GSWStartElement(context);
|
||||||
GSWAssertCorrectElementID(context);
|
GSWAssertCorrectElementID(context);
|
||||||
component=[context component];
|
component=[context component];
|
||||||
if (_list)
|
[self getParameterValuesReturnList:&listValue
|
||||||
{
|
count:&countValue
|
||||||
listValue=[_list valueInComponent:component];
|
startIndex:&startIndexValue
|
||||||
NSAssert2(!listValue || [listValue respondsToSelector:@selector(count)],
|
stopIndex:&stopIndexValue
|
||||||
@"The list (%@) (of class:%@) doesn't respond to 'count'",
|
withComponent:component];
|
||||||
_list,
|
|
||||||
[listValue class]);
|
|
||||||
countValue=[listValue count];
|
|
||||||
};
|
|
||||||
if (_count)
|
|
||||||
{
|
|
||||||
id tmpCountValue=[_count valueInComponent:component];
|
|
||||||
int tmpCount=0;
|
|
||||||
NSAssert2(!tmpCountValue || [tmpCountValue respondsToSelector:@selector(intValue)],
|
|
||||||
@"The 'count' (%@) (of class:%@) doesn't respond to 'intValue'",
|
|
||||||
_count,
|
|
||||||
[tmpCountValue class]);
|
|
||||||
tmpCount=[tmpCountValue intValue];
|
|
||||||
if (_list)
|
|
||||||
countValue=min(tmpCount,countValue);
|
|
||||||
else
|
|
||||||
countValue=tmpCount;
|
|
||||||
};
|
|
||||||
[context incrementLoopLevel];
|
[context incrementLoopLevel];
|
||||||
for(i=0;i<countValue;i++)
|
for(i=startIndexValue;i<=stopIndexValue;i++)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
GSWElementIDString* debugElementID=[context elementID];
|
GSWElementIDString* debugElementID=[context elementID];
|
||||||
#endif
|
#endif
|
||||||
[self startOneIterationWithIndex:i
|
[self startOneIterationWithIndex:i
|
||||||
|
startIndex:startIndexValue
|
||||||
list:listValue
|
list:listValue
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
|
@ -287,6 +354,7 @@ static char rcsId[] = "$Id$";
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context deleteLastElementIDComponent];
|
[context deleteLastElementIDComponent];
|
||||||
[self stopOneIterationWithIndex:i
|
[self stopOneIterationWithIndex:i
|
||||||
|
stopIndex:stopIndexValue
|
||||||
count:countValue
|
count:countValue
|
||||||
isLastOne:NO
|
isLastOne:NO
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
@ -318,42 +386,27 @@ static char rcsId[] = "$Id$";
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
int i=0;
|
int i=0;
|
||||||
int countValue=0;
|
int countValue=0;
|
||||||
|
int startIndexValue = 0;
|
||||||
|
int stopIndexValue = 0;
|
||||||
#ifndef NDEBBUG
|
#ifndef NDEBBUG
|
||||||
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
int elementsNb=[(GSWElementIDString*)[context elementID]elementsNb];
|
||||||
#endif
|
#endif
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
GSWStartElement(context);
|
GSWStartElement(context);
|
||||||
component=[context component];
|
component=[context component];
|
||||||
if (_list)
|
[self getParameterValuesReturnList:&listValue
|
||||||
{
|
count:&countValue
|
||||||
listValue=[_list valueInComponent:component];
|
startIndex:&startIndexValue
|
||||||
NSAssert2(!listValue || [listValue respondsToSelector:@selector(count)],
|
stopIndex:&stopIndexValue
|
||||||
@"The list (%@) (of class:%@) doesn't respond to 'count'",
|
withComponent:component];
|
||||||
_list,
|
|
||||||
[listValue class]);
|
|
||||||
countValue=[listValue count];
|
|
||||||
};
|
|
||||||
if (_count)
|
|
||||||
{
|
|
||||||
id tmpCountValue=[_count valueInComponent:component];
|
|
||||||
int tmpCount=0;
|
|
||||||
NSAssert2(!tmpCountValue || [tmpCountValue respondsToSelector:@selector(intValue)],
|
|
||||||
@"The 'count' (%@) (of class:%@) doesn't respond to 'intValue'",
|
|
||||||
_count,
|
|
||||||
[tmpCountValue class]);
|
|
||||||
tmpCount=[tmpCountValue intValue];
|
|
||||||
if (_list)
|
|
||||||
countValue=min(tmpCount,countValue);
|
|
||||||
else
|
|
||||||
countValue=tmpCount;
|
|
||||||
};
|
|
||||||
[context incrementLoopLevel];
|
[context incrementLoopLevel];
|
||||||
for(i=0;!element && i<countValue;i++)
|
for(i=startIndexValue;!element && i<=stopIndexValue;i++)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
GSWElementIDString* debugElementID=[context elementID];
|
GSWElementIDString* debugElementID=[context elementID];
|
||||||
#endif
|
#endif
|
||||||
[self startOneIterationWithIndex:i
|
[self startOneIterationWithIndex:i
|
||||||
|
startIndex:startIndexValue
|
||||||
list:listValue
|
list:listValue
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
|
@ -361,6 +414,7 @@ static char rcsId[] = "$Id$";
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context deleteLastElementIDComponent];
|
[context deleteLastElementIDComponent];
|
||||||
[self stopOneIterationWithIndex:i
|
[self stopOneIterationWithIndex:i
|
||||||
|
stopIndex:stopIndexValue
|
||||||
count:countValue
|
count:countValue
|
||||||
isLastOne:(element!=nil)
|
isLastOne:(element!=nil)
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
@ -403,35 +457,20 @@ static char rcsId[] = "$Id$";
|
||||||
#endif
|
#endif
|
||||||
int countValue=0;
|
int countValue=0;
|
||||||
NSArray* listValue=nil;
|
NSArray* listValue=nil;
|
||||||
|
int startIndexValue = 0;
|
||||||
|
int stopIndexValue = 0;
|
||||||
int i=0;
|
int i=0;
|
||||||
GSWComponent* component=[context component];
|
GSWComponent* component=[context component];
|
||||||
if (_list)
|
[self getParameterValuesReturnList:&listValue
|
||||||
{
|
count:&countValue
|
||||||
listValue=[_list valueInComponent:component];
|
startIndex:&startIndexValue
|
||||||
NSAssert2(!listValue || [listValue respondsToSelector:@selector(count)],
|
stopIndex:&stopIndexValue
|
||||||
@"The list (%@) (of class:%@) doesn't respond to 'count'",
|
withComponent:component];
|
||||||
_list,
|
|
||||||
[listValue class]);
|
|
||||||
countValue=[listValue count];
|
|
||||||
};
|
|
||||||
if (_count)
|
|
||||||
{
|
|
||||||
id tmpCountValue=[_count valueInComponent:component];
|
|
||||||
int tmpCount=0;
|
|
||||||
NSAssert2(!tmpCountValue || [tmpCountValue respondsToSelector:@selector(intValue)],
|
|
||||||
@"The 'count' (%@) (of class:%@) doesn't respond to 'intValue'",
|
|
||||||
_count,
|
|
||||||
[tmpCountValue class]);
|
|
||||||
tmpCount=[tmpCountValue intValue];
|
|
||||||
if (_list)
|
|
||||||
countValue=min(tmpCount,countValue);
|
|
||||||
else
|
|
||||||
countValue=tmpCount;
|
|
||||||
};
|
|
||||||
[context incrementLoopLevel];
|
[context incrementLoopLevel];
|
||||||
for(i=0;!element && i<countValue;i++)
|
for(i=startIndexValue;!element && i<=stopIndexValue;i++)
|
||||||
{
|
{
|
||||||
[self startOneIterationWithIndex:i
|
[self startOneIterationWithIndex:i
|
||||||
|
startIndex:startIndexValue
|
||||||
list:listValue
|
list:listValue
|
||||||
inContext:context];
|
inContext:context];
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
|
@ -440,6 +479,7 @@ static char rcsId[] = "$Id$";
|
||||||
NSDebugMLLog(@"gswdync",@"element=%@",element);
|
NSDebugMLLog(@"gswdync",@"element=%@",element);
|
||||||
[context deleteLastElementIDComponent];
|
[context deleteLastElementIDComponent];
|
||||||
[self stopOneIterationWithIndex:i
|
[self stopOneIterationWithIndex:i
|
||||||
|
stopIndex:stopIndexValue
|
||||||
count:countValue
|
count:countValue
|
||||||
isLastOne:(element!=nil)
|
isLastOne:(element!=nil)
|
||||||
inContext:context];
|
inContext:context];
|
||||||
|
@ -462,13 +502,17 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)stopOneIterationWithIndex:(int)currentIndex
|
-(void)stopOneIterationWithIndex:(int)currentIndex
|
||||||
|
stopIndex:(int)stopIndex
|
||||||
count:(int)count
|
count:(int)count
|
||||||
isLastOne:(BOOL)isLastOne
|
isLastOne:(BOOL)isLastOne
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
LOGObjectFnStart();
|
LOGObjectFnStart();
|
||||||
if (currentIndex==(count-1) || isLastOne)
|
NSDebugMLLog(@"gswdync",@"self=%p currentIndex=%d stopIndex=%d count=%d isLastOne=%s [context elementID]=%@",
|
||||||
|
self,currentIndex,stopIndex,count,(isLastOne ? "YES" : "NO"),
|
||||||
|
[context elementID]);
|
||||||
|
if (currentIndex==(count-1) || currentIndex==stopIndex ||isLastOne)
|
||||||
{
|
{
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
|
@ -493,6 +537,7 @@ static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(void)startOneIterationWithIndex:(unsigned int)currentIndex
|
-(void)startOneIterationWithIndex:(unsigned int)currentIndex
|
||||||
|
startIndex:(unsigned int)startIndex
|
||||||
list:(NSArray*)list
|
list:(NSArray*)list
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
|
@ -502,10 +547,12 @@ static char rcsId[] = "$Id$";
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
component=[context component];
|
component=[context component];
|
||||||
|
NSDebugMLLog(@"gswdync",@"currentIndex=%d startIndex=%d",currentIndex,startIndex);
|
||||||
|
NSDebugMLLog(@"gswdync",@"_index=%@",_index);
|
||||||
NSDebugMLLog(@"gswdync",@"_item=%@",_item);
|
NSDebugMLLog(@"gswdync",@"_item=%@",_item);
|
||||||
if (_list && _item) {
|
if (_list && _item) {
|
||||||
if ([list count]>currentIndex) {
|
if ([list count]>currentIndex) {
|
||||||
NSDebugMLLog(@"gswdync",@"[list objectAtIndex:currentIndex]=%@",[list objectAtIndex:currentIndex]);
|
NSDebugMLLog(@"gswdync",@"[list objectAtIndex:%d]=%@",currentIndex,[list objectAtIndex:currentIndex]);
|
||||||
[_item setValue:[list objectAtIndex:currentIndex]
|
[_item setValue:[list objectAtIndex:currentIndex]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
} else {
|
} else {
|
||||||
|
@ -513,12 +560,10 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"currentIndex=%d",currentIndex);
|
|
||||||
NSDebugMLLog(@"gswdync",@"_index=%@",_index);
|
|
||||||
if (_index)
|
if (_index)
|
||||||
[_index setValue:[NSNumber numberWithShort:currentIndex]
|
[_index setValue:[NSNumber numberWithShort:currentIndex]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
if (currentIndex==0)
|
if (currentIndex==startIndex)
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
else
|
else
|
||||||
[context incrementLastElementIDComponent];
|
[context incrementLastElementIDComponent];
|
||||||
|
@ -533,3 +578,4 @@ static char rcsId[] = "$Id$";
|
||||||
};
|
};
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,11 @@ static char rcsId[] = "$Id$";
|
||||||
GSWSaveAppendToResponseElementID(aContext);
|
GSWSaveAppendToResponseElementID(aContext);
|
||||||
elementNameInContext=[self _elementNameInContext:aContext];
|
elementNameInContext=[self _elementNameInContext:aContext];
|
||||||
[aContext appendElementIDComponent:elementNameInContext];
|
[aContext appendElementIDComponent:elementNameInContext];
|
||||||
|
if ([elementNameInContext length]==0)
|
||||||
|
{
|
||||||
|
ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@",
|
||||||
|
_componentName);
|
||||||
|
};
|
||||||
element=[self _realComponentWithName:elementNameInContext
|
element=[self _realComponentWithName:elementNameInContext
|
||||||
inContext:aContext];
|
inContext:aContext];
|
||||||
[element appendToResponse:response
|
[element appendToResponse:response
|
||||||
|
@ -135,6 +140,11 @@ static char rcsId[] = "$Id$";
|
||||||
GSWAssertCorrectElementID(aContext);
|
GSWAssertCorrectElementID(aContext);
|
||||||
elementNameInContext=[self _elementNameInContext:aContext];
|
elementNameInContext=[self _elementNameInContext:aContext];
|
||||||
[aContext appendElementIDComponent:elementNameInContext];
|
[aContext appendElementIDComponent:elementNameInContext];
|
||||||
|
if ([elementNameInContext length]==0)
|
||||||
|
{
|
||||||
|
ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@",
|
||||||
|
_componentName);
|
||||||
|
};
|
||||||
element=[self _realComponentWithName:elementNameInContext
|
element=[self _realComponentWithName:elementNameInContext
|
||||||
inContext:aContext];
|
inContext:aContext];
|
||||||
resultElement=[element invokeActionForRequest:request
|
resultElement=[element invokeActionForRequest:request
|
||||||
|
@ -155,6 +165,11 @@ static char rcsId[] = "$Id$";
|
||||||
GSWAssertCorrectElementID(aContext);
|
GSWAssertCorrectElementID(aContext);
|
||||||
elementNameInContext=[self _elementNameInContext:aContext];
|
elementNameInContext=[self _elementNameInContext:aContext];
|
||||||
[aContext appendElementIDComponent:elementNameInContext];
|
[aContext appendElementIDComponent:elementNameInContext];
|
||||||
|
if ([elementNameInContext length]==0)
|
||||||
|
{
|
||||||
|
ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@",
|
||||||
|
_componentName);
|
||||||
|
};
|
||||||
element=[self _realComponentWithName:elementNameInContext
|
element=[self _realComponentWithName:elementNameInContext
|
||||||
inContext:aContext];
|
inContext:aContext];
|
||||||
[element takeValuesFromRequest:aRequest
|
[element takeValuesFromRequest:aRequest
|
||||||
|
@ -177,9 +192,10 @@ if the component has already been created, it get it from the cache; otherwise,
|
||||||
component=[aContext component];
|
component=[aContext component];
|
||||||
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent %p (defName=%@): componentName=%@ parent=%@",
|
NSDebugMLLog(@"gswdync",@"GSWSwitchComponent %p (defName=%@): componentName=%@ parent=%@",
|
||||||
self,[self definitionName],_componentName,[component parent]);
|
self,[self definitionName],_componentName,[component parent]);
|
||||||
if (!aName)
|
if ([aName length]==0)
|
||||||
{
|
{
|
||||||
ExceptionRaise0(@"GSWSwitchComponent",@"ComponentName is null !");
|
ExceptionRaise(@"GSWSwitchComponent",@"ComponentName is null ! componentName key: %@",
|
||||||
|
_componentName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,9 +54,11 @@ typedef enum _GSWTemplateParserType
|
||||||
NSString* _stringPath;
|
NSString* _stringPath;
|
||||||
NSString* _definitionsString;
|
NSString* _definitionsString;
|
||||||
NSArray* _languages;
|
NSArray* _languages;
|
||||||
NSMutableSet* _definitionFilePath;
|
NSString* _definitionFilePath;
|
||||||
|
NSMutableSet* _processedDefinitionFilePaths;
|
||||||
GSWElement* _template;
|
GSWElement* _template;
|
||||||
NSDictionary* _definitions;
|
NSDictionary* _definitions;
|
||||||
|
NSMutableArray* _errorMessages; /** Template/definition errors. If non empty, raise an exception **/
|
||||||
int gswebTagN;
|
int gswebTagN;
|
||||||
int tagN;
|
int tagN;
|
||||||
}
|
}
|
||||||
|
@ -93,6 +95,12 @@ typedef enum _GSWTemplateParserType
|
||||||
forLanguages:(NSArray*)someLanguages;
|
forLanguages:(NSArray*)someLanguages;
|
||||||
-(void)dealloc;
|
-(void)dealloc;
|
||||||
-(NSString*)logPrefix;
|
-(NSString*)logPrefix;
|
||||||
|
-(void)addErrorMessage:(NSString*)errorMessage;
|
||||||
|
-(void)addErrorMessageFormat:(NSString*)format
|
||||||
|
arguments:(va_list)arguments;
|
||||||
|
-(void)addErrorMessageFormat:(NSString*)format,...;
|
||||||
|
-(NSMutableArray*)errorMessages;
|
||||||
|
-(NSString*)errorMessagesAsText;
|
||||||
-(GSWElement*)template;
|
-(GSWElement*)template;
|
||||||
-(NSArray*)templateElements;
|
-(NSArray*)templateElements;
|
||||||
-(NSDictionary*)definitions;
|
-(NSDictionary*)definitions;
|
||||||
|
|
|
@ -207,8 +207,10 @@ static char rcsId[] = "$Id$";
|
||||||
DESTROY(_definitionsString);
|
DESTROY(_definitionsString);
|
||||||
DESTROY(_languages);
|
DESTROY(_languages);
|
||||||
DESTROY(_definitionFilePath);
|
DESTROY(_definitionFilePath);
|
||||||
|
DESTROY(_processedDefinitionFilePaths);
|
||||||
DESTROY(_template);
|
DESTROY(_template);
|
||||||
DESTROY(_definitions);
|
DESTROY(_definitions);
|
||||||
|
DESTROY(_errorMessages);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -221,6 +223,47 @@ static char rcsId[] = "$Id$";
|
||||||
_stringPath];
|
_stringPath];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)addErrorMessage:(NSString*)errorMessage
|
||||||
|
{
|
||||||
|
if (!_errorMessages)
|
||||||
|
_errorMessages=(NSMutableArray*)[NSMutableArray new];
|
||||||
|
[_errorMessages addObject:[NSString stringWithFormat:@"%@%@",
|
||||||
|
[self logPrefix],
|
||||||
|
errorMessage]];
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)addErrorMessageFormat:(NSString*)format
|
||||||
|
arguments:(va_list)arguments
|
||||||
|
{
|
||||||
|
NSString* string=[NSString stringWithFormat:format
|
||||||
|
arguments:arguments];
|
||||||
|
[self addErrorMessage:string];
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)addErrorMessageFormat:(NSString*)format,...
|
||||||
|
{
|
||||||
|
va_list ap=NULL;
|
||||||
|
va_start(ap,format);
|
||||||
|
[self addErrorMessageFormat:format
|
||||||
|
arguments:ap];
|
||||||
|
va_end(ap);
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(NSMutableArray*)errorMessages
|
||||||
|
{
|
||||||
|
return _errorMessages;
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(NSString*)errorMessagesAsText
|
||||||
|
{
|
||||||
|
return [[self errorMessages]componentsJoinedByString:@"\n"];
|
||||||
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(GSWElement*)template
|
-(GSWElement*)template
|
||||||
{
|
{
|
||||||
|
@ -320,11 +363,12 @@ static char rcsId[] = "$Id$";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSMutableSet* processedFiles=[NSMutableSet setWithObject:_definitionFilePath];
|
DESTROY(_processedDefinitionFilePaths);
|
||||||
|
ASSIGN(_processedDefinitionFilePaths,[NSMutableSet setWithObject:_definitionFilePath]);
|
||||||
NSDictionary* tmpDefinitions=[self parseDefinitionsString:_definitionsString
|
NSDictionary* tmpDefinitions=[self parseDefinitionsString:_definitionsString
|
||||||
named:_templateName
|
named:_templateName
|
||||||
inFrameworkNamed:_frameworkName
|
inFrameworkNamed:_frameworkName
|
||||||
processedFiles:processedFiles];
|
processedFiles:_processedDefinitionFilePaths];
|
||||||
if (tmpDefinitions)
|
if (tmpDefinitions)
|
||||||
ASSIGN(_definitions,[NSDictionary dictionaryWithDictionary:tmpDefinitions]);
|
ASSIGN(_definitions,[NSDictionary dictionaryWithDictionary:tmpDefinitions]);
|
||||||
};
|
};
|
||||||
|
|
|
@ -826,6 +826,15 @@ static NSString* TabsForLevel(int level)
|
||||||
gswebTagN=0;
|
gswebTagN=0;
|
||||||
tagN=0;
|
tagN=0;
|
||||||
elements=[self createElementsFromNode:node];
|
elements=[self createElementsFromNode:node];
|
||||||
|
// If we've found error raise exception
|
||||||
|
NSDebugMLog(@"_errorMessages=%@",_errorMessages);
|
||||||
|
if ([[self errorMessages]count]>0)
|
||||||
|
{
|
||||||
|
NSDebugMLog(@"definitionFilePath=%@",_definitionFilePath);
|
||||||
|
ExceptionRaise(@"GSWTemplateParser",@"%@\nDefinitionFiles: %@",
|
||||||
|
[self errorMessagesAsText],
|
||||||
|
_processedDefinitionFilePaths);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
@ -958,16 +967,12 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
||||||
{
|
{
|
||||||
// allow null name tags
|
// allow null name tags
|
||||||
elem=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease];
|
elem=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease];
|
||||||
/* ExceptionRaise(@"GSWTemplateParser",
|
|
||||||
@"%@ No element name for gsweb tag (%@) [#%d,#%d]",
|
|
||||||
[self logPrefix],
|
|
||||||
nodeName,
|
|
||||||
currentGSWebTagN,
|
|
||||||
currentTagN);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
NSDictionary* _associations=nil;
|
||||||
|
NSString* className=nil;
|
||||||
|
GSWHTMLStaticGroup* aStaticGroup=nil;
|
||||||
definitionsElement=[_definitions objectForKey:nodeNameAttribute];
|
definitionsElement=[_definitions objectForKey:nodeNameAttribute];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"definitionsElement:[%@]",
|
NSDebugMLLog(@"GSWTemplateParser",@"definitionsElement:[%@]",
|
||||||
definitionsElement);
|
definitionsElement);
|
||||||
|
@ -975,31 +980,30 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
||||||
definitionsElement);
|
definitionsElement);
|
||||||
if (!definitionsElement)
|
if (!definitionsElement)
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
// We don't raise exception know because it's better for developper to collect and report all errors before :-)
|
||||||
@"%@ No element definition for tag named:%@ [#%d,#%d]",
|
[self addErrorMessageFormat:@"No element definition for tag named:%@ [#%d,#%d]",
|
||||||
[self logPrefix],
|
|
||||||
nodeNameAttribute,
|
nodeNameAttribute,
|
||||||
currentGSWebTagN,
|
currentGSWebTagN,
|
||||||
currentTagN);
|
currentTagN];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSDictionary* _associations=[definitionsElement associations];
|
_associations=[definitionsElement associations];
|
||||||
NSString* className=[definitionsElement className];
|
className=[definitionsElement className];
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p GSWeb Tag className:[%@]",currentNode,className);
|
NSDebugMLLog(@"GSWTemplateParser",@"node=%p GSWeb Tag className:[%@]",currentNode,className);
|
||||||
if (!className)
|
if (!className)
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
// We don't raise exception know because it's better for developper to collect and report all errors before :-)
|
||||||
@"%@No class name in page definition for tag named:%@ definitionsElement=%@ [#%d,#%d]",
|
[self addErrorMessageFormat:@"No class name in page definition for tag named:%@ definitionsElement=%@ [#%d,#%d]",
|
||||||
[self logPrefix],
|
|
||||||
nodeNameAttribute,
|
nodeNameAttribute,
|
||||||
definitionsElement,
|
definitionsElement,
|
||||||
currentGSWebTagN,
|
currentGSWebTagN,
|
||||||
currentTagN);
|
currentTagN];
|
||||||
}
|
};
|
||||||
else
|
};
|
||||||
|
// No class name mean we'll raise an exception after so don't care about this part...
|
||||||
|
if (className) //
|
||||||
{
|
{
|
||||||
GSWHTMLStaticGroup* aStaticGroup=nil;
|
|
||||||
NSDebugMLLog(@"GSWTemplateParser",@"node=%p associations:%@",currentNode,_associations);
|
NSDebugMLLog(@"GSWTemplateParser",@"node=%p associations:%@",currentNode,_associations);
|
||||||
{
|
{
|
||||||
NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator];
|
NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator];
|
||||||
|
@ -1042,12 +1046,10 @@ text [Type:XML_TEXT_NODE] [{}] ####
|
||||||
[elem setDefinitionName:[definitionsElement elementName]];
|
[elem setDefinitionName:[definitionsElement elementName]];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ExceptionRaise(@"GSWTemplateParser",
|
// We don't raise exception know because it's better for developper to collect and report all errors before :-)
|
||||||
@"%@ Creation failed for element named:%@ className:%@",
|
[self addErrorMessageFormat:@"Creation failed for element named:%@ className:%@",
|
||||||
[self logPrefix],
|
|
||||||
[definitionsElement elementName],
|
[definitionsElement elementName],
|
||||||
className);
|
className];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -182,21 +182,23 @@ static char rcsId[] = "$Id$";
|
||||||
inContext:(GSWContext*)context
|
inContext:(GSWContext*)context
|
||||||
{
|
{
|
||||||
//OK
|
//OK
|
||||||
|
LOGObjectFnStartC("GSWTextField");
|
||||||
|
//Does nothing special
|
||||||
|
[super appendGSWebObjectsAssociationsToResponse:response
|
||||||
|
inContext:context];
|
||||||
|
LOGObjectFnStopC("GSWTextField");
|
||||||
|
};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
-(void)appendValueToResponse:(GSWResponse*)response
|
||||||
|
inContext:(GSWContext*)context
|
||||||
|
{
|
||||||
id valueValue=nil;
|
id valueValue=nil;
|
||||||
id formattedValue=nil;
|
id formattedValue=nil;
|
||||||
NSFormatter* formatter=nil;
|
NSFormatter* formatter=nil;
|
||||||
GSWComponent* component=nil;
|
GSWComponent* component=nil;
|
||||||
id valueTmp=nil;
|
|
||||||
LOGObjectFnStartC("GSWTextField");
|
LOGObjectFnStartC("GSWTextField");
|
||||||
component=[context component];
|
component=[context component];
|
||||||
//To avoid input value printing (stupid original hack !)
|
|
||||||
valueTmp=_value;
|
|
||||||
_value=nil;
|
|
||||||
[super appendGSWebObjectsAssociationsToResponse:response
|
|
||||||
inContext:context];
|
|
||||||
//To avoid input value printing (stupid original hack !)
|
|
||||||
_value=valueTmp;
|
|
||||||
valueTmp=nil;
|
|
||||||
valueValue=[_value valueInComponent:component];
|
valueValue=[_value valueInComponent:component];
|
||||||
formatter=[self formatterForComponent:component];
|
formatter=[self formatterForComponent:component];
|
||||||
if (!formatter)
|
if (!formatter)
|
||||||
|
|
40
Testing/DynamicElements/BasePage.h
Normal file
40
Testing/DynamicElements/BasePage.h
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** BasePage.h - <title>GSWeb Testing: Class BasePage</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _BasePage_h__
|
||||||
|
#define _BasePage_h__
|
||||||
|
|
||||||
|
@interface BasePage: GSWComponent
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_BasePage_h__
|
43
Testing/DynamicElements/BasePage.m
Normal file
43
Testing/DynamicElements/BasePage.m
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/** BasePage.m - <title>GSWeb Testing: Class BasePage</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation BasePage
|
||||||
|
|
||||||
|
-(GSWComponent*)submitAction
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
};
|
||||||
|
@end
|
||||||
|
|
25
Testing/DynamicElements/Browser1Page.gswc/Browser1Page.gswd
Normal file
25
Testing/DynamicElements/Browser1Page.gswc/Browser1Page.gswd
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ABrowser: GSWBrowser
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.Browser.list;
|
||||||
|
item = anItem;
|
||||||
|
value = anItem.value;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selections = selectedItems;
|
||||||
|
selectionValues = selectedValues;
|
||||||
|
selectedValues = selectedValues;
|
||||||
|
multiple = YES;
|
||||||
|
name = "BROWSERNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItems: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItems;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedValues: GSWString
|
||||||
|
{
|
||||||
|
value = selectedValues;
|
||||||
|
};
|
||||||
|
|
18
Testing/DynamicElements/Browser1Page.gswc/Browser1Page.html
Normal file
18
Testing/DynamicElements/Browser1Page.gswc/Browser1Page.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWBrowser Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWBrowser Test 1 (With value)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected items : <gsweb name="SelectedItems"></gsweb><br/>
|
||||||
|
Selected item values : <gsweb name="SelectedValues"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ABrowser"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
43
Testing/DynamicElements/Browser1Page.h
Normal file
43
Testing/DynamicElements/Browser1Page.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/** Browser1Page.h - <title>GSWeb Testing: Class Browser1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _Browser1Page_h__
|
||||||
|
#define _Browser1Page_h__
|
||||||
|
|
||||||
|
@interface Browser1Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItems;
|
||||||
|
id selectedValues;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_Browser1Page_h__
|
40
Testing/DynamicElements/Browser1Page.m
Normal file
40
Testing/DynamicElements/Browser1Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** Browser1Page.m - <title>GSWeb Testing: Class Browser1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "Browser1Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation Browser1Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
24
Testing/DynamicElements/Browser2Page.gswc/Browser2Page.gswd
Normal file
24
Testing/DynamicElements/Browser2Page.gswc/Browser2Page.gswd
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ABrowser: GSWBrowser
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.Browser.list;
|
||||||
|
item = anItem;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selections = selectedItems;
|
||||||
|
selectionValues = selectedValues;
|
||||||
|
selectedValues = selectedValues;
|
||||||
|
multiple = YES;
|
||||||
|
name = "BROWSERNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItems: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItems;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedValues: GSWString
|
||||||
|
{
|
||||||
|
value = selectedValues;
|
||||||
|
};
|
||||||
|
|
18
Testing/DynamicElements/Browser2Page.gswc/Browser2Page.html
Normal file
18
Testing/DynamicElements/Browser2Page.gswc/Browser2Page.html
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWBrowser Test 2</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWBrowser Test 2 (Without value: AutoValue)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected items : <gsweb name="SelectedItems"></gsweb><br/>
|
||||||
|
Selected item values : <gsweb name="SelectedValues"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ABrowser"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
43
Testing/DynamicElements/Browser2Page.h
Normal file
43
Testing/DynamicElements/Browser2Page.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/** Browser2Page.h - <title>GSWeb Testing: Class Browser2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _Browser2Page_h__
|
||||||
|
#define _Browser2Page_h__
|
||||||
|
|
||||||
|
@interface Browser2Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItems;
|
||||||
|
id selectedValues;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_Browser2Page_h__
|
40
Testing/DynamicElements/Browser2Page.m
Normal file
40
Testing/DynamicElements/Browser2Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** Browser2Page.m - <title>GSWeb Testing: Class Browser2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "Browser2Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation Browser2Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ACheckBoxList: GSWCheckBoxList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.CheckBoxList.list;
|
||||||
|
item = anItem;
|
||||||
|
value = anItem.value;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selections = selectedItems;
|
||||||
|
name = "CHECKNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItems: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItems;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedValues: GSWString
|
||||||
|
{
|
||||||
|
value = selectedValues;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWCheckBoxList Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWCheckBoxList Test 1 (With value)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected items : <gsweb name="SelectedItems"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ACheckBoxList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ARadioButtonList: GSWRadioButtonList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.RadioButtonList.list;
|
||||||
|
item = anItem;
|
||||||
|
value = anItem.value;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWRadioButtonList Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWRadioButtonList Test 1 (With value)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ARadioButtonList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
42
Testing/DynamicElements/CheckBoxList1Page.h
Normal file
42
Testing/DynamicElements/CheckBoxList1Page.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/** CheckBoxList1Page.h - <title>GSWeb Testing: Class CheckBoxList1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _CheckBoxList1Page_h__
|
||||||
|
#define _CheckBoxList1Page_h__
|
||||||
|
|
||||||
|
@interface CheckBoxList1Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItems;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_RadioButtonList1Page_h__
|
40
Testing/DynamicElements/CheckBoxList1Page.m
Normal file
40
Testing/DynamicElements/CheckBoxList1Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** CheckBoxList1Page.m - <title>GSWeb Testing: Class CheckBoxList1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "CheckBoxList1Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation CheckBoxList1Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ACheckBoxList: GSWCheckBoxList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.CheckBoxList.list;
|
||||||
|
item = anItem;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selections = selectedItems;
|
||||||
|
name = "CHECKNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItems: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItems;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWCheckBoxList Test 2</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWCheckBoxList Test 2 (Without value: AutoValue)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected items : <gsweb name="SelectedItems"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ACheckBoxList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ARadioButtonList: GSWRadioButtonList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.RadioButtonList.list;
|
||||||
|
item = anItem;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWRadioButtonList Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWRadioButtonList Test 2 (Without value: AutoValue)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ARadioButtonList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
42
Testing/DynamicElements/CheckBoxList2Page.h
Normal file
42
Testing/DynamicElements/CheckBoxList2Page.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/** CheckBoxList2Page.h - <title>GSWeb Testing: Class CheckBoxList2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _CheckBoxList2Page_h__
|
||||||
|
#define _CheckBoxList2Page_h__
|
||||||
|
|
||||||
|
@interface CheckBoxList2Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItems;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_CheckBoxList2Page_h__
|
40
Testing/DynamicElements/CheckBoxList2Page.m
Normal file
40
Testing/DynamicElements/CheckBoxList2Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** CheckBoxList2Page.m - <title>GSWeb Testing: Class CheckBoxList2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "CheckBoxList2Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation CheckBoxList2Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
3
Testing/DynamicElements/DynamicElements.h
Normal file
3
Testing/DynamicElements/DynamicElements.h
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
//====================================================================
|
||||||
|
@interface DynamicElements : GSWApplication
|
||||||
|
@end
|
12
Testing/DynamicElements/DynamicElements.m
Normal file
12
Testing/DynamicElements/DynamicElements.m
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#import <GSWeb/GSWeb.h>
|
||||||
|
#include "DynamicElements.h"
|
||||||
|
|
||||||
|
@implementation DynamicElements
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface Session: GSWSession
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation Session
|
||||||
|
@end
|
||||||
|
|
10
Testing/DynamicElements/DynamicElements_main.m
Normal file
10
Testing/DynamicElements/DynamicElements_main.m
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#import <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
int main(int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
int ret=0;
|
||||||
|
NSAutoreleasePool *arp = [NSAutoreleasePool new];
|
||||||
|
ret=GSWApplicationMain(@"DynamicElements", argc, argv);
|
||||||
|
[arp release];
|
||||||
|
return ret;
|
||||||
|
}
|
83
Testing/DynamicElements/GNUmakefile
Normal file
83
Testing/DynamicElements/GNUmakefile
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
#
|
||||||
|
# Dynamic Elements Testing makefile for the GNUstepWeb
|
||||||
|
#
|
||||||
|
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# Written by: Manuel Guesdon <mguedon@orange-concept.com>
|
||||||
|
#
|
||||||
|
# This file is part of GNUstepWeb
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Install into the system root by default
|
||||||
|
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
|
||||||
|
|
||||||
|
GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
|
||||||
|
|
||||||
|
include $(GNUSTEP_MAKEFILES)/common.make
|
||||||
|
include config.mak
|
||||||
|
|
||||||
|
|
||||||
|
GSWAPP_NAME=DynamicElements
|
||||||
|
DynamicElements_HAS_GSWCOMPONENTS=YES
|
||||||
|
DynamicElements_PRINCIPAL_CLASS=DynamicElements
|
||||||
|
DynamicElements_GSWAPP_INFO_PLIST=Resources/Info-DynamicElements.plist
|
||||||
|
|
||||||
|
# The bundle resource files and directories
|
||||||
|
DynamicElements_RESOURCE_FILES = \
|
||||||
|
Resources/Info-DynamicElements.plist \
|
||||||
|
Resources/Base.gswd \
|
||||||
|
|
||||||
|
# The Objective-C source files to be compiled
|
||||||
|
DynamicElements_OBJC_FILES = \
|
||||||
|
BasePage.m \
|
||||||
|
DynamicElements.m \
|
||||||
|
DynamicElements_main.m \
|
||||||
|
Main.m \
|
||||||
|
RadioButtonList1Page.m \
|
||||||
|
RadioButtonList2Page.m \
|
||||||
|
CheckBoxList1Page.m \
|
||||||
|
CheckBoxList2Page.m \
|
||||||
|
Browser1Page.m \
|
||||||
|
Browser2Page.m \
|
||||||
|
PopUpButton1Page.m \
|
||||||
|
PopUpButton2Page.m \
|
||||||
|
TextField1Page.m \
|
||||||
|
|
||||||
|
|
||||||
|
DynamicElements_COMPONENTS = \
|
||||||
|
Main.gswc \
|
||||||
|
RadioButtonList1Page.gswc \
|
||||||
|
RadioButtonList2Page.gswc \
|
||||||
|
CheckBoxList1Page.gswc \
|
||||||
|
CheckBoxList2Page.gswc \
|
||||||
|
Browser1Page.gswc \
|
||||||
|
Browser2Page.gswc \
|
||||||
|
PopUpButton1Page.gswc \
|
||||||
|
PopUpButton2Page.gswc \
|
||||||
|
TextField1Page.gswc \
|
||||||
|
|
||||||
|
SRCS = $(GSWAPP_NAME:=.m)
|
||||||
|
|
||||||
|
HDRS =
|
||||||
|
|
||||||
|
DIST_FILES = $(SRCS) $(HDRS) GNUmakefile Makefile.postamble Makefile.preamble
|
||||||
|
|
||||||
|
-include Makefile.preamble
|
||||||
|
|
||||||
|
include $(GNUSTEP_MAKEFILES)/gswapp.make
|
||||||
|
|
||||||
|
-include Makefile.postamble
|
23
Testing/DynamicElements/INSTALL
Normal file
23
Testing/DynamicElements/INSTALL
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
To install this little application:
|
||||||
|
o install GNUstep, GNUstepWeb (including apache module),..
|
||||||
|
o do a make install in this directory
|
||||||
|
o add entry for this application in your apache module configuration file:
|
||||||
|
DynamicElements = {
|
||||||
|
adaptorTemplatesPath = "/home/httpd/GSWAdaptorTemplates";
|
||||||
|
GSWExtensionsFrameworkWebServerResources="/GSW/GSWExtensions/WebServerResources";
|
||||||
|
canDump = YES;
|
||||||
|
instances = {
|
||||||
|
1 = {
|
||||||
|
host=localhost;
|
||||||
|
port=9004;
|
||||||
|
parameters= {
|
||||||
|
transport=socket;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
o cd /usr/GNUstep/System/GSWApps/DynamicElements.gswa
|
||||||
|
o run ./ix86/linux-gnu/gnu-gnu-gnu/DynamicElements
|
||||||
|
o open your browser a goto: http://YourHostName/GSWeb/DynamicElements
|
||||||
|
|
27
Testing/DynamicElements/Main.gswc/Main.gswd
Normal file
27
Testing/DynamicElements/Main.gswc/Main.gswd
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
/*
|
||||||
|
* Main.gswd
|
||||||
|
*
|
||||||
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
|
* its fitness for any particular use.
|
||||||
|
*
|
||||||
|
* This is the declarations file for the main page of the
|
||||||
|
* DynamicElements Testing application.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Repetition: GSWRepetition
|
||||||
|
{
|
||||||
|
item = tmpDynamicElement;
|
||||||
|
list = application.bundleInfo.dynamicElements;
|
||||||
|
};
|
||||||
|
|
||||||
|
Link: GSWHyperlink
|
||||||
|
{
|
||||||
|
pageName = tmpDynamicElement.pageName;
|
||||||
|
string = tmpDynamicElement.label;
|
||||||
|
};
|
||||||
|
|
||||||
|
Comment: GSWString
|
||||||
|
{
|
||||||
|
value = tmpDynamicElement.comment;
|
||||||
|
};
|
13
Testing/DynamicElements/Main.gswc/Main.html
Normal file
13
Testing/DynamicElements/Main.gswc/Main.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GNUstepWeb Dynamic Elements Testing</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GNUstepWeb Dynamic Elements Testing</h2>
|
||||||
|
<ul>
|
||||||
|
<gsweb name="Repetition">
|
||||||
|
<li><gsweb name="Link"></gsweb> <gsweb name="Comment"></gsweb></li>
|
||||||
|
</gsweb>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
20
Testing/DynamicElements/Main.h
Normal file
20
Testing/DynamicElements/Main.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Main.h
|
||||||
|
*
|
||||||
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
|
* its fitness for any particular use.
|
||||||
|
*
|
||||||
|
* This file declares the interface to the object that controls the DynamicElements
|
||||||
|
* page.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#import <GSWeb/GSWeb.h>
|
||||||
|
|
||||||
|
@interface Main: GSWComponent
|
||||||
|
{
|
||||||
|
id tmpDynamicElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
16
Testing/DynamicElements/Main.m
Normal file
16
Testing/DynamicElements/Main.m
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* Main.m
|
||||||
|
*
|
||||||
|
* You may freely copy, distribute and reuse the code in this example.
|
||||||
|
* We disclaims any warranty of any kind, expressed or implied, as to
|
||||||
|
* its fitness for any particular use.
|
||||||
|
*
|
||||||
|
* This is the implementation file for the object that controls the DynamicElements
|
||||||
|
* page.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "Main.h"
|
||||||
|
|
||||||
|
@implementation Main
|
||||||
|
|
||||||
|
@end
|
71
Testing/DynamicElements/Makefile.postamble
Normal file
71
Testing/DynamicElements/Makefile.postamble
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
# Makefile.postamble
|
||||||
|
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
# Date: Nov 2002
|
||||||
|
#
|
||||||
|
# This file is part of the GNUstep Web Library.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Makefile.postamble
|
||||||
|
#
|
||||||
|
# Project specific makefile rules
|
||||||
|
#
|
||||||
|
# Uncomment the targets you want.
|
||||||
|
# The double colons (::) are important, do not make them single colons
|
||||||
|
# otherwise the normal makefile rules will not be performed.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Things to do before compiling
|
||||||
|
# before-all::
|
||||||
|
|
||||||
|
# Things to do after compiling
|
||||||
|
# after-all::
|
||||||
|
|
||||||
|
# Things to do before installing
|
||||||
|
# before-install::
|
||||||
|
|
||||||
|
# Things to do after installing
|
||||||
|
# after-install::
|
||||||
|
|
||||||
|
# Things to do before uninstalling
|
||||||
|
# before-uninstall::
|
||||||
|
|
||||||
|
# Things to do after uninstalling
|
||||||
|
# after-uninstall::
|
||||||
|
|
||||||
|
# Things to do before cleaning
|
||||||
|
# before-clean::
|
||||||
|
|
||||||
|
# Things to do after cleaning
|
||||||
|
# after-clean::
|
||||||
|
|
||||||
|
# Things to do before distcleaning
|
||||||
|
# before-distclean::
|
||||||
|
|
||||||
|
# Things to do after distcleaning
|
||||||
|
# after-distclean::
|
||||||
|
|
||||||
|
# Things to do before checking
|
||||||
|
# before-check::
|
||||||
|
|
||||||
|
# Things to do after checking
|
||||||
|
# after-check::
|
||||||
|
|
||||||
|
regenerate:
|
||||||
|
|
||||||
|
copy-dist: $(DIST_FILES)
|
77
Testing/DynamicElements/Makefile.preamble
Normal file
77
Testing/DynamicElements/Makefile.preamble
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
# Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# Written by: Manuel Guesdon <mguesdon@orange-concept.Com>
|
||||||
|
# Date: Nov 2002
|
||||||
|
#
|
||||||
|
# This file is part of the GNUstep Web Library.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Makefile.preamble
|
||||||
|
#
|
||||||
|
# Project specific makefile variables, and additional
|
||||||
|
#
|
||||||
|
# Do not put any Makefile rules in this file, instead they should
|
||||||
|
# be put into Makefile.postamble.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Flags dealing with compiling and linking
|
||||||
|
#
|
||||||
|
|
||||||
|
# Additional flags to pass to the preprocessor
|
||||||
|
ADDITIONAL_CPPFLAGS =
|
||||||
|
|
||||||
|
# Additional flags to pass to the Objective-C compiler
|
||||||
|
ADDITIONAL_OBJCFLAGS =
|
||||||
|
|
||||||
|
# Additional flags to pass to the C compiler
|
||||||
|
ADDITIONAL_CFLAGS =
|
||||||
|
|
||||||
|
# Additional flags to pass to the Objective-C compiler
|
||||||
|
#new
|
||||||
|
ifeq ($(GDL2), yes)
|
||||||
|
ADDITIONAL_OBJCFLAGS = -DUSE_BUILTIN -DGDL2
|
||||||
|
else
|
||||||
|
ADDITIONAL_OBJCFLAGS = -DUSE_BUILTIN
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Additional include directories the compiler should search
|
||||||
|
ADDITIONAL_INCLUDE_DIRS = -I$(GNUSTEP_SYSTEM_ROOT)/db -I../..
|
||||||
|
|
||||||
|
# Additional LDFLAGS to pass to the linker
|
||||||
|
ifeq ($(debug), yes)
|
||||||
|
ADDITIONAL_LDFLAGS = -lFoundationExt_d -lGSWeb -lGSANTLR_d -lgnustep-db2_d -lgnustep-db2control_d
|
||||||
|
else
|
||||||
|
ADDITIONAL_LDFLAGS = -lFoundationExt -lGSWeb -lGSANTLR -lgnustep-db2 -lgnustep-db2control
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(LIBWRAP), yes)
|
||||||
|
ADDITIONAL_OBJCFLAGS := $(ADDITIONAL_OBJCFLAGS) -DHAVE_LIBWRAP
|
||||||
|
ADDITIONAL_LDFLAGS := $(ADDITIONAL_LDFLAGS) -lwrap
|
||||||
|
endif
|
||||||
|
|
||||||
|
#-lgnustep-xraw
|
||||||
|
|
||||||
|
# Additional library directories the linker should search
|
||||||
|
ADDITIONAL_LIB_DIRS =
|
||||||
|
|
||||||
|
#
|
||||||
|
# Flags dealing with installing and uninstalling
|
||||||
|
#
|
||||||
|
|
||||||
|
# Additional directories to be created during installation
|
||||||
|
ADDITIONAL_INSTALL_DIRS =
|
|
@ -0,0 +1,25 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
APopUpButton: GSWPopUpButton
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.PopUpButton.list;
|
||||||
|
item = anItem;
|
||||||
|
value = anItem.value;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
selectedValue = selectedValue;
|
||||||
|
selectionValue = selectedValue;
|
||||||
|
noSelectionString = "Nothing Selected";
|
||||||
|
name = "POPNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedValue: GSWString
|
||||||
|
{
|
||||||
|
value = selectedValue;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWPopUpButton Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWPopUpButton Test 1 (With value)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
Selected value : <gsweb name="SelectedValue"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="APopUpButton"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
43
Testing/DynamicElements/PopUpButton1Page.h
Normal file
43
Testing/DynamicElements/PopUpButton1Page.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/** PopUpButton1Page.h - <title>GSWeb Testing: Class PopUpButton1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _PopUpButton1Page_h__
|
||||||
|
#define _PopUpButton1Page_h__
|
||||||
|
|
||||||
|
@interface PopUpButton1Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItem;
|
||||||
|
id selectedValue;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_PopUpButton1Page_h__
|
40
Testing/DynamicElements/PopUpButton1Page.m
Normal file
40
Testing/DynamicElements/PopUpButton1Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** PopUpButton1Page.m - <title>GSWeb Testing: Class PopUpButton1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "PopUpButton1Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation PopUpButton1Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
APopUpButton: GSWPopUpButton
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.PopUpButton.list;
|
||||||
|
item = anItem;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
selectedValue = selectedValue;
|
||||||
|
selectionValue = selectedValue;
|
||||||
|
noSelectionString = "Nothing Selected";
|
||||||
|
name = "POPNAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedValue: GSWString
|
||||||
|
{
|
||||||
|
value = selectedValue;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWPopUpButton Test 2</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWPopUpButton Test 2 (Without value: AutoValue)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
Selected value : <gsweb name="SelectedValue"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="APopUpButton"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
43
Testing/DynamicElements/PopUpButton2Page.h
Normal file
43
Testing/DynamicElements/PopUpButton2Page.h
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
/** PopUpButton2Page.h - <title>GSWeb Testing: Class PopUpButton2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _PopUpButton2Page_h__
|
||||||
|
#define _PopUpButton2Page_h__
|
||||||
|
|
||||||
|
@interface PopUpButton2Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItem;
|
||||||
|
id selectedValue;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_PopUpButton2Page_h__
|
40
Testing/DynamicElements/PopUpButton2Page.m
Normal file
40
Testing/DynamicElements/PopUpButton2Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** PopUpButton2Page.m - <title>GSWeb Testing: Class PopUpButton2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "PopUpButton2Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation PopUpButton2Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ARadioButtonList: GSWRadioButtonList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.RadioButtonList.list;
|
||||||
|
item = anItem;
|
||||||
|
value = anItem.value;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
name = "RADIONAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWRadioButtonList Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWRadioButtonList Test 1 (With value)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ARadioButtonList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
42
Testing/DynamicElements/RadioButtonList1Page.h
Normal file
42
Testing/DynamicElements/RadioButtonList1Page.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/** RadioButtonList1Page.h - <title>GSWeb Testing: Class RadioButtonList1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _RadioButtonList1Page_h__
|
||||||
|
#define _RadioButtonList1Page_h__
|
||||||
|
|
||||||
|
@interface RadioButtonList1Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItem;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_RadioButtonList1Page_h__
|
40
Testing/DynamicElements/RadioButtonList1Page.m
Normal file
40
Testing/DynamicElements/RadioButtonList1Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** RadioButtonList1Page.m - <title>GSWeb Testing: Class RadioButtonList1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "RadioButtonList1Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation RadioButtonList1Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ARadioButtonList: GSWRadioButtonList
|
||||||
|
{
|
||||||
|
list = application.bundleInfo.RadioButtonList.list;
|
||||||
|
item = anItem;
|
||||||
|
displayString = anItem.label;
|
||||||
|
selection = selectedItem;
|
||||||
|
name = "RADIONAME";
|
||||||
|
};
|
||||||
|
|
||||||
|
SelectedItem: GSWString
|
||||||
|
{
|
||||||
|
value = selectedItem;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWRadioButtonList Test 2</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWRadioButtonList Test 2 (Without value: AutoValue)</h2>
|
||||||
|
<br/>
|
||||||
|
Selected item : <gsweb name="SelectedItem"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ARadioButtonList"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
42
Testing/DynamicElements/RadioButtonList2Page.h
Normal file
42
Testing/DynamicElements/RadioButtonList2Page.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/** RadioButtonList2Page.h - <title>GSWeb Testing: Class RadioButtonList2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _RadioButtonList2Page_h__
|
||||||
|
#define _RadioButtonList2Page_h__
|
||||||
|
|
||||||
|
@interface RadioButtonList2Page: BasePage
|
||||||
|
{
|
||||||
|
id anItem;
|
||||||
|
id selectedItem;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_RadioButtonList2Page_h__
|
40
Testing/DynamicElements/RadioButtonList2Page.m
Normal file
40
Testing/DynamicElements/RadioButtonList2Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** RadioButtonList2Page.m - <title>GSWeb Testing: Class RadioButtonList2Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "RadioButtonList2Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation RadioButtonList2Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
17
Testing/DynamicElements/Resources/Base.gswd
Normal file
17
Testing/DynamicElements/Resources/Base.gswd
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
MainPageLink: GSWHyperlink
|
||||||
|
{
|
||||||
|
pageName = "Main";
|
||||||
|
string = "Main Page";
|
||||||
|
};
|
||||||
|
|
||||||
|
Form: GSWForm
|
||||||
|
{
|
||||||
|
enctype = "multipart/form-data";
|
||||||
|
};
|
||||||
|
|
||||||
|
SubmitButton: GSWSubmitButton
|
||||||
|
{
|
||||||
|
action = submitAction;
|
||||||
|
value = "Submit";
|
||||||
|
};
|
||||||
|
|
158
Testing/DynamicElements/Resources/Info-DynamicElements.plist
Normal file
158
Testing/DynamicElements/Resources/Info-DynamicElements.plist
Normal file
|
@ -0,0 +1,158 @@
|
||||||
|
defaults = {
|
||||||
|
GSWAdaptor = GSWDefaultAdaptor;
|
||||||
|
GSWDebugSetConfigFilePath = "/etc/gsweb/DynamicEelements.logstate";
|
||||||
|
GSWHost = "localhost";
|
||||||
|
GSWPort = 9004;
|
||||||
|
GSWApplicationBaseURL = "/GSW";
|
||||||
|
GSWFrameworksBaseURL = "/GSW/frameworks";
|
||||||
|
GSWLoadFrameworks = (
|
||||||
|
"GSWExtensionsGSW",
|
||||||
|
"GSWExtensions"
|
||||||
|
);
|
||||||
|
GSWMonitorAppConfFilePath = "/etc/httpd/conf/GSWebMonitor.conf";
|
||||||
|
GSWSessionTimeOut = 1200;
|
||||||
|
};
|
||||||
|
|
||||||
|
dynamicElements = (
|
||||||
|
{
|
||||||
|
pageName = "RadioButtonList1Page";
|
||||||
|
label = "GSWRadioButtonList 1";
|
||||||
|
comment = "GSWRadioButtonList Test 1";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "RadioButtonList2Page";
|
||||||
|
label = "GSWRadioButtonList 2";
|
||||||
|
comment = "GSWRadioButtonList Test 2";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "CheckBoxList1Page";
|
||||||
|
label = "GSWCheckBoxList 1";
|
||||||
|
comment = "GSWCheckBoxList Test 1";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "CheckBoxList2Page";
|
||||||
|
label = "GSWCheckBoxList 2";
|
||||||
|
comment = "GSWCheckBoxList Test 2";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "PopUpButton1Page";
|
||||||
|
label = "GSWPopUpButton 1";
|
||||||
|
comment = "GSWPopUpButton Test 1";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "PopUpButton2Page";
|
||||||
|
label = "GSWPopUpButton 2";
|
||||||
|
comment = "GSWPopUpButton Test 2";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "Browser1Page";
|
||||||
|
label = "GSWBrowser 1";
|
||||||
|
comment = "GSWBrowser Test 1";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "Browser2Page";
|
||||||
|
label = "GSWBrowser 2";
|
||||||
|
comment = "GSWBrowser Test 2";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pageName = "TextField1Page";
|
||||||
|
label = "TextField 1";
|
||||||
|
comment = "GSWTextField Test 1";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
RadioButtonList = {
|
||||||
|
list = (
|
||||||
|
{
|
||||||
|
label = "An Apple";
|
||||||
|
value = "apple";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A Fish";
|
||||||
|
value = "fisch";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A table";
|
||||||
|
value = "table";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "An icon";
|
||||||
|
value = "icon";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A turtle";
|
||||||
|
value = "turtle";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
CheckBoxList = {
|
||||||
|
list = (
|
||||||
|
{
|
||||||
|
label = "An Apple";
|
||||||
|
value = "apple";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A Fish";
|
||||||
|
value = "fisch";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A table";
|
||||||
|
value = "table";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "An icon";
|
||||||
|
value = "icon";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A turtle";
|
||||||
|
value = "turtle";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
Browser = {
|
||||||
|
list = (
|
||||||
|
{
|
||||||
|
label = "An Apple";
|
||||||
|
value = "apple";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A Fish";
|
||||||
|
value = "fisch";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A table";
|
||||||
|
value = "table";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "An icon";
|
||||||
|
value = "icon";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A turtle";
|
||||||
|
value = "turtle";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
PopUpButton = {
|
||||||
|
list = (
|
||||||
|
{
|
||||||
|
label = "An Apple";
|
||||||
|
value = "apple";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A Fish";
|
||||||
|
value = "fisch";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A table";
|
||||||
|
value = "table";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "An icon";
|
||||||
|
value = "icon";
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label = "A turtle";
|
||||||
|
value = "turtle";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include "Base"
|
||||||
|
|
||||||
|
ATextField: GSWTextField
|
||||||
|
{
|
||||||
|
value = aString;
|
||||||
|
};
|
||||||
|
|
||||||
|
EnteredString: GSWString
|
||||||
|
{
|
||||||
|
value = aString;
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GSWTextField Test 1</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>GSWTextField Test 1</h2>
|
||||||
|
<br/>
|
||||||
|
Entered String : <gsweb name="EnteredString"></gsweb><br/>
|
||||||
|
<br/>
|
||||||
|
<gsweb name="Form">
|
||||||
|
<gsweb name="ATextField"></gsweb>
|
||||||
|
<gsweb name="SubmitButton"></gsweb>
|
||||||
|
</gsweb>
|
||||||
|
<hr/>
|
||||||
|
<gsweb name="MainPageLink"></gsweb>
|
||||||
|
</body>
|
||||||
|
</html>
|
41
Testing/DynamicElements/TextField1Page.h
Normal file
41
Testing/DynamicElements/TextField1Page.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/** TextField1Page.h - <title>GSWeb Testing: Class TextField1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
// $Id$
|
||||||
|
|
||||||
|
#ifndef _TextField1Page_h__
|
||||||
|
#define _TextField1Page_h__
|
||||||
|
|
||||||
|
@interface TextField1Page: BasePage
|
||||||
|
{
|
||||||
|
id aString;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif //_TextField1Page_h__
|
40
Testing/DynamicElements/TextField1Page.m
Normal file
40
Testing/DynamicElements/TextField1Page.m
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/** TextField1Page.m - <title>GSWeb Testing: Class TextField1Page</title>
|
||||||
|
|
||||||
|
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
|
Date: Nov 2002
|
||||||
|
|
||||||
|
$Revision$
|
||||||
|
$Date$
|
||||||
|
|
||||||
|
This file is part of the GNUstep Web Library.
|
||||||
|
|
||||||
|
<license>
|
||||||
|
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.
|
||||||
|
</license>
|
||||||
|
**/
|
||||||
|
|
||||||
|
static char rcsId[] = "$Id$";
|
||||||
|
|
||||||
|
#include <GSWeb/GSWeb.h>
|
||||||
|
#include "BasePage.h"
|
||||||
|
#include "TextField1Page.h"
|
||||||
|
|
||||||
|
|
||||||
|
@implementation TextField1Page
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
Loading…
Reference in a new issue