diff --git a/ChangeLog b/ChangeLog index 1781926..803ad93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,65 @@ +2002-11-18 Manuel Guesdon + 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
by
+ * 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 * a start to make statistics work Modified Files: diff --git a/Examples/hello/HelloPage.gswc/HelloPage.gswd b/Examples/hello/HelloPage.gswc/HelloPage.gswd index 4e0de01..490b69d 100644 --- a/Examples/hello/HelloPage.gswc/HelloPage.gswd +++ b/Examples/hello/HelloPage.gswc/HelloPage.gswd @@ -1,16 +1,12 @@ /* - * Hello.wod + * HelloPage.gswd * * 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. * - * 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 - * HelloWorldObjC application. + * HelloWorld ObjC application. */ BODY_NAME_STRING:GSWString {value = nameString} diff --git a/Examples/hello/HelloPage.h b/Examples/hello/HelloPage.h index 6fcd36d..d96bb75 100644 --- a/Examples/hello/HelloPage.h +++ b/Examples/hello/HelloPage.h @@ -2,7 +2,7 @@ * HelloPage.h * * 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. * * This file declares the interface to the object that controls the Hello diff --git a/Examples/hello/HelloPage.m b/Examples/hello/HelloPage.m index ce83823..4f50000 100644 --- a/Examples/hello/HelloPage.m +++ b/Examples/hello/HelloPage.m @@ -2,7 +2,7 @@ * HelloPage.m * * 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. * * This is the implementation file for the object that controls the Hello diff --git a/Examples/hello/Main.gswc/Main.gswd b/Examples/hello/Main.gswc/Main.gswd index 45843e3..9d3c35a 100644 --- a/Examples/hello/Main.gswc/Main.gswd +++ b/Examples/hello/Main.gswc/Main.gswd @@ -1,17 +1,13 @@ /* - * Main.wod + * Main.gswd * * 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. * - * Written by WebObjects Development Team - * - * This is the declarations file for the first page (Main) of the - * 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. + * This is the declarations file for the Main page of the + * HelloWorld ObjC application. Each declaration corresponds to a GNUstepWeb + * element in Main.html. * */ diff --git a/Examples/hello/Main.h b/Examples/hello/Main.h index c5a1cee..d9f626e 100644 --- a/Examples/hello/Main.h +++ b/Examples/hello/Main.h @@ -2,7 +2,7 @@ * Main.h * * 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. * * This file declares the interface to the object that controls the Main diff --git a/Examples/hello/Main.m b/Examples/hello/Main.m index 6a31cd8..34c098f 100644 --- a/Examples/hello/Main.m +++ b/Examples/hello/Main.m @@ -2,11 +2,9 @@ * Main.m * * 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. * - * Written by WebObjects Development Team - * * This is the implementation file for the object that controls the Main * page. */ diff --git a/GSWExtensions.framework/GNUmakefile b/GSWExtensions.framework/GNUmakefile index abae6e6..267dd48 100644 --- a/GSWExtensions.framework/GNUmakefile +++ b/GSWExtensions.framework/GNUmakefile @@ -115,7 +115,8 @@ GSWExceptionPage.m \ GSWDictionaryRepetition.m \ GSWRedirect.m \ GSWIFrame.m \ -GSWMetaRefresh.m +GSWMetaRefresh.m \ +GSWLongResponsePage.m \ #GSWCompletionBar.m @@ -130,7 +131,8 @@ GSWPageRestorationErrorPage.h \ GSWRedirect.h \ GSWSessionCreationErrorPage.h \ GSWSessionRestorationErrorPage.h \ -GSWStatsPage.h +GSWStatsPage.h \ +GSWLongResponsePage.h #GSWCompletionBar.h #GSWThresholdColoredNumber.h diff --git a/GSWExtensions.framework/GSWLongResponsePage.h b/GSWExtensions.framework/GSWLongResponsePage.h new file mode 100644 index 0000000..463628e --- /dev/null +++ b/GSWExtensions.framework/GSWLongResponsePage.h @@ -0,0 +1,108 @@ +/** GSWLongResponsePage.m - GSWeb: Class GSWLongResponsePage + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Sep 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _GSWLongResponsePage_h__ + #define _GSWLongResponsePage_h__ + + +//============================================================================== +@interface GSWLongResponsePage: GSWComponent +{ +@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__ diff --git a/GSWExtensions.framework/GSWLongResponsePage.m b/GSWExtensions.framework/GSWLongResponsePage.m new file mode 100644 index 0000000..b0c41f8 --- /dev/null +++ b/GSWExtensions.framework/GSWLongResponsePage.m @@ -0,0 +1,405 @@ +/** GSWLongResponsePage.m - GSWeb: Class GSWLongResponsePage + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Sep 2002 + + $Revision$ + $Date$ + + + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include + +//=================================================================================== +@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 diff --git a/GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html b/GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html index 6dc1632..f29a44c 100644 --- a/GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html +++ b/GSWExtensionsGSW.framework/GSWValidationFailureComponent.gswc/GSWValidationFailureComponent.html @@ -1,7 +1,7 @@ - - - -
-
+ + + +
+
-
+
diff --git a/GSWeb.framework/GSWApplication.m b/GSWeb.framework/GSWApplication.m index ea6f0aa..d94e033 100644 --- a/GSWeb.framework/GSWApplication.m +++ b/GSWeb.framework/GSWApplication.m @@ -2021,6 +2021,7 @@ selfLockn, { //TODO erreur NSDebugMLLog0(@"application",@"No Session Class"); + NSAssert(NO,@"Can't find session class"); } else { @@ -2123,11 +2124,17 @@ selfLockn, [self lock]; NS_DURING { + // If the pageName is empty, try to get one from -defaultPageName if ([aName length]<=0) aName=[self defaultPageName];//NDFN + // If the pageName is still empty, use a default one ("Main") if ([aName length]<=0) aName=GSWMainPageName; + + // Retrieve context languages languages=[aContext languages]; + + // Find component definition for pageName and languages componentDefinition=[self lockedComponentDefinitionWithName:aName languages:languages]; NSDebugMLLog(@"info",@"componentDefinition %p=%@ (%@)", @@ -2154,10 +2161,14 @@ selfLockn, } else { + // As we've found a component defintion, we create an instance (an object of class GSWComponent) NSAssert(aContext,@"No Context"); component=[componentDefinition componentInstanceInContext:aContext]; NSAssert(aContext,@"No Context"); + // Next we awake it [component awakeInContext:aContext]; + + // And flag it as a page. [component _setIsPage:YES]; }; } diff --git a/GSWeb.framework/GSWAssociation.m b/GSWeb.framework/GSWAssociation.m index 0fcdc1e..17411be 100644 --- a/GSWeb.framework/GSWAssociation.m +++ b/GSWeb.framework/GSWAssociation.m @@ -772,6 +772,7 @@ static NSMutableArray* associationsLogsHandlerClasses=nil; }; if (retValue) { + NSDebugMLLog(@"associations",@"retValue ptr=%p",retValue); NSDebugMLLog(@"associations",@"retValue=%@",retValue); } else diff --git a/GSWeb.framework/GSWBrowser.h b/GSWeb.framework/GSWBrowser.h index f089661..306c134 100644 --- a/GSWeb.framework/GSWBrowser.h +++ b/GSWeb.framework/GSWBrowser.h @@ -37,6 +37,9 @@ { GSWAssociation* _list; GSWAssociation* _item; +//GSWeb Additions { + GSWAssociation* _index; +// } GSWAssociation* _displayString; GSWAssociation* _selections; //GSWeb Additions { diff --git a/GSWeb.framework/GSWBrowser.m b/GSWeb.framework/GSWBrowser.m index 7ca4277..670cb20 100644 --- a/GSWeb.framework/GSWBrowser.m +++ b/GSWeb.framework/GSWBrowser.m @@ -31,6 +31,35 @@ static char rcsId[] = "$Id$"; #include +/** +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 @@ -47,6 +76,10 @@ static char rcsId[] = "$Id$"; tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations]; [tmpAssociations removeObjectForKey:list__Key]; [tmpAssociations removeObjectForKey:item__Key]; + if (!WOStrictFlag) + { + [tmpAssociations removeObjectForKey:index__Key]; + }; [tmpAssociations removeObjectForKey:displayString__Key]; [tmpAssociations removeObjectForKey:selections__Key]; if (!WOStrictFlag) @@ -62,24 +95,41 @@ static char rcsId[] = "$Id$"; { _list=[[associations objectForKey:list__Key withDefaultObject:[_list autorelease]] retain]; + _item=[[associations objectForKey:item__Key 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 withDefaultObject:[_displayString autorelease]] retain]; _selections=[[associations objectForKey:selections__Key withDefaultObject:[_selections autorelease]] retain]; if (_selections && ![_selections isValueSettable]) { - //TODO + ExceptionRaise0(@"GSWBrowser",@"'selections' parameter must be settable"); }; if (!WOStrictFlag) { - _selectionValues=[[associations objectForKey:selectionValue__Key + _selectionValues=[[associations objectForKey:selectionValues__Key withDefaultObject:[_selectionValues autorelease]] retain]; if (_selectionValues && ![_selectionValues isValueSettable]) { - //TODO + ExceptionRaise0(@"GSWBrowser",@"'selectionValues' parameter must be settable"); }; }; @@ -101,6 +151,7 @@ static char rcsId[] = "$Id$"; { DESTROY(_list); DESTROY(_item); + DESTROY(_index); DESTROY(_displayString); DESTROY(_selections); DESTROY(_selectionValues); @@ -131,8 +182,7 @@ static char rcsId[] = "$Id$"; @implementation GSWBrowser (GSWBrowserA) /* - - On WO it looks like that: + On WO it looks like that when value is not binded: ']; - [response appendContentString:prefixValue]; - [response appendContentHTMLString:displayStringValue]; - [response appendContentString:suffixValue]; - }; + 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) + [response appendContentString:@" CHECKED"]; + + if (disabledInContext) + [response appendContentString:@" DISABLED"]; + + [response appendContentCharacter:'>']; + [response appendContentString:prefixValue]; + [response appendContentHTMLString:displayStringValue]; + [response appendContentString:suffixValue]; + }; + }; }; LOGObjectFnStopC("GSWCheckBoxList"); }; diff --git a/GSWeb.framework/GSWComponent.h b/GSWeb.framework/GSWComponent.h index 0f307ab..3ce063e 100644 --- a/GSWeb.framework/GSWComponent.h +++ b/GSWeb.framework/GSWComponent.h @@ -56,7 +56,9 @@ // } BOOL _isPage; BOOL _isCachingEnabled; - BOOL _isSynchronized; + BOOL _isParentToComponentSynchronized; + BOOL _isComponentToParentSynchronized; + }; -(id)init; @@ -160,6 +162,8 @@ associationsKeys:(NSArray*)associationsKeys forBinding:(NSString*)parentBindingName; -(id)valueForBinding:(NSString*)parentBindingName; -(BOOL)synchronizesVariablesWithBindings; +-(BOOL)synchronizesParentToComponentVariablesWithBindings; +-(BOOL)synchronizesComponentToParentVariablesWithBindings; -(NSDictionary*)bindingAssociations; @end diff --git a/GSWeb.framework/GSWComponent.m b/GSWeb.framework/GSWComponent.m index 687ca30..c180ac0 100644 --- a/GSWeb.framework/GSWComponent.m +++ b/GSWeb.framework/GSWComponent.m @@ -47,6 +47,7 @@ static char rcsId[] = "$Id$"; { NSMutableDictionary* currentThreadDictionary=GSCurrentThreadDictionary(); GSWContext* aContext=[currentThreadDictionary objectForKey:GSWThreadKey_Context]; + // This was set by GSWComponentDefintion -componentInstanceInContext: GSWComponentDefinition* aComponentDefinition=[currentThreadDictionary objectForKey:GSWThreadKey_ComponentDefinition]; NSAssert(aContext,@"No Context in GSWComponent Init"); NSAssert(aComponentDefinition,@"No ComponentDefinition in GSWComponent Init"); @@ -60,8 +61,10 @@ static char rcsId[] = "$Id$"; NSDebugMLLog(@"GSWComponent",@"_templateName=%@",_templateName); [self setCachingEnabled:[GSWApp isCachingEnabled]]; [_componentDefinition _finishInitializingComponent:self]; - _isSynchronized=[self synchronizesVariablesWithBindings]; - NSDebugMLLog(@"GSWComponent",@"_isSynchronized=%s",(_isSynchronized ? "YES" : "NO")); + _isParentToComponentSynchronized=[self synchronizesParentToComponentVariablesWithBindings]; + _isComponentToParentSynchronized=[self synchronizesComponentToParentVariablesWithBindings]; + NSDebugMLLog(@"GSWComponent",@"_isParentToComponentSynchronized=%s",(_isParentToComponentSynchronized ? "YES" : "NO")); + NSDebugMLLog(@"GSWComponent",@"_isComponentToParentSynchronized=%s",(_isComponentToParentSynchronized ? "YES" : "NO")); }; LOGObjectFnStop(); return self; @@ -123,7 +126,8 @@ static char rcsId[] = "$Id$"; ASSIGNCOPY(clone->_session,_session); clone->_isPage=_isPage; clone->_isCachingEnabled=_isCachingEnabled; - clone->_isSynchronized=_isSynchronized; + clone->_isParentToComponentSynchronized=_isParentToComponentSynchronized; + clone->_isComponentToParentSynchronized=_isComponentToParentSynchronized; return clone; }; @@ -148,7 +152,9 @@ static char rcsId[] = "$Id$"; [aCoder encodeValueOfObjCType:@encode(BOOL) at:&_isCachingEnabled]; [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) at:&_isCachingEnabled]; [aCoder decodeValueOfObjCType:@encode(BOOL) - at:&_isSynchronized]; + at:&_isParentToComponentSynchronized]; + [aCoder decodeValueOfObjCType:@encode(BOOL) + at:&_isComponentToParentSynchronized]; }; return self; } @@ -365,9 +373,9 @@ associationsKeys:(NSArray*)associationsKeys { //OK LOGObjectFnStart(); - NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s", - [self definitionName],(_isSynchronized ? "YES" : "NO")); - if (_isSynchronized) + NSDebugMLLog(@"GSWComponent",@"Name=%@ - isComponentToParentSynchronized=%s", + [self definitionName],(_isComponentToParentSynchronized ? "YES" : "NO")); + if (_isComponentToParentSynchronized) { int i=0; id aKey=nil; @@ -404,9 +412,9 @@ associationsKeys:(NSArray*)associationsKeys { //OK LOGObjectFnStart(); - NSDebugMLLog(@"GSWComponent",@"Name=%@ - isSynchronized=%s", - [self definitionName],(_isSynchronized ? "YES" : "NO")); - if (_isSynchronized) + NSDebugMLLog(@"GSWComponent",@"Name=%@ - isParentToComponentSynchronized=%s", + [self definitionName],(_isParentToComponentSynchronized ? "YES" : "NO")); + if (_isParentToComponentSynchronized) { //Synchro Component->SubComponent int i=0; @@ -906,6 +914,62 @@ associationsKeys:(NSArray*)associationsKeys 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 { @@ -1535,11 +1599,13 @@ associationsKeys:(NSArray*)associationsKeys NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]); [session appendCookieToResponse:response]; //==>11 + NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]); [session _saveCurrentPage]; [aContext _incrementContextID]; [aContext deleteAllElementIDComponents]; [aContext _setPageChanged:pageChanged]; [aContext _setPageReplaced:NO]; + NSDebugMLLog(@"GSWComponent",@"sessionID=%@",[session sessionID]); //<========== LOGObjectFnStop(); @@ -1895,3 +1961,4 @@ associationsKeys:(NSArray*)associationsKeys }; }; @end + diff --git a/GSWeb.framework/GSWComponentDefinition.m b/GSWeb.framework/GSWComponentDefinition.m index 5c26c45..fcb68c7 100644 --- a/GSWeb.framework/GSWComponentDefinition.m +++ b/GSWeb.framework/GSWComponentDefinition.m @@ -350,14 +350,19 @@ languages:(NSArray*)languages LOGObjectFnStart(); NSAssert(aContext,@"No Context"); NSDebugMLLog(@"gswcomponents",@"aContext=%@",aContext); + + // Get component class componentClass=[self componentClass]; NSAssert(componentClass,@"No 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 setObject:self forKey:GSWThreadKey_ComponentDefinition]; NS_DURING { + // Now, create the component by allocation a new instance of the class. component=[[componentClass new] autorelease]; } NS_HANDLER @@ -368,6 +373,8 @@ languages:(NSArray*)languages [localException raise]; }; NS_ENDHANDLER; + + // Remove the component from the thread dictionary [threadDictionary removeObjectForKey:GSWThreadKey_ComponentDefinition]; // [_component context];//so what ? LOGObjectFnStop(); @@ -382,6 +389,7 @@ languages:(NSArray*)languages }; //-------------------------------------------------------------------- +/** Find the class of the component **/ -(Class)_componentClass { //OK To Verify @@ -392,13 +400,14 @@ languages:(NSArray*)languages if (!componentClass) componentClass=NSClassFromString(_name);//??? NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass); - NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]); - if (!componentClass) + NSDebugMLLog(@"gswcomponents",@"componentClass superclass=%@",[componentClass superclass]); + if (!componentClass) // There's no class with that name { BOOL createClassesOk=NO; NSString* superClassName=nil; if (!WOStrictFlag) { + // Search component archive for a superclass (superClassName keyword) NSDictionary* archive=[_bundle archiveNamed:_name]; NSDebugMLLog(@"gswcomponents",@"archive=%@",archive); superClassName=[archive objectForKey:@"superClassName"]; @@ -413,15 +422,20 @@ languages:(NSArray*)languages }; }; }; + // If we haven't found a superclass, use GSWComponent as the superclass if (!superClassName) superClassName=@"GSWComponent"; NSDebugMLLog(@"gswcomponents",@"superClassName=%@",superClassName); + + // Create class createClassesOk=[GSWApplication createUnknownComponentClasses:[NSArray arrayWithObject:_name] superClassName:superClassName]; + + // Use it componentClass=NSClassFromString(_name); NSDebugMLLog(@"gswcomponents",@"componentClass=%p",(void*)componentClass); }; -//call GSWApp isCaching + //call GSWApp isCaching NSDebugMLLog(@"gswcomponents",@"componentClass=%@",componentClass); LOGObjectFnStop(); return componentClass; diff --git a/GSWeb.framework/GSWComponentRequestHandler.m b/GSWeb.framework/GSWComponentRequestHandler.m index b0cadf3..ef7e7a4 100644 --- a/GSWeb.framework/GSWComponentRequestHandler.m +++ b/GSWeb.framework/GSWComponentRequestHandler.m @@ -35,6 +35,9 @@ static char rcsId[] = "$Id$"; @implementation GSWComponentRequestHandler //-------------------------------------------------------------------- +/** Handle request aRequest and return the response + This lock application +**/ -(GSWResponse*)handleRequest:(GSWRequest*)aRequest { //OK @@ -45,7 +48,7 @@ static char rcsId[] = "$Id$"; response=[self lockedHandleRequest:aRequest]; if (!response) { - response=[GSWResponse responseWithMessage:@"Component Handle request failed" + response=[GSWResponse responseWithMessage:@"Component Handle request failed. No Response" inContext:nil forRequest:aRequest]; [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 { //OK @@ -69,7 +75,7 @@ static char rcsId[] = "$Id$"; BOOL exceptionRaised=NO; LOGObjectFnStart(); NS_DURING - { + { requestHandlerValues=[GSWComponentRequestHandler _requestHandlerValuesForRequest:aRequest]; } NS_HANDLER @@ -190,6 +196,7 @@ static char rcsId[] = "$Id$"; { // check for refuseNewSessions session=[application _initializeSessionInContext:aContext]; + NSDebugMLLog(@"requests",@"session=%@",session); } } NS_HANDLER diff --git a/GSWeb.framework/GSWConstants.h b/GSWeb.framework/GSWConstants.h index aa526a1..1d677ec 100644 --- a/GSWeb.framework/GSWConstants.h +++ b/GSWeb.framework/GSWConstants.h @@ -314,6 +314,8 @@ extern id imageMapString__Key; extern id imageMapRegions__Key; extern id handleValidationException__Key; extern id selectedValues__Key; +extern id startIndex__Key; +extern id stopIndex__Key; #endif // _GSWebConstants_h__ diff --git a/GSWeb.framework/GSWConstants.m b/GSWeb.framework/GSWConstants.m index 314e477..2c76a11 100644 --- a/GSWeb.framework/GSWConstants.m +++ b/GSWeb.framework/GSWConstants.m @@ -318,4 +318,6 @@ id imageMapString__Key = @"imageMapString"; id imageMapRegions__Key = @"imageMapRegions"; id handleValidationException__Key = @"handleValidationException"; id selectedValues__Key = @"selectedValues"; +id startIndex__Key = @"startIndex"; +id stopIndex__Key = @"stopIndex"; diff --git a/GSWeb.framework/GSWContext.m b/GSWeb.framework/GSWContext.m index 58934bb..1917f4b 100644 --- a/GSWeb.framework/GSWContext.m +++ b/GSWeb.framework/GSWContext.m @@ -133,7 +133,7 @@ static int dontTraceComponentActionURL=0; ASSIGN(clone->_pageComponent,_pageComponent); ASSIGN(clone->_currentComponent,_currentComponent); ASSIGNCOPY(clone->_url,_url); - ASSIGNCOPY(clone->_awakePageComponents,_awakePageComponents); + ASSIGN(clone->_awakePageComponents,_awakePageComponents); clone->_urlApplicationNumber=_urlApplicationNumber; clone->_isClientComponentRequest=_isClientComponentRequest; clone->_distributionEnabled=_distributionEnabled; diff --git a/GSWeb.framework/GSWDebug.h b/GSWeb.framework/GSWDebug.h index 7a3ecf6..aeb002b 100644 --- a/GSWeb.framework/GSWDebug.h +++ b/GSWeb.framework/GSWDebug.h @@ -27,6 +27,7 @@ #define _GSWebDebug_h__ #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 GSWLogDumpObjectFn(CONST char* file,int line,id object,int deep); 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 #ifdef GSWDEBUG + #define LOGClassFnStart() \ do { if (GSDebugSet(@"GSWebFn") == YES) { \ NSString *fmt = GSDebugFunctionMsg(__PRETTY_FUNCTION__, __FILE__, __LINE__,@"FNSTART"); \ @@ -111,47 +113,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define LOGObjectFnStart() \ 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) #define LOGObjectFnStop() \ 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) #define LOGObjectFnStartC(comment) \ 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) #define LOGObjectFnStopC(comment) \ 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) #define LOGObjectFnStartCond(cond) \ 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) #define LOGObjectFnStopCond(cond) \ 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) #define LOGObjectFnStartCondC(cond,comment) \ 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) #define LOGObjectFnStopCondC(cond,comment) \ 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) #define LOGObjectFnNotImplemented() \ 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) #define LOGClassFnNotImplemented() \ @@ -202,25 +204,25 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define NSDebugMLLogCond(cond, level, format, args...) \ do { if (cond && GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugMLogCond(cond, format, args...) \ do { if (cond && GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugMLog0(format) \ do { if (GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) #define NSDebugMLLog0(level,format) \ do { if (GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) @@ -313,47 +315,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define LOGDEEPObjectFnStart() \ 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) #define LOGDEEPObjectFnStop() \ 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) #define LOGDEEPObjectFnStartC(comment) \ 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) #define LOGDEEPObjectFnStopC(comment) \ 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) #define LOGDEEPObjectFnStartCond(cond) \ 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) #define LOGDEEPObjectFnStopCond(cond) \ 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) #define LOGDEEPObjectFnStartCondC(cond,comment) \ 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) #define LOGDEEPObjectFnStopCondC(cond,comment) \ 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) #define LOGDEEPObjectFnNotImplemented() \ 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) #define LOGDEEPClassFnNotImplemented() \ @@ -404,37 +406,37 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define NSDebugDeepMLLogCond(cond, level, format, args...) \ do { if (cond && GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugDeepMLog(format, args...) \ do { if (GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugDeepMLLog(level, format, args...) \ do { if (GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugDeepMLogCond(cond, format, args...) \ do { if (cond && GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugDeepMLog0(format) \ do { if (GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) #define NSDebugDeepMLLog0(level,format) \ do { if (GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) @@ -529,47 +531,47 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define LOGLOCKObjectFnStart() \ 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) #define LOGLOCKObjectFnStop() \ 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) #define LOGLOCKObjectFnStartC(comment) \ 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) #define LOGLOCKObjectFnStopC(comment) \ 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) #define LOGLOCKObjectFnStartCond(cond) \ 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) #define LOGLOCKObjectFnStopCond(cond) \ 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) #define LOGLOCKObjectFnStartCondC(cond,comment) \ 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) #define LOGLOCKObjectFnStopCondC(cond,comment) \ 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) #define LOGLOCKObjectFnNotImplemented() \ 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) #define LOGLOCKClassFnNotImplemented() \ @@ -620,37 +622,37 @@ extern void GSWLogAssertGoodFn(CONST char* file,int line,NSObject* object); #define NSDebugLockMLLogCond(cond, level, format, args...) \ do { if (cond && GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugLockMLLog(level, format, args...) \ do { if (GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugLockMLogCond(cond, format, args...) \ do { if (cond && GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugLockMLog(format, args...) \ do { if (GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt, ## args); }} while (0) #define NSDebugLockMLog0(format) \ do { if (GSDebugSet(@"dflt") == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) #define NSDebugLockMLLog0(level,format) \ do { if (GSDebugSet(level) == YES) { \ - NSString *fmt = GSDebugMethodMsg( \ + NSString *fmt = GSWDebugMethodMsg( \ self, _cmd, __FILE__, __LINE__, format); \ NSLog(fmt); }} while (0) diff --git a/GSWeb.framework/GSWDebug.m b/GSWeb.framework/GSWDebug.m index e0f831a..d3dd889 100644 --- a/GSWeb.framework/GSWDebug.m +++ b/GSWeb.framework/GSWDebug.m @@ -50,6 +50,22 @@ static char rcsId[] = "$Id$"; @end #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) { diff --git a/GSWeb.framework/GSWHyperlink.m b/GSWeb.framework/GSWHyperlink.m index 60db01f..6552575 100644 --- a/GSWeb.framework/GSWHyperlink.m +++ b/GSWeb.framework/GSWHyperlink.m @@ -513,17 +513,37 @@ static char rcsId[] = "$Id$"; //TODOV if (_otherQueryAssociations) { - NSEnumerator *enumerator = [_otherAssociations keyEnumerator]; + NSEnumerator *enumerator = [_otherQueryAssociations keyEnumerator]; id oaKey=nil; while ((oaKey = [enumerator nextObject])) { - id oaValue=[[_otherAssociations objectForKey:oaKey] valueInComponent:component]; + id oaValue=[[_otherQueryAssociations objectForKey:oaKey] valueInComponent:component]; if (!oaValue) oaValue=[NSString string]; [queryDictionary setObject:oaValue 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 ?? LOGObjectFnStop(); return queryDictionary; diff --git a/GSWeb.framework/GSWInput.h b/GSWeb.framework/GSWInput.h index 7f39ac1..ffb718d 100644 --- a/GSWeb.framework/GSWInput.h +++ b/GSWeb.framework/GSWInput.h @@ -60,9 +60,14 @@ //==================================================================== @interface GSWInput (GSWInputA) + +/** Return the name for html output. +If no name is binded, it return the context id **/ -(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; @end @@ -75,10 +80,24 @@ //==================================================================== @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 inContext:(GSWContext*)context; + +/** Append value property to response. +(Called by -appendGSWebObjectsAssociationsToResponse:inContext:) +**/ -(void)appendValueToResponse:(GSWResponse*)response inContext:(GSWContext*)context; + +/** Append name property to response. +name come from -nameInContext: +*/ -(void)appendNameToResponse:(GSWResponse*)response inContext:(GSWContext*)context; diff --git a/GSWeb.framework/GSWInput.m b/GSWeb.framework/GSWInput.m index 248d263..d60385e 100644 --- a/GSWeb.framework/GSWInput.m +++ b/GSWeb.framework/GSWInput.m @@ -43,8 +43,9 @@ static char rcsId[] = "$Id$"; LOGObjectFnStartC("GSWInput"); NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements); [attributedAssociations removeObjectForKey:disabled__Key]; - [attributedAssociations removeObjectForKey:enabled__Key];//?? - [attributedAssociations removeObjectForKey:value__Key];//?? + [attributedAssociations removeObjectForKey:enabled__Key]; + [attributedAssociations removeObjectForKey:value__Key]; + [attributedAssociations removeObjectForKey:name__Key]; if (!WOStrictFlag) [attributedAssociations removeObjectForKey:handleValidationException__Key]; _value = [[associations objectForKey:value__Key @@ -131,50 +132,15 @@ static char rcsId[] = "$Id$"; nameValue=[context elementID]; NSDebugMLLog(@"gswdync",@"elementID=%@",[context elementID]); }; + NSDebugMLLog(@"gswdync",@"nameValue=%@",nameValue); GSWAssertIsElementID(context); LOGObjectFnStopC("GSWInput"); 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 { - //OK if (!WOStrictFlag && _enabled) return ![self evaluateCondition:_enabled inContext:context]; @@ -249,10 +215,10 @@ static int countAutoValue = 0; disabledInContext=[self disabledInContext:context]; //return 0 if (disabledInContext) [response _appendContentAsciiString:@" disabled"]; - [self appendValueToResponse:response - inContext:context]; [self appendNameToResponse:response inContext:context]; + [self appendValueToResponse:response + inContext:context]; LOGObjectFnStopC("GSWInput"); }; diff --git a/GSWeb.framework/GSWMailDelivery.h b/GSWeb.framework/GSWMailDelivery.h index 68d0387..8407e56 100644 --- a/GSWeb.framework/GSWMailDelivery.h +++ b/GSWeb.framework/GSWMailDelivery.h @@ -46,12 +46,15 @@ plainText:(NSString*)plainTextMessage send:(BOOL)sendNow; + -(NSString*)composeEmailFrom:(NSString*)sender to:(NSArray*)to cc:(NSArray*)cc subject:(NSString*)subject component:(GSWComponent*)component send:(BOOL)sendNow; + + //NDFN -(NSString*)composeEmailFrom:(NSString*)sender to:(NSArray*)to @@ -60,6 +63,9 @@ subject:(NSString*)subject plainText:(NSString*)plainTextMessage send:(BOOL)sendNow; + +//NDFN + //NDFN -(NSString*)composeEmailFrom:(NSString*)sender to:(NSArray*)to @@ -69,6 +75,7 @@ component:(GSWComponent*)component send:(BOOL)sendNow; + -(void)sendEmail:(NSString*)emailString; -(void)_invokeGSWSendMailAt:(id)at withEmail:(id)email; diff --git a/GSWeb.framework/GSWMailDelivery.m b/GSWeb.framework/GSWMailDelivery.m index bf8c067..3b37566 100644 --- a/GSWeb.framework/GSWMailDelivery.m +++ b/GSWeb.framework/GSWMailDelivery.m @@ -54,19 +54,24 @@ static GSWMailDelivery *sharedInstance; plainText:(NSString*)plainTextMessage send:(BOOL)sendNow { + NSString* emailString=nil; + LOGObjectFnStart(); NSDebugMLog(@"sender=%@",sender); NSDebugMLog(@"to=%@",to); NSDebugMLog(@"cc=%@",cc); NSDebugMLog(@"subject=%@",subject); NSDebugMLog(@"plainTextMessage=%@",plainTextMessage); NSDebugMLog(@"sendNow=%d",(int)sendNow); - return [self composeEmailFrom:sender - to:to - cc:cc - bcc:nil - subject:subject - plainText:plainTextMessage - send:sendNow]; + emailString=[self composeEmailFrom:sender + to:to + cc:cc + bcc:nil + subject:subject + plainText:plainTextMessage + send:sendNow]; + NSDebugMLog(@"emailString=%@",emailString); + LOGObjectFnStop(); + return emailString; }; -(NSString*)composeEmailFrom:(NSString*)sender @@ -76,10 +81,27 @@ static GSWMailDelivery *sharedInstance; component:(GSWComponent*)component send:(BOOL)sendNow { - LOGObjectFnNotImplemented(); //TODOFN - return nil; + NSString* emailString=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 -(NSString*)composeEmailFrom:(NSString*)sender to:(NSArray*)to @@ -93,7 +115,10 @@ static GSWMailDelivery *sharedInstance; NSMutableString* toString=nil; int i=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]; NSDebugMLog(@"sender=%@",sender); NSDebugMLog(@"to=%@",to); @@ -147,10 +172,12 @@ static GSWMailDelivery *sharedInstance; NSDebugMLog(@"messageString=%@",messageString); if (sendNow) [self sendEmail:messageString]; + LOGObjectFnStop(); return messageString; }; //NDFN +// Be carefull: this call [context _generateCompleteURLs] -(NSString*)composeEmailFrom:(NSString*)sender to:(NSArray*)to cc:(NSArray*)cc @@ -159,16 +186,107 @@ static GSWMailDelivery *sharedInstance; component:(GSWComponent*)component send:(BOOL)sendNow { - LOGObjectFnNotImplemented(); //TODOFN - return nil; +//TODO setting the content type of the email as Content-type: text/html. + 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)) [NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot create pipe", @@ -179,6 +297,7 @@ static GSWMailDelivery *sharedInstance; switch(pid = fork()) { case 0: + NSDebugMLog(@"FORK0"); close(0); dup(files[0]); close(files[0]); @@ -189,6 +308,7 @@ static GSWMailDelivery *sharedInstance; break; case -1: + NSDebugMLog(@"FORK-1"); close(files[0]); close(files[1]); [NSException raise:NSInternalInconsistencyException format:@"%@ -- %@ 0x%x: cannot fork process", @@ -198,13 +318,16 @@ static GSWMailDelivery *sharedInstance; break; default: - write(files[1], [emailString_ cString], strlen([emailString_ cString])); + NSDebugMLog(@"FORKDEF"); + write(files[1], [emailString cString], strlen([emailString cString])); close(files[0]); close(files[1]); waitpid(pid, NULL, 0); break; } + LOGObjectFnStop(); +*/ }; -(void)_invokeGSWSendMailAt:(id)at @@ -215,3 +338,4 @@ static GSWMailDelivery *sharedInstance; @end + diff --git a/GSWeb.framework/GSWPopUpButton.h b/GSWeb.framework/GSWPopUpButton.h index 5f09e80..241ea6b 100644 --- a/GSWeb.framework/GSWPopUpButton.h +++ b/GSWeb.framework/GSWPopUpButton.h @@ -46,7 +46,6 @@ GSWAssociation* _noSelectionString; GSWAssociation* _escapeHTML; //GSWeb Additions { - BOOL _autoValue; GSWAssociation* _count; GSWAssociation* _index; // } diff --git a/GSWeb.framework/GSWPopUpButton.m b/GSWeb.framework/GSWPopUpButton.m index 01ba38b..d70c385 100644 --- a/GSWeb.framework/GSWPopUpButton.m +++ b/GSWeb.framework/GSWPopUpButton.m @@ -31,6 +31,35 @@ static char rcsId[] = "$Id$"; #include +/** +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 @@ -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: ']; [response appendContentString:prefixValue]; [response appendContentHTMLString:displayStringValue]; [response appendContentString:suffixValue]; - }; - LOGObjectFnStop(); + }; + LOGObjectFnStopC("GSWRadioButtonList"); }; @end diff --git a/GSWeb.framework/GSWRepetition.h b/GSWeb.framework/GSWRepetition.h index 606e36b..567887a 100644 --- a/GSWeb.framework/GSWRepetition.h +++ b/GSWeb.framework/GSWRepetition.h @@ -42,6 +42,10 @@ GSWAssociation* _identifier; GSWAssociation* _count; 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; }; @@ -75,10 +79,12 @@ inContext:(GSWContext*)aContext; -(void)stopOneIterationWithIndex:(int)index + stopIndex:(int)stopIndex count:(int)count isLastOne:(BOOL)isLastOne inContext:(GSWContext*)aContext; -(void)startOneIterationWithIndex:(unsigned int)index + startIndex:(unsigned int)startIndex list:(NSArray*)aList inContext:(GSWContext*)aContext; @end diff --git a/GSWeb.framework/GSWRepetition.m b/GSWeb.framework/GSWRepetition.m index c727b3d..a6678b1 100644 --- a/GSWeb.framework/GSWRepetition.m +++ b/GSWeb.framework/GSWRepetition.m @@ -70,6 +70,18 @@ static char rcsId[] = "$Id$"; { 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) { _childrenGroup=[[GSWHTMLStaticGroup alloc]initWithContentElements:elements]; @@ -100,6 +112,8 @@ static char rcsId[] = "$Id$"; DESTROY(_identifier); DESTROY(_count); DESTROY(_index); + DESTROY(_startIndex); + DESTROY(_stopIndex); DESTROY(_childrenGroup); [super dealloc]; } @@ -123,31 +137,22 @@ static char rcsId[] = "$Id$"; //==================================================================== @implementation GSWRepetition (GSWRepetitionA) -//-------------------------------------------------------------------- --(void)appendToResponse:(GSWResponse*)response - inContext:(GSWContext*)context +-(void)getParameterValuesReturnList:(NSArray**)listValuePtr + count:(int*)countValuePtr + 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(); - GSWStartElement(context); - GSWSaveAppendToResponseElementID(context); - component=[context component]; NSDebugMLLog(@"gswdync",@"_list=%@",_list); if (_list) { - listValue=[_list valueInComponent:component]; - NSAssert2(!listValue || [listValue respondsToSelector:@selector(count)], + *listValuePtr=[_list valueInComponent:component]; + NSAssert2(!(*listValuePtr) || [(*listValuePtr) respondsToSelector:@selector(count)], @"The list (%@) (of class:%@) doesn't respond to 'count'", _list, - [listValue class]); - countValue=[listValue count]; + [(*listValuePtr) class]); + *countValuePtr=[(*listValuePtr) count]; }; NSDebugMLLog(@"gswdync",@"_count=%@",_count); if (_count) @@ -162,19 +167,91 @@ static char rcsId[] = "$Id$"; tmpCount=[tmpCountValue intValue]; NSDebugMLLog(@"gswdync",@"tmpCount=%d",tmpCount); if (_list) - countValue=min(tmpCount,countValue); + *countValuePtr=min(tmpCount,(*countValuePtr)); 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); [context incrementLoopLevel]; - for(i=0;icurrentIndex) { - NSDebugMLLog(@"gswdync",@"[list objectAtIndex:currentIndex]=%@",[list objectAtIndex:currentIndex]); + NSDebugMLLog(@"gswdync",@"[list objectAtIndex:%d]=%@",currentIndex,[list objectAtIndex:currentIndex]); [_item setValue:[list objectAtIndex:currentIndex] inComponent:component]; } else { @@ -513,12 +560,10 @@ static char rcsId[] = "$Id$"; } } - NSDebugMLLog(@"gswdync",@"currentIndex=%d",currentIndex); - NSDebugMLLog(@"gswdync",@"_index=%@",_index); if (_index) [_index setValue:[NSNumber numberWithShort:currentIndex] inComponent:component]; - if (currentIndex==0) + if (currentIndex==startIndex) [context appendZeroElementIDComponent]; else [context incrementLastElementIDComponent]; @@ -533,3 +578,4 @@ static char rcsId[] = "$Id$"; }; @end + diff --git a/GSWeb.framework/GSWSwitchComponent.m b/GSWeb.framework/GSWSwitchComponent.m index 1062d74..03eb8fc 100644 --- a/GSWeb.framework/GSWSwitchComponent.m +++ b/GSWeb.framework/GSWSwitchComponent.m @@ -115,6 +115,11 @@ static char rcsId[] = "$Id$"; GSWSaveAppendToResponseElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; + if ([elementNameInContext length]==0) + { + ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@", + _componentName); + }; element=[self _realComponentWithName:elementNameInContext inContext:aContext]; [element appendToResponse:response @@ -135,8 +140,13 @@ static char rcsId[] = "$Id$"; GSWAssertCorrectElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; + if ([elementNameInContext length]==0) + { + ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@", + _componentName); + }; element=[self _realComponentWithName:elementNameInContext - inContext:aContext]; + inContext:aContext]; resultElement=[element invokeActionForRequest:request inContext:aContext]; [aContext deleteLastElementIDComponent]; @@ -155,6 +165,11 @@ static char rcsId[] = "$Id$"; GSWAssertCorrectElementID(aContext); elementNameInContext=[self _elementNameInContext:aContext]; [aContext appendElementIDComponent:elementNameInContext]; + if ([elementNameInContext length]==0) + { + ExceptionRaise(@"GSWSwitchComponent",@"ComponentName Value is null ! componentName: %@", + _componentName); + }; element=[self _realComponentWithName:elementNameInContext inContext:aContext]; [element takeValuesFromRequest:aRequest @@ -177,9 +192,10 @@ if the component has already been created, it get it from the cache; otherwise, component=[aContext component]; NSDebugMLLog(@"gswdync",@"GSWSwitchComponent %p (defName=%@): componentName=%@ 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 { diff --git a/GSWeb.framework/GSWTemplateParser.h b/GSWeb.framework/GSWTemplateParser.h index 1df45cf..a432d0f 100644 --- a/GSWeb.framework/GSWTemplateParser.h +++ b/GSWeb.framework/GSWTemplateParser.h @@ -54,9 +54,11 @@ typedef enum _GSWTemplateParserType NSString* _stringPath; NSString* _definitionsString; NSArray* _languages; - NSMutableSet* _definitionFilePath; + NSString* _definitionFilePath; + NSMutableSet* _processedDefinitionFilePaths; GSWElement* _template; NSDictionary* _definitions; + NSMutableArray* _errorMessages; /** Template/definition errors. If non empty, raise an exception **/ int gswebTagN; int tagN; } @@ -93,6 +95,12 @@ typedef enum _GSWTemplateParserType forLanguages:(NSArray*)someLanguages; -(void)dealloc; -(NSString*)logPrefix; +-(void)addErrorMessage:(NSString*)errorMessage; +-(void)addErrorMessageFormat:(NSString*)format + arguments:(va_list)arguments; +-(void)addErrorMessageFormat:(NSString*)format,...; +-(NSMutableArray*)errorMessages; +-(NSString*)errorMessagesAsText; -(GSWElement*)template; -(NSArray*)templateElements; -(NSDictionary*)definitions; diff --git a/GSWeb.framework/GSWTemplateParser.m b/GSWeb.framework/GSWTemplateParser.m index 5f872dd..b0a422d 100644 --- a/GSWeb.framework/GSWTemplateParser.m +++ b/GSWeb.framework/GSWTemplateParser.m @@ -207,8 +207,10 @@ static char rcsId[] = "$Id$"; DESTROY(_definitionsString); DESTROY(_languages); DESTROY(_definitionFilePath); + DESTROY(_processedDefinitionFilePaths); DESTROY(_template); DESTROY(_definitions); + DESTROY(_errorMessages); [super dealloc]; }; @@ -221,6 +223,47 @@ static char rcsId[] = "$Id$"; _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 { @@ -320,11 +363,12 @@ static char rcsId[] = "$Id$"; } else { - NSMutableSet* processedFiles=[NSMutableSet setWithObject:_definitionFilePath]; + DESTROY(_processedDefinitionFilePaths); + ASSIGN(_processedDefinitionFilePaths,[NSMutableSet setWithObject:_definitionFilePath]); NSDictionary* tmpDefinitions=[self parseDefinitionsString:_definitionsString named:_templateName inFrameworkNamed:_frameworkName - processedFiles:processedFiles]; + processedFiles:_processedDefinitionFilePaths]; if (tmpDefinitions) ASSIGN(_definitions,[NSDictionary dictionaryWithDictionary:tmpDefinitions]); }; diff --git a/GSWeb.framework/GSWTemplateParserXML.m b/GSWeb.framework/GSWTemplateParserXML.m index e2b30d3..9cd9c0f 100644 --- a/GSWeb.framework/GSWTemplateParserXML.m +++ b/GSWeb.framework/GSWTemplateParserXML.m @@ -825,7 +825,16 @@ static NSString* TabsForLevel(int level) { gswebTagN=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 { @@ -958,16 +967,12 @@ text [Type:XML_TEXT_NODE] [{}] #### { // allow null name tags elem=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]; -/* ExceptionRaise(@"GSWTemplateParser", - @"%@ No element name for gsweb tag (%@) [#%d,#%d]", - [self logPrefix], - nodeName, - currentGSWebTagN, - currentTagN); -*/ } else { + NSDictionary* _associations=nil; + NSString* className=nil; + GSWHTMLStaticGroup* aStaticGroup=nil; definitionsElement=[_definitions objectForKey:nodeNameAttribute]; NSDebugMLLog(@"GSWTemplateParser",@"definitionsElement:[%@]", definitionsElement); @@ -975,79 +980,76 @@ text [Type:XML_TEXT_NODE] [{}] #### definitionsElement); if (!definitionsElement) { - ExceptionRaise(@"GSWTemplateParser", - @"%@ No element definition for tag named:%@ [#%d,#%d]", - [self logPrefix], - nodeNameAttribute, - currentGSWebTagN, - currentTagN); + // We don't raise exception know because it's better for developper to collect and report all errors before :-) + [self addErrorMessageFormat:@"No element definition for tag named:%@ [#%d,#%d]", + nodeNameAttribute, + currentGSWebTagN, + currentTagN]; } else { - NSDictionary* _associations=[definitionsElement associations]; - NSString* className=[definitionsElement className]; + _associations=[definitionsElement associations]; + className=[definitionsElement className]; NSDebugMLLog(@"GSWTemplateParser",@"node=%p GSWeb Tag className:[%@]",currentNode,className); if (!className) { - ExceptionRaise(@"GSWTemplateParser", - @"%@No class name in page definition for tag named:%@ definitionsElement=%@ [#%d,#%d]", - [self logPrefix], - nodeNameAttribute, - definitionsElement, - currentGSWebTagN, - currentTagN); - } - else - { - GSWHTMLStaticGroup* aStaticGroup=nil; - NSDebugMLLog(@"GSWTemplateParser",@"node=%p associations:%@",currentNode,_associations); + // We don't raise exception know because it's better for developper to collect and report all errors before :-) + [self addErrorMessageFormat:@"No class name in page definition for tag named:%@ definitionsElement=%@ [#%d,#%d]", + nodeNameAttribute, + definitionsElement, + currentGSWebTagN, + currentTagN]; + }; + }; + // No class name mean we'll raise an exception after so don't care about this part... + if (className) // + { + NSDebugMLLog(@"GSWTemplateParser",@"node=%p associations:%@",currentNode,_associations); + { + NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator]; + id _tagAttrKey=nil; + id _tagAttrValue=nil; + NSMutableDictionary* _addedAssoc=nil; + while ((_tagAttrKey = [_nodeAttributesEnum nextObject])) { - NSEnumerator* _nodeAttributesEnum = [nodeAttributes keyEnumerator]; - id _tagAttrKey=nil; - id _tagAttrValue=nil; - NSMutableDictionary* _addedAssoc=nil; - while ((_tagAttrKey = [_nodeAttributesEnum nextObject])) + if (![_tagAttrKey isEqualToString:@"name"] && ![_associations objectForKey:_tagAttrKey]) { - if (![_tagAttrKey isEqualToString:@"name"] && ![_associations objectForKey:_tagAttrKey]) - { - if (!_addedAssoc) - _addedAssoc=(NSMutableDictionary*)[NSMutableDictionary dictionary]; - _tagAttrValue=[nodeAttributes objectForKey:_tagAttrKey]; + if (!_addedAssoc) + _addedAssoc=(NSMutableDictionary*)[NSMutableDictionary dictionary]; + _tagAttrValue=[nodeAttributes objectForKey:_tagAttrKey]; [_addedAssoc setObject:[GSWAssociation associationWithValue:_tagAttrValue] forKey:_tagAttrKey]; - }; - }; - if (_addedAssoc) - { - _associations=[_associations dictionaryByAddingEntriesFromDictionary:_addedAssoc]; }; }; - NSDebugMLLog(@"GSWTemplateParser",@"node=%p gsweb name=%@ dynamicElementWithName: children=%@", - currentNode, - nodeNameAttribute, - children); - NSDebugMLLog(@"GSWTemplateParser",@"node=%p %@ [Type:%@] [%@] ##%s##\n", - currentNode, - [currentNode name], - [currentNode typeDescription], - [currentNode propertiesAsDictionaryWithKeyTransformationSel:NULL], - [[currentNode content] lossyCString]); - aStaticGroup=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]; - elem=[GSWApp dynamicElementWithName:className - associations:_associations - template:aStaticGroup - languages:_languages]; - NSDebugMLLog(@"GSWTemplateParser",@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup); - if (elem) - [elem setDefinitionName:[definitionsElement elementName]]; - else - { - ExceptionRaise(@"GSWTemplateParser", - @"%@ Creation failed for element named:%@ className:%@", - [self logPrefix], - [definitionsElement elementName], - className); - }; + if (_addedAssoc) + { + _associations=[_associations dictionaryByAddingEntriesFromDictionary:_addedAssoc]; + }; + }; + NSDebugMLLog(@"GSWTemplateParser",@"node=%p gsweb name=%@ dynamicElementWithName: children=%@", + currentNode, + nodeNameAttribute, + children); + NSDebugMLLog(@"GSWTemplateParser",@"node=%p %@ [Type:%@] [%@] ##%s##\n", + currentNode, + [currentNode name], + [currentNode typeDescription], + [currentNode propertiesAsDictionaryWithKeyTransformationSel:NULL], + [[currentNode content] lossyCString]); + aStaticGroup=[[[GSWHTMLStaticGroup alloc]initWithContentElements:children]autorelease]; + elem=[GSWApp dynamicElementWithName:className + associations:_associations + template:aStaticGroup + languages:_languages]; + NSDebugMLLog(@"GSWTemplateParser",@"node=%p element=%@ StaticGroup %p=%@",currentNode,elem,aStaticGroup,aStaticGroup); + if (elem) + [elem setDefinitionName:[definitionsElement elementName]]; + else + { + // We don't raise exception know because it's better for developper to collect and report all errors before :-) + [self addErrorMessageFormat:@"Creation failed for element named:%@ className:%@", + [definitionsElement elementName], + className]; }; }; }; diff --git a/GSWeb.framework/GSWTextField.m b/GSWeb.framework/GSWTextField.m index 218ce35..5e11f49 100644 --- a/GSWeb.framework/GSWTextField.m +++ b/GSWeb.framework/GSWTextField.m @@ -182,21 +182,23 @@ static char rcsId[] = "$Id$"; inContext:(GSWContext*)context { //OK + LOGObjectFnStartC("GSWTextField"); + //Does nothing special + [super appendGSWebObjectsAssociationsToResponse:response + inContext:context]; + LOGObjectFnStopC("GSWTextField"); +}; + +//-------------------------------------------------------------------- +-(void)appendValueToResponse:(GSWResponse*)response + inContext:(GSWContext*)context +{ id valueValue=nil; id formattedValue=nil; NSFormatter* formatter=nil; GSWComponent* component=nil; - id valueTmp=nil; LOGObjectFnStartC("GSWTextField"); 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]; formatter=[self formatterForComponent:component]; if (!formatter) diff --git a/Testing/DynamicElements/BasePage.h b/Testing/DynamicElements/BasePage.h new file mode 100644 index 0000000..f2589cb --- /dev/null +++ b/Testing/DynamicElements/BasePage.h @@ -0,0 +1,40 @@ +/** BasePage.h - GSWeb Testing: Class BasePage + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _BasePage_h__ + #define _BasePage_h__ + +@interface BasePage: GSWComponent +{ +} +@end + +#endif //_BasePage_h__ diff --git a/Testing/DynamicElements/BasePage.m b/Testing/DynamicElements/BasePage.m new file mode 100644 index 0000000..398cedb --- /dev/null +++ b/Testing/DynamicElements/BasePage.m @@ -0,0 +1,43 @@ +/** BasePage.m - GSWeb Testing: Class BasePage + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" + + +@implementation BasePage + +-(GSWComponent*)submitAction +{ + return nil; +}; +@end + diff --git a/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.gswd b/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.gswd new file mode 100644 index 0000000..738746a --- /dev/null +++ b/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.html b/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.html new file mode 100644 index 0000000..79020d1 --- /dev/null +++ b/Testing/DynamicElements/Browser1Page.gswc/Browser1Page.html @@ -0,0 +1,18 @@ + + +GSWBrowser Test 1 + + +

GSWBrowser Test 1 (With value)

+
+Selected items :
+Selected item values :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/Browser1Page.h b/Testing/DynamicElements/Browser1Page.h new file mode 100644 index 0000000..5237427 --- /dev/null +++ b/Testing/DynamicElements/Browser1Page.h @@ -0,0 +1,43 @@ +/** Browser1Page.h - GSWeb Testing: Class Browser1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _Browser1Page_h__ + #define _Browser1Page_h__ + +@interface Browser1Page: BasePage +{ + id anItem; + id selectedItems; + id selectedValues; +} +@end + +#endif //_Browser1Page_h__ diff --git a/Testing/DynamicElements/Browser1Page.m b/Testing/DynamicElements/Browser1Page.m new file mode 100644 index 0000000..c795bbe --- /dev/null +++ b/Testing/DynamicElements/Browser1Page.m @@ -0,0 +1,40 @@ +/** Browser1Page.m - GSWeb Testing: Class Browser1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "Browser1Page.h" + + +@implementation Browser1Page + +@end + diff --git a/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.gswd b/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.gswd new file mode 100644 index 0000000..2615ea0 --- /dev/null +++ b/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.html b/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.html new file mode 100644 index 0000000..41d362e --- /dev/null +++ b/Testing/DynamicElements/Browser2Page.gswc/Browser2Page.html @@ -0,0 +1,18 @@ + + +GSWBrowser Test 2 + + +

GSWBrowser Test 2 (Without value: AutoValue)

+
+Selected items :
+Selected item values :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/Browser2Page.h b/Testing/DynamicElements/Browser2Page.h new file mode 100644 index 0000000..1a53f83 --- /dev/null +++ b/Testing/DynamicElements/Browser2Page.h @@ -0,0 +1,43 @@ +/** Browser2Page.h - GSWeb Testing: Class Browser2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _Browser2Page_h__ + #define _Browser2Page_h__ + +@interface Browser2Page: BasePage +{ + id anItem; + id selectedItems; + id selectedValues; +} +@end + +#endif //_Browser2Page_h__ diff --git a/Testing/DynamicElements/Browser2Page.m b/Testing/DynamicElements/Browser2Page.m new file mode 100644 index 0000000..58e9c1b --- /dev/null +++ b/Testing/DynamicElements/Browser2Page.m @@ -0,0 +1,40 @@ +/** Browser2Page.m - GSWeb Testing: Class Browser2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "Browser2Page.h" + + +@implementation Browser2Page + +@end + diff --git a/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.gswd b/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.gswd new file mode 100644 index 0000000..79262d3 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.html b/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.html new file mode 100644 index 0000000..9319ebc --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.gswc/CheckBoxList1Page.html @@ -0,0 +1,17 @@ + + +GSWCheckBoxList Test 1 + + +

GSWCheckBoxList Test 1 (With value)

+
+Selected items :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.gswd b/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.gswd new file mode 100644 index 0000000..ef1e88e --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.html b/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.html new file mode 100644 index 0000000..0aeb728 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.gswc/RadioButtonList1Page.html @@ -0,0 +1,17 @@ + + +GSWRadioButtonList Test 1 + + +

GSWRadioButtonList Test 1 (With value)

+
+Selected item :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/CheckBoxList1Page.h b/Testing/DynamicElements/CheckBoxList1Page.h new file mode 100644 index 0000000..2c45228 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.h @@ -0,0 +1,42 @@ +/** CheckBoxList1Page.h - GSWeb Testing: Class CheckBoxList1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _CheckBoxList1Page_h__ + #define _CheckBoxList1Page_h__ + +@interface CheckBoxList1Page: BasePage +{ + id anItem; + id selectedItems; +} +@end + +#endif //_RadioButtonList1Page_h__ diff --git a/Testing/DynamicElements/CheckBoxList1Page.m b/Testing/DynamicElements/CheckBoxList1Page.m new file mode 100644 index 0000000..6b5f35f --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList1Page.m @@ -0,0 +1,40 @@ +/** CheckBoxList1Page.m - GSWeb Testing: Class CheckBoxList1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "CheckBoxList1Page.h" + + +@implementation CheckBoxList1Page + +@end + diff --git a/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.gswd b/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.gswd new file mode 100644 index 0000000..4378657 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.html b/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.html new file mode 100644 index 0000000..d7f75fa --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.gswc/CheckBoxList2Page.html @@ -0,0 +1,17 @@ + + +GSWCheckBoxList Test 2 + + +

GSWCheckBoxList Test 2 (Without value: AutoValue)

+
+Selected items :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.gswd b/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.gswd new file mode 100644 index 0000000..06ac99e --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.gswd @@ -0,0 +1,15 @@ +#include "Base" + +ARadioButtonList: GSWRadioButtonList +{ + list = application.bundleInfo.RadioButtonList.list; + item = anItem; + displayString = anItem.label; + selection = selectedItem; +}; + +SelectedItem: GSWString +{ + value = selectedItem; +}; + diff --git a/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.html b/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.html new file mode 100644 index 0000000..07dffdf --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.gswc/RadioButtonList2Page.html @@ -0,0 +1,17 @@ + + +GSWRadioButtonList Test 1 + + +

GSWRadioButtonList Test 2 (Without value: AutoValue)

+
+Selected item :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/CheckBoxList2Page.h b/Testing/DynamicElements/CheckBoxList2Page.h new file mode 100644 index 0000000..f555023 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.h @@ -0,0 +1,42 @@ +/** CheckBoxList2Page.h - GSWeb Testing: Class CheckBoxList2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _CheckBoxList2Page_h__ + #define _CheckBoxList2Page_h__ + +@interface CheckBoxList2Page: BasePage +{ + id anItem; + id selectedItems; +} +@end + +#endif //_CheckBoxList2Page_h__ diff --git a/Testing/DynamicElements/CheckBoxList2Page.m b/Testing/DynamicElements/CheckBoxList2Page.m new file mode 100644 index 0000000..3dea062 --- /dev/null +++ b/Testing/DynamicElements/CheckBoxList2Page.m @@ -0,0 +1,40 @@ +/** CheckBoxList2Page.m - GSWeb Testing: Class CheckBoxList2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "CheckBoxList2Page.h" + + +@implementation CheckBoxList2Page + +@end + diff --git a/Testing/DynamicElements/DynamicElements.h b/Testing/DynamicElements/DynamicElements.h new file mode 100644 index 0000000..26572c9 --- /dev/null +++ b/Testing/DynamicElements/DynamicElements.h @@ -0,0 +1,3 @@ +//==================================================================== +@interface DynamicElements : GSWApplication +@end diff --git a/Testing/DynamicElements/DynamicElements.m b/Testing/DynamicElements/DynamicElements.m new file mode 100644 index 0000000..638f512 --- /dev/null +++ b/Testing/DynamicElements/DynamicElements.m @@ -0,0 +1,12 @@ +#import +#include "DynamicElements.h" + +@implementation DynamicElements +@end + +@interface Session: GSWSession +@end + +@implementation Session +@end + diff --git a/Testing/DynamicElements/DynamicElements_main.m b/Testing/DynamicElements/DynamicElements_main.m new file mode 100644 index 0000000..42be8b3 --- /dev/null +++ b/Testing/DynamicElements/DynamicElements_main.m @@ -0,0 +1,10 @@ +#import + +int main(int argc, const char *argv[]) +{ + int ret=0; + NSAutoreleasePool *arp = [NSAutoreleasePool new]; + ret=GSWApplicationMain(@"DynamicElements", argc, argv); + [arp release]; + return ret; +} diff --git a/Testing/DynamicElements/GNUmakefile b/Testing/DynamicElements/GNUmakefile new file mode 100644 index 0000000..e737975 --- /dev/null +++ b/Testing/DynamicElements/GNUmakefile @@ -0,0 +1,83 @@ +# +# Dynamic Elements Testing makefile for the GNUstepWeb +# +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# Written by: Manuel Guesdon +# +# 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 diff --git a/Testing/DynamicElements/INSTALL b/Testing/DynamicElements/INSTALL new file mode 100644 index 0000000..bf7d655 --- /dev/null +++ b/Testing/DynamicElements/INSTALL @@ -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 + diff --git a/Testing/DynamicElements/Main.gswc/Main.gswd b/Testing/DynamicElements/Main.gswc/Main.gswd new file mode 100644 index 0000000..46ca124 --- /dev/null +++ b/Testing/DynamicElements/Main.gswc/Main.gswd @@ -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; +}; diff --git a/Testing/DynamicElements/Main.gswc/Main.html b/Testing/DynamicElements/Main.gswc/Main.html new file mode 100644 index 0000000..32d4690 --- /dev/null +++ b/Testing/DynamicElements/Main.gswc/Main.html @@ -0,0 +1,13 @@ + + + GNUstepWeb Dynamic Elements Testing + + +

GNUstepWeb Dynamic Elements Testing

+
    + +
  • +
    +
+ + diff --git a/Testing/DynamicElements/Main.h b/Testing/DynamicElements/Main.h new file mode 100644 index 0000000..e8178ab --- /dev/null +++ b/Testing/DynamicElements/Main.h @@ -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 + +@interface Main: GSWComponent +{ + id tmpDynamicElement; +} + +@end diff --git a/Testing/DynamicElements/Main.m b/Testing/DynamicElements/Main.m new file mode 100644 index 0000000..22c6d1b --- /dev/null +++ b/Testing/DynamicElements/Main.m @@ -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 diff --git a/Testing/DynamicElements/Makefile.postamble b/Testing/DynamicElements/Makefile.postamble new file mode 100644 index 0000000..a97bf5b --- /dev/null +++ b/Testing/DynamicElements/Makefile.postamble @@ -0,0 +1,71 @@ +# Makefile.postamble +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# Written by: Manuel Guesdon +# 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) diff --git a/Testing/DynamicElements/Makefile.preamble b/Testing/DynamicElements/Makefile.preamble new file mode 100644 index 0000000..7a4e988 --- /dev/null +++ b/Testing/DynamicElements/Makefile.preamble @@ -0,0 +1,77 @@ +# Copyright (C) 2002 Free Software Foundation, Inc. +# +# Written by: Manuel Guesdon +# 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 = diff --git a/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.gswd b/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.gswd new file mode 100644 index 0000000..fc14120 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.html b/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.html new file mode 100644 index 0000000..7dd7442 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton1Page.gswc/PopUpButton1Page.html @@ -0,0 +1,18 @@ + + +GSWPopUpButton Test 1 + + +

GSWPopUpButton Test 1 (With value)

+
+Selected item :
+Selected value :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/PopUpButton1Page.h b/Testing/DynamicElements/PopUpButton1Page.h new file mode 100644 index 0000000..940f5d6 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton1Page.h @@ -0,0 +1,43 @@ +/** PopUpButton1Page.h - GSWeb Testing: Class PopUpButton1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _PopUpButton1Page_h__ + #define _PopUpButton1Page_h__ + +@interface PopUpButton1Page: BasePage +{ + id anItem; + id selectedItem; + id selectedValue; +} +@end + +#endif //_PopUpButton1Page_h__ diff --git a/Testing/DynamicElements/PopUpButton1Page.m b/Testing/DynamicElements/PopUpButton1Page.m new file mode 100644 index 0000000..1b03bc3 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton1Page.m @@ -0,0 +1,40 @@ +/** PopUpButton1Page.m - GSWeb Testing: Class PopUpButton1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "PopUpButton1Page.h" + + +@implementation PopUpButton1Page + +@end + diff --git a/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.gswd b/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.gswd new file mode 100644 index 0000000..bf4bb79 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.html b/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.html new file mode 100644 index 0000000..ac3f333 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton2Page.gswc/PopUpButton2Page.html @@ -0,0 +1,18 @@ + + +GSWPopUpButton Test 2 + + +

GSWPopUpButton Test 2 (Without value: AutoValue)

+
+Selected item :
+Selected value :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/PopUpButton2Page.h b/Testing/DynamicElements/PopUpButton2Page.h new file mode 100644 index 0000000..0648b8a --- /dev/null +++ b/Testing/DynamicElements/PopUpButton2Page.h @@ -0,0 +1,43 @@ +/** PopUpButton2Page.h - GSWeb Testing: Class PopUpButton2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _PopUpButton2Page_h__ + #define _PopUpButton2Page_h__ + +@interface PopUpButton2Page: BasePage +{ + id anItem; + id selectedItem; + id selectedValue; +} +@end + +#endif //_PopUpButton2Page_h__ diff --git a/Testing/DynamicElements/PopUpButton2Page.m b/Testing/DynamicElements/PopUpButton2Page.m new file mode 100644 index 0000000..6489d03 --- /dev/null +++ b/Testing/DynamicElements/PopUpButton2Page.m @@ -0,0 +1,40 @@ +/** PopUpButton2Page.m - GSWeb Testing: Class PopUpButton2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "PopUpButton2Page.h" + + +@implementation PopUpButton2Page + +@end + diff --git a/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.gswd b/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.gswd new file mode 100644 index 0000000..cc41411 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.html b/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.html new file mode 100644 index 0000000..0aeb728 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList1Page.gswc/RadioButtonList1Page.html @@ -0,0 +1,17 @@ + + +GSWRadioButtonList Test 1 + + +

GSWRadioButtonList Test 1 (With value)

+
+Selected item :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/RadioButtonList1Page.h b/Testing/DynamicElements/RadioButtonList1Page.h new file mode 100644 index 0000000..df6f9f9 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList1Page.h @@ -0,0 +1,42 @@ +/** RadioButtonList1Page.h - GSWeb Testing: Class RadioButtonList1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _RadioButtonList1Page_h__ + #define _RadioButtonList1Page_h__ + +@interface RadioButtonList1Page: BasePage +{ + id anItem; + id selectedItem; +} +@end + +#endif //_RadioButtonList1Page_h__ diff --git a/Testing/DynamicElements/RadioButtonList1Page.m b/Testing/DynamicElements/RadioButtonList1Page.m new file mode 100644 index 0000000..9680c0d --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList1Page.m @@ -0,0 +1,40 @@ +/** RadioButtonList1Page.m - GSWeb Testing: Class RadioButtonList1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "RadioButtonList1Page.h" + + +@implementation RadioButtonList1Page + +@end + diff --git a/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.gswd b/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.gswd new file mode 100644 index 0000000..5f33023 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.gswd @@ -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; +}; + diff --git a/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.html b/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.html new file mode 100644 index 0000000..9bf5498 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList2Page.gswc/RadioButtonList2Page.html @@ -0,0 +1,17 @@ + + +GSWRadioButtonList Test 2 + + +

GSWRadioButtonList Test 2 (Without value: AutoValue)

+
+Selected item :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/RadioButtonList2Page.h b/Testing/DynamicElements/RadioButtonList2Page.h new file mode 100644 index 0000000..2726b03 --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList2Page.h @@ -0,0 +1,42 @@ +/** RadioButtonList2Page.h - GSWeb Testing: Class RadioButtonList2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _RadioButtonList2Page_h__ + #define _RadioButtonList2Page_h__ + +@interface RadioButtonList2Page: BasePage +{ + id anItem; + id selectedItem; +} +@end + +#endif //_RadioButtonList2Page_h__ diff --git a/Testing/DynamicElements/RadioButtonList2Page.m b/Testing/DynamicElements/RadioButtonList2Page.m new file mode 100644 index 0000000..d6dfadb --- /dev/null +++ b/Testing/DynamicElements/RadioButtonList2Page.m @@ -0,0 +1,40 @@ +/** RadioButtonList2Page.m - GSWeb Testing: Class RadioButtonList2Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "RadioButtonList2Page.h" + + +@implementation RadioButtonList2Page + +@end + diff --git a/Testing/DynamicElements/Resources/Base.gswd b/Testing/DynamicElements/Resources/Base.gswd new file mode 100644 index 0000000..fcf0537 --- /dev/null +++ b/Testing/DynamicElements/Resources/Base.gswd @@ -0,0 +1,17 @@ +MainPageLink: GSWHyperlink +{ + pageName = "Main"; + string = "Main Page"; +}; + +Form: GSWForm +{ + enctype = "multipart/form-data"; +}; + +SubmitButton: GSWSubmitButton +{ + action = submitAction; + value = "Submit"; +}; + diff --git a/Testing/DynamicElements/Resources/Info-DynamicElements.plist b/Testing/DynamicElements/Resources/Info-DynamicElements.plist new file mode 100644 index 0000000..5e10099 --- /dev/null +++ b/Testing/DynamicElements/Resources/Info-DynamicElements.plist @@ -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"; + } + ); + }; diff --git a/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.gswd b/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.gswd new file mode 100644 index 0000000..72f014e --- /dev/null +++ b/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.gswd @@ -0,0 +1,12 @@ +#include "Base" + +ATextField: GSWTextField +{ + value = aString; +}; + +EnteredString: GSWString +{ + value = aString; +}; + diff --git a/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.html b/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.html new file mode 100644 index 0000000..437b83c --- /dev/null +++ b/Testing/DynamicElements/TextField1Page.gswc/TextField1Page.html @@ -0,0 +1,17 @@ + + +GSWTextField Test 1 + + +

GSWTextField Test 1

+
+Entered String :
+
+ + + + +
+ + + \ No newline at end of file diff --git a/Testing/DynamicElements/TextField1Page.h b/Testing/DynamicElements/TextField1Page.h new file mode 100644 index 0000000..2390ee4 --- /dev/null +++ b/Testing/DynamicElements/TextField1Page.h @@ -0,0 +1,41 @@ +/** TextField1Page.h - GSWeb Testing: Class TextField1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +// $Id$ + +#ifndef _TextField1Page_h__ + #define _TextField1Page_h__ + +@interface TextField1Page: BasePage +{ + id aString; +} +@end + +#endif //_TextField1Page_h__ diff --git a/Testing/DynamicElements/TextField1Page.m b/Testing/DynamicElements/TextField1Page.m new file mode 100644 index 0000000..75f0093 --- /dev/null +++ b/Testing/DynamicElements/TextField1Page.m @@ -0,0 +1,40 @@ +/** TextField1Page.m - GSWeb Testing: Class TextField1Page + + Copyright (C) 2002 Free Software Foundation, Inc. + + Written by: Manuel Guesdon + Date: Nov 2002 + + $Revision$ + $Date$ + + 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. + +**/ + +static char rcsId[] = "$Id$"; + +#include +#include "BasePage.h" +#include "TextField1Page.h" + + +@implementation TextField1Page + +@end +